query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
To change body of implemented methods use File | Settings | File Templates. | @Override
public void delete(Usuario usuario) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void method() {\n\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void verkaufen() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n\tpublic void doYouWantTo() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tvoid methodabstract() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}",
"@Override\n\tpublic void leti() \n\t{\n\t}",
"@Override\n\tpublic void myMethod() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void dosomething2() {\n\t\t\n\t}",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\r\n\tpublic void Method3() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void Method1() {\n\t\t\r\n\t}",
"@Override\n\tpublic void buscar() {\n\t\t\n\t}",
"public Methods() {\n // what is this doing? -PMC\n }",
"public void myPublicMethod() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void Method2() {\n\t\t\r\n\t}",
"@Override\n\tpublic void function() {\n\t\t\n\t}",
"@Override\r\n\tpublic void method1() {\n\t}",
"@Override\n\tpublic void alterar() {\n\t\t\n\t}",
"public void smell() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void method() {\n\t\tSystem.out.println(\"这是第三个实现\");\n\t}",
"@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic void voar() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"public void mo97908d() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void laught() {\n\r\n\t}",
"@Override\n\tpublic void name() {\n\t\t\n\t}",
"@Override\n\tpublic void name() {\n\t\t\n\t}",
"public void mo21825b() {\n }",
"@Override\n\tpublic void aaa() {\n\t\t\n\t}",
"@Override\n\tpublic void classroom() {\n\t\t\n\t}",
"@Override\n\tpublic void yürü() {\n\n\t}",
"public void method_202() {}",
"@Override\n\tpublic void type() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n public void salir() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo21793R() {\n }",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"public void mo55254a() {\n }",
"public void foo() {\r\n\t}",
"@Override\n\tpublic void e() {\n\n\t}",
"@Override\n\tpublic void some() {\n\t\t\n\t}",
"public void method(){}",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"@Override\n public void update() {\n }",
"void berechneFlaeche() {\n\t}",
"@Override\n\tpublic void modify() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tpublic void action() {\n\t\t\r\n\t}",
"@Override\n\tpublic void view() {\n\t\t\n\t}",
"@Override\n\tpublic void name1() {\n\t\t\n\t}",
"@Override\n public void feedingHerb() {\n\n }",
"public void mo4359a() {\n }",
"public void m23075a() {\n }",
"@Override\n public void author()\n {\n }",
"public void mo21779D() {\n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"public void mo115190b() {\n }",
"@Override\r\n\tpublic void a() {\n\t\t\r\n\t}",
"public void mo21792Q() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }"
] | [
"0.74342245",
"0.7388708",
"0.73807424",
"0.7342543",
"0.733612",
"0.73274",
"0.73048407",
"0.73048407",
"0.7288761",
"0.7263298",
"0.72240573",
"0.72240573",
"0.7185279",
"0.7173534",
"0.71181035",
"0.71084964",
"0.70798004",
"0.7044164",
"0.7011181",
"0.6997047",
"0.6988354",
"0.6974695",
"0.6933389",
"0.69078255",
"0.68886364",
"0.6873616",
"0.6863273",
"0.6860139",
"0.6849512",
"0.6844424",
"0.6835018",
"0.6806309",
"0.680564",
"0.67972124",
"0.67971444",
"0.67901814",
"0.6783107",
"0.6742863",
"0.67092294",
"0.67045176",
"0.6691299",
"0.6672521",
"0.6667701",
"0.66439843",
"0.6641542",
"0.66354257",
"0.6634153",
"0.6631264",
"0.6629309",
"0.6623261",
"0.661811",
"0.6617406",
"0.6608999",
"0.6608808",
"0.6608808",
"0.66031474",
"0.6589945",
"0.6589945",
"0.6587139",
"0.6585568",
"0.6582855",
"0.658134",
"0.65806216",
"0.6572759",
"0.65513843",
"0.6551288",
"0.6547154",
"0.6547127",
"0.65428925",
"0.653221",
"0.6527863",
"0.65270823",
"0.65270823",
"0.65270823",
"0.65235084",
"0.6516452",
"0.6515151",
"0.65133286",
"0.65131664",
"0.6512005",
"0.6511146",
"0.65110445",
"0.6508677",
"0.65022266",
"0.6498299",
"0.6495718",
"0.6493608",
"0.64926344",
"0.6488336",
"0.64852387",
"0.6485153",
"0.64781404",
"0.64741564",
"0.647411",
"0.64622664",
"0.6460401",
"0.6455523",
"0.645338",
"0.645338",
"0.645338",
"0.645338"
] | 0.0 | -1 |
Ejecutar index.html con navegador por defecto | public static void main(String[] args) throws MalformedURLException, URISyntaxException, IOException {
File file = new File("../index.html");
Desktop desktop = Desktop.getDesktop();
if (file.exists()) {
desktop.open(file);
System.out.println("Archivo abierto");
} else {
System.out.println("Archivo no existe");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic String executa(HttpServletRequest req, HttpServletResponse res) throws Exception {\n\t\treturn \"view/home.html\";\r\n\t}",
"@Override\r\n\tpublic void index() {\n\t\trender(\"index.jsp\");\r\n\t}",
"public static void main(String[] args) throws Exception {\n URL webRootLocation = MainView.class.getResource(\"/webapp/\"); //src/masin\n URI webRootUri = webRootLocation.toURI();\n\n WebAppContext context = new WebAppContext();\n context.setBaseResource(Resource.newResource(webRootUri));\n context.setContextPath(\"/\");\n context.setAttribute(\"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern\", \".*\");\n context.setConfigurationDiscovered(true);\n context.setConfigurations(new Configuration[]{\n new AnnotationConfiguration(),\n new WebInfConfiguration(),\n new WebXmlConfiguration(),\n new MetaInfConfiguration()\n });\n context.getServletContext().setExtendedListenerTypes(true);\n context.addEventListener(new ServletContextListeners());\n\n Server server = new Server(8080);\n server.setHandler(context);\n server.start();\n server.join();\n }",
"public static Result index() {\n\n String root = com.domain.root.Main.someString();\n String foo = com.domain.foo.Main.someString();\n String bar = com.domain.bar.Main.someString();\n String zee = com.domain.zee.Main.someString();\n\n return ok(index.render(\"Your new application is ready.\"));\n }",
"@RequestMapping(\"/\")\n\tpublic String main() {\n\t\treturn \"index.jsp\";\n\t}",
"protected void index()\r\n\t{\n\t}",
"public static void index() {\r\n render();\r\n }",
"public static Result index() {\n return ok(index.render(\"Welcome to the UW-La Crosse Eco Warehouse.\"));\n }",
"@Override\n\tpublic void EjecutaGui() {\n\t\tVentanaEj1 inicio = new VentanaEj1();\n\t\tinicio.setVisible(true);\n\t}",
"public static void main(String[] args) {\n\t\tJavalin app = Javalin.create(config -> {\n\t\t\t//This hosts the static html file on the server\n\t\t\tconfig.addStaticFiles(\"/\", Location.CLASSPATH);\n\t\t});\n\t\t\n\t\tControllerException ctrl = new ControllerException(new ServiceException());\n\t\tctrl.registerEndpoint(app);\n\t\t\n\t\tapp.start(8080);\n\t}",
"public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }",
"@RequestMapping(\"/\")\n\tpublic String index() {\n\t\treturn \"index.html\";\n\t}",
"public static void main(String [] args) throws IOException {\n MyIe jf=new MyIe();\n jf.getEditPanel().setPage(\"http://www.sina.com\");\n jf.getEditPanel().setEnabled(false);\n jf.getFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n jf.getFrame().setVisible(true);\n }",
"public static void main(String[] args) {\n Servidor aplicacao = new Servidor();\n aplicacao.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n aplicacao.rodaServidor();\n }",
"public Result index() {\n \t\n \treturn ok(\"rules are running... check the console\");\n \t//views.html.index.render()\n }",
"@RequestMapping(\"/\")\r\n\tpublic String index() {\r\n\t\treturn \"index.html\";\r\n\t}",
"public void home_index()\n {\n Home.index(homer);\n }",
"@GetMapping(path = \"/index\")\n\tpublic String index() {\n\t\treturn \"Welcome to Ripple Application!\";\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tNewItretor it = new NewItretor();\n\t\tit.invokeBrowser();\n\t\t\t\n\n\t}",
"public Result index() {\n return ok(views.html.index.render());\n }",
"public Result index() {\n return ok(views.html.index.render());\n }",
"public Result index() {\n return ok(views.html.index.render());\n }",
"public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}",
"@Path(\"/index\")\n public void index(){\n }",
"@GetMapping(\"/\")\n public String index()\n {\n return \"index\";\n }",
"@Override\r\n public void run() {\n ax.browserPane.setTitleAt(0,ax.browser.getTitle());\r\n String stringToken1 = null; \r\n try {\r\n stringToken1 = (\"<Navigate Home>::\" + getHome());\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n ax.consoleTextArea.setText(stringToken1);\r\n //Put the current html address in the addressbar\r\n ax.addressBar.setText(ax.browser.getCurrentLocation());\r\n \r\n }",
"public static void main(String[] args) throws IOException {\n\t\tSystem.out.println(getUrlByKey(\"登录页面\"));\n\t\t\n\t}",
"public static void main(String[] args) {\n MainController mainController = new MainController();\n mainController.showView();\n SessionManager.getSessionManager().getSession();\n }",
"@Override\n\tpublic String execute() throws Exception {\n\t\treturn \"index\";\n\t}",
"public static void main(String[] args){\n FinagoController finagoController = new FinagoController();\n finagoController.run();\n }",
"public static void main(String[] args) throws IOException, URISyntaxException {\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (Exception e) { \r\n \tSystem.out.println(\"algo no jalo\"); \t\r\n }\r\n\t\t\r\n \tHost host=new Host();\r\n \t \t \t\r\n \thttpServer = HttpServer.create(new InetSocketAddress(puerto), 0);\r\n \t\r\n \thttpServer.createContext(\"/\", new Principal());\t\t//esta es la pagina principal\r\n \thttpServer.createContext(\"/apagado\", new Apagado());\r\n \thttpServer.createContext(\"/descarga\", new Descarga());// llama a la pagina como video1.mp4\r\n \thttpServer.createContext(\"/openFileDialog\", new OpenFileDialog());\r\n \r\n \thttpServer.setExecutor(null);\r\n \thttpServer.start();\r\n \t\r\n\r\n \thost.abreLocalHost();\r\n \thost.cargaGPIO();\r\n\t}",
"public static void main(String[] args) {\n mainController controll = new mainController(\"127.0.0.1\");\n MainFrame mf = MainFrame.getInstance();\n mf.setController(controll);\n mf.setVisible(true);\n\n //메인메뉴 띄우기\n mf.changeView(Mode.MAIN);\n }",
"public Result index() {\n\t\treturn ok(views.html.index.render());\n\t}",
"public static void main(String[] args) { //type “psvm + tab” to autocreate this\n // directing the server to immediate files it should access. Just like index\n staticFileLocation(\"/public\");\n\n\n // routes as per their handlebars templates. Make sure to read and understand what they do\n get(\"/\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n return new ModelAndView(model, \"index.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animalnew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return new ModelAndView(model, \"animalForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/endangerednew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model,\"endangeredForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/sightingsnew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model,\"sightingsForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animals\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List peter = Endangered.relative_All();\n System.out.println(peter.get(0));\n model.put(\"endangered\", peter);\n return modelAndView(model, \"endangered.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/sightings\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model, \"sightings.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/saved\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List sightings = Sightings.retrieveFromSightings();\n model.put(\"sightings\", sightings);\n return new ModelAndView(model,\"sight.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/newanimal\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List animal = Animal.relative_All();\n model.put(\"animals\", animal);\n return new ModelAndView(model, \"wildlife.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animals/:id/edit\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n model.put(\"animal\", Animal.find(Integer.parseInt(request.params(\":id\"))));\n return new ModelAndView(model, \"editForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/animals/:id/delete\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n Animal.find(Integer.parseInt(request.params(\":id\"))).delete();\n response.redirect(\"/animals\");\n return null;\n }, new HandlebarsTemplateEngine());\n\n\n post(\"/animals/:id/edit\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n int id = Integer.parseInt(request.params(\":id\"));\n String name = request.queryParams(\"name\");\n Animal animal = Animal.find(id);\n animal.setName(name);\n animal.update();\n return new ModelAndView(model, \"ess.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n post(\"/succ\", (req, res) -> { //new\n Map<String, Object> model = new HashMap<>();\n String animalname = req.queryParams(\"animalname\");\n String rangername = req.queryParams(\"ranger\");\n String location = req.queryParams(\"location\");\n Sightings sightings = new Sightings(animalname,rangername,location);\n sightings.save();\n model.put(\"sightings\", sightings);\n return modelAndView(model, \"succ.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n\n //post methods\n post(\"/success\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n String name = req.queryParams(\"name\");\n String health = req.queryParams(\"health\");\n String age = req.queryParams(\"age\");\n Endangered endangered = new Endangered(name, health, age);\n endangered.save();\n System.out.println(\"Please enter all input fields.\");\n return new ModelAndView(model,\"success.hbs\");\n }, new HandlebarsTemplateEngine());\n\n post(\"/wildlife\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n String name = req.queryParams(\"name\");\n Animal animal = new Animal(name);\n animal.save();\n return new ModelAndView(model,\"ess.hbs\");\n }, new HandlebarsTemplateEngine());\n }",
"public static void main(String[] args) {\n\t\t/**Mandamos a llamar el metodo estatico ya que no requiere ser instanciado*/\n\t\tClaseInservible.ejecutarEstatico();\n\t}",
"@Override\n\tpublic String ejecutar(HttpServletRequest request, HttpServletResponse response) {\n\t\tServiceGenericDAO service = new ServiceGenericDAOImp();\n\t\tItinerario itinerario = (Itinerario)service.getDetalleItinerario(request.getParameter(\"nombre\"));\n\t\t\n\t\titinerario.setNombre(request.getParameter(\"nombreNuevo\"));\n\t\titinerario.setCategoria(request.getParameter(\"categoriaNueva\"));\n\t\titinerario.setDuracion(request.getParameter(\"duracionNueva\"));\n\t\titinerario.setUbicacion(request.getParameter(\"ubicacionNueva\"));\n\t\t\n\t\tservice.update(itinerario);\n\t\t\n\t\treturn \"index.html\";\n\t}",
"public static void index() {\n\t\tList<models.Todo> todos = models.Todo.findAllSorted();\t\n\t\trender(todos);\n\t}",
"public static void main(String[] args) {\n\n\t\tWindow.startOkno();\n\t\tWindow.zacni.setEnabled(false);\n\n\t\tSystem.out.println(\"Spoustim...\");\n\n\t\tGenerator.generujSouradniceACesty();\n\t\tInputOutput.zapisSouradniceACestyDoSouboru();\n\t\tMatice.vygenerujMatice();\n\n\t\tFile f = new File(InputOutput.MATICE_CEST_SOUBOR);\n\t\tif (f.exists() && !f.isDirectory()) {\n\t\t\tMatice.nactiMaticiNejkratsichCestZeSouboru();\n\t\t} else {\n\t\t\tSystem.out.println(\"Generuji matici nejkratsich cest\");\n\t\t\tMatice.vytvorNejkratsiCesty();\n\t\t\tInputOutput.zapisMaticeNejkratsichCest(Matice.maticeNejkratsichCest);\n\t\t}\n\n\t\tSystem.out.println(\"Pripraveno...\");\n\t\tWindow.zacni.setEnabled(true);\n\t\tWindow.aktualizace.setEnabled(true);\n\t}",
"public static void main(String[] args) {\n webSocket(\"/forte\", WebSocketHandler.class);\n\n //indicar ruta de archivos publicos.\n staticFileLocation(\"/public\");\n //agregar pantalla de debug. Solo en desarrollo.\n enableDebugScreen();\n\n //freemarker template engine\n Configuration configuration = new Configuration();\n configuration.setClassForTemplateLoading(Main.class, \"/templates\");\n\n //aplicar filtros\n Filtros.iniciarFiltros();\n\n //iniciar db\n DBService.test();\n\n //crear usuario por default si no se ha creado ya\n GestorUsuarios.getInstance().editar(new Usuario(\"admin\",\"admin\",\"admin\",true,true));\n\n //Rutas\n get(\"/chat\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"chat\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n data.put(\"active_user\",Sesion.getUsuarioActivo(request));\n\n return new ModelAndView(data,\"chat_page.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/\", (request, response) -> {\n response.redirect(\"/page/1\");\n\n return \"\";\n });\n\n get(\"/page/:pageNumber\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"index\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n try {\n int page = Integer.parseInt(request.params(\"pageNumber\"));\n\n page = Math.max(1,page);\n\n data.put(\"articulos\",GestorArticulos.getInstance().find_page(page));\n\n if(GestorArticulos.getInstance().hasMoreArticles()) {\n data.put(\"proxima_pagina\", \"\" + (page + 1));\n }\n if(page > 1) {\n data.put(\"anterior_pagina\",\"\" + (page - 1));\n }\n\n\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n return new ModelAndView(data,\"index.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/tag/:etiqueta/\",(request, response) -> {\n String tag = request.params(\"etiqueta\");\n response.redirect(\"/tag/\" + tag + \"/page/1\");\n\n return \"\";\n });\n\n get(\"/tag/:etiqueta/page/:pageNumber\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"index\");\n data.put(\"loggedIn\",Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n try {\n int page = Integer.parseInt(request.params(\"pageNumber\"));\n page = Math.max(1,page);\n\n String tag = request.params(\"etiqueta\");\n\n data.put(\"articulos\",GestorArticulos.getInstance().find_by_tag(page,tag));\n\n if(GestorArticulos.getInstance().hasMoreArticles()) {\n data.put(\"proxima_pagina\", \"\" + (page + 1));\n }\n if(page > 1) {\n data.put(\"anterior_pagina\",\"\" + (page - 1));\n }\n\n\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n return new ModelAndView(data,\"index.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n\n get(\"/admin/user/list\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"list_users\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n //obtener los usuarios\n data.put(\"usuarios\", GestorUsuarios.getInstance().findAll());\n\n return new ModelAndView(data,\"user_list.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/admin/user/delete/:username\",(request, response) -> {\n String username = request.params(\"username\");\n\n Usuario target = GestorUsuarios.getInstance().find(username);\n\n if(target != null) {\n //borrar\n if(GestorUsuarios.getInstance().eliminar(target)) {\n target = null;\n }\n }\n //redireccionar\n response.redirect(\"/admin/user/list\");\n\n return \"\";\n });\n\n get(\"/admin/user/edit/:username\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"edit_user\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n String username = request.params(\"username\");\n Usuario target = GestorUsuarios.getInstance().find(username);\n\n if(target == null) {\n //redireccionar por error\n response.redirect(\"/admin/user/list\");\n }\n else {\n //setear datos para llenar formulario\n data.put(\"username\",target.getUsername());\n data.put(\"nombre\",target.getNombre());\n\n if(target.isAdministrador()) {\n data.put(\"esAdministrador\",\"si\");\n }\n else {\n if (target.isAutor()) {\n data.put(\"esAutor\", \"si\");\n }\n else {\n data.put(\"esLector\", \"si\");\n }\n }\n }\n\n return new ModelAndView(data,\"register_edit_user.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n post(\"/admin/user/edit\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"edit_user\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n String username = request.queryParams(\"username\");\n Usuario target = GestorUsuarios.getInstance().find(username.trim());\n\n if(target == null) {\n //redireccionar por error\n response.redirect(\"/admin/user/list\");\n }\n else {\n //tratar de actualizar usuario\n String password = request.queryParams(\"password\");\n String nombre = request.queryParams(\"nombre\");\n boolean esAdministrador = request.queryParams(\"type\").contentEquals(\"administrador\");\n boolean esAutor = request.queryParams(\"type\").contentEquals(\"autor\") || esAdministrador;\n\n //actulizar usuario\n target = new Usuario(username,password,nombre,esAdministrador,esAutor);\n\n if(GestorUsuarios.getInstance().editar(target)) {\n //redireccionar\n response.redirect(\"/admin/user/list\");\n }\n else {\n //setear datos para llenar formulario\n data.put(\"username\", target.getUsername());\n data.put(\"nombre\", target.getNombre());\n if (target.isAdministrador()) {\n data.put(\"esAdministrador\", \"si\");\n }\n else {\n if (target.isAutor()) {\n data.put(\"esAutor\", \"si\");\n } else {\n data.put(\"esLector\", \"si\");\n }\n }\n\n data.put(\"msg_type\", \"error\");\n data.put(\"msg\", \"Hubo un error con el formulario. Revisa los campos.\");\n }\n }\n\n return new ModelAndView(data,\"register_edit_user.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n\n get(\"/article/new\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"new_article\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n return new ModelAndView(data,\"create_edit_article.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n post(\"/article/new\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"new_article\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n String titulo = request.queryParams(\"titulo\");\n String cuerpo = request.queryParams(\"cuerpo\");\n String raw_etiquetas = request.queryParams(\"etiquetas\");\n\n //Crear articulo en el gestor\n Articulo nuevo = new Articulo();\n nuevo.setTitulo(titulo);\n nuevo.setCuerpo(cuerpo);\n nuevo.setAutor(GestorUsuarios.getInstance().find(Sesion.getUsuarioActivo(request)));\n nuevo.setFecha(new java.sql.Date(Calendar.getInstance().getTimeInMillis()));\n boolean exito = GestorArticulos.getInstance().crear(nuevo);\n\n if(exito) {\n //si se creo el articulo, crear las etiquetas\n Set<String> etiquetas = GestorEtiquetas.parsearEtiquetas(raw_etiquetas);\n for(String str : etiquetas) {\n Etiqueta e = new Etiqueta();\n e.setEtiqueta(str);\n e.setArticulo(nuevo);\n\n GestorEtiquetas.getInstance().crear(e);\n }\n\n //redireccionar a vista con mis articulos\n response.redirect(\"/\");\n }\n else {\n data.put(\"titulo\",titulo);\n data.put(\"cuerpo\",cuerpo);\n data.put(\"etiquetas\",raw_etiquetas);\n\n data.put(\"msg_type\",\"error\");\n data.put(\"msg\",\"Hubo un error en el formulario\");\n }\n\n return new ModelAndView(data,\"create_edit_article.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/article/edit/:articulo_id\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"edit_article\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n String raw_id = request.params(\"articulo_id\");\n Articulo articulo = null;\n\n try {\n Long long_id = Long.parseLong(raw_id);\n articulo = GestorArticulos.getInstance().find(long_id);\n } catch(NumberFormatException e) {\n e.printStackTrace();\n }\n\n if (articulo != null) {\n data.put(\"id\",articulo.getId());\n data.put(\"cuerpo\",articulo.getCuerpo());\n data.put(\"titulo\",articulo.getTitulo());\n data.put(\"etiquetas\",GestorEtiquetas.joinListEtiquetdas(articulo.etiquetas()));\n }\n else {\n response.redirect(\"/\");\n }\n\n return new ModelAndView(data,\"create_edit_article.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n post(\"/article/edit\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"edit_article\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n //obtener datos del form y del usuario activo\n String raw_id = request.queryParams(\"id\");\n long long_id = -1;\n boolean exito = true;\n\n String titulo = request.queryParams(\"titulo\");\n String cuerpo = request.queryParams(\"cuerpo\");\n String raw_etiquetas = request.queryParams(\"etiquetas\");\n\n try {\n long_id = Long.parseLong(raw_id.trim());\n\n Articulo ar = GestorArticulos.getInstance().find(long_id);\n ar.setTitulo(titulo);\n ar.setCuerpo(cuerpo);\n exito = GestorArticulos.getInstance().editar(ar);\n exito = exito && GestorEtiquetas.getInstance().crearEtiquetasByArticle(ar,raw_etiquetas);\n } catch (NumberFormatException e) {\n //TODO CAMBIAR MENSAJE DE EXITO\n e.printStackTrace();\n }\n\n if(exito) {\n response.redirect(\"/\");\n }\n else {\n data.put(\"id\",long_id);\n data.put(\"titulo\",titulo);\n data.put(\"cuerpo\",cuerpo);\n// data.put(\"etiquetas\",_GestorEtiquetas.cargarEtiquetas(long_id));\n\n data.put(\"msg_type\",\"error\");\n data.put(\"msg\",\"Hubo un error con el formulario.\");\n }\n\n return new ModelAndView(data,\"create_edit_article.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/article/delete/:article_id\", (request, response) -> {\n String raw_id = request.params(\"article_id\");\n\n try {\n long long_id = Long.parseLong(raw_id);\n\n Articulo articulo = GestorArticulos.getInstance().find(long_id);\n\n if(articulo != null) {\n GestorArticulos.getInstance().eliminar(articulo);\n }\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n response.redirect(\"/\");\n\n return \"\";\n });\n\n get(\"/article/view/:article_id\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"view_article\");\n data.put(\"loggedIn\",Sesion.isLoggedIn(request));\n data.put(\"currentUser\",Sesion.getUsuarioActivo(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n if(esAdmin) {\n data.put(\"isAdmin\",\"si\");\n }\n\n String raw_article_id = request.params(\"article_id\");\n boolean exito = false;\n\n try {\n long long_id = Long.parseLong(raw_article_id);\n\n Articulo articulo = GestorArticulos.getInstance().find(long_id);\n\n if(articulo != null) {\n data.put(\"articulo\", articulo);\n data.put(\"comentarios\",GestorComentarios.getInstance().findByArticle(articulo));\n\n\n data.put(\"num_likes\",GestorComentarios.getInstance().likeCount(articulo) + \"\");\n\n exito = true;\n }\n } catch (NumberFormatException e) {\n //TODO CAMBIAR MENSAJE DE EXCEPCION\n e.printStackTrace();\n }\n\n if(!exito) {\n response.redirect(\"/\");\n }\n\n return new ModelAndView(data,\"view_article.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n\n post(\"/comment/new\", (request, response) -> {\n if(!Sesion.isLoggedIn(request)) {\n response.redirect(\"/\");\n }\n\n String username = Sesion.getUsuarioActivo(request);\n String cuerpo_com = request.queryParams(\"comentario\");\n String raw_articulo_id = request.queryParams(\"articulo_id\");\n String voto = request.queryParams(\"voto\");\n\n boolean exito = false;\n\n try {\n long long_articulo_id = Long.parseLong(raw_articulo_id);\n\n Comentario comentario = new Comentario();\n comentario.setArticulo(GestorArticulos.getInstance().find(long_articulo_id));\n comentario.setComentario(cuerpo_com);\n comentario.setAutor(GestorUsuarios.getInstance().find(username));\n boolean esVotoBueno = (voto != null && voto.contentEquals(\"bueno\"));\n comentario.setVoto(esVotoBueno);\n\n GestorComentarios.getInstance().crear(comentario);\n exito = true;\n } catch (NumberFormatException e) {\n //TODO CAMBIAR MENSAJE DE EXCEPCION\n e.printStackTrace();\n }\n\n if(exito) {\n response.redirect(\"/article/view/\" + raw_articulo_id);\n }\n else {\n response.redirect(\"/\");\n }\n\n return \"\";\n });\n\n get(\"/comment/like/:comentario/:articulo\", (request, response) -> {\n if(!Sesion.isLoggedIn(request)) {\n response.redirect(\"/\");\n }\n\n String username = Sesion.getUsuarioActivo(request);\n String raw_comentario_id = request.params(\"comentario\");\n String articulo_id = request.params(\"articulo\");\n\n try {\n Long comentario_id = Long.parseLong(raw_comentario_id);\n\n Usuario usuario = GestorUsuarios.getInstance().find(username);\n Comentario comentario = GestorComentarios.getInstance().find(comentario_id);\n\n GestorLikesComentarios.getInstance().darLike(usuario, comentario);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n response.redirect(\"/article/view/\" + articulo_id.trim());\n return \"\";\n });\n\n get(\"/comment/delete/:article_id/:comment_id\", (request, response) -> {\n String raw_articulo_id = request.params(\"article_id\");\n\n long articulo_id = Long.parseLong(raw_articulo_id);\n Articulo ar = GestorArticulos.getInstance().find(articulo_id);\n\n boolean esAdministrador = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n boolean esAutor = false;\n if(ar != null) {\n esAutor = esAutor && ar.getAutor().getUsername() == Sesion.getUsuarioActivo(request);\n }\n\n if(esAutor || esAdministrador) {\n String comentario_id = request.params(\"comment_id\");\n\n try {\n long long_comentario_id = Long.parseLong(comentario_id);\n\n Comentario comentario = GestorComentarios.getInstance().find(long_comentario_id);\n GestorComentarios.getInstance().eliminar(comentario);\n } catch (NumberFormatException e) {\n //TODO CAMBIAR MENSAJE DE EXCEPCION\n e.printStackTrace();\n }\n }\n\n response.redirect(\"/article/view/\" + articulo_id);\n\n return \"\";\n });\n\n\n get(\"/logout\",(request, response) -> {\n WebSocketHandler.desconectar(Sesion.getUsuarioActivo(request));\n\n Sesion.cerrar(request);\n\n response.redirect(\"/\");\n\n return \"\";\n });\n\n get(\"/login\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"login\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n return new ModelAndView(data,\"login.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n post(\"/login\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"login\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n if(!request.queryParams(\"submit\").isEmpty()) {\n //obtener datos de quien desea iniciar sesion\n String username = request.queryParams(\"username\");\n String password = request.queryParams(\"password\");\n\n if(GestorUsuarios.getInstance().credencialesValidas(username,password)) {\n Usuario user = GestorUsuarios.getInstance().find(username);\n //iniciar sesion\n Sesion.iniciar(request,user);\n\n //redireccionar con estado de exito\n response.redirect(\"/\");\n }\n else {\n //setear datos para llenar formulario\n data.put(\"username\",username);\n\n data.put(\"msg_type\",\"error\");\n data.put(\"msg\",\"No se pudo iniciar sesion. Username/password no coinciden.\");\n }\n }\n\n return new ModelAndView(data,\"login.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n get(\"/user/register\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"register\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n return new ModelAndView(data,\"register_edit_user.ftl\");\n }, new FreeMarkerEngine(configuration));\n\n post(\"/user/register\", (request, response) -> {\n HashMap<String,Object> data = new HashMap<>();\n data.put(\"action\",\"register\");\n data.put(\"loggedIn\", Sesion.isLoggedIn(request));\n boolean esAdmin = Sesion.accesoValido(AccessTypes.ADMIN_ONLY,request,null);\n data.put(\"isAutor\",Sesion.getTipoUsuarioActivo(request) == \"autor\" || esAdmin);\n\n //si el request llego desde el formulario\n if(!request.queryParams(\"submit\").isEmpty()) {\n //obtener datos de nuevo usuario\n String username = request.queryParams(\"username\");\n String password = request.queryParams(\"password\");\n String nombre = request.queryParams(\"nombre\");\n //no es administrador by default\n boolean esAutor = request.queryParams(\"type\").contentEquals(\"autor\"); //1 : autor, 0 : lector\n\n //crear nueva instancia\n Usuario newUser = new Usuario(username,password,nombre,false,esAutor);\n\n //persistir nueva instancia, en caso de ser valida\n if(GestorUsuarios.getInstance().crear(newUser)) {\n //redireccionar con mensaje de exito\n response.redirect(\"/\");\n }\n else {\n //setear datos para llenar formulario\n data.put(\"username\",newUser.getUsername());\n data.put(\"nombre\",newUser.getNombre());\n if(newUser.isAutor()) {\n data.put(\"esAutor\",\"si\");\n }\n else {\n data.put(\"esLector\",\"si\");\n }\n\n data.put(\"msg_type\",\"error\");\n data.put(\"msg\",\"No se pudo crear usuario. Revisar datos del formulario.\");\n }\n }\n\n return new ModelAndView(data,\"register_edit_user.ftl\");\n }, new FreeMarkerEngine(configuration));\n }",
"private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }",
"public static void main(String[] args) {\r\n\t\t\r\n\t\tJFrame frame = new JFrame(\"Solitaire\");\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\r\n\t\tController control = new Controller();\r\n\t\tframe.getContentPane().add(new Panel(control));\r\n\t\tframe.pack();\r\n\t\tframe.setSize(1000,500);\r\n\t\t\r\n\t\tframe.setVisible(true);\r\n\t}",
"public static void main(String[] args) throws Exception{\n\n\t\tHttpServer server = HttpServerFactory.create(\"http://localhost:8080/\");\n\t\tserver.start();\n\n\t\tThread.sleep(1000000);\n\t\tJOptionPane.showMessageDialog(null, \"Ende\");\n\t\tserver.stop(0);\n\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tURL url = new URL(\"http://www.fastgames.com.br/destiny-2-pre-venda-ps4-pr-12903-187970.htm\");\n\t\tgetHtml(url);\n\t}",
"public void execute(){\r\n\t\tapplicationController.about();\r\n\t}",
"@Override\n\tpublic void EjecutaGui() {\n\t\tSystem.out.println(\"Ejecucion en ventana del ejercicio 2 del grupo 3\");\n\t}",
"public static void main(String[] args) {\n TemplateController controller = new TemplateController();\n controller.run();\n }",
"public static void main(String[] args){\n ViewLogin viewLogin = new ViewLogin();\n OuvinteViewLogin ouvinte = new OuvinteViewLogin(viewLogin);\n viewLogin.setLocationRelativeTo(null);\n viewLogin.setVisible(true);\n \n JogadorDAO ddao = new JogadorDAO();\n ddao.listar();\n }",
"public static void main(String[] args) {\n\t\tinicialitzarGUI();\r\n\t\tviewtable();\r\n\t}",
"public static void main(String[] args) {\n staticFiles.location(\"/public\");\n\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model/:Version\", (req, res) -> newModel( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:Version/:row/:col/:hard\", (req, res) -> fireAt( req ));\n //This will handle the scan feature\n post(\"/scan/:Version/:row/:col/:hard\", (req, res) -> scan( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:Version/:id/:row/:col/:orientation/:hard\", (req, res) -> placeShip( req ));\n }",
"public static void executeBrowser() throws Exception{\n\t\tinvokeMyBrowser();\n\t}",
"public static void main(String[] args) {\n\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tcreateAndShowFirstPage();\n\t\t\t}\n\t\t});\n\t}",
"public interface Command {\n String index = \"mainPage.jsp\";\n\n String execute(HttpServletRequest request, Entity model);\n}",
"public static void main(String[] args) throws Exception {\n if (args.length < 1) {\n abort(\"Usage: java org.python.indexer.HtmlDemo <file-or-directory>\");\n }\n\n File fileOrDir = new File(args[0]);\n if (!fileOrDir.exists()) {\n abort(\"File not found: \" + fileOrDir);\n }\n\n new HtmlDemo().start(fileOrDir);\n }",
"public static void main(final String[] args) {\n\t\tServer server = new Server();\n\t\tSocketConnector connector = new SocketConnector();\n\t\tconnector.setPort(9090);\n\t\tserver.setConnectors(new Connector[] {connector});\n\n\t\tWebAppContext context = new WebAppContext();\n\t\tcontext.setServer(server);\n\t\tcontext.setContextPath(\"/biomedcalib\");\n\t\tcontext.setWar(\"src/main/webapp\");\n\n\t\tserver.addHandler(context);\n\t\ttry {\n\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"public static void main(String[] args) {\n staticFiles.location(\"/public\");\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model\", (req, res) -> newModel());\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:row/:col\", (req, res) -> fireAt(req));\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:id/:row/:col/:orientation\", (req, res) -> placeShip(req));\n }",
"public static void main(String[] args) {\n rellenarDatos();\n \n //ejercicio01();\n //ejercicio02();\n ejercicio03();\n }",
"public static void main(String[] args){\n\t\tView view = new View();\r\n\t\tDatabaseInteraction model = new DatabaseInteraction();\r\n\r\n\t\t//Initialize controller. \r\n\t\tController controller = new Controller(view,model);\r\n\r\n\t\t//Connect database, start user interaction, and let the controller respond to user options. \r\n\t\tmodel.connectDatabase();\r\n\t\tcontroller.userInteracion();\r\n\t\tcontroller.respondToUserOption();\r\n\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tClienteView vista = new ClienteView();\r\n\t\tCliente modelo = llenarDatosCliente();\r\n\r\n\t\t// se crea un objeto controlados y se le pasa\r\n\t\t// un model y un view\r\n\t\tClienteControlador controller = new ClienteControlador(modelo, vista);\r\n\r\n\t\t// se muestra los datos del cliente\r\n\t\tcontroller.actualizaVista();\r\n\r\n\t\t// actualizamos un cliente y mostramos los datos de nuevo\r\n\r\n\t\tcontroller.SetNombre(\"Felipe mistico\");\r\n\t\tcontroller.SetApellido(\"Magia\");\r\n\t\tcontroller.setId(6543);\r\n\t\tcontroller.actualizaVista();\r\n\r\n\t}",
"@GetMapping(\"/\")\n\tpublic String index() {\n\t\treturn \"index\";\n\t}",
"@RequestMapping(\"/\")\n\tpublic String homePage() {\n\t\tlogger.info(\"Index Page Loaded\");\n\t\treturn \"index\";\n\t}",
"public Action getIndexApiAction() {\n Thing object = new Thing.Builder()\n .setName(\"Main Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-HTTP-HOST-HERE]/main\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }",
"@RequestMapping(\"/\") //match to root path\r\n String ropa(){\n return \"index\"; //index.html in templates directory\r\n }",
"@GetMapping(\"\")\r\n @ResponseStatus(code = HttpStatus.OK)\r\n public void main() {\r\n LOGGER.info(\"GET /\");\r\n }",
"public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}",
"public index() {\n initComponents();\n }",
"public static void main(String[] args) {\n\t\tLabel saludoLabel = new Label();\n\t\tsaludoLabel.setText(\"Aquí saldra el saludo\");\n\t\tsaludoLabel.setBounds(20, 20, 120, 50); //x, y, ancho alto\n\t\t\n\t\t// creamos un botón para saludar\n\t\tButton saludarButton = new Button();\n\t\tsaludarButton.setLabel(\"Saludar\");\n\t\tsaludarButton.setBounds(20, 80, 120, 30); //x, y, ancho alto\n\t\t//Establecemos un listenes para la pulsación del botón\n\t\tsaludarButton.addActionListener(e -> saludoLabel.setText(\"¡¡¡Hola Mundo!!!\")); //Mostramos el saludo en la etiqueta\n\t\t//panel (contenedor) que contiene etiqueta y botón\n\t\tPanel rootPanel = new Panel();\n\t\trootPanel.setLayout(null);\n\t\trootPanel.add(saludoLabel);\n\t\trootPanel.add(saludarButton);\n\t\t\n\t\t//ventana\n\t\tFrame frame = new Frame();\n\t\tframe.setTitle(\"Hola Mundo\");\n\t\tframe.setSize(320, 200);\n\t\tframe.setResizable(false);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.add(rootPanel);\n\t\tframe.addWindowListener(new WindowAdapter() {\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tframe.dispose();\n\t\t\t}\n\t\t});\n\t\t\n\t\tframe.setVisible(true);\n\t\t\n\t}",
"public static void main(String[] args) {\n Ventana_Cliente VC = new Ventana_Cliente();\n adm.Iniciar_Juego(VC);\n \n }",
"public static void main(String[] args) {\n\t\tJFrame frame = new JFrame();\n\t\tSistemaAdministracionGanadera sistema=SistemaAdministracionGanadera.getInstancia();\n\t\tframe.getContentPane().add(new NuevaCategoriaView(sistema));\n\t\tframe.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t}",
"public static void main(String[] a){\n\t\tSystem.out.println(\"Fullstack web development training!!\");\n\t}",
"@RequestMapping(\"/\")\n\t public String index(Model model){\n\t return \"homepage\";\n\t }",
"public static void main(String[] args) {\n\t\t\tgenerateMenu();\n\t\t\tbrowser br= new browser();\n\t\t\tint choice = getInput();\n\t\t\twhile(choice>0){\n\t\t\t\tswitch(choice){\n\t\t\t\tcase 1:\n\t\t\t\t\tbr.goToWebsite();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tbr.goBack();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tbr.searchWebsites();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tbr.listWebsites();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tbr.checkLastWebsite();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"!!!Invalid Choice!!!\");\n\t\t\t\t}\n\t\t\t\tgenerateMenu();\n\t\t\t\tchoice = getInput();\n\t\t\t}\t\t\n\t\t}",
"public static void main(String[] args) {\n\n\t\tJavalin app = Javalin.create(config -> config.addStaticFiles(\n\t\t\t\tstaticFiles ->\n\t\t\t\t{\n\t\t\t\t\tstaticFiles.directory = \"/public\";\n\t\t\t\t}\n\t\t\t\t)\n\t\t\t\t).start(6001);\n\t\t\n\t\t\n\t\tapp.get(\"/\", ctx -> ctx.html(\"hello!\"));\n\t\t\n\t\tapp.post(\"/authenticate\", ctx -> {login(ctx);} ); //Someone has to ping my authenticate, \n\t\t\t\t\t\t\t\t\t\t//before they can access my \"/secret\"\n\t\t\n\t\tapp.get(\"/secret\", ctx -> {\n\t\t\t\n\t\t\tUser sessionUser = ctx.sessionAttribute(\"user\");\n\t\t\t\n\t\t\tif(sessionUser == null) {\n\t\t\t\tctx.res.setStatus(400);\n\t\t\t\tSystem.out.println(\"Login in first!\");\n\t\t\t}else if(sessionUser.isAdmin()) {\n\t\t\t\tctx.res.setStatus(200); //success!\n\t\t\t\tctx.req.getRequestDispatcher(\"/SuperSecretPage.html\").forward(ctx.req, ctx.res);\n\t\t\t}else if(sessionUser.isAdmin() == false) {\n\t\t\t\tctx.res.setStatus(401);\n\t\t\t\tctx.req.getRequestDispatcher(\"/failed.html\").forward(ctx.req, ctx.res);\n\t\t\t}\n\t\t}); //That I only want access once they login!\n\t\t\n\t\tapp.get(\"logout\", ctx -> {\n\t\t\t\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false)); //instead of removing altogther!\n//\t\t\tctx.consumeSessionAttribute(\"user\"); //logout!\n\t\t\t\n\t\t});\n\t\t\t\n\t\t\n\t\t//creating cookies\n\t\tapp.get(\"/cookie\", ctx -> {\n\t\t\t\n\t\t\t//cookies stored in the client machine! \n\t\t\t\n\t\t\tctx.cookie(\"user\", \"McBobby\");\n\t\t\tctx.cookie(\"favoriteColor\",\"Blue\");\n\t\t\tctx.cookie(\"member\",\"true\"); \n\t\t\tctx.cookie(\"admin\", \"false\");\n\t\t\tctx.cookie(\"access\", \"true\");\n\t\t});\n\t\t\n\t\tapp.get(\"/checkCookies\", ctx -> ctx.html(ctx.cookieMap().toString()));\n\t\t//checking if the cookies exist\n//\t\tapp.get(\"/checkCookies\", ctx -> {\n//\t\t\t\n//\t\t\tctx.res.setStatus(404);\n//\t\t\t\n//\t\t\t//checking if the cookieMap exists\n//\t\t\tif(ctx.cookieMap() != null) {\n//\t\t\t\tif(ctx.cookieMap().get(\"member\")!= null //checking if the \"member\" cookie exists\n//\t\t\t\t\t\t&& ctx.cookieMap().get(\"member\").equals(\"true\")) { //checkif the member cookie has the right value\n//\t\t\t\t\tctx.res.setStatus(200);\n//\t\t\t\t\t\n//\t\t\t\t}}\n//\t\t\t\n//\t\t\t\n//\t\t\t\t\n//\t\t\t\t\n//\t\t});\n\n\t\t//removing or overwriting the value of the cookie\n\t\tapp.get(\"/removeCookies\", ctx ->{\n\t\t\t\n\t\t\tctx.removeCookie(\"member\");\n\t\t\tctx.cookie(\"access\", \"false\");\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\tapp.get(\"/setSession\", ctx -> {\n\t\t\n\t\t\tctx.sessionAttribute(\"user\", new User(\"Mcbobby\",false));\n\t\t\t\n\t\t});\n\t\t\n\t\tapp.get(\"/checkSession\", ctx -> {\n\n\t\t\tUser sessionUser = ctx.sessionAttribute(\"user\");\n\t\t\tSystem.out.println(sessionUser);\n\t\t});\n\t\t\n\t\tapp.get(\"/invalidateSession\", ctx -> {\n\t\t\t\n\t\t\tctx.consumeSessionAttribute(\"user\"); //this invalidates the session!\n\t\t});\n\t\t\n\t}",
"public static void main(String... args) {\n\t\tApplication.launch(View.class, args);\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tMarcoServidor mimarco=new MarcoServidor();\r\n\t\t//esto hace que la ventana no se pueda cambiar de tama�o\r\n\t\tmimarco.setResizable(false);\r\n\t\t\r\n\t\tmimarco.setTitle(\"Ventana Servidor\");\r\n\t\t\r\n\t\tmimarco.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\t\r\n\t}",
"@RequestMapping(\"/\")\r\n\tpublic String showIndex() {\r\n\t\treturn \"index\";\r\n\t}",
"public static void main(String[] args) {\n\t\tChromeDriver dr = new ChromeDriver();\n\t\tdr.manage().window().maximize();\n\t\tdr.get(\"file:///Users/apollozealot/Downloads/Practice.html\");\n\t}",
"@RequestMapping(value = \"/\", method = RequestMethod.GET)\n public String index() {\n return \"Index\";\n }",
"public Action getIndexApiAction0() {\n Thing object = new Thing.Builder()\n .setName(\"Main Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }",
"public static void main(String[] args) {\r\n // TODO code application logic here\r\n ObjectFactory.getUIinstance().getHomeInstance().setVisible(true);\r\n }",
"public static void main(String[] args) { \n\t\t usuarios=ArchivoJSON.LeerData();\n\t\t \t\t \n\t\t EventQueue.invokeLater(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tEjecutarSegundoPlano API = new EjecutarSegundoPlano();\n\t\t\t\t\t\tAPI.execute();\n\t\t\t\t//\t\tSoloMonedasCirculantes();\n\t\t\t\t\t\tRegistrarUsuario frame = new RegistrarUsuario();\n\t\t\t\t\t\tframe.setLocationRelativeTo(null);\n\t\t\t\t\t\tframe.setVisible(true);\t\t\t\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n }",
"@RequestMapping(value = \"/index\")\n public String index() {\n return \"index\";\n }",
"@RequestMapping(\"/\")\n public String startPage() {\n\n return \"redirect:/html/singlelamp/nnlightctl/Index.html\";\n }",
"public void ejecutar() throws IOException {\n ServerSocket serverSocket = null;\n\n try {\n serverSocket = new ServerSocket(4444);\n } catch (IOException e) {\n System.err.println(\"No se puede abrir el puerto: 4444.\");\n System.exit(1);\n }\n System.out.println(\"Puerto abierto: 4444.\");\n\n while (listening) {\n \t\n \tTCPServerHilo hilo = new TCPServerHilo(serverSocket.accept(), this);\n hilosClientes.add(hilo);\n hilo.start();\n }\n\n serverSocket.close();\n }",
"public static void main(String[] args) {\n Tortuga marco = new Tortuga();\n marco.setSize(500, 400);\n marco.createGUI();\n marco.setVisible(true);\n }",
"public static void main(String[] args) {\n\t\tPruebaCliente aplicacion = new PruebaCliente();\r\n\t\taplicacion.run();\r\n\t}",
"public static void main(String[] args) {\n\t\tSeContainerInitializer initializer = SeContainerInitializer.newInstance();\n\t\ttry (final SeContainer container = initializer.initialize()) {\n\t\t\tApp app = container.select(App.class).get();\n\t\t\tapp.executar();\n\t\t}\n\t}",
"public Action getIndexApiAction() {\n Thing object = new Thing.Builder()\n .setName(\"Main Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }",
"public static void main(String[] args) throws Exception {\n Set<Users> likedSet = new HashSet<>();\n new Server(8080){{\n setHandler(new ServletContextHandler() {{\n addServlet(new ServletHolder(new ServletUsers(likedSet)) ,\"/users\");\n addServlet(new ServletHolder(new ServletsLiked(likedSet)) ,\"/liked\");\n addServlet(new ServletHolder(new StaticServlet()),\"/assets/*\");\n /* addServlet(new ServletHolder(new ServletsLinked(likedSet)) ,\"/liked\");\n addServlet(new ServletHolder(new ServletMessages()) ,\"/messages\");*/\n }}\n );\n start();\n join();\n }};\n\n }",
"public static void main(String[] args) {\r\n System.out.println(\"***debut serveur gestion ***\");\r\n new ServeurGestion(50003).fonctionnementService();\r\n \r\n }",
"public static void main(String[] args){\n ClienteController obj1 = new ClienteController();\r\n //chamar o método inserir desse objeto\r\n obj1.inserir(11, \"Pietra\");\r\n obj1.inserir(12, \"Maila\");\r\n obj1.inserir(13, \"Patricia\");\r\n obj1.mostrarTodosClientes();\r\n //executar e conferir no BD\r\n }",
"public static void main(String[] args) {\n\t\t\n\t\tMarcoServidor mimarco=new MarcoServidor();\n\t\t\n\t\tmimarco.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n\n\n QuizModel quiz = new QuizModel();\n QuizView quizView = new QuizView();\n QuizController quizMasterController = new QuizController(quiz,quizView);\n //quizMasterController.viewMessage();\n //quizMasterController.getQuiz();\n //quizView.loginPage();\n quiz.generateQuestion();\n\n quiz.uploadFiles();\n QuizRepository quizRepository1 = new QuizRepository();\n quizRepository1.getQuizFile();\n }",
"public void showWebSite() throws Exception {\n\t\twebServer.start();\n\t\tSystem.out.println(getUrl());\n\t\twebServer.join();\n\t}",
"public static void main(String[] args) throws IOException {\n ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);\n context.setContextPath(\"/\");\n\n // Establish DB connection first\n\n // now start the server\n System.out.println(\"=== Initializing server on port \" + PORT);\n\n Server jettyServer = new Server(PORT);\n jettyServer.setHandler(context);\n\n if (LOG_REQUESTS) {\n RequestLog requestLog = new RipLogger();\n jettyServer.setRequestLog(requestLog);\n }\n\n ServletHolder jerseyServlet = context.addServlet(ServletContainer.class, \"/sudoku/*\");\n jerseyServlet.setInitOrder(0);\n jerseyServlet.setInitParameter(\"jersey.config.server.provider.packages\", \"com.shadedreality.rest\");\n\n try {\n jettyServer.start();\n jettyServer.dumpStdErr();\n jettyServer.join();\n } catch (Exception e) {\n System.err.println(\"Uncaught Exception in server: \"+e);\n }\n finally {\n jettyServer.destroy();\n }\n }",
"public static void main(String[] args) {\n \r\n TelaLogin inicio = new TelaLogin();\r\n inicio.setVisible(true);\r\n }",
"public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tModificacionCliente inst = new ModificacionCliente();\n\t\t\t\tinst.setLocationRelativeTo(null);\n\t\t\t\tinst.setVisible(true);\n\t\t\t}\n\t\t});\n\t}",
"@GetMapping\n\tpublic String home() {\n\t\tSystem.out.println(\"Index page\");\n\t\treturn \"redirect:index.jsp\";\n\t}",
"public Result index() {\n Logger.info(\"render top page\");\n return ok(index.render());\n }",
"public static void main(String[] args) {\n startServer();\n Application.launch(GUI.class, args);\n }",
"public static void main(String[] args) throws IOException {\n\t\t\n\t\tStart st = new Start();\n\t\t\n\t\tWebDriver drv = st.driverInit();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tString url = st.prop.getProperty(\"url\") ;\n\t\t\n\t\tdrv.get(url);\n\t\tSystem.out.println(dr.getTitle());\n\t\t\n\t\t\n\t\t\n \n\n\t}"
] | [
"0.6623421",
"0.64930904",
"0.63767165",
"0.6376515",
"0.63626415",
"0.62853175",
"0.6201632",
"0.61983633",
"0.60306096",
"0.60233974",
"0.60078496",
"0.5980339",
"0.59674484",
"0.5962304",
"0.5950165",
"0.5939382",
"0.5930528",
"0.5911387",
"0.5907427",
"0.5873186",
"0.5873186",
"0.5873186",
"0.5861536",
"0.5857854",
"0.58562016",
"0.58372587",
"0.5834639",
"0.58082813",
"0.5803335",
"0.5801458",
"0.5780349",
"0.57777756",
"0.5754999",
"0.5746516",
"0.5744429",
"0.5735003",
"0.5729893",
"0.5724113",
"0.5720287",
"0.57167697",
"0.57002246",
"0.5673896",
"0.5672305",
"0.566897",
"0.5668759",
"0.56615525",
"0.56588864",
"0.5645488",
"0.5643758",
"0.56321716",
"0.56312144",
"0.5620148",
"0.5592682",
"0.5581642",
"0.5580264",
"0.55718166",
"0.55713385",
"0.5566179",
"0.556409",
"0.5555752",
"0.5541333",
"0.55398154",
"0.55397856",
"0.55385077",
"0.5536391",
"0.5523718",
"0.5523441",
"0.55052316",
"0.54997504",
"0.5493166",
"0.5492095",
"0.549103",
"0.5486329",
"0.5479682",
"0.54770905",
"0.54765797",
"0.5472096",
"0.5469904",
"0.5462957",
"0.54619294",
"0.5456306",
"0.5454324",
"0.54407036",
"0.54344463",
"0.5430782",
"0.5430594",
"0.54266214",
"0.54255337",
"0.54214746",
"0.54204935",
"0.5419247",
"0.5418534",
"0.5415946",
"0.54146826",
"0.54077405",
"0.5405352",
"0.5402919",
"0.53993326",
"0.53956664",
"0.53953713"
] | 0.62031955 | 6 |
These if statements are used to verify that there is information present in both of the text fields | @Override
public void onClick(View arg0) {
if (usernameBox.getText().toString().trim().length()>0 && passwordBox.getText().toString().trim().length()>0)
{
//Convert the username and password textfields into strings
String username=usernameBox.getText().toString();
String password=passwordBox.getText().toString();
Boolean contFlag = true;
//Parses the inspectors if they have not already been parsed
try {
if(LoginControl.getInstance().getInspectors().isEmpty())
{
LoginControl.getInstance().parseInspectors();
}
} catch (FileNotFoundException e) {
Toast.makeText(getApplicationContext(), "The user accounts file required to run this program is missing", Toast.LENGTH_SHORT).show();
contFlag = false;
e.printStackTrace();
} catch (SAXException e) {
Toast.makeText(getApplicationContext(), "An error exists in one of the files required to run this program", Toast.LENGTH_SHORT).show();
contFlag = false;
e.printStackTrace();
} catch (IOException e) {
contFlag = false;
e.printStackTrace();
} catch (ParserConfigurationException e) {
contFlag = false;
e.printStackTrace();
}
//Checks if the inputs are correct for the login and sees is the user is found within the xml file
if(contFlag == true)
{
if(!(LoginControl.getInstance().checkLogin(username)))
Toast.makeText(getApplicationContext(), "User Account Does Not Exist", Toast.LENGTH_SHORT).show();
else
{
String storedPassword = LoginControl.getInstance().getCurrentInspector().getPassword();
//Toast.makeText(getApplicationContext(), storedPassword, Toast.LENGTH_LONG).show();
try {
if(PasswordHash.validatePassword(password, storedPassword) == true)
{
Toast.makeText(getApplicationContext(), ("Entering "+LoginControl.getInstance().getCurrentInspector().getName()+"'s account"), Toast.LENGTH_SHORT).show();
//Move into the next screen state (List of Clients) screen
startActivity(new Intent (LoginScreen.this, ClientScreen.class));
//Current screen will slide to the left
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
}
else
Toast.makeText(getApplicationContext(), "Incorrect Password", Toast.LENGTH_LONG).show();
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidKeySpecException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
else
Toast.makeText(getApplicationContext(), "Please fill in your username and password", Toast.LENGTH_LONG).show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public boolean checkNull() {\r\n // Check if the two textfields are null or default \r\n return newIng_ingName.getText().equals(\"\") || newIng_ingCal.getText().equals(\"\");\r\n }",
"private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }",
"public boolean checkInput(){\n if(spelerIDField.getText().equals(\"\") || typeField.getText().equals(\"\") || codeField.getText().equals(\"\") || heeftBetaaldField.getText().equals(\"\")){\n return true;\n } else { return false; }\n }",
"public boolean verifyFields() {\n String fname = firstName.getText();\n String lname = lastName.getText();\n String username = userName.getText();\n String emailString = email.getText();\n String passwordString = String.valueOf(password.getText());\n String confirmPasswordString = String.valueOf(confirmPassword.getText());\n\n\n if (fname.trim().equals(\"\") || lname.trim().equals(\"\") || username.trim().equals(\"\") || emailString.trim().equals(\"\") || passwordString.trim().equals(\"\")) {\n\n outputText.setStyle(\"-fx-text-fill: #d33232\");\n outputText.setText(\"Fill in the Required Fields\");\n\n return false;\n }\n\n //check if confirm password equals password\n else if (!passwordString.equals(confirmPasswordString)) {\n outputText.setStyle(\"-fx-text-fill: #D33232\");\n outputText.setText(\"Password does not match Confirm Password\");\n return false;\n }\n\n // if everything is fine\n else {\n return true;\n }\n }",
"private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }",
"protected boolean checkFields() {\n // Check if any of the fields are empty\n boolean ok = true;\n ok = !isFieldEmpty(password2) && ok;\n ok = !isFieldEmpty(password) && ok;\n ok = !isFieldEmpty(email) && ok;\n\n if (!ok)\n return false;\n\n // Check whether passwords match\n if (!password.getText().toString().equals(password2.getText().toString())){\n password2.setError(getString(R.string.signup_password_mismatch));\n password2.requestFocus();\n return false;\n }\n return true;\n }",
"private boolean checkAddrInputFields(){\n \tboolean same = textFieldCurrents.get(jTextFieldStart).equals(jTextFieldStart.getText()) &&\n\t\t\t\ttextFieldCurrents.get(jTextFieldEnd).equals(jTextFieldEnd.getText()) &&\n\t\t\t\tjComboBoxFormat.getSelectedIndex() == selectedFormat &&\n\t\t\t\tjCheckBoxQuickSearch.isSelected() == quickSearch;\n \t\n \tif(DEBUG){\n \t\toutputResults(\"lasts:\");\n \t\toutputResults(textFieldCurrents.get(jTextFieldStart));\n\t\t\toutputResults(textFieldCurrents.get(jTextFieldEnd));\n\t\t\toutputResults(\"\"+jComboBoxFormat.getSelectedIndex()); \n\t\t\toutputResults(\"nows:\");\n\t\t\toutputResults(jTextFieldEnd.getText());\n\t\t\toutputResults(jTextFieldStart.getText());\n\t\t\toutputResults(\"\"+selectedFormat);\n \t}\n \t\n \tif(!same){\n \t\tjButtonGetDirections.setText(\"Find Directions!\");\n \t}else{\n \t\tjButtonGetDirections.setText(\"Refresh Map\");\n \t}\n \treturn same;\n }",
"public boolean verifyData()\n {\n if(jTextFieldName.getText().equals(\"\") && jTextFieldNumber.getText().equals(\"\") \n || jTextFieldSupplier.getText().equals(\"\") || jTextArea1.getText().equals(\"\") || jTextFieldModel.getText().equals(\"\"))\n {\n JOptionPane.showMessageDialog(null, \"One or More Fields Are Empty\");\n return false;\n }\n \n else\n {\n return true;\n }\n \n }",
"private boolean checkFields() {\n if (editTxtName.getText().equals(\"\")) return false;//name\n if (editTxtDesc.getText().equals(\"\")) return false;//desc\n if (editClrColor.getValue() == null) return false;//color\n if (oldEnvironment == null) return false;//environment is null\n return true;//everything is valid\n }",
"private boolean fieldsAreFilled(){\n return !textboxName.isEnabled() && !textboxInitialValue.isEnabled();\n }",
"private void checkFieldsForEmptyValues() {\n String s1 = edtEmail.getText().toString();\n String s2 = edtDisplayName.getText().toString();\n String s3 = edtPaswd.getText().toString();\n\n if (s1.equals(\"\") || s2.equals(\"\") || s3.equals(\"\")) { //disables the button\n btnRegister.setEnabled(false);\n } else { //enables the button\n btnRegister.setEnabled(true);\n }\n }",
"private void checkBaselineInput(){\n String typedText=baselineStation1Text.getText();\n String typedText2=baselineStation2Text.getText();\n if(!typedText.equals(\"\") && !typedText2.equals(\"\")){\n this.addBaseLineButton.setEnabled(true);\n }else{\n this.addBaseLineButton.setEnabled(false);\n }\n }",
"private boolean checkfields() {\n try {\n Integer.parseInt(checknum.getText().toString());\n Integer.parseInt(banknum.getText().toString());\n Integer.parseInt(branchnum.getText().toString());\n Integer.parseInt(accountnum.getText().toString()); //was commented\n\n } catch (NumberFormatException e) { // at least one of these numbers is not Integer\n return false;\n }\n\n if (checknum.getText().toString().equals(null) || banknum.getText().toString().equals(null) ||branchnum.getText().toString().equals(null)|| accountnum.getText().toString().equals(null))\n return false; // At least one of the fields is empty\n\n return true;\n }",
"private boolean check() {\r\n\t\tif (principal.getText().equals(\"\") && rate.getText().equals(\"\")) {\r\n\t\t\tJOptionPane\r\n\t\t\t\t\t.showMessageDialog(this,\r\n\t\t\t\t\t\t\t\"Please enter a value for \\\"Principal\\\" and \\\"Rate(Percentage)\\\".\");\r\n\t\t\treturn false;\r\n\t\t} else if (principal.getText().equals(\"\")) {\r\n\t\t\tJOptionPane.showMessageDialog(this,\r\n\t\t\t\t\t\"Please enter a value for \\\"Principal\\\".\");\r\n\t\t\treturn false;\r\n\t\t} else if (rate.getText().equals(\"\")) {\r\n\t\t\tJOptionPane.showMessageDialog(this,\r\n\t\t\t\t\t\"Please enter a value for \\\"Rate(Percentage)\\\".\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public boolean isBothPasswordCorrect() { \n String pass1 = new String(newPasswordTextField.getPassword());\n String pass2 = new String(repeatPasswordTextField.getPassword()); \n \n return (pass1.equals(pass2) && isPasswordCorrect());\n }",
"public boolean checkEntryInputs() {\n\t\tboolean isValid = true;\n\t\tif(sampleNumberTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(materialDescriptionTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(Double.valueOf(bacteroidesConcentrationTF.getText())==null) {\n\t\t\tisValid = false;\n\t\t}\n\t\treturn isValid;\n\t}",
"private boolean textFieldsChange() {\r\n\r\n if (!passwordEditText.getText().toString().equals(db.getSetting(\"password\").getValue()))\r\n return true;\r\n if (!idEditText.getText().toString().equals(db.getSetting(\"id\").getValue())) {\r\n return true;\r\n }\r\n if (deleteEntriesCheckBox.isChecked() != db.getSetting(\"notDeleteAfterTransmission\").getValue().equals(\"t\")) {\r\n return true;\r\n }\r\n return false;\r\n }",
"private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }",
"public boolean areBothFieldsSet()\r\n {\r\n if ((!(isEditText1Empty)) && (!(isEditText2Empty))) {\r\n this.button1.setImageResource(R.drawable.login); // THIS NEEDS DIFFERENT SRC\r\n return true;\r\n } else {\r\n this.button1.setImageResource(R.drawable.login);\r\n return false;\r\n }\r\n }",
"public final boolean hasAllRequiredField() {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n CharSequence obj = editText.getText().toString();\n int length = obj.length() - 1;\n int i = 0;\n boolean z = false;\n while (i <= length) {\n boolean z2 = obj.charAt(!z ? i : length) <= ' ';\n if (!z) {\n if (!z2) {\n z = true;\n } else {\n i++;\n }\n } else if (!z2) {\n break;\n } else {\n length--;\n }\n }\n String obj2 = obj.subSequence(i, length + 1).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n CharSequence obj3 = editText2.getText().toString();\n int length2 = obj3.length() - 1;\n int i2 = 0;\n boolean z3 = false;\n while (i2 <= length2) {\n boolean z4 = obj3.charAt(!z3 ? i2 : length2) <= ' ';\n if (!z3) {\n if (!z4) {\n z3 = true;\n } else {\n i2++;\n }\n } else if (!z4) {\n break;\n } else {\n length2--;\n }\n }\n String obj4 = obj3.subSequence(i2, length2 + 1).toString();\n if (TextUtils.isEmpty(obj2) || TextUtils.isEmpty(obj4)) {\n return false;\n }\n return true;\n }",
"private boolean validateInputs() {\n return !proID.getText().isEmpty() || \n !proName.getText().isEmpty() ||\n !proPrice.getText().isEmpty();\n }",
"private boolean verificaDados() {\n if (!txtNome.getText().equals(\"\") && !txtProprietario.getText().equals(\"\")) {\n return true;\n } else {\n JOptionPane.showMessageDialog(null, \"Falta campos a ser preenchido\", \"Informação\", 2);\n return false;\n }\n }",
"@Override\n\tpublic boolean verifyText(JTextField arg0, String arg1) {\n\t\treturn true;\n\t}",
"private boolean formComplete(){\r\n return NAME_FIELD.getLength()>0 && ADDRESS_1_FIELD.getLength()>0 &&\r\n CITY_FIELD.getLength()>0 && ZIP_FIELD.getLength()>0 && \r\n COUNTRY_FIELD.getLength()>0 && PHONE_FIELD.getLength()>0; \r\n }",
"private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }",
"public void CheckEditTextStatus(){\n\n // Getting value from All EditText and storing into String Variables.\n NameHolder = Name.getText().toString();\n EmailHolder = Email.getText().toString();\n PasswordHolder = Password.getText().toString();\n\n // Checking EditText is empty or no using TextUtils.\n if( TextUtils.isEmpty(NameHolder)|| TextUtils.isEmpty(EmailHolder)|| TextUtils.isEmpty(PasswordHolder)){\n\n EditTextEmptyHolder = false ;\n\n }\n else {\n\n EditTextEmptyHolder = true ;\n }\n }",
"protected boolean areStrFieldsBlank(String password, String firstname,\n String midname, String lastname, String email,\n String profile, String educ, String expertise,\n String location) {\n if (password.isEmpty() || firstname.isEmpty() || midname.isEmpty()\n || lastname.isEmpty() || email.isEmpty() || profile.isEmpty() ||\n educ.isEmpty() || expertise.isEmpty() || location.isEmpty()) {\n Toast.makeText(FreelanceEditProfileActivity.this,\n \"ERROR: You may not leave any of the fields empty.\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n else\n return false;\n }",
"private boolean checkBoth(String input1, String input2){\r\n\t\tboolean pass=true;\r\n\t\tstart=aptManager.search(input1); //convert input into index\r\n\t\tdestn=aptManager.search(input2); //^^^\r\n\t\tif(start<0 && destn<0){//check if start and destination is valid\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE STARTING AIRPORT AND DESTINATION AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(destn<0){\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE DESTINATION AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(start<0){\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE STARTING AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n \t\telse if(start==destn){ //check if start and destination is same\r\n \t\t\tJOptionPane.showMessageDialog(this,\"THE STARTING AIRPORT AND DESTINATION AIRPORT CANNOT BE THE SAME\");\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\telse if(!multiDestn.isEmpty()){\r\n \t\t\tif(destn==multiDestn.get(0)){ //if multiple destination exist, check if destination 1 and destination 2 is same\r\n \t\t\t\t\tJOptionPane.showMessageDialog(this,\"The Second Destination Airport cannot be the same as its Departing Airport\");\r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn pass;\r\n }",
"public void checkCD() {\r\n\t\tif (CDsSelected.titleField.getText().length() != 0) {\r\n\t\t\ttitle = CDsSelected.titleField.getText();\r\n\t\t\tCDsSelected.enterTitleText.setText(\" \");\r\n\t\t} else {\r\n\t\t\tCDsSelected.enterTitleText.setText(\"Please enter a title\");\r\n\t\t\tcheck_add = false;\r\n\t\t}\r\n\t\tif (CDsSelected.artistField.getText().length() != 0) {\r\n\t\t\tartist = CDsSelected.artistField.getText();\r\n\t\t\tCDsSelected.enterArtistText.setText(\" \");\r\n\t\t} else {\r\n\t\t\tCDsSelected.enterArtistText.setText(\"Please enter an artist\");\r\n\t\t\tcheck_add = false;\r\n\t\t}\r\n\t\tif (CDsSelected.genreField.getText().length() != 0) {\r\n\t\t\tgenre = CDsSelected.genreField.getText();\r\n\t\t\tCDsSelected.enterGenreText.setText(\" \");\r\n\t\t} else {\r\n\t\t\tCDsSelected.enterGenreText.setText(\"Please enter a genre\");\r\n\t\t\tcheck_add = false;\r\n\t\t}\r\n\r\n\t\tdescription = CDsSelected.descriptionTextArea.getText();\r\n\r\n\t}",
"private void checkFields() {\n if (month.getText().toString().isEmpty()) {\n month.setError(\"enter a month\");\n month.requestFocus();\n return;\n }\n if (day.getText().toString().isEmpty()) {\n day.setError(\"enter a day\");\n day.requestFocus();\n return;\n }\n if (year.getText().toString().isEmpty()) {\n year.setError(\"enter a year\");\n year.requestFocus();\n return;\n }\n if (hour.getText().toString().isEmpty()) {\n hour.setError(\"enter an hour\");\n hour.requestFocus();\n return;\n }\n if (minute.getText().toString().isEmpty()) {\n minute.setError(\"enter the minute\");\n minute.requestFocus();\n return;\n }\n if (AMorPM.getText().toString().isEmpty()) {\n AMorPM.setError(\"enter AM or PM\");\n AMorPM.requestFocus();\n return;\n }\n if (place.getText().toString().isEmpty()) {\n place.setError(\"enter the place\");\n place.requestFocus();\n return;\n }\n }",
"private boolean fieldsFilled(){\n return !editTextEmail.getText().toString().isEmpty() &&\n !editTextPassword.getText().toString().isEmpty();\n }",
"public boolean checkFields(){\n String message = \"\";\n if (firstName.getText().isEmpty()){\n message=\"First name is required\";\n }\n if (lastName.getText().isEmpty()){\n if (message.isEmpty())\n message = \"Last name is required\";\n else\n message = \"First name and Last name are required\";\n }\n if (birthday.getValue() == null){\n if (message.isEmpty())\n message = \"please select your birthday\";\n else if (firstName.getText().isEmpty()&& !lastName.getText().isEmpty())\n message = \"First name and birthday required\";\n else if (!firstName.getText().isEmpty() && lastName.getText().isEmpty())\n message = \"Last name and birthday required\";\n else\n message = \"all fields are required\";\n }\n errorDisplay.setText(message);\n return message.equals(\"\");\n }",
"private boolean comprobarCampos(){\n if(jTextField1.getText().isEmpty() || jTextField2.getText().isEmpty()){\n JOptionPane.showMessageDialog(this, \"No se debe dejar campos en blanco\", \n \"ERROR: campos en blanco\", JOptionPane.ERROR_MESSAGE);\n }\n if (jComboBox1.getSelectedIndex() == 0|| entrenador.getNacionalidad().equals(\"\")){\n JOptionPane.showMessageDialog(this, \"Debes indicar un pais\", \"ERROR: Nacionalidad incorrecta\", \n JOptionPane.ERROR_MESSAGE);\n return false;\n }\n if(jXDatePicker1.getDate() == null){\n JOptionPane.showMessageDialog(this, \"Debes indicar una fecha de nacimiento\", \n \"ERROR: Fecha de nacimiento vacía\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n return true;\n }",
"private boolean validateFields() {\r\n\t\tif (txUsuario.getText().equals(\"\") || txPassword.getText().equals(\"\")\r\n\t\t\t\t|| checkAdmin.isIndeterminate()|| checkTPV.isIndeterminate())\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }",
"private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}",
"private boolean isFormEmpty(){\n if(pickupLocationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(destinationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(notesInput.getText().toString().length() != 0){\n return false;\n }\n\n return true;\n }",
"private boolean isValid(){\n if(txtFirstname.getText().trim().isEmpty() || txtLastname.getText().trim().isEmpty() ||\n txtEmailAddress.getText().trim().isEmpty() || dobPicker.getValue()==null\n || txtPNum.getText().trim().isEmpty()\n || txtDefUsername.getText().trim().isEmpty()\n || curPassword.getText().trim().isEmpty()){\n \n return false; // return false if one/more fields are not filled\n }else{\n if(!newPassword.getText().trim().isEmpty()){\n if(!confirmPassword.getText().trim().isEmpty()){\n return true;\n }else{\n return false;\n }\n }\n return true; // return true if all fields are filled\n }\n }",
"private boolean Integritycheck() {\n String mail = Objects.requireNonNull(email.getEditText()).getText().toString();\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n String passwordAgain = Objects.requireNonNull(password2.getEditText()).getText().toString();\n String city = this.city.getText().toString();\n String fname = Objects.requireNonNull(FName.getEditText()).getText().toString();\n String Lname = Objects.requireNonNull(this.LName.getEditText()).getText().toString();\n String phone = Objects.requireNonNull(this.phone.getEditText()).getText().toString();\n\n return mail.length() < 1 || password.length() < 1 || passwordAgain.length() < 1 || city.length() < 1 || fname.length() < 1 || Lname.length() < 1 || phone.length() < 1;\n }",
"private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"ivan@foofoo.com\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}",
"private void checkEditTexts() {\n\n if (!validateEmail(Objects.requireNonNull(edInputEmail.getText()).toString().trim())) {\n Toasty.error(Objects.requireNonNull(getActivity()), getString(R.string.error_invalid_email), Toasty.LENGTH_SHORT, true).show();\n } else {\n\n if (Objects.requireNonNull(edInputPass.getText()).toString().trim().equalsIgnoreCase(\"\")) {\n\n Toasty.error(Objects.requireNonNull(getActivity()), getString(R.string.error_empty_password), Toasty.LENGTH_SHORT, true).show();\n\n } else {\n sendLoginRequest(edInputEmail.getText().toString(), edInputPass.getText().toString());\n CustomProgressBar.showProgress(loadingLayout);\n }\n }\n }",
"public boolean check(){\n for(TextField texts:textFields){\n if(texts.getText().isEmpty()){\n return false;\n }\n }\n return true;\n }",
"private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }",
"public boolean fieldsAreFilled(){\r\n boolean filled = true;\r\n if(txtFName.getText().trim().isEmpty() | txtFEmail.getText().trim().isEmpty() | txtFPhone.getText().trim().isEmpty()){\r\n filled = false;\r\n }\r\n return filled;\r\n }",
"private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }",
"boolean hasSecondField();",
"private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }",
"public void checkText()\n\t{\n\t\ttry\n\t\t{\n\t\t\tqualityNum = Integer.parseInt(quality.getText());\n\t\t\tsidesNum = Integer.parseInt(sides.getText());\n\t\t\tlengthNum = Double.parseDouble(length.getText());\n\t\t\twidthNum = Double.parseDouble(width.getText());\n\t\t\theightNum = Double.parseDouble(height.getText());\n\t\t\tradiusNum = Double.parseDouble(radius.getText());\n\t\t\tradius2Num = Double.parseDouble(radius2.getText());\n\t\t\trollNum = Double.parseDouble(roll.getText());\n\t\t\tpitchNum = Double.parseDouble(pitch.getText());\n\t\t\tyawNum = Double.parseDouble(yaw.getText());\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t}\n\t\t\n\t\tquality.setText(Integer.toString(qualityNum));\n\t\tsides.setText(Integer.toString(sidesNum));\n\t\tlength.setText(Double.toString(lengthNum));\n\t\twidth.setText(Double.toString(widthNum));\n\t\theight.setText(Double.toString(heightNum));\n\t\tradius.setText(Double.toString(radiusNum));\n\t\tradius2.setText(Double.toString(radius2Num));\n\t\troll.setText(Double.toString(rollNum));\n\t\tpitch.setText(Double.toString(pitchNum));\n\t\tyaw.setText(Double.toString(yawNum));\n\t}",
"private boolean checkInputFields(){\r\n\t\tString allertMsg = \"Invalid input: \" + System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MCSTf.getText());\r\n\t\t\tif(testValue < 0 || testValue > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a MCS score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for relevance score weight and coherence score weight text fields\r\n\t\ttry{\r\n\t\t\tFloat relScoreW = Float.parseFloat(m_RelScoreTf.getText());\r\n\t\t\tFloat cohScoreW = Float.parseFloat(m_CohScoreTf.getText());\r\n\t\t\tif(relScoreW < 0 || relScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif(cohScoreW < 0 || cohScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif((relScoreW + cohScoreW) != 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a weight for relevance and coherence score.\" + System.getProperty(\"line.separator\");\r\n\t\t\tallertMsg += \"Sum of the weights for relevance and coherence score must be 1.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_KeyTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as multiplier for keyword concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for category confidence weight\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_CatConfTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for the weight of the category confidence of concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for weight of repeated concepts\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_RepeatTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for repeated concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for number of output categories\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MaxCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the maximum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MinCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the minimum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MinCatScoreTf.getText());\r\n\t\t\tif(testValue < 0.0f || testValue > 1.0f)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number between 0 and 1 as minimum category score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\tif(allertMsg.length() > 18){\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(allertMsg);\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"private boolean validateForm() {\r\n\t\tResources res = getResources();\r\n\t\tif (this.textViewPrivateKey.getText().toString().equalsIgnoreCase(\"\") ||\r\n\t\t\t\tthis.editTextPassword1.getText().toString().equalsIgnoreCase(\"\") ||\r\n\t\t\t\tthis.editTextPassword2.getText().toString().equalsIgnoreCase(\"\")) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.all_fields_required, Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else if (!(this.editTextPassword1.getText().toString().equals(this.editTextPassword2.getText().toString()))) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.passwords_not_the_same, Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else if (!(this.editTextPassword1.getText().length() >= MIN_PASSWORD_LENGTH)) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.password_too_short + MIN_PASSWORD_LENGTH + \".\", Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"boolean isInputValid(){\n\t\tString ac = edAccount.getText().toString();\n\t\tString pwd = edPassword.getText().toString();\n\t\tboolean isAccEmpty = StringUtil.isNullOrEmpty(ac);\n\t\tboolean isPwdEmpty = StringUtil.isNullOrEmpty(pwd);\n\t\tif(isAccEmpty){\n\t\t\tedAccount.requestFocus();\n\t\t}else if(isPwdEmpty){\n\t\t\tedPassword.requestFocus();\n\t\t}\n\t\treturn !( isAccEmpty|| isPwdEmpty);\n\t}",
"private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }",
"private boolean userInfoCheck(){\n boolean isValid = true;\n EditText et_user_name = findViewById(R.id.et_client_fName);\n EditText et_user_location = findViewById(R.id.et_client_sName);\n if(et_user_name.getText().toString().trim().isEmpty()){\n et_user_name.setError(\"Name Cannot Be Empty\");\n isValid = false;\n }\n if (et_user_location.getText().toString().trim().isEmpty()){\n et_user_location.setError(\"Location Cannot Be Empty\");\n isValid = false;\n }\n return isValid;\n }",
"private void InputTextValidator () {\n isNotNull = !txtCategoryNo.getText().equals(\"\") && !txtCategoryName.getText().equals(\"\");\n }",
"private boolean Validate() {\n EditText titleText = findViewById(R.id.register_movie_title_txt);\n EditText yearText = findViewById(R.id.register_movie_year_txt);\n EditText ratingText = findViewById(R.id.register_movie_rating_txt);\n\n\n boolean is_filled_required_fields = false;\n is_filled_required_fields = titleText.getText().toString().length() > 0\n && yearText.getText().toString().length() > 0\n && ratingText.getText().toString().length() > 0;\n\n if (!is_filled_required_fields) {\n Snackbar mySnackbar = Snackbar.make(findViewById(R.id.activity_register_base_layout), \"Please fill required fields\", BaseTransientBottomBar.LENGTH_SHORT);\n mySnackbar.show();\n }\n return is_filled_required_fields;\n }",
"private boolean checkValidity() {\n if(txtSupplierCode.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Please Enter the Supplier Code!!\", \"EMPTY SUPPLIER CODE\", JOptionPane.ERROR_MESSAGE);\n txtSupplierCode.setBackground(Color.RED);\n return false;\n }\n if(txtSupplierName.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Please Enter the Supplier Name!!\", \"EMPTY SUPPLIER NAME\", JOptionPane.ERROR_MESSAGE);\n txtSupplierName.setBackground(Color.RED);\n return false;\n }\n return true;\n }",
"private boolean emptyBoxes() {\n return (FirstName.getText().toString().isEmpty() || LastName.getText().toString().isEmpty() ||\n ID.getText().toString().isEmpty() || PhoneNumber.getText().toString().isEmpty() ||\n EmailAddress.getText().toString().isEmpty() || CreditCard.getText().toString().isEmpty() ||\n Password.getText().toString().isEmpty());\n }",
"public boolean validateInputFields(){\n if(titleText.getText().isEmpty() || descriptionText.getText().isEmpty()){\n showError(true, \"All fields are required. Please complete.\");\n return false;\n }\n if(locationCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a location.\");\n return false;\n }\n if(contactCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a contact.\");\n return false;\n }\n if(typeCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select the type.\");\n return false;\n }\n if(customerCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a customer.\");\n return false;\n }\n if(userCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a user.\");\n return false;\n }\n return true;\n }",
"private boolean validateInputs() {\n if (KEY_EMPTY.equals(tenchuxe)) {\n etTenChuXe.setError(\"Vui lòng điền Tên chủ xe\");\n etTenChuXe.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(sdt)) {\n etSDT.setError(\"Vui lòng điền Số điện thoại\");\n etSDT.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(mota)) {\n edMoTa.setError(\"Vui lòng điền Mô tả xe\");\n edMoTa.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(biensoxe)) {\n etBienSoXe.setError(\"Vui lòng điền Biển số xe\");\n etBienSoXe.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(passwordtx)) {\n etPasswordtx.setError(\"Vui lòng điền Mật khẩu\");\n etPasswordtx.requestFocus();\n return false;\n }\n\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Vui lòng điền Xác nhận mật khẩu\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!passwordtx.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Xác nhận mật khẩu sai !\");\n etConfirmPassword.requestFocus();\n return false;\n }\n\n return true;\n }",
"private boolean validateInputs() {\n question = txtQuestion.getText().trim();\n option1 = txtOption1.getText().trim();\n option2 = txtOption2.getText().trim();\n option3 = txtOption3.getText().trim();\n option4 = txtOption4.getText().trim();\n correctOption = jcCorrectAns.getSelectedItem().toString();\n //System.out.println(correctOption);\n if(question.isEmpty() || option1.isEmpty() || option2.isEmpty() || \n option3.isEmpty() || option4.isEmpty() || correctOption.isEmpty()){\n return false;\n }\n return true;\n }",
"private boolean validateInputs() {\n if (Constants.NULL.equals(review)) {\n reviewET.setError(\"Must type a review!\");\n reviewET.requestFocus();\n return false;\n }\n if (Constants.NULL.equals(heading)) {\n headingET.setError(\"Heading cannot be empty\");\n headingET.requestFocus();\n return false;\n }\n return true;\n }",
"private boolean validSignUpFields() {\n final EditText etEmail = findViewById(R.id.etSignUpEmail);\n final EditText etPassword = findViewById(R.id.etSignUpPassword);\n final EditText etConfirmPassword = findViewById(R.id.etConfirmPassword);\n\n final String email = etEmail.getText().toString();\n final String password = etPassword.getText().toString();\n final String confirmPassword = etConfirmPassword.getText().toString();\n\n if (email.isEmpty()) {\n etEmail.setError(\"Email field is required.\");\n etEmail.requestFocus();\n } else if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {\n etEmail.setError(\"Valid email address required.\");\n etEmail.requestFocus();\n } else if (password.isEmpty()) {\n etPassword.setError(\"Password field is required.\");\n etPassword.requestFocus();\n } else if (confirmPassword.isEmpty()) {\n etConfirmPassword.setError(\"Must confirm your password.\");\n etConfirmPassword.requestFocus();\n } else if (!password.equals(confirmPassword)) {\n etConfirmPassword.setError(\"The two entered passwords do not match.\");\n etConfirmPassword.requestFocus();\n } else {\n return true;\n }\n\n return false;\n }",
"private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }",
"protected boolean isAllRequiredTxtFieldsFilled() {\r\n JTextField[] txtFields = {\r\n txtFieldFirstName, txtFieldLastName,\r\n txtFieldDateOfBirth, txtFieldIBAN,\r\n txtFieldState, txtFieldHouseNumber,\r\n txtFieldPostcode, txtFieldLocation,\r\n txtFieldCountry, txtFieldState\r\n };\r\n\r\n for (JTextField txtField : txtFields) {\r\n if (txtField.getText().equals(\"\")) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }",
"private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }",
"public boolean validations() {\n boolean result = false;\n String nameString = mItemNameEditText.getText().toString().trim();\n String locationString = mItemLocationEditText.getText().toString().trim();\n\n if (nameString.isEmpty() || nameString == null || locationString.isEmpty() || locationString == null || isImageNotPresent()) {\n displayToastMessage(getString(R.string.fields_mandatory_msg));\n return result;\n } else {\n result = true;\n return result;\n }\n }",
"public boolean validateData(){\n boolean dataOk=true;\n if (etName.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Name field is void.\");\n dataOk=false;\n }\n if (etSurname.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Surname field is void.\");\n dataOk=false;\n }\n if (etDescription.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Description field is void.\");\n dataOk=false;\n }\n return dataOk;\n }",
"public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}",
"protected boolean validateInputs() {\n if (KEY_EMPTY.equals(firstName)) {\n etFirstName.setError(\"First Name cannot be empty\");\n etFirstName.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(lastName)) {\n etLastName.setError(\"Last Name cannot be empty\");\n etLastName.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(username)) {\n etUsername.setError(\"Username cannot be empty\");\n etUsername.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(email)) {\n etEmail.setError(\"Email cannot be empty\");\n etEmail.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(password)) {\n etPassword.setError(\"Password cannot be empty\");\n etPassword.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Confirm Password cannot be empty\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!password.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Password and Confirm Password does not match\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(major)) {\n etMajor.setError(\"Major cannot be empty\");\n etMajor.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(university)) {\n etUniversity.setError(\"university cannot be empty\");\n etUniversity.requestFocus();\n return false;\n }\n\n\n\n if(!isStudent && !isTutor){\n //Show a toast or some kind of error\n Toast toast = Toast.makeText(this, \"message\", Toast.LENGTH_SHORT);\n toast.setText(\"please check the account type\");\n toast.setGravity(Gravity.CENTER, 0, 0);\n //other setters\n toast.show();\n return false;\n }\n\n\n return true;\n }",
"private boolean hayCamposVacios() {\r\n\t\tif(nomTextField.getText().isEmpty()\r\n\t\t\t|| claveTextField.getText().isEmpty()\r\n\t\t\t\t|| reingresoTextField.getText().isEmpty()\r\n\t\t\t\t\t|| preguntaTextField.getText().isEmpty()\r\n\t\t\t\t\t\t|| respuestaTextField.getText().isEmpty())\r\n\t\t\treturn true;\t\t\r\n\t\treturn false;\r\n\t}",
"protected boolean okData() {\n \t\tString name2 = name.getText().trim();\n \t\tString phone2 = phone.getText().trim();\n \t\tString adress2 = adress.getText().trim();\n \t\tboolean enterpriseButton = enterpriseCustomer.isSelected();\n \t\tboolean privateButton = privateCustomer.isSelected();\n \t if (name2.equals(\"\") || phone2.equals(\"\") || adress2.equals(\"\") || (!enterpriseButton && !privateButton)) {\n \t \tif (name2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input a customer name!\");\n \t \t\tname.requestFocusInWindow();\n \t \t} else if(phone2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input a phone number!\");\n \t \t\tphone.requestFocusInWindow();\n \t \t} else if(adress2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input an adress!\");\n \t \t\tadress.requestFocusInWindow();\n \t \t} else if(!enterpriseButton && !privateButton) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to choose a customer type!\");\n \t \t\tprivateCustomer.requestFocusInWindow();\n \t \t}\n \t \treturn false;\n \t } else {\n \t \treturn true;\n \t }\n \t}",
"public boolean verifyFields()\n\t{\n\t\t// check name first\n\t\tif (!validateUserName(username.getText()))\n\t\t\treturn false;\n\n\t\t// check address if name is valid\n\t\tif (!validateIP(address.getText()))\n\t\t{\n\t\t\tsetWarning(\"invalid address\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// only check port if name and address are okay\n\t\ttry\n\t\t{\n\t\t\tInteger.parseInt(port.getText());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tsetWarning(\"invalid port number\");\n\t\t\treturn false;\n\t\t}\n\n\t\tstatus.setTextFill(GREEN);\n\t\tstatus.setText(\"attempting connection\");\n\n\t\treturn true;\n\t}",
"@Override\n public boolean isValid() {\n if((eMultipleAnswerType == null && textAnswerIn.getText().toString().trim().isEmpty()) || (eMultipleAnswerType != null && !compoundButtonController.isChecked())){\n try {\n invalidText = getResources().getString(R.string.output_invalidField_questionAnswering_notAnswered);\n } catch (NullPointerException e){\n e.printStackTrace();\n }\n return false;\n }\n return true;\n }",
"private boolean bothNull(String one, String two) {\n return (one == null && two == null);\n }",
"public int check_both()\r\n {\r\n if(((check_passwrd.compareTo(conf_password))==0) && (Email_id.compareTo(Email))==0 && check_email()==0)\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return 1;\r\n }\r\n }",
"private boolean checkIfChanged() {\n //get everything\n if ((!fname.getText().toString().equals(prefs.getString(\"fname\", null))\n || (!lname.getText().toString().equals(prefs.getString(\"lname\", null)))\n || (!email.getText().toString().equals(prefs.getString(\"email\", null)))\n || (!password.getText().toString().equals(prefs.getString(\"password\", null)))\n || (!(spinner_curr.getSelectedItemPosition() == (prefs.getInt(\"curr\", 0))))\n || (!(spinner_stock.getSelectedItemPosition() == (prefs.getInt(\"stock\", 0)))))) {\n return true;\n }\n return false;\n }",
"private boolean validEditInput() throws SQLException {\n // Checks if any of the fields is empty\n if(teamNameEditField.getText().equals(\"\") || abbrevationEditField.getText().equals(\"\")\n || chooseCityBox.getValue() == null || chooseLeagueBox.getValue() == null\n || chooseLeagueTeamBox.getValue() == null) {\n displayMessage(messagePane,\"Please fill all the fields\",true);\n return false;\n }\n // Checks the abbrevation length\n else if(abbrevationEditField.getText().length() > 3)\n {\n displayMessage(messagePane,\"Abbrevations must be at most 3 characters\",true);\n return false;\n }\n // Checks team name length\n else if (teamNameEditField.getText().length() > 30){\n displayMessage(messagePane,\"Team Names must be smaller than 30 characters\",true);\n return false;\n }\n return true;\n }",
"private boolean validFormInputs() {\n String email = etEmail.getText().toString();\n String password = etPassword.getText().toString();\n String institutionName = etInstitutionName.getText().toString();\n String addressFirst = etInstitutionAddressFirst.getText().toString();\n String addressSecond = etInstitutionAddressSecond.getText().toString();\n String CIF = etCIF.getText().toString();\n\n String[] allInputs = {email, password, institutionName, addressFirst, addressSecond, CIF};\n for (String currentInput : allInputs) {\n if (currentInput.matches(\"/s+\")) // Regex pt cazul cand stringul e gol sau contine doar spatii\n return false; // formular invalid - toate inputurile trebuie sa fie completate\n }\n String[] stringsAddressFirst = addressFirst.split(\",\");\n String[] stringsAddressSecond = addressSecond.split(\",\");\n if (stringsAddressFirst.length != 4 ||\n stringsAddressSecond.length != 3)\n return false;\n\n //<editor-fold desc=\"Checking if NUMBER and APARTMENT are numbers\">\n try {\n Integer.parseInt(stringsAddressSecond[0]);\n Integer.parseInt(stringsAddressSecond[2]);\n return true; // parsed successfully without throwing any parsing exception from string to int\n }catch (Exception e) {\n Log.v(LOG_TAG, \"Error on converting input to number : \" + e);\n return false; // parsed unsuccessfully - given strings can not be converted to int\n }\n //</editor-fold>\n }",
"public void verifyTextSignUpToLetsKodeIt() {\n verifyTextAssertMethod(signUpToLetsKodeIt, \"Sign Up to Let's Kode It\");\n }",
"private boolean isAllFieldsAreFull(){\n\t\tboolean lack = true;\n\t\tif (userNameField.getText().equals(\"\")) {\n\t\t\tlackUserNameLabel.setVisible(true);\t\t\t\t\n\t\t\tlack = false;\n\t\t}\n\t\tif (userLastNameField.getText().equals(\"\")) {\n\t\t\tlackUserLastNameLabel.setVisible(true);\n\t\t\tlack = false;\n\t\t}\n\t\tif (userLoginField.getText().equals(\"\")) {\n\t\t\tlackUserLoginLabel.setText(\"to pole nie może być puste\");\n\t\t\tlackUserLoginLabel.setVisible(true);\n\t\t\tlack = false;\n\t\t}\n\t\t\n\t\tif (userPermissionsBox.getSelectionModel().getSelectedIndex() <= -1) {\n\t\t\tlackUserPermissionsLabel.setVisible(true);\n\t\t\tlack = false;\n\t\t}\n\t\t\n\t\tif ((newUser) || (changePassword)){\n\t\t\tif (userPasswordField.getText().equals(\"\")) {\n\t\t\t\tlackUserPasswordLabel.setVisible(true);\n\t\t\t\tlack = false;\n\t\t\t}\n\t\t\tif (userConfirmPasswordField.getText().equals(\"\")) {\n\t\t\t\tlackUserConfirmPasswordLabel.setText(\"to pole nie może być puste\");\n\t\t\t\tlackUserConfirmPasswordLabel.setVisible(true);\n\t\t\t\tlack = false;\n\t\t\t}\n\t\t}\n\t\treturn lack;\n\t}",
"private boolean areFieldsNotBlank() {\r\n boolean ok=true;\r\n if (dogNameField.getText() == null) {\r\n dogNameField.setStyle(\"-fx-border-color: red ; \");\r\n ok = false;\r\n } else if (dogNameField.getText().isBlank()) {\r\n dogNameField.setStyle(\"-fx-border-color: red ; \");\r\n ok = false;\r\n }\r\n return ok;\r\n }",
"private boolean settingChangedValues(String origJobText, String origJobSkill, String origLocation,\n String origAge) {\n if (!origJobText.contentEquals(mEditTextJobText.getText().toString()) ||\n !origJobSkill.contentEquals(mEditTextSkill.getText().toString()) ||\n !origLocation.contentEquals(mEditTextLocation.getText().toString()) ||\n !origAge.contentEquals(mEditTextAge.getText().toString())) {\n return true;\n } else return false;\n }",
"public boolean dataEntered() {\n \t\n \t//finds all the views\n \tEditText txtmatch = (EditText) this.findViewById(R.id.te_match_num);\n\t\tEditText txtteam = (EditText) this.findViewById(R.id.te_team_num);\n\t\tRadioButton btnBlue = (RadioButton) this.findViewById(R.id.btn_blue);\n\t\tRadioButton btnRed = (RadioButton) this.findViewById(R.id.btn_red);\n\t\t\n\t\tif(!txtmatch.getText().toString().matches(\"\") && \t\t//Checks to make sure a match number was entered\n\t\t !txtteam.getText().toString().matches(\"\") && \t\t//checks to make sure a team number was entered\n\t\t (btnBlue.isChecked() || btnRed.isChecked())){\t\t//checks to make sure an alliance color was selected\n\t\t\treturn true;\n\t\t}return false;\n }",
"private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }",
"private boolean validCreateInput() throws SQLException {\n // Checks if any of the fields is empty\n if(teamNameCreateField.getText().equals(\"\") || abbrevationCreateField.getText().equals(\"\")\n || chooseCityBoxCreate.getValue() == null || chooseLeagueBoxCreate.getValue() == null\n || chooseAgeGroupCreate.getValue() == null || chooseLeagueTeamBoxCreate.getValue() == null){\n displayMessage(messagePane,\"Please fill all the fields\",true);\n return false;\n }\n // Checks the abbrevation length\n else if(abbrevationCreateField.getText().length() > 3)\n {\n displayMessage(messagePane,\"Abbrevations must be at most 3 characters\",true);\n return false;\n }\n // Checks team name length\n else if (teamNameCreateField.getText().length() > 30){\n displayMessage(messagePane,\"Team Names must be smaller than 30 characters\",true);\n return false;\n }\n return true;\n }",
"private boolean isInputOkay() {\n // checks the text fields\n if (mBinding.date.getText() == null || mBinding.date.getText().toString().equals(\"\")) {\n snackBar(\"Please select the date.\");\n return false;\n }\n\n if (mBinding.time.getText() == null || mBinding.time.getText().toString().equals(\"\")) {\n snackBar(\"Please select the time.\");\n return false;\n }\n\n if (mBinding.stress.getText() == null || mBinding.stress.getText().toString().equals(\"\")) {\n snackBar(\"Please select the stress level.\");\n return false;\n }\n\n if (mBinding.tired.getText() == null || mBinding.tired.getText().toString().equals(\"\")) {\n snackBar(\"Please select the tiredness level.\");\n return false;\n }\n\n if (mBinding.mv0.getText() == null || mBinding.mv0.getText().toString().equals(\"\")) {\n snackBar(\"Please select at least the start glucose value.\");\n return false;\n }\n\n return true;\n }",
"private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }",
"private boolean validateInput() {\n String username = editUsername.getText().toString().trim();\n String email = editEmail.getText().toString().trim();\n String password = editPassword.getText().toString().trim();\n String repeatPassword = editRepeatPassword.getText().toString().trim();\n if (!password.equals(repeatPassword)) {\n ShowMessageUtil.tosatSlow(\"Enter passwords differ\", EmailRegisterActivity.this);\n return false;\n } else if (username.equals(\"\") || email.equals(\"\") || password.equals(\"\")) {\n ShowMessageUtil.tosatSlow(\"every item can not be empty!\", EmailRegisterActivity.this);\n return false;\n }\n if (username.length()>10){\n ShowMessageUtil.tosatSlow(\"the character length of the username can't be over than 10\", EmailRegisterActivity.this);\n return false;\n }\n return true;\n }",
"private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }",
"public void validarPostagem() {\n\t\t// validando se o nome motorista ou carona foram preenchidos\n\t\tint verif = 0;\n\t\ttry {\n\t\t\tif (txtCarona.getText() == null\n\t\t\t\t\t|| txtCarona.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (txtMotorista.getText() == null\n\t\t\t\t\t|| txtMotorista.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (verif == 2) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t\tif (txtDestino.getText() == null\n\t\t\t\t\t|| txtDestino.getText().trim().equals(\"\")) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"Para postar no quadro é necessário informar nome (motorista ou passageiro) \"\n\t\t\t\t\t\t\t\t\t+ \"\t\t\t\t\t\t\te local. \\n Por favor certifique se os campos foram preenchidos e tente novamente.\");\n\t\t}\n\n\t}",
"public static boolean checkTwoStringsAreZeroOrOneEditsAway(String first, String second) {\n if (first.length() == second.length()) {\n return oneEditReplace(first, second);\n }else if(first.length() - 1 == second.length()){\n return oneEditInsert(second, first);\n }else if(first.length() + 1 == second.length())\n return oneEditInsert(first, second);\n\n return false;\n }",
"private boolean checkForInvalidInput(){\n String email = emailTextView.getText().toString();\n String password = passwordTextView.getText().toString();\n String name = usernameTextView.getText().toString();\n\n\n if(email.isEmpty() || password.isEmpty() || name.isEmpty()){\n Toast.makeText(getApplicationContext(),\"Please fill in all fields\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n\n if(!email.contains(\"@\")){\n Toast.makeText(getApplicationContext(),\"Please enter a valid email\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n if(!isStudent && !isTeacher){\n Toast.makeText(getApplicationContext(),\"Please select Student or Teacher\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n\n\n\n\n // add more checks?\n\n return true;\n\n }",
"private boolean isInputValid(){\n boolean isUserInfoValid = userInfoCheck();\n boolean isProductInfoValid = productInfoCheck();\n ImageView iv_error_user_info = findViewById(R.id.iv_error_user_info);\n ImageView iv_error_product_info = findViewById(R.id.iv_error_product_info);\n if(!isUserInfoValid){\n iv_error_user_info.setVisibility(View.VISIBLE);\n }else{\n iv_error_user_info.setVisibility(View.INVISIBLE);\n }\n if (!isProductInfoValid){\n iv_error_product_info.setVisibility(View.VISIBLE);\n }else{\n iv_error_product_info.setVisibility(View.INVISIBLE);\n }\n\n return isUserInfoValid && isProductInfoValid;\n }",
"private int isFormValid() {\n Calendar start = new GregorianCalendar(datePicker1.year, datePicker1.month, datePicker1.day, timePicker1.hour, timePicker1.minute);\n Calendar end = new GregorianCalendar(datePicker2.year, datePicker2.month, datePicker2.day, timePicker2.hour, timePicker2.minute);\n if (end.before(start))\n return ERR_START_AFTER_END;\n Switch onOffSwitch = (Switch) findViewById(R.id.toggBtn);\n if (!onOffSwitch.isChecked()) {\n long seconds = (end.getTimeInMillis() - start.getTimeInMillis()) / 1000;\n if (seconds > SECONDS_IN_A_DAY)\n return ERR_START_AFTER_END;\n }\n return NO_ERR;\n }",
"public static void checkEnterAnswersFields() {\r\n\t\tcheckNoSuchElementExceptionByName(\"answer1\", \"\\\"Enter answer\\\" field\");\r\n\t}",
"private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }",
"private void checkInputData(){\n if(!TextUtils.isEmpty(email.getText())){\n if(!TextUtils.isEmpty(password.getText())){\n //Below code is only for testing purposes.\n //signInprogressBar.setVisibility(View.VISIBLE);\n mainSignInBtn.setEnabled(true);\n mainSignInBtn.setTextColor(Color.rgb(255,255,255));\n\n }else {\n mainSignInBtn.setEnabled(false);\n mainSignInBtn.setTextColor(Color.argb(50,255,255,255));\n }\n }else {\n mainSignInBtn.setEnabled(false);\n mainSignInBtn.setTextColor(Color.argb(50,255,255,255));\n }\n }",
"public boolean validate()\n {\n EditText walletName = findViewById(R.id.walletName);\n String walletNameString = walletName.getText().toString();\n\n EditText walletBalance = findViewById(R.id.walletBalance);\n String walletBalanceString = walletBalance.getText().toString();\n\n if (TextUtils.isEmpty(walletNameString))\n {\n walletName.setError(\"This field cannot be empty\");\n\n return false;\n }\n else if (TextUtils.isEmpty(walletBalanceString))\n {\n walletBalance.setError(\"This field cannot be empty\");\n\n return false;\n }\n else\n {\n return true;\n }\n }",
"private boolean hasCorrectDetails() {\n // set any error to null\n mEdit_name_layout.setError(null);\n mEmail_input_layout.setError(null);\n mPassword_input_layout.setError(null);\n\n View focusView = null;\n boolean cancel = false;\n\n // grab data from views\n mPassword = mPassword_input_layout.getEditText().getText().toString().trim();\n mEmail = mEmail_input_layout.getEditText().getText().toString().trim();\n mName = mEdit_name_layout.getEditText().getText().toString().trim();\n mGender = mRadioGender.indexOfChild(findViewById(mRadioGender.getCheckedRadioButtonId()));\n mPhone = mPhone_input_layout.getEditText().getText().toString().trim();\n mMajor = mMajor_input_layout.getEditText().getText().toString().trim();\n mYearGroup = mClass_input_layout.getEditText().getText().toString().trim();\n\n\n if (TextUtils.isEmpty(mName)) {\n mEdit_name_layout.setError(getString(R.string.error_field_required));\n cancel = true;\n }\n\n if (!isPasswordValid(mPassword)) {\n focusView = mPassword_input_layout;\n focusView.requestFocus();\n cancel = true;\n }\n\n if (!isEmailValid(mEmail)) {\n focusView = mEdit_name_layout;\n cancel = true;\n }\n\n if (mGender < 0) {\n Toast.makeText(this, \"Gender \" + getString(R.string.error_field_required),\n Toast.LENGTH_SHORT).show();\n focusView = mRadioGender;\n cancel = true;\n }\n if (cancel) {\n if (focusView != null) {\n focusView.requestFocus();\n }\n return false;\n } else {\n // all is good, return true\n return true;\n }\n\n }",
"public void checkData(){\n if (isEmpty(etEmailLogin)){\n etEmailLogin.setError(\"Enter Email\");\n }\n\n //to check if the email is valid\n else if (!isEmail(etEmailLogin)){\n Toast.makeText(this, \"Please Enter Email Address\", Toast.LENGTH_SHORT).show();\n }\n\n //to check if the password is entered\n else if (isEmpty(etPasswordLogin)){\n etPasswordLogin.setError(\"Enter Password\");\n }\n }",
"private boolean getTests() {\n boolean genderTest = genderSpinner.getValue().equals(currentContact.getGender());\n boolean birthdayTest = dateModel.getValue().equals(currentContact.getBirthday());\n boolean emailTest = emailField.getText().equals(currentContact.getEmail());\n boolean mobileTest = mobileField.getText().equals(currentContact.getMobile());\n boolean homeTest = homeField.getText().equals(currentContact.getHome());\n boolean motherTest = motherField.getText().equals(currentContact.getMother());\n boolean fatherTest = fatherField.getText().equals(currentContact.getFather());\n boolean addressTest = addressArea.getText().equals(currentContact.getAddress());\n return genderTest && birthdayTest && emailTest && mobileTest && homeTest && motherTest && fatherTest && addressTest;\n }"
] | [
"0.7171526",
"0.70392084",
"0.69503736",
"0.67561364",
"0.67454016",
"0.6668986",
"0.6647222",
"0.6497079",
"0.64845514",
"0.6472985",
"0.64705914",
"0.64556825",
"0.6446789",
"0.6361906",
"0.6342086",
"0.63170564",
"0.63036406",
"0.62975407",
"0.6264773",
"0.6239539",
"0.62390304",
"0.62340873",
"0.62149024",
"0.61860836",
"0.61748624",
"0.6137422",
"0.6135325",
"0.6125726",
"0.61128277",
"0.6101653",
"0.6073103",
"0.6063853",
"0.6062013",
"0.60535735",
"0.60503274",
"0.6046441",
"0.60455745",
"0.60371757",
"0.6028941",
"0.6028473",
"0.60129416",
"0.6012447",
"0.6003636",
"0.59987944",
"0.5996815",
"0.5995549",
"0.5987475",
"0.5973652",
"0.5968268",
"0.59598505",
"0.59397876",
"0.5933272",
"0.59190005",
"0.5909313",
"0.59089863",
"0.5905056",
"0.5904451",
"0.58837837",
"0.58797365",
"0.58771545",
"0.58770967",
"0.5848279",
"0.58368045",
"0.58273184",
"0.58257425",
"0.5824905",
"0.58215517",
"0.5812774",
"0.5812028",
"0.5804913",
"0.58036566",
"0.58026266",
"0.5802052",
"0.58015907",
"0.5781628",
"0.5779309",
"0.57769954",
"0.57767624",
"0.5775909",
"0.5774734",
"0.57746506",
"0.5769559",
"0.5767257",
"0.57536936",
"0.5747812",
"0.5735724",
"0.5723007",
"0.571977",
"0.57173437",
"0.57105744",
"0.57049245",
"0.568659",
"0.56847465",
"0.5680398",
"0.56689817",
"0.56685966",
"0.56409997",
"0.5640921",
"0.5606799",
"0.56049097",
"0.56043696"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.login_screen, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.72461367",
"0.7201596",
"0.7195268",
"0.7177002",
"0.71069986",
"0.7039653",
"0.70384306",
"0.70115715",
"0.7010647",
"0.69803435",
"0.6945406",
"0.69389313",
"0.6933442",
"0.69172275",
"0.69172275",
"0.6890826",
"0.6883689",
"0.687515",
"0.6874831",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68522274",
"0.6846375",
"0.68189865",
"0.68165565",
"0.68124795",
"0.6812267",
"0.6812267",
"0.68056566",
"0.6800461",
"0.6797465",
"0.6790805",
"0.6789039",
"0.6787885",
"0.6782993",
"0.67597246",
"0.67570525",
"0.6747535",
"0.6743268",
"0.6743268",
"0.6740546",
"0.67395175",
"0.67256093",
"0.6723954",
"0.6722248",
"0.6722248",
"0.6720444",
"0.67118156",
"0.6706721",
"0.6704184",
"0.66993994",
"0.66988564",
"0.669681",
"0.66943884",
"0.66860807",
"0.668306",
"0.668306",
"0.6682587",
"0.668012",
"0.6678661",
"0.6676379",
"0.6668044",
"0.66669863",
"0.66628903",
"0.6657356",
"0.6657356",
"0.6657356",
"0.66565585",
"0.665397",
"0.665397",
"0.665397",
"0.66525495",
"0.66518986",
"0.66496557",
"0.6648199",
"0.6646489",
"0.66462386",
"0.6646177",
"0.6645531",
"0.66453475",
"0.66446036",
"0.66438025",
"0.6642411",
"0.6641632",
"0.6638948",
"0.6634394",
"0.66336566",
"0.6632082",
"0.66315377",
"0.66315377",
"0.66315377",
"0.6628936",
"0.6627818",
"0.6627061",
"0.66256744",
"0.6623986",
"0.661993",
"0.6618369",
"0.6618369"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (YangHeZiApplication.tppe==0) return;
requestWindowFeature(Window.FEATURE_NO_TITLE);
initContentView(R.layout.base_activity);
infoView();
// checkLogin();
addNotifyUpdate();
Log.e("Activity:",getClass().getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_edit_account, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.72461367",
"0.7201596",
"0.7195268",
"0.7177002",
"0.71069986",
"0.7039653",
"0.70384306",
"0.70115715",
"0.7010647",
"0.69803435",
"0.6945406",
"0.69389313",
"0.6933442",
"0.69172275",
"0.69172275",
"0.6890826",
"0.6883689",
"0.687515",
"0.6874831",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68522274",
"0.6846375",
"0.68189865",
"0.68165565",
"0.68124795",
"0.6812267",
"0.6812267",
"0.68056566",
"0.6800461",
"0.6797465",
"0.6790805",
"0.6789039",
"0.6787885",
"0.6782993",
"0.67597246",
"0.67570525",
"0.6747535",
"0.6743268",
"0.6743268",
"0.6740546",
"0.67395175",
"0.67256093",
"0.6723954",
"0.6722248",
"0.6722248",
"0.6720444",
"0.67118156",
"0.6706721",
"0.6704184",
"0.66993994",
"0.66988564",
"0.669681",
"0.66943884",
"0.66860807",
"0.668306",
"0.668306",
"0.6682587",
"0.668012",
"0.6678661",
"0.6676379",
"0.6668044",
"0.66669863",
"0.66628903",
"0.6657356",
"0.6657356",
"0.6657356",
"0.66565585",
"0.665397",
"0.665397",
"0.665397",
"0.66525495",
"0.66518986",
"0.66496557",
"0.6648199",
"0.6646489",
"0.66462386",
"0.6646177",
"0.6645531",
"0.66453475",
"0.66446036",
"0.66438025",
"0.6642411",
"0.6641632",
"0.6638948",
"0.6634394",
"0.66336566",
"0.6632082",
"0.66315377",
"0.66315377",
"0.66315377",
"0.6628936",
"0.6627818",
"0.6627061",
"0.66256744",
"0.6623986",
"0.661993",
"0.6618369",
"0.6618369"
] | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }"
] | [
"0.7904975",
"0.78056985",
"0.77671826",
"0.77275974",
"0.7632173",
"0.7622138",
"0.75856143",
"0.7531176",
"0.7488386",
"0.74576557",
"0.74576557",
"0.74391466",
"0.7422802",
"0.7403698",
"0.7392229",
"0.73873955",
"0.73796785",
"0.737091",
"0.73627585",
"0.7356357",
"0.73460615",
"0.73415256",
"0.73305213",
"0.7329754",
"0.7326127",
"0.731949",
"0.73171073",
"0.7314056",
"0.7304481",
"0.7304481",
"0.73022866",
"0.72986156",
"0.7293808",
"0.7287263",
"0.72836643",
"0.72815806",
"0.72789687",
"0.72602886",
"0.72602886",
"0.72602886",
"0.7259816",
"0.7259814",
"0.72502047",
"0.7225156",
"0.7219905",
"0.7217096",
"0.72046524",
"0.72012514",
"0.7201042",
"0.71939653",
"0.71857035",
"0.71786326",
"0.7169012",
"0.7167622",
"0.7154164",
"0.71538347",
"0.7136608",
"0.7135137",
"0.7135137",
"0.7129952",
"0.7129347",
"0.71241516",
"0.7123588",
"0.7123425",
"0.71223265",
"0.71175927",
"0.71175927",
"0.71175927",
"0.71175927",
"0.71171945",
"0.71171755",
"0.71165764",
"0.7114952",
"0.71124375",
"0.7109778",
"0.7109144",
"0.7105842",
"0.71002746",
"0.70984215",
"0.7096018",
"0.709392",
"0.709392",
"0.70864546",
"0.7083677",
"0.708144",
"0.70804363",
"0.70738995",
"0.7068429",
"0.7061805",
"0.7060801",
"0.7060423",
"0.7051581",
"0.7037953",
"0.7037953",
"0.70359737",
"0.7035605",
"0.7035605",
"0.7033388",
"0.70312315",
"0.7029681",
"0.70192695"
] | 0.0 | -1 |
Returns a List of the SingleSeatCraft contained in this packet. | public List<SingleSeatCraft> getCraftList() {
return mCraftList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Seat> getSeats() {\n return Collections.unmodifiableList(seats);\n }",
"public ArrayList<Seat> getSeatList() {\n\t\treturn Sdao.selectSeatList();\r\n\t}",
"public List<Seat> listAll() {\n\t\treturn repository.findAll();\n\t}",
"public List<List<Seat>> getFirst() {\n\t\treturn first;\n\t}",
"public ArrayList<SeatHold> getSeat() {\n\t\treturn seat;\n\t}",
"public List<Seat> getSeatsHeld() { return seatsHeld; }",
"public ArrayList<Seat> fetchSeatDatabaseContentToList() { \n\n\t\tArrayList<Seat> listOfSeats = (ArrayList<Seat>) seatdb.fetchDatabaseContent();\n\t\tif (listOfSeats.isEmpty()) {\n\t\t\tSystem.out.println(\"There's no seats stored in database!\");\n\t\t\treturn null;\n\t\t}\n\t\treturn listOfSeats;\n\t}",
"@Override\r\n\tpublic List<Aircraft> findAircraftBySeats(int seats) {\r\n\t\t/*\r\n\t\t * We will need to read through our arrayList and return only \r\n\t\t * the Aircrafts with the specified seats number.\r\n\t\t * Initializing a new array for output.\r\n\t\t */\r\n\t\t\r\n\t\tList<Aircraft> output = new ArrayList<Aircraft>();\r\n\t\t\r\n\t\tfor(Aircraft x : airCrafts)\r\n\t\t{\r\n\t\t\tif(x.getSeats() >= seats)\r\n\t\t\t\toutput.add(x);\r\n\t\t}\r\n\t\treturn output;\r\n\t}",
"public ArrayList<Seat> getAllAvailableSeats() {\n ArrayList<Seat> allAvailableSeats = new ArrayList<>();\n\n for (Row r : this.theater.getAllRows()) {\n allAvailableSeats.addAll(r.getAllAvailableSeats());\n }\n return allAvailableSeats;\n }",
"@ModelAttribute(\"crafts\")\n public List<Craft> getCrafts(){\n return craftService.listAll();\n }",
"public ArrayList<Seat> getSeatsFromScreenInfo(ScreenInfo screenInfo){\r\n ArrayList<Seat> result = new ArrayList<>();\r\n String name = screenInfo.getName();\r\n Seat seat;\r\n for(Map.Entry<String, RowInfo> row : screenInfo.getSeatInfo().entrySet()){\r\n for(int seatNumber=0;seatNumber<row.getValue().getNumberOfSeats();seatNumber++) {\r\n seat = new Seat(name, row.getKey(), seatNumber, false, row.getValue().getAisleSeats().contains(seatNumber));\r\n result.add(seat);\r\n }\r\n }\r\n return result;\r\n }",
"public List<SeatEntity> getAll();",
"public List<Sacca> getSacche() {\n return sacche;\n }",
"@Override\r\n\tpublic List<Aircraft> getAllAircraft() {\r\n\t\treturn airCrafts;\r\n\t}",
"public final Collection<ChestCharacter> allChestCharacters() {\n return chestCharacters.values();\n }",
"public Seat getSeat()\r\n\t{\r\n\t\tif( seat != null )\r\n\t\t{\r\n\t\t\treturn seat;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\t}",
"public List<Render.ReservationStationEntryWrapper> toList() {\n List<Render.ReservationStationEntryWrapper> ret = new ArrayList<>();\n for (int i = 0; i < table.length; i++) {\n Render.ReservationStationEntryWrapper wrapper = new Render.ReservationStationEntryWrapper(table[i], i);\n ret.add(wrapper);\n }\n return ret;\n }",
"@Override\n public List<Vessel> getVessels() {\n return new ArrayList<>(boats);\n }",
"public String getSeat() {\n\t\t\treturn seat;\n\t\t}",
"public ArrayList<Vehicle> getShips() {\n return vehicles.stream().filter(loc -> loc.getClass().getSuperclass().getSimpleName().equals(\"Ship\")).collect(Collectors.toCollection(ArrayList::new));\n }",
"public List<Card> getCardsInPlay() {\n List<Card> cards = new ArrayList<>(cardsInPlayStack);\n cardsInPlayStack.removeAllElements();\n return cards;\n }",
"public List<Card> getCards() {\n\t\treturn new ArrayList<Card>(this.content);\n\t}",
"public List<Object> getShips() {\n return ships;\n }",
"public void setSeatsHeld(List<Seat> seatsHeld) { this.seatsHeld = seatsHeld; }",
"@Override\n\tpublic List<Seats> getAllSeats()\n\t{\n\t\tQuery query = getSession().createQuery(\"select s from Seats s \");\n\t\tList<Seats> seatList=query.list();\n\t\treturn seatList;\n\t}",
"public static List<Sighting> all() {\n\t\tString sql = \"SELECT id, name, location, rangerName FROM sightings\";\n\t\ttry(Connection con = DB.sql2o.open()) {\n\t\t\treturn con.createQuery(sql).executeAndFetch(Sighting.class);\n\t\t}\n\t}",
"@Override\n\tpublic List<Seats> getSeatById(Long seatId)\n\t{\n\t\tQuery query = getSession().createQuery(\"From Seats s where id:=id\");\n\t\tquery.setParameter(\"id\",seatId);\n\t\tList<Seats> seatList=query.list();\n\t\treturn seatList;\n\t}",
"public List<Card> getCards(){\n\t\treturn this.pile;\n\t}",
"@JsonIgnore public Collection<Mass> getSaturatedFatContents() {\n final Object current = myData.get(\"saturatedFatContent\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<Mass>) current;\n }\n return Arrays.asList((Mass) current);\n }",
"public List<Ship> getShips()\n {\n return this.fleet;\n }",
"public List<Card> getCards() {\n return new ArrayList<Card>(cards);\n }",
"public ArrayList<card> displayPack()\n {\n dbObj=new dbFlashCards(uid);\n return dbObj.fetchAllCards(packId);\n \n \n \n }",
"public List<Cheese> getCheeseList() {\n\t\tif (cheesesInStock.isEmpty())\n\t\t\treturn Collections.emptyList();\t// Always return same list\n\t\telse\n\t\t\treturn new ArrayList<Cheese>(cheesesInStock);\n\t}",
"private List<WeatherStation> getWeatherStations(){\n List<WeatherStation> weatherStations = new ArrayList<>();\n List<String> weatherStationList = new ArrayList<>();\n weatherStationList.add(Constants.STATION_CODE_ADELAIDE);\n weatherStationList.add(Constants.STATION_CODE_BRISBANE);\n weatherStationList.add(Constants.STATION_CODE_CAIRNS);\n weatherStationList.add(Constants.STATION_CODE_CANBERRA);\n weatherStationList.add(Constants.STATION_CODE_DARWIN);\n weatherStationList.add(Constants.STATION_CODE_GOLD_COAST);\n weatherStationList.add(Constants.STATION_CODE_HOBART);\n weatherStationList.add(Constants.STATION_CODE_MELBOURNE);\n weatherStationList.add(Constants.STATION_CODE_PERTH);\n weatherStationList.add(Constants.STATION_CODE_SYDNEY);\n\n for(String weatherStationCode : weatherStationList){\n weatherStations.add(WeatherStationFactory.getWeatherStation(weatherStationCode));\n }\n return weatherStations;\n }",
"public List<TilePojo> getCharacterList() {\n\t\tList<TilePojo> charList;\n\t\tcharList = getFixedNumberChar(characterList, 12);\n\t\treturn charList;\n\t}",
"public String getSeatType() {\n return seatType;\n }",
"@Override\n\tpublic PlayingCard[] getCards() {\n\t\tif(getCount() != 0) {\n\t\t\tPlayingCard[] kopie = new SkatCard[getCount()];\n\t\t\tfor(int i = 0; i < getCount(); i++) {\n\t\t\t\tkopie[i] = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t}\n\t\t\treturn kopie;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer --> Kopie vom Stapel leer\");\n\t\t\treturn null;\n\t\t}\n\t}",
"public List<OwnedWarp> getWarps(String player) {\n return warps.get(player);\n }",
"@Override\n public Map<Integer, PenghuziPlayer> getSeatMap() {\n return seatMap;\n }",
"public LinkedHashSet<Spot> getSpotSet() {\n if (spotSet == null) {\n spotSet = new LinkedHashSet<>();\n for (int x = 0; x < WIDTH; x++) {\n for (int y = 0; y < HEIGHT; y++) {\n spotSet.add(board[x][y]);\n }\n }\n }\n return spotSet;\n }",
"@Override\n\tpublic List<seatStructure> seatNUM(int s) {\n\t\treturn userdao.seatNUM(s);\n\t}",
"public List<Location> getSpawns(){\n\t\treturn spawns;\n\t}",
"public Station[] getStations()\n {\n Vector<Station> ret_stations = new Vector<Station>();\n for (Station station : stations)\n if (station != null)\n ret_stations.add(station);\n return ret_stations.toArray(new Station[0]);\n }",
"public Collection<Card> getCopyOfCardsList() {\n\t\treturn new ArrayList<>(cards);\n\t}",
"@JsonIgnore public Collection<String> getAircraftStrings() {\n final Object current = myData.get(\"aircraft\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<String>) current;\n }\n return Arrays.asList((String) current);\n }",
"public List<Choosecat> FindAll_Choosecat() {\r\n\t\treturn ChoosecatService.FindAll(\"id\", JPAOp.Asc);\r\n\t}",
"java.util.List<com.rpg.framework.database.Protocol.Monster> \n getMonstersList();",
"java.util.List<com.rpg.framework.database.Protocol.Monster> \n getMonstersList();",
"public List<List<Seat>> getBuisness() {\n\t\treturn buisness;\n\t}",
"public List<Colony> getColoniesGivenBy(Player player) {\n List<Colony> colonyList = new ArrayList<Colony>();\n for (TradeItem ti : items) {\n if (ti instanceof ColonyTradeItem && player == ti.getSource()) {\n colonyList.add(((ColonyTradeItem)ti).getColony());\n }\n }\n return colonyList;\n }",
"public StationSet getStation()\n {\n StationSet result = new StationSet();\n \n for (Train obj : this)\n {\n result.with(obj.getStation());\n }\n \n return result;\n }",
"public ArrayList<FlashCard> getFlashCards()\n\t{\n\t\tfor(int i = 0; i < 10; i++)\n\t\t{\n\t\t\tthis.getLine();\n\t\t\tString tempQue = line.split(\":\")[0];\n\t\t\tString tempAns = line.split(\":\")[1];\n\t\t\tFlashCard flashCard = new FlashCard(tempQue, tempAns);\n\t\t\tfcArray.add(flashCard);\n\t\t}\n\n\t\treturn fcArray;\n\t}",
"@JsonIgnore public Collection<Vehicle> getAircraftVehicles() {\n final Object current = myData.get(\"aircraft\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<Vehicle>) current;\n }\n return Arrays.asList((Vehicle) current);\n }",
"public static List<Flashcard> generateStudySet() {\n\n Flashcard card1 = new Flashcard(\"ANT\", \n \"Another Neat Tool, a Java library for building Java projects\", 1); \n Flashcard card2 = new Flashcard(\"HTTP\", \"HyperText Transfer Protocol for \"\n + \"browser requests and server responses.\", 2); \n Flashcard card3 = new Flashcard(\"Servlet\", \"A Java class that handles \" \n + \"browser requests by sending responses with data.\", 2); \n Flashcard card4 = new Flashcard(\"JSP\", \"Java Server Page, server-compiled \" \n + \"webpages.\", 3);\n\n ArrayList<Flashcard> flashcards = new ArrayList<Flashcard>(); \n flashcards.add(card1);\n flashcards.add(card2);\n flashcards.add(card3);\n flashcards.add(card4);\n \n return flashcards; \n\n }",
"private List<StadiumModel> dummyDataStadiumList()\n\t{\n\t\tfinal StadiumModel wembley = new StadiumModel();\n\t\twembley.setCode(STADIUM_NAME);\n\t\twembley.setCapacity(STADIUM_CAPACITY);\n\t\tfinal List<StadiumModel> stadiums = new ArrayList<StadiumModel>();\n\t\tstadiums.add(wembley);\n\t\treturn stadiums;\n\t}",
"public Block[] getCannons() {\n\t\tArrayList<Block> cannons = new ArrayList<Block>();\n\t\tfor (int i = 0; i < this.blocks.length; i++) {\n\t\t\tif (blocks[i].getType().equals(Material.DISPENSER))\n\t\t\t\tcannons.add(blocks[i]);\n\t\t}\n\t\treturn cannons.toArray(new Block[0]);\n\t}",
"public ArrayList<Cards> getSeedCards() {\r\n\t\treturn seedCards;\r\n\t}",
"public List<List<GameCard>> getPlayerCardsList() {\n return this.playerCardsList;\n }",
"public List<Station> stations() {\n return List.of(station1, station2);\n }",
"public ArrayList<Card> giveAllCards() {\n\t\tArrayList<Card> temp = new ArrayList<Card>();\n\t\ttemp.addAll(cards);\n\t\tcards.clear();\n\t\ttopCard = new Card();\n\t\treturn temp;\n\t}",
"@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}",
"public List<List<Seat>> getEconomy() {\n\t\treturn economy;\n\t}",
"private List<SeatHold> getHoldTickets(Instant instant) {\n List<SeatHold> seatHolds = seatHoldMap.values()\n .stream()\n .filter(seatHold -> seatHold.getDate()\n .isBefore(LocalDateTime.ofInstant(instant, ZoneId.systemDefault())))\n .collect(Collectors.toList());\n return seatHolds;\n }",
"@Override\r\n\tpublic Collection<Sticker> list(Sticker sticker) {\n\t\treturn sst.selectList(\"stickerns.list\",sticker);\r\n\t}",
"public List<Card> getCards() throws RemoteException {\n return mainScreenProvider.getCards();\n }",
"default List<Player> getViewers(Class<? extends SimpleInventory> clazz) {\n return this.getViewers().stream()\n .filter(viewer -> this.getOpenedInventory(viewer).getClass().equals(clazz))\n .collect(Collectors.toList());\n }",
"public List<Card> getCards()\n {\n // RETURN the CardMessage's list of <code>ClueCards</code>\n return this.cards;\n }",
"public List<Tile> getOwnedTiles() {\n return new ArrayList<Tile>(ownedTiles);\n }",
"public List < Block > getLineOfSight ( Set < Material > transparent , int maxDistance ) {\n\t\treturn invokeSafe ( \"getLineOfSight\" ,\n\t\t\t\t\t\t\tnew Class[] { Set.class , int.class } , transparent , maxDistance );\n\t}",
"public List<TicTacToeCoordinates> getAvailableSpots() {\n List<TicTacToeCoordinates> openSpots = new ArrayList<>();\n for (int x = 0; x < boardLength; x++) {\n for (int y = 0; y < boardWidth; y++) {\n if (board[x][y] == '\\u0000') {\n openSpots.add(new TicTacToeCoordinates(x, y));\n }\n }\n }\n return openSpots;\n }",
"public ArrayList<Tile> getDeckTiles() {\n\t\treturn tileDeck.getDeck();\n\t}",
"public void setFirst(List<List<Seat>> first) {\n\t\tthis.first = first;\n\t}",
"public LinkedList<Station> getStations() {\n return stations;\n }",
"public Seat getSeatById(Long id) {\n\t\treturn repository.getSeatById(id);\n\t}",
"public List<Card> getCards() {\n\t\treturn cards;\n\t}",
"public FormattedSeatsDTO(List<Seat> seats) {\n\t\n\t\tthis.first = new ArrayList<>();\n\t\tthis.buisness = new ArrayList<>();\n\t\tthis.economy = new ArrayList<>();\n\t\t\n\t\tList<Seat> rowFirst = new ArrayList<>();\n\t\tList<Seat> rowBuisness = new ArrayList<>();\n\t\tList<Seat> rowEconomy = new ArrayList<>();\n\t\t\n\t\t// Creates the rows of seats\n\t\tfor (Seat seat : seats) {\n\t\t\tif (seat.getSeatType().getSeatTypeId() == 1) {\n\t\t\t\tempty = false;\n\t\t\t\trowEconomy.add(seat);\n\t\t\t\tif (rowEconomy.size() == 6){\n\t\t\t\t\tthis.economy.add(rowEconomy);\n\t\t\t\t\trowEconomy = new ArrayList<>();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (seat.getSeatType().getSeatTypeId() == 2) {\n\t\t\t\tempty = false;\n\t\t\t\trowBuisness.add(seat);\n\t\t\t\tif (rowBuisness.size() == 6){\n\t\t\t\t\tthis.buisness.add(rowBuisness);\n\t\t\t\t\trowBuisness = new ArrayList<>();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (seat.getSeatType().getSeatTypeId() == 3) {\n\t\t\t\tempty = false;\n\t\t\t\trowFirst.add(seat);\n\t\t\t\tif (rowFirst.size() == 4){\n\t\t\t\t\tthis.first.add(rowFirst);\n\t\t\t\t\trowFirst = new ArrayList<>();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"Seat getSeat(int seatId);",
"public List<Card> getCards()\n {\n return this.deckOfCards;\n }",
"@Override\n\tpublic List<String> listSector() {\n\t\treturn repository.distinctSector();\n\t}",
"public Seat getSeat(String seatID) {\n\t\tfor(ArrayList<Seat> row : this.seats){\n\t\t\tfor(Seat seat : row){\n\t\t\t\tif(seat.getSeatID().equals(seatID)){\n\t\t\t\t\treturn seat;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Collection<Seance> getSeances() {\n RestTemplate restTemplate = new RestTemplate();\n String url = \"http://admin:8080/cinema/seances\";\n Collection<Seance> r = null;\n Collection<Seance> result = restTemplate.getForObject(url, r.getClass());\n return result;\n }",
"public ArrayList<Station> getStations() {\n\t\treturn stations;\n\t}",
"public int[] getInputSeat() {\n\t\tint[] seat = new int[2];\n\t\tString input;\n\t\tint A = (int)('A');\n\t\twhile (true) {\n\t\t\tinput = this.getInputString();\n\t\t\tif (!input.matches(\"[A-Z]\\\\d+\")) {\n\t\t\t\tSystem.out.println(\"Wrong format! Please try again:\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint row = (int)input.charAt(0) - A;\n\t\t\tint col = Integer.valueOf(input.substring(1));\n\t\t\tif (this.showtimes.isAvailableSeat(row, col)) {\n\t\t\t\tseat[0] = row;\n\t\t\t\tseat[1] = col;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn seat;\n\t}",
"public List<Pair> GetSnake() {\n return snake;\n }",
"@Override\n public List<Set<String>> getPlayersVisibleTo(){\n Set<String> players = new HashSet<String>();\n players.add(destination.getOwner().getName());\n for(Region adj : destination.getAdjRegions()){\n players.add(adj.getOwner().getName());\n }\n //All adjacent can see cloaking happened\n return Arrays.asList(players);\n }",
"public List<Establishment> establishmentCanTrade() {\n List<Establishment> can_take = new ArrayList<> ();\n for(int i = 0; i < Establishments.size(); i++) {\n Establishment check = Establishments.get(i);\n if(check.getName().equals(\"Wheat Field\") || check.getName().equals(\"Bakery\")) {\n if (check.getAvailable() > 1) {\n can_take.add(check);\n }\n } else if(!check.getColor().equals(Card.Color.PURPLE)) {\n can_take.add(check);\n }\n }\n return can_take;\n }",
"public List<Treasure> giveInventory() {\r\n return treasures;\r\n }",
"public final HashSet<Drop> getDeponents() {\r\n synchronized (f_seaLock) {\r\n return new HashSet<>(f_deponents);\r\n }\r\n }",
"default List<Player> getViewers(SimpleInventory inventory) {\n return this.getViewers().stream()\n .filter(viewer -> this.getOpenedInventory(viewer).equals(inventory))\n .collect(Collectors.toList());\n }",
"public io.vertigo.dynamo.domain.model.DtList<com.kleegroup.formation.domain.formation.SessionFormation> getSessionFormationList() {\n//\t\treturn this.<com.kleegroup.formation.domain.formation.SessionFormation> getList(getSessionFormationListURI());\n\t\t// On doit avoir une clé primaire renseignée. Si ce n'est pas le cas, on renvoie une liste vide\n\t\tif (io.vertigo.dynamo.domain.util.DtObjectUtil.getId(this) == null) {\n\t\t\treturn new io.vertigo.dynamo.domain.model.DtList<>(com.kleegroup.formation.domain.formation.SessionFormation.class);\n\t\t}\n\t\tfinal io.vertigo.dynamo.domain.model.DtListURI fkDtListURI = getSessionFormationDtListURI();\n\t\tio.vertigo.lang.Assertion.checkNotNull(fkDtListURI);\n\t\t//---------------------------------------------------------------------\n\t\t//On est toujours dans un mode lazy.\n\t\tif (sessionFormation == null) {\n\t\t\tsessionFormation = io.vertigo.app.Home.getApp().getComponentSpace().resolve(io.vertigo.dynamo.store.StoreManager.class).getDataStore().findAll(fkDtListURI);\n\t\t}\n\t\treturn sessionFormation;\n\t}",
"public List<SpawnPoint> getSpawns() {\n\t\treturn spawns;\n\t}",
"public ArrayList<Tile> getSilkBag() {\r\n return silkBag;\r\n }",
"public static List<ScrumPokerCard> getDeck() {\n return Arrays.stream(values()).collect(Collectors.toList());\n }",
"ArrayList<Tile> getTilesPlayerOne() throws RemoteException;",
"public List<Integer> boardingGate(List<Integer> seatNumberList) {\n\t\tList<Integer> gates = new ArrayList <Integer>();\n\t\n\t\t\n\t\tfor (int i =0; i < seatNumberList.size(); i++) {\n\t\t\tif (0 < seatNumberList.get(i) && seatNumberList.get(i) <11) {\n\t\t\t\tgates.add(seatNumberList.get(i));\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < seatNumberList.size(); i++ ) {\n\t\t\tif(10 < seatNumberList.get(i) && seatNumberList.get(i) <21) {\n\t\t\t\tgates.add(seatNumberList.get(i));\n\t\t\t}\n\t\t}\n\t\t\tfor (int i =0; i < seatNumberList.size(); i++) {\n\t\t\t\tif (20 < seatNumberList.get(i) && seatNumberList.get(i) <31) {\n\t\t\t\t\tgates.add(seatNumberList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\treturn gates;\n\t}",
"public List<Car> getCars() {\n List<Car> cars = new ArrayList<>();\n\n for (Car car : DatabaseManager.getCars()) {\n if (!car.isReserved()) {\n cars.add(car);\n }\n }\n\n return cars;\n }",
"public List<Card> getCards(){\r\n\t\treturn cards;\r\n\t}",
"public List<Attack> getAttacks()\n\t{\n\t\treturn attacks;\n\t}",
"private List<Boat> playStateBoats() {\n\t\tList<Boat> output = new ArrayList<>();\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tBoat boat = this.boats.get(generator.nextInt(this.boats.size() - 1));\n\t\t\toutput.add(boat);\n\t\t\tthis.boats.remove(boat);\n\t\t}\n\t\treturn output;\n\t}",
"public ArrayList<Ship> getShipsOnBoard(){\n return ships;\n }"
] | [
"0.6725367",
"0.6556544",
"0.6269812",
"0.6257194",
"0.6157384",
"0.60972637",
"0.60087866",
"0.5894948",
"0.58658016",
"0.5753755",
"0.5722723",
"0.5535824",
"0.5506311",
"0.5449677",
"0.54489744",
"0.5388004",
"0.5364393",
"0.5350436",
"0.53403264",
"0.5294582",
"0.52666223",
"0.5244649",
"0.5194817",
"0.51920724",
"0.51822215",
"0.5140021",
"0.5134032",
"0.5109373",
"0.5107355",
"0.50999063",
"0.5084826",
"0.50741696",
"0.5058866",
"0.5047109",
"0.50365597",
"0.5017071",
"0.5014916",
"0.50144136",
"0.5006182",
"0.4999369",
"0.49990895",
"0.49896112",
"0.49851984",
"0.4984684",
"0.49754706",
"0.49636072",
"0.4950988",
"0.49508303",
"0.49492377",
"0.49447832",
"0.4939328",
"0.49237534",
"0.49204338",
"0.49168426",
"0.49145976",
"0.49047524",
"0.4899343",
"0.48926535",
"0.48919335",
"0.4888043",
"0.48809832",
"0.4873207",
"0.48629627",
"0.48566368",
"0.48543286",
"0.4847565",
"0.484346",
"0.48428932",
"0.48420247",
"0.48331437",
"0.48285872",
"0.48185393",
"0.48162338",
"0.4812417",
"0.48110124",
"0.48026103",
"0.47945303",
"0.47944343",
"0.47904927",
"0.47890183",
"0.4785667",
"0.47807112",
"0.47781563",
"0.47707635",
"0.47635487",
"0.4754481",
"0.47472763",
"0.4744477",
"0.47420356",
"0.47415718",
"0.4733148",
"0.4732901",
"0.47301233",
"0.4724527",
"0.4722843",
"0.47135997",
"0.4712031",
"0.47080392",
"0.47059485",
"0.47035426"
] | 0.77610075 | 0 |
/ JADX WARNING: inconsistent code. / Code decompiled incorrectly, please refer to instructions dump. | private void m3989a(org.xmlpull.v1.XmlPullParser r11, android.util.AttributeSet r12, android.view.Menu r13) {
/*
r10 = this;
r4 = 0;
r1 = 1;
r6 = 0;
r7 = new android.support.v7.view.k;
r7.<init>(r10, r13);
r0 = r11.getEventType();
L_0x000c:
r2 = 2;
if (r0 != r2) goto L_0x004a;
L_0x000f:
r0 = r11.getName();
r2 = "menu";
r2 = r0.equals(r2);
if (r2 == 0) goto L_0x0031;
L_0x001b:
r0 = r11.next();
L_0x001f:
r2 = r4;
r5 = r6;
r3 = r0;
r0 = r6;
L_0x0023:
if (r0 != 0) goto L_0x00e1;
L_0x0025:
switch(r3) {
case 1: goto L_0x00d9;
case 2: goto L_0x0051;
case 3: goto L_0x0087;
default: goto L_0x0028;
};
L_0x0028:
r3 = r5;
L_0x0029:
r5 = r11.next();
r9 = r3;
r3 = r5;
r5 = r9;
goto L_0x0023;
L_0x0031:
r1 = new java.lang.RuntimeException;
r2 = new java.lang.StringBuilder;
r2.<init>();
r3 = "Expecting menu, got ";
r2 = r2.append(r3);
r0 = r2.append(r0);
r0 = r0.toString();
r1.<init>(r0);
throw r1;
L_0x004a:
r0 = r11.next();
if (r0 != r1) goto L_0x000c;
L_0x0050:
goto L_0x001f;
L_0x0051:
if (r5 == 0) goto L_0x0055;
L_0x0053:
r3 = r5;
goto L_0x0029;
L_0x0055:
r3 = r11.getName();
r8 = "group";
r8 = r3.equals(r8);
if (r8 == 0) goto L_0x0066;
L_0x0061:
r7.m4001a(r12);
r3 = r5;
goto L_0x0029;
L_0x0066:
r8 = "item";
r8 = r3.equals(r8);
if (r8 == 0) goto L_0x0073;
L_0x006e:
r7.m4003b(r12);
r3 = r5;
goto L_0x0029;
L_0x0073:
r8 = "menu";
r8 = r3.equals(r8);
if (r8 == 0) goto L_0x0084;
L_0x007b:
r3 = r7.m4004c();
r10.m3989a(r11, r12, r3);
r3 = r5;
goto L_0x0029;
L_0x0084:
r2 = r3;
r3 = r1;
goto L_0x0029;
L_0x0087:
r3 = r11.getName();
if (r5 == 0) goto L_0x0096;
L_0x008d:
r8 = r3.equals(r2);
if (r8 == 0) goto L_0x0096;
L_0x0093:
r2 = r4;
r3 = r6;
goto L_0x0029;
L_0x0096:
r8 = "group";
r8 = r3.equals(r8);
if (r8 == 0) goto L_0x00a3;
L_0x009e:
r7.m4000a();
r3 = r5;
goto L_0x0029;
L_0x00a3:
r8 = "item";
r8 = r3.equals(r8);
if (r8 == 0) goto L_0x00cd;
L_0x00ab:
r3 = r7.m4005d();
if (r3 != 0) goto L_0x0028;
L_0x00b1:
r3 = r7.f2104z;
if (r3 == 0) goto L_0x00c7;
L_0x00b7:
r3 = r7.f2104z;
r3 = r3.hasSubMenu();
if (r3 == 0) goto L_0x00c7;
L_0x00c1:
r7.m4004c();
r3 = r5;
goto L_0x0029;
L_0x00c7:
r7.m4002b();
r3 = r5;
goto L_0x0029;
L_0x00cd:
r8 = "menu";
r3 = r3.equals(r8);
if (r3 == 0) goto L_0x0028;
L_0x00d5:
r0 = r1;
r3 = r5;
goto L_0x0029;
L_0x00d9:
r0 = new java.lang.RuntimeException;
r1 = "Unexpected end of document";
r0.<init>(r1);
throw r0;
L_0x00e1:
return;
*/
throw new UnsupportedOperationException("Method not decompiled: android.support.v7.view.i.a(org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.view.Menu):void");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void method_2241() {\r\n // $FF: Couldn't be decompiled\r\n }",
"private void method_7083() {\r\n // $FF: Couldn't be decompiled\r\n }",
"protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }",
"protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_1148() {\r\n // $FF: Couldn't be decompiled\r\n }",
"protected void method_2141() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_7081() {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2113() {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2139() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void m13383b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x000a }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x000a }\n r2 = 0;\t Catch:{ Exception -> 0x000a }\n r0.delete(r1, r2, r2);\t Catch:{ Exception -> 0x000a }\n L_0x000a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.b():void\");\n }",
"static void method_2226() {\r\n // $FF: Couldn't be decompiled\r\n }",
"private void m14210a(java.io.IOException r4, java.io.IOException r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r3 = this;\n r0 = f12370a;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = f12370a;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = 1;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = new java.lang.Object[r1];\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r2 = 0;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1[r2] = r5;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r0.invoke(r4, r1);\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.internal.connection.RouteException.a(java.io.IOException, java.io.IOException):void\");\n }",
"public void method_2046() {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2197() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_7086() {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2250() {\r\n // $FF: Couldn't be decompiled\r\n }",
"static void method_28() {\r\n // $FF: Couldn't be decompiled\r\n }",
"private boolean method_2253(class_1033 param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public long mo915b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = -1;\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n if (r2 == 0) goto L_0x000d;\t Catch:{ NumberFormatException -> 0x000e }\n L_0x0006:\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n r2 = java.lang.Long.parseLong(r2);\t Catch:{ NumberFormatException -> 0x000e }\n r0 = r2;\n L_0x000d:\n return r0;\n L_0x000e:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.b.b():long\");\n }",
"private void m25427g() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19111m;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = r2.f19104f;\t Catch:{ Exception -> 0x000f }\n r0 = android.support.v4.content.C0396d.m1465a(r0);\t Catch:{ Exception -> 0x000f }\n r1 = r2.f19111m;\t Catch:{ Exception -> 0x000f }\n r0.m1468a(r1);\t Catch:{ Exception -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.w.g():void\");\n }",
"public void mo2485a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = r2.f11863a;\n monitor-enter(r0);\n r1 = r2.f11873l;\t Catch:{ all -> 0x002a }\n if (r1 != 0) goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x0007:\n r1 = r2.f11872k;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x000c;\t Catch:{ all -> 0x002a }\n L_0x000b:\n goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x000c:\n r1 = r2.f11875n;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x0015;\n L_0x0010:\n r1 = r2.f11875n;\t Catch:{ RemoteException -> 0x0015 }\n r1.cancel();\t Catch:{ RemoteException -> 0x0015 }\n L_0x0015:\n r1 = r2.f11870i;\t Catch:{ all -> 0x002a }\n m14216b(r1);\t Catch:{ all -> 0x002a }\n r1 = 1;\t Catch:{ all -> 0x002a }\n r2.f11873l = r1;\t Catch:{ all -> 0x002a }\n r1 = com.google.android.gms.common.api.Status.zzfnm;\t Catch:{ all -> 0x002a }\n r1 = r2.mo3568a(r1);\t Catch:{ all -> 0x002a }\n r2.m14217c(r1);\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x0028:\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x002a:\n r1 = move-exception;\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.api.internal.BasePendingResult.a():void\");\n }",
"private void method_7082(class_1293 param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void mo3613a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = r4.f18081b;\n monitor-enter(r0);\n r1 = r4.f18080a;\t Catch:{ all -> 0x001f }\n if (r1 == 0) goto L_0x0009;\t Catch:{ all -> 0x001f }\n L_0x0007:\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n return;\t Catch:{ all -> 0x001f }\n L_0x0009:\n r1 = 1;\t Catch:{ all -> 0x001f }\n r4.f18080a = r1;\t Catch:{ all -> 0x001f }\n r2 = r4.f18081b;\t Catch:{ all -> 0x001f }\n r3 = r2.f12200d;\t Catch:{ all -> 0x001f }\n r3 = r3 + r1;\t Catch:{ all -> 0x001f }\n r2.f12200d = r3;\t Catch:{ all -> 0x001f }\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n r0 = r4.f18083d;\n okhttp3.internal.C2933c.m14194a(r0);\n r0 = r4.f18082c;\t Catch:{ IOException -> 0x001e }\n r0.m14100c();\t Catch:{ IOException -> 0x001e }\n L_0x001e:\n return;\n L_0x001f:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.a.a():void\");\n }",
"private static void m13385d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = java.lang.System.currentTimeMillis();\t Catch:{ Exception -> 0x0024 }\n r2 = java.util.concurrent.TimeUnit.DAYS;\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r2 = r2.toMillis(r3);\t Catch:{ Exception -> 0x0024 }\n r4 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = r0 - r2;\t Catch:{ Exception -> 0x0024 }\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x0024 }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x0024 }\n r2 = \"timestamp < ?\";\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r3 = new java.lang.String[r3];\t Catch:{ Exception -> 0x0024 }\n r6 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = java.lang.String.valueOf(r4);\t Catch:{ Exception -> 0x0024 }\n r3[r6] = r4;\t Catch:{ Exception -> 0x0024 }\n r0.delete(r1, r2, r3);\t Catch:{ Exception -> 0x0024 }\n L_0x0024:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.d():void\");\n }",
"private boolean m2248a(java.lang.String r3, com.onesignal.La.C0596a r4) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/318857719.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = 0;\n r1 = 1;\n java.lang.Float.parseFloat(r3);\t Catch:{ Throwable -> 0x0007 }\n r3 = 1;\n goto L_0x0008;\n L_0x0007:\n r3 = 0;\n L_0x0008:\n if (r3 != 0) goto L_0x0017;\n L_0x000a:\n r3 = com.onesignal.sa.C0650i.ERROR;\n r1 = \"Missing Google Project number!\\nPlease enter a Google Project number / Sender ID on under App Settings > Android > Configuration on the OneSignal dashboard.\";\n com.onesignal.sa.m1656a(r3, r1);\n r3 = 0;\n r1 = -6;\n r4.mo1392a(r3, r1);\n return r0;\n L_0x0017:\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onesignal.Pa.a(java.lang.String, com.onesignal.La$a):boolean\");\n }",
"public static boolean m19464a(java.lang.String r3, int[] r4) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = android.text.TextUtils.isEmpty(r3);\n r1 = 0;\n if (r0 == 0) goto L_0x0008;\n L_0x0007:\n return r1;\n L_0x0008:\n r0 = r4.length;\n r2 = 2;\n if (r0 == r2) goto L_0x000d;\n L_0x000c:\n return r1;\n L_0x000d:\n r0 = \"x\";\n r3 = r3.split(r0);\n r0 = r3.length;\n if (r0 == r2) goto L_0x0017;\n L_0x0016:\n return r1;\n L_0x0017:\n r0 = r3[r1];\t Catch:{ NumberFormatException -> 0x0029 }\n r0 = java.lang.Integer.parseInt(r0);\t Catch:{ NumberFormatException -> 0x0029 }\n r4[r1] = r0;\t Catch:{ NumberFormatException -> 0x0029 }\n r0 = 1;\t Catch:{ NumberFormatException -> 0x0029 }\n r3 = r3[r0];\t Catch:{ NumberFormatException -> 0x0029 }\n r3 = java.lang.Integer.parseInt(r3);\t Catch:{ NumberFormatException -> 0x0029 }\n r4[r0] = r3;\t Catch:{ NumberFormatException -> 0x0029 }\n return r0;\n L_0x0029:\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.arp.a(java.lang.String, int[]):boolean\");\n }",
"public boolean mo3969a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = r4.f19005h;\n if (r0 != 0) goto L_0x0011;\n L_0x0004:\n r0 = r4.f19004g;\n if (r0 == 0) goto L_0x000f;\n L_0x0008:\n r0 = r4.f19004g;\n r1 = com.facebook.ads.C1700b.f5123e;\n r0.mo1313a(r4, r1);\n L_0x000f:\n r0 = 0;\n return r0;\n L_0x0011:\n r0 = new android.content.Intent;\n r1 = r4.f19002e;\n r2 = com.facebook.ads.AudienceNetworkActivity.class;\n r0.<init>(r1, r2);\n r1 = \"predefinedOrientationKey\";\n r2 = r4.m25306b();\n r0.putExtra(r1, r2);\n r1 = \"uniqueId\";\n r2 = r4.f18999b;\n r0.putExtra(r1, r2);\n r1 = \"placementId\";\n r2 = r4.f19000c;\n r0.putExtra(r1, r2);\n r1 = \"requestTime\";\n r2 = r4.f19001d;\n r0.putExtra(r1, r2);\n r1 = \"viewType\";\n r2 = r4.f19009l;\n r0.putExtra(r1, r2);\n r1 = \"useCache\";\n r2 = r4.f19010m;\n r0.putExtra(r1, r2);\n r1 = r4.f19008k;\n if (r1 == 0) goto L_0x0052;\n L_0x004a:\n r1 = \"ad_data_bundle\";\n r2 = r4.f19008k;\n r0.putExtra(r1, r2);\n goto L_0x005b;\n L_0x0052:\n r1 = r4.f19006i;\n if (r1 == 0) goto L_0x005b;\n L_0x0056:\n r1 = r4.f19006i;\n r1.m18953a(r0);\n L_0x005b:\n r1 = 268435456; // 0x10000000 float:2.5243549E-29 double:1.32624737E-315;\n r0.addFlags(r1);\n r1 = r4.f19002e;\t Catch:{ ActivityNotFoundException -> 0x0066 }\n r1.startActivity(r0);\t Catch:{ ActivityNotFoundException -> 0x0066 }\n goto L_0x0072;\n L_0x0066:\n r1 = r4.f19002e;\n r2 = com.facebook.ads.InterstitialAdActivity.class;\n r0.setClass(r1, r2);\n r1 = r4.f19002e;\n r1.startActivity(r0);\n L_0x0072:\n r0 = 1;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.k.a():boolean\");\n }",
"protected void method_2045(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"protected void method_2246(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private final java.util.Map<java.lang.String, java.lang.String> m11967c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r7 = this;\n r0 = new java.util.HashMap;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r0.<init>();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r7.f10169c;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r2 = r7.f10170d;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r3 = f10168i;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r4 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r5 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r6 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r1.query(r2, r3, r4, r5, r6);\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n if (r1 == 0) goto L_0x0031;\n L_0x0014:\n r2 = r1.moveToNext();\t Catch:{ all -> 0x002c }\n if (r2 == 0) goto L_0x0028;\t Catch:{ all -> 0x002c }\n L_0x001a:\n r2 = 0;\t Catch:{ all -> 0x002c }\n r2 = r1.getString(r2);\t Catch:{ all -> 0x002c }\n r3 = 1;\t Catch:{ all -> 0x002c }\n r3 = r1.getString(r3);\t Catch:{ all -> 0x002c }\n r0.put(r2, r3);\t Catch:{ all -> 0x002c }\n goto L_0x0014;\n L_0x0028:\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n goto L_0x0031;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x002c:\n r0 = move-exception;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n throw r0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x0031:\n return r0;\n L_0x0032:\n r0 = \"ConfigurationContentLoader\";\n r1 = \"PhenotypeFlag unable to load ContentProvider, using default values\";\n android.util.Log.e(r0, r1);\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzsi.c():java.util.Map<java.lang.String, java.lang.String>\");\n }",
"private void m50366E() {\n }",
"public int method_7084(String param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private p000a.p001a.p002a.p003a.C0916s m1655b(p000a.p001a.p002a.p003a.p022i.p024b.C0112x r7, p000a.p001a.p002a.p003a.p034n.C0157e r8) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/293907205.run(Unknown Source)\n*/\n /*\n r6 = this;\n r0 = r7.m321a();\n r7 = r7.m322b();\n r1 = 0;\n r2 = r1;\n L_0x000a:\n r3 = r6.f1533u;\n r3 = r3 + 1;\n r6.f1533u = r3;\n r0.m2803e();\n r3 = r0.mo2010a();\n if (r3 != 0) goto L_0x0032;\n L_0x0019:\n r7 = r6.f1513a;\n r8 = \"Cannot retry non-repeatable request\";\n r7.m260a(r8);\n if (r2 == 0) goto L_0x002a;\n L_0x0022:\n r7 = new a.a.a.a.b.m;\n r8 = \"Cannot retry request with a non-repeatable request entity. The cause lists the reason the original request failed.\";\n r7.<init>(r8, r2);\n throw r7;\n L_0x002a:\n r7 = new a.a.a.a.b.m;\n r8 = \"Cannot retry request with a non-repeatable request entity.\";\n r7.<init>(r8);\n throw r7;\n L_0x0032:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.mo1932c();\t Catch:{ IOException -> 0x0086 }\n if (r2 != 0) goto L_0x0057;\t Catch:{ IOException -> 0x0086 }\n L_0x003a:\n r2 = r7.mo15e();\t Catch:{ IOException -> 0x0086 }\n if (r2 != 0) goto L_0x004f;\t Catch:{ IOException -> 0x0086 }\n L_0x0040:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = \"Reopening the direct connection.\";\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x0086 }\n r2.mo2023a(r7, r8, r3);\t Catch:{ IOException -> 0x0086 }\n goto L_0x0057;\t Catch:{ IOException -> 0x0086 }\n L_0x004f:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = \"Proxied connection. Need to start over.\";\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n goto L_0x0085;\t Catch:{ IOException -> 0x0086 }\n L_0x0057:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.m262a();\t Catch:{ IOException -> 0x0086 }\n if (r2 == 0) goto L_0x007c;\t Catch:{ IOException -> 0x0086 }\n L_0x005f:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = new java.lang.StringBuilder;\t Catch:{ IOException -> 0x0086 }\n r3.<init>();\t Catch:{ IOException -> 0x0086 }\n r4 = \"Attempt \";\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r4 = r6.f1533u;\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r4 = \" to execute request\";\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r3 = r3.toString();\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n L_0x007c:\n r2 = r6.f1518f;\t Catch:{ IOException -> 0x0086 }\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.m464a(r0, r3, r8);\t Catch:{ IOException -> 0x0086 }\n r1 = r2;\n L_0x0085:\n return r1;\n L_0x0086:\n r2 = move-exception;\n r3 = r6.f1513a;\n r4 = \"Closing the connection.\";\n r3.m260a(r4);\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0093 }\n r3.close();\t Catch:{ IOException -> 0x0093 }\n L_0x0093:\n r3 = r6.f1520h;\n r4 = r0.m2802d();\n r3 = r3.retryRequest(r2, r4, r8);\n if (r3 == 0) goto L_0x010a;\n L_0x009f:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x00d9;\n L_0x00a7:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"I/O exception (\";\n r4.append(r5);\n r5 = r2.getClass();\n r5 = r5.getName();\n r4.append(r5);\n r5 = \") caught when processing request to \";\n r4.append(r5);\n r4.append(r7);\n r5 = \": \";\n r4.append(r5);\n r5 = r2.getMessage();\n r4.append(r5);\n r4 = r4.toString();\n r3.m269d(r4);\n L_0x00d9:\n r3 = r6.f1513a;\n r3 = r3.m262a();\n if (r3 == 0) goto L_0x00ea;\n L_0x00e1:\n r3 = r6.f1513a;\n r4 = r2.getMessage();\n r3.m261a(r4, r2);\n L_0x00ea:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x000a;\n L_0x00f2:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"Retrying request to \";\n r4.append(r5);\n r4.append(r7);\n r4 = r4.toString();\n r3.m269d(r4);\n goto L_0x000a;\n L_0x010a:\n r8 = r2 instanceof p000a.p001a.p002a.p003a.C0176z;\n if (r8 == 0) goto L_0x0134;\n L_0x010e:\n r8 = new a.a.a.a.z;\n r0 = new java.lang.StringBuilder;\n r0.<init>();\n r7 = r7.mo10a();\n r7 = r7.m474e();\n r0.append(r7);\n r7 = \" failed to respond\";\n r0.append(r7);\n r7 = r0.toString();\n r8.<init>(r7);\n r7 = r2.getStackTrace();\n r8.setStackTrace(r7);\n throw r8;\n L_0x0134:\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: a.a.a.a.i.b.p.b(a.a.a.a.i.b.x, a.a.a.a.n.e):a.a.a.a.s\");\n }",
"void m5768b() throws C0841b;",
"void m1864a() {\r\n }",
"public boolean method_2088(class_689 param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"void m5770d() throws C0841b;",
"public static void m5820b(java.lang.String r3, java.lang.String r4, java.lang.String r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = new com.crashlytics.android.answers.StartCheckoutEvent;\n r0.<init>();\n r1 = java.util.Locale.getDefault();\n r1 = java.util.Currency.getInstance(r1);\n r0.putCurrency(r1);\n r1 = 1;\n r0.putItemCount(r1);\n r1 = java.lang.Long.parseLong(r3);\t Catch:{ Exception -> 0x001f }\n r3 = java.math.BigDecimal.valueOf(r1);\t Catch:{ Exception -> 0x001f }\n r0.putTotalPrice(r3);\t Catch:{ Exception -> 0x001f }\n L_0x001f:\n r3 = \"type\";\n r0.putCustomAttribute(r3, r4);\n r3 = \"cta\";\n r0.putCustomAttribute(r3, r5);\n r3 = com.crashlytics.android.answers.Answers.getInstance();\n r3.logStartCheckout(r0);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.b(java.lang.String, java.lang.String, java.lang.String):void\");\n }",
"public final void mo91715d() {\n }",
"public static void m5812a(java.lang.String r0, java.lang.String r1, java.lang.String r2) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r2 = new com.crashlytics.android.answers.AddToCartEvent;\n r2.<init>();\n r2.putItemType(r0);\n r0 = java.lang.Long.parseLong(r1);\t Catch:{ Exception -> 0x0013 }\n r0 = java.math.BigDecimal.valueOf(r0);\t Catch:{ Exception -> 0x0013 }\n r2.putItemPrice(r0);\t Catch:{ Exception -> 0x0013 }\n L_0x0013:\n r0 = java.util.Locale.getDefault();\n r0 = java.util.Currency.getInstance(r0);\n r2.putCurrency(r0);\n r0 = com.crashlytics.android.answers.Answers.getInstance();\n r0.logAddToCart(r2);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.a(java.lang.String, java.lang.String, java.lang.String):void\");\n }",
"public void method_4270() {}",
"private static void m13381a(long r3, float r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\n r0.beginTransaction();\t Catch:{ Exception -> 0x001f }\n r1 = \"INSERT INTO battery_watcher (timestamp, level) VALUES (?, ?)\";\t Catch:{ Exception -> 0x001f }\n r1 = r0.compileStatement(r1);\t Catch:{ Exception -> 0x001f }\n r2 = 1;\t Catch:{ Exception -> 0x001f }\n r1.bindLong(r2, r3);\t Catch:{ Exception -> 0x001f }\n r3 = 2;\t Catch:{ Exception -> 0x001f }\n r4 = (double) r5;\t Catch:{ Exception -> 0x001f }\n r1.bindDouble(r3, r4);\t Catch:{ Exception -> 0x001f }\n r1.execute();\t Catch:{ Exception -> 0x001f }\n r0.setTransactionSuccessful();\t Catch:{ Exception -> 0x001f }\n goto L_0x0026;\n L_0x001d:\n r3 = move-exception;\n goto L_0x002a;\n L_0x001f:\n r3 = f10646a;\t Catch:{ all -> 0x001d }\n r4 = \"Issue adding location to battery history\";\t Catch:{ all -> 0x001d }\n com.foursquare.internal.util.FsLog.m6807d(r3, r4);\t Catch:{ all -> 0x001d }\n L_0x0026:\n r0.endTransaction();\n return;\n L_0x002a:\n r0.endTransaction();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.a(long, float):void\");\n }",
"static void method_461() {\r\n // $FF: Couldn't be decompiled\r\n }",
"private static class_1205 method_6442(String param0, int param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2112(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }",
"void m5769c() throws C0841b;",
"void m5771e() throws C0841b;",
"@Override // X.AnonymousClass0PN\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void A0D() {\n /*\n r5 = this;\n super.A0D()\n X.08d r0 = r5.A05\n X.0OQ r4 = r0.A04()\n X.0Rk r3 = r4.A00() // Catch:{ all -> 0x003d }\n X.0BK r2 = r4.A04 // Catch:{ all -> 0x0036 }\n java.lang.String r1 = \"DELETE FROM receipt_device\"\n java.lang.String r0 = \"CLEAR_TABLE_RECEIPT_DEVICE\"\n r2.A0C(r1, r0) // Catch:{ all -> 0x0036 }\n X.08m r1 = r5.A03 // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"receipt_device_migration_complete\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"migration_receipt_device_index\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"migration_receipt_device_retry\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n r3.A00() // Catch:{ all -> 0x0036 }\n r3.close()\n r4.close()\n java.lang.String r0 = \"ReceiptDeviceStore/ReceiptDeviceDatabaseMigration/resetMigration/done\"\n com.whatsapp.util.Log.i(r0)\n return\n L_0x0036:\n r0 = move-exception\n throw r0 // Catch:{ all -> 0x0038 }\n L_0x0038:\n r0 = move-exception\n r3.close() // Catch:{ all -> 0x003c }\n L_0x003c:\n throw r0\n L_0x003d:\n r0 = move-exception\n throw r0 // Catch:{ all -> 0x003f }\n L_0x003f:\n r0 = move-exception\n r4.close() // Catch:{ all -> 0x0043 }\n L_0x0043:\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: X.C43661yk.A0D():void\");\n }",
"public static void m5813a(java.lang.String r2, java.lang.String r3, java.lang.String r4, boolean r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = new com.crashlytics.android.answers.PurchaseEvent;\n r0.<init>();\n r1 = java.util.Locale.getDefault();\n r1 = java.util.Currency.getInstance(r1);\n r0.putCurrency(r1);\n r0.putItemId(r2);\n r0.putItemType(r3);\n r2 = java.lang.Long.parseLong(r4);\t Catch:{ Exception -> 0x0021 }\n r2 = java.math.BigDecimal.valueOf(r2);\t Catch:{ Exception -> 0x0021 }\n r0.putItemPrice(r2);\t Catch:{ Exception -> 0x0021 }\n L_0x0021:\n r0.putSuccess(r5);\n r2 = com.crashlytics.android.answers.Answers.getInstance();\n r2.logPurchase(r0);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.a(java.lang.String, java.lang.String, java.lang.String, boolean):void\");\n }",
"public void method_2111(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }",
"@androidx.annotation.Nullable\n /* renamed from: j */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final p005b.p096l.p097a.p151d.p152a.p154b.C3474b mo14822j(java.lang.String r9) {\n /*\n r8 = this;\n java.io.File r0 = new java.io.File\n java.io.File r1 = r8.mo14820g()\n r0.<init>(r1, r9)\n boolean r1 = r0.exists()\n r2 = 3\n r3 = 6\n r4 = 1\n r5 = 0\n r6 = 0\n if (r1 != 0) goto L_0x0022\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r4]\n r1[r5] = r9\n java.lang.String r9 = \"Pack not found with pack name: %s\"\n r0.mo14884b(r2, r9, r1)\n L_0x001f:\n r9 = r6\n goto L_0x0093\n L_0x0022:\n java.io.File r1 = new java.io.File\n b.l.a.d.a.b.o1 r7 = r8.f6567b\n int r7 = r7.mo14797a()\n java.lang.String r7 = java.lang.String.valueOf(r7)\n r1.<init>(r0, r7)\n boolean r0 = r1.exists()\n r7 = 2\n if (r0 != 0) goto L_0x0050\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"Pack not found with pack name: %s app version: %s\"\n r0.mo14884b(r2, r9, r1)\n goto L_0x001f\n L_0x0050:\n java.io.File[] r0 = r1.listFiles()\n if (r0 == 0) goto L_0x007b\n int r1 = r0.length\n if (r1 != 0) goto L_0x005a\n goto L_0x007b\n L_0x005a:\n if (r1 <= r4) goto L_0x0074\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"Multiple pack versions found for pack name: %s app version: %s\"\n r0.mo14884b(r3, r9, r1)\n goto L_0x001f\n L_0x0074:\n r9 = r0[r5]\n java.lang.String r9 = r9.getCanonicalPath()\n goto L_0x0093\n L_0x007b:\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"No pack version found for pack name: %s app version: %s\"\n r0.mo14884b(r2, r9, r1)\n goto L_0x001f\n L_0x0093:\n if (r9 != 0) goto L_0x0096\n return r6\n L_0x0096:\n java.io.File r0 = new java.io.File\n java.lang.String r1 = \"assets\"\n r0.<init>(r9, r1)\n boolean r1 = r0.isDirectory()\n if (r1 != 0) goto L_0x00af\n b.l.a.d.a.e.f r9 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r4]\n r1[r5] = r0\n java.lang.String r0 = \"Failed to find assets directory: %s\"\n r9.mo14884b(r3, r0, r1)\n return r6\n L_0x00af:\n java.lang.String r0 = r0.getCanonicalPath()\n b.l.a.d.a.b.w r1 = new b.l.a.d.a.b.w\n r1.<init>(r5, r9, r0)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p005b.p096l.p097a.p151d.p152a.p154b.C3544t.mo14822j(java.lang.String):b.l.a.d.a.b.b\");\n }",
"public boolean method_2243() {\r\n // $FF: Couldn't be decompiled\r\n }",
"private void m1654a(p000a.p001a.p002a.p003a.p022i.p024b.C0112x r7, p000a.p001a.p002a.p003a.p034n.C0157e r8) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/293907205.run(Unknown Source)\n*/\n /*\n r6 = this;\n r0 = r7.m322b();\n r7 = r7.m321a();\n r1 = 0;\n L_0x0009:\n r2 = \"http.request\";\n r8.mo160a(r2, r7);\n r1 = r1 + 1;\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r2 = r2.mo1932c();\t Catch:{ IOException -> 0x002f }\n if (r2 != 0) goto L_0x0020;\t Catch:{ IOException -> 0x002f }\n L_0x0018:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x002f }\n r2.mo2023a(r0, r8, r3);\t Catch:{ IOException -> 0x002f }\n goto L_0x002b;\t Catch:{ IOException -> 0x002f }\n L_0x0020:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x002f }\n r3 = p000a.p001a.p002a.p003a.p032l.C0150c.m428a(r3);\t Catch:{ IOException -> 0x002f }\n r2.mo1931b(r3);\t Catch:{ IOException -> 0x002f }\n L_0x002b:\n r6.m1660a(r0, r8);\t Catch:{ IOException -> 0x002f }\n return;\n L_0x002f:\n r2 = move-exception;\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0035 }\n r3.close();\t Catch:{ IOException -> 0x0035 }\n L_0x0035:\n r3 = r6.f1520h;\n r3 = r3.retryRequest(r2, r1, r8);\n if (r3 == 0) goto L_0x00a0;\n L_0x003d:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x0009;\n L_0x0045:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"I/O exception (\";\n r4.append(r5);\n r5 = r2.getClass();\n r5 = r5.getName();\n r4.append(r5);\n r5 = \") caught when connecting to \";\n r4.append(r5);\n r4.append(r0);\n r5 = \": \";\n r4.append(r5);\n r5 = r2.getMessage();\n r4.append(r5);\n r4 = r4.toString();\n r3.m269d(r4);\n r3 = r6.f1513a;\n r3 = r3.m262a();\n if (r3 == 0) goto L_0x0088;\n L_0x007f:\n r3 = r6.f1513a;\n r4 = r2.getMessage();\n r3.m261a(r4, r2);\n L_0x0088:\n r2 = r6.f1513a;\n r3 = new java.lang.StringBuilder;\n r3.<init>();\n r4 = \"Retrying connect to \";\n r3.append(r4);\n r3.append(r0);\n r3 = r3.toString();\n r2.m269d(r3);\n goto L_0x0009;\n L_0x00a0:\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: a.a.a.a.i.b.p.a(a.a.a.a.i.b.x, a.a.a.a.n.e):void\");\n }",
"private final void asx() {\n /*\n r12 = this;\n r0 = r12.cFE;\n if (r0 == 0) goto L_0x0073;\n L_0x0004:\n r1 = r12.cxs;\n if (r1 == 0) goto L_0x0073;\n L_0x0008:\n r1 = r12.ayL;\n if (r1 != 0) goto L_0x000d;\n L_0x000c:\n goto L_0x0073;\n L_0x000d:\n r2 = 0;\n if (r1 == 0) goto L_0x0027;\n L_0x0010:\n r1 = r1.Km();\n if (r1 == 0) goto L_0x0027;\n L_0x0016:\n r1 = r1.aar();\n if (r1 == 0) goto L_0x0027;\n L_0x001c:\n r3 = r0.getName();\n r1 = r1.get(r3);\n r1 = (java.util.ArrayList) r1;\n goto L_0x0028;\n L_0x0027:\n r1 = r2;\n L_0x0028:\n if (r1 == 0) goto L_0x0051;\n L_0x002a:\n r1 = (java.lang.Iterable) r1;\n r1 = kotlin.collections.u.Z(r1);\n if (r1 == 0) goto L_0x0051;\n L_0x0032:\n r3 = new com.iqoption.deposit.light.perform.DepositPerformLightFragment$setPresets$items$1;\n r3.<init>(r12);\n r3 = (kotlin.jvm.a.b) r3;\n r1 = kotlin.sequences.n.b(r1, r3);\n if (r1 == 0) goto L_0x0051;\n L_0x003f:\n r3 = new com.iqoption.deposit.light.perform.DepositPerformLightFragment$setPresets$items$2;\n r3.<init>(r0);\n r3 = (kotlin.jvm.a.b) r3;\n r1 = kotlin.sequences.n.f(r1, r3);\n if (r1 == 0) goto L_0x0051;\n L_0x004c:\n r1 = kotlin.sequences.n.f(r1);\n goto L_0x0052;\n L_0x0051:\n r1 = r2;\n L_0x0052:\n r3 = r12.asr();\n if (r1 == 0) goto L_0x0059;\n L_0x0058:\n goto L_0x005d;\n L_0x0059:\n r1 = kotlin.collections.m.emptyList();\n L_0x005d:\n r4 = r12.bub;\n if (r4 == 0) goto L_0x006d;\n L_0x0061:\n r5 = 0;\n r6 = 0;\n r7 = 1;\n r8 = 0;\n r9 = 0;\n r10 = 19;\n r11 = 0;\n r2 = com.iqoption.core.util.e.a(r4, r5, r6, r7, r8, r9, r10, r11);\n L_0x006d:\n r3.c(r1, r2);\n r12.d(r0);\n L_0x0073:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.deposit.light.perform.c.asx():void\");\n }",
"public void method_2116(class_689 param1, boolean param2) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private static int m69982c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r0 = \"android.os.Build$VERSION\";\t Catch:{ Exception -> 0x0018 }\n r0 = java.lang.Class.forName(r0);\t Catch:{ Exception -> 0x0018 }\n r1 = \"SDK_INT\";\t Catch:{ Exception -> 0x0018 }\n r0 = r0.getField(r1);\t Catch:{ Exception -> 0x0018 }\n r1 = 0;\t Catch:{ Exception -> 0x0018 }\n r0 = r0.get(r1);\t Catch:{ Exception -> 0x0018 }\n r0 = (java.lang.Integer) r0;\t Catch:{ Exception -> 0x0018 }\n r0 = r0.intValue();\t Catch:{ Exception -> 0x0018 }\n return r0;\n L_0x0018:\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.util.f.c():int\");\n }",
"static void m7753b() {\n f8029a = false;\n }",
"public final synchronized com.google.android.m4b.maps.bu.C4910a m21843a(java.lang.String r10) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r9 = this;\n monitor-enter(r9);\n r0 = r9.f17909e;\t Catch:{ all -> 0x0056 }\n r1 = 0;\n if (r0 != 0) goto L_0x0008;\n L_0x0006:\n monitor-exit(r9);\n return r1;\n L_0x0008:\n r0 = r9.f17907c;\t Catch:{ all -> 0x0056 }\n r2 = com.google.android.m4b.maps.az.C4733b.m21060a(r10);\t Catch:{ all -> 0x0056 }\n r0 = r0.m21933a(r2, r1);\t Catch:{ all -> 0x0056 }\n if (r0 == 0) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0014:\n r2 = r0.length;\t Catch:{ all -> 0x0056 }\n r3 = 9;\t Catch:{ all -> 0x0056 }\n if (r2 <= r3) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0019:\n r2 = 0;\t Catch:{ all -> 0x0056 }\n r2 = r0[r2];\t Catch:{ all -> 0x0056 }\n r4 = 1;\t Catch:{ all -> 0x0056 }\n if (r2 == r4) goto L_0x0020;\t Catch:{ all -> 0x0056 }\n L_0x001f:\n goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0020:\n r5 = com.google.android.m4b.maps.bs.C4891e.m21914c(r0, r4);\t Catch:{ all -> 0x0056 }\n r2 = new com.google.android.m4b.maps.ar.a;\t Catch:{ all -> 0x0056 }\n r7 = com.google.android.m4b.maps.de.C5350x.f20104b;\t Catch:{ all -> 0x0056 }\n r2.<init>(r7);\t Catch:{ all -> 0x0056 }\n r7 = new java.io.ByteArrayInputStream;\t Catch:{ IOException -> 0x0052 }\n r8 = r0.length;\t Catch:{ IOException -> 0x0052 }\n r8 = r8 - r3;\t Catch:{ IOException -> 0x0052 }\n r7.<init>(r0, r3, r8);\t Catch:{ IOException -> 0x0052 }\n r2.m20818a(r7);\t Catch:{ IOException -> 0x0052 }\n r0 = 2;\n r0 = r2.m20843h(r0);\t Catch:{ all -> 0x0056 }\n r10 = r10.equals(r0);\t Catch:{ all -> 0x0056 }\n if (r10 != 0) goto L_0x0042;\n L_0x0040:\n monitor-exit(r9);\n return r1;\n L_0x0042:\n r10 = new com.google.android.m4b.maps.bu.a;\t Catch:{ all -> 0x0056 }\n r10.<init>();\t Catch:{ all -> 0x0056 }\n r10.m22018a(r4);\t Catch:{ all -> 0x0056 }\n r10.m22020a(r2);\t Catch:{ all -> 0x0056 }\n r10.m22016a(r5);\t Catch:{ all -> 0x0056 }\n monitor-exit(r9);\n return r10;\n L_0x0052:\n monitor-exit(r9);\n return r1;\n L_0x0054:\n monitor-exit(r9);\n return r1;\n L_0x0056:\n r10 = move-exception;\n monitor-exit(r9);\n throw r10;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.bs.b.a(java.lang.String):com.google.android.m4b.maps.bu.a\");\n }",
"public static int m22557b(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = com.google.android.gms.internal.measurement.dr.m11788a(r1);\t Catch:{ zzyn -> 0x0005 }\n goto L_0x000c;\n L_0x0005:\n r0 = com.google.android.gms.internal.measurement.zzvo.f10281a;\n r1 = r1.getBytes(r0);\n r0 = r1.length;\n L_0x000c:\n r1 = m22576g(r0);\n r1 = r1 + r0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzut.b(java.lang.String):int\");\n }",
"public void method_7080(String param1, class_1293 param2) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void m9741j() throws cf {\r\n }",
"private static void check(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.Signer.check(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.check(java.lang.String):void\");\n }",
"public boolean method_2153(boolean param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void method_2259(String param1, double param2, double param4, double param6, int param8, double param9, double param11, double param13, double param15) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private void m50367F() {\n }",
"public void mo21779D() {\n }",
"public final synchronized void mo5320b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r1 = 0;\t Catch:{ all -> 0x004c }\n r2 = 0;\t Catch:{ all -> 0x004c }\n if (r0 == 0) goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0007:\n r0 = r6.f24851a;\t Catch:{ all -> 0x004c }\n if (r0 != 0) goto L_0x0013;\t Catch:{ all -> 0x004c }\n L_0x000b:\n r0 = r6.f24854d;\t Catch:{ all -> 0x004c }\n r3 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r0.deleteFile(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0013:\n r0 = com.google.android.m4b.maps.cg.bx.m23058b();\t Catch:{ all -> 0x004c }\n r3 = r6.f24854d;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24853c;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r3 = r3.openFileOutput(r4, r1);\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24851a;\t Catch:{ IOException -> 0x0033 }\n r4 = r4.m20837d();\t Catch:{ IOException -> 0x0033 }\n r3.write(r4);\t Catch:{ IOException -> 0x0033 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n L_0x002b:\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\n L_0x002f:\n r1 = move-exception;\n r3 = r2;\n goto L_0x003f;\n L_0x0032:\n r3 = r2;\n L_0x0033:\n r4 = r6.f24854d;\t Catch:{ all -> 0x003e }\n r5 = r6.f24853c;\t Catch:{ all -> 0x003e }\n r4.deleteFile(r5);\t Catch:{ all -> 0x003e }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n goto L_0x002b;\t Catch:{ all -> 0x004c }\n L_0x003e:\n r1 = move-exception;\t Catch:{ all -> 0x004c }\n L_0x003f:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n throw r1;\t Catch:{ all -> 0x004c }\n L_0x0046:\n r6.f24851a = r2;\t Catch:{ all -> 0x004c }\n r6.f24852b = r1;\t Catch:{ all -> 0x004c }\n monitor-exit(r6);\n return;\n L_0x004c:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.b():void\");\n }",
"private synchronized void m29549c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x0050 }\n if (r0 == 0) goto L_0x004b;\t Catch:{ all -> 0x0050 }\n L_0x0005:\n r0 = com.google.android.m4b.maps.cg.bx.m23056a();\t Catch:{ all -> 0x0050 }\n r1 = 0;\n r2 = r6.f24854d;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r3 = r6.f24853c;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r2 = r2.openFileInput(r3);\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n if (r2 == 0) goto L_0x0027;\n L_0x0014:\n r3 = new com.google.android.m4b.maps.ar.a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.de.af.f19891a;\t Catch:{ IOException -> 0x0036 }\n r3.<init>(r4);\t Catch:{ IOException -> 0x0036 }\n r6.f24851a = r3;\t Catch:{ IOException -> 0x0036 }\n r3 = r6.f24851a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.ap.C4655c.m20771a(r2);\t Catch:{ IOException -> 0x0036 }\n r3.m20819a(r4);\t Catch:{ IOException -> 0x0036 }\n goto L_0x0029;\t Catch:{ IOException -> 0x0036 }\n L_0x0027:\n r6.f24851a = r1;\t Catch:{ IOException -> 0x0036 }\n L_0x0029:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n L_0x002c:\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n goto L_0x004b;\n L_0x0030:\n r2 = move-exception;\n r5 = r2;\n r2 = r1;\n r1 = r5;\n goto L_0x0044;\n L_0x0035:\n r2 = r1;\n L_0x0036:\n r6.f24851a = r1;\t Catch:{ all -> 0x0043 }\n r1 = r6.f24854d;\t Catch:{ all -> 0x0043 }\n r3 = r6.f24853c;\t Catch:{ all -> 0x0043 }\n r1.deleteFile(r3);\t Catch:{ all -> 0x0043 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n goto L_0x002c;\t Catch:{ all -> 0x0050 }\n L_0x0043:\n r1 = move-exception;\t Catch:{ all -> 0x0050 }\n L_0x0044:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n throw r1;\t Catch:{ all -> 0x0050 }\n L_0x004b:\n r0 = 1;\t Catch:{ all -> 0x0050 }\n r6.f24852b = r0;\t Catch:{ all -> 0x0050 }\n monitor-exit(r6);\n return;\n L_0x0050:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.c():void\");\n }",
"public void method_2249(boolean param1, class_81 param2) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public void mo115190b() {\n }",
"public final void mo1285b() {\n }",
"public void mo23813b() {\n }",
"public boolean method_208() {\r\n return false;\r\n }",
"public final void mo11687c() {\n }",
"public static com.facebook.ads.internal.p081a.C1714d m6464a(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = android.text.TextUtils.isEmpty(r1);\n if (r0 == 0) goto L_0x0009;\n L_0x0006:\n r1 = NONE;\n return r1;\n L_0x0009:\n r0 = java.util.Locale.US;\t Catch:{ IllegalArgumentException -> 0x0014 }\n r1 = r1.toUpperCase(r0);\t Catch:{ IllegalArgumentException -> 0x0014 }\n r1 = com.facebook.ads.internal.p081a.C1714d.valueOf(r1);\t Catch:{ IllegalArgumentException -> 0x0014 }\n return r1;\n L_0x0014:\n r1 = NONE;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.a.d.a(java.lang.String):com.facebook.ads.internal.a.d\");\n }",
"public final void mo51373a() {\n }",
"void mo72113b();",
"public boolean method_2434() {\r\n return false;\r\n }",
"public void mo21787L() {\n }",
"boolean m25333a(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r0 = this;\n java.lang.Class.forName(r1);\t Catch:{ ClassNotFoundException -> 0x0005 }\n r1 = 1;\n return r1;\n L_0x0005:\n r1 = 0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mapbox.android.core.location.c.a(java.lang.String):boolean\");\n }",
"private void kk12() {\n\n\t}",
"void mo80457c();",
"@org.jetbrains.annotations.NotNull\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static /* synthetic */ com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection copy$default(com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection r4, com.bitcoin.mwallet.core.models.slp.Slp r5, java.util.List<kotlin.ULong> r6, com.bitcoin.bitcoink.p008tx.Satoshis r7, com.bitcoin.bitcoink.p008tx.Satoshis r8, java.util.List<com.bitcoin.mwallet.core.models.p009tx.utxo.Utxo> r9, com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection.Error r10, int r11, java.lang.Object r12) {\n /*\n r12 = r11 & 1\n if (r12 == 0) goto L_0x0006\n com.bitcoin.mwallet.core.models.slp.Slp r5 = r4.token\n L_0x0006:\n r12 = r11 & 2\n if (r12 == 0) goto L_0x000c\n java.util.List<kotlin.ULong> r6 = r4.quantities\n L_0x000c:\n r12 = r6\n r6 = r11 & 4\n if (r6 == 0) goto L_0x0013\n com.bitcoin.bitcoink.tx.Satoshis r7 = r4.fee\n L_0x0013:\n r0 = r7\n r6 = r11 & 8\n if (r6 == 0) goto L_0x001a\n com.bitcoin.bitcoink.tx.Satoshis r8 = r4.change\n L_0x001a:\n r1 = r8\n r6 = r11 & 16\n if (r6 == 0) goto L_0x0021\n java.util.List<com.bitcoin.mwallet.core.models.tx.utxo.Utxo> r9 = r4.utxos\n L_0x0021:\n r2 = r9\n r6 = r11 & 32\n if (r6 == 0) goto L_0x0028\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error r10 = r4.error\n L_0x0028:\n r3 = r10\n r6 = r4\n r7 = r5\n r8 = r12\n r9 = r0\n r10 = r1\n r11 = r2\n r12 = r3\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection r4 = r6.copy(r7, r8, r9, r10, r11, r12)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection.copy$default(com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection, com.bitcoin.mwallet.core.models.slp.Slp, java.util.List, com.bitcoin.bitcoink.tx.Satoshis, com.bitcoin.bitcoink.tx.Satoshis, java.util.List, com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error, int, java.lang.Object):com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection\");\n }",
"public boolean A_()\r\n/* 21: */ {\r\n/* 22:138 */ return true;\r\n/* 23: */ }",
"private final boolean e() {\n /*\n r15 = this;\n r2 = 0\n r1 = 0\n dtd r0 = r15.m // Catch:{ all -> 0x008e }\n if (r0 != 0) goto L_0x000d\n dtd r0 = new dtd // Catch:{ all -> 0x008e }\n r0.<init>() // Catch:{ all -> 0x008e }\n r15.m = r0 // Catch:{ all -> 0x008e }\n L_0x000d:\n int r0 = r15.k // Catch:{ all -> 0x008e }\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x039e\n dvk r3 = r15.g // Catch:{ all -> 0x008e }\n if (r3 == 0) goto L_0x0356\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 == 0) goto L_0x0025\n int r3 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != r4) goto L_0x0032\n L_0x0025:\n r3 = 2097152(0x200000, float:2.938736E-39)\n int r3 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = new byte[r3] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r15.h = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r15.i = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0032:\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r4\n int r6 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r7 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r8 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r9 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n boolean r0 = r7.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x00ac\n r0 = 1\n L_0x0047:\n java.lang.String r3 = \"GzipInflatingBuffer is closed\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r0 = 1\n r5 = r3\n L_0x004f:\n if (r0 == 0) goto L_0x02ef\n int r3 = r6 - r5\n if (r3 <= 0) goto L_0x02ef\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.ordinal() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n switch(r0) {\n case 0: goto L_0x00ae;\n case 1: goto L_0x0148;\n case 2: goto L_0x0171;\n case 3: goto L_0x01d7;\n case 4: goto L_0x01fc;\n case 5: goto L_0x0221;\n case 6: goto L_0x0256;\n case 7: goto L_0x0289;\n case 8: goto L_0x02a2;\n case 9: goto L_0x02e9;\n default: goto L_0x005e;\n } // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x005e:\n java.lang.AssertionError r0 = new java.lang.AssertionError // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4 + 15\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5.<init>(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = \"Invalid state: \"\n java.lang.StringBuilder r4 = r5.append(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.StringBuilder r3 = r4.append(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = r3.toString() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0087:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x008e:\n r0 = move-exception\n if (r2 <= 0) goto L_0x00ab\n dxe r3 = r15.a\n r3.a(r2)\n dxh r3 = r15.j\n dxh r4 = defpackage.dxh.BODY\n if (r3 != r4) goto L_0x00ab\n dvk r3 = r15.g\n if (r3 == 0) goto L_0x03c9\n dzo r2 = r15.d\n long r4 = (long) r1\n r2.d(r4)\n int r2 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n L_0x00ab:\n throw r0\n L_0x00ac:\n r0 = 0\n goto L_0x0047\n L_0x00ae:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x00ba\n r0 = 0\n goto L_0x004f\n L_0x00ba:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 35615(0x8b1f, float:4.9907E-41)\n if (r0 == r3) goto L_0x00d4\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Not in GZIP format\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00cd:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x00d4:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 8\n if (r0 == r3) goto L_0x00e6\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Unsupported compression method\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00e6:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.j = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvl r4 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 6\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r10.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r10\n if (r3 <= 0) goto L_0x03d9\n r0 = 6\n int r0 = java.lang.Math.min(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r10 = r10.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r11 = r11.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r10, r11, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = 6 - r0\n r3 = r0\n L_0x0118:\n if (r3 <= 0) goto L_0x013b\n r0 = 512(0x200, float:7.175E-43)\n byte[] r10 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x011f:\n if (r0 >= r3) goto L_0x013b\n int r11 = r3 - r0\n r12 = 512(0x200, float:7.175E-43)\n int r11 = java.lang.Math.min(r11, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r12 = r12.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.a(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r12 = r12.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.update(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r11\n goto L_0x011f\n L_0x013b:\n dvk r0 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 6\n defpackage.dvk.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA_LEN // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0148:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 4\n r3 = 4\n if (r0 == r3) goto L_0x0156\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0156:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0162\n r0 = 0\n goto L_0x004f\n L_0x0162:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.k = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0171:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 >= r3) goto L_0x017e\n r0 = 0\n goto L_0x004f\n L_0x017e:\n dvl r10 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x03d6\n int r0 = java.lang.Math.min(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r11 = r11.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r12 = r12.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r11, r12, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r4 - r0\n r3 = r0\n L_0x01a8:\n if (r3 <= 0) goto L_0x01cb\n r0 = 512(0x200, float:7.175E-43)\n byte[] r11 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x01af:\n if (r0 >= r3) goto L_0x01cb\n int r12 = r3 - r0\n r13 = 512(0x200, float:7.175E-43)\n int r12 = java.lang.Math.min(r12, r13) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r13 = r13.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.a(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r13 = r13.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.update(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r12\n goto L_0x01af\n L_0x01cb:\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.b(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01d7:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 8\n r3 = 8\n if (r0 != r3) goto L_0x01f5\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x01e1:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x01f3\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x01e1\n r0 = 1\n L_0x01ee:\n if (r0 != 0) goto L_0x01f5\n r0 = 0\n goto L_0x004f\n L_0x01f3:\n r0 = 0\n goto L_0x01ee\n L_0x01f5:\n dvm r0 = defpackage.dvm.HEADER_COMMENT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01fc:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 16\n r3 = 16\n if (r0 != r3) goto L_0x021a\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0206:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x0218\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x0206\n r0 = 1\n L_0x0213:\n if (r0 != 0) goto L_0x021a\n r0 = 0\n goto L_0x004f\n L_0x0218:\n r0 = 0\n goto L_0x0213\n L_0x021a:\n dvm r0 = defpackage.dvm.HEADER_CRC // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0221:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 2\n r3 = 2\n if (r0 != r3) goto L_0x024f\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0234\n r0 = 0\n goto L_0x004f\n L_0x0234:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n long r10 = r0.getValue() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = (int) r10 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 65535(0xffff, float:9.1834E-41)\n r0 = r0 & r3\n dvl r3 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == r3) goto L_0x024f\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Corrupt GZIP header\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x024f:\n dvm r0 = defpackage.dvm.INITIALIZE_INFLATER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0256:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x027e\n java.util.zip.Inflater r0 = new java.util.zip.Inflater // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 1\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.g = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0262:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x0284\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x027b:\n r0 = 1\n goto L_0x004f\n L_0x027e:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x0262\n L_0x0284:\n dvm r0 = defpackage.dvm.INFLATER_NEEDS_INPUT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x027b\n L_0x0289:\n int r0 = r9 + r5\n int r0 = r7.a(r8, r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r5 + r0\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r4 = defpackage.dvm.TRAILER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r4) goto L_0x029e\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5 = r3\n goto L_0x004f\n L_0x029e:\n r0 = 1\n r5 = r3\n goto L_0x004f\n L_0x02a2:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == 0) goto L_0x02c7\n r0 = 1\n L_0x02a7:\n java.lang.String r3 = \"inflater is null\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x02c9\n r0 = 1\n L_0x02b3:\n java.lang.String r3 = \"inflaterInput has unconsumed bytes\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r0 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 512(0x200, float:7.175E-43)\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x02cb\n r0 = 0\n goto L_0x004f\n L_0x02c7:\n r0 = 0\n goto L_0x02a7\n L_0x02c9:\n r0 = 0\n goto L_0x02b3\n L_0x02cb:\n r3 = 0\n r7.e = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.f = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r3 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.a(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x02e9:\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x004f\n L_0x02ef:\n if (r0 == 0) goto L_0x0301\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = defpackage.dvm.HEADER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x0334\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x0334\n L_0x0301:\n r0 = 1\n L_0x0302:\n r7.n = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.l // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.l = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r2 = r2 + r3\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.m = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r1 = r1 + r3\n if (r5 != 0) goto L_0x0342\n if (r2 <= 0) goto L_0x0332\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0332\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x0336\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0332:\n r0 = 0\n L_0x0333:\n return r0\n L_0x0334:\n r0 = 0\n goto L_0x0302\n L_0x0336:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0332\n L_0x0342:\n dtd r0 = r15.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dxv r3 = defpackage.dxw.a(r3, r4, r5) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.a(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r5\n r15.i = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x000d\n L_0x0356:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n if (r3 != 0) goto L_0x0386\n if (r2 <= 0) goto L_0x0378\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0378\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x037a\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0378:\n r0 = 0\n goto L_0x0333\n L_0x037a:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0378\n L_0x0386:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ all -> 0x008e }\n int r2 = r2 + r0\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n dtd r4 = r15.n // Catch:{ all -> 0x008e }\n dxv r0 = r4.a(r0) // Catch:{ all -> 0x008e }\n dtd r0 = (defpackage.dtd) r0 // Catch:{ all -> 0x008e }\n r3.a(r0) // Catch:{ all -> 0x008e }\n goto L_0x000d\n L_0x039e:\n if (r2 <= 0) goto L_0x03ba\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x03ba\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x03bd\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x03ba:\n r0 = 1\n goto L_0x0333\n L_0x03bd:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x03ba\n L_0x03c9:\n dzo r1 = r15.d\n long r4 = (long) r2\n r1.d(r4)\n int r1 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n goto L_0x00ab\n L_0x03d6:\n r3 = r4\n goto L_0x01a8\n L_0x03d9:\n r3 = r0\n goto L_0x0118\n */\n throw new UnsupportedOperationException(\"Method not decompiled: defpackage.dxd.e():boolean\");\n }",
"public void m23075a() {\n }",
"void mo80452a();",
"public final int mo11683a(com.google.android.gms.internal.ads.bci r11, com.google.android.gms.internal.ads.bcn r12) {\n /*\n r10 = this;\n L_0x0000:\n int r12 = r10.f3925e\n r0 = -1\n r1 = 1\n r2 = 0\n switch(r12) {\n case 0: goto L_0x00b2;\n case 1: goto L_0x0044;\n case 2: goto L_0x000e;\n default: goto L_0x0008;\n }\n L_0x0008:\n java.lang.IllegalStateException r11 = new java.lang.IllegalStateException\n r11.<init>()\n throw r11\n L_0x000e:\n int r12 = r10.f3928h\n if (r12 <= 0) goto L_0x0031\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r0 = 3\n r11.mo11675b(r12, r2, r0)\n com.google.android.gms.internal.ads.bcq r12 = r10.f3924d\n com.google.android.gms.internal.ads.bkh r3 = r10.f3923c\n r12.mo11681a(r3, r0)\n int r12 = r10.f3929i\n int r12 = r12 + r0\n r10.f3929i = r12\n int r12 = r10.f3928h\n int r12 = r12 - r1\n r10.f3928h = r12\n goto L_0x000e\n L_0x0031:\n int r11 = r10.f3929i\n if (r11 <= 0) goto L_0x0041\n com.google.android.gms.internal.ads.bcq r3 = r10.f3924d\n long r4 = r10.f3927g\n r6 = 1\n int r7 = r10.f3929i\n r8 = 0\n r9 = 0\n r3.mo11680a(r4, r6, r7, r8, r9)\n L_0x0041:\n r10.f3925e = r1\n return r2\n L_0x0044:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n int r12 = r10.f3926f\n if (r12 != 0) goto L_0x006a\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 5\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 != 0) goto L_0x005a\n L_0x0058:\n r1 = 0\n goto L_0x008d\n L_0x005a:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n long r3 = r12.mo12063j()\n r5 = 1000(0x3e8, double:4.94E-321)\n long r3 = r3 * r5\n r5 = 45\n long r3 = r3 / r5\n r10.f3927g = r3\n goto L_0x0083\n L_0x006a:\n int r12 = r10.f3926f\n if (r12 != r1) goto L_0x0097\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 9\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 != 0) goto L_0x007b\n goto L_0x0058\n L_0x007b:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n long r3 = r12.mo12066m()\n r10.f3927g = r3\n L_0x0083:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12059f()\n r10.f3928h = r12\n r10.f3929i = r2\n L_0x008d:\n if (r1 == 0) goto L_0x0094\n r12 = 2\n r10.f3925e = r12\n goto L_0x0000\n L_0x0094:\n r10.f3925e = r2\n return r0\n L_0x0097:\n com.google.android.gms.internal.ads.bad r11 = new com.google.android.gms.internal.ads.bad\n int r12 = r10.f3926f\n r0 = 39\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>(r0)\n java.lang.String r0 = \"Unsupported version number: \"\n r1.append(r0)\n r1.append(r12)\n java.lang.String r12 = r1.toString()\n r11.<init>((java.lang.String) r12)\n throw r11\n L_0x00b2:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 8\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 == 0) goto L_0x00df\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12065l()\n int r2 = f3921a\n if (r12 != r2) goto L_0x00d7\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12059f()\n r10.f3926f = r12\n r2 = 1\n goto L_0x00df\n L_0x00d7:\n java.io.IOException r11 = new java.io.IOException\n java.lang.String r12 = \"Input not RawCC\"\n r11.<init>(r12)\n throw r11\n L_0x00df:\n if (r2 == 0) goto L_0x00e5\n r10.f3925e = r1\n goto L_0x0000\n L_0x00e5:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.bef.mo11683a(com.google.android.gms.internal.ads.bci, com.google.android.gms.internal.ads.bcn):int\");\n }",
"public void mo12628c() {\n }",
"public synchronized void m6495a(int r6, int r7) throws fr.pcsoft.wdjava.geo.C0918i {\n /* JADX: method processing error */\n/*\nError: jadx.core.utils.exceptions.JadxRuntimeException: Exception block dominator not found, method:fr.pcsoft.wdjava.geo.a.b.a(int, int):void. bs: [B:13:0x001d, B:18:0x0027, B:23:0x0031, B:28:0x003a, B:44:0x005d, B:55:0x006c, B:64:0x0079]\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:86)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/70807318.run(Unknown Source)\n*/\n /*\n r5 = this;\n r4 = 2;\n r1 = 0;\n r0 = 1;\n monitor-enter(r5);\n r5.m6487e();\t Catch:{ all -> 0x0053 }\n switch(r6) {\n case 2: goto L_0x0089;\n case 3: goto L_0x000a;\n case 4: goto L_0x0013;\n default: goto L_0x000a;\n };\t Catch:{ all -> 0x0053 }\n L_0x000a:\n r0 = f2486z;\t Catch:{ all -> 0x0053 }\n r1 = 3;\t Catch:{ all -> 0x0053 }\n r0 = r0[r1];\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n L_0x0011:\n monitor-exit(r5);\n return;\n L_0x0013:\n r3 = new android.location.Criteria;\t Catch:{ all -> 0x0053 }\n r3.<init>();\t Catch:{ all -> 0x0053 }\n r2 = r7 & 2;\n if (r2 != r4) goto L_0x0058;\n L_0x001c:\n r2 = 1;\n r3.setAccuracy(r2);\t Catch:{ i -> 0x0056 }\n L_0x0020:\n r2 = r7 & 128;\n r4 = 128; // 0x80 float:1.794E-43 double:6.32E-322;\n if (r2 != r4) goto L_0x0065;\n L_0x0026:\n r2 = 3;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x0063 }\n L_0x002a:\n r2 = r7 & 8;\n r4 = 8;\n if (r2 != r4) goto L_0x007f;\n L_0x0030:\n r2 = r0;\n L_0x0031:\n r3.setAltitudeRequired(r2);\t Catch:{ i -> 0x0081 }\n r2 = r7 & 4;\n r4 = 4;\n if (r2 != r4) goto L_0x0083;\n L_0x0039:\n r2 = r0;\n L_0x003a:\n r3.setAltitudeRequired(r2);\t Catch:{ i -> 0x0085 }\n r2 = r7 & 16;\n r4 = 16;\n if (r2 != r4) goto L_0x0087;\n L_0x0043:\n r3.setAltitudeRequired(r0);\t Catch:{ all -> 0x0053 }\n r0 = 0;\t Catch:{ all -> 0x0053 }\n r0 = r5.m6485a(r0);\t Catch:{ all -> 0x0053 }\n r1 = 1;\t Catch:{ all -> 0x0053 }\n r0 = r0.getBestProvider(r3, r1);\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n goto L_0x0011;\n L_0x0053:\n r0 = move-exception;\n monitor-exit(r5);\n throw r0;\n L_0x0056:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0058:\n r2 = r7 & 1;\n if (r2 != r0) goto L_0x0020;\n L_0x005c:\n r2 = 2;\n r3.setAccuracy(r2);\t Catch:{ i -> 0x0061 }\n goto L_0x0020;\n L_0x0061:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0063:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0065:\n r2 = r7 & 64;\n r4 = 64;\n if (r2 != r4) goto L_0x0072;\n L_0x006b:\n r2 = 2;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x0070 }\n goto L_0x002a;\n L_0x0070:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0072:\n r2 = r7 & 32;\n r4 = 32;\n if (r2 != r4) goto L_0x002a;\n L_0x0078:\n r2 = 1;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x007d }\n goto L_0x002a;\n L_0x007d:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x007f:\n r2 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x0031;\t Catch:{ all -> 0x0053 }\n L_0x0081:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0083:\n r2 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x003a;\t Catch:{ all -> 0x0053 }\n L_0x0085:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0087:\n r0 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x0043;\t Catch:{ all -> 0x0053 }\n L_0x0089:\n r0 = f2486z;\t Catch:{ all -> 0x0053 }\n r1 = 2;\t Catch:{ all -> 0x0053 }\n r0 = r0[r1];\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n goto L_0x0011;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: fr.pcsoft.wdjava.geo.a.b.a(int, int):void\");\n }",
"void mo41086b();",
"private synchronized void m3985g() {\n /*\n r8 = this;\n monitor-enter(r8);\n r2 = java.lang.Thread.currentThread();\t Catch:{ all -> 0x0063 }\n r3 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r3 = r3.mo1186c();\t Catch:{ all -> 0x0063 }\n r2 = r2.equals(r3);\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0021;\n L_0x0011:\n r2 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1185b();\t Catch:{ all -> 0x0063 }\n r3 = new com.google.analytics.tracking.android.aa;\t Catch:{ all -> 0x0063 }\n r3.<init>(r8);\t Catch:{ all -> 0x0063 }\n r2.add(r3);\t Catch:{ all -> 0x0063 }\n L_0x001f:\n monitor-exit(r8);\n return;\n L_0x0021:\n r2 = r8.f2122n;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x0028;\n L_0x0025:\n r8.m3999d();\t Catch:{ all -> 0x0063 }\n L_0x0028:\n r2 = com.google.analytics.tracking.android.ab.f1966a;\t Catch:{ all -> 0x0063 }\n r3 = r8.f2110b;\t Catch:{ all -> 0x0063 }\n r3 = r3.ordinal();\t Catch:{ all -> 0x0063 }\n r2 = r2[r3];\t Catch:{ all -> 0x0063 }\n switch(r2) {\n case 1: goto L_0x0036;\n case 2: goto L_0x006e;\n case 3: goto L_0x00aa;\n default: goto L_0x0035;\n };\t Catch:{ all -> 0x0063 }\n L_0x0035:\n goto L_0x001f;\n L_0x0036:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0066;\n L_0x003e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.poll();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to store\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2112d;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1197a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n goto L_0x0036;\n L_0x0063:\n r2 = move-exception;\n monitor-exit(r8);\n throw r2;\n L_0x0066:\n r2 = r8.f2121m;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x001f;\n L_0x006a:\n r8.m3987h();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x006e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x00a0;\n L_0x0076:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.peek();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to service\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2111c;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1204a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2.poll();\t Catch:{ all -> 0x0063 }\n goto L_0x006e;\n L_0x00a0:\n r2 = r8.f2123o;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1198a();\t Catch:{ all -> 0x0063 }\n r8.f2109a = r2;\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x00aa:\n r2 = \"Need to reconnect\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x001f;\n L_0x00b7:\n r8.m3991j();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.analytics.tracking.android.y.g():void\");\n }",
"private final void m710e() {\n /*\n r12 = this;\n akn r0 = r12.f531p\n akl r0 = r0.f601d\n if (r0 == 0) goto L_0x0155\n boolean r1 = r0.f580d\n r2 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)\n if (r1 == 0) goto L_0x0017\n aws r1 = r0.f577a\n long r4 = r1.mo1486c()\n r8 = r4\n goto L_0x0019\n L_0x0017:\n r8 = r2\n L_0x0019:\n int r1 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))\n if (r1 != 0) goto L_0x0122\n ajf r1 = r12.f528m\n akn r2 = r12.f531p\n akl r2 = r2.f602e\n akx r3 = r1.f445c\n r4 = 0\n if (r3 == 0) goto L_0x008a\n boolean r3 = r3.mo486w()\n if (r3 != 0) goto L_0x008a\n akx r3 = r1.f445c\n boolean r3 = r3.mo485v()\n if (r3 == 0) goto L_0x0037\n goto L_0x0042\n L_0x0037:\n if (r0 != r2) goto L_0x008a\n akx r2 = r1.f445c\n boolean r2 = r2.mo359g()\n if (r2 == 0) goto L_0x0042\n goto L_0x008a\n L_0x0042:\n bkr r2 = r1.f446d\n long r2 = r2.mo379b()\n boolean r5 = r1.f447e\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n long r5 = r5.mo379b()\n int r7 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))\n if (r7 >= 0) goto L_0x005c\n blf r2 = r1.f443a\n r2.mo2109d()\n goto L_0x0096\n L_0x005c:\n r1.f447e = r4\n boolean r5 = r1.f448f\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n r5.mo2107a()\n L_0x0068:\n blf r5 = r1.f443a\n r5.mo2108a(r2)\n bkr r2 = r1.f446d\n akq r2 = r2.mo376Q()\n blf r3 = r1.f443a\n akq r3 = r3.f4280a\n boolean r3 = r2.equals(r3)\n if (r3 != 0) goto L_0x0096\n blf r3 = r1.f443a\n r3.mo378a(r2)\n aje r3 = r1.f444b\n ake r3 = (p000.ake) r3\n r3.m694a(r2, r4)\n goto L_0x0096\n L_0x008a:\n r2 = 1\n r1.f447e = r2\n boolean r2 = r1.f448f\n if (r2 == 0) goto L_0x0096\n blf r2 = r1.f443a\n r2.mo2107a()\n L_0x0096:\n long r1 = r1.mo379b()\n r12.f513D = r1\n long r0 = r0.mo440b(r1)\n akp r2 = r12.f533r\n long r2 = r2.f623m\n java.util.ArrayList r5 = r12.f530o\n boolean r5 = r5.isEmpty()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n awt r5 = r5.f612b\n boolean r5 = r5.mo1504a()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n long r6 = r5.f613c\n int r8 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1))\n if (r8 != 0) goto L_0x00c5\n boolean r6 = r12.f515F\n if (r6 == 0) goto L_0x00c5\n r6 = -1\n long r2 = r2 + r6\n L_0x00c5:\n r12.f515F = r4\n alh r4 = r5.f611a\n awt r5 = r5.f612b\n java.lang.Object r5 = r5.f2566a\n int r4 = r4.mo525a(r5)\n int r5 = r12.f514E\n r6 = 0\n if (r5 <= 0) goto L_0x00e1\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x00e1:\n L_0x00e2:\n r5 = r6\n L_0x00e3:\n if (r5 != 0) goto L_0x00e6\n goto L_0x0109\n L_0x00e6:\n int r5 = r5.f502a\n if (r4 >= 0) goto L_0x00eb\n L_0x00ea:\n goto L_0x00f4\n L_0x00eb:\n if (r4 != 0) goto L_0x0109\n r7 = 0\n int r5 = (r2 > r7 ? 1 : (r2 == r7 ? 0 : -1))\n if (r5 >= 0) goto L_0x0109\n goto L_0x00ea\n L_0x00f4:\n int r5 = r12.f514E\n int r5 = r5 + -1\n r12.f514E = r5\n if (r5 <= 0) goto L_0x0108\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x0108:\n goto L_0x00e2\n L_0x0109:\n int r2 = r12.f514E\n java.util.ArrayList r3 = r12.f530o\n int r3 = r3.size()\n if (r2 >= r3) goto L_0x011d\n java.util.ArrayList r2 = r12.f530o\n int r3 = r12.f514E\n java.lang.Object r2 = r2.get(r3)\n akb r2 = (p000.akb) r2\n L_0x011d:\n akp r2 = r12.f533r\n r2.f623m = r0\n goto L_0x0140\n L_0x0122:\n r12.m691a(r8)\n akp r0 = r12.f533r\n long r0 = r0.f623m\n int r2 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))\n if (r2 == 0) goto L_0x0140\n akp r0 = r12.f533r\n awt r7 = r0.f612b\n long r10 = r0.f614d\n r6 = r12\n akp r0 = r6.m686a(r7, r8, r10)\n r12.f533r = r0\n akc r0 = r12.f529n\n r1 = 4\n r0.mo409b(r1)\n L_0x0140:\n akn r0 = r12.f531p\n akl r0 = r0.f603f\n akp r1 = r12.f533r\n long r2 = r0.mo442c()\n r1.f621k = r2\n akp r0 = r12.f533r\n long r1 = r12.m719n()\n r0.f622l = r1\n return\n L_0x0155:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.ake.m710e():void\");\n }",
"public void mo21785J() {\n }",
"public final com.google.android.gms.internal.ads.zzafx mo4170d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19705f;\n monitor-enter(r0);\n r1 = r2.f19706g;\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n r1 = r1.m26175a();\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x000b:\n r1 = move-exception;\t Catch:{ all -> 0x000b }\n goto L_0x0010;\t Catch:{ all -> 0x000b }\n L_0x000d:\n r1 = 0;\t Catch:{ all -> 0x000b }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x0010:\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzafn.d():com.google.android.gms.internal.ads.zzafx\");\n }",
"protected boolean func_70041_e_() { return false; }",
"static /* synthetic */ void m204-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }",
"public int g()\r\n/* 173: */ {\r\n/* 174:198 */ return 0;\r\n/* 175: */ }"
] | [
"0.7616782",
"0.75728166",
"0.7525724",
"0.74507046",
"0.74505866",
"0.74373597",
"0.7381616",
"0.7381616",
"0.7366568",
"0.735341",
"0.73420185",
"0.73150736",
"0.7308675",
"0.73055106",
"0.7274724",
"0.72523946",
"0.72216254",
"0.71979403",
"0.7177258",
"0.7136552",
"0.7106082",
"0.70418596",
"0.7024962",
"0.70197546",
"0.69911283",
"0.69613564",
"0.69409144",
"0.6908151",
"0.6890134",
"0.68525946",
"0.68281573",
"0.67949134",
"0.6784313",
"0.6777685",
"0.67725635",
"0.677158",
"0.6769469",
"0.6767704",
"0.67430586",
"0.67081237",
"0.6701509",
"0.66999537",
"0.6698843",
"0.6698377",
"0.6670063",
"0.6668109",
"0.66555125",
"0.6613381",
"0.661335",
"0.6609933",
"0.6594555",
"0.65691173",
"0.65659195",
"0.6539569",
"0.6514096",
"0.65095544",
"0.65094143",
"0.6490445",
"0.64368844",
"0.6432842",
"0.6430799",
"0.6404235",
"0.6401294",
"0.6372685",
"0.6369568",
"0.6368447",
"0.63579416",
"0.6329343",
"0.6326999",
"0.63252985",
"0.6317552",
"0.6305244",
"0.630364",
"0.62988764",
"0.6281612",
"0.6281284",
"0.6241846",
"0.6228182",
"0.622796",
"0.62267816",
"0.62259656",
"0.62186515",
"0.62184393",
"0.6204782",
"0.6197622",
"0.61945254",
"0.6180569",
"0.61717045",
"0.61680174",
"0.6164003",
"0.61634594",
"0.6161363",
"0.615725",
"0.61552316",
"0.61522835",
"0.61414874",
"0.61262673",
"0.6115875",
"0.6111993",
"0.6102305",
"0.6096556"
] | 0.0 | -1 |
Created by parado on 19.03.14. | public interface IInstructorService extends IIdentifiableService<Instructor> {
Instructor activate(Instructor instructor);
Instructor deactivate(Instructor instructor);
List<Course> findCourses(Instructor instructor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private void poetries() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\n void init() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void init() {}",
"private void strin() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void init() {\n }",
"protected boolean func_70814_o() { return true; }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo4359a() {\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n public void memoria() {\n \n }",
"private void init() {\n\n\n\n }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n public void initialize() { \n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n protected void getExras() {\n }",
"private void m50366E() {\n }",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"Petunia() {\r\n\t\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private void initialize() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}"
] | [
"0.5917266",
"0.58803254",
"0.57635885",
"0.5746273",
"0.5643697",
"0.5643697",
"0.56381077",
"0.56301445",
"0.56015706",
"0.5587952",
"0.55824596",
"0.55724674",
"0.55720097",
"0.555806",
"0.5544956",
"0.55335903",
"0.5527613",
"0.5526477",
"0.5526477",
"0.5526477",
"0.5526477",
"0.5526477",
"0.552303",
"0.55190915",
"0.5499439",
"0.54985666",
"0.54905576",
"0.5479275",
"0.5460744",
"0.5460744",
"0.5457083",
"0.5457009",
"0.5454726",
"0.54471153",
"0.5433004",
"0.5405246",
"0.54012626",
"0.54012626",
"0.54012626",
"0.54012626",
"0.54012626",
"0.54012626",
"0.54002994",
"0.5392078",
"0.5391355",
"0.5391355",
"0.5390822",
"0.5389974",
"0.5387751",
"0.5380863",
"0.5378981",
"0.53788346",
"0.5377798",
"0.53692174",
"0.53692174",
"0.53692174",
"0.5367215",
"0.5367215",
"0.5367215",
"0.53605807",
"0.53572124",
"0.5352359",
"0.5352359",
"0.5352359",
"0.5351408",
"0.53496385",
"0.53496385",
"0.5346769",
"0.533558",
"0.53308076",
"0.5326164",
"0.53115547",
"0.5308783",
"0.5303467",
"0.5300102",
"0.52857536",
"0.52783805",
"0.52681583",
"0.52676517",
"0.52661586",
"0.5262603",
"0.5255489",
"0.525363",
"0.52524865",
"0.5249884",
"0.52342397",
"0.52342397",
"0.52305",
"0.5226439",
"0.5225232",
"0.52217245",
"0.52217245",
"0.52217245",
"0.52217245",
"0.52217245",
"0.52217245",
"0.52217245",
"0.52194935",
"0.5203216",
"0.51928043",
"0.51906353"
] | 0.0 | -1 |
String configpath = "/Users/milo/document/workspace/mofang.chat.frontend/src/main/resources/config.ini"; | public static void main(String[] args)
{
if(args.length <= 0)
{
System.out.println("usage:java -server -Xms1024m -Xmx1024m -jar mofang-chat-frontend.jar configpath");
System.exit(1);
}
String configpath = args[0];
try
{
///服务器初始化
System.out.println("prepare to initializing config......");
Initializer initializer = new MainInitializer(configpath);
initializer.init();
System.out.println("initialize config completed!");
///启动服务器
ActionResolve websocketActionResolve = new WebSocketActionResolve();
ActionResolve httpActionResolve = new HttpActionResolve();
int port = GlobalConfig.SERVER_PORT;
WebServer server = new WebServer(port, PostDataParserType.Json);
///channel 配置
ChannelConfig channelConfig = new ChannelConfig();
channelConfig.setConnTimeout(GlobalConfig.CONN_TIMEOUT);
channelConfig.setSoTimeout(GlobalConfig.READ_TIMEOUT);
///Idle 配置
IdleConfig idleConfig = new IdleConfig();
idleConfig.setReadIdleTime(GlobalConfig.READ_IDLE_TIME);
idleConfig.setWriteIdleTime(GlobalConfig.WRITE_IDLE_TIME);
idleConfig.setAllIdleTime(GlobalConfig.ALL_IDLE_TIME);
///webserver logger
FrameworkLogger serverLogger = new FrameworkLogger();
server.setWebServerLogger(serverLogger);
server.setChannelConfig(channelConfig);
server.setIdleConfig(idleConfig);
server.setScanPackagePath(GlobalConfig.SCAN_PACKAGE_PATH);
server.setWebSocketActionResolve(websocketActionResolve);
server.setHttpActionResolve(httpActionResolve);
server.setWebSocketCloseHandlerClass(WebSocketCloseHandlerImpl.class);
try
{
System.out.println("Frontend Server Start on " + GlobalConfig.SERVER_PORT);
server.start();
}
catch(Exception e)
{
e.printStackTrace();
}
}
catch (Exception e)
{
System.out.println("frontend server start error. message:");
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String readConfiguration(String path);",
"String getConfigFileName();",
"private void initPath() {\n this.IniFile = new IniFile();\n String configPath = this.getApplicationContext().getFilesDir()\n .getParentFile().getAbsolutePath();\n if (configPath.endsWith(\"/\") == false) {\n configPath = configPath + \"/\";\n }\n this.appIniFile = configPath + constants.USER_CONFIG_FILE_NAME;\n }",
"private static String getConfigFile() {\n\n final String sPath = getUserFolder();\n\n return sPath + File.separator + \"sextante.settings\";\n\n }",
"public File getConfigurationFile();",
"void setConfigFileName( String s );",
"String path(Configuration configuration);",
"public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t}",
"public static String getConfigurationFilePath() {\n\n return getCloudTestRootPath() + File.separator + \"Config\"\n + File.separator + \"PluginConfig.xml\";\n }",
"public static String setConfigPath(String propertFileName ) {\n String propFilePath;\n\n propFilePath = \"src\" + File.separator + \"main\" + File.separator\n + \"resources\" + File.separator + propertFileName;\n return propFilePath;\n }",
"public String readConfig(String path) throws Exception {\n\t\treturn getObject(path + CONFIG);\n\t}",
"List<String> getConfigFilePaths();",
"private static void readConfigFile() {\n\n BufferedReader input = null;\n try {\n input = new BufferedReader(new FileReader(getConfigFile()));\n String sLine = null;\n while ((sLine = input.readLine()) != null) {\n final String[] sTokens = sLine.split(\"=\");\n if (sTokens.length == 2) {\n m_Settings.put(sTokens[0], sTokens[1]);\n }\n }\n }\n catch (final FileNotFoundException e) {\n }\n catch (final IOException e) {\n }\n finally {\n try {\n if (input != null) {\n input.close();\n }\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n }\n\n }",
"private void loadConfig()\n {\n File config = new File(\"config.ini\");\n\n if (config.exists())\n {\n try\n {\n BufferedReader in = new BufferedReader(new FileReader(config));\n\n configLine = Integer.parseInt(in.readLine());\n configString = in.readLine();\n socketSelect = (in.readLine()).split(\",\");\n in.close();\n }\n catch (Exception e)\n {\n System.exit(1);\n }\n }\n else\n {\n System.exit(1);\n }\n }",
"@Override\n public String getConfigPath() {\n String fs = String.valueOf(File.separatorChar);\n StringBuilder sb = new StringBuilder();\n\n sb.append(\"scan\").append(fs);\n sb.append(\"config\").append(fs);\n sb.append(\"mesoTableConfig\").append(fs);\n\n return sb.toString();\n }",
"public String readConfig(Context context) {\n\n String ret = \"\";\n\n try {\n InputStream inputStream = context.openFileInput(\"config.txt\");\n\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receiveString = \"\";\n StringBuilder stringBuilder = new StringBuilder();\n\n while ((receiveString = bufferedReader.readLine()) != null) {\n stringBuilder.append(receiveString);\n }\n\n inputStream.close();\n ret = stringBuilder.toString();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"Config\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"Config\", \"Can not read file: \" + e.toString());\n }\n\n return ret;\n }",
"@Test\n public void getPath() throws Exception {\n ReadConfig conf = new ReadConfig();\n try {\n conf.getPath(0);\n } catch (Exception e) {\n assertTrue(e.getMessage().equals(\"Try to access config file before reading it.\") );\n }\n try {\n conf.readFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n assertNotNull(conf.getPath(0));\n String total = conf.getFileLocation() + \"/\" + conf.getFileName().get(0);\n assertEquals(total, conf.getPath(0));\n }",
"private static Path getConfig(String modName)\n\t{\n\t\treturn Paths.get(\"config\"+File.separator+modName+\".cfg\").toAbsolutePath();\n\t}",
"private void GetConfig()\n {\n boolean useClassPath = false;\n if(configFile_ == null)\n {\n useClassPath = true;\n configFile_ = \"data.config.lvg\";\n }\n // read in configuration file\n if(conf_ == null)\n {\n conf_ = new Configuration(configFile_, useClassPath);\n }\n }",
"String getApplicationContextPath();",
"private static String readPropertiesFile() {\n Properties prop = new Properties();\n\n try (InputStream inputStream = MembershipService.class.getClassLoader().getResourceAsStream(\"config.properties\")) {\n\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n throw new FileNotFoundException(\"property file 'config.properties' not found in the classpath\");\n }\n } catch (Exception e) {\n return \"\";\n }\n return prop.getProperty(\"introducer\");\n }",
"public String getConfigProperties(String key) {\n String value = null;\n try {\n FileReader fileReader=new FileReader(System.getProperty(\"user.dir\")+\"/src/main/resources/config.properties\");\n Properties properties=new Properties();\n properties.load(fileReader);\n value= properties.getProperty(key);\n }catch (Exception e){\n e.printStackTrace();\n }\n return value;\n }",
"public String getUrlFromConfigFile(File configFile) {\n StringBuilder text = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(configFile));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n }\n br.close();\n } catch (IOException ex) {\n Toast.makeText(this, \"Reading file: \" + ex.getMessage(), Toast.LENGTH_LONG).show();\n }\n\n return text.toString();\n }",
"public interface FileConfig {\n /**\n * get the mustache file path.\n * @return file path\n */\n String getPath();\n}",
"public static IFile getConfigLocalFile(IProject proj) {\n return proj.getFile(SLOEBER_PROJECT);\n }",
"public String getConfigFile() {\n return configFile;\n }",
"public Config(String filename) {\n this.filename = filename;\n }",
"public interface IPathConstant {\n\tString PROPERTY_FILEPATH=\"./src/main/resources/CommonData.properties\";\n\tString EXCELPATH=\"./src/test/resources/testdata.xlsx\";\n\tString JSONFILEPATH=\"\";\n\tString htmlPath=\"./extentReport\"+JavaUtility.getCurrentSystemDate()+\".html\";\n}",
"private void LoadConfigFromClasspath() throws IOException \n {\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(\"lrs.properties\");\n config.load(is);\n is.close();\n\t}",
"private void initiate(){try{\n\t//String dataIni = run.class.getResource(\"../util/DataBase.ini\").getFile();\n //FileInputStream fin=new FileInputStream(dataIni); // 打开文件,从根目录开始寻找\n//\tFileInputStream fin=new FileInputStream(\"src/util/DataBase.ini\"); // 打开文件,从根目录开始寻找\n//\tProperties props=new Properties(); // 建立属性类,读取ini文件\n//\tprops.load(fin); \n//\tdriver=props.getProperty(\"driver\"); //根据键读取值\n//\turl=props.getProperty(\"url\");\n//\tusername=props.getProperty(\"username\");\n//\tuserpassword=props.getProperty(\"userpassword\");\n\t}\n\tcatch(Exception e){e.printStackTrace();}\n\t}",
"public static void loadConfig(String path) throws IOException {\n \tInputStream stream = null;\n \t\n \t// Load the config\n \ttry {\n \t\t// Get the stream\n \t\ttry {\n \t\t\tstream = new FileInputStream(new File(path));\n \t\t} catch(FileNotFoundException e) {\n \t\t\tstream = NotaQL.class.getClassLoader().getResourceAsStream(path);\n \t\t}\n\n \t\tif(stream == null) {\n \t\t\tthrow new FileNotFoundException(\"Unable to find \" + path + \" in classpath.\");\n \t\t}\n\n \t\t\n \t\t// load the properties\n \t\tloadConfig(stream);\n\n \t} finally {\n \t\t// Always close the stream if any\n \t\tif (stream != null)\n \t\t\tstream.close();\n\t\t}\n }",
"public static File getConfigDirectory() {\n return getDirectoryStoragePath(\"/NWD/config\", false);\n }",
"public static void main(String[] args)\n {\n AppConfig.LoadIntoConfigFiles();\n //configFileName\n }",
"@Test\n public void getFileLocation() throws Exception {\n ReadConfig conf = new ReadConfig();\n try {\n conf.getFileLocation();\n } catch (Exception e) {\n assertTrue(e.getMessage().equals(\"Try to access config file before reading it.\") );\n }\n try {\n conf.readFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n assertNotNull(conf.getFileLocation());\n }",
"private static void loadConfig()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal Properties props = ManagerServer.loadProperties(ManagerServer.class, \"/resources/conf.properties\");\n\t\t\tasteriskIP = props.getProperty(\"asteriskIP\");\n\t\t\tloginName = props.getProperty(\"userName\");\n\t\t\tloginPwd = props.getProperty(\"password\");\n\t\t\toutboundproxy = props.getProperty(\"outBoundProxy\");\n\t\t\tasteriskPort = Integer.parseInt(props.getProperty(\"asteriskPort\"));\n\t\t}\n\t\tcatch (IOException ex)\n\t\t{\n\t\t\tLOG.error(\"IO Exception while reading the configuration file.\", ex);\n\t\t}\n\t}",
"public String getConfig();",
"public ConfigFileNotFoundException() {\n\tthis(\"No pude encontrar el archivo de configuración!\");\n }",
"public static void loadConfig(){\n String filename = ConfigManager.getConfig().getString(LANG_FILE_KEY);\n String langFileName = Language.LANG_FOLDER_NAME + '/' + filename;\n config.setConfigFile(langFileName);\n\n File file = config.getConfigFile();\n if(file.exists()){\n config.loadConfig();\n }else{\n Logger.warn(\"Lang file \\\"\" + filename + \"\\\" doesn't exist\", false);\n Logger.warn(\"Using English language to avoid errors\", false);\n config.clearConfig();\n try{\n config.getBukkitConfig().load(plugin.getResource(Language.EN.getLangFileName()));\n }catch(Exception ex){\n Logger.err(\"An error occurred while loading English language:\", false);\n Logger.err(ex, false);\n }\n }\n//</editor-fold>\n }",
"private static void manageGameConfigFile(File configFile) {\n Gson gson = new Gson();\n try {\n GameConfig.setInstance(gson.fromJson(new FileReader(configFile), GameConfig.class));\n } catch (FileNotFoundException e) {\n LogUtils.error(\"FileNotFoundException => \", e);\n }\n }",
"public static ChebiConfig readFromFile(String filePath) throws IOException {\n InputStream is = null;\n try {\n is = ChebiConfig.class.getClassLoader()\n .getResourceAsStream(filePath);\n if (is == null){\n LOGGER.info(filePath + \" not found in the classpath,\"\n + \" trying the working directory...\");\n is = new FileInputStream(filePath);\n }\n return readFromInputStream(is);\n } finally {\n if (is != null) try {\n is.close();\n } catch (IOException e) {\n LOGGER.error(\"Unable to close input stream\", e);\n }\n }\n }",
"public Properties loadConfig(){\n\t\tprintln(\"Begin loadConfig \");\n\t\tProperties prop = null;\n\t\t prop = new Properties();\n\t\ttry {\n\t\t\t\n\t\t\tprop.load(new FileInputStream(APIConstant.configFullPath));\n\n\t } catch (Exception ex) {\n\t ex.printStackTrace();\n\t println(\"Exception \"+ex.toString());\n\t \n\t }\n\t\tprintln(\"End loadConfig \");\n\t\treturn prop;\n\t\t\n\t}",
"@BeforeClass\n\tpublic void readConfig() {\n\t\t// object creation of properties file\n\n\t\tProperties prop = new Properties();\n\n\t\t// read the file: inputstream\n\n\t\ttry {\n\t\t\tInputStream input = new FileInputStream(\"\\\\src\\\\main\\\\java\\\\config\\\\config.properties\");\n\t\t\tprop.load(input);\n\t\t\tbrowser = prop.getProperty(\"browser\");\n\t\t//\turl = prop.getProperty(\"url\");\n\t\t\t\n\t\t}\n\n\t\tcatch (IOException e) {\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\t}",
"private static File getInstallFolderConfFile() throws IOException {\n String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;\n String installFolder = PlatformUtil.getInstallPath();\n File installFolderEtc = new File(installFolder, ETC_FOLDER_NAME);\n File installFolderConfigFile = new File(installFolderEtc, confFileName);\n if (!installFolderConfigFile.exists()) {\n throw new IOException(\"Conf file could not be found\" + installFolderConfigFile.toString());\n }\n return installFolderConfigFile;\n }",
"public String getResourcePath();",
"public static void main(String[] args) { \n\t\t \n\t\t String path =ResourceHelper.getResourcePath(\"src/main/resources/configfile/log4j.properties\"); \n\t\t System.out.println(path);\n\t }",
"private String getPlaymeidFromConfig(){\n\t\tString playmeid = \"\";\n\t\ttry {\n\t\t\tString filePath = \"/system/etc/manufactory.conf\";\n\t\t\tFile file = new File(filePath);\n\t\t\tif (!file.isFile()) {\n\t\t\t\treturn playmeid;\n\t\t\t}\n\t\t\tFileInputStream fin = new FileInputStream(filePath);\n\t\t\tint length = fin.available();\n\t\t\tif(length == 32){\n\t\t\t\tbyte[] buffer = new byte[length];\n\t\t\t\tfin.read(buffer);\n//\t\t\t\tplaymeid = EncodingUtils.getString(buffer, \"UTF-8\");\n\t\t\t\tfin.close();\n\t\t\t\treturn new String(buffer);\n\t\t\t}\n\t\t\tfin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn playmeid;\n\t}",
"public URI getConfigurationFile() {\n return configurationFile;\n }",
"public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }",
"public void setConfigurationFileString(String s) {\r\n\t\tthis.configurationFileString = s;\r\n\t}",
"public File getConfigFile() {\r\n\t\treturn new File(homeDir, \"tacos.config\");\r\n\t}",
"abstract public Config createConfig(String path);",
"public String getConfigurationFileString() {\r\n\t\treturn configurationFileString;\r\n\t}",
"public static ChebiConfig readFromFile() throws IOException{\n return readFromInputStream(ChebiConfig.class.getClassLoader()\n .getResourceAsStream(\"chebi-adapter.properties\"));\n }",
"public interface IConfigurationProvider {\r\n String get(String path);\r\n}",
"String getFilepath();",
"public static Config createConfig(String path) throws FileNotFoundException {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n BufferedReader br = new BufferedReader(new FileReader(path));\n\n Config saps = gson.fromJson(br, Config.class);\n return saps;\n }",
"@Override\r\n public File getProfileConfigurationFile() {\n return new File(getConfigurablePath(ConfigurablePathId.PROFILE_ROOT), MAIN_CONFIGURATION_FILENAME);\r\n }",
"public String getBasePath(){\r\n\t\t \r\n\t\t String basePath = properties.getProperty(\"getPath\");\r\n\t\t if(basePath != null) return basePath;\r\n\t\t else throw new RuntimeException(\"getPath not specified in the configuration.properties file.\");\r\n\t }",
"private static Config loadConfig(String name) {\n\n\t\tString path;\n\t\tif (name == null) {\n\t\t\tpath = \"application.json\";\n\t\t} else {\n\t\t\tpath = \"src/\"+extensionsPackage+\"/\" + name + \"/config.json\";\n\t\t}\n\n\t\tGson gson = new Gson();\n\t\tConfig config = null;\n\n\t\ttry {\n\t\t\tconfig = gson.fromJson(new FileReader(path), Config.class);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn config;\n\t}",
"private static String loadPropertiesFileByEnvironement(String propertiesPath) {\n\t\t\tSystem.setProperty(\"ENV\", \"dev\");\n\t\tString env = System.getProperty(\"ENV\");\n\t\tString [] ts = propertiesPath.split(\"/\");\n\t\tfor(int i = 0;i<ts.length;i++){\n\t\t\tif(ts[i].contains(\".cfg.\")){\n\t\t\t\tts[i] = env+\"_\"+ts[i];\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tString newPathProperties = \"\";\n\t\tfor(String s : ts)\n\t\t\tnewPathProperties=newPathProperties +\"/\"+s;\n\t\tnewPathProperties = newPathProperties.substring(1,newPathProperties.length());\n\t\treturn newPathProperties;\n\t}",
"protected static File getInternalConfigurationFile(String pathToApplication) {\r\n\t\t\r\n\t\tString configPath = PhotoConstants.PROPERTIES_PATH;\r\n\t\tString configFileName = PhotoConstants.SETUP_FILE;\r\n\t\t\r\n\t\t// read configuration\r\n\t\tFile configDir = new File(pathToApplication, configPath);\r\n\t\tFile configFile = new File (configDir, configFileName);\r\n\t\treturn configFile;\r\n\t}",
"public String getIniLocation() {\n return iniLocation;\n }",
"public static String getConfigFileLocation(String propertyFilePath) {\n String fileLoc = System.getProperty(\"user.dir\") + propertyFilePath;\n return fileLoc.replace(\"/\", File.separator);\n }",
"public ReadConfigProperty() {\n\n\t\ttry {\n\t\t\tString filename = \"com/unitedcloud/resources/config.properties\";\n\t\t\tinput = ReadConfigProperty.class.getClassLoader().getResourceAsStream(filename);\n\t\t\tif (input == null) {\n\t\t\t\tSystem.out.println(\"Sorry, unable to find \" + filename);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void setConfigfile (File file)\n {\n _configfile = file;\n }",
"public interface ConfigProperties {\n ConfigFileReader config = new ConfigFileReader();\n // Common configuration properties\n String WORKING_DIRECTORY = System.getProperty(\"user.dir\");\n String TestAppName = config.getProperty(\"testappname\");\n String TestExecutionType = config.getProperty(\"testexecutiontype\");\n String OsType = config.getProperty(\"ostype\");\n // String AppType = config.getProperty(\"apptype\");\n String AppType = config.getProperty(\"apptype\");\n String AppiumVersion = config.getProperty(\"appiumversion\");\n long EXPLICIT_WAIT_TIME = Integer.parseInt(config.getProperty(\"explicit.wait\"));\n long IMPLICIT_WAIT_TIME = Integer.parseInt(config.getProperty(\"implicit.wait\"));\n long DEFAULT_WAIT_TIME = Integer.parseInt(config.getProperty(\"default.wait\"));\n String APPLICATION_NAME = config.getProperty(\"key\");\n String APPIUM_PORT = config.getProperty(\"appium.server.port\");\n String APPIUM_SYSTEM_PORT = config.getProperty(\"appium.system.port\");\n int NEW_COMMAND_TIMEOUT = Integer.parseInt(config.getProperty(\"new.command.timeout\"));\n String DEVICE_READY_TIMEOUT = config.getProperty(\"device.ready.timeout\");\n String HubAddress = config.getProperty(\"HubAddress\");\n String DEVICE_CATEGORY = config.getProperty(\"Device.category\");\n String TabletSize = config.getProperty(\"Tablet.size\");\n String ExecutionEnvironment = config.getProperty(\"execution.environment\");\n //String User_Type = config.getProperty(\"usertype\");\n String User_Type = config.getProperty(\"usertype\");\n String Full_Reset = config.getProperty(\"full.reset\");\n String No_Reset = config.getProperty(\"no.reset\");\n // iOS specific configuration properties\n String IOS_AUTOMATION_NAME = config.getProperty(\"ios.automation.name\");\n String IOS_BROWSER_NAME = config.getProperty(\"ios.browser.name\");\n String IOS_PLATFORM_NAME = config.getProperty(\"ios.platform.name\");\n String IOS_PLATFORM_VERSION = config.getProperty(\"ios.platform.version\");\n String IOS_DEVICE_NAME = config.getProperty(\"ios.device.name\");\n String IOS_BUNDLE_ID = config.getProperty(\"ios.bundle.id\");\n String IOS_APPLICATION_PATH = getConfigFileLocation(config.getProperty(\"ios.application.apppath\"));\n String IOS_UDID = config.getProperty(\"ios.udid\");\n // Android specific configuration properties\n String ANDROID_AUTOMATION_NAME = config.getProperty(\"android.automation.name\");\n String ANDROID_APP_PKG = config.getProperty(\"android.app.pkg\");\n String ANDROID_APP_ACTIVITY = config.getProperty(\"android.application.activity\");\n String ANDROID_APPlICATION_PATH = getConfigFileLocation(config.getProperty(\"android.application.apppath\"));\n String ANDROID_DEVICE_NAME = config.getProperty(\"android.device.name\");\n String ANDROID_PLATFORM_VERSION = config.getProperty(\"android.platform.version\");\n // Windows specific configuration properties\n String WINDOWS_APPlICATION_PATH = getConfigFileLocation(config.getProperty(\"windows.application.apppath\"));\n String WINDOWS_DEVICE_NAME = config.getProperty(\"windows.device.name\");\n boolean SCREENSHOT_ON_PASS = Boolean.parseBoolean(config.getProperty(\"screenshotOnPass\"));\n }",
"private File getConfigurationFile() {\n return new File(BungeeBan.getInstance().getDataFolder(), this.filename);\n }",
"public Config createConfig(String filename);",
"private static HisPatientInfoConfiguration loadConfiguration(String filePath) throws HisServiceException{\n File file = new File(filePath);\n if(file != null && file.exists() && file.isFile() ) {\n try {\n configuration = new Yaml().loadAs(new FileInputStream(file), HisPatientInfoConfiguration.class);\n } catch(FileNotFoundException e) {\n log.error(e.getMessage());\n isOK = false;\n throw new HisServiceException(HisServerStatusEnum.NO_CONFIGURATION);\n }\n }\n else {\n isOK = false;\n }\n return configuration;\n }",
"public interface Constants {\r\n\t/**\r\n\t * Example directory.\r\n\t */\r\n\tPath EXAMPLE_DIR = Path.of(\"src/main/resources\");\r\n\t/**\r\n\t * Example XML file.\r\n\t */\r\n\tPath EXAMPLE_PATH = Path.of(EXAMPLE_DIR.toString(), \"example.xml\");\r\n\t/**\r\n\t * Example text file name.\r\n\t */\r\n\tString EXAMPLE_TXT_FILE_NAME = \"example.txt\";\r\n\t/**\r\n\t * Example ZIP file name.\r\n\t */\r\n\tString EXAMPLE_ZIP_FILE_NAME = \"example.zip\";\r\n\t/**\r\n\t * Example ZIP file.\r\n\t */\r\n\tPath EXAMPLE_ZIP_PATH = Path.of(EXAMPLE_DIR.toString(), EXAMPLE_ZIP_FILE_NAME);\r\n\t/**\r\n\t * Example ZIP file entry.\r\n\t */\r\n\tString EXAMPLE_ZIP_ENTRY = \"data/example.xml\";\r\n\t/**\r\n\t * Example properties file.\r\n\t */\r\n\tPath EXAMPLE_PROPERTIES_PATH = Path.of(System.getProperty(\"user.dir\"), EXAMPLE_DIR.toString(),\r\n\t\t\t\"example.properties\");\r\n\t/**\r\n\t * Length of string to read.\r\n\t */\r\n\tString XML_CONTENT = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\r\n}",
"public void read() {\n\t\tconfigfic = new Properties();\n\t\tInputStream input = ConfigReader.class.getClassLoader().getResourceAsStream(\"source/config.properties\");\n\t\t// on peut remplacer ConfigReader.class par getClass()\n\t\ttry {\n\t\t\tconfigfic.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private <T> T readConfig(final ConfigurationFactory<T> factory, final String filePath) {\n try (final BufferedReader reader = Files.newBufferedReader(getDataFolder().toPath().resolve(filePath))) {\n return factory.create(YamlConfiguration.loadConfiguration(reader));\n } catch (final IOException e) {\n throw new RuntimeException(String.format(\"Could not read configuration file %s in plugin data-folder\",\n filePath), e);\n }\n }",
"private String getProjectName(String configFilePath) {\r\n\t\t// get the project name i.e the first directory name relative to the projects root\r\n\t\tFile projectsRoot = new File(RuntimeVariables.getProjectsRoot());\r\n\t\tString relativePath = configFilePath.substring(projectsRoot.getAbsolutePath().length());\r\n\t\treturn new StringTokenizer(relativePath, File.separator).nextToken();\t\t\r\n\t}",
"public abstract String getConfig();",
"public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}",
"public static void loadFromFile() {\n\t\tloadFromFile(Main.getConfigFile(), Main.instance.getServer());\n\t}",
"public void loadConfig(){\r\n File config = new File(\"config.ini\");\r\n if(config.exists()){\r\n try {\r\n Scanner confRead = new Scanner(config);\r\n \r\n while(confRead.hasNextLine()){\r\n String line = confRead.nextLine();\r\n if(line.indexOf('=')>0){\r\n String setting,value;\r\n setting = line.substring(0,line.indexOf('='));\r\n value = line.substring(line.indexOf('=')+1,line.length());\r\n \r\n //Perform the actual parameter check here\r\n if(setting.equals(\"romfile\")){\r\n boolean result;\r\n result = hc11_Helpers.loadBinary(new File(value.substring(value.indexOf(',')+1,value.length())),board,\r\n Integer.parseInt(value.substring(0,value.indexOf(',')),16));\r\n if(result)\r\n System.out.println(\"Loaded a rom file.\");\r\n else\r\n System.out.println(\"Error loading rom file.\");\r\n }\r\n }\r\n }\r\n confRead.close();\r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }",
"private String getConfigurationDirectory() throws UnsupportedEncodingException {\r\n\r\n String folder;\r\n if (ISphereJobLogExplorerPlugin.getDefault() != null) {\r\n // Executed, when started from a plug-in.\r\n folder = ISphereJobLogExplorerPlugin.getDefault().getStateLocation().toFile().getAbsolutePath() + File.separator + REPOSITORY_LOCATION\r\n + File.separator;\r\n FileHelper.ensureDirectory(folder);\r\n } else {\r\n // Executed, when started on a command line.\r\n URL url = getClass().getResource(DEFAULT_CONFIGURATION_FILE);\r\n if (url == null) {\r\n return null;\r\n }\r\n String resource = URLDecoder.decode(url.getFile(), \"utf-8\"); //$NON-NLS-1$\r\n folder = new File(resource).getParent() + File.separator;\r\n }\r\n return folder;\r\n }",
"private static void inputFile(final String jsonString, final String path) {\n new Thread(new Runnable() {\r\n \r\n public void run() { \r\n // TODO Auto-generated method stub\r\n WriteConfigJson(jsonString,path);\r\n }\r\n }).start();\r\n }",
"public ReadConfig() \n\t{\n\t\tFile scr = new File(\"./Configuration/config.properties\"); //property file\n\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(scr); // READ the DATA (read mode)\n\t\t\tpro = new Properties(); // pro object\n\t\t\tpro.load(fis); // Load method -load at the \n\n\t\t} catch (final Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(\"Except is \" + e.getMessage());\n\t\t} \n\t}",
"public void getConfigProperty() {\n Properties properties = new Properties();\n try(InputStream input = new FileInputStream(\"config.properties\");){\n properties.load(input);\n logger.info(\"BASE URL :\" + properties.getProperty(\"BASEURL\"));\n setBaseUrl(properties.getProperty(\"BASEURL\"));\n setLoginMode(properties.getProperty(\"LOGINMODE\"));\n setProjectId(properties.getProperty(\"PROJECTID\"));\n setReportId(properties.getProperty(\"REPORTID\"));\n if (!(properties.getProperty(\"PASSWORD\").trim().equals(\"\"))) {\n setPassword(properties.getProperty(\"PASSWORD\"));\n }\n if (!(properties.getProperty(\"USERNAME\").trim().equals(\"\"))) {\n setUserName(properties.getProperty(\"USERNAME\"));\n }\n }catch(IOException ex) {\n logger.debug(\"Failed to fetch value from configure file: \", ex);\n }\n\n }",
"public void setConfig(String config)\n throws IOException\n {\n _config=config;\n _configResource=Resource.newResource(_config);\n loadConfig();\n \n }",
"public FileConfiguration loadConfiguration(File file);",
"private void checkConfig(String path) {\n\t\tLog.i(\"ChooseFileActivity\", \"Path: \" + path);\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(path);\n\t\t\tBufferedReader myReader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfis));\n\t\t\tboolean gotoNeighbor = false;\n\t\t\tif (myReader.readLine().equals(confProof)) {\n\t\t\t\tgotoNeighbor = true;\n\t\t\t\tString Fileline = myReader.readLine();\n\t\t\t\tlocationNames = \"\";\n\n\t\t\t\twhile (Fileline != null) {\n\t\t\t\t\tif (Fileline.substring(0, 1).equals(\"#\")) {\n\t\t\t\t\t\tString[] refreshDataSplit = Fileline.split(\":\");\n\t\t\t\t\t\trefreshTime = Integer.parseInt(refreshDataSplit[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlocationNames += Fileline;\n\t\t\t\t\t}\n\t\t\t\t\tFileline = myReader.readLine();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tshowToast(\"Wrong Configuration File!\");\n\t\t\t}\n\n\t\t\tmyReader.close();\n\t\t\tif (gotoNeighbor) {\n\t\t\t\tIntent intent = new Intent(getApplicationContext(), MainActivity.class);\n\t\t\t\tif (refreshTime != 0) {\n\t\t\t\t\tintent.putExtra(MessageTypes.REFRESH_TIME.toString(), refreshTime);\n\t\t\t\t}\n\t\t\t\tintent.putExtra(MessageTypes.CONFIGFILE.toString(), getExtensionOrFileName(path, false));\n\t\t\t\tintent.putExtra(MessageTypes.LOCATION_NAMES.toString(), locationNames);\n\t\t\t\tsetResult(RESULT_OK, intent);\n\t\t\t\tfinish();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static String getConfigFileName() {\r\n\t\treturn configFileName;\r\n\t}",
"private static File getItestPropertiesForCurrentTestSetup() {\n return new File(\"src/itest/resources/itest-dockercompose.properties\");\n }",
"private static String getConfigFileName(String command) {\n if (command == null || command.trim().length() == 0) {\n command = \"start\";\n }\n // strip off the leading dash\n if (command.startsWith(\"-\")) {\n command = command.substring(1);\n }\n // shutdown & status hack\n if (command.equalsIgnoreCase(\"shutdown\")) {\n command = \"start\";\n } else if (command.equalsIgnoreCase(\"status\")) {\n command = \"start\";\n }\n\n String configFileName = System.getProperty(\"easyfk.home\",\".\");\n configFileName +=\"/core/base/config/\"+ command + \".properties\";\n return configFileName;\n }",
"public static void read(String configFile){\n\t\ttry {\n\t\t\tif(configFile.startsWith(\"$setu\")){\n\t\t\t\t\n\t\t\t\tString path=AppProperties.getProperty(\"setu\");\n\t\t\t\tif((path.substring(path.length()-1)).equals(\"/\")){\n\t\t\t\t\tpath=path.substring(0,path.length()-1);\n\t\t\t\t}\n\t\t\t\tconfigFile=path.concat(configFile.substring(5));\n\t\t\t}\n\n\t\t\tBufferedReader bcfr = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), \"UTF8\"));\n\t\t\tString varPrefix = \"\";\n\t\t\tString varName;\n\t\t\tString value;\n\t\t\tint indexOfEqual;\n\t\t\tString line = null;\n\t\t\tconfig = new HashMap<String,String>();\n\t\t\twhile((line = bcfr.readLine()) != null){\n\t\t\t\tif(line.equals(\"\"))\n\t\t\t\t\tcontinue;\n\t\t\t\tif(line.startsWith(\"[\") && line.trim().endsWith(\"]\")){\n\t\t\t\t\tvarPrefix = line.substring(1, line.indexOf(\"]\"))+\".\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tindexOfEqual = line.indexOf(\"=\");\n\t\t\t\t\tvarName = line.substring(0, indexOfEqual).trim();\n\t\t\t\t\tvalue = line.substring(indexOfEqual + 1).trim();\n\t\t\t\t\tconfig.put(varPrefix + varName, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Test\n public void getFileName() throws Exception {\n ReadConfig conf = new ReadConfig();\n try {\n conf.getFileName();\n } catch (Exception e) {\n assertTrue(e.getMessage().equals(\"Try to access config file before reading it.\") );\n }\n try {\n conf.readFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n assertNotNull(conf.getFileName());\n assertTrue(conf.getFileName().size() == 1);\n }",
"public static void loadConfig() throws IOException {\n\t\t// initialize hash map\n\t\tserverOptions = new HashMap<>();\n\t\t// Get config from file system\n\t\tClass<ConfigurationHandler> configurationHandler = ConfigurationHandler.class;\n\t\tInputStream inputStream = configurationHandler.getResourceAsStream(\"/Config/app.properties\");\n\t\tInputStreamReader isReader = new InputStreamReader(inputStream);\n\t //Creating a BufferedReader object\n\t BufferedReader reader = new BufferedReader(isReader);\n\t String str;\n\t while((str = reader.readLine())!= null){\n\t \t if (str.contains(\"=\")) {\n\t \t\t String[] config = str.split(\" = \", 2);\n\t \t serverOptions.put(config[0], config[1]);\n\t \t }\n\t }\n\t}",
"public String getPropertyPath();",
"public String getPropertyPath();",
"Config(InfoHandler info){\n \n this.info = info;\n \n config_list = new ArrayList<>();\n \n File test = new File(config_path);\n \n if(test.exists()){ //plik istnieje\n \n info.mode=1; //wlaczenie trybu dla obslugi pliku konfiguracyjnego\n \n \n //tutaj pobieranie informacji z pliku konfiguracyjnego\n //do ciała funkcji\n \n config_file = new DictReader(config_path,info);\n \n //tutaj dodajemy funkcjonalnosci\n \n config_list.add(config_file.szukaj(\"%imie\"));\n config_list.add(config_file.szukaj(\"%dict_path\"));\n \n config = get_config();\n \n info.mode=0;\n \n is_alive = true;\n }\n else{\n config = new ArrayList<>();\n config_file = new DictReader(config_path,info);\n first_start = 1;\n }\n }",
"public abstract String getPropertyFile();",
"public interface IPathConstants \n{\n\tString PropertyFilePath = \"./src/test/resources/commondata.properties\";\n\tString JsonFilePath\t = \"./commonData.json\";\n\tString ExcelPath = \"./src/test/resources/testdata.xlsx\";\n\t\n }",
"public Config getConfig();",
"public static ProjectConfig getProjectConfig(String configFile) throws Exception {\n\t\tProjectConfig config = new ProjectConfig();\n\n\t\tDocument document;\n\t\tFile file = new File(configFile);\n\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\tfactory.setNamespaceAware(true);\n\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\tdocument = builder.parse(file);\n\n\t\tElement root = document.getDocumentElement();\n\n\t\tString pjtName = getText(root, Constants.PROJECT_NAME);\n\t\tString packageName = getText(root, Constants.PACKAGE_NAME);\n\t\tString pjtHome = getText(root, Constants.PROJECT_HOME);\n\n\t\tString anyframeHome = \"\";\n\t\tString contextRoot = \"\";\n\t\tString offline = \"\";\n\n\t\tNodeList antList = root.getElementsByTagName(Constants.PROJECT_BUILD_TYPE_ANT);\n\t\tif (antList != null && antList.getLength() > 0) {\n\t\t\tElement antTag = (Element) antList.item(0);\n\t\t\tanyframeHome = getText(antTag, Constants.ANYFRAME_HOME);\n\t\t\tcontextRoot = getText(antTag, Constants.CONTEXT_ROOT);\n\t\t\toffline = getText(antTag, Constants.OFFLINE);\n\t\t}\n\n\t\tNodeList pathList = root.getElementsByTagName(Constants.CONFIG_PATH);\n\t\tElement pathTag = (Element) pathList.item(0);\n\t\tString templatePath = getText(pathTag, Constants.XML_TAG_TEMPLATE);\n\t\tString jdbcdriverPath = getText(pathTag, Constants.XML_TAG_JDBCDRIVERS);\n\t\tString databasesPath = getText(pathTag, Constants.XML_TAG_DATABASES);\n\n\t\tconfig.setPjtHome(pjtHome);\n\t\tconfig.setPjtName(pjtName);\n\t\tconfig.setPackageName(packageName);\n\n\t\tconfig.setAnyframeHome(anyframeHome);\n\t\tconfig.setContextRoot(contextRoot);\n\t\tconfig.setOffline(offline);\n\n\t\tconfig.setTemplateHomePath(templatePath);\n\t\tconfig.setJdbcdriverPath(jdbcdriverPath);\n\t\tconfig.setDatabasesPath(databasesPath);\n\n\t\treturn config;\n\t}",
"private void parseConfig() throws CatascopiaException {\n\t\tthis.config = new Properties();\n\t\t//load config properties file\n\t\ttry {\t\t\t\t\n\t\t\tFileInputStream fis = new FileInputStream(JCATASCOPIA_AGENT_HOME + File.separator + CONFIG_PATH);\n\t\t\tconfig.load(fis);\n\t\t\tif (fis != null)\n\t \t\tfis.close();\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\tthrow new CatascopiaException(\"config file not found\", CatascopiaException.ExceptionType.FILE_ERROR);\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\tthrow new CatascopiaException(\"config file parsing error\", CatascopiaException.ExceptionType.FILE_ERROR);\n\t\t}\n\t}",
"private File findConfigurationFile(String fileName) throws UnsupportedEncodingException {\r\n\r\n String directory = getConfigurationDirectory();\r\n if (directory == null) {\r\n return null;\r\n }\r\n\r\n String path = directory + fileName;\r\n\r\n File configFile = new File(path);\r\n if (configFile.exists() && configFile.isFile()) {\r\n return configFile;\r\n }\r\n\r\n return null;\r\n }",
"@Test\n public final void testConfigurationParser() {\n URL resourceUrl = this.getClass().getResource(configPath);\n File folder = new File(resourceUrl.getFile());\n for (File configFile : folder.listFiles()) {\n try {\n System.setProperty(\"loadbalancer.conf.file\", configFile.getAbsolutePath());\n LoadBalancerConfiguration.getInstance();\n } finally {\n LoadBalancerConfiguration.clear();\n }\n }\n }",
"public String getConfigFile()\n {\n return __m_ConfigFile;\n }"
] | [
"0.69494957",
"0.69274616",
"0.67926383",
"0.6718421",
"0.6567739",
"0.6302309",
"0.61957806",
"0.6184209",
"0.61578196",
"0.6053705",
"0.60353446",
"0.60292256",
"0.6019274",
"0.59717405",
"0.59527206",
"0.5879055",
"0.5823116",
"0.5814253",
"0.5742264",
"0.5734181",
"0.57181627",
"0.57045305",
"0.5691264",
"0.56872267",
"0.5685507",
"0.56853545",
"0.5683543",
"0.5679689",
"0.56647104",
"0.5653371",
"0.56231904",
"0.56162226",
"0.55979663",
"0.5577823",
"0.5563241",
"0.55586165",
"0.5555596",
"0.5555115",
"0.5553855",
"0.5538817",
"0.5535915",
"0.5512927",
"0.5509546",
"0.5509395",
"0.55082256",
"0.5507847",
"0.5501166",
"0.5485612",
"0.54839873",
"0.54800296",
"0.54659504",
"0.54615927",
"0.54555434",
"0.5442091",
"0.54380196",
"0.5437593",
"0.5436961",
"0.5434668",
"0.5431542",
"0.5430869",
"0.5430696",
"0.5430666",
"0.5428144",
"0.5422845",
"0.5416224",
"0.54147923",
"0.54094833",
"0.5405889",
"0.53928584",
"0.5389314",
"0.53744584",
"0.5373651",
"0.5362013",
"0.53556144",
"0.5344629",
"0.5341736",
"0.5339486",
"0.5334094",
"0.5326361",
"0.53223807",
"0.53217983",
"0.5314597",
"0.5313267",
"0.53129244",
"0.53085655",
"0.5302257",
"0.53007704",
"0.52962154",
"0.52953863",
"0.529419",
"0.52918065",
"0.52918065",
"0.528867",
"0.528427",
"0.5278397",
"0.5265636",
"0.5258876",
"0.5255759",
"0.52328855",
"0.5223462",
"0.5211909"
] | 0.0 | -1 |
/ Method called on creation of the dialog. | @Override
public Dialog onCreateDialog (Bundle SaveInstanceState) {
/* Get context from current activity.*/
Context context = getActivity();
/* Create new dialog, and set message. */
AlertDialog.Builder ackAlert = new AlertDialog.Builder(context);
String message = getString(R.string.msg_about_us);
ackAlert.setMessage(message);
/* Create button in dialog. */
ackAlert.setNeutralButton(R.string.btn_got_it, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
/* Set title and show dialog. */
ackAlert.setTitle("About us");
ackAlert.create();
return ackAlert.create();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initDialog() {\n }",
"public abstract void initDialog();",
"void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}",
"public StandardDialog() {\n super();\n init();\n }",
"private Dialogs () {\r\n\t}",
"@Override\n public void onStart() {\n pDialog.show();\n }",
"public ReorganizeDialog() { }",
"public InfoDialog() {\r\n\t\tcreateContents();\r\n\t}",
"private void initDialog() {\n dialog = new Dialog(context);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_custom_ok);\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n View view = getActivity().getLayoutInflater().inflate(R.layout.rollback_detail_dialog, new LinearLayout(getActivity()), false);\n\n initUI(view);\n // clickEvents();\n\n /*\n assert getArguments() != null;\n voucherTypes = (ArrayList<VoucherType>) getArguments().getSerializable(\"warehouses\");\n voucherType=\"\";\n*/\n\n Dialog builder = new Dialog(getActivity());\n builder.requestWindowFeature(Window.FEATURE_NO_TITLE);\n builder.setContentView(view);\n return builder;\n\n\n }",
"protected void createDialogSize ()\n {\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }",
"@Override\r\n\t\t\t\tpublic void onDialogMenuPressed() {\n\r\n\t\t\t\t}",
"public Dialog() {\n\t}",
"@Override\n protected void onPreExecute()\n {\n dialog.show();\n super.onPreExecute();\n }",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tprogress = UserCenterDialog.onCreateDialog(this);\r\n\t\tcontext = this;\r\n\t\tshellRW = new RWSharedPreferences(context, \"addInfo\");\r\n\t\tinitDialog(NoticeActivityGroup.LOTNO);\r\n\t}",
"protected void dialog() {\n TextInputDialog textInput = new TextInputDialog(\"\");\n textInput.setTitle(\"Text Input Dialog\");\n textInput.getDialogPane().setContentText(\"Nyt bord nr: \");\n textInput.showAndWait()\n .ifPresent(response -> {\n if (!response.isEmpty()) {\n newOrderbutton(response.toUpperCase());\n }\n });\n }",
"public PHConstDialog() {\n\t\tinitComponents();\n\t}",
"@Override\n public void onShow(DialogInterface arg0) {\n\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog.show();\n\t\t}",
"public FiltroGirosDialog() {\n \n }",
"public void addRelationshipDialog() { new RelationshipDialog(); }",
"private void newDialog() {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setTitle(getString(R.string.addmark));\n\t\tfinal EditText input = new EditText(this);\n\t\tinput.setHint(getString(R.string.pleasemark));\n\t\tbuilder.setView(input);\n\t\tbuilder.setPositiveButton(getString(R.string.yes),\n\t\t\t\tnew OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tif (input.getText().toString().trim().length() > 0) {\n\t\t\t\t\t\t\taddTag(input.getText().toString());\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\tToast.makeText(ArchermindReaderActivity.this,\n\t\t\t\t\t\t\t\t\tgetString(R.string.successaddmark),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tToast.makeText(ArchermindReaderActivity.this,\n\t\t\t\t\t\t\t\t\tgetString(R.string.pleasemark),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\tnewDialog();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tbuilder.setNegativeButton(getString(R.string.no),\n\t\t\t\tnew OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tbuilder.show();\n\t}",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n filename = getArguments().getString(\"filename\");\n username = getArguments().getString(\"username\");\n workingDIR = getArguments().getString(\"workingDIR\");\n builder.setTitle(R.string.copy_move_file_select_options_title)\n .setItems(R.array.file__move_copy_dialog_options, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n onSelect(which);\n }\n });\n return builder.create();\n }",
"@Override\n\t\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\t\treturn mDialog;\n\t\t}",
"@Override\n protected void onPrepareDialog(int id, Dialog dialog) {\n \tToast.makeText(this, dialog.toString(), Toast.LENGTH_SHORT).show();\n }",
"@Override\n protected void windowInit ()\n {\n }",
"private void setDialog()\n {\n //this.setSize(350,500);\n this.setTitle(Constant.getTextBundle(\"ปฏิกิริยาต่อกัน\"));\n Toolkit thekit = this.getToolkit(); \n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n this.setLocation((screenSize.width-this.getSize().width)/2, (screenSize.height-this.getSize().height)/2);\n }",
"public void setup() {\n self.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n // make dialog background unselectable\n self.setCanceledOnTouchOutside(false);\n }",
"private void startMealToDatabaseAlert() {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);\n TextView dialogTitle = new TextView(this);\n int blackValue = Color.parseColor(\"#000000\");\n dialogTitle.setText(R.string.title_dialog_meal);\n dialogTitle.setGravity(Gravity.CENTER_HORIZONTAL);\n dialogTitle.setPadding(0, 30, 0, 0);\n dialogTitle.setTextSize(25);\n dialogTitle.setTextColor(blackValue);\n dialogBuilder.setCustomTitle(dialogTitle);\n View dialogView = getLayoutInflater().inflate(R.layout.dialog_add_meal, null);\n\n this.startEditTexts(dialogView);\n this.startLocationSpinner(dialogView);\n this.startAddPhotoButton(dialogView);\n this.startMealDialogButtonListeners(dialogBuilder);\n\n dialogBuilder.setView(dialogView);\n AlertDialog permission_dialog = dialogBuilder.create();\n permission_dialog.show();\n }",
"private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}",
"@Override\r\n\tprotected void initUI() {\n\r\n\t}",
"public BaseDialog create()\n {\n LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n // instantiate the dialog with the custom Theme\n final BaseDialog dialog = new BaseDialog(context, R.style.Dialog);\n\n View layout = inflater.inflate(R.layout.view_shared_basedialog, null);\n\n //set the dialog's image\n this.icon = (ImageView) layout.findViewById(R.id.view_shared_basedialog_icon);\n\n if (this.imageResource > 0 || this.imageUrl != null)\n {\n this.icon.setVisibility(View.VISIBLE);\n if (this.imageResource > 0)\n {\n this.icon.setBackgroundResource(this.imageResource);\n }\n else\n {\n// TextureRender.getInstance().setBitmap(this.imageUrl, this.icon, R.drawable.no_data_error_image);\n }\n }\n else\n {\n this.icon.setVisibility(View.GONE);\n }\n\n // set check box's text and default value\n this.checkLayout = layout.findViewById(R.id.view_shared_basedialog_checkbox_layout);\n this.checkBox = (CheckBox) layout.findViewById(R.id.view_shared_basedialog_checkbox);\n this.checkBoxTextView = (TextView) layout.findViewById(R.id.view_shared_basedialog_checkbox_text);\n\n if (!TextUtils.isEmpty(this.checkBoxText))\n {\n this.checkLayout.setVisibility(View.VISIBLE);\n this.checkBoxTextView.setText(this.checkBoxText);\n this.checkBox.setChecked(checkBoxDefaultState);\n }\n else\n {\n this.checkLayout.setVisibility(View.GONE);\n }\n\n // set the dialog main title and sub title\n this.maintitleTextView = (TextView) layout.findViewById(R.id.view_shared_basedialog_maintitle_textview);\n this.subtitleTextView = (TextView) layout.findViewById(R.id.view_shared_basedialog_subtitle_textview);\n this.titleDivideTextView = (TextView) layout.findViewById(R.id.view_shared_basedialog_titledivide_textview);\n if (!TextUtils.isEmpty(title1))\n {\n this.maintitleTextView.setText(title1);\n if (this.title1BoldAndBig)\n {\n this.maintitleTextView.setTypeface(null, Typeface.BOLD);\n this.maintitleTextView.setTextSize(17);\n }\n\n this.maintitleTextView.setVisibility(View.VISIBLE);\n }\n else\n {\n this.maintitleTextView.setVisibility(View.GONE);\n }\n\n if (!TextUtils.isEmpty(title2))\n {\n this.subtitleTextView.setText(title2);\n this.subtitleTextView.setVisibility(View.VISIBLE);\n }\n else\n {\n this.subtitleTextView.setVisibility(View.GONE);\n }\n this.titleDivideTextView.setVisibility(View.GONE);\n\n // set the confirm button\n this.positiveButton = ((Button) layout.findViewById(R.id.view_shared_basedialog_positivebutton));\n if (!TextUtils.isEmpty(positiveButtonText))\n {\n this.positiveButton.setText(positiveButtonText);\n this.positiveButton.setVisibility(View.VISIBLE);\n if (positiveButtonClickListener != null)\n {\n this.positiveButton.setOnClickListener(new View.OnClickListener()\n {\n public void onClick(View v)\n {\n positiveButtonClickListener.onClick(dialog, DialogInterface.BUTTON_POSITIVE);\n if (checkBox.isChecked()&&onCheckBoxListener!=null)\n {\n onCheckBoxListener.checkedOperation();\n }\n }\n });\n }\n }\n else\n {\n // if no confirm button just set the visibility to GONE\n this.positiveButton.setVisibility(View.GONE);\n }\n\n // set the cancel button\n this.negativeButton = ((Button) layout.findViewById(R.id.view_shared_basedialog_negativebutton));\n if (!TextUtils.isEmpty(negativeButtonText))\n {\n this.negativeButton.setText(negativeButtonText);\n this.negativeButton.setVisibility(View.VISIBLE);\n if (negativeButtonClickListener != null)\n {\n this.negativeButton.setOnClickListener(new View.OnClickListener()\n {\n public void onClick(View v)\n {\n negativeButtonClickListener.onClick(dialog, DialogInterface.BUTTON_NEGATIVE);\n }\n });\n }\n }\n else\n {\n // if no confirm button just set the visibility to GONE\n this.negativeButton.setVisibility(View.GONE);\n }\n\n // set button's background\n this.buttonDivideTextView = (TextView) layout.findViewById(R.id.view_shared_basedialog_buttondivide_textview);\n if (!TextUtils.isEmpty(negativeButtonText) && !TextUtils.isEmpty(negativeButtonText))\n {\n this.buttonDivideTextView.setVisibility(View.VISIBLE);\n this.positiveButton.setBackgroundResource(R.drawable.view_shared_corner_round_rightbottom);\n this.negativeButton.setBackgroundResource(R.drawable.view_shared_corner_round_leftbottom);\n }\n else\n {\n this.buttonDivideTextView.setVisibility(View.GONE);\n this.positiveButton.setBackgroundResource(R.drawable.view_shared_corner_round_bottom);\n this.negativeButton.setBackgroundResource(R.drawable.view_shared_corner_round_bottom);\n }\n\n // set the content message\n this.contentLayout = layout.findViewById(R.id.view_shared_basedialog_content_layout);\n if (!TextUtils.isEmpty(message))\n {\n this.contentTextView = ((TextView) layout.findViewById(R.id.view_shared_basedialog_content_textview));\n this.contentTextView.setText(message);\n this.contentTextView.setMovementMethod(ScrollingMovementMethod.getInstance());\n }\n else if (contentView != null)\n {\n // if no message set\n // add the contentView to the dialog body\n ((ViewGroup) this.contentLayout).removeAllViews();\n ((ViewGroup) this.contentLayout).addView(contentView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n }\n else\n {\n this.contentLayout.setVisibility(View.GONE);\n }\n\n int[] params = Utils.getLayoutParamsForHeroImage();\n dialog.setContentView(layout, new ViewGroup.LayoutParams(params[0]*4/5, ViewGroup.LayoutParams.MATCH_PARENT));\n return dialog;\n }",
"public void openDialog(){\n if (!isAdded()) return;\n homeViewModel.getAllSets().removeObservers(getViewLifecycleOwner());\n ChooseSetDialog dialog = new ChooseSetDialog(setsTitles);\n dialog.show(getChildFragmentManager(), \"choose_set_dialog\");\n dialog.setOnSelectedListener(choice -> {\n Word word = new Word(setsObjects.get(choice).getId(), original, translation);\n homeViewModel.insertWord(word);\n original=\"\"; translation=\"\";\n etOrigWord.setText(\"\"); etTransWord.setText(\"\");\n });\n }",
"private void dialog() {\n\t\tGenericDialog gd = new GenericDialog(\"Bildart\");\n\t\t\n\t\tgd.addChoice(\"Bildtyp\", choices, choices[0]);\n\t\t\n\t\t\n\t\tgd.showDialog();\t// generiere Eingabefenster\n\t\t\n\t\tchoice = gd.getNextChoice(); // Auswahl uebernehmen\n\t\t\n\t\tif (gd.wasCanceled())\n\t\t\tSystem.exit(0);\n\t}",
"private AssignFSADialog() {\r\n super(Hub.getMainWindow(), Hub.string(\"TD_assignFSATitle\"));\r\n addWindowListener(new WindowAdapter() {\r\n @Override\r\n public void windowClosing(WindowEvent e) {\r\n onEscapeEvent();\r\n }\r\n });\r\n this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r\n this.setMinimumSize(new Dimension(300, 10));\r\n\r\n Box mainBox = Box.createHorizontalBox();\r\n mainBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n Box newBox = Box.createVerticalBox();\r\n newBox.add(new JLabel(\" \"));\r\n newBox.add(new JButton(new NewFSAAction()));\r\n mainBox.add(newBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n openModelsCombo = new JComboBox();\r\n openModelsCombo.setRenderer(new JLabelListRenderer());\r\n Box modelsBox = Box.createVerticalBox();\r\n Box titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_openModels\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n modelsBox.add(titleBox);\r\n modelsBox.add(openModelsCombo);\r\n mainBox.add(modelsBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n templatesCombo = new JComboBox();\r\n templatesCombo.setRenderer(new JLabelListRenderer());\r\n Box templatesBox = Box.createVerticalBox();\r\n titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_templates\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n templatesBox.add(titleBox);\r\n templatesBox.add(templatesCombo);\r\n mainBox.add(templatesBox);\r\n\r\n getContentPane().add(mainBox);\r\n\r\n }",
"private void createDialog() {\r\n final AlertDialog dialog = new AlertDialog.Builder(getActivity()).setView(R.layout.dialog_recorder_details)\r\n .setTitle(\"Recorder Info\").setPositiveButton(\"Start\", (dialog1, which) -> {\r\n EditText width = (EditText) ((AlertDialog) dialog1).findViewById(R.id.dialog_recorder_resolution_width);\r\n EditText height = (EditText) ((AlertDialog) dialog1).findViewById(R.id.dialog_recorder_resolution_height);\r\n CheckBox audio = (CheckBox) ((AlertDialog) dialog1).findViewById(R.id.dialog_recorder_audio_checkbox);\r\n EditText fileName = (EditText) ((AlertDialog) dialog1).findViewById(R.id.dialog_recorder_filename_name);\r\n mServiceHandle.start(new RecordingInfo(Integer.parseInt(width.getText().toString()), Integer.parseInt(height.getText().toString()),\r\n audio.isChecked(), fileName.getText().toString()));\r\n dialog1.dismiss();\r\n }).setNegativeButton(\"Cancel\", (dialog1, which) -> {\r\n dialog1.dismiss();\r\n }).show();\r\n Point size = new Point();\r\n getActivity().getWindowManager().getDefaultDisplay().getRealSize(size);\r\n ((EditText) dialog.findViewById(R.id.dialog_recorder_resolution_width)).setText(Integer.toString(size.x));\r\n ((EditText) dialog.findViewById(R.id.dialog_recorder_resolution_height)).setText(Integer.toString(size.y));\r\n }",
"private void openCreateAccountDialog()\n {\n testDialog();\n\n }",
"@Override\n public void onCancel(DialogInterface dialog) {\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = requireActivity().getLayoutInflater();\n final View view = inflater.inflate(R.layout.on_click_dialog, null);\n builder.setView(view);\n\n\n\n\n\n\n\n\n return builder.create();\n }",
"@Override\r\n\tpublic void dialogControyCancel() {\n\r\n\t}",
"public JDialogParticleAnalysisNew() { }",
"public DialogManager() {\n }",
"public void popupAdd() {\n builder = new AlertDialog.Builder(getView().getContext());\n View views = getLayoutInflater().inflate(R.layout.departmentpopup, (ViewGroup) null);\n DepartmentName = (EditText) views.findViewById(R.id.department_name);\n DepartmentId = (EditText) views.findViewById(R.id.department_id);\n pbar =views.findViewById(R.id.departmentProgress);\n Button button =views.findViewById(R.id.save_depart);\n saveButton = button;\n button.setOnClickListener(new View.OnClickListener() {\n public void onClick(View view) {\n addDeparatments();\n }\n });\n builder.setView(views);\n AlertDialog create =builder.create();\n dialog = create;\n create.show();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = getActivity().getLayoutInflater();\n View view = inflater.inflate(R.layout.complete_workout_dialog,null);\n builder.setView(view);\n completeScore = view.findViewById(R.id.score_edit_text);\n completeTime = view.findViewById(R.id.time_edit_text);\n\n // Inflate and set the layout for the dialog\n // Pass null as the parent view because its going in the dialog layout\n // Add action buttons\n builder.setMessage(\"\")\n .setPositiveButton(\"Ok \", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n completeWorkoutListener.onCompletedWorkoutSelected(completeScore.getText().toString(), completeTime.getText().toString());\n }\n })\n .setNegativeButton(\" Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // User cancelled the dialog\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\t\t\t}",
"protected abstract JDialog createDialog();",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n setRetainInstance(true);\n\n Dialog dialog = new Dialog(getContext(), R.style.DialogTheme);\n dialog.setContentView(R.layout.add_student_feedback_dialog);\n\n return dialog;\n }",
"@Override\r\n \tprotected Dialog onCreateDialog(int id) {\n \t\tDialog dialog;\r\n \t\tswitch (id) {\r\n \t\t\tcase DIALOG_LOCATION_HISTORY:\r\n \t\t\t\t//logically, this cannot appear before the location layout is updated, so there is no \r\n \t\t\t\t//chance historyLayout can be null, except you are doing something wrong\r\n \t\t\t\tdialog = new Dialog(this);\r\n \t\t\t\tdialog.setTitle(\"Location History\");\r\n \t\t\t\tdialog.setContentView(detachedHistoryLayout);\r\n \t\t\t\treturn dialog;\r\n \t\t\t\t\r\n \t\t\tcase DIALOG_LOCATION:\r\n \t\t\t\tlocationLayout = (LinearLayout) getLayoutInflater().inflate\r\n \t\t\t\t\t\t\t(R.layout.manual_location_dialog, null);\r\n \t\t\t\tdetachedHistoryLayout = (LinearLayout) getLayoutInflater().inflate\r\n \t\t\t\t\t\t(R.layout.manual_location_history_dialog, null);\r\n \t\t\t\t\r\n \t\t\t\tfinal LinearLayout historyLayout = (LinearLayout) detachedHistoryLayout.findViewById(R.id.historyLayout); \r\n \t\t\t\t\r\n \t\t\t\tfinal TextView currentLocation = (TextView) locationLayout.findViewById(R.id.locationText);\r\n \t\t\t\tif (MyApplication.currentLocation != null)\r\n \t\t\t\t{\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\tcurrentLocation.setText(\"Your last updated location is \" + '\\n' + \r\n \t\t\t\t\t\t\t\tMyApplication.currentLocation.getString(\"name\") + \" within approx. \" \r\n \t\t\t\t\t\t\t\t+ MyApplication.currentLocation.getString(\"accuracy\"));\r\n \t\t\t\t\t} catch (JSONException e) {\r\n \t\t\t\t\t\te.printStackTrace();\r\n \t\t\t\t\t\tcurrentLocation.setText(\"Cannot get your current location.\");\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\tfinal RelativeLayout showHistoryLayout = (RelativeLayout) locationLayout.findViewById(R.id.showHistoryLayout);\r\n \t\t\t\tshowHistoryLayout.setOnClickListener(new OnClickListener() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onClick(View v) {\r\n \t\t\t\t\t\tshowDialog(Page.DIALOG_LOCATION_HISTORY);\r\n \t\t\t\t\t}\r\n \t\t\t\t});\r\n \t\t\t\t\r\n \t\t\t\tnew LocationListTask(null,Page.this, false, true).execute(historyLayout,currentLocation);\r\n \t\t\t\t\r\n \t\t\t\tRelativeLayout autoLocLayout = (RelativeLayout) locationLayout.findViewById(R.id.autoLocLayout);\r\n \t\t\t\tautoLocLayout.setOnClickListener(new OnClickListener() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onClick(View v) {\r\n \t\t\t\t\t\ttry {\r\n \t\t\t\t\t\t\tLocationTracker.autoLoc = true;\r\n \t\t\t\t\t\t\tnew LocationListTask(null,Page.this, false, true).execute(historyLayout,currentLocation);\r\n \t\t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\t\te.printStackTrace();\r\n \t\t\t\t\t\t\tToast.makeText(Page.this, \"Your new location cannot be updated. Please try again later\", \r\n \t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n \t\t\t\t\t\t} \r\n \t\t\t\t\t}\r\n \t\t\t\t});\r\n \t\t\t\t\r\n \t\t\t\tfinal EditText manualLocationField = (EditText) locationLayout.findViewById(R.id.manualLocationField);\r\n \t\t\t\tmanualLocationField.setOnKeyListener(new OnKeyListener() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic boolean onKey(View v, int keyCode, KeyEvent event) {\r\n \t\t\t\t\t\tif (event.getAction() == KeyEvent.ACTION_DOWN)\r\n \t\t\t\t\t\t{\r\n \t\t\t\t\t\t\tswitch (keyCode) {\r\n \t\t\t\t\t\t\tcase KeyEvent.KEYCODE_ENTER:\r\n \t\t\t\t\t\t\tcase KeyEvent.KEYCODE_DPAD_CENTER:\r\n \t\t\t\t\t\t\t\tLocationTracker.autoLoc = false;\r\n \t\t\t\t\t\t\t\tnew LocationListTask(manualLocationField.getText().toString(), Page.this, \r\n \t\t\t\t\t\t\t\t\t\t\tfalse, true).execute(historyLayout,currentLocation);\r\n \t\t\t\t\t\t\t\treturn true;\r\n \t\t\t\t\t\t\tdefault:\r\n \t\t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\treturn false;\r\n \t\t\t\t\t}\r\n \t\t\t\t});\r\n \t\t\t\t\r\n \t\t\t\tButton setLocation = (Button) locationLayout.findViewById(R.id.setLocationButton);\r\n \t\t\t\tsetLocation.setOnClickListener(new OnClickListener() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onClick(View v) {\r\n \t\t\t\t\t\tLocationTracker.autoLoc = false;\r\n \t\t\t\t\t\ttry {\r\n \t\t\t\t\t\t\tnew LocationListTask(manualLocationField.getText().toString(), Page.this, \r\n \t\t\t\t\t\t\t\t\tfalse, true).execute(historyLayout,currentLocation);\r\n \t\t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\t\tToast.makeText(Page.this, \"Your new location cannot be updated. Please try \" +\r\n \t\t\t\t\t\t\t\t\t\"again later\", Toast.LENGTH_SHORT).show();\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t});\r\n \t\t\t\t\r\n \t\t\t\tdialog = new LocationDialog(this);\r\n \t\t\t\tdialog.setTitle(\"Update your location\");\r\n \t\t\t\tdialog.setContentView(locationLayout);\r\n \t\t\t\treturn dialog;\r\n \t\t\tdefault:\r\n \t\t\t\tbreak;\r\n \t\t}\r\n \t\treturn super.onCreateDialog(id);\r\n \t}",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n //return super.onCreateDialog(savedInstanceState); // TODO: should we call it?\n final String title = getArguments().getString(\"TITLE\");\n final String msg = getArguments().getString(\"MESSAGE\");\n final String pos = getArguments().getString(\"POS\");\n final String neg = getArguments().getString(\"NEG\");\n final String neu = getArguments().getString(\"NEU\");\n // TODO - this is just an int... what about other ... Parcelable\n final int idx = getArguments().getInt(\"IDX\");\n final int iconid = getArguments().getInt(\"ICON_ID\");\n final float textsize = getArguments().getFloat(\"MSGSIZE\");\n\n if (savedInstanceState != null) {\n tag = savedInstanceState.getString(\"TAG\");\n }\n\n final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialogInterface, int clickedButton) {\n ConfirmListener act = (ConfirmListener) getActivity();\n act.processConfirmation(clickedButton, tag, idx);\n }\n };\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(title)\n .setMessage(msg);\n if (iconid != 0 && getResources().getResourceTypeName(iconid).equals(\"drawable\")) {\n // this must be a R.drawable.id, otherwise crash!\n // android.content.res.Resources$NotFoundException:\n builder.setIcon(iconid);\n }\n if (pos != null) {\n builder.setPositiveButton(pos, listener);\n }\n if (neg != null) {\n builder.setNegativeButton(neg, listener);\n }\n if (neu != null) {\n builder.setNeutralButton(neu, listener);\n }\n\n dialog = builder.create();\n if (textsize != 0) {\n dialog.show(); // need to call this to be able to get the TextView as non-null pointer\n TextView tv = (TextView) dialog.findViewById(android.R.id.message);\n if (tv != null) {\n tv.setTextSize(textsize);\n }\n }\n return dialog;\n }",
"@Override\r\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n \r\n LayoutInflater inflater = getActivity().getLayoutInflater();\r\n builder.setTitle(\"New Wallet\");\r\n \r\n\t final View view = inflater.inflate(R.layout.new_wallet_dialog, null);\r\n\t \r\n\t final EditText name = (EditText) view.findViewById(R.id.newWallet_text);\r\n\t \r\n builder.setPositiveButton(R.string.confirmRecord, new DialogInterface.OnClickListener() {\r\n \r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.comfirmPressed(name.getText().toString());\t\r\n \t\t}\r\n });\r\n builder.setNegativeButton(R.string.cancelRecord, new DialogInterface.OnClickListener() {\r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.cancelPressed();\r\n \t\t}\r\n \t});\r\n // Create the AlertDialog object and return it\r\n return builder.create();\r\n }",
"public CustomDialog(String title) {\n\t\tsuper();\n\t\tsetTitle(title);\n\t\tinit();\n\t}",
"private void init() {\n super.setPersistent(false);\n super.setDialogLayoutResource(R.layout.login_edit);\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(R.string.dialog_fire_missiles)\n .setPositiveButton(R.string.fire, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n return builder.create();\n }",
"private void newLabButton(){\n NewLabNameTextfield.setText(\"\");\n NewLabDialog.setVisible(true);\n NewLabNameTextfield.requestFocusInWindow();\n }",
"@Override\n\tprotected Dialog onCreateDialog(int id) {\n\t\treturn buildDialog(MainActivity.this);\n\t\t\n\t}",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n setRetainInstance(true);\n\n Dialog dialog = new Dialog(getContext(), R.style.DialogTheme);\n dialog.setContentView(R.layout.add_sale_item_dialog);\n\n return dialog;\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }",
"@Override\n\tprotected void initUi() {\n\t\t\n\t}",
"public NewDialog() {\n\t\t\t// super((java.awt.Frame)null, \"New Document\");\n\t\t\tsuper(\"JFLAP 7.0\");\n\t\t\tgetContentPane().setLayout(new GridLayout(0, 1));\n\t\t\tinitMenu();\n\t\t\tinitComponents();\n\t\t\tsetResizable(false);\n\t\t\tpack();\n\t\t\tthis.setLocation(50, 50);\n\n\t\t\taddWindowListener(new WindowAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void windowClosing(final WindowEvent event) {\n\t\t\t\t\tif (Universe.numberOfFrames() > 0) {\n\t\t\t\t\t\tNewDialog.this.setVisible(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tQuitAction.beginQuit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"@Override\n\tprotected Dialog onCreateDialog(int id)\n\t{\n\t\tsuper.onCreateDialog(id);\n\t\treturn visitor.instantiateDialog(id);\n\t}",
"@Override\n\tprotected void initializePopupFields(Owner data) {\n\t}",
"@Override\n public void onClick(View view) {\n if (mAddDialog == null) {\n mAddDialog = new XPopup.Builder(MainActivity.this)\n .asInputConfirm(getString(R.string.add_random_title)\n , getString(R.string.add_random_content)\n , new OnInputConfirmListener() {\n @Override\n public void onConfirm(String text) {\n if (mAdapter != null) {\n mAdapter.addData(new BaseModel(text, 1));\n }\n }\n }).show();\n } else {\n mAddDialog.show();\n }\n }",
"@Override\n protected Dialog onCreateDialog(int id) {\n \tswitch (id) {\n\t\tcase DLG_PROGRESSBAR:\n\t\t\treturn dialogoProgressBar();\n\t\tcase DLG_BUTTONS:\n\t\t\treturn dialogButtons();\n\t\tcase DLG_LIST:\n\t\t\treturn dialogLista();\n\t\tcase DLG_LIST_SELECT:\n\t\t\treturn dialogListaSelect();\n\t\tdefault:\n\t\t\treturn dialogButtons();\n\t\t}\n }",
"@Override\n public void Create() {\n\n initView();\n }",
"@Override\r\n\t protected void onPrepareDialog(int id, Dialog dialog) {\n\t switch(id){\r\n\t case(ID_SCREENDIALOG):\r\n\t \tdialog.setTitle(\"Job Details\");\r\n\t \tButton myButton = new Button(this);\r\n\t \tmyButton.setText(\"Cancel\");\r\n\t \tmyButton.setBackgroundColor(Color.parseColor(\"#ff4c67\"));\r\n\t \tmyButton.setTextColor(Color.parseColor(\"#ffffff\"));\r\n\t \tRelativeLayout datlis = (RelativeLayout)screenDialog.findViewById(R.id.datalist01);\r\n\t \tLayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\r\n\t \tlp.addRule(RelativeLayout.BELOW, list.getId());\r\n\t \tdatlis.addView(myButton, lp);\r\n\t \tmyButton.setOnClickListener(dismissscreen);\r\n\t \t\r\n\t break;\r\n\t }\r\n\t }",
"@Override\r\n public Dialog onCreateDialog(Bundle savedInstanceState) {\r\n //use the builder class for convenient dialog construction\r\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n //get the layout inflater\r\n LayoutInflater inflater = getActivity().getLayoutInflater();\r\n View rootView = inflater.inflate(R.layout.dialog_room, null);\r\n mRoomNumber = rootView.findViewById(R.id.roomNumberEditText);\r\n mAllergy = rootView.findViewById(R.id.allergyEditText);\r\n mPlateType = rootView.findViewById(R.id.plateTypeEditText);\r\n mChemicalDiet = rootView.findViewById(R.id.chemicalDietEditText);\r\n mTextureDiet = rootView.findViewById(R.id.textureDietEditText);\r\n mLiquidDiet = rootView.findViewById(R.id.liquidDietEditText);\r\n mLikes = rootView.findViewById(R.id.likesEditText);\r\n mDislikes = rootView.findViewById(R.id.dislikesEditText);\r\n mNotes = rootView.findViewById(R.id.notesEditText);\r\n mMeal = rootView.findViewById(R.id.mealEditText);\r\n mDessert = rootView.findViewById(R.id.dessertEditText);\r\n mBeverage = rootView.findViewById(R.id.beverageEditText);\r\n\r\n mBeverage.setOnEditorActionListener(new TextView.OnEditorActionListener() {\r\n @Override\r\n public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {\r\n if (i == EditorInfo.IME_ACTION_DONE || keyEvent.getAction() == KeyEvent.ACTION_DOWN){\r\n addRoom();\r\n }\r\n return true;\r\n }\r\n });\r\n\r\n //inflate and set the layout for the dialog\r\n //pass null as the parent view cause its going in the dialog layout.\r\n builder.setView(rootView).setPositiveButton(R.string.button_done, new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n addRoom();\r\n }\r\n });\r\n\r\n return builder.create();\r\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n builder.setTitle(\"Add Participant...\");\n builder.setMessage(\"Participant address:\");\n\n final EditText input = new EditText(getActivity());\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n input.setLayoutParams(lp);\n builder.setView(input); // uncomment this line\n\n\n builder.setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n mListener.onAddUserDialogAdd(input.getText().toString());\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n mListener.onAddUserDialogCancel();\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public void dialog_entranceSheet() {\n final Dialog dialog = new Dialog(ReportActivity.this);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_entrance_sheet);\n dialog.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.transparent));\n\n TextView tv_enterDialog = dialog.findViewById(R.id.tv_enterDialog);\n tv_enterDialog.setText(entrance_item);\n DataBaseHandler dataBaseHandler = new DataBaseHandler(ReportActivity.this);\n ArrayList<EntranceSheet> preEntranceSheetList = new ArrayList<>();\n preEntranceSheetList = dataBaseHandler.getAllEntranceSheet();\n\n TextView tv_Title = dialog.findViewById(R.id.tv_Title);\n if (preEntranceSheetList.size() == 0) {\n tv_Title.setText(no_entrace_data);\n } else {\n tv_Title.setText(has_entrance_data);\n }\n\n ListView lv_preEntranceSheet = dialog.findViewById(R.id.lv_preEntranceSheet);\n PreEntranceSheetAdapter preEntranceSheetAdapter = new PreEntranceSheetAdapter(ReportActivity.this, preEntranceSheetList, dialog);\n lv_preEntranceSheet.setAdapter(preEntranceSheetAdapter);\n\n Button bt_AddEntranceSheet = dialog.findViewById(R.id.bt_AddEntranceSheet);\n bt_AddEntranceSheet.setText(add_new_entrance_process);\n bt_AddEntranceSheet.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n dialog_AddEntranceSheet();\n dialog.dismiss();\n dialog.cancel();\n }\n });\n\n dialog.setCancelable(true);\n dialog.show();\n }",
"public void onNew() {\t\t\n\t\tdesignWidget.addNewForm();\n\t}",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),\n R.style.RedButtonAlertDialog);\n\n builder.setTitle(\"Add new profile\").setView(R.layout.dialog_add_player)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n EditText profileNameEditText =\n (EditText) getDialog().findViewById(R.id.add_player_edit_text);\n String name = profileNameEditText.getText().toString();\n DartLogDatabaseHelper dbHelper = new DartLogDatabaseHelper(getContext());\n dbHelper.addPlayer(name);\n getProfilesAdapter().updateDataSetFromDatabase();\n }\n })\n .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"private void initializeUI() {\r\n this.parentFrame = game.getFrame();\r\n parentFrame.setEnabled(false); // Disable main game UI during the ending dialog.\r\n createResultPopup();\r\n }",
"private void init() {\n \n dialog = new JDialog(this.owner, charField.getName() + \" Post Composition\");\n compFieldPanel = new FieldPanel(false,false, null, this.selectionManager, this.editManager, null); // (searchParams)?\n //compFieldPanel.setSearchParams(searchParams);\n \n // MAIN GENUS TERM\n genusField = CharFieldGui.makePostCompTermList(charField,\"Genus\",minCompChars);\n genusField.setSelectionManager(this.selectionManager); // ??\n //genusField.setListSelectionModel(this.selectionModel);\n compFieldPanel.addCharFieldGuiToPanel(genusField);\n\n // REL-DIFF - put in 1 differentia\n addRelDiffGui();\n\n setGuiFromSelectedModel();\n\n // override FieldPanel preferred size which will set window size\n compFieldPanel.setPreferredSize(null);//new Dimension(700,160));\n dialog.add(compFieldPanel);\n addButtons();\n dialog.pack();\n dialog.setLocationRelativeTo(owner);\n dialog.setVisible(true);\n\n compCharChangeListener = new CompCharChangeListener();\n this.editManager.addCharChangeListener(compCharChangeListener);\n compCharSelectListener = new CompCharSelectListener();\n this.selectionModel.addListSelectionListener(compCharSelectListener);\n }",
"@Override\n\tpublic void init() {\n//\t\tSystem.out.println(\"init UIAgent\");\n\n//\t\tSystem.out.println(\"closing old dialog of \");\n\t\tif (ui != null) {\n\t\t\tui.dispose();\n\t\t\tui = null;\n\t\t}\n//\t\tSystem.out.println(\"old dialog closed. Trying to open new dialog. \");\n\t\ttry {\n\t\t\tui = new EnterBidDialog(this, null, true,\n\t\t\t\t\t(AdditiveUtilitySpace) utilitySpace, null);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Problem in UIAgent2.init:\" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n//\t\tSystem.out.println(\"finished init of UIAgent2\");\n\t}",
"private void initDialog() {\n Window subWindow = new Window(\"Sub-window\");\n \n FormLayout nameLayout = new FormLayout();\n TextField code = new TextField(\"Code\");\n code.setPlaceholder(\"Code\");\n \n TextField description = new TextField(\"Description\");\n description.setPlaceholder(\"Description\");\n \n Button confirm = new Button(\"Save\");\n confirm.addClickListener(listener -> insertRole(code.getValue(), description.getValue()));\n\n nameLayout.addComponent(code);\n nameLayout.addComponent(description);\n nameLayout.addComponent(confirm);\n \n subWindow.setContent(nameLayout);\n \n // Center it in the browser window\n subWindow.center();\n\n // Open it in the UI\n UI.getCurrent().addWindow(subWindow);\n\t}",
"private void usernameTakenDialog() {\n Dialog dialog = new Dialog(\"Username taken\", cloudSkin, \"dialog\") {\n public void result(Object obj) {\n System.out.println(\"result \" + obj);\n }\n };\n dialog.text(\"This username has already been taken, try a new one.\");\n dialog.button(\"OK\", true);\n dialog.show(stage);\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater layoutInflater = getActivity().getLayoutInflater();\n final View view = layoutInflater.inflate(R.layout.save_set_dialog, null);\n builder.setView(view);\n builder.setTitle(\"Save Set\");\n builder.setPositiveButton(\"Save\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // overwritten below\n }\n });\n\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n SaveSetDialog.this.getDialog().cancel();\n }\n });\n\n final AlertDialog saveSetDialog = builder.show();\n\n int buttonTextColor = ContextCompat.getColor(getActivity(), R.color.colorAccent);\n\n Button positiveButton = saveSetDialog.getButton(AlertDialog.BUTTON_POSITIVE);\n positiveButton.setTextColor(buttonTextColor);\n\n Button negativeButton = saveSetDialog.getButton(AlertDialog.BUTTON_NEGATIVE);\n negativeButton.setTextColor(buttonTextColor);\n saveSetDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n\n DisplayMetrics displayMetrics = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n int width = displayMetrics.widthPixels;\n int widthDialog = (int) Math.floor(width*0.85);\n\n saveSetDialog.getWindow().setLayout(widthDialog, WindowManager.LayoutParams.WRAP_CONTENT);\n\n saveSetDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n boolean closeDialog = false;\n\n EditText setName = (EditText) view.findViewById(R.id.setNameEditText);\n\n final int defaultColor = setName.getCurrentHintTextColor();\n setName.setHintTextColor(defaultColor);\n\n String setNameString = setName.getText().toString().trim();\n\n int redColor = Color.rgb(229, 57, 53);\n\n if (setNameString.length() == 0) {\n setName.setHintTextColor(redColor);\n Toast toast = Toast.makeText(getActivity(), \"Insert set name.\", Toast.LENGTH_SHORT);\n toast.show();\n\n }\n else if (duplicateSetName(setNameString)) {\n Toast toast = Toast.makeText(getActivity(), \"Set name in use.\", Toast.LENGTH_SHORT);\n toast.show();\n }\n else {\n Set setCopy = (Set) deepClone(SetManager.getInstance().getCurrentSet());\n if (setCopy != null){\n setCopy.setName(setNameString);\n SetManager.getInstance().getSets().add(setCopy);\n }\n\n else {\n Toast toast = Toast.makeText(getActivity(), \"Error saving set.\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n\n closeDialog = true;\n }\n\n if(closeDialog) {\n saveSetDialog.dismiss();\n }\n }\n });\n\n return saveSetDialog;\n }",
"@Override\r\n\t protected void onPrepareDialog(int id, Dialog dialog) {\n\t switch(id){\r\n\t case(ID_SCREENDIALOG):\r\n\t \tdialog.setTitle(\"Send Instant Message\");\r\n\t break;\r\n\t }\r\n\t }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflator = getActivity().getLayoutInflater();\n View view = inflator.inflate(R.layout.informationdialog, datePicker);\n builder.setView(view);\n init(view);\n Dialog dialog = builder.create();\n\n //Dialog will not close automatically until user click on cancle button.\n setCancelable(false);\n return dialog;\n }",
"@Override\r\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\r\n\t\t\t\t\t}",
"@Override\n public Dialog onCreateDialog(Bundle state) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n // Set the title\n builder.setTitle(R.string.new_location_title);\n\n // Get the layout inflater\n LayoutInflater inflater = getActivity().getLayoutInflater();\n\n // Pass null as the parent view because its going in the dialog layout\n view = inflater.inflate(R.layout.fire_report, null);\n builder.setView(view);\n\n populate();\n\n // Add a cancel button\n builder.setNegativeButton(R.string.close, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int id) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n Boolean checked = ((CheckBox) view.findViewById(R.id.checkExtinguished)).isChecked();\n if (fire.isExtinguished() != checked) {\n fire.setExtinguished(checked);\n if (!new Cloud(view.getContext()).updateExtinguishedToCloud(fire)) {\n fire.setExtinguished(!checked);\n view.post(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(view.getContext(), R.string.extinguished_failed, Toast.LENGTH_SHORT).show();\n }\n });\n }\n }\n }\n }).start();\n }\n });\n\n dlg = builder.create();\n\n return dlg;\n }",
"protected ERMinerNodeDialog() {\nsuper();\n \n addDialogComponent(new DialogComponentColumnNameSelection(ERMinerNodeModel.createSeqColumnModel(),\n\t\t\t\t\t\t\"Column containing the sequences: \", 0, true, StringValue.class));\n addDialogComponent(new DialogComponentNumber(ERMinerNodeModel.createMinSupModel(), \"Choose minSup\", 0.05));\n addDialogComponent(new DialogComponentNumber(ERMinerNodeModel.createMinConfModel(), \"Choose minConf\", 0.05));\n }",
"public void showDialog() {\n mDialogInfoWithTwoButtons = new DialogInfoWithTwoButtons(mContext,\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n saveTemplate(mToastEdited);\n mDialogInfoWithTwoButtons.getDialog().dismiss();\n }\n }, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n mTemplateId = mDatabaseManager.getTemplateNewId();\n mPreferenceManager.setTemplateId(mTemplateId);\n saveTemplate(mToastCreated);\n mDialogInfoWithTwoButtons.getDialog().dismiss();\n }\n }, mTitle, mMessage, mTitleButtonOne, mTitleButtonTwo);\n mDialogInfoWithTwoButtons.getDialog().show();\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n\n }",
"@Override\n public void onClick(DialogInterface dialog, int id)\n {\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n }",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n }",
"public CustomDialog(Dialog owner, String title) {\n\t\tsuper(owner, title);\n\t\tinit();\n\t}",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n // Use the Builder class for convenient dialog construction\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.title_add_to_shopping);\n\n // initialize itemcreation\n m_createItemDlg = new CreateItemDialog(this);\n\n // create item selection\n builder.setView(createItemSelection());\n\n // set buttonss\n builder.setPositiveButton(R.string.button_add, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if(m_callback != null) {\n m_callback.readAddToShoppingDlgAndUpdate();\n }\n }\n });\n builder.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) { }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public Dialog onCreateDialog(Bundle savedInstanceState){\n AlertDialog.Builder sample_builder = new AlertDialog.Builder(getActivity());\n sample_builder.setView(\"activity_main\");\n sample_builder.setMessage(\"This is a sample prompt. No new networks should be scanned while this prompt is up\");\n sample_builder.setCancelable(true);\n sample_builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogPositiveClick(StationFragment.this);\n }\n });\n sample_builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogNegativeClick(StationFragment.this);\n }\n });\n return sample_builder.create();\n\n }",
"public abstract Dialog createDialog(DialogDescriptor descriptor);",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n predata();\n }",
"private void dialogChanged()\n {\n // Checking if a Schema Project is open\n if ( Activator.getDefault().getSchemaHandler() == null )\n {\n displayErrorMessage( Messages.getString( \"ImportCoreSchemasWizardPage.ErrorNoSchemaProjectOpen\" ) ); //$NON-NLS-1$\n return;\n }\n\n displayErrorMessage( null );\n }",
"protected Dialog onCreateDialog (int id) {\n\t\tif (!this.hasWindowFocus())\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdismissDialog (DIALOG_CREATE);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdismissDialog (DIALOG_SUBMIT);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tAlertDialog.Builder bld = new AlertDialog.Builder(this);\r\n\t\tswitch (id){\r\n\t\tcase DIALOG_CREATE: \r\n\t\t{bld.setMessage(\"More than one call needs to be reported. Your most recent call is first.\").setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener()\r\n\t\t{\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\tdialog.dismiss();\r\n\t\t}\r\n\t\t}).setTitle(\"New Record\");\r\n\t\tbreak;\r\n\t\t}\r\n\t\tcase DIALOG_SUBMIT:\r\n\t\t{\r\n\t\t\tbld.setMessage(\"Please submit your previous call record now.\").setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener()\r\n\t\t\t{\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tdialog.dismiss();\r\n\t\t\t}\r\n\t\t\t}).setTitle(\"Older Record\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t}\r\n\t\treturn bld.create();\r\n\t}",
"@Override \r\n \tprotected IDialogSettings getDialogSettings() {\n \t\tIDialogSettings temp = super.getDialogSettings();\t\r\n \t\treturn temp;\r\n \t}",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n\n }"
] | [
"0.78672165",
"0.7413859",
"0.72828877",
"0.7117956",
"0.7024244",
"0.6994827",
"0.6993393",
"0.6923101",
"0.68032825",
"0.6800394",
"0.67804885",
"0.6744022",
"0.6697612",
"0.66875374",
"0.66356283",
"0.6632703",
"0.66319484",
"0.65907204",
"0.65717906",
"0.6566662",
"0.6550302",
"0.64938045",
"0.64294285",
"0.6415451",
"0.6405038",
"0.6393005",
"0.6389158",
"0.6375935",
"0.63749933",
"0.6366191",
"0.6355986",
"0.63463",
"0.63417226",
"0.6332904",
"0.633271",
"0.63034445",
"0.62992716",
"0.6297003",
"0.62895536",
"0.62773377",
"0.62768537",
"0.6274826",
"0.62616426",
"0.6256396",
"0.6249768",
"0.6234272",
"0.6223334",
"0.62216675",
"0.6221469",
"0.6217021",
"0.621249",
"0.6210465",
"0.6206123",
"0.6205799",
"0.6193527",
"0.6192186",
"0.6185094",
"0.61836916",
"0.6181972",
"0.61746794",
"0.6172173",
"0.61702275",
"0.6161433",
"0.61599773",
"0.6158716",
"0.61550975",
"0.6151427",
"0.6135171",
"0.61316866",
"0.6125431",
"0.6125031",
"0.61191225",
"0.61168766",
"0.61091465",
"0.61070883",
"0.6105787",
"0.61034745",
"0.60929906",
"0.6087536",
"0.6086741",
"0.6085651",
"0.6079773",
"0.60764676",
"0.6072954",
"0.6070814",
"0.6070814",
"0.6066771",
"0.60615563",
"0.60615563",
"0.60615563",
"0.60615563",
"0.6060806",
"0.60602856",
"0.6060267",
"0.60595053",
"0.6059254",
"0.60480714",
"0.6041327",
"0.603341",
"0.60312706",
"0.60312706"
] | 0.0 | -1 |
Currently support DFS parser only Prefix + Suffix If the prefixID ==1, then the suffix is just the graph | public GraphResultNormalPrefix(int ID, int prefixID, int[][] suffix, IndexSearcherPrefix index){
super(ID, null);
this.prefixID = prefixID;
this.suffix = suffix;
if(prefixID!=-1){
int[][] prefix = index.getTotalLabel(prefixID);
if(suffix!=null){
int[][] gString = new int[prefix.length + suffix.length][];
for(int i = 0; i< prefix.length; i++)
gString[i] = prefix[i];
for(int j = 0; j< suffix.length; j++)
gString[prefix.length + j] = suffix[j];
this.g = MyFactory.getDFSCoder().parse(gString, MyFactory.getGraphFactory());
}
else this.g =MyFactory.getDFSCoder().parse(prefix, MyFactory.getGraphFactory());
}
else{
if(suffix!=null)
this.g = MyFactory.getDFSCoder().parse(suffix, MyFactory.getGraphFactory());
else {
System.out.println("Exception: both prefix & suffix are null");
this.g = null;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testSubgraphsDontPolluteDefaultPrefix() \n {\n String imported = \"http://imported#\", local = \"http://local#\";\n g1.getPrefixMapping().setNsPrefix( \"\", imported );\n poly.getPrefixMapping().setNsPrefix( \"\", local );\n assertEquals( null, poly.getPrefixMapping().getNsURIPrefix( imported ) );\n }",
"public abstract String getPrefix();",
"private void fastscan(State state,SuffixNode currNode,int uvLen,int j){ \n \n for(int i=0;i<currNode.children.size();i++){ \n SuffixNode child = currNode.children.get(i); \n \n if(text.charAt(child.start) == text.charAt(j)){ \n int len = child.getLength(); \n if(uvLen==len){ \n //then we find w \n //uvLen = 0; \n //need slow scan after this child \n state.u = child; \n state.w = child; \n state.j = j+len; \n }else if(uvLen<len){ \n //branching and cut child short \n //e.g. child=\"abc\",uvLen = 2 \n // abc ab \n // / \\ ================> / \\ \n // e f suffix part: \"abd^\" c d^ \n // / \\ \n // e f \n \n //insert the new node: ab; child is now c \n int nodepathlen = child.pathlen \n - (child.getLength()-uvLen); \n SuffixNode node = new SuffixNode(text, \n child.start,child.start + uvLen - 1,nodepathlen); \n node.children = new LinkedList<SuffixNode>(); \n \n int tailpathlen = (text.length() - (j + uvLen)) + nodepathlen; \n SuffixNode tail = new SuffixNode(text, \n j+uvLen,text.length()-1,tailpathlen); \n \n //update child node: c \n child.start += uvLen; \n if(text.charAt(j+uvLen)<text.charAt(child.start)){ \n node.children.add(tail); \n node.children.add(child); \n }else{ \n node.children.add(child); \n node.children.add(tail); \n } \n \n //update parent \n currNode.children.set(i, node); \n \n //uvLen = 0; \n //state.u = currNode; //currNode is already registered as state.u, so commented out \n state.w = node; \n state.finished = true; \n state.v = node; \n \n }else{//uvLen>len \n //e.g. child=\"abc\", uvLen = 4 \n // abc \n // / \\ ================> \n // e f suffix part: \"abcdefg^\" \n // \n // \n //jump to next node \n uvLen -= len; \n state.u = child; \n j += len; \n state.j = j; \n fastscan(state,child,uvLen,j); \n } \n break; \n } \n } \n }",
"private void buildSuffixTree() throws Exception{ \n if(root==null){ \n root = new SuffixNode(text); \n root.link = root; //link to itself \n } \n \n SuffixNode u = root; \n SuffixNode v = root; \n State state = new State(); \n \n for(int i=0;i<text.length();i++){ \n //process each suffix \n \n SuffixNode s = u.link; \n \n int uvLen=v.pathlen - u.pathlen; \n if(u.isRoot() && !v.isRoot()){ \n uvLen--; \n } \n int j = s.pathlen + i; \n \n //init state \n state.u = s; \n state.w = s; //if uvLen = 0 \n state.v = s; \n state.j = j; \n state.finished = false; \n \n //execute fast scan \n if(uvLen > 0) { \n fastscan(state,s,uvLen,j); \n } \n \n //establish the suffix link with v \n SuffixNode w = state.w; \n v.link = w; \n \n //execute slow scan \n if(!state.finished){ \n j = state.j; \n state.u = w; //w must be an internal node when state.finished=false, then it must have a suffix link, so u can be updated. \n slowscan(state,w,j); \n } \n \n u = state.u; \n v = state.v; \n } \n }",
"public void visit(PrimarySuffix n) {\n n.f0.accept(this);\n }",
"public String toIdent(Path prefix) {\n if (prefix != null && prefix.length() < length() && startsWith(prefix)) {\n return toIdent(prefix.length());\n } else {\n return toIdent(0);\n }\n }",
"public static void main(String[] args) {\n\n String expresson = \"1+((2+3)*40)-5\";\n List<String> strings = toInffixExpresion(expresson);\n System.out.println(strings.toString());\n\n List<String> parse = parseSuffix(strings);\n System.out.println(parse);\n }",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"private void processPath(String str) {\r\n if (str.equals(\"\")) {\r\n return;\r\n }\r\n\r\n int id1 = Integer.valueOf(str.split(\"->\")[0].trim());\r\n int id2 = Integer.valueOf(str.split(\"->\")[1].trim());\r\n Node node1 = null;\r\n Node node2 = null;\r\n\r\n // Find node according to its id\r\n for (Node node : NodeSet) {\r\n if (node.getID() == id1) {\r\n node1 = node;\r\n } else if (node.getID() == id2) {\r\n node2 = node;\r\n }\r\n }\r\n\r\n g.add(new Edge(node1, node2));\r\n }",
"public abstract String getIdPrefix();",
"private void slowscan(State state,SuffixNode currNode,int j){ \n boolean done = false; \n int keyLen = text.length() - j; \n for(int i=0;i<currNode.children.size();i++){ \n SuffixNode child = currNode.children.get(i); \n \n //use min(child.key.length, key.length) \n int childKeyLen = child.getLength(); \n int len = childKeyLen<keyLen?childKeyLen:keyLen; \n int delta = 0; \n for(;delta<len;delta++){ \n if(text.charAt(j+delta) != text.charAt(child.start+delta)){ \n break; \n } \n } \n if(delta==0){//this child doesn't match any character with the new key \n //order keys by lexi-order \n if(text.charAt(j) < text.charAt(child.start)){ \n //e.g. child=\"e\" (currNode=\"abc\") \n // abc abc \n // / \\ =========> / | \\ \n // e f insert \"c^\" c^ e f \n int pathlen = text.length() - j + currNode.pathlen; \n SuffixNode node = new SuffixNode(text,j,text.length()-1,pathlen); \n currNode.children.add(i,node); \n //state.u = currNode; //currNode is already registered as state.u, so commented out \n state.v = currNode; \n state.finished = true; \n done = true; \n break; \n }else{ //key.charAt(0)>child.key.charAt(0) \n //don't forget to add the largest new key after iterating all children \n continue; \n } \n }else{//current child's key partially matches with the new key \n if(delta==len){ \n if(keyLen>childKeyLen){ //suffix tree with ^ ending can't have other two cases \n //e.g. child=\"ab\" \n // ab ab \n // / \\ ==========> / | \\ \n // e f insert \"abc^\" c^ e f \n //recursion \n state.u = child; \n j += childKeyLen; \n state.j = j; \n slowscan(state,child,j); \n } \n }else{//0<delta<len \n \n //e.g. child=\"abc\" \n // abc ab \n // / \\ ==========> / \\ \n // e f insert \"abd^\" c d^ \n // / \\ \n // e f \n //insert the new node: ab \n int nodepathlen = child.pathlen \n - (child.getLength()-delta); \n SuffixNode node = new SuffixNode(text, \n child.start,child.start + delta - 1,nodepathlen); \n node.children = new LinkedList<SuffixNode>(); \n \n int tailpathlen = (text.length() - (j + delta)) + nodepathlen; \n SuffixNode tail = new SuffixNode(text, \n j+delta,text.length()-1,tailpathlen); \n \n //update child node: c \n child.start += delta; \n if(text.charAt(j+delta)<text.charAt(child.start)){ \n node.children.add(tail); \n node.children.add(child); \n }else{ \n node.children.add(child); \n node.children.add(tail); \n } \n //update parent \n currNode.children.set(i, node); \n \n //state.u = currNode; //currNode is already registered as state.u, so commented out \n state.v = node; \n state.finished = true; \n } \n done = true; \n break; \n } \n } \n if(!done){ \n int pathlen = text.length() - j + currNode.pathlen; \n SuffixNode node = new SuffixNode(text,j,text.length()-1,pathlen); \n currNode.children.add(node); \n //state.u = currNode; //currNode is already registered as state.u, so commented out \n state.v = currNode; \n state.finished = true; \n } \n }",
"private String parseDescrName(String line) {\n\t\t// d1f74a_ 201-209;3-11 DGAIGSTFN LKGIFSALL #7\n\t\t// d1nvra_ 226-253;184-204 IDSAPLALL GIVLTAMLA 0_0:-5_-8 0.477587\n\t\t// GroupName is created as name of domain (remove proceeding 'd') + pdb\n\t\t// number of the first residue\n\t\t// in the second segment (3-11 in the example) increased by 10000 + '_'\n\t\t// + number of cluster (7 in the case)\n\t\t// the residue with fasta number 3 is translated into address A4_ - so\n\t\t// the pdb number is 4\n\t\t// finally the group name will be 1f74a_#10004_7\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tString dom = tokens[0].substring(1);\n\t\tString noClust = \"\";\n\t\t@SuppressWarnings(\"unused\")\n\t\tint shift1 = 0; // segment1 shift\n\t\tint shift2 = 0; // segment2 shift\n\t\ttry {\n\t\t\tif (tokens[4].startsWith(\"#\")) {\n\t\t\t\tnoClust = \"_\" + tokens[4].substring(1);\n\t\t\t} else {\n\t\t\t\tnoClust = \"\";\n\t\t\t}\n\t\t\tif (tokens[4].startsWith(\"0_0\")) {\n\t\t\t\ttokens[4] = tokens[4].replaceFirst(\"0_0:\", \"\");\n\t\t\t\tString[] shifts = tokens[4].split(\"_\");\n\t\t\t\tshift1 = Integer.valueOf(shifts[0]);\n\t\t\t\tshift2 = Integer.valueOf(shifts[1]);\n\t\t\t}\n\t\t} catch (ArrayIndexOutOfBoundsException e) {\n\t\t\t// do nothing keep default values\n\t\t}\n\t\t// get the first number of second segment : e.g. 3 from 201-209;3-11\n\t\tString[] tokensA = tokens[1].split(\";\");\n\t\tString[] tokensB = tokensA[1].split(\"-\");\n\t\tInteger fastaNo = (Integer.valueOf(tokensB[0]) - shift2 >= 0 ? Integer\n\t\t\t\t.valueOf(tokensB[0]) - shift2 : Integer.valueOf(tokensB[0]));\n\n\t\t// get pdb address\n\t\tString pdbResAddr = hashResMapInt2Str.get(dom).get(fastaNo);\n\t\tpdbResAddr = pdbResAddr.substring(1, pdbResAddr.length() - 1);\n\t\tint pdbResNo = Integer.valueOf(pdbResAddr);\n\n\t\treturn (dom + \"#\" + (10000 + pdbResNo) + noClust);\n\t}",
"private String readPrefixPart()\n // { return readWordSub(false, false) ; }\n {\n return readSegment(false);\n }",
"public String getPrefix() { return \"linknode\"; }",
"public void replacePrefixesAndSplitByPredicate() throws ConfigurationNotInitializedException, PrefixReplacerPredicateSplitterException {\n\t\ttry {\n\t\t\tedu.utdallas.hadooprdf.conf.Configuration config =\n\t\t\t\tedu.utdallas.hadooprdf.conf.Configuration.getInstance();\n\t\t\torg.apache.hadoop.conf.Configuration hadoopConfiguration =\n\t\t\t\tnew org.apache.hadoop.conf.Configuration(config.getHadoopConfiguration()); // Should create a clone so\n\t\t\t// that the original one does not get cluttered with job specific key-value pairs\n\t\t\tFileSystem fs = FileSystem.get(hadoopConfiguration);\n\t\t\t// Delete output directory\n\t\t\tfs.delete(m_OutputDirectoryPath, true);\n\t\t\t// Must set all the job parameters before creating the job\n\t\t\tString sPathToPrefixFile = m_DataSet.getPathToPrefixFile().toString();\n\t\t\thadoopConfiguration.set(Tags.PATH_TO_PREFIX_FILE, sPathToPrefixFile);\n\t\t\t// Create the job\n\t\t\tString sJobName = \"Prefix Replacer for \" + m_InputDirectoryPath.getParent() + '/' + m_InputDirectoryPath.getName();\n\t\t\tJob job = new Job(hadoopConfiguration, sJobName);\n\t\t\t// Specify input parameters\n\t\t\tjob.setInputFormatClass(TextInputFormat.class);\n\t\t\tboolean bInputPathEmpty = true;\n\t\t\t// Get input file names\n\t\t\tFileStatus [] fstatus = fs.listStatus(m_InputDirectoryPath, new PathFilterOnFilenameExtension(m_sInputFilesExtension));\n\t\t\tfor (int i = 0; i < fstatus.length; i++) {\n\t\t\t\tif (!fstatus[i].isDir()) {\n\t\t\t\t\tFileInputFormat.addInputPath(job, fstatus[i].getPath());\n\t\t\t\t\tbInputPathEmpty = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (bInputPathEmpty)\n\t\t\t\tthrow new PrefixReplacerPredicateSplitterException(\"No file to replace prefix for!\");\n\t\t\t// Specify output parameters\n\t\t\tjob.setOutputFormatClass(FilenameByKeyMultipleTextOutputFormat.class);\n\t\t\tjob.setOutputKeyClass(Text.class);\n\t\t\tjob.setOutputValueClass(Text.class);\n\t\t\tjob.setMapOutputKeyClass(Text.class);\n\t\t\tjob.setMapOutputValueClass(Text.class);\n\t\t\tFileOutputFormat.setOutputPath(job, m_OutputDirectoryPath);\n\t\t\t// Set the mapper and reducer classes\n\t\t\tjob.setMapperClass(edu.utdallas.hadooprdf.data.preprocessing.namespacingpredicatesplit.mapred.PrefixReplacerPredicateSplitterMapper.class);\n\t\t\tjob.setReducerClass(edu.utdallas.hadooprdf.data.preprocessing.namespacingpredicatesplit.mapred.PrefixReplacerPredicateSplitterReducer.class);\n\t\t\t// Set the number of reducers\n\t\t\tif (-1 != getNumberOfReducers())\t// Use the number set by the client, if any\n\t\t\t\tjob.setNumReduceTasks(getNumberOfReducers());\n\t\t\telse if (-1 != config.getNumberOfTaskTrackersInCluster())\t// Use one reducer per TastTracker, if the number of TaskTrackers is available\n\t\t\t\tjob.setNumReduceTasks(config.getNumberOfTaskTrackersInCluster());\n\t\t\t// Set the jar file\n\t\t\tjob.setJarByClass(this.getClass());\n\t\t\t// Run the job\n\t\t\tif (job.waitForCompletion(true)) {\n\t\t\t\tfs.delete(m_InputDirectoryPath, true);\n\t\t\t\tfs.delete(m_DataSet.getPathToPSData(), true);\n\t\t\t\tfs.mkdirs(m_DataSet.getPathToPSData());\n\t\t\t\tfstatus = fs.listStatus(m_OutputDirectoryPath, new PathFilterOnFilenameExtension(Constants.PS_EXTENSION));\n\t\t\t\tfor (int i = 0; i < fstatus.length; i++)\n\t\t\t\t\tfs.rename(fstatus[i].getPath(), new Path(m_DataSet.getPathToPSData(), fstatus[i].getPath().getName()));\n\t\t\t\tfs.delete(m_OutputDirectoryPath, true);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new PrefixReplacerPredicateSplitterException(\"Prefix replacer job failed!\");\n\t\t} catch (IOException e) {\n\t\t\tthrow new PrefixReplacerPredicateSplitterException(\"IOException occurred:\\n\" + e.getMessage());\n\t\t} catch (InterruptedException e) {\n\t\t\tthrow new PrefixReplacerPredicateSplitterException(\"InterruptedException occurred:\\n\" + e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new PrefixReplacerPredicateSplitterException(\"ClassNotFoundException occurred:\\n\" + e.getMessage());\n\t\t}\n\t}",
"public void setPrefix(String prefix)\r\n {\r\n if (this.labels.size() > 0)\r\n {\r\n this.labels.get(0).setText(prefix);\r\n }\r\n else\r\n {\r\n throw new IllegalArgumentException(\"UMLFragmentLabelFigure: Cannot \"\r\n + \"set prefix (first sublabel) as there are no sublabels.\");\r\n }\r\n }",
"public String getPrefix();",
"public String getPrefix();",
"String getSuffix();",
"public void endPrefixMapping(String prefix) { }",
"public List<Node> calculatePrefix(Node start, Node goal, int numOfNodesToDevelop, Agent agent);",
"private void suffix(){\n String instruction = key_words.get(0);\n if(instruction.charAt(0) == 'B'){\n if(instruction.length() == 1) key_words.add(\"AL\");\n else{\n key_words.add(instruction.substring(1));\n key_words.set(0, \"B\");\n }\n }\n else{\n if(instruction.length() > 3){\n key_words.add(instruction.substring(3));\n key_words.set(0, instruction.substring(0,3));\n }\n }\n }",
"public static String getPrefixString() {\n\n\t\tString prefix = \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\"\n\t\t\t\t+ \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\"\n\t\t\t\t+ \"PREFIX dbpedia: <http://dbpedia.org/property/>\"\n\t\t\t\t+ \"PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\"\n\t\t\t\t+ \"PREFIX oddlinker: <http://data.linkedmdb.org/resource/oddlinker/>\"\n\t\t\t\t+ \"PREFIX db: <http://data.linkedmdb.org/resource/>\"\n\t\t\t\t+ \"PREFIX movie: <http://data.linkedmdb.org/resource/movie/>\"\n\t\t\t\t+ \"PREFIX map: <file:/C:/d2r-server-0.4/mapping.n3#>\"\n\t\t\t\t+ \"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\"\n\t\t\t\t+ \"PREFIX d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#>\"\n\t\t\t\t+ \"PREFIX owl: <http://www.w3.org/2002/07/owl#>\"\n\t\t\t\t+ \"PREFIX dc: <http://purl.org/dc/terms/>\"\n\t\t\t\t+ \"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\"\n\t\t\t\t+ \"PREFIX fn: <java:facet.>\";\n\n\t\treturn prefix;\n\t}",
"@Override\n public String getFromID()\n {\n \tStringBuilder sb = new StringBuilder();\n\n \tint ident2 = getIdent2();\n \t\n \tIdentType type = IdentType.fromIdent( ident2 );\n\n \t/* Inter-Prefix - the from and to idents are different prefixes */\n \tif( type == IdentType.IPFIXI )\n \t{\n \tsb.append( format( getBlock2Prefix(), 3 ) );\n \tsb.append( \"-\" );\n \tsb.append( format( getBlock2Ident2(), 4) );\n \t}\n \telse\n \t{\n \tsb.append( format( getPrefix(), 3 ) );\n \tsb.append( \"-\" );\n \tsb.append( format( ident2, 4) );\n \t}\n \t\n \treturn sb.toString();\n }",
"private void superSuffix(Operation base, Scope scope, Vector queue)\r\n {\r\n if (nextSymbol == Keyword.LPARSY)\r\n base.left.left = arguments(scope, null, queue);\r\n else\r\n {\r\n matchKeyword(Keyword.DOTSY);\r\n\r\n base = base.right = new Operation();\r\n base.left = new Operation();\r\n base.left.name = nextToken;\r\n matchKeyword(Keyword.IDENTSY);\r\n\r\n base.left.left = argumentsOpt(scope, null, queue);\r\n }\r\n }",
"private int nextSuffix() {\r\n\t\t\tint unsignedByte = suffixes[index] & 0xFF;\r\n\r\n\t\t\tint suffix = unsignedByte + 1;\r\n\t\t\tsuffix += (256 * (offset));\r\n\r\n\t\t\tif (index < 255) {\r\n\t\t\t\tindex++;\r\n\t\t\t} else {\r\n\t\t\t\tindex = 0;\r\n\t\t\t\toffset++;\r\n\t\t\t}\r\n\t\t\treturn suffix;\r\n\t\t}",
"static void getFullsetMid2Name() throws IOException {\n\t\tDelimitedWriter dw = new DelimitedWriter(Main.file_mid2namesfullset);\r\n\t\tDelimitedReader dr = new DelimitedReader(Main.file_fbdump_2_len4);\r\n\t\tString[] l;\r\n\t\twhile ((l = dr.read()) != null) {\r\n\t\t\t// set name\r\n\t\t\tif (l[1].equals(\"/type/object/name\") && l[2].equals(\"/lang/en\")) {\r\n\t\t\t\tString mid = l[0];\r\n\t\t\t\tString name = l[3];\r\n\t\t\t\tdw.write(mid, name, \"name\");\r\n\t\t\t}\r\n\t\t\tif (l[1].equals(\"/common/topic/alias\") && l[2].equals(\"/lang/en\")) {\r\n\t\t\t\tString mid = l[0];\r\n\t\t\t\tString name = l[3];\r\n\t\t\t\tdw.write(mid, name, \"alias\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tdw.close();\r\n\t}",
"public String getPrefixString() {\n/* 105 */ return this.prefix;\n/* */ }",
"private int prefixQuery(String prefix) {\n if (curr == null)\n curr = track(dict, prefix);\n else\n curr = track(curr.mid, prefix);\n\n if (curr == null) return 0;\n if (curr.isString) {\n if (curr.mid == null) return 1;\n else return 3;\n } else {\n if (curr.mid == null) return 0;\n return 2;\n }\n }",
"public Path getDescendant(\n List<XRISegment> suffix\n ) {\n \tPath result = this;\n \tfor(XRISegment component : suffix) {\n \t\tresult = result.getChild(component);\n \t}\n return result;\n }",
"private void prefix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t \t\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tprefix(root.left, sb); // run recursive method \n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tprefix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t }",
"public SuffixTree() {\n }",
"SimpleString getPrefix(SimpleString address);",
"public LinkedList<String> startsWith(String prefix) { \n char[] w = prefix.toCharArray(); \n TrieNode start = startsWith(root, w, 0); \n LinkedList<String> result = new LinkedList<String>(); \n StringBuilder sb = new StringBuilder(); \n constructWords(start, prefix, result, sb); \n return result; \n }",
"private Operation identifierSuffix(Operation root, Operation next, Scope scope, Vector queue)\r\n {\r\n if (nextSymbol == Keyword.LBRACKETSY)\r\n {\r\n lookAhead();\r\n lookAhead();\r\n unresolved.add(\"JavaArray\");\r\n\r\n bracketsOpt();\r\n\r\n matchKeyword(Keyword.DOTSY);\r\n\r\n matchKeyword(Keyword.CLASSSY);\r\n\r\n next.left.operator = Keyword.CLASSSY;\r\n }\r\n else if (nextSymbol == Keyword.DOTSY)\r\n {\r\n lookAhead();\r\n\r\n if (nextSymbol == Keyword.CLASSSY)\r\n {\r\n lookAhead();\r\n next.left.operator = Keyword.CLASSSY;\r\n }\r\n else\r\n {\r\n next = (next.right = new Operation());\r\n next.left = new Operation();\r\n next.left.operator = nextSymbol;\r\n matchKeyword(Keyword.THISSY);\r\n }\r\n }\r\n else\r\n {\r\n next.left.left = argumentsOpt(scope, null, queue);\r\n }\r\n\r\n return root;\r\n }",
"void setPrefix(String prefix);",
"private String getPrefixForObject(Context context, DSpaceObject dso)\n {\n String prefix = getConfigProperty(context,\n CFG_PREFIX, dso);\n return prefix;\n }",
"String getIdNode2();",
"String targetGraph();",
"private String getPrefixesString() {\n\t\t//TODO: Include dynamic way of including this\n\t\treturn \"@prefix core: <http://vivoweb.org/ontology/core#> .\";\n\t}",
"public ImplementPrefix() {\n root = new TrieNode('$');\n }",
"@Override\n public IABTNode updateNode(String substring, String word, int index) {\n int descendNode = this.descend(substring.charAt(index));\n IABTNode newNode;\n if(descendNode == 1){\n newNode = new ABTNode(substring.charAt(index+1));\n } else {\n newNode = new ABTNode(substring.charAt(index));\n }\n newNode.setKey(word, -1);\n this.sons.set(descendNode, newNode);\n return this.sons.get(descendNode);\n }",
"@Override\n\t\tpublic void endPrefixMapping(String prefix) throws SAXException {\n\t\t\t\n\t\t}",
"protected StringBuilder visualize(int node, StringBuilder prefix, boolean isTail, StringBuilder sb) {\r\n\r\n\t\tint right = rightChildOf(node);\r\n\t\tint left = leftChildOf(node);\r\n\t\t\r\n\t if(right < size()) {\r\n\t visualize(right, new StringBuilder().append(prefix).append(isTail ? \"| \" : \" \"), false, sb);\r\n\t }\r\n\t sb.append(prefix).append(isTail ? \"\\\\—— \" : \"/—— \").append(array.get(node)).append(\"\\n\");\r\n\t if(left < size()) {\r\n\t visualize(left, new StringBuilder().append(prefix).append(isTail ? \" \" : \"| \"), true, sb);\r\n\t }\r\n\t return sb;\r\n\t}",
"private Node findLastNodeOf(String prefix){\n if(prefix == null) return null;\n\n var current = root;\n // loop over all the ch in this preix String\n for(var ch: prefix.toCharArray()){\n //get the current node for this character\n var child = current.getChild(ch);\n if(child == null) return null; // no any prefix word i Trie\n current = child; // otherwise set current to this child\n }\n return current; // last node of prefix\n }",
"public void setIdentificationPrefix(String prefix);",
"@Override\r\n public void endPrefixMapping(String prefix) throws SAXException {\n }",
"public void addPOSPrefix(String prefix) {\n if(prefix==null)\n return;\n if(POSPrefix==null){\n POSPrefix=prefix;\n return;\n }\n if(prefix.startsWith(POSPrefix))\n return;\n if(POSPrefix.startsWith(prefix)){\n POSPrefix=prefix;\n } else { //We need to find the longest common prefix of the two prefix strings\n int len=0;\n for(int max=Math.min(prefix.length(),POSPrefix.length());len<max;++len){\n if(prefix.charAt(len)!=POSPrefix.charAt(len))\n break;\n }\n POSPrefix=prefix.substring(0,len);\n }\n }",
"public void testBug631Suffixes() {\n // Set the prefix length large enough so that we ensure suffixes are\n // appropriately tested\n final PrefixTree tree = new PrefixTree(100);\n final String[] prototypeNames = {\n \"__proto__\", \"constructor\", \"eval\", \"prototype\", \"toString\",\n \"toSource\", \"unwatch\", \"valueOf\",};\n\n for (int i = 0; i < prototypeNames.length; i++) {\n final String name = prototypeNames[i];\n\n assertFalse(\"Incorrectly found \" + name, tree.contains(name));\n\n assertTrue(\"First add() didn't return true: \" + name, tree.add(name));\n assertFalse(\"Second add() of duplicate entry didn't return false: \"\n + name, tree.add(name));\n\n assertTrue(\"contains() didn't find added word: \" + name,\n tree.contains(name));\n }\n\n testSizeByIterator(tree);\n assertTrue(\"PrefixTree doesn't contain all of the desired words\",\n prototypeNames.length == tree.size());\n }",
"public boolean startsWith(String prefix) {\n int length = prefix.length();\n if(length == 0){\n return false;\n }\n\n char[] chars = prefix.toCharArray();\n\n Map<Character,Node> map = this.root.map;\n // 需要保证word的结尾是endfr\n for(int i = 0;i < length;i++){\n if(!map.containsKey(chars[i])) {\n return false;\n }\n\n map = map.get(chars[i]).map;\n }\n return true;\n }",
"@Override\n\tpublic void endPrefixMapping(String prefix) throws SAXException {\n\t\t\n\t}",
"@Override\n\tpublic void endPrefixMapping(String prefix) throws SAXException {\n\t\t\n\t}",
"private boolean dfs(String word, int idx, TrieNode parent) {\n if (idx == word.length()) {//since it's parent node so idx cannot be len - 1\n return parent.isLeaf;\n }\n if (word.charAt(idx) == '.') {\n for (TrieNode curr : parent.map.values()) {\n boolean res = dfs(word, idx + 1, curr);\n if (res) return true;\n }\n } else {\n if (parent.map.containsKey(word.charAt(idx))) {\n return dfs(word, idx + 1, parent.map.get(word.charAt(idx)));\n }\n }\n return false;\n}",
"void setSuffix(String suffix);",
"public String getIdentificationPrefix();",
"public String getSuffixOrPrefix()\r\n\t{\r\n\t\treturn suffixOrPrefix;\r\n\t}",
"public void createPrefixS(){\n\t \tprefixS = new Stack<Node>();\n\t \tprefixS.push(root);\n\t }",
"@Override\n\tpublic void notationDecl(String arg0, String arg1, String arg2)\n\t\t\tthrows SAXException {\n\n\t}",
"public void visit(PrimaryPrefix n) {\n n.f0.accept(this);\n }",
"@Override\n public void endPrefixMapping(String prefix) throws SAXException {\n // ...\n }",
"public static String generateID(String prefix) {\n if(prefix.length()!=3){\n prefix = prefix.substring(0,3);\n }\n /*Solo en el caso de que queramos reciclar los IDs\n for (ID a : EmptyIDs) {\n if (a.getType().equals(prefix)) {\n EmptyIDs.remove(a);\n return prefix+\"#\" + a.getNumVal();\n }\n }*/\n //Tenemos guardado el id mas alto y lo incrementamos cada vez que creamos uno nuevo (asumiendo que no se recicla)\n for (ID max : MaxIDs) {\n if (max.getType().equals(prefix)) {\n max.increment();\n return prefix +\"#\"+ max.getNumVal();\n }\n }\n return prefix + \"#1\";\n }",
"private void dfs(int start, int end, String str, String s, List<Integer>[] cache, LinkedList<String> res) {\n\t\tif (start == -1) {\n\t\t\tres.add(str.substring(1));\n\t\t} else {\n\t\t\tfor (int n : cache[start]) {\n\t\t\t\tdfs(n, start, \" \" + s.substring(start, end) + str, s, cache, res);\n\t\t\t}\n\t\t}\n\t}",
"GetPrefix prefix(String... prefixPaths);",
"private void getPathsForSameNodeAndMaxLatency(Node target, int maxLatency, String prefix) {\n LinkedList<Edge> edges = target.getEdges();\n for (Edge e : edges) {\n String newPrefix = prefix + e.getDestination().getName();\n temp = getPathWeight(newPrefix);\n if(temp<maxLatency) {\n if (e.getDestination().getName().equalsIgnoreCase(endNode.getName())) {\n paths.put(newPrefix, temp);\n }\n getPathsForSameNodeAndMaxLatency(e.getDestination(),maxLatency,newPrefix);\n }\n }\n }",
"public void parseNodeFrequences(PairList nGramList, TreeNode parent, String current){\r\n\r\n\t\tString str = null;\r\n\t\tif(!parent.getSyscall().equals(rootNodeName)){ // update n-gram name\r\n\t\t\tif(current== null){\r\n\t\t\t\tstr = parent.getSyscall();\r\n\t\t\t}else{\r\n\t\t\t\tstr = current.concat(\",\" + parent.getSyscall());\r\n\t\t\t}\r\n\t\t\tnGramList.add(new Pair(parent.getFrequency(), str, parent.getAbnormality(0))); // add n-gram in list\r\n\t\t}\r\n\r\n\t\tIterator<TreeNode> i = parent.children();\r\n\t\twhile(i.hasNext()){\r\n\t\t\tparseNodeFrequences(nGramList, i.next(), str);\r\n\t\t}\t\t\r\n\t}",
"public final void ast_suffix() throws RecognitionException {\n\t\ttry {\n\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:652:2: ( ROOT | BANG )\n\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:\n\t\t\t{\n\t\t\tif ( input.LA(1)==BANG||input.LA(1)==ROOT ) {\n\t\t\t\tinput.consume();\n\t\t\t\tstate.errorRecovery=false;\n\t\t\t\tstate.failed=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (state.backtracking>0) {state.failed=true; return;}\n\t\t\t\tMismatchedSetException mse = new MismatchedSetException(null,input);\n\t\t\t\tthrow mse;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public void addPOSPrefix(String prefix) {\n\t\tif(prefix==null)\n\t\t\treturn;\n\t\tif(POSPrefix==null){\n\t\t\tPOSPrefix=prefix;\n\t\t\treturn;\n\t\t}\n\t\tif(prefix.startsWith(POSPrefix))\n\t\t\treturn;\n\t\tif(POSPrefix.startsWith(prefix)){\n\t\t\tPOSPrefix=prefix;\n\t\t} else { //We need to find the longest common prefix of the two prefix strings\n\t\t\tint len=0;\n\t\t\tfor(int max=Math.min(prefix.length(),POSPrefix.length());len<max;++len){\n\t\t\t\tif(prefix.charAt(len)!=POSPrefix.charAt(len))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tPOSPrefix=prefix.substring(0,len);\n\t\t}\n\t}",
"public boolean startsWith(String prefix) {\n TrieNode now = root;\n for(int i = 0; i < prefix.length(); i++) {\n Character c = prefix.charAt(i);\n if (!now.children.containsKey(c)) {return false;}\n now = now.children.get(c);\n }\n return true;\n}",
"public DP_Suffix_Solution(DP_Decision dec)\n {\n \tthis.first_decision = dec;\n \tthis.shorter_suffix = null;\n \t// this.length = 1;\n this.cost = dec.cost;\n this.next = null;\n }",
"private Node createFromSpeciesFile(String[] line, String alias1, Node parent, int cnt, double bl){\n\t\t String name = line[1];\n\t\t String[] names = name.split(\"\\\\|\");\n\t\t \n\t\t if(names.length>3 && names[3].startsWith(\"NC\")) name = names[3];\n\t\t Node n = new SimpleNode(name,bl);\n\t\t Identifier id = n.getIdentifier();\n\t\t Identifier pid = parent.getIdentifier();\n\t\t String prefix = ((String)pid.getAttribute(\"prefix\"));\n\t\t if(parent.isRoot()) prefix = prefix+\"+-\";\n\t\t id.setAttribute(\"level\",((Integer) pid.getAttribute(\"level\"))+2);\n\t\t id.setAttribute(\"prefix\", \" | \"+prefix);\n\t\t id.setAttribute(\"alias\", line[0]);\n\t\t id.setAttribute(\"alias1\", alias1);\n\t\t id.setAttribute(\"speciesIndex\", cnt);\n\t\t String css =(String) pid.getAttribute(\"css\");\n\t\t if(css!=null){\n\t\t\t id.setAttribute(\"css\", css);\n\t\t }\n\t\t parent.addChild(n);\n\t\t this.putSlug(n);\n\t\t return n;\n\t }",
"private void getPathsForSameNodeAndMaxNumberOfSteps(Node target, int maxNrHoops, String prefix) {\n LinkedList<Edge> edges = target.getEdges();\n\n for (Edge e : edges) {\n String newPrefix = prefix + e.getDestination().getName();\n if(!e.getDestination().getName().equalsIgnoreCase(startNode.getName()) && prefix.length()<maxNrHoops){\n getPathsForSameNodeAndMaxNumberOfSteps(e.getDestination(),maxNrHoops,newPrefix);\n } else if(e.getDestination().getName().equalsIgnoreCase(startNode.getName())){\n temp=getPathWeight(newPrefix);\n paths.put(newPrefix, temp);\n if(newPrefix.length()<maxNrHoops) {\n getPathsForSameNodeAndMaxNumberOfSteps(e.getDestination(),maxNrHoops,newPrefix);\n }\n }\n }\n\n }",
"private void expandAffixes() {\n // Reuse one StringBuffer for better performance\n final StringBuffer buffer = new StringBuffer();\n if (posPrefixPattern != null) {\n positivePrefix = expandAffix(posPrefixPattern, buffer);\n positivePrefixFieldPositions = null;\n }\n if (posSuffixPattern != null) {\n positiveSuffix = expandAffix(posSuffixPattern, buffer);\n positiveSuffixFieldPositions = null;\n }\n if (negPrefixPattern != null) {\n negativePrefix = expandAffix(negPrefixPattern, buffer);\n negativePrefixFieldPositions = null;\n }\n if (negSuffixPattern != null) {\n negativeSuffix = expandAffix(negSuffixPattern, buffer);\n negativeSuffixFieldPositions = null;\n }\n }",
"Set getPrefixes();",
"public void endPrefixMapping (String prefix)\n throws SAXException\n {\n // no op\n }",
"void processDFS(int offset, String str) {\n if (offset == 0) {\n wordOut.add(str.strip());\n }\n ArrayList<Integer> arr = dp[offset];\n for (int iStart : arr) {\n String strWord = sentence.substring(iStart, offset);\n strWord = strWord + \" \" + str;\n processDFS(iStart, strWord);\n }\n }",
"public longestRepeatedSuffixTree(String word) {\r\n super();\r\n char[] wordChar = (word + \"$\").toCharArray();\r\n for (int i = 0; i< wordChar.length; i++)\r\n addSuffix(wordChar, i);\r\n compressTree();\r\n createLongestRepeatedSubstring(); \r\n }",
"@Override\n public R visit(PrefixDecl n, A argu) {\n R _ret = null;\n n.nodeToken.accept(this, argu);\n n.nodeToken1.accept(this, argu);\n n.nodeToken2.accept(this, argu);\n return _ret;\n }",
"public boolean startsWith(String prefix) {\n char[] chars = prefix.toCharArray();\n Node theNode = root;\n for (char c : chars) {\n if (theNode.children.containsKey(c)) {\n theNode = theNode.children.get(c);\n } else {\n return false;\n }\n }\n return true;\n }",
"GetPrefix internalContent();",
"@DSComment(\"Package priviledge\")\n @DSBan(DSCat.DEFAULT_MODIFIER)\n @DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.411 -0500\", hash_original_method = \"4549801F41C68E0A6A490696C062C72D\", hash_generated_method = \"8B62B5695F36760CAD8EDCDC235C2C64\")\n \nvoid declarePrefix(String prefix, String uri) {\n // Lazy processing...\n if (!declsOK) {\n throw new IllegalStateException (\"can't declare any more prefixes in this context\");\n }\n if (!declSeen) {\n copyTables();\n }\n if (declarations == null) {\n declarations = new ArrayList<String>();\n }\n\n prefix = prefix.intern();\n uri = uri.intern();\n if (\"\".equals(prefix)) {\n if (\"\".equals(uri)) {\n defaultNS = null;\n } else {\n defaultNS = uri;\n }\n } else {\n prefixTable.put(prefix, uri);\n uriTable.put(uri, prefix); // may wipe out another prefix\n }\n declarations.add(prefix);\n }",
"public abstract String beginGraphString();",
"public void endPrefixMapping(String prefix) throws SAXException {\r\n\t}",
"public SuffixLattice(String suffix) {\n\t\tthis.suffix = suffix;\n\t}",
"java.util.Optional<String> getPrefix();",
"public static void main(String[] args) {\n\t\tString[] strs = {\"predlgas\", \"preskdlf;\", \"prekdsg\", \"prekdkgl;\", \"predlldf\"};\n\t\tString prefix = longestCommonPrefix(strs);\n\t\tSystem.out.println(prefix);\n\n\t}",
"@Override\r\n public synchronized String getLabelExtension() {\r\n int sourceSize = (getSource() != null) ? 1 : 0;\r\n int targetSize = (getTarget() != null) ? getTarget().size() : 0;\r\n String prefix = (!super.getLabelExtension().equals(Constant.EMPTY_STRING)) ? super\r\n .getLabelExtension()\r\n : Schema.TYPE_LINK;\r\n return prefix + Constant.BLANK + Constant.OPEN_PARENTHESIS + sourceSize\r\n + Constant.COMMA + Constant.BLANK + targetSize\r\n + Constant.CLOSE_PARENTHESIS;\r\n }",
"public void end_ns(Object parser, String prefix) {\n }",
"public VicarBinaryLabel getBinaryPrefix(int n2, int n3) throws IOException;",
"public ActionStartCurrStmtPlus(int suffix) {\n super();\n _suffix = suffix;\n }",
"private String parseGroupNameD2K(String line) {\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tsb.append(tokens[0] + \".\");\n\t\tsb.append(tokens[1].replace(';', '_'));\n\t\ttry{\n\t\t\tsb.append(tokens[4].replace('#', '.'));\n\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\t// do nothing\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private void processNode(String str) {\r\n String[] strs = str.split(\":\");\r\n int id = Integer.valueOf(strs[0].trim());\r\n String[] strings = strs[1].split(\",\");\r\n int num = strings[1].indexOf(\"(\");\r\n int x = Integer\r\n .valueOf(strings[1].substring(num + 1, strings[1].length()));\r\n int y = Integer\r\n .valueOf(strings[2].trim().substring(0,\r\n strings[2].trim().length() - 1));\r\n\r\n if (strings[0].trim().toLowerCase().equals(\"input\")) {\r\n ArrayList<Circle> inputList = new ArrayList<>();\r\n NodeSet.add(new InputNode(id, x, y, inputList));\r\n } else if (strings[0].trim().toLowerCase().equals(\"passthrough\")) {\r\n NodeSet.add(new ThingNode(id, x, y));\r\n }\r\n\r\n else if (strings[0].trim().toLowerCase().equals(\"sink\")) {\r\n NodeSet.add(new SinkNode(id, x, y));\r\n }\r\n }",
"public UMLFragmentLabelFigure(String prefix, String text)\r\n {\r\n this();\r\n\r\n LabelFigure boldLabel = new LabelFigure(prefix, Commons4EclipseFonts\r\n .getFont(Commons4EclipseFonts.FONT_DEFAULT_BOLD));\r\n addLabel(boldLabel);\r\n\r\n LabelFigure textLabel = new LabelFigure(text, Commons4EclipseFonts\r\n .getFont(Commons4EclipseFonts.FONT_DEFAULT_NORMAL));\r\n addLabel(textLabel);\r\n }",
"public PrefixAndSuffix( final String prefix , final String suffix , final String delimiter ) {\n if ( delimiter == null ) {\n throw new IllegalArgumentException( \"Null delimiters are not allowed.\" );\n }\n if ( prefix == null ) {\n prefixAppender = new DummyPrefixAppender();\n } else {\n prefixAppender = new PrefixAppender( prefix , delimiter );\n }\n\n if ( suffix == null ) {\n suffixAppender = new DummySuffixAppender();\n } else {\n suffixAppender = new SuffixAppender( suffix , delimiter );\n }\n }",
"String getIdNode1();",
"private String longestPrefix(String[] inputs){\n\t\tif(inputs == null || inputs.length == 0)\n\t\t\treturn \"\";\n\t\tif(inputs.length == 1)\n\t\t\treturn inputs[0];\n\t\tString prefix = inputs[0];\n\t\t\n\t\tfor(int i=0; i< inputs.length; i++){\n\t\t\twhile(inputs[i].indexOf(prefix) != 0){\n\t\t\t\tprefix = prefix.substring(0, prefix.length()-1);\n\t\t\t\tif(prefix.isEmpty())\n\t\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\t\t\n\t\treturn prefix;\n\t}",
"public NodeKey parseSegments(String[] segments);",
"public String buildDotString(){\n\t\tString ret=\"digraph NFA{\\n\";\n\t\tint numStarts=0;\n\t\tfor (State s : theStates){\n\t\t\tif(s.getAccept())\n\t\t\t\tret+=\"\\t\"+s.getIndex()+\"[shape=doublecircle]\\n\";\n\t\t\tif(s.getStart()){\n\t\t\t\tString startlbl=\"start\"+(numStarts++);\n\t\t\t\tret+=\"\\t\"+startlbl+\"[shape=none,label=\\\"\\\"]\\n\";\n\t\t\t\tret+=\"\\t\"+startlbl+\"->\"+s.getIndex()+\"[color=green]\\n\";\n\t\t\t}\n\t\t\tfor (Object withChar : s.getToStates().keySet()){\n\t\t\t\t//TODO: combine arrows with same from/to\n\t\t\t\tfor (Integer toNode : (ArrayList<Integer>)s.getToStates().get(withChar)){\n\t\t\t\t\t//find similar arrows\n\t\t\t\t\tString arrowName=(String)withChar;\n\t\t\t\t\t/*for (Object otherChar : s.getToStates().keySet()){\n\t\t\t\t\t\tfor (Integer sameNodeIdx : (ArrayList<Integer>)s.getToStates().get(withChar)){\n\t\t\t\t\t\t\tif(sameNodeIdx==toNode) arrowName+=\",\"+otherChar;\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\t\t\t\t\tret+=\"\\t\"+s.getIndex()+\" -> \"+toNode+\"[label=\\\"\"+arrowName+\"\\\"]\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tret+=\"}\";\n\t\treturn ret;\n\t}"
] | [
"0.55186856",
"0.54936963",
"0.5440105",
"0.54258573",
"0.5398431",
"0.5382044",
"0.5333613",
"0.5285363",
"0.5285363",
"0.5285363",
"0.5285363",
"0.5274898",
"0.52648306",
"0.5252807",
"0.5224072",
"0.52152985",
"0.5201629",
"0.51734465",
"0.5146445",
"0.5137665",
"0.5137665",
"0.51149964",
"0.5086785",
"0.5064322",
"0.49802223",
"0.49744734",
"0.4957762",
"0.49359816",
"0.4915733",
"0.49073705",
"0.48987195",
"0.48945826",
"0.48807123",
"0.4878501",
"0.48784038",
"0.48699376",
"0.4862145",
"0.485031",
"0.48474833",
"0.483635",
"0.4831208",
"0.48258623",
"0.48173013",
"0.48108906",
"0.48046488",
"0.48044944",
"0.48026806",
"0.4800514",
"0.47791734",
"0.47691354",
"0.47668466",
"0.47512406",
"0.47476923",
"0.4736427",
"0.4736427",
"0.47350308",
"0.47330102",
"0.47255144",
"0.47226378",
"0.47191665",
"0.4714373",
"0.4710303",
"0.47011968",
"0.47003883",
"0.4698456",
"0.46912223",
"0.4686201",
"0.46726346",
"0.4663006",
"0.46531293",
"0.46516827",
"0.46499178",
"0.46448445",
"0.46407905",
"0.4630933",
"0.46288657",
"0.4624643",
"0.4623083",
"0.46138403",
"0.46074212",
"0.4606364",
"0.4600052",
"0.45995966",
"0.45952737",
"0.4584247",
"0.45769173",
"0.45728385",
"0.4565084",
"0.45618",
"0.45607236",
"0.45471203",
"0.45436013",
"0.45423365",
"0.45295584",
"0.45247114",
"0.45242304",
"0.45237544",
"0.45225975",
"0.45208356",
"0.45197865"
] | 0.6038594 | 0 |
Remote interface for Enterprise Bean: CfgDocument | public interface CfgDocument extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {
/**
* Get accessor for persistent attribute: savconfigidold
*/
public int getSavconfigidold() throws java.rmi.RemoteException;
/**
* Set accessor for persistent attribute: savconfigidold
*/
public void setSavconfigidold(int newSavconfigidold)
throws java.rmi.RemoteException;
/**
* Get accessor for persistent attribute: savconfigidnew
*/
public int getSavconfigidnew() throws java.rmi.RemoteException;
/**
* Set accessor for persistent attribute: savconfigidnew
*/
public void setSavconfigidnew(int newSavconfigidnew)
throws java.rmi.RemoteException;
/**
* Get accessor for persistent attribute: storedem
*/
public java.lang.Integer getStoredem() throws java.rmi.RemoteException;
/**
* Set accessor for persistent attribute: storedem
*/
public void setStoredem(java.lang.Integer newStoredem)
throws java.rmi.RemoteException;
/**
* Get accessor for persistent attribute: storebad
*/
public java.lang.Integer getStorebad() throws java.rmi.RemoteException;
/**
* Set accessor for persistent attribute: storebad
*/
public void setStorebad(java.lang.Integer newStorebad)
throws java.rmi.RemoteException;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface CfgDocumentHome extends javax.ejb.EJBHome {\n\t/**\n\t * Creates an instance from a key for Entity Bean: CfgDocument\n\t */\n\t/*\n\tpublic com.hps.july.persistence.CfgDocument create(\n\t\tint document,\n\t\tcom.hps.july.persistence.Organization argOwner,\n\t\tcom.hps.july.persistence.StoragePlace argTo,\n\t\tcom.hps.july.persistence.Organization argContragent,\n\t\tcom.hps.july.persistence.StoragePlace argFrom,\n\t\tcom.hps.july.persistence.Worker argStorageManager)\n\t\tthrows javax.ejb.CreateException, java.rmi.RemoteException;\n\t*/\n\t/**\n\t * Finds an instance using a key for Entity Bean: CfgDocument\n\t */\n\tpublic com.hps.july.persistence.CfgDocument findByPrimaryKey(\n\t\tcom.hps.july.persistence.DocumentKey primaryKey)\n\t\tthrows javax.ejb.FinderException, java.rmi.RemoteException;\n\t\t\n\tpublic com.hps.july.persistence.CfgDocument create(\n\t\tint argDocument,\n\t\tInteger argOwner,\n\t\tInteger argFrom,\n\t\tInteger argTo,\n\t\tjava.sql.Date argBlankDate,\n\t\tint argBlankindex,\n\t\tString argBlankNumber,\n\t\tString argState,\n\t\tBoolean argProcessSource,\n\t\tBoolean argProcessDestination,\n\t\tint SavconfigIdOld,\n\t\tint SavconfigIdNew)\n\t\tthrows javax.ejb.CreateException, java.rmi.RemoteException;\n}",
"public interface DocStoreUpdateContext extends DocUpdateContext {\n\n}",
"cdfgFactory getcdfgFactory();",
"public interface Config {\n public final String contentOfDocument=\"contentOfDoc\";\n public final String docId=\"docId\";\n public final String baseIp=\"http://irlab.daiict.ac.in/Annotation_Interface\";\n public final String sentenceFolder=\"sentences\";\n public final String savedSentenceEnd=\"savedSentenceEnd\";\n public final String savedSentenceStart=\"savedSentenceStart\";\n public final String docName=\"doc_name\";\n public final String relationFolder=\"relationsFolder\";\n public final String savedRelation=\"savedRelation\";\n public final String loginPrefs=\"loginFolder\";\n public final String isLoggedIn=\"isLoggedIn\";\n public final String userName=\"userName\";\n public final String password=\"password\";\n public final String relation=\"relation\";\n public final String checkedRelation=\"checkedRelation\";\n}",
"@Remote\r\npublic interface CmUserDocstatusAccessFacadeRemote extends UtopiaBasicUsecaseBean<CmUserDocstatusAccess, CmUserDocstatusAccess> {\r\n\r\n\tpublic List<CmDocStatus> getUserAccessibleDocStatuses(Long userId,Map<String,Object>context);\r\n}",
"public interface EavropDocumentService {\n\t\n\n\t/**\n\t * Adds to the eavrop an externally received document, will potentially affect the start date of the eavrop assessment period \n\t *\n\t * @param aCommand\n\t */\n\tpublic boolean addReceivedExternalDocument(AddReceivedExternalDocumentsCommand aCommand);\n\n\t/**\n\t * Adds to the eavrop an internally received document \n\t *\n\t * @param aCommand\n\t */\n\tpublic void addReceivedInternalDocument(AddReceivedInternalDocumentCommand aCommand);\n\n\t/**\n\t * Adds to the eavrop a requested document\n\t * @param aCommand\n\t */\n\tpublic RequestedDocument addRequestedDocument(AddRequestedDocumentCommand aCommand);\n\n}",
"org.omg.CORBA.Object _get_interface_def();",
"public String getDocumentEndpoint();",
"public interface DocumentDefinition extends NodeDefinition {\n\n String getContentPath();\n\n String getMimeType();\n\n String getEncoding();\n}",
"public interface CCRDocumentTypes extends DocumentTypes{\n\tpublic String MEDCOMMONS_AFFINITY_DOMAIN = \"MedCommons Patient Identifier\";\n\n public String CCR_CHANGE_NOTIFICATION_STATUS_PENDING = \"Pending\";\n \n public String CCR_CHANGE_NOTIFICATION_STATUS_NOTIFIED = \"Notified\";\n\n public static final String MEDCOMMONS_PATIENT_ID_TYPE = \"MedCommons Account Id\";\n\n\t\n\t/**\n\t * The URN of the namespace for CCR documents. This is the value that appears\n\t * in the XML header.\n\t */\n\tpublic static final String CCR_NAMESPACE_URN = \"urn:astm-org:CCR\";\n\n\t/**\n\t * Location of the XSD on disk\n\t */\n\tpublic static String XSD_LOCATION = \"conf/CCR_20051109.xsd\";\n\t\n\t/**\n\t * The URI of the namespace for CCR documents. This is the value that is returned by \n\t * the JDOM getNamespaceURI() method.\n\t */\n\tpublic static final String CCR_NAMESPACE_URI = \"uri:\" + CCR_NAMESPACE_URN;\n\t\n\t/**\n\t * Schema validation OFF - only unvalidated parsing performed.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_OFF = \"OFF\";\n\t/**\n\t * Schema validation LENIENT - CCRs are parsed; validation errors returned as warning messages but\n\t * processing proceeds.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_LENIENT = \"LENIENT\";\n\t\n\t/**\n\t * Schema validation STRICT - Any schema validation failures return an error.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_STRICT = \"STRICT\";\n\n}",
"public interface CentralConfRegistryService {\n void set(String key, Object value) throws ServiceException;\n\n void set(String key, Object value, String description) throws ServiceException;\n\n Object get(String key) throws ServiceException;\n}",
"public manageDoc() {\r\r\r\n\r\r\r\n }",
"public DocumentumCoreServicesImpl() {\r\n\r\n\t\tIObjectService iObjService = null;\r\n\r\n\t\tif (this.objectService == null) {\r\n\r\n\t\t\tlogger.info(INFO_INICIANDO_EMC);\r\n\r\n\t\t\ttry {\r\n\r\n\t\t\t\tRepositoryIdentityConstants repositoryIdentityConstants = EMCDocumentumFactory\r\n\t\t\t\t\t\t.getConstants(RepositoryIdentityConstants.class);\r\n\r\n\t\t\t\tthis.setRepositoryIdentityConstants(repositoryIdentityConstants);\r\n\r\n\t\t\t\tContextFactory contextFactory = ContextFactory.getInstance();\r\n\r\n\t\t\t\tIServiceContext serviceContext = contextFactory.getContext();\r\n\t\t\t\tserviceContext.setRuntimeProperty(IServiceContext.USER_TRANSACTION_HINT, IServiceContext.TRANSACTION_REQUIRED);\r\n\t\t\t\tserviceContext.setRuntimeProperty(IServiceContext.PAYLOAD_PROCESSING_POLICY, \"PAYLOAD_FAIL_ON_EXCEPTION\");\r\n\r\n\t\t\t\tsetServiceContext(serviceContext);\r\n\r\n\t\t\t\tRepositoryIdentity repoId = new RepositoryIdentity();\r\n\r\n\t\t\t\trepoId.setRepositoryName(REPOSITORY_NAME);\r\n\r\n\t\t\t\trepoId.setUserName(USER_NAME);\r\n\r\n\t\t\t\trepoId.setPassword(USER_PASSWORD);\r\n\r\n\t\t\t\tgetServiceContext().addIdentity(repoId);\r\n\r\n\t\t\t\t//\t\tcontextFactory.register(getServiceContext());\r\n\r\n\t\t\t\t//iObjectService = ServiceFactory.getInstance().getRemoteService(IObjectService.class, serviceContext, MODULE_NAME, DFS_SERVICE_URL);\r\n\t\t\t\tiObjService = ServiceFactory.getInstance().getLocalService(IObjectService.class, serviceContext);\r\n\r\n\t\t\t\tlogger.info(INFO_CONEXAO_EMC);\r\n\r\n\t\t\t\tthis.objectService = iObjService;\r\n\r\n\t\t\t} catch (ServiceInvocationException e) {\r\n\r\n\t\t\t\tlogger.error(ERROR_CONEXAO_EMC.concat(e.getLocalizedMessage()));\r\n\r\n\t\t\t}\r\n\r\n\t\t\tthis.setObjectService(iObjService);\r\n\t\t}\r\n\r\n\t}",
"public interface ConsumerAdminOperations\n{\n\t/* constants */\n\t/* operations */\n\torg.omg.CosEventChannelAdmin.ProxyPushSupplier obtain_push_supplier();\n\torg.omg.CosEventChannelAdmin.ProxyPullSupplier obtain_pull_supplier();\n}",
"public interface RESTDocument {\n\n}",
"public interface CdapFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tCdapFactory eINSTANCE = org.openecomp.dcae.controller.service.cdap.impl.CdapFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Service</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Service</em>'.\n\t * @generated\n\t */\n\tCdapService createCdapService();\n\n\t/**\n\t * Returns a new object of class '<em>Service Instance</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Service Instance</em>'.\n\t * @generated\n\t */\n\tCdapServiceInstance createCdapServiceInstance();\n\n\t/**\n\t * Returns a new object of class '<em>Application</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Application</em>'.\n\t * @generated\n\t */\n\tCdapApplication createCdapApplication();\n\n\t/**\n\t * Returns a new object of class '<em>Artifact</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Artifact</em>'.\n\t * @generated\n\t */\n\tCdapArtifact createCdapArtifact();\n\n\t/**\n\t * Returns a new object of class '<em>Service Instance Configuration</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Service Instance Configuration</em>'.\n\t * @generated\n\t */\n\tCdapServiceInstanceConfiguration createCdapServiceInstanceConfiguration();\n\n\t/**\n\t * Returns a new object of class '<em>Internal Application Configuration</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Internal Application Configuration</em>'.\n\t * @generated\n\t */\n\tCdapInternalApplicationConfiguration createCdapInternalApplicationConfiguration();\n\n\t/**\n\t * Returns a new object of class '<em>Service Descriptor</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Service Descriptor</em>'.\n\t * @generated\n\t */\n\tCdapServiceDescriptor createCdapServiceDescriptor();\n\n\t/**\n\t * Returns a new object of class '<em>Load Artifact Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Load Artifact Step</em>'.\n\t * @generated\n\t */\n\tCdapLoadArtifactStep createCdapLoadArtifactStep();\n\n\t/**\n\t * Returns a new object of class '<em>Load Artifact With Config Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Load Artifact With Config Step</em>'.\n\t * @generated\n\t */\n\tCdapLoadArtifactWithConfigStep createCdapLoadArtifactWithConfigStep();\n\n\t/**\n\t * Returns a new object of class '<em>Create App Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Create App Step</em>'.\n\t * @generated\n\t */\n\tCdapCreateAppStep createCdapCreateAppStep();\n\n\t/**\n\t * Returns a new object of class '<em>Create App With Config Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Create App With Config Step</em>'.\n\t * @generated\n\t */\n\tCdapCreateAppWithConfigStep createCdapCreateAppWithConfigStep();\n\n\t/**\n\t * Returns a new object of class '<em>Deploy App Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Deploy App Step</em>'.\n\t * @generated\n\t */\n\tCdapDeployAppStep createCdapDeployAppStep();\n\n\t/**\n\t * Returns a new object of class '<em>Stop Flow Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Stop Flow Step</em>'.\n\t * @generated\n\t */\n\tCdapStopFlowStep createCdapStopFlowStep();\n\n\t/**\n\t * Returns a new object of class '<em>Stop Worker Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Stop Worker Step</em>'.\n\t * @generated\n\t */\n\tCdapStopWorkerStep createCdapStopWorkerStep();\n\n\t/**\n\t * Returns a new object of class '<em>Stop Service Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Stop Service Step</em>'.\n\t * @generated\n\t */\n\tCdapStopServiceStep createCdapStopServiceStep();\n\n\t/**\n\t * Returns a new object of class '<em>Stop App Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Stop App Step</em>'.\n\t * @generated\n\t */\n\tCdapStopAppStep createCdapStopAppStep();\n\n\t/**\n\t * Returns a new object of class '<em>Start Flow Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Start Flow Step</em>'.\n\t * @generated\n\t */\n\tCdapStartFlowStep createCdapStartFlowStep();\n\n\t/**\n\t * Returns a new object of class '<em>Start Worker Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Start Worker Step</em>'.\n\t * @generated\n\t */\n\tCdapStartWorkerStep createCdapStartWorkerStep();\n\n\t/**\n\t * Returns a new object of class '<em>Start Service Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Start Service Step</em>'.\n\t * @generated\n\t */\n\tCdapStartServiceStep createCdapStartServiceStep();\n\n\t/**\n\t * Returns a new object of class '<em>Start App Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Start App Step</em>'.\n\t * @generated\n\t */\n\tCdapStartAppStep createCdapStartAppStep();\n\n\t/**\n\t * Returns a new object of class '<em>Delete App Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Delete App Step</em>'.\n\t * @generated\n\t */\n\tCdapDeleteAppStep createCdapDeleteAppStep();\n\n\t/**\n\t * Returns a new object of class '<em>Delete Artifact</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Delete Artifact</em>'.\n\t * @generated\n\t */\n\tCdapDeleteArtifact createCdapDeleteArtifact();\n\n\t/**\n\t * Returns a new object of class '<em>Suspend Schedule Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Suspend Schedule Step</em>'.\n\t * @generated\n\t */\n\tCdapSuspendScheduleStep createCdapSuspendScheduleStep();\n\n\t/**\n\t * Returns a new object of class '<em>Resume Schedule Step</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resume Schedule Step</em>'.\n\t * @generated\n\t */\n\tCdapResumeScheduleStep createCdapResumeScheduleStep();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tCdapPackage getCdapPackage();\n\n}",
"public interface I13nAct extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n/**\n * This method was generated for supporting the association named I13nAct2Agregate. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.StorageCard getAgregate() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * This method was generated for supporting the association named I13nAct2Agregate. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.StorageCardKey getAgregateKey() throws java.rmi.RemoteException;\n/**\n * \n * @return java.lang.Integer\n * @exception String The exception description.\n */\njava.lang.Integer getAgregateresource() throws java.rmi.RemoteException;\n/**\n * \n * @return java.lang.String\n * @exception String The exception description.\n */\njava.lang.String getAgregateserial() throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nActResourceSet2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic java.util.Enumeration getI13nActResourceSet() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * This method was generated for supporting the association named I13nDateSaving2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic java.util.Enumeration getI13nDateSaving() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * \n * @return java.lang.Boolean\n * @exception String The exception description.\n */\njava.lang.Boolean getRecalcagrprice() throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Techstuff. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.Worker getTechStuff() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * This method was generated for supporting the association named I13nAct2Techstuff. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Agregate. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid privateSetAgregateKey(com.hps.july.persistence.StorageCardKey inKey) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Techstuff. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nActResourceSet2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondaryAddI13nActResourceSet(com.hps.july.persistence.I13nActResourceSet anI13nActResourceSet) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nDateSaving2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondaryAddI13nDateSaving(com.hps.july.persistence.I13nDateSaving anI13nDateSaving) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nActResourceSet2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondaryRemoveI13nActResourceSet(com.hps.july.persistence.I13nActResourceSet anI13nActResourceSet) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nDateSaving2I13nAct. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondaryRemoveI13nDateSaving(com.hps.july.persistence.I13nDateSaving anI13nDateSaving) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Agregate. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid secondarySetAgregate(com.hps.july.persistence.StorageCard anAgregate) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Techstuff. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid secondarySetTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Agregate. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid setAgregate(com.hps.july.persistence.StorageCard anAgregate) throws java.rmi.RemoteException;\n/**\n * \n * @return void\n * @param newValue java.lang.Integer\n * @exception String The exception description.\n */\nvoid setAgregateresource(java.lang.Integer newValue) throws java.rmi.RemoteException;\n/**\n * \n * @return void\n * @param newValue java.lang.String\n * @exception String The exception description.\n */\nvoid setAgregateserial(java.lang.String newValue) throws java.rmi.RemoteException;\n/**\n * \n * @return void\n * @param newValue java.lang.Boolean\n * @exception String The exception description.\n */\nvoid setRecalcagrprice(java.lang.Boolean newValue) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named I13nAct2Techstuff. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid setTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;\n}",
"public interface CfgAntenna extends javax.ejb.EJBObject, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n\n\n\n\n\t/**\n\t * Get accessor for persistent attribute: resource\n\t */\n\tpublic int getResource() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: resource\n\t */\n\tpublic void setResource(int newResource) throws java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: num_ant\n\t */\n\tpublic java.lang.String getNum_ant() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: num_ant\n\t */\n\tpublic void setNum_ant(java.lang.String newNum_ant)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: kind_ant\n\t */\n\tpublic java.lang.String getKind_ant() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: kind_ant\n\t */\n\tpublic void setKind_ant(java.lang.String newKind_ant)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: nakl\n\t */\n\tpublic java.math.BigDecimal getNakl() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: nakl\n\t */\n\tpublic void setNakl(java.math.BigDecimal newNakl)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: az_ant\n\t */\n\tpublic java.math.BigDecimal getAz_ant() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: az_ant\n\t */\n\tpublic void setAz_ant(java.math.BigDecimal newAz_ant)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: kswn\n\t */\n\tpublic java.math.BigDecimal getKswn() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: kswn\n\t */\n\tpublic void setKswn(java.math.BigDecimal newKswn)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: h_set1\n\t */\n\tpublic java.math.BigDecimal getH_set1() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: h_set1\n\t */\n\tpublic void setH_set1(java.math.BigDecimal newH_set1)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: len_cable\n\t */\n\tpublic java.math.BigDecimal getLen_cable() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: len_cable\n\t */\n\tpublic void setLen_cable(java.math.BigDecimal newLen_cable)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: cableres\n\t */\n\tpublic java.lang.Integer getCableres() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: cableres\n\t */\n\tpublic void setCableres(java.lang.Integer newCableres)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: equipment\n\t */\n\tpublic int getEquipment() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: equipment\n\t */\n\tpublic void setEquipment(int newEquipment) throws java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: az_variation\n\t */\n\tpublic java.lang.String getAz_variation() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: az_variation\n\t */\n\tpublic void setAz_variation(java.lang.String newAz_variation)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: nakl_variation\n\t */\n\tpublic java.lang.String getNakl_variation()\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: nakl_variation\n\t */\n\tpublic void setNakl_variation(java.lang.String newNakl_variation)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: input_power\n\t */\n\tpublic java.math.BigDecimal getInput_power()\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: input_power\n\t */\n\tpublic void setInput_power(java.math.BigDecimal newInput_power)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: operator\n\t */\n\tpublic java.lang.Integer getOperator() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: operator\n\t */\n\tpublic void setOperator(java.lang.Integer newOperator)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: byhand\n\t */\n\tpublic java.lang.Boolean getByhand() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: byhand\n\t */\n\tpublic void setByhand(java.lang.Boolean newByhand)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: groundresource\n\t */\n\tpublic java.lang.Integer getGroundresource()\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: groundresource\n\t */\n\tpublic void setGroundresource(java.lang.Integer newGroundresource)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: groundcnt\n\t */\n\tpublic java.lang.Integer getGroundcnt() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: groundcnt\n\t */\n\tpublic void setGroundcnt(java.lang.Integer newGroundcnt)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: locationtype\n\t */\n\tpublic java.lang.String getLocationtype() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: locationtype\n\t */\n\tpublic void setLocationtype(java.lang.String newLocationtype)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: electricaltilt\n\t */\n\tpublic java.math.BigDecimal getElectricaltilt()\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: electricaltilt\n\t */\n\tpublic void setElectricaltilt(java.math.BigDecimal newElectricaltilt)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: StorageCard\n\t */\n\tpublic java.lang.Integer getStorageCard() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: StorageCard\n\t */\n\tpublic void setStorageCard(java.lang.Integer newStorageCard)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: qty\n\t */\n\tpublic java.math.BigDecimal getQty() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: qty\n\t */\n\tpublic void setQty(java.math.BigDecimal newQty)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: datasource\n\t */\n\tpublic int getDatasource() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: datasource\n\t */\n\tpublic void setDatasource(int newDatasource)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: ObjectStatus\n\t */\n\tpublic java.lang.String getObjectStatus() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: ObjectStatus\n\t */\n\tpublic void setObjectStatus(java.lang.String newObjectStatus)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * @return\n\t */\n\tpublic int getId_anten() throws java.rmi.RemoteException;\n\t/**\n\t * @return\n\t */\n\tpublic int getSavconfigid() throws java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: commcable\n\t */\n\tpublic java.lang.Boolean getCommcable() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: commcable\n\t */\n\tpublic void setCommcable(java.lang.Boolean newCommcable)\n\t\tthrows java.rmi.RemoteException;\n}",
"public interface IConfiguration extends ISessionAwareObject {\n\n\tString ENV_SOPECO_HOME = \"SOPECO_HOME\";\n\n\tString CONF_LOGGER_CONFIG_FILE_NAME = \"sopeco.config.loggerConfigFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION_FILE_NAME = \"sopeco.config.measurementSpecFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION = \"sopeco.config.measurementSpecification\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_URI = \"sopeco.config.measurementControllerURI\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_CLASS_NAME = \"sopeco.config.measurementControllerClassName\";\n\n\tString CONF_APP_NAME = \"sopeco.config.applicationName\";\n\n\tString CONF_MAIN_CLASS = \"sopeco.config.mainClass\";\n\n\tString CONF_MEC_ACQUISITION_TIMEOUT = \"sopeco.config.MECAcquisitionTimeout\";\n\n\n\tString CONF_MEC_SOCKET_RECONNECT_DELAY = \"sopeco.config.mec.reconnectDelay\";\n\n\tString CONF_HTTP_PROXY_HOST = \"sopeco.config.httpProxyHost\";\n\t\n\tString CONF_HTTP_PROXY_PORT = \"sopeco.config.httpProxyPort\";\n\n\t\n\tString CONF_DEFINITION_CHANGE_HANDLING_MODE = \"sopeco.config.definitionChangeHandlingMode\";\n\tString DCHM_ARCHIVE = \"archive\";\n\tString DCHM_DISCARD = \"discard\";\n\n\tString CONF_SCENARIO_DEFINITION_PACKAGE = \"sopeco.config.xml.scenarioDefinitionPackage\";\n\t/** Holds the path to the root folder of SoPeCo. */\n\tString CONF_APP_ROOT_FOLDER = \"sopeco.config.rootFolder\";\n\tString CONF_EXPERIMENT_EXECUTION_SELECTION = \"sopeco.engine.experimentExecutionSelection\";\n\t/**\n\t * Holds the path to the plugins folder, relative to the root folder of\n\t * SoPeCo.\n\t */\n\tString CONF_PLUGINS_DIRECTORIES = \"sopeco.config.pluginsDirs\";\n\n\tString CLA_EXTENSION_ID = \"org.sopeco.config.commandlinearguments\";\n\n\t/** Folder for configuration files relative to the application root folder */\n\tString DEFAULT_CONFIG_FOLDER_NAME = \"config\";\n\n\tString DEFAULT_CONFIG_FILE_NAME = \"sopeco-defaults.conf\";\n\n\tString DIR_SEPARATOR = \":\";\n\t\n\tString EXPERIMENT_RUN_ABORT = \"org.sopeco.experiment.run.abort\";\n\n\t/**\n\t * Export the configuration as a key-value map. Both, the default ones and the ones in the\n\t * system environment are included.\n\t * \n\t * @return a key-value representation of the configuration\n\t * \n\t * @deprecated Use {@code exportConfiguration()} and {@code exportDefaultConfiguration}.\n\t */\n\t@Deprecated\n\tMap<String, Object> getProperties();\n\t\n\t/**\n\t * Exports the configuration as a key-value map. The default configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportConfiguration();\n\t\n\t/**\n\t * Exports the default configuration as a key-value map. The actual configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportDefaultConfiguration();\n\t\n\t/**\n\t * Imports the configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Imports the default configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid overwriteConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the default configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the default configuration\n\t */\n\tvoid overwriteDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Returns the configured value of the given property in SoPeCo.\n\t * \n\t * It first looks up the current SoPeCo configuration, if there is no value\n\t * defined there, looks up the system properties, if no value is defined\n\t * there, then loads it from the default values; in case of no default\n\t * value, returns null.\n\t * \n\t * @param key\n\t * property key\n\t * @return Returns the configured value of the given property in SoPeCo.\n\t */\n\tObject getProperty(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a String.\n\t * \n\t * This method calls the {@link Object#toString()} of the property value and\n\t * is for convenience only. If the given property is not set, it returns\n\t * <code>null</code>.\n\t * \n\t * @param key\n\t * property key\n\t * \n\t * @see #getProperty(String)\n\t * @return Returns the configured value of the given property as a String.\n\t */\n\tString getPropertyAsStr(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a Boolean value.\n\t * \n\t * This method uses the {@link #getPropertyAsStr(String)} and interprets\n\t * values 'yes' and 'true' (case insensitive) as a Boolean <code>true</code>\n\t * value and all other values as <code>false</code>. If the value of the\n\t * given property is <code>null</code> it returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a boolean\n\t * \n\t * @see #getProperty(String)\n\t */\n\tboolean getPropertyAsBoolean(String key, boolean defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Long value.\n\t * \n\t * This method uses the {@link Long.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a long\n\t * \n\t * @see #getProperty(String)\n\t */\n\tlong getPropertyAsLong(String key, long defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Double value.\n\t * \n\t * This method uses the {@link Double.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a double\n\t * \n\t * @see #getProperty(String)\n\t */\n\tdouble getPropertyAsDouble(String key, double defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as an Integer value.\n\t * \n\t * This method uses the {@link Integer.#parseInt(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as an int\n\t * \n\t * @see #getProperty(String)\n\t */\n\tint getPropertyAsInteger(String key, int defaultValue);\n\n\t/**\n\t * Sets the value of a property for the current run.\n\t * \n\t * @param key\n\t * property key\n\t * @param value\n\t * property value\n\t */\n\tvoid setProperty(String key, Object value);\n\n\t/**\n\t * Clears the value of the given property in all layers of configuration,\n\t * including the system property environment.\n\t * \n\t * @param key the property\n\t */\n\tvoid clearProperty(String key);\n\n\t/**\n\t * Returns the default value (ignoring the current runtime configuration)\n\t * for a given property.\n\t * \n\t * @param key\n\t * porperty key\n\t * \n\t * @return Returns the default value for a given property.\n\t */\n\tObject getDefaultValue(String key);\n\n\t/**\n\t * Processes the given command line arguments, the effects of which will\n\t * reflect in the global property values.\n\t * \n\t * @param args\n\t * command line arguments\n\t * @throws ConfigurationException\n\t * if there is any problem with command line arguments\n\t */\n\tvoid processCommandLineArguments(String[] args) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadDefaultConfiguration(ClassLoader, String)} for loading\n\t * default configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * \n\t */\n\tvoid loadDefaultConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadDefaultConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadConfiguration(ClassLoader, String)} for loading default\n\t * configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finally the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Performs any post processing of configuration settings that may be\n\t * required.\n\t * \n\t * This method can be called after manually making changes to the\n\t * configuration values. It should be called automatically after a call to\n\t * {@link IConfiguration#loadConfiguration(String)}.\n\t */\n\tvoid applyConfiguration();\n\n\t/**\n\t * Sets the value of scenario description file name.\n\t * \n\t * @param fileName\n\t * file name\n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tvoid setScenarioDescriptionFileName(String fileName);\n\n\t/**\n\t * Sets the sceanrio description as the given object. This property in\n\t * effect overrides the value of scenario description file name (\n\t * {@link IConfiguration#CONF_SCENARIO_DESCRIPTION_FILE_NAME}).\n\t * \n\t * @param sceanrioDescription\n\t * an instance of a scenario description\n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tvoid setScenarioDescription(Object sceanrioDescription);\n\n\t/**\n\t * Sets the measurement controller URI.\n\t * \n\t * @param uriStr\n\t * a URI as an String\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tvoid setMeasurementControllerURI(String uriStr) throws ConfigurationException;\n\n\t/**\n\t * Sets the measurement controller class name. This also sets the\n\t * measurement controller URI to be '<code>class://[CLASS_NAME]</code>'.\n\t * \n\t * @param className\n\t * the full name of the class\n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tvoid setMeasurementControllerClassName(String className);\n\n\t/**\n\t * Sets the application name for this executable instance.\n\t * \n\t * @param appName\n\t * an application name\n\t */\n\tvoid setApplicationName(String appName);\n\n\t/**\n\t * Sets the main class that runs this thread. This will also be used in\n\t * finding the root folder\n\t * \n\t * @param mainClass\n\t * class to be set as main class\n\t */\n\tvoid setMainClass(Class<?> mainClass);\n\n\t/**\n\t * Sets the logger configuration file name and triggers logger\n\t * configuration.\n\t * \n\t * @param fileName\n\t * a file name\n\t */\n\tvoid setLoggerConfigFileName(String fileName);\n\n\t/**\n\t * @return Returns the application root directory.\n\t */\n\tString getAppRootDirectory();\n\n\t/**\n\t * Sets the application root directory to the given folder.\n\t * \n\t * @param rootDir\n\t * path to a folder\n\t */\n\tvoid setAppRootDirectory(String rootDir);\n\n\t/**\n\t * @return Returns the application's configuration directory.\n\t */\n\tString getAppConfDirectory();\n\n\t/**\n\t * @return Returns the value of scenario description file name.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tString getScenarioDescriptionFileName();\n\n\t/**\n\t * @return returns the sceanrio description as the given object.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tObject getScenarioDescription();\n\n\t/**\n\t * @return Returns the measurement controller URI.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tURI getMeasurementControllerURI();\n\n\t/**\n\t * @return Returns the measurement controller URI as a String.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tString getMeasurementControllerURIAsStr();\n\n\t/**\n\t * @return Returns the measurement controller class name.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tString getMeasurementControllerClassName();\n\n\t/**\n\t * @return Returns the application name for this executable instance.\n\t */\n\tString getApplicationName();\n\n\t/**\n\t * @return Returns the main class that runs this thread. This value must\n\t * have been set by a call to\n\t * {@link IConfiguration#setMainClass(Class)}.\n\t */\n\tClass<?> getMainClass();\n\n\t/**\n\t * Writes the current configuration values into a file.\n\t * \n\t * @param fileName\n\t * the name of the file\n\t * @throws IOException\n\t * if exporting the configuration fails\n\t */\n\tvoid writeConfiguration(String fileName) throws IOException;\n\n\t/**\n\t * Overrides the values of this configuration with those of the given\n\t * configuration.\n\t * \n\t * @param configuration\n\t * with the new values\n\t */\n\t void overwrite(IConfiguration configuration);\n\n\t /**\n\t * Adds a new command-line extension to the configuration component. \n\t * \n\t * The same extension will not be added twice. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void addCommandLineExtension(ICommandLineArgumentsExtension extension);\n\t \n\t /**\n\t * Removes a new command-line extension from the configuration component. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void removeCommandLineExtension(ICommandLineArgumentsExtension extension);\n}",
"public interface DocumentManager extends Manager {\n\n /* Document related properties */\n public static final String DOCUMENT_THUMBNAIL_PROPERTY = \"dell.document.thumbnail\";\n\n /**\n * Method to retrieve the the Document objects list\n *\n * @return - List of Document's\n */\n Collection<Document> getDocuments();\n\n\n /**\n * Method to retrieve the list of Document's using retailer siteID\n *\n * @param retailerSiteID\n * @return -Return the list of Document's with matching siteID\n * @see com.dell.acs.persistence.domain.RetailerSite\n */\n @Deprecated\n Collection<Document> getDocumentByRetailerSiteID(Long retailerSiteID);\n\n // Library page helper method\n @Deprecated\n Collection<Document> getLatestDocuments(Long retailerSiteID);\n\n public boolean doesDocumentExists(Document document);\n /* Document management related methods */\n\n\n /**\n * Method to persist the Document object\n *\n * @return - Return the document object\n */\n Document saveDocument(Document document) throws EntityExistsException;\n\n /**\n * Method to load the Document by ID\n *\n * @param documentID - Document ID\n * @return - Document object with ID = documentID\n */\n Document getDocument(Long documentID) throws EntityNotFoundException;\n\n /**\n * Method to delete a Document object by ID\n *\n * @param documentID - Document ID\n */\n void deleteDocument(Long documentID) throws EntityNotFoundException;\n\n /**\n * Method to get the BASECDN path for Document\n *\n * @param document\n * @return\n */\n String getBaseCDNPathForDocument(Document document);\n\n /**\n * To get the filtered documents.\n *\n * @param paramsMap\n * @return\n */\n List<Map<String, String>> getFilteredDocuments(Map<String, Object> paramsMap);\n\n\n // <======= New methods introduced in sprint 4 =======>\n\n /**\n Retrieve the published document.\n @param documentId, store the document id.\n @param type , store the document type.\n @return published document name.\n */\n @Deprecated\n String getDocumentNameByID(Long documentId,Integer type);\n\n /**\n Check the name existence , so that duplicate entry not allowed.\n It checks during ajax call.\n @param documentName , store the document name.\n @return boolean status , according to existence status.\n @throws NonUniqueResultException\n */\n @Deprecated\n boolean checkNameExistence(String documentName) throws NonUniqueResultException;\n\n /**\n * Method to load the Document by ID and type.\n *\n * @param documentID - Long - document ID\n * @return - Document object with ID = documentID\n * @throws - EntityNotFoundException - if document with given ID and type is not found.\n */\n Document getDocument(Long documentID, Integer type) throws EntityNotFoundException;\n\n /**\n * retrieve the documents on the basis of RetailerSite and source Type.\n *\n * @param retailerSiteID - Long - retailer site ID\n * @param type - Integer - Refer {@link com.dell.acs.content.EntityConstants}\n * @return Collection of {@link Document}\n */\n Collection<Document> getDocuments(Long retailerSiteID, Integer type, ServiceFilterBean filterBean);\n\n /**\n * retrieve the documents on the basis of RetailerSite Name and source Type.\n *\n * @param retailerSiteName - String - retailer site name\n * @param type - Integer - Refer {@link com.dell.acs.content.EntityConstants}\n * @return Collection of {@link}\n */\n Collection<Document> getDocuments(String retailerSiteName, Integer type, ServiceFilterBean filterBean);\n\n\n}",
"public abstract IOptions newDocumentOptions();",
"public interface DocbookFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tDocbookFactory eINSTANCE = ttc2019.live.docbook.impl.DocbookFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Doc Book</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Doc Book</em>'.\n\t * @generated\n\t */\n\tDocBook createDocBook();\n\n\t/**\n\t * Returns a new object of class '<em>Book</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Book</em>'.\n\t * @generated\n\t */\n\tBook createBook();\n\n\t/**\n\t * Returns a new object of class '<em>Article</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Article</em>'.\n\t * @generated\n\t */\n\tArticle createArticle();\n\n\t/**\n\t * Returns a new object of class '<em>Sect1</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Sect1</em>'.\n\t * @generated\n\t */\n\tSect1 createSect1();\n\n\t/**\n\t * Returns a new object of class '<em>Sect2</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Sect2</em>'.\n\t * @generated\n\t */\n\tSect2 createSect2();\n\n\t/**\n\t * Returns a new object of class '<em>Para</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Para</em>'.\n\t * @generated\n\t */\n\tPara createPara();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tDocbookPackage getDocbookPackage();\n\n}",
"public interface SysOfficeMService {\n\n String getOfficeIdByUser();\n}",
"public IPSDocument getContainer();",
"public conversorDOC(){\n }",
"public void setDocumentType (String DocumentType);",
"ISModifyConnector createISModifyConnector();",
"Map<String, Object> createConfig(VirtualHost vhost, String configtype, Map<String, Object> doc);",
"public interface AppBottomIconCfgService {\n\n AppBottomIConCfg getAppBottomIConCfgById(int id) throws Exception;\n\n PageInfo<AppBottomIConCfg> getAppBottomIConCfgByPage(int page_number, int page_size, String search_value) throws Exception;\n\n String insert(String message, String user_id) throws Exception;\n\n String update(String message, String user_id) throws Exception;\n\n int delete(int id) throws Exception;\n\n PageInfo<AppBottomIConCfg> getAppBottomIConCfgScreen(int page_number, int page_size, Map<String, String> map) throws Exception;\n\n AppBottomIConCfg getAppBottomIConCfgByCorp(String isactive, String corp_code) throws Exception;\n\n List<AppBottomIConCfg> getListByCorp(String isactive, String corp_code) throws Exception;\n\n\n}",
"public OpenDefinitionsDocument getDocument() { return _document; }",
"public interface IDocument {\n /**\n * Returns the content of the document, in a byte array.\n */\n byte[] getByteContent() throws IOException;\n /**\n * Returns the content of the document, in a char array.\n */\n char[] getCharContent() throws IOException;\n /**\n * returns the name of the document (e.g. its path for a <code>File</code>, or its relative path\n * in the workbench for an <code>IFile</code>).\n */\n String getName();\n /**\n * returns the value of the given property, or null if this document does not have\n * such a property.\n */\n String getProperty(String property);\n /**\n * Returns an enumeration of the names of the properties the document has.\n */\n java.util.Enumeration getPropertyNames();\n /**\n * Returns the content of the document, as a String.\n */\n public String getStringContent() throws IOException;\n /**\n * Returns the type of the document.\n */\n String getType();\n /**\n * Sets the given property of the document to the given value.\n */\n void setProperty(String attribute, String value); }",
"public void setDocumentType(String documentType);",
"public Gedcomx getDocument() {\n return doc;\n }",
"public interface IDocLibraryService {\r\n boolean add(DocLibrary doc);\r\n boolean del(String UUID);\r\n boolean set(DocLibrary doc);\r\n\r\n List<DocLibrary> getAll(String projectID);\r\n DocLibrary get(String UUID);\r\n}",
"public interface IModelDocumentProvider {\r\n\t/** \r\n\t * Locate an existing document or load it. Listen for future changes\r\n\t * to the document and to the file. \r\n\t * @param file full pathed file\r\n\t * @return IDocument instance; return null only if the file does not exist. \r\n\t */\r\n\tIDocument getDocument(File file);\r\n}",
"public interface GaewebFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tGaewebFactory eINSTANCE = gaeweb.impl.GaewebFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Admin Console</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Admin Console</em>'.\n\t * @generated\n\t */\n\tAdminConsole createAdminConsole();\n\n\t/**\n\t * Returns a new object of class '<em>Admin Console Page Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Admin Console Page Type</em>'.\n\t * @generated\n\t */\n\tAdminConsolePageType createAdminConsolePageType();\n\n\t/**\n\t * Returns a new object of class '<em>Appengine Web App Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Appengine Web App Type</em>'.\n\t * @generated\n\t */\n\tAppengineWebAppType createAppengineWebAppType();\n\n\t/**\n\t * Returns a new object of class '<em>Async Session Persistence Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Async Session Persistence Type</em>'.\n\t * @generated\n\t */\n\tAsyncSessionPersistenceType createAsyncSessionPersistenceType();\n\n\t/**\n\t * Returns a new object of class '<em>Automatic Scaling Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Automatic Scaling Type</em>'.\n\t * @generated\n\t */\n\tAutomaticScalingType createAutomaticScalingType();\n\n\t/**\n\t * Returns a new object of class '<em>Basic Scaling Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Basic Scaling Type</em>'.\n\t * @generated\n\t */\n\tBasicScalingType createBasicScalingType();\n\n\t/**\n\t * Returns a new object of class '<em>Class Loader Config Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Class Loader Config Type</em>'.\n\t * @generated\n\t */\n\tClassLoaderConfigType createClassLoaderConfigType();\n\n\t/**\n\t * Returns a new object of class '<em>Cpu Utilization Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Cpu Utilization Type</em>'.\n\t * @generated\n\t */\n\tCpuUtilizationType createCpuUtilizationType();\n\n\t/**\n\t * Returns a new object of class '<em>Document Root</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Document Root</em>'.\n\t * @generated\n\t */\n\tDocumentRoot createDocumentRoot();\n\n\t/**\n\t * Returns a new object of class '<em>Env Variables Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Env Variables Type</em>'.\n\t * @generated\n\t */\n\tEnvVariablesType createEnvVariablesType();\n\n\t/**\n\t * Returns a new object of class '<em>Env Var Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Env Var Type</em>'.\n\t * @generated\n\t */\n\tEnvVarType createEnvVarType();\n\n\t/**\n\t * Returns a new object of class '<em>Exclude Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Exclude Type</em>'.\n\t * @generated\n\t */\n\tExcludeType createExcludeType();\n\n\t/**\n\t * Returns a new object of class '<em>Http Header Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Http Header Type</em>'.\n\t * @generated\n\t */\n\tHttpHeaderType createHttpHeaderType();\n\n\t/**\n\t * Returns a new object of class '<em>Inbound Services Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Inbound Services Type</em>'.\n\t * @generated\n\t */\n\tInboundServicesType createInboundServicesType();\n\n\t/**\n\t * Returns a new object of class '<em>Include Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Include Type</em>'.\n\t * @generated\n\t */\n\tIncludeType createIncludeType();\n\n\t/**\n\t * Returns a new object of class '<em>Manual Scaling Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Manual Scaling Type</em>'.\n\t * @generated\n\t */\n\tManualScalingType createManualScalingType();\n\n\t/**\n\t * Returns a new object of class '<em>Pagespeed Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Pagespeed Type</em>'.\n\t * @generated\n\t */\n\tPagespeedType createPagespeedType();\n\n\t/**\n\t * Returns a new object of class '<em>Permission Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Permission Type</em>'.\n\t * @generated\n\t */\n\tPermissionType createPermissionType();\n\n\t/**\n\t * Returns a new object of class '<em>Priority Specifier Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Priority Specifier Type</em>'.\n\t * @generated\n\t */\n\tPrioritySpecifierType createPrioritySpecifierType();\n\n\t/**\n\t * Returns a new object of class '<em>Property Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Property Type</em>'.\n\t * @generated\n\t */\n\tPropertyType createPropertyType();\n\n\t/**\n\t * Returns a new object of class '<em>Resource Files Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resource Files Type</em>'.\n\t * @generated\n\t */\n\tResourceFilesType createResourceFilesType();\n\n\t/**\n\t * Returns a new object of class '<em>Setting Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Setting Type</em>'.\n\t * @generated\n\t */\n\tSettingType createSettingType();\n\n\t/**\n\t * Returns a new object of class '<em>Static Error Handlers</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Static Error Handlers</em>'.\n\t * @generated\n\t */\n\tStaticErrorHandlers createStaticErrorHandlers();\n\n\t/**\n\t * Returns a new object of class '<em>Static Error Handlers Handler</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Static Error Handlers Handler</em>'.\n\t * @generated\n\t */\n\tStaticErrorHandlersHandler createStaticErrorHandlersHandler();\n\n\t/**\n\t * Returns a new object of class '<em>Static Files Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Static Files Type</em>'.\n\t * @generated\n\t */\n\tStaticFilesType createStaticFilesType();\n\n\t/**\n\t * Returns a new object of class '<em>Static Include Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Static Include Type</em>'.\n\t * @generated\n\t */\n\tStaticIncludeType createStaticIncludeType();\n\n\t/**\n\t * Returns a new object of class '<em>System Properties Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>System Properties Type</em>'.\n\t * @generated\n\t */\n\tSystemPropertiesType createSystemPropertiesType();\n\n\t/**\n\t * Returns a new object of class '<em>User Permissions Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>User Permissions Type</em>'.\n\t * @generated\n\t */\n\tUserPermissionsType createUserPermissionsType();\n\n\t/**\n\t * Returns a new object of class '<em>Vm Health Check Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vm Health Check Type</em>'.\n\t * @generated\n\t */\n\tVmHealthCheckType createVmHealthCheckType();\n\n\t/**\n\t * Returns a new object of class '<em>Vm Settings Type</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vm Settings Type</em>'.\n\t * @generated\n\t */\n\tVmSettingsType createVmSettingsType();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tGaewebPackage getGaewebPackage();\n\n}",
"Map<String, Object> updateConfig(VirtualHost vhost, String configtype, String id, Map<String, Object> doc);",
"public interface INodeFileCabin {\r\n /**\r\n * Get Documents According to TransID or DataFlow\r\n * @param tIDorDataFlow String TRANS_ID or DATAFLOW_NAME\r\n * @param isTransID true if TransID, false if DataFlow\r\n * @return ClsNodeDocument[] FILE_CONTENT\r\n */\r\n public ClsNodeDocument[] GetDocuments (String tIDorDataFlow, boolean isTransID);\r\n\r\n /**\r\n * Get Documents According to Names in ClsNodeDocument[]\r\n * @param searchDocs ClsNodeDocument[] Search Criteria\r\n * @return ClsNodeDocument[] FILE_CONTENT\r\n */\r\n public ClsNodeDocument[] GetDocuments (ClsNodeDocument[] searchDocs);\r\n\r\n /**\r\n * Get Documents According to TransID and DataFlow\r\n * @param transID String TRANS_ID\r\n * @param dataFlow String DATAFLOW_NAME\r\n * @return ClsNodeDocument[] FILE_CONTENT\r\n */\r\n public ClsNodeDocument[] GetDocuments (String transID, String dataFlow);\r\n\r\n /**\r\n * Get Documents According to TransID and DataFlow\r\n * @param transID String TRANS_ID\r\n * @param dataFlow String DATAFLOW_NAME\r\n * @param searchDocs ClsNodeDocument[] FILE_NAME\r\n * @return ClsNodeDocument[] FILE_CONTENT\r\n */\r\n public ClsNodeDocument[] GetDocuments (String transID, String dataFlow, ClsNodeDocument[] searchDocs);\r\n\r\n /**\r\n * Get Documents According to TransID and DataFlow\r\n * @param transID String TRANS_ID\r\n * @param dataFlow String DATAFLOW_NAME\r\n * @param operation String OPERATION_NAME\r\n * @param searchDocs ClsNodeDocument[] FILE_NAME\r\n * @return ClsNodeDocument[] FILE_CONTENT\r\n */\r\n public ClsNodeDocument[] GetDocuments (String transID, String dataFlow,String[] operationArr, ClsNodeDocument[] searchDocs);\r\n /**\r\n * Upload Documents to the Database\r\n * @param docs Documents to be upload (required)\r\n * @param transID String TRANS_ID (optional, although strongly recommended)\r\n * @param status String STATUS (optional)\r\n * @param dataFlow String DATAFLOW_NAME (optional)\r\n * @param submitURL String SUBMIT_URL (optional)\r\n * @param token String SUBMIT_TOKEN (optional)\r\n * @param submitted Date SUBMIT_DATE (optional)\r\n * @param submittedTS Timestamp SUBMIT_DATE (optional)\r\n * @return boolean true if successful, false otherwise\r\n */\r\n public boolean UploadDocuments (ClsNodeDocument[] docs, String transID, String status, String dataFlow, String submitURL, String token, Date submitted, Timestamp submittedTS, String user);\r\n\r\n /**\r\n * Upload Documents to the Database\r\n * @param docs Documents to be upload (required)\r\n * @param transID String TRANS_ID (optional, although strongly recommended)\r\n * @param status String STATUS (optional)\r\n * @param dataFlow String DATAFLOW_NAME (optional)\r\n * @param submitURL String SUBMIT_URL (optional)\r\n * @param token String SUBMIT_TOKEN (optional)\r\n * @param submitted Date SUBMIT_DATE (optional)\r\n * @param submittedTS Timestamp SUBMIT_DATE (optional)\r\n * @return boolean true if successful, false otherwise\r\n */\r\n public boolean UploadHugeDocuments (ClsNodeDocument[] docs, String transID, String status, String dataFlow, String submitURL, String token, Date submitted, Timestamp submittedTS, String user);\r\n\t// WI 22695\r\n /**\r\n * Upload Documents to the Database without delete the temp file\r\n * @param docs Documents to be upload (required)\r\n * @param transID String TRANS_ID (optional, although strongly recommended)\r\n * @param status String STATUS (optional)\r\n * @param dataFlow String DATAFLOW_NAME (optional)\r\n * @param submitURL String SUBMIT_URL (optional)\r\n * @param token String SUBMIT_TOKEN (optional)\r\n * @param submitted Date SUBMIT_DATE (optional)\r\n * @param submittedTS Timestamp SUBMIT_DATE (optional)\r\n * @return boolean true if successful, false otherwise\r\n */\r\n public boolean UploadHugeDocumentsWithoutDelete (ClsNodeDocument[] docs, String transID, String status, String dataFlow, String submitURL, String token, Date submitted, Timestamp submittedTS, String user);\r\n /**\r\n * Query Documents\r\n * @param transID String TRANS_ID\r\n * @param dataFlow String DATAFLOW_NAME\r\n * @param names String[] Search Names\r\n * @return XmlDocument Return Result, null if no documents found\r\n */\r\n public XmlDocument QueryDocs (String transID, String dataFlow, String[] names);\r\n\r\n /**\r\n * Search Documents\r\n * @param docName String\r\n * @param transID String\r\n * @param domainName String\r\n * @param opName String\r\n * @param start Date\r\n * @param end Date\r\n * @return Document[]\r\n */\r\n public Document[] SearchDocuments (String docName, String transID, String domainName, String opName, Date start, Date end, String[] adminDomains, String version_no);\r\n\r\n /**\r\n * Get Unique Operations\r\n * @param domains String[] Domains Admin has rights to, null for all operations\r\n * @return String[]\r\n */\r\n public String[] GetOperationNames (String[] domains);\r\n\r\n /**\r\n * Get Document\r\n * @param fileID int\r\n * @return Document\r\n */\r\n public Document GetDocument (int fileID);\r\n\r\n /**\r\n * Get Document\r\n * @param fileID int\r\n * @return Document\r\n * The content of Document object is the temporary file path, not real data\r\n */\r\n public Document GetHugeDocument (int fileID);\r\n\r\n /**\r\n * Remove Documents\r\n * @param fileIDs int[]\r\n * @return boolean\r\n */\r\n public boolean RemoveDocuments (int[] fileIDs);\r\n\r\n /**\r\n * Remove Documents\r\n * @param transID String\r\n * @param names String[]\r\n * @return boolean\r\n */\r\n public boolean RemoveDocuments (String transID, String[] names);\r\n\r\n /**\r\n * Get Document Transanction ID\r\n * @param fileID int\r\n * @return Document\r\n */\r\n public String GetDocumentTransactionID (int fileID);\r\n\r\n /**\r\n * SaveDocument\r\n * @param fileID\r\n * @param transID\r\n * @param fileName\r\n * @param fileType\r\n * @param status\r\n * @param dataFlow\r\n * @param submitURL\r\n * @param submitToken\r\n * @param submitDate\r\n * @param content\r\n * @param user\r\n * @return String\r\n */\r\n public String SaveDocument (int fileID, String transID, String fileName, String fileType, String status, String dataFlow,\r\n String submitURL, String submitToken, Date submitDate, byte[] content, String user);\r\n\r\n /**\r\n * SaveDocument\r\n * @param fileID\r\n * @param documentID\r\n * @param transID\r\n * @param fileName\r\n * @param fileType\r\n * @param status\r\n * @param dataFlow\r\n * @param submitURL\r\n * @param submitToken\r\n * @param submitDate\r\n * @param content\r\n * @param user\r\n * @return String\r\n */\r\n public String SaveDocument (int fileID, String documentID,String transID, String fileName, String fileType, String status, String dataFlow,\r\n String submitURL, String submitToken, Date submitDate, byte[] content, String user);\r\n}",
"public interface StockFactory extends StockFactoryOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity\n{\n}",
"public G2Definition getDefinition () throws G2AccessException;",
"public interface ReferencesFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tReferencesFactory eINSTANCE = org.servicifi.gelato.language.cobol.references.impl.ReferencesFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Special Names Condition Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Special Names Condition Name Reference</em>'.\n\t * @generated\n\t */\n\tSpecialNamesConditionNameReference createSpecialNamesConditionNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>File Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>File Name Reference</em>'.\n\t * @generated\n\t */\n\tFileNameReference createFileNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Index Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Index Name Reference</em>'.\n\t * @generated\n\t */\n\tIndexNameReference createIndexNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Mnemonic Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Mnemonic Name Reference</em>'.\n\t * @generated\n\t */\n\tMnemonicNameReference createMnemonicNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Alphabet Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Alphabet Name Reference</em>'.\n\t * @generated\n\t */\n\tAlphabetNameReference createAlphabetNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Condition Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Condition Name Reference</em>'.\n\t * @generated\n\t */\n\tConditionNameReference createConditionNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Data Name Reference</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Data Name Reference</em>'.\n\t * @generated\n\t */\n\tDataNameReference createDataNameReference();\n\n\t/**\n\t * Returns a new object of class '<em>Identifier Reference Qualifier</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Identifier Reference Qualifier</em>'.\n\t * @generated\n\t */\n\tIdentifierReferenceQualifier createIdentifierReferenceQualifier();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tReferencesPackage getReferencesPackage();\n\n}",
"public interface CustomerInfo extends EObject {\n\t/**\n\t * Returns the name of the customer associated to the booking reference\n\t * @model dataType=\"types.String\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCustomerName(String bookingRef);\n\n\t/**\n\t * Returns the last name of the customer associated to the booking reference\n\t * @model dataType=\"types.String\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCustomerLastName(String bookingRef);\n\n\t/**\n\t * Returns the age of the customer associated to the booking reference. \n\t * Returns -1 if the booking reference does not exist.\n\t * @model dataType=\"types.Integer\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tint getCustomerAge(String bookingRef);\n\n\t/**\n\t * Returns the email of the customer associated to the booking reference\n\t * @model dataType=\"types.String\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */ \n\tString getCustomerEmail(String bookingRef);\n\n\t/**\n\t * Returns the ccnr of the bank card associated to the booking reference\n\t * @model dataType=\"types.Integer\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCcNr(String bookingRef);\n\n\t/**\n\t * Returns the ccv of the bank card associated to the booking reference\n\t * @model dataType=\"types.Integer\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCcV(String bookingRef);\n\n\t/**\n\t * Returns the expiry month of the bank card associated to the booking reference\n\t * @model dataType=\"types.Integer\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tint getExpMonth(String bookingRef);\n\n\t/**\n\t * Returns the expiry year of the bank card associated to the booking reference\n\t * @model dataType=\"types.Integer\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tint getExpYear(String bookingRef);\n\n\t/**\n\t * Returns the first name of the bank card associated to the booking reference\n\t * @model dataType=\"types.String\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCardFirstName(String bookingRef);\n\n\t/**\n\t * Returns the last name of the bank card associated to the booking reference\n\t * @model dataType=\"types.String\" required=\"true\" ordered=\"false\" bookingRefDataType=\"types.String\" bookingRefRequired=\"true\" bookingRefOrdered=\"false\"\n\t * @generated NOT\n\t */\n\tString getCardLastName(String bookingRef);\n\n}",
"public interface ProcessDefinitionSer {\n /**\n * 查询流程定义\n */\n public List<TempDefi> queryDefinition();\n\n /**\n * 删除流程定义\n */\n String deletlDefinition(String deployID);\n\n String downDefinitionPng(String deployID);\n}",
"public interface Calculadora extends CalculadoraOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \r\n{\r\n}",
"public interface InvoiceEntityHome\n extends javax.ejb.EJBHome\n{\n public static final String COMP_NAME=\"java:comp/env/ejb/InvoiceEntity\";\n public static final String JNDI_NAME=\"ejb/InvoiceEntity\";\n\n public com.csr.billing.ejb.InvoiceEntity create(com.csr.billing.ejb.InvoiceDTO invoice)\n throws javax.ejb.CreateException,java.rmi.RemoteException;\n\n public java.util.Collection findAll()\n throws javax.ejb.FinderException,java.rmi.RemoteException;\n\n public com.csr.billing.ejb.InvoiceEntity findByPrimaryKey(java.lang.Integer pk)\n throws javax.ejb.FinderException,java.rmi.RemoteException;\n\n}",
"public interface DispersionDataSource {\n\n}",
"public static void main(String[] args) {\n\t\tString realPath = getFileRealPath(\"config/docService.properties\");\n\t\tgetPropertiesConfigByResourceRealPath(realPath);\n\t\t\n\t}",
"public interface BackendBusinessObjectJCo extends BackendBusinessObject\n{\n\n\t/**\n\t * Returns a JCo connection to an SAP system. This is a default connection configured externally. <br />\n\t * The methods checks if the connection is valid. If it is invalid, it will be tried to rebuild the connection if\n\t * <ul>\n\t * <li>connection is of type JCoConnectionStateless</li>\n\t * <li>user ID from the old connection is the same as the user from EAI-Config.</li>\n\t * </ul>\n\t * The rebuild reads language from context and it will be used to complete the connection (the parameter user and\n\t * password are taken from an connection called JCoComplete which must be defined is sapcore-connection-spring.xml.\n\t * \n\t * @return JCo client connection to an SAP system\n\t * @throws BackendException\n\t * Backend Exception\n\t */\n\tpublic JCoConnection getDefaultJCoConnection() throws BackendException;\n\n\t/**\n\t * Set the defaultConnectionName.\n\t * \n\t * @param defaultConnectionName\n\t * default connection name to be set\n\t */\n\tpublic void setDefaultConnectionName(String defaultConnectionName);\n\n\t/**\n\t * Return the defaultConnectionName.\n\t * \n\t * @return defaultConnectionName\n\t */\n\tpublic String getDefaultConnectionName();\n\n}",
"public interface BeanFactory {\n\n// BeanDefinition getBeanDefinition(String beanID);\n\n Object getBean(String beanID);\n}",
"public int getC_DocTypeTarget_ID();",
"@SystemApi\n public interface IkeConfigRequest {}",
"@RemoteServiceRelativePath(\"attributeset\")\r\npublic interface AttributeSetService extends RemoteService {\r\n\t/**\r\n\t * Deletes a given set\r\n\t */\r\n\tpublic void delete(long setId) throws ServerException;\r\n\r\n\t/**\r\n\t * Creates or updates a set\r\n\t */\r\n\tpublic GUIAttributeSet save(GUIAttributeSet set) throws ServerException;\r\n\r\n\t/**\r\n\t * Loads a given set from the database\r\n\t */\r\n\tpublic GUIAttributeSet getAttributeSet(long setId) throws ServerException;\r\n\r\n\t/**\r\n\t * Saves the list of all possible options\r\n\t */\r\n\tpublic void saveOptions(long setId, String attribute, String[] values) throws ServerException;\r\n\r\n\t/**\r\n\t * Delete a selection of options\r\n\t */\r\n\tpublic void deleteOptions(long setId, String attribute, String[] values) throws ServerException;\r\n\r\n\t/**\r\n\t * Reads the contacts that are about to be imported from CSV\r\n\t */\r\n\tpublic String[] parseOptions(long setId, String attribute) throws ServerException;\r\n}",
"@Override\n public org.omg.CORBA.Object _get_interface_def()\n {\n if (interfaceDef != null)\n return interfaceDef;\n else\n return super._get_interface_def();\n }",
"public interface ResearchApplicationRemoteHome extends javax.ejb.EJBHome {\n \n \n \n /**\n *\n */\n org.tgdb.model.researchapplication.ResearchApplicationRemote findByPrimaryKey(Integer key) throws javax.ejb.FinderException, java.rmi.RemoteException;\n\n java.util.Collection findByProject(int pid) throws javax.ejb.FinderException, java.rmi.RemoteException;\n\n org.tgdb.model.researchapplication.ResearchApplicationRemote create(java.lang.String name, java.lang.String comm, int pid, int raid, TgDbCaller caller) throws javax.ejb.CreateException, java.rmi.RemoteException;\n\n Collection findByName(String name) throws javax.ejb.FinderException, java.rmi.RemoteException;\n\n Collection findByKeyword(Keyword keyword, TgDbCaller caller) throws javax.ejb.FinderException, java.rmi.RemoteException;\n \n}",
"public interface FMISComLocalHome extends javax.ejb.EJBLocalHome {\n\t/**\n\t * Creates a default instance of Session Bean: FMISBusiness\n\t */\n\tpublic FMISComLocal create() throws javax.ejb.CreateException;\n}",
"public interface EventDefinition extends EObject {\r\n}",
"public interface PropertyDefEntity extends javax.ejb.EJBLocalObject {\n\n /**\n * Returns a PropertyDefDto data transfer object containing all parameters of\n * this property definition instance.\n *\n * @return PropertyDefDto the data transfer object containing all parameters of this instance\n * @see #setDto\n */\n public PropertyDefDto getDto();\n\n /**\n * Sets all data members of this property definition instance to the values\n * from the specified data transfer object.\n *\n * @param dto PropertyDefDto the data transfer object containing the new\n * parameters for this instance\n * @see #getDto\n */\n public void setDto(PropertyDefDto dto);\n\n}",
"public interface DocumentProperties {\n\n /**\n * The character encoding used by the source XML document.\n */\n public interface Charset {\n public void setCharset(java.nio.charset.Charset charset);\n }\n}",
"public interface IListViewRecord {\r\n\r\n /**\r\n * element : columns of type {urn:partner.soap.sforce.com}ListViewRecordColumn\r\n * java type: com.sforce.soap.partner.ListViewRecordColumn[]\r\n */\r\n\r\n public com.sforce.soap.partner.IListViewRecordColumn[] getColumns();\r\n\r\n public void setColumns(com.sforce.soap.partner.IListViewRecordColumn[] columns);\r\n\r\n\r\n}",
"public interface ContactHome extends javax.ejb.EJBLocalHome {\n\t/**\n\t * Creates an instance from a key for Entity Bean: Contact\n\t */\n\tpublic com.vh.locker.ejb.Contact create(java.lang.Long id, java.lang.String name, java.lang.String nickName, java.lang.String phone, java.lang.String email, com.vh.locker.ejb.User anUser) throws javax.ejb.CreateException;\n\t\n /**\n\t * Finds an instance using a key for Entity Bean: Contact\n\t */\n\tpublic com.vh.locker.ejb.Contact findByPrimaryKey(java.lang.Long primaryKey) throws javax.ejb.FinderException;\n\tpublic java.util.Collection findByUser(java.lang.Long userId) throws javax.ejb.FinderException;\n}",
"public void setupBaseConvenienceObjects(MaintenanceDocument document);",
"public interface FacesConfig extends JSFConfigComponent, IdentifiableElement {\n \n /**\n * Property for <managed-bean> element\n */\n String MANAGED_BEAN = JSFConfigQNames.MANAGED_BEAN.getLocalName();\n /**\n * Property of <navigation-rule> element\n */\n String NAVIGATION_RULE = JSFConfigQNames.NAVIGATION_RULE.getLocalName();\n /**\n * Property of <converter> element\n */\n String CONVERTER = JSFConfigQNames.CONVERTER.getLocalName();\n \n /**\n * Property of <application> element\n */\n String APPLICATION = JSFConfigQNames.APPLICATION.getLocalName();\n \n /**\n * Property of <ordering> element\n */\n String ORDERING = JSFConfigQNames.ORDERING.getLocalName();\n \n /**\n * Property of <absolute-ordering> element\n */\n String ABSOLUTE_ORDERING =JSFConfigQNames.ABSOLUTE_ORDERING.getLocalName();\n \n /**\n * Property of <factory> element\n */\n String FACTORY =JSFConfigQNames.FACTORY.getLocalName();\n \n /**\n * Property of <component> element\n */\n String COMPONENT =JSFConfigQNames.FACTORY.getLocalName();\n \n /**\n * Property of <name> element.\n */\n String NAME = JSFConfigQNames.NAME.getLocalName();\n \n /**\n * Property of <referenced-bean> element.\n */\n String REFERENCED_BEAN = JSFConfigQNames.REFERENCED_BEAN.getLocalName();\n \n /**\n * Property of <referenced-bean> element.\n */\n String RENDER_KIT = JSFConfigQNames.RENDER_KIT.getLocalName();\n \n /**\n * Property of <lifecycle> element.\n */\n String LIFECYCLE= JSFConfigQNames.LIFECYCLE.getLocalName();\n \n /**\n * Property of <validator> element.\n */\n String VALIDATOR= JSFConfigQNames.VALIDATOR.getLocalName();\n \n /**\n * Property of <faces-config-extension> element.\n */\n String FACES_CONFIG_EXTENSION= JSFConfigQNames.FACES_CONFIG_EXTENSION.getLocalName();\n \n /**\n * Property of <behavior> element.\n */\n String BEHAVIOR= JSFConfigQNames.BEHAVIOR.getLocalName();\n \n \n /**\n * Attribute <metadata-complete> element.\n */\n String METADATA_COMPLETE = \"metadata-complete\"; // NOI18N\n \n /**\n * Attribute <version> element.\n */\n String VERSION = \"version\"; // NOI18N\n\n /**\n * Attribute <faces-flow-definition> element.\n */\n String FLOW_DEFINITION = JSFConfigQNames.FLOW_DEFINITION.getLocalName();\n\n /**\n * Attribute <protected-views> element.\n */\n String PROTECTED_VIEWS = JSFConfigQNames.PROTECTED_VIEWS.getLocalName();\n \n List<Ordering> getOrderings();\n void addOrdering(Ordering ordering);\n void removeOrdering(Ordering ordering);\n \n List<AbsoluteOrdering> getAbsoluteOrderings();\n void addAbsoluteOrdering(AbsoluteOrdering ordering);\n void removeAbsoluteOrdering(AbsoluteOrdering ordering);\n \n List<Factory> getFactories();\n void addFactories( Factory factory );\n void removeFactory( Factory factory );\n \n List<Component> getComponents();\n void addComponent( FacesComponent component );\n void removeComponent( FacesComponent component );\n \n List<Name> getNames();\n void addName( Name name );\n void removeName(Name name );\n \n List<ReferencedBean> getReferencedBeans();\n void addReferencedBean( ReferencedBean bean );\n void removeReferencedBean( ReferencedBean bean);\n \n List<RenderKit> getRenderKits();\n void addRenderKit( RenderKit kit );\n void removeRenderKit( RenderKit kit );\n \n List<Lifecycle> getLifecycles();\n void addLifecycle( Lifecycle lifecycle );\n void removeLifecycle( Lifecycle lifecycle );\n \n List<FacesValidator> getValidators();\n void addValidator( FacesValidator validator );\n void removeValidator( FacesValidator validator );\n \n List<FacesConfigExtension> getFacesConfigExtensions();\n void addFacesConfigExtension( FacesConfigExtension extension );\n void removeFacesConfigExtension( FacesConfigExtension extension );\n \n List<Converter> getConverters();\n void addConverter(Converter converter);\n void removeConverter(Converter converter);\n \n List <ManagedBean> getManagedBeans();\n void addManagedBean(ManagedBean bean);\n void removeManagedBean(ManagedBean bean);\n \n List<NavigationRule> getNavigationRules();\n void addNavigationRule(NavigationRule rule);\n void removeNavigationRule(NavigationRule rule);\n \n List<Application> getApplications();\n void addApplication(Application application);\n void removeApplication(Application application);\n \n List<FacesBehavior> getBehaviors();\n void addBehavior( FacesBehavior behavior );\n void removeBehavior( FacesBehavior behavior );\n\n List<FlowDefinition> getFlowDefinitions();\n void addFlowDefinition(FlowDefinition flowDefinition);\n void removeFlowDefinition(FlowDefinition flowDefinition);\n\n List<ProtectedViews> getProtectedViews();\n void addProtectedView(ProtectedViews protectedView);\n void removeProtectedView(ProtectedViews protectedView);\n \n void addFacesConfigElement( int index, FacesConfigElement element );\n List<FacesConfigElement> getFacesConfigElements();\n \n Boolean isMetaDataComplete();\n void setMetaDataComplete( Boolean isMetadataComplete);\n \n String getVersion();\n void setVersion(String version);\n}",
"public interface DocumentService {\n /**\n * 查找\n *\n * @return\n */\n DocumentPo findOne(Long id);\n\n DocumentPo findByUuid(String uuid);\n /**\n * 查找\n *\n * @return\n */\n List<DocumentPo> findAll();\n\n /**\n * 新增/更新\n *\n * @param documentPo\n * @return\n */\n DocumentPo save(DocumentPo documentPo);\n /**\n * 删除\n *\n * @param id\n */\n void delete(Long id);\n}",
"public interface ContainerColorDefinition extends EObject\n{\n}",
"public interface ApplicantDAO {\r\n\t/**\r\n\t *\r\n\t * @Method_Name addApplication\r\n\t * @Description adds Applicant\r\n\t * @Created_On Sep 15, 2012\r\n\t * @author sc804382\r\n\t * @param application\r\n\t * @throws UASException\r\n\t * \r\n\t * returns : boolean\r\n\t */\r\n\tpublic boolean addApplication(ApplicationBean application)\r\n\t\t\tthrows UASException;\r\n\r\n\t/**\r\n\t *\r\n\t * @Method_Name showStatus\r\n\t * @Description show applicant status\r\n\t * @Created_On Sep 15, 2012\r\n\t * @author sc804382\r\n\t * @param applicationId\r\n\t * @throws UASException\r\n\t * \r\n\t * returns : ApplicationBean\r\n\t */\r\n\tpublic ApplicationBean showStatus(String applicationId) throws UASException;\r\n}",
"public interface ConectorLocalHome extends javax.ejb.EJBLocalHome {\n\t/**\n\t * Creates an instance from a key for Entity Bean: Conector\n\t */\n\t static final String JNDI_NAME=\"ejb/co/com/telefonica/atiempo/ejb/eb/ConectorLocalHome\";\n\t \n\tpublic co.com.telefonica.atiempo.ejb.eb.ConectorLocal create(\n\t\tjava.lang.Integer cod_conector)\n\t\tthrows javax.ejb.CreateException;\n\t/**\n\t * Finds an instance using a key for Entity Bean: Conector\n\t */\n\tpublic co.com.telefonica.atiempo.ejb.eb.ConectorLocal findByPrimaryKey(\n\t\tco.com.telefonica.atiempo.ejb.eb.ConectorKey primaryKey)\n\t\tthrows javax.ejb.FinderException;\n}",
"public interface MarkupLanguage extends Component {\n\n String ROLE = \"org.apache.cocoon.components.language.markup.MarkupLanguage\";\n /**\n * Return the input document's encoding or <code>null</code> if it is the\n * platform's default encoding.\n * This method should be called after <code>generateCode<code> method.\n *\n * @return The input document's encoding\n */\n String getEncoding();\n\n /**\n * Generate source code from the input source for the target\n * <code>ProgrammingLanguage</code>.\n *\n * @param input The input source document\n * @param filename The input document's original filename\n * @param programmingLanguage The target programming language\n * @return The generated source code\n * @exception Exception If an error occurs during code generation\n */\n String generateCode(\n InputSource input, String filename,\n ProgrammingLanguage programmingLanguage,\n SourceResolver resolver\n ) throws Exception;\n}",
"public interface DataStoreIntegrityService {\n\t\n\t/**\n\t * The function expects 3 hashmaps to be available in RequestScope and a map of defaultValues for create/merge\n\t * Map<ModelNode,QName> -> 3 such maps for Create/Delete/Merge list of nodes. \n\t * Map<SchemaPath,String> -> a map of defaultValues. \n\t */\n\tpublic List<EditConfigRequest> createInternalEditRequests(EditConfigRequest sourceRequest, NetconfClientInfo clientInfo, DSValidationContext validationContext) throws GetAttributeException;\n}",
"@DISPID(-2147417094)\n @PropGet\n com4j.Com4jObject document();",
"public interface FreeMakerConfigurator {\r\n\r\n\t/**\r\n\t * @param servletContext the SERVLET context\r\n\t * @param configuration the FreeMaker defined configuration\r\n\t */\r\n\tvoid configure(ServletContext servletContext, Configuration configuration);\r\n}",
"public interface CommunityService extends WorkspaceService\r\n{\r\n\r\n static final String COMMUNITY_SERVICE_KEY = \"COMMUNITY_SERVICE_KEY\";\r\n\r\n /**\r\n * Creations of a Community object reference.\r\n * @param name the initial name to asign to the community\r\n * @param user_short_pid storage object short pid representing the owner\r\n * @return Community object reference\r\n * @exception CommunityException\r\n */\r\n Community createCommunity( String name, byte[] user_short_pid ) \r\n throws CommunityException;\r\n\r\n /**\r\n * Creations of a Community storage instance.\r\n * @param name the initial name to asign to the community\r\n * @param user_short_pid storage object short pid representing the owner\r\n * @return CommunityStorage community storage\r\n * @exception CommunityException\r\n */\r\n CommunityStorage createCommunityStorage( String name, byte[] user_short_pid ) \r\n throws CommunityException;\r\n\r\n /**\r\n * Creation of a Community object reference based on a supplied storage object.\r\n * @param store a community storage object\r\n * @return Community a Community object reference\r\n * @exception CommunityException\r\n */\r\n Community getCommunityReference( CommunityStorage store ) \r\n throws CommunityException;\r\n\r\n /**\r\n * Returns a reference to a Community given a persistent storage object identifier.\r\n * @param pid community short persistent identifier\r\n * @return Desktop the corresponding PID\r\n * @exception NotFound if the supplied pid does not matach a know desktop\r\n */\r\n Community getCommunityReference( byte[] pid )\r\n throws NotFound;\r\n\r\n}",
"DocBook createDocBook();",
"@Override\n\tpublic CmisBinding createCmisBinding() {\n\t\tSessionParameterMap parameters = new SessionParameterMap();\n\t\t//connect the file share repository\n\t\tparameters.setRepositoryId(Constants.REPO_ID);\n\t\tparameters.setBrowserBindingUrl(Constants.REPO_URL);\n\t\tparameters.setUserAndPassword(Constants.REPO_USERNAME, Constants.REPO_PASSWORD);\n\t\t//parameters.put(SessionParameter.BINDING_TYPE, \"browser\");\n\t\tparameters.put(SessionParameter.CONNECT_TIMEOUT, \"60000\");\n\t\tparameters.put(SessionParameter.READ_TIMEOUT, \"900000\");\n\n\t\tparameters.put(SessionParameter.HTTP_INVOKER_CLASS, DefaultHttpInvoker.class.getName());\n\t\tcmisBinding = CmisBindingFactory.newInstance().createCmisBrowserBinding(parameters);\n\t\treturn cmisBinding;\n\t}",
"public interface IControllerDocBuilder {\n\n /**\n * build api docs and return as string\n *\n * @param controllerNode\n * @return\n */\n String buildDoc(ControllerNode controllerNode) throws IOException;\n\n}",
"interface ISampleStoreForwardClient\n{\n /**\n * Service PID for Spillway service\n */\n public final static String SERVICE_PID = \"com.ge.dspmicro.sample.storeforwardclient\"; //$NON-NLS-1$\n\n /** Required Property key for storeforward name */\n public final static String STOREFORWARD = SERVICE_PID + \".storeforward\"; //$NON-NLS-1$\n\n}",
"public void setC_DocType_ID (int C_DocType_ID);",
"public void setC_DocType_ID (int C_DocType_ID);",
"public abstract String getDefinition();",
"public void newDocument();",
"public Smart_officeFactoryImpl() {\n\t\tsuper();\n\t}",
"public abstract ModuleDoc doc();",
"public interface IngestHandlerService extends Remote {\r\n\r\n String ingest(String xmlData, String resourceType, SecurityContext securityContext) throws EscidocException,\r\n RemoteException;\r\n\r\n String ingest(String xmlData, String resourceType, String authHandle, Boolean restAccess) throws EscidocException,\r\n RemoteException;\r\n\r\n}",
"public interface Form {\n\n\t/**\n\t * Gets the number of documents that use this Form and have been modified since a given Java date\n\t *\n\t * @param since\n\t * Date the method should compare against\n\t * @return int number of documents using this Form modified\n\t * @since org.openntf.domino 3.0.0\n\t */\n\tpublic int getModifiedNoteCount(final java.util.Date since);\n\n\t/**\n\t * Gets the XPage that this Form is set to launch on the web as ($XPageAlt field)\n\t *\n\t * @return String XPage to Form is designed to launch with on web\n\t * @since org.openntf.domino 4.5.0\n\t */\n\tpublic String getXPageAlt();\n\n\t/**\n\t * Gets the XPage that this Form is set to launch in the client as ($XPageAltClient field, if defined, else $XPageAlt)\n\t *\n\t * @return String XPage to Form is designed to launch with on client\n\t * @since org.openntf.domino 5.0.0\n\t */\n\tpublic String getXPageAltClient();\n\n\t/**\n\t * Generates a selection formula in format:\n\t *\n\t * <code>SELECT Form = \"myFormName\" | Form = \"myFormAlias\" | Form = \"myFormSecondAlias\" etc.</code>\n\t *\n\t * <p>\n\t * Continues for as many aliases as the Form has, not including aliases if none is defined.\n\t * </p>\n\t *\n\t * <p>\n\t * NOTE: Forms view in an NSF only displays the first alias of a design element, deisng element's properties box will shows all.\n\t * </p>\n\t *\n\t * @return String selection formula to access all Documents created with that Form\n\t * @since org.openntf.domino 3.0.0\n\t */\n\tpublic String getSelectionFormula();\n\n\t/**\n\t * Returns documents associated with this form\n\t *\n\t * @return Documents as a <code>NotesCollection</code>\n\t */\n\tpublic NoteCollection getNoteCollection();\n\n\t/**\n\t * Returns a Metaversal ID consisting of a replica ID of the parent database and a universal ID of this form.\n\t */\n\tpublic String getMetaversalID();\n\n}",
"public interface ConfigurationHandler extends Facet {\r\n\r\n\t/**\r\n\t * Called to request that the property associated with the passed in\r\n\t * identifier is changed to the value given by value.\r\n\t * \r\n\t * @param configurationIdentifier\r\n\t * the identifier associated with the property being changed.\r\n\t * @param value\r\n\t * the value the property is to be changed to.\r\n\t */\r\n\tpublic void valueChanged(ConfigurationIdentifier configurationIdentifier, Serializable value);\r\n\r\n\t/**\r\n\t * Nested class for service provider.\r\n\t * \r\n\t * @see org.openmaji.spi.MajiSPI\r\n\t */\r\n\tpublic class spi {\r\n\t\tpublic static String getIdentifier() {\r\n\t\t\treturn (\"configurationHandler\");\r\n\t\t};\r\n\t}\r\n}",
"public interface Configurable\t{\n\t/**\n\t *\tConfiguration files have changed.\n\t */\n\tpublic void reConfigure();\n}",
"public String getDocumentType();",
"OurIFC createOurIFC();",
"@UserScope\n@Component(modules = CreateRichDocModule.class,dependencies = NetComponent.class)\npublic interface CreateRichDocComponent {\n void inject(CreateRichDocActivity activity);\n}",
"public interface SimpleLogRemote extends javax.ejb.EJBObject, com.arexis.mugen.simplelog.SimpleLogRemoteBusiness {\n \n \n}",
"ServiceConfig getServiceConfig();",
"ServiceConfig getServiceConfig();",
"public interface TBizProjectDocService extends BaseService<TBizProjectDoc,TBizProjectDocExample>{\n\n PageParams<TBizProjectDoc> list(PageParams<TBizProjectDoc> pageParams);\n\n List<TBizProjectDoc> listAll();\n\n TBizProjectDoc findById(@NotNull Long id);\n\n Boolean del(List<Long> ids);\n\n Boolean saveOrUpdate(TBizProjectDoc bean);\n\n\n void saveOrUpdate(Long projectId,List<Long> docIds);\n\n\n List<Long> getDocIdsByProjectId(Long projectId);\n\n}",
"ServiceRemoteOffice() {\r\n\t\tsuper();\r\n\r\n\t\ttry {\r\n\t\t\tloadRemoteOfficeComponents();\r\n\t\t\tpopulateWithResourceBundleValues();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t}\r\n\t}",
"public interface StatusCodePropertiesEditionPart {\n\n\t/**\n\t * @return the number\n\t * \n\t */\n\tpublic String getNumber();\n\n\t/**\n\t * Defines a new number\n\t * @param newValue the new number to set\n\t * \n\t */\n\tpublic void setNumber(String newValue);\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t * \n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}",
"public interface ACSUIEditor {\n\n ACSUIEditable getEditable(SimpleRequestContext src);\n\n ACSUIEditable getEditable();\n\n ACSUIEditable updatetEditable(SimpleRequestContext src);\n\n ACSUIEditable insertEditable(SimpleRequestContext src);\n\n ACSUIEditable deleteEditable(SimpleRequestContext src);\n\n ACSUIEditable[] getEditables(SimpleRequestContext src);\n\n String[] getColNames();\n\n String getType();\n\n boolean[] checkInputData(ACSRequestContext ctx);\n\n String getManagmentLabel();\n\n String getAddLabel();\n\n String getUpdateLabel();\n\n}",
"public interface ScmFxConfiguration {\n\n void save(Profile.Section section);\n void load(Profile.Section section);\n\n}",
"public interface ICommInfo\n{\n /**\n * Entity Name for CommInfo.\n */\n public static final String ENTITY_NAME = \"CommInfo\";\n\n /**\n * FieldId for UId.\n */\n public static final Number UID = new Integer(0); // bigint(20)\n\n /**\n * FieldId for Name.\n */\n public static final Number NAME = new Integer(1); // varchar(30)\n\n /**\n * FieldId for Description.\n */\n public static final Number DESCRIPTION = new Integer(2); // varchar(80)\n\n /**\n * FieldId for isDefaultTpt.\n */\n public static final Number IS_DEFAULT_TPT = new Integer(3); // boolean\n\n /**\n * FieldId for HostName.\n */\n // public static final Number HOST = new Integer(4); // varchar(30)\n\n /**\n * FieldId for Port Number.\n */\n // public static final Number PORT = new Integer(5); // int(10)\n\n /**\n * FieldId for Protocol Type.\n */\n public static final Number PROTOCOL_TYPE = new Integer(4); // varchar(10)\n\n /**\n * FieldId for Version of Protocol.\n */\n // public static final Number PROTOCOL_VERSION = new Integer(7); // varchar(10)\n\n /**\n * FieldId for Version of Implementation.\n */\n public static final Number TPT_IMPL_VERSION = new Integer(5); // varchar(6)\n\n /**\n * FieldId for Protocol Specific Information.\n */\n //public static final Number PROTOCOL_DETAIL = new Integer(9); // text\n\n /**\n * FieldId for Reference Id.\n */\n public static final Number REF_ID = new Integer(6); // varchar(30)\n\n /**\n * FieldId for Version for this data.\n */\n public static final Number VERSION = new Integer(7); // double\n\n /**\n * FieldId for CanDelete flag .\n */\n public static final Number CAN_DELETE = new Integer(8); //Boolean\n\n /**\n * FieldId for Partner Category. A Integer.\n */\n\n public static final Number PARTNER_CAT = new Integer(9);\n\n /**\n * FieldId for ISDISABLE.\n */\n\n public static final Number IS_DISABLE = new Integer(10);\n\n /**\n * FieldId for isMaster. A Integer.\n */\n public static final Number IS_PARTNER = new Integer(11); //Boolean\n\n /**\n * FieldId for URL.\n */\n public static final Number URL = new Integer(12);\n\n /**\n * Static constant for TPTImplVersion.\n */\n public static final String DEFAULT_TPTIMPL_VERSION = \"030000\";\n\n /**\n * Constant value for protocol type.\n */\n public static final String JMS = \"JMS\";\n\n /**\n * Constant value for protocol type.\n */\n public static final String HTTP = \"HTTP\";\n\n /**\n * Constant value for protocol type.\n */\n public static final String SOAP = \"SOAP-HTTP\";\n\n /**\n * Constant value for protocol type.\n */\n public static final String UPC = \"UPC\";\n\n /**\n * Constant value for URL Format.\n */\n public static final String URL_FORMAT =\n \"protocol://[username:password@]host:port/URI\";\n}",
"public interface OmcSchemaManagementService {\n public void txnSchemaUpload(\n OmcEnvironment.Environment envionment,\n String schemaDir,\n boolean isClassAttrUpload,\n boolean isMenuUpload,\n boolean isLifeCycleUpload,\n boolean isEtcUpload,\n boolean isConstantUpload,\n boolean isTemporaryOnly,\n Map<String,String> schemaExcelScheet);\n public void synchronizeClassProcess(OmcEnvironment.Environment envionment, String propertyUtilClass, String objectRootVOClass);\n public void dumpTableScripts(OmcEnvironment.Environment envionment,boolean isFull, boolean includeCreateIndex, long targetDBMSType);\n public void txnInitialSchemaSetupMain(OmcEnvironment.Environment envionment,String defaultSite);\n //public void secondSchemaSetupMain(OmcEnvironment.Environment envionment);\n public void dumpIndexScriptsAll(OmcEnvironment.Environment envionment, boolean isParallelOption);\n}",
"public interface DocumentDataModel extends Serializable {\n\n\t/**\n\t * Create's a view for this DocumentComponent that is suitable for\n\t * embedding directly in a frame. The view must create its own\n\t * menubar if it needs one. Standard menus that are usable as-is\n\t * are passed as parameters.\n\t *\n\t * @param selection The selection listener that keeps \"Edit\" menu updated\n\t * @param editListener The listener that keeps the Undo/Redo menu item\n\t * and undo history up to date.\n\t * @param menuKeys The listener that handles menu keys\n\t * @param fileMenu the standard file menu\n\t * @param editMenu the standard edit menu\n\t * @return the view\n\t */\n\tComponent createRootGUI(AppMain app, Frame f,\n\t\t\tSelectionListener selection, UndoableEditListener editListener,\n\t\t\tKeyListener menuKeys, JMenu fileMenu, JMenu editMenu);\n\n}",
"public interface CurrentMaintenanceOperationIterator_I extends CurrentMaintenanceOperationIterator_IOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \n{\n}"
] | [
"0.7391268",
"0.5876425",
"0.5872359",
"0.5835512",
"0.579913",
"0.578919",
"0.5700039",
"0.5652099",
"0.5619815",
"0.5587669",
"0.5555799",
"0.5534209",
"0.55002946",
"0.5454021",
"0.54500985",
"0.53660053",
"0.5351399",
"0.5342349",
"0.5332401",
"0.5318576",
"0.5315826",
"0.527823",
"0.52512085",
"0.52309483",
"0.5220756",
"0.52133477",
"0.5202133",
"0.5176523",
"0.51713276",
"0.5164324",
"0.51426685",
"0.5114428",
"0.51126",
"0.5109983",
"0.5108882",
"0.510623",
"0.5104447",
"0.5101631",
"0.5097615",
"0.5097084",
"0.5087864",
"0.5085139",
"0.5083719",
"0.50809866",
"0.5079669",
"0.5065515",
"0.50525075",
"0.5048994",
"0.50443506",
"0.5031127",
"0.5030435",
"0.50253296",
"0.50184155",
"0.5001495",
"0.5000192",
"0.499583",
"0.49934953",
"0.49926227",
"0.49853203",
"0.49847364",
"0.49821794",
"0.498081",
"0.49801144",
"0.49789414",
"0.49708602",
"0.49700025",
"0.49654588",
"0.4956275",
"0.4956254",
"0.49561086",
"0.4954463",
"0.49498436",
"0.49495497",
"0.49486428",
"0.49476978",
"0.49471474",
"0.49471474",
"0.4942769",
"0.49383315",
"0.49342185",
"0.49318063",
"0.49255022",
"0.4924762",
"0.4923438",
"0.49187875",
"0.4916115",
"0.49097443",
"0.49094507",
"0.49059716",
"0.49057406",
"0.49057406",
"0.4904609",
"0.49045935",
"0.48965687",
"0.4895255",
"0.48904395",
"0.48902988",
"0.4889446",
"0.48883834",
"0.4886458"
] | 0.7720292 | 0 |
Get accessor for persistent attribute: savconfigidold | public int getSavconfigidold() throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface CfgDocument extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n\n\n\t/**\n\t * Get accessor for persistent attribute: savconfigidold\n\t */\n\tpublic int getSavconfigidold() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidold\n\t */\n\tpublic void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic int getSavconfigidnew() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storedem\n\t */\n\tpublic java.lang.Integer getStoredem() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storedem\n\t */\n\tpublic void setStoredem(java.lang.Integer newStoredem)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storebad\n\t */\n\tpublic java.lang.Integer getStorebad() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storebad\n\t */\n\tpublic void setStorebad(java.lang.Integer newStorebad)\n\t\tthrows java.rmi.RemoteException;\n}",
"public int getSavconfigidnew() throws java.rmi.RemoteException;",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;",
"public String getReadWriteAttribute();",
"public Integer getOidold() {\n return oidold;\n }",
"public abstract long getSdiId();",
"com.google.protobuf.Any getOldConfig();",
"public InstanceConfigId getId() {\n return id;\n }",
"public int getId() {\n\t\treturn config >> 8;\n\t}",
"@Nullable\n public String getOldAvatarId()\n {\n return getOldValue();\n }",
"@Id\n @WhereSQL(sql = \"id=:WxPayconfig_id\")\n public java.lang.String getId() {\n return this.id;\n }",
"String getOldStatusId();",
"public Object get_KeyValue(){return\t\t\t Id;}",
"public int get(int id) {\r\n return configurations[id];\r\n }",
"private Long getConfigId(ParentEntityNode getRelationId) {\n\t\treturn getRelationId.getLosConfigDetails().getConfigId();\n\t}",
"public String getConfigIdHash() {\n return configIdHash;\n }",
"public void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;",
"public Integer getAttrId() {\n return attrId;\n }",
"public String getAttributeValue(int id) {\n Attribute attr = super.findById(id, false);\n if (attr != null ) {\n return attr.getValue();\n } else {\n return \"unknown attribute\";\n }\n }",
"public java.lang.String getOldProperty_description(){\n return localOldProperty_description;\n }",
"String attributeToGetter(String name);",
"public int[] getSavedConfigurations() {\r\n return savedConfigurations;\r\n }",
"public String getATTR_ID() {\n return ATTR_ID;\n }",
"String attributeToSetter(String name);",
"protected String getConfigKey ()\n {\n return \"ConfigEditor.\" + ResourceUtil.getPrefsPrefix() + (_readOnly ? \".readonly\" : \"\");\n }",
"public Long getLongAttribute();",
"public abstract int getPersistence();",
"public String getId() {\n return (String)getAttributeInternal(ID);\n }",
"public String getId() {\n return (String)getAttributeInternal(ID);\n }",
"public String getConfigurationValue() {\n return newConfigValue;\n }",
"boolean isNewConfig();",
"public int getOldProperty_descriptionType(){\n return localOldProperty_descriptionType;\n }",
"@Override\n public ConfigRepositoryConfig getConfigRepositoryConfig(){\n outObject = \"getConfigRepositoryConfig\";\n try {\n out.writeObject(outObject);\n } catch (IOException ex) {\n }\n try {\n inObject = (ConfigRepositoryConfig) in.readObject();\n } catch (IOException | ClassNotFoundException ex) {\n }\n return (ConfigRepositoryConfig) inObject;\n }",
"public String getOriginalId()\r\n {\r\n return originalId;\r\n }",
"@XmlAttribute\n\tpublic Long getId() {\n\t\treturn id;\n\t}",
"default IEmfAttribute<?, V> getOriginalAttribute() {\n\n\t\treturn this;\n\t}",
"private Integer getId() { return this.id; }",
"public final int getId() {\n\t\treturn this.accessor.getId();\n\t}",
"public Integer getChangedSoc() {\n return changedSoc;\n }",
"public C getConfig()\n {\n return config;\n }",
"public abstract String getConfigElementName();",
"@Transient\n @Override\n public Integer getId()\n {\n return this.conservDescriptionId;\n }",
"public IAuditID getAuditID() {\n return this.auditID;\n }",
"public int getSaveVersion()\n {\n return saveVersion;\n }",
"com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();",
"public static native Element overwrite(String oldId, DomConfig config)/*-{\r\n\t\tvar configJS = config.@com.ait.toolkit.sencha.shared.client.dom.DomConfig::getJsObject()();\r\n\t\treturn $wnd.Ext.DomHelper.overwrite(oldId, configJS);\r\n\t}-*/;",
"@ApiModelProperty(required = true, value = \"Unique identifier of the configuration master.\")\n public Long getId() {\n return id;\n }",
"public long getConfId() {\n\t\treturn confId;\n\t}",
"@Override\n\tpublic Object getAttribute(String appKey,String contextpath, String sessionID, String attribute,Session session) {\n\t\tString _attribute = SessionUtil.wraperAttributeName(appKey,contextpath, attribute);\n\t\tObject value = sessionStore.getAttribute(appKey, contextpath, sessionID, _attribute,session);\n\t\tif(session.isStoreReadAttributes() && value != null && readcanstore( value))\n\t\t\tsession.modifyAttribute(_attribute, value, ModifyValue.type_data, ModifyValue.type_read);\t\n\t\treturn value;\n\t}",
"public int getInstanceID()\n {\n return super.getPersistenceID();\n }",
"public Object getOldValue()\n {\n return oldValue;\n }",
"public SimpleIntegerProperty getIDProperty(){ return id; }",
"public String getId ();",
"public String getId ();",
"@java.lang.Override\n public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() {\n return config_ == null\n ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance()\n : config_;\n }",
"public String getPropertyDACConfig();",
"public abstract Long getIdHistoricalWrapper();",
"public abstract String getConfig();",
"public int getM_AttributeSetInstance_ID();",
"public String getIdAttribute() {\n return idAttribute;\n }",
"public int getId()\r\n/* 75: */ {\r\n/* 76:110 */ return this.idAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI;\r\n/* 77: */ }",
"public int getId(){return id;}",
"public Object getConfig() {\n return config;\n }",
"public int getId(){ return id; }",
"public String getPluginIdAttr() {\n return pluginIdAttr;\n }",
"public Integer getId() { return this.id; }",
"public int getId()\r\n/* 69: */ {\r\n/* 70:103 */ return this.idAutorizacionEmpresaSRI;\r\n/* 71: */ }",
"com.google.protobuf.AnyOrBuilder getOldConfigOrBuilder();",
"public String getLegacyId() {\n return (String)getAttributeInternal(LEGACYID);\n }",
"public PersistenceType getNewPersistenceType(){\n return newPersistenceType;\n }",
"@Transient\n\t/**\n\t * @return the idInstituicao\n\t */\n\tpublic Integer getIdInstituicao() {\n\t\treturn idInstituicao;\n\t}",
"public String getId(){ return ID; }",
"public Long getId() {\n return super.getId();\n }",
"public String getConfigurationID() {\n return configurationID;\n }",
"public Integer getIntegerAttribute();",
"public String getId(){ return id.get(); }",
"public Long getLong(String attr) {\n return (Long) super.get(attr);\n }",
"SerializableState getData(Long id) throws RemoteException;",
"public Integer getId(){return id;}",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public String getId(){return id;}",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"ConfigData selectByPrimaryKey(Integer id);",
"public final Long save() {\n\t\tid = Ollie.save(this);\n\t\tOllie.putEntity(this);\n\t\tnotifyChange();\n\t\treturn id;\n\t}",
"public long getId() { return this.id; }"
] | [
"0.5825288",
"0.57949436",
"0.5779945",
"0.5779945",
"0.5779945",
"0.5779945",
"0.55945015",
"0.55628896",
"0.5477017",
"0.5452097",
"0.5392457",
"0.5293921",
"0.5290993",
"0.52271897",
"0.51614505",
"0.51523316",
"0.51393384",
"0.51209295",
"0.5116846",
"0.51110214",
"0.5056077",
"0.504621",
"0.5028874",
"0.50106305",
"0.50072664",
"0.50056857",
"0.500397",
"0.5001896",
"0.49900115",
"0.49811113",
"0.4974035",
"0.49712706",
"0.49712706",
"0.49575636",
"0.49328986",
"0.49280632",
"0.4926625",
"0.49237353",
"0.49226364",
"0.4910743",
"0.4900505",
"0.4896357",
"0.4895863",
"0.48958623",
"0.4889255",
"0.48781326",
"0.4872225",
"0.48623958",
"0.48533052",
"0.4845833",
"0.48448488",
"0.48346883",
"0.4829941",
"0.48152933",
"0.4815071",
"0.4810997",
"0.47990453",
"0.47990453",
"0.47929066",
"0.4788205",
"0.47876534",
"0.47874495",
"0.47757187",
"0.47736704",
"0.47703245",
"0.47677326",
"0.4764659",
"0.47628936",
"0.47583303",
"0.47582316",
"0.475771",
"0.47549185",
"0.47537827",
"0.47536263",
"0.47530434",
"0.47528145",
"0.4748359",
"0.47395182",
"0.47387555",
"0.4729853",
"0.47292852",
"0.47274262",
"0.47226703",
"0.47224712",
"0.47224712",
"0.47224712",
"0.47224712",
"0.47224712",
"0.47224712",
"0.4722412",
"0.47189292",
"0.47189292",
"0.47189292",
"0.47189292",
"0.47189292",
"0.47189292",
"0.47189292",
"0.4717579",
"0.4716525",
"0.47126955"
] | 0.6570331 | 0 |
Set accessor for persistent attribute: savconfigidold | public void setSavconfigidold(int newSavconfigidold)
throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getSavconfigidold() throws java.rmi.RemoteException;",
"public interface CfgDocument extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n\n\n\t/**\n\t * Get accessor for persistent attribute: savconfigidold\n\t */\n\tpublic int getSavconfigidold() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidold\n\t */\n\tpublic void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic int getSavconfigidnew() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storedem\n\t */\n\tpublic java.lang.Integer getStoredem() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storedem\n\t */\n\tpublic void setStoredem(java.lang.Integer newStoredem)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storebad\n\t */\n\tpublic java.lang.Integer getStorebad() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storebad\n\t */\n\tpublic void setStorebad(java.lang.Integer newStorebad)\n\t\tthrows java.rmi.RemoteException;\n}",
"public void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;",
"public int getSavconfigidnew() throws java.rmi.RemoteException;",
"String attributeToSetter(String name);",
"public abstract void setTica_id(java.lang.String newTica_id);",
"public abstract void setEspe_id(java.lang.Integer newEspe_id);",
"public void setId(String newValue);",
"public abstract void setIdpc(java.lang.String newIdpc);",
"public abstract void setAcma_id(java.lang.Long newAcma_id);",
"public void setOidold(Integer oidold) {\n this.oidold = oidold;\n }",
"public abstract void setCod_actividad(java.lang.Long newCod_actividad);",
"public void setOldProperty_description(java.lang.String param){\n localOldProperty_descriptionTracker = true;\n \n this.localOldProperty_description=param;\n \n\n }",
"public static native Element overwrite(String oldId, DomConfig config)/*-{\r\n\t\tvar configJS = config.@com.ait.toolkit.sencha.shared.client.dom.DomConfig::getJsObject()();\r\n\t\treturn $wnd.Ext.DomHelper.overwrite(oldId, configJS);\r\n\t}-*/;",
"public void changed() {\n // from ChangeHandler\n configSave.enable();\n }",
"@Override\r\n\tpublic int saveConfig(BaseConfig record) {\n\t\treturn baseConfigMapper.insertSelective(record);\r\n\t}",
"void setDatty(Datty newDatty);",
"public abstract void setCod_dpto(java.lang.String newCod_dpto);",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public abstract void setConfig(String config) throws java.rmi.RemoteException;",
"public Integer getOidold() {\n return oidold;\n }",
"public void setID(String newID)\r\n {\r\n id=newID;\r\n }",
"public void setId(int newId) {\n\tid = newId;\n}",
"public String getReadWriteAttribute();",
"void setProperty(String attribute, String value);",
"public abstract void setAtis(java.lang.Long newAtis);",
"void setId(int val);",
"@Override\r\n\tpublic void setId(String id) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic int updateConfig(BaseConfig record) {\n\t\treturn baseConfigMapper.updateByPrimaryKeySelective(record);\r\n\t}",
"@Override\n\tpublic void setConfigChanged(boolean changed) {\n\t\t//do nothing\n\t}",
"@Override\n\tpublic void setId(String id)\n\t{\n\t\t\n\t}",
"public void save() {\n if(persistenceType == PropertyPersistenceType.Persistent) {\n if (!isSetToDefault()) {\n permanentStore.setBoolean(key, get());\n } else {\n permanentStore.remove(key);\n }\n }\n }",
"public void changeAttrName() {\r\n }",
"public void setObject(String objId,String objValue) throws ExceptionAccessDeny, ExceptionObjectNotFound {\n\t\tConfVarEnum ParamNameAsEnum = ConfVarEnum.getByName(objId);\n\t\tif (! ParamNameAsEnum.getAccess().equalsIgnoreCase(\"rw\")) {\n\t\t\tthrow new ExceptionObjectNotFound(\"Config parameter \" + objId + \" is readonly.\");\n\t\t}\n\t\tconfigServ.setValue(ParamNameAsEnum, objValue);\t\n\t}",
"public abstract void setId(int id);",
"@Override\npublic void setAttributes() {\n\t\n}",
"int updateByPrimaryKey(MrpConfigSettingsEntity record);",
"public abstract void setCod_tecnico(java.lang.String newCod_tecnico);",
"private void saveConfiguration() {\n }",
"public abstract void setFecha_inicio(java.lang.String newFecha_inicio);",
"private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}",
"void setInt(int attributeValue);",
"public void setId(int driverDBId);",
"public void setM_Locator_ID (int M_Locator_ID)\n{\nset_Value (\"M_Locator_ID\", new Integer(M_Locator_ID));\n}",
"public String setter() {\n\t\treturn prefix(\"set\");\n\t}",
"@Override\n public void setConfig(Map<String, String> config) {\n if (parentDir != null) throw RaptureExceptionFactory.create(\"Calling setConfig twice is currently not supported\");\n\n String prefix = config.get(FileRepoUtils.PREFIX);\n if (StringUtils.trimToNull(prefix) == null) throw RaptureExceptionFactory.create(\"prefix must be specified\");\n parentDir = FileRepoUtils.ensureDirectory(prefix + \"_idgen\");\n\n init();\n }",
"@Override\n public void loadNewConfig(String newCfgName) {\n currentConfigFileName = newCfgName;\n mesoCfgXML = (SCANConfigMesoXML) readExistingConfig();\n createAttributeMap(getAttributes());\n }",
"public void valueChanged(ConfigurationIdentifier configurationIdentifier, Serializable value);",
"void setNilID();",
"@Override\r\n\t\tpublic void setId(String id)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"public abstract boolean updateConfig();",
"public boolean setProperty(String attName, Object value);",
"@Test\n public void test_setNetworkId() {\n String value = \"new_value\";\n instance.setNetworkId(value);\n\n assertEquals(\"'setNetworkId' should be correct.\",\n value, TestsHelper.getField(instance, \"networkId\"));\n }",
"com.google.protobuf.Any getOldConfig();",
"public void attributSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}",
"public void editConfig(DatabaseConfig databaseConfig) {\n }",
"public void setdat()\n {\n }",
"void setInternal(ATTRIBUTES attribute, Object iValue);",
"@Override\r\n\tpublic void setId(final K id) {\n\t\tsuper.setId(id);\r\n\t}",
"public void setModified();",
"int updateByPrimaryKeySelective(MrpConfigSettingsEntity record);",
"public void setConfig(C config)\n {\n this.config = config;\n fireConfigChanged();\n }",
"public void setNew();",
"public abstract void setNovedad(java.lang.String newNovedad);",
"public final void setNetId( String id) //final doesn't allow new rules or ways in door\r\n {\r\n netId = id; //only place I can do it in set methods\r\n }",
"void setAttributes(String path, Map<String, Object> newValue) throws IOException;",
"@Override\r\n\tpublic void resetPropertyValue(Object id) {\n\r\n\t}",
"@Override\r\n public void setsaleId(int saleid) {\n this.saleId = saleid;\r\n }",
"public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID);",
"void setId(int id) throws UnsupportedOperationException;",
"public void setId(String id)\r\n/* 19: */ {\r\n/* 20:17 */ this.id = id;\r\n/* 21: */ }",
"@Test\n public void testSetId_edificio() {\n System.out.println(\"setId_edificio\");\n int id_edificio = 1;\n DboEdificio instance = new DboEdificio(1, \"T-3\");\n instance.setId_edificio(id_edificio);\n \n }",
"@Override\n\tprotected boolean setSaveAttributes() throws Exception {\n\t\treturn false;\n\t}",
"int updateByPrimaryKey(ConfigData record);",
"private <T> void setIdGeneration(DeployBeanDescriptor<T> desc) {\n if (desc.getIdGenerator() != null) {\n // already assigned (So custom or UUID)\n return;\n }\n if (desc.idProperty() == null) {\n return;\n }\n final DeployIdentityMode identityMode = desc.getIdentityMode();\n if (identityMode.isSequence() && !dbIdentity.isSupportsSequence()) {\n // explicit sequence but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit sequence on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n if (identityMode.isIdentity() && !dbIdentity.isSupportsIdentity()) {\n // explicit identity but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit Identity on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n\n if (identityMode.isAuto()) {\n if (desc.isPrimaryKeyCompoundOrNonNumeric()) {\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n if (desc.isIdGeneratedValue() || config.isIdGeneratorAutomatic()) {\n // use IDENTITY or SEQUENCE based on platform\n identityMode.setPlatformType(dbIdentity.getIdType());\n } else {\n // externally/application supplied Id values\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n }\n\n if (desc.getBaseTable() == null) {\n // no base table so not going to set Identity or sequence information\n return;\n }\n\n if (identityMode.isIdentity()) {\n // used when getGeneratedKeys is not supported (SQL Server 2000, SAP Hana)\n String selectLastInsertedId = dbIdentity.getSelectLastInsertedId(desc.getBaseTable());\n String selectLastInsertedIdDraft = (!desc.isDraftable()) ? selectLastInsertedId : dbIdentity.getSelectLastInsertedId(desc.getDraftTable());\n desc.setSelectLastInsertedId(selectLastInsertedId, selectLastInsertedIdDraft);\n return;\n }\n\n if (identityMode.isSequence()) {\n String seqName = identityMode.getSequenceName();\n if (seqName == null || seqName.isEmpty()) {\n String primaryKeyColumn = desc.getSinglePrimaryKeyColumn();\n seqName = namingConvention.getSequenceName(desc.getBaseTable(), primaryKeyColumn);\n }\n int stepSize = desc.setIdentitySequenceBatchMode(databasePlatform.sequenceBatchMode());\n desc.setIdGenerator(createSequenceIdGenerator(seqName, stepSize));\n }\n }",
"@Nullable\n public String getOldAvatarId()\n {\n return getOldValue();\n }",
"public void\t\tsetConfiguration(Object obj);",
"@RdfProperty(\"http://www.coadunation.net/schema/rdf/1.0/base#IdValue\")\n public abstract void setValue(String value);",
"@Override\n public void saveBootstrapState ()\n {\n service.getServerConfiguration().saveBootstrapState(evCustomers);\n }",
"public void setAttributes(IEntityObject obj) {\r\n\tDispenser dObj = (Dispenser) obj;\r\n\tdObj.pk = this.pk;\r\n\tdObj.versionInfoID = this.versionInfoID;\r\n\tdObj.interfaceID = this.interfaceID;\t\r\n\tdObj.setBlender(this.blender);\r\n }",
"public void setBSCA_PriceChangePrev_ID (int BSCA_PriceChangePrev_ID);",
"public void saveProperties()\n {\n _appContext.Configuration.save();\n }",
"public void setID() throws IOException;",
"public void setOldData(String oldData) {\r\n this.oldData = oldData;\r\n }",
"@Override\r\n\tpublic void config() {\n\t\tinter.setState(inter.getConfig());\r\n\t}",
"public void saveValue() {\n String[] idCol = assignedDataObject.getIdentifyTemplate().getIdentifyColumnNames();\n if (!(idCol.length == 1 && name.equals(idCol[0]))) { // method \"copy\" must not change unique key name! For any other methods it is not needed to save from frame.\n if (this.getText().equals(\"\")) {\n assignedDataObject.setInt(name, 0);\n } else {\n assignedDataObject.setInt(name, this.getIntValue());\n }\n }\n }",
"@Override\n public void setField(int id, int value) {\n \n }",
"@Test\r\n public void testSetId_getId() {\r\n System.out.println(\"getId\");\r\n ConfigNode configNode = new ConfigNode(testLine);\r\n configNode.setId(\"id1\");\r\n assertEquals(\"id1\", configNode.getId());\r\n }",
"public void setOID(java.lang.String oid)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(OID$12);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(OID$12);\r\n }\r\n target.setStringValue(oid);\r\n }\r\n }",
"void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws WrongReferenceAttributeValueException;",
"@Override\r\n\tpublic void persist(Seat seatHoldState, SeatState value) {\n\t\t\r\n\t}",
"public Mapping setIdentity( String theId) {\n\t\tmyIdentity = new IdDt(theId); \n\t\treturn this; \n\t}",
"@Override\n\tpublic void saveSettings() {\n\n\t}",
"public abstract long getSdiId();",
"public void loadConfig(){\n this.saveDefaultConfig();\n //this.saveConfig();\n\n\n }",
"public abstract void setAtiempo(java.lang.Long newAtiempo);",
"public void setId(int newId) {\n this.id = newId;\n }"
] | [
"0.6210228",
"0.5769661",
"0.57331467",
"0.5541017",
"0.54768103",
"0.5456638",
"0.53531057",
"0.5352549",
"0.5346824",
"0.5313039",
"0.52707684",
"0.52256054",
"0.52044266",
"0.51907134",
"0.51580507",
"0.5152524",
"0.5133011",
"0.5126359",
"0.5111877",
"0.5111877",
"0.5111877",
"0.5111877",
"0.5094179",
"0.50641876",
"0.505958",
"0.50423366",
"0.5039576",
"0.50122505",
"0.5005662",
"0.5005243",
"0.500513",
"0.4990207",
"0.49683303",
"0.49557763",
"0.49458256",
"0.49427402",
"0.49316022",
"0.49299908",
"0.49272683",
"0.49225736",
"0.4918261",
"0.49157062",
"0.49082848",
"0.4908184",
"0.4905544",
"0.48928687",
"0.4886374",
"0.4886309",
"0.48855034",
"0.48851985",
"0.48843002",
"0.48790458",
"0.4874794",
"0.48746154",
"0.48719913",
"0.48708218",
"0.48641425",
"0.48545307",
"0.484941",
"0.48277128",
"0.4827574",
"0.4817798",
"0.48173591",
"0.48152626",
"0.4814889",
"0.4809119",
"0.48057127",
"0.48000318",
"0.47977847",
"0.4796702",
"0.47963536",
"0.479632",
"0.4796262",
"0.4794183",
"0.47835913",
"0.4779983",
"0.4772602",
"0.47691274",
"0.47658044",
"0.476459",
"0.4763802",
"0.47622404",
"0.47589725",
"0.47552264",
"0.4754707",
"0.47537154",
"0.47516772",
"0.4750225",
"0.47496873",
"0.47451282",
"0.4740228",
"0.47359902",
"0.47347984",
"0.47278222",
"0.47226822",
"0.4721684",
"0.47214755",
"0.47175866",
"0.4716054",
"0.47151843"
] | 0.6296874 | 0 |
Get accessor for persistent attribute: savconfigidnew | public int getSavconfigidnew() throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getSavconfigidold() throws java.rmi.RemoteException;",
"public abstract long getSdiId();",
"public interface CfgDocument extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n\n\n\t/**\n\t * Get accessor for persistent attribute: savconfigidold\n\t */\n\tpublic int getSavconfigidold() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidold\n\t */\n\tpublic void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic int getSavconfigidnew() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storedem\n\t */\n\tpublic java.lang.Integer getStoredem() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storedem\n\t */\n\tpublic void setStoredem(java.lang.Integer newStoredem)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storebad\n\t */\n\tpublic java.lang.Integer getStorebad() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storebad\n\t */\n\tpublic void setStorebad(java.lang.Integer newStorebad)\n\t\tthrows java.rmi.RemoteException;\n}",
"@Transient\n @Override\n public Integer getId()\n {\n return this.conservDescriptionId;\n }",
"public void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;",
"public InstanceConfigId getId() {\n return id;\n }",
"public Integer getOidnew() {\n return oidnew;\n }",
"public int getId() {\n\t\treturn config >> 8;\n\t}",
"public String getReadWriteAttribute();",
"public String getId ();",
"public String getId ();",
"public Object get_KeyValue(){return\t\t\t Id;}",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public abstract String getId();",
"public String getPaternalID();",
"public String getId(){ return ID; }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"public String getConfigToSave() {\n return configToSave;\n }",
"boolean isNewConfig();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"@Id\n @WhereSQL(sql = \"id=:WxPayconfig_id\")\n public java.lang.String getId() {\n return this.id;\n }",
"public SimpleIntegerProperty getIDProperty(){ return id; }",
"public String getId(){ return id.get(); }",
"protected abstract String getId();",
"public int getInstanceID()\n {\n return super.getPersistenceID();\n }",
"public String newSpyId()\n {\n return _spyDataSource.createConnectionId();\n }",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getId();",
"public String getATTR_ID() {\n return ATTR_ID;\n }",
"public String getId(){return id;}",
"protected Map<String, BaseAttribute> retrievePersistentIdAttribute(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException {\n Map <String, BaseAttribute> resolvedAttributes = new HashMap<String, BaseAttribute>();\n String persistentId = getPersistentId(resolutionContext);\n\n if (persistentId != null) {\n log.debug(\"Data connector {} got persistentId {} from backend.\", getId(), persistentId);\n BasicAttribute<String> attribute = new BasicAttribute<String>();\n attribute.setId(getPidGeneratedAttributeId());\n attribute.getValues().add(persistentId);\n resolvedAttributes.put(attribute.getId(), attribute);\n }\n\n return resolvedAttributes;\n }",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"public int getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();"
] | [
"0.57894385",
"0.5758292",
"0.5673529",
"0.5418455",
"0.5396633",
"0.5391727",
"0.53801423",
"0.5375247",
"0.5372228",
"0.5345388",
"0.5345388",
"0.5335749",
"0.5299337",
"0.5299337",
"0.5299337",
"0.5299337",
"0.5299337",
"0.5299337",
"0.52913916",
"0.52604616",
"0.5246134",
"0.5246134",
"0.5246134",
"0.5246134",
"0.52360404",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.5221659",
"0.52138406",
"0.5213406",
"0.51916414",
"0.51868045",
"0.516516",
"0.5153796",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.5151106",
"0.515052",
"0.51358443",
"0.5129021",
"0.5125535",
"0.5125535",
"0.5125535",
"0.5125535",
"0.5125535",
"0.5125535",
"0.5125535",
"0.51075876",
"0.51075876",
"0.51075876",
"0.51075876",
"0.51075876"
] | 0.6604305 | 0 |
Set accessor for persistent attribute: savconfigidnew | public void setSavconfigidnew(int newSavconfigidnew)
throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getSavconfigidnew() throws java.rmi.RemoteException;",
"public abstract void setIdpc(java.lang.String newIdpc);",
"public interface CfgDocument extends com.hps.july.persistence.Document, com.ibm.ivj.ejb.runtime.CopyHelper {\n\n\n\n\t/**\n\t * Get accessor for persistent attribute: savconfigidold\n\t */\n\tpublic int getSavconfigidold() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidold\n\t */\n\tpublic void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic int getSavconfigidnew() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: savconfigidnew\n\t */\n\tpublic void setSavconfigidnew(int newSavconfigidnew)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storedem\n\t */\n\tpublic java.lang.Integer getStoredem() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storedem\n\t */\n\tpublic void setStoredem(java.lang.Integer newStoredem)\n\t\tthrows java.rmi.RemoteException;\n\t/**\n\t * Get accessor for persistent attribute: storebad\n\t */\n\tpublic java.lang.Integer getStorebad() throws java.rmi.RemoteException;\n\t/**\n\t * Set accessor for persistent attribute: storebad\n\t */\n\tpublic void setStorebad(java.lang.Integer newStorebad)\n\t\tthrows java.rmi.RemoteException;\n}",
"public abstract void setTica_id(java.lang.String newTica_id);",
"public void setSavconfigidold(int newSavconfigidold)\n\t\tthrows java.rmi.RemoteException;",
"public int getSavconfigidold() throws java.rmi.RemoteException;",
"public void setId(String newValue);",
"public void setID(String newID)\r\n {\r\n id=newID;\r\n }",
"public abstract void setEspe_id(java.lang.Integer newEspe_id);",
"public void setNew();",
"@Test\r\n public void testSetId_getId() {\r\n System.out.println(\"getId\");\r\n ConfigNode configNode = new ConfigNode(testLine);\r\n configNode.setId(\"id1\");\r\n assertEquals(\"id1\", configNode.getId());\r\n }",
"public abstract void setAcma_id(java.lang.Long newAcma_id);",
"void setNilID();",
"@Test\n public void test_setNetworkId() {\n String value = \"new_value\";\n instance.setNetworkId(value);\n\n assertEquals(\"'setNetworkId' should be correct.\",\n value, TestsHelper.getField(instance, \"networkId\"));\n }",
"@RdfProperty(\"http://www.coadunation.net/schema/rdf/1.0/base#IdValue\")\n public abstract void setValue(String value);",
"public void setM_Locator_ID (int M_Locator_ID)\n{\nset_Value (\"M_Locator_ID\", new Integer(M_Locator_ID));\n}",
"String attributeToSetter(String name);",
"void setId(int val);",
"@Test\n public void testSetId_edificio() {\n System.out.println(\"setId_edificio\");\n int id_edificio = 1;\n DboEdificio instance = new DboEdificio(1, \"T-3\");\n instance.setId_edificio(id_edificio);\n \n }",
"@Override\r\n\tpublic void setId(String id) {\n\t\t\r\n\t}",
"public final void setNetId( String id) //final doesn't allow new rules or ways in door\r\n {\r\n netId = id; //only place I can do it in set methods\r\n }",
"public abstract void setCod_dpto(java.lang.String newCod_dpto);",
"@Override\n\tpublic void setId(String id)\n\t{\n\t\t\n\t}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setOidnew(Integer oidnew) {\n this.oidnew = oidnew;\n }",
"public void setID() throws IOException;",
"private <T> void setIdGeneration(DeployBeanDescriptor<T> desc) {\n if (desc.getIdGenerator() != null) {\n // already assigned (So custom or UUID)\n return;\n }\n if (desc.idProperty() == null) {\n return;\n }\n final DeployIdentityMode identityMode = desc.getIdentityMode();\n if (identityMode.isSequence() && !dbIdentity.isSupportsSequence()) {\n // explicit sequence but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit sequence on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n if (identityMode.isIdentity() && !dbIdentity.isSupportsIdentity()) {\n // explicit identity but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit Identity on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n\n if (identityMode.isAuto()) {\n if (desc.isPrimaryKeyCompoundOrNonNumeric()) {\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n if (desc.isIdGeneratedValue() || config.isIdGeneratorAutomatic()) {\n // use IDENTITY or SEQUENCE based on platform\n identityMode.setPlatformType(dbIdentity.getIdType());\n } else {\n // externally/application supplied Id values\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n }\n\n if (desc.getBaseTable() == null) {\n // no base table so not going to set Identity or sequence information\n return;\n }\n\n if (identityMode.isIdentity()) {\n // used when getGeneratedKeys is not supported (SQL Server 2000, SAP Hana)\n String selectLastInsertedId = dbIdentity.getSelectLastInsertedId(desc.getBaseTable());\n String selectLastInsertedIdDraft = (!desc.isDraftable()) ? selectLastInsertedId : dbIdentity.getSelectLastInsertedId(desc.getDraftTable());\n desc.setSelectLastInsertedId(selectLastInsertedId, selectLastInsertedIdDraft);\n return;\n }\n\n if (identityMode.isSequence()) {\n String seqName = identityMode.getSequenceName();\n if (seqName == null || seqName.isEmpty()) {\n String primaryKeyColumn = desc.getSinglePrimaryKeyColumn();\n seqName = namingConvention.getSequenceName(desc.getBaseTable(), primaryKeyColumn);\n }\n int stepSize = desc.setIdentitySequenceBatchMode(databasePlatform.sequenceBatchMode());\n desc.setIdGenerator(createSequenceIdGenerator(seqName, stepSize));\n }\n }",
"@Override\r\n\tpublic int saveConfig(BaseConfig record) {\n\t\treturn baseConfigMapper.insertSelective(record);\r\n\t}",
"public abstract void setId(int id);",
"public void setId(int driverDBId);",
"public void setId(int newId) {\n\tid = newId;\n}",
"@Override\r\n\tpublic void setAddNewObjectIdentifier(String arg0, Long arg1)\r\n\t{\n\r\n\t}",
"@Override\r\n\t\tpublic void setId(String id)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"public abstract long getSdiId();",
"@JsProperty(name = \"id\")\n public native void setId(String value);",
"public void setId(int idNuevo)\n { \n this.id = idNuevo;\n }",
"public Mapping setIdentity( String theId) {\n\t\tmyIdentity = new IdDt(theId); \n\t\treturn this; \n\t}",
"public void setId (String id);",
"private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}",
"public abstract void setCod_actividad(java.lang.Long newCod_actividad);",
"public abstract void setId_causal_peticion(\n\t\tjava.lang.Long newId_causal_peticion);",
"public int addAttributeToConfig(int attribId, int configId, boolean global);",
"void setDatty(Datty newDatty);",
"public void setId(String id) {\n }",
"public void setId(String id) {\n this.id = id;\n }",
"public abstract void setNovedad(java.lang.String newNovedad);",
"public int storeAttribute(String key, String value);",
"public void setId(String id)\r\n/* 19: */ {\r\n/* 20:17 */ this.id = id;\r\n/* 21: */ }",
"public Integer getOidnew() {\n return oidnew;\n }",
"@JSProperty(\"id\")\n void setId(String value);",
"public void setNewProperty_description(java.lang.String param){\n localNewProperty_descriptionTracker = true;\n \n this.localNewProperty_description=param;\n \n\n }",
"public Object setID(int iD)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setId : \" + \"Agent\");\r\n/* 51 */ \tthis.myID = iD;\r\n/* 52 */ \treturn this;\r\n/* */ }",
"public void setId(String s) {\n\t\tid = s;\n\t}",
"public void setId(String newId) {\n\t\tthis.Id = newId;\n\t}",
"public abstract void setConfig(String config) throws java.rmi.RemoteException;",
"void setId(String id);",
"void setId(String id);",
"void setId(String id);",
"public void setIdentificacion(String identificacion)\r\n/* 128: */ {\r\n/* 129:233 */ this.identificacion = identificacion;\r\n/* 130: */ }",
"public void saveOptions(long setId, String attribute, String[] values) throws ServerException;",
"public void setId(String id);",
"public void setId(String id);",
"@Override\r\n\tpublic void setId(final K id) {\n\t\tsuper.setId(id);\r\n\t}",
"protected LPDMODOMAttribute() {\n }",
"void setId(int id) throws UnsupportedOperationException;",
"@Override\r\n public void setsaleId(int saleid) {\n this.saleId = saleid;\r\n }",
"public abstract void setIdpcTV(java.lang.String newIdpcTV);",
"public String newSpyId()\n {\n return _spyDataSource.createConnectionId();\n }",
"@Test\n public void testSetId() {\n System.out.println(\"setId\");\n long id = 0L;\n DTO_Ride instance = dtoRide;\n instance.setId(id);\n long result = instance.getId();\n assertEquals(id, result);\n }",
"public void setPatientID(java.lang.String param){\n \n this.localPatientID=param;\n \n\n }",
"public void setPatientID(java.lang.String param){\n \n this.localPatientID=param;\n \n\n }",
"boolean isNewConfig();",
"public Object get_KeyValue(){return\t\t\t Id;}",
"public void setID(int id);",
"public void setM_Product_ID (int M_Product_ID)\n{\nset_Value (\"M_Product_ID\", new Integer(M_Product_ID));\n}",
"public void setGeneratedAttribute(String id) {\n generatedAttribute = id;\n }",
"public SimpleIntegerProperty getIDProperty(){ return id; }",
"@Test\n public void testSetId() {\n System.out.println(\"setId\");\n Member instance = member;\n \n String id = \"new Id\";\n instance.setId(id);\n \n String expResult = id;\n String result = instance.getId();\n \n assertEquals(expResult,result);\n }",
"private void setupSpalteID() {\r\n\t\t// legt fest, welches Attribut von Arbeitspaket in dieser Spalte angezeigt wird\r\n\t\tspalteID.setCellValueFactory(new PropertyValueFactory<>(\"idExtern\"));\r\n\r\n\t\t// lässt die Zelle mit Hilfe der Klasse EditCell bei Tastatureingabe bearbeitbar\r\n\t\t// machen\r\n\t\tspalteID.setCellFactory(EditCell.<ArbeitspaketTableData>forTableColumn());\r\n\r\n\t\t// überschreibt den alten Attributwert mit der User-Eingabe\r\n\t\tspalteID.setOnEditCommit(event -> {\r\n\t\t\tfinal String value = event.getNewValue() != null ? event.getNewValue() : event.getOldValue();\r\n\t\t\tevent.getTableView().getItems().get(event.getTablePosition().getRow()).setIdExtern(value);\r\n\t\t\ttabelle.refresh();\r\n\t\t});\r\n\t}",
"public void setId(byte id){this.id = id;}",
"public String getReadWriteAttribute();",
"public void setId(int id){ this.id = id; }",
"public void setOID(java.lang.String oid)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(OID$12);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(OID$12);\r\n }\r\n target.setStringValue(oid);\r\n }\r\n }",
"public void setSpid(int param){\n localSpidTracker = true;\n \n this.localSpid=param;\n \n\n }",
"public void setSalesRep_ID (int SalesRep_ID);",
"public void setSalesRep_ID (int SalesRep_ID);",
"public void setM_Warehouse_ID (int M_Warehouse_ID)\n{\nset_Value (\"M_Warehouse_ID\", new Integer(M_Warehouse_ID));\n}",
"public abstract void setAtis(java.lang.Long newAtis);",
"@Test\n public void setGetID() {\n final CourseType courseType = new CourseType();\n final String ID = \"ID\";\n courseType.setId(ID);\n\n assertSame(ID, courseType.getId());\n }",
"public void setC_UOM_ID (int C_UOM_ID)\n{\nset_Value (\"C_UOM_ID\", new Integer(C_UOM_ID));\n}",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"public void setAccidentDetail(typekey.AccidentDetailPEL value);",
"public void newConfig ()\n {\n Class<?> clazz = group.getRawConfigClasses().get(0);\n try {\n ManagedConfig cfg = (ManagedConfig)PreparedEditable.PREPARER.apply(\n clazz.newInstance());\n if (cfg instanceof DerivedConfig) {\n ((DerivedConfig)cfg).cclass = group.getConfigClass();\n }\n newNode(cfg);\n } catch (Exception e) {\n log.warning(\"Failed to instantiate config [class=\" + clazz + \"].\", e);\n }\n }",
"public void setDni(String dni);",
"public void save() {\n if(persistenceType == PropertyPersistenceType.Persistent) {\n if (!isSetToDefault()) {\n permanentStore.setBoolean(key, get());\n } else {\n permanentStore.remove(key);\n }\n }\n }",
"@Override\r\n\t\tpublic void setIdAttribute(String name, boolean isId) throws DOMException\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"@Transient\n @Override\n public Integer getId()\n {\n return this.conservDescriptionId;\n }",
"public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID);"
] | [
"0.6347333",
"0.5696542",
"0.56369025",
"0.5620694",
"0.55454046",
"0.55233806",
"0.5476515",
"0.5462434",
"0.54421335",
"0.5425068",
"0.53899574",
"0.53693074",
"0.5337531",
"0.5287983",
"0.5285791",
"0.5259164",
"0.5236253",
"0.5210823",
"0.5207837",
"0.5203709",
"0.51983076",
"0.51674175",
"0.5166501",
"0.5164539",
"0.5119258",
"0.5112052",
"0.5102584",
"0.50969595",
"0.5079618",
"0.5071848",
"0.50713164",
"0.506728",
"0.50666666",
"0.50620174",
"0.5058072",
"0.5053145",
"0.5048826",
"0.50444114",
"0.5033441",
"0.5028796",
"0.50284",
"0.5017147",
"0.5012382",
"0.5005852",
"0.50042504",
"0.49903265",
"0.49899334",
"0.4983786",
"0.49833897",
"0.49777958",
"0.496205",
"0.4952103",
"0.4948891",
"0.4937811",
"0.49376208",
"0.4937492",
"0.4937492",
"0.4937492",
"0.49341595",
"0.49280605",
"0.49255076",
"0.49255076",
"0.4922122",
"0.49218586",
"0.4920856",
"0.4919223",
"0.49175283",
"0.4914262",
"0.49118695",
"0.49117622",
"0.49117622",
"0.490306",
"0.48960358",
"0.48960242",
"0.48948255",
"0.4886876",
"0.48831618",
"0.48812383",
"0.48795167",
"0.4877826",
"0.48713285",
"0.48709077",
"0.48672867",
"0.48609826",
"0.48594925",
"0.48594925",
"0.48536363",
"0.48507595",
"0.48473874",
"0.48465466",
"0.4838507",
"0.4838507",
"0.4838507",
"0.48378253",
"0.4834893",
"0.4833662",
"0.48329458",
"0.48316115",
"0.48312706",
"0.4827863"
] | 0.6120256 | 1 |
Get accessor for persistent attribute: storedem | public java.lang.Integer getStoredem() throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();",
"String attributeToGetter(String name);",
"boolean hasStoreAttribute();",
"public abstract IAccessor getAccessor(IContext context);",
"Object getAttribute(int attribute);",
"public abstract int getPersistence();",
"public GenericAttribute getAttribute () {\n return attribute;\n }",
"Attribute getAttribute();",
"public int storeAttribute(String key, String value);",
"public String getReadWriteAttribute();",
"@Override\n\tpublic Object getAttribute(String appKey,String contextpath, String sessionID, String attribute,Session session) {\n\t\tString _attribute = SessionUtil.wraperAttributeName(appKey,contextpath, attribute);\n\t\tObject value = sessionStore.getAttribute(appKey, contextpath, sessionID, _attribute,session);\n\t\tif(session.isStoreReadAttributes() && value != null && readcanstore( value))\n\t\t\tsession.modifyAttribute(_attribute, value, ModifyValue.type_data, ModifyValue.type_read);\t\n\t\treturn value;\n\t}",
"public IData getStoreddata();",
"java.lang.String getAttribute();",
"<T> T getSessionAttribute( String key );",
"public StructuredData getStructuredDataAttribute();",
"public Attribute fetchAttribute(String key, String value);",
"public String getGetter() {\n return \"get\" + getCapName();\n }",
"public org.omg.uml.foundation.core.Attribute getAttribute();",
"String getAttribute();",
"Object getAttribute(String name);",
"Object getAttribute(String name);",
"Object getAttribute(String name);",
"public <T> T get(String attr) {\n return (T) (super.get(attr));\n }",
"com.google.ads.googleads.v4.common.StoreAttributeOrBuilder getStoreAttributeOrBuilder();",
"public Object getProperty(String attName);",
"default Attribute getAttribute(AttributeName attributeName) {return (Attribute) attributeName;}",
"@Override\n\tpublic Datastore getDatastore() {\n\t\treturn SKBeanUtils.getDatastore();\n\t}",
"public Double getDoubleAttribute();",
"public String get();",
"public abstract String get();",
"public String attribute() {\n return this.attribute;\n }",
"Object getAttribute(String key);",
"Object getAttribute(String key);",
"public Object attribute(String name) {\n return Classes.getFieldValue(this, name);\n }",
"public Object getAttribute(String name);",
"public String getAttr() {\n return attr;\n }",
"public Object get(String aName) { return _attrMap.get(aName); }",
"public T getStore() {\r\n\t\treturn store;\r\n\t}",
"String attributeToSetter(String name);",
"public Long getLongAttribute();",
"public ExpandoValuePersistence getExpandoValuePersistence() {\n\t\treturn expandoValuePersistence;\n\t}",
"public Method getGetter() {\n return this.getter;\n }",
"String booleanAttributeToGetter(String arg0);",
"protected String getStore() {\n return store;\n }",
"public int getAttribute() {\n return Attribute;\n }",
"public com.hps.july.persistence.StoragePlaceAccessBean getStorage() {\n\treturn storage;\n}",
"public KVCommInterface getStore();",
"public String getStringAttribute();",
"public HashMap getClassWithAttr() {\n return storingClassWithAttr;\n }",
"public abstract StoreInfo getInfo();",
"public DtxStore getStore() {\n return dtxStore;\n }",
"public T get() {\n return value;\n }",
"public T get() {\n return value;\n }",
"public IPersistence<T> getPersistence();",
"@Override\n String get();",
"public T get() {\n return value;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic U accessObject()\n\t{\n\t\treturn (primaryKey == null)?(null):\n\t\t (U)bean(GetUnity.class).getUnited(primaryKey);\n\t}",
"public Object getPersisted(String key) {\r\n\t\treturn getPersistenceMap().get(key);\r\n\t}",
"DataStore getDataStore ();",
"public String getter() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic void saveAttribute(URI resource, String attrName, Object attrValue)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\t\n\t}",
"public Integer getIntegerAttribute();",
"public ExpandoColumnPersistence getExpandoColumnPersistence() {\n\t\treturn expandoColumnPersistence;\n\t}",
"Attribute createAttribute();",
"Attribute createAttribute();",
"public org.python.Object __getattribute__(java.lang.String name);",
"public K get()\n {\n\treturn current.data(); \n }",
"@FameProperty(name = \"accessors\", derived = true)\n public Collection<TWithAccesses> getAccessors() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }",
"public FooPersistence getFooPersistence() {\n return fooPersistence;\n }",
"OsType getObjectStore();",
"String get();",
"String get();",
"com.google.protobuf.ByteString getAttributeBytes();",
"protected Object getAttrInvokeAccessor(int index, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case SEQUENCENO:\n return getSequenceNo();\n case LINENUMBER:\n return getLineNumber();\n case COUNTRY:\n return getCountry();\n case ATTRIBUTE1:\n return getAttribute1();\n case ATTRIBUTE2:\n return getAttribute2();\n case ATTRIBUTE3:\n return getAttribute3();\n case ATTRIBUTE4:\n return getAttribute4();\n case ATTRIBUTE5:\n return getAttribute5();\n case LASTUPDATEDATE:\n return getLastUpdateDate();\n case LASTUPDATEDBY:\n return getLastUpdatedBy();\n case LASTUPDATELOGIN:\n return getLastUpdateLogin();\n case CREATEDBY:\n return getCreatedBy();\n case CREATIONDATE:\n return getCreationDate();\n case ITEMKEY:\n return getItemKey();\n case ROWID:\n return getRowID();\n default:\n return super.getAttrInvokeAccessor(index, attrDef);\n }\n }",
"public Object getAttribute(Object key);",
"OStorage getStorage();",
"public String getAttribute() {\n return attribute;\n }",
"@SuppressWarnings(\"unchecked\") public <T> T attribute (final String name) {\n return (T)session.getAttribute (name);\n }",
"public DataStorage getDataStorage();",
"public int getStoreID() { return storeID; }",
"public abstract String metadata(String property);",
"public String getAttributeValue(int id) {\n Attribute attr = super.findById(id, false);\n if (attr != null ) {\n return attr.getValue();\n } else {\n return \"unknown attribute\";\n }\n }",
"public java.lang.String getAttributeValue() {\r\n return localAttributeValue;\r\n }",
"public FactAttribute[] getAttribute() {\r\n return localAttribute;\r\n }",
"public static SpriteStore get() {\n\t\treturn single;\n\t}",
"public Attribute fetchAttributeById(int attribId);",
"public Value makeGetter() {\n Value r = new Value(this);\n r.getters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }",
"@Override\n\tpublic Object readAttribute(URI resource, String attrName)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\treturn null;\n\t}",
"public String getSex(){ //\"public\" access allows other classes to retrieve the value of \"sex\", but since there\n // is no setter it cannot be changed from outside the class = Encapsulation/Inkapsling\n return this.sex;\n }",
"protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception\n {\n switch (index) {\n case SUPPLIERID:\n return getSupplierId();\n case NAME:\n return getName();\n case ONHOLDFLAG:\n return getOnHoldFlag();\n case STARTDATE:\n return getStartDate();\n case ENDDATE:\n return getEndDate();\n case LASTUPDATEDATE:\n return getLastUpdateDate();\n case LASTUPDATEDBY:\n return getLastUpdatedBy();\n case CREATIONDATE:\n return getCreationDate();\n case CREATEDBY:\n return getCreatedBy();\n case LASTUPDATELOGIN:\n return getLastUpdateLogin();\n case ATTRIBUTECATEGORY:\n return getAttributeCategory();\n case ATTRIBUTE1:\n return getAttribute1();\n case ATTRIBUTE2:\n return getAttribute2();\n case ATTRIBUTE3:\n return getAttribute3();\n case ATTRIBUTE4:\n return getAttribute4();\n case ATTRIBUTE5:\n return getAttribute5();\n case ATTRIBUTE6:\n return getAttribute6();\n case ATTRIBUTE7:\n return getAttribute7();\n case ATTRIBUTE8:\n return getAttribute8();\n case ATTRIBUTE9:\n return getAttribute9();\n case ATTRIBUTE10:\n return getAttribute10();\n case ATTRIBUTE11:\n return getAttribute11();\n case ATTRIBUTE12:\n return getAttribute12();\n case ATTRIBUTE13:\n return getAttribute13();\n case ATTRIBUTE14:\n return getAttribute14();\n case ATTRIBUTE15:\n return getAttribute15();\n case SUPPLIERSITEEO:\n return getSupplierSiteEO();\n case PURCHASEORDERHEADEREO:\n return getPurchaseOrderHeaderEO();\n default:\n return super.getAttrInvokeAccessor(index, attrDef);\n }\n }",
"public Object get()\n {\n return m_internalValue;\n }",
"public final Object get() {\n return getValue();\n }",
"public T get() {\n return cache.getUnchecked(clazz);\n }",
"public Object get() {\n Supplier supplier = this.delegate;\n synchronized (supplier) {\n Supplier supplier2 = this.delegate;\n return supplier2.get();\n }\n }",
"public AttributeFactElements getAttributeFactAccess() {\n\t\treturn pAttributeFact;\n\t}",
"public int getAtt(){ \r\n return att;\r\n }",
"public java.lang.String getGet() {\n return instance.getGet();\n }",
"public interface DataAccessor {\n}",
"public T get() {\n return object;\n }",
"public DBSequence getArtId() {\n return (DBSequence)getAttributeInternal(ARTID);\n }"
] | [
"0.75462395",
"0.6803441",
"0.61417705",
"0.6047669",
"0.60273486",
"0.6004244",
"0.5948482",
"0.592327",
"0.5901541",
"0.58674675",
"0.5856374",
"0.5809147",
"0.58062446",
"0.5787338",
"0.5779257",
"0.57416314",
"0.57398415",
"0.57357526",
"0.5735496",
"0.5719928",
"0.5719928",
"0.5719928",
"0.5709688",
"0.56947887",
"0.5686966",
"0.56805384",
"0.56752014",
"0.56690556",
"0.56565213",
"0.561007",
"0.560753",
"0.5589678",
"0.5589678",
"0.5584892",
"0.55700135",
"0.55510867",
"0.55468756",
"0.5545075",
"0.5539959",
"0.5538424",
"0.5536649",
"0.5535735",
"0.5515046",
"0.5489877",
"0.5473471",
"0.5459978",
"0.543748",
"0.54299074",
"0.5428625",
"0.5420075",
"0.5419724",
"0.54112977",
"0.54112977",
"0.5406418",
"0.54051036",
"0.5391183",
"0.5379176",
"0.53745914",
"0.5369201",
"0.5368993",
"0.53620255",
"0.535726",
"0.53469074",
"0.5343548",
"0.5343548",
"0.5342638",
"0.5334423",
"0.533002",
"0.53259397",
"0.5322044",
"0.53208745",
"0.53208745",
"0.5317092",
"0.53070366",
"0.53053933",
"0.53043145",
"0.52979165",
"0.5286724",
"0.5285379",
"0.5284354",
"0.52738935",
"0.52721786",
"0.5262584",
"0.52617776",
"0.52412504",
"0.5237667",
"0.52306736",
"0.5226678",
"0.5226052",
"0.52244675",
"0.52230525",
"0.5221309",
"0.52197725",
"0.5215939",
"0.52119786",
"0.52117527",
"0.5197607",
"0.5195273",
"0.5195114",
"0.5189009"
] | 0.52947444 | 77 |
Set accessor for persistent attribute: storedem | public void setStoredem(java.lang.Integer newStoredem)
throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String attributeToSetter(String name);",
"public int storeAttribute(String key, String value);",
"com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();",
"void setProperty(String attribute, String value);",
"@Override\n\tpublic void saveAttribute(URI resource, String attrName, Object attrValue)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\t\n\t}",
"String attributeToGetter(String name);",
"void setInternal(ATTRIBUTES attribute, Object iValue);",
"public String getReadWriteAttribute();",
"protected SLEXMMAttribute(SLEXMMStorageMetaModel storage) {\n\t\tsuper(storage);\n\t}",
"boolean hasStoreAttribute();",
"public String getSetter() {\n return \"set\" + getCapName();\n }",
"public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;",
"@Mixin(EntityPlayerSP.class)\npublic interface AccessorEntityPlayerSP {\n\n @Accessor(\"handActive\")\n void gsSetHandActive(boolean value);\n\n}",
"@Override\n\t\tpublic void setAttribute(String name, Object value) {\n\t\t\t\n\t\t}",
"public boolean setProperty(String attName, Object value);",
"public String setter() {\n\t\treturn prefix(\"set\");\n\t}",
"@Override\npublic void setAttributes() {\n\t\n}",
"@Override\n\t\tpublic void setAttribute(String name, Object o) {\n\t\t\t\n\t\t}",
"protected abstract void setContextAttribute(String name, Object value);",
"public void save() {\n if(persistenceType == PropertyPersistenceType.Persistent) {\n if (!isSetToDefault()) {\n permanentStore.setBoolean(key, get());\n } else {\n permanentStore.remove(key);\n }\n }\n }",
"public void setAttrib(String name, String value);",
"public void setDataGetter(Object instance, Method method) {\n this.instance = instance;\n this.method = method;\n }",
"@Override\n public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {\n\n }",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case SEQUENCENO:\n setSequenceNo((Number)value);\n return;\n case LINENUMBER:\n setLineNumber((Number)value);\n return;\n case COUNTRY:\n setCountry((String)value);\n return;\n case ATTRIBUTE1:\n setAttribute1((String)value);\n return;\n case ATTRIBUTE2:\n setAttribute2((String)value);\n return;\n case ATTRIBUTE3:\n setAttribute3((String)value);\n return;\n case ATTRIBUTE4:\n setAttribute4((String)value);\n return;\n case ATTRIBUTE5:\n setAttribute5((String)value);\n return;\n case LASTUPDATEDATE:\n setLastUpdateDate((Date)value);\n return;\n case LASTUPDATEDBY:\n setLastUpdatedBy((Number)value);\n return;\n case LASTUPDATELOGIN:\n setLastUpdateLogin((Number)value);\n return;\n case CREATEDBY:\n setCreatedBy((Number)value);\n return;\n case CREATIONDATE:\n setCreationDate((Date)value);\n return;\n case ITEMKEY:\n setItemKey((String)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"void setInt(int attributeValue);",
"public void setAttribute(Object key, Object value);",
"@Test\n public void setExtraSavesExtra()\n {\n //arrange\n String expectedExtra = \"some user agent extra\";\n ProductInfo actual = new ProductInfo();\n\n //act\n actual.setExtra(expectedExtra);\n\n //assert\n assertEquals(expectedExtra, Deencapsulation.getField(actual, \"extra\"));\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception\n {\n switch (index) {\n case SUPPLIERID:\n setSupplierId((Number)value);\n return;\n case NAME:\n setName((String)value);\n return;\n case ONHOLDFLAG:\n setOnHoldFlag((String)value);\n return;\n case STARTDATE:\n setStartDate((Date)value);\n return;\n case ENDDATE:\n setEndDate((Date)value);\n return;\n case LASTUPDATEDATE:\n setLastUpdateDate((Date)value);\n return;\n case LASTUPDATEDBY:\n setLastUpdatedBy((Number)value);\n return;\n case CREATIONDATE:\n setCreationDate((Date)value);\n return;\n case CREATEDBY:\n setCreatedBy((Number)value);\n return;\n case LASTUPDATELOGIN:\n setLastUpdateLogin((Number)value);\n return;\n case ATTRIBUTECATEGORY:\n setAttributeCategory((String)value);\n return;\n case ATTRIBUTE1:\n setAttribute1((String)value);\n return;\n case ATTRIBUTE2:\n setAttribute2((String)value);\n return;\n case ATTRIBUTE3:\n setAttribute3((String)value);\n return;\n case ATTRIBUTE4:\n setAttribute4((String)value);\n return;\n case ATTRIBUTE5:\n setAttribute5((String)value);\n return;\n case ATTRIBUTE6:\n setAttribute6((String)value);\n return;\n case ATTRIBUTE7:\n setAttribute7((String)value);\n return;\n case ATTRIBUTE8:\n setAttribute8((String)value);\n return;\n case ATTRIBUTE9:\n setAttribute9((String)value);\n return;\n case ATTRIBUTE10:\n setAttribute10((String)value);\n return;\n case ATTRIBUTE11:\n setAttribute11((String)value);\n return;\n case ATTRIBUTE12:\n setAttribute12((String)value);\n return;\n case ATTRIBUTE13:\n setAttribute13((String)value);\n return;\n case ATTRIBUTE14:\n setAttribute14((String)value);\n return;\n case ATTRIBUTE15:\n setAttribute15((String)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"@Override\n\tpublic void setAttribute(String name, Object o) {\n\t\t\n\t}",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\r\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\r\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\r\n return;\r\n }\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\r\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\r\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\r\n return;\r\n }\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case EMPLOYEEPERSONID:\n setEmployeePersonId((Number)value);\n return;\n case CODECOMBINATIONID:\n setCodeCombinationId((Number)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"void setAttribute( String attrName, Object value ) throws FileSystemException;",
"public abstract void set(DataType x, DataType y, DataType z);",
"Attribute createAttribute();",
"Attribute createAttribute();",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"public abstract void set(M newValue);",
"public void set(File file, String view, String attribute, Object value, boolean create) {\n/* 131 */ throw unsettable(view, attribute);\n/* */ }",
"@Override\n\tpublic Object getAttribute(String appKey,String contextpath, String sessionID, String attribute,Session session) {\n\t\tString _attribute = SessionUtil.wraperAttributeName(appKey,contextpath, attribute);\n\t\tObject value = sessionStore.getAttribute(appKey, contextpath, sessionID, _attribute,session);\n\t\tif(session.isStoreReadAttributes() && value != null && readcanstore( value))\n\t\t\tsession.modifyAttribute(_attribute, value, ModifyValue.type_data, ModifyValue.type_read);\t\n\t\treturn value;\n\t}",
"public void setAttributeValue(java.lang.String param) {\r\n localAttributeValueTracker = true;\r\n\r\n this.localAttributeValue = param;\r\n\r\n\r\n }",
"public abstract IAccessor getAccessor(IContext context);",
"EAttribute createEAttribute();",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case INVOICESTATUS:\n setInvoiceStatus((String)value);\n return;\n case CHECKBOX:\n setCheckBox((Boolean)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"alluxio.proto.journal.File.SetAttributeEntry getSetAttribute();",
"public abstract void set(String key, T data);",
"@Pointcut(\"execution(* com.iamscratches.aopdemo.dao.*.set*(..))\")\n\tpublic void setter() {}",
"public EdmAttribute setupAttribute(String val) {\n EdmAttribute a = new EdmAttribute(val);\n return a;\n }",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"public abstract int getPersistence();",
"@Override\n\tpublic void setValue(final Attribute att, final String value) {\n\n\t}",
"AdditionalAttributes setAttribute(String name, Object value, boolean force);",
"void setDatty(Datty newDatty);",
"@Override\n public void setAttribute(boolean f)\n {\n checkState();\n attribute = f;\n }",
"public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}",
"public void storeAttribute(final String attributeLocator, final String variableName);",
"void setAttribute(String name, Object value);",
"void setAttribute(String name, Object value);",
"public void setAttribute(String name, Object value);",
"public Object setAttribute(Object key, Object value) {\n\t\treturn session.setAttribute(key, value);\n\t}",
"<T> T getSessionAttribute( String key );",
"private String getSetMethodName() {\n assert name != null;\n return \"set\" + upperFirstChar(name);\n }",
"public abstract double set\r\n ( DataID dID // input\r\n , double value // input\r\n );",
"protected void setAttrInvokeAccessor(int index, Object value, \r\n AttributeDefImpl attrDef) throws Exception {\r\n switch (index) {\r\n default:\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n return;\r\n }\r\n }",
"final public void setAttr(final String name, final Object value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\tattr.Object = value;\r\n\t\t}\r\n\t}",
"public T set(String name, Object value)\n\t\t\tthrows TablesawException\n\t\t{\n\t\ttry\n\t\t\t{\n\t\t\tif (value instanceof String)\n\t\t\t\t{\n\t\t\t\tm_intHelper.setAttribute(m_project, m_antObject, name, (String)value);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tMethod m = m_intHelper.getAttributeMethod(name);\n\t\t\t\tm.invoke(m_antObject, value);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (IllegalArgumentException iae)\n\t\t\t{\n\t\t\t// TODO: add better error\n\t\t\tthrow new TablesawException(iae);\n\t\t\t}\n\t\tcatch (Exception e)\n\t\t\t{\n\t\t\tthrow new TablesawException(\"Error setting attribute '\"+name+\"' on '\"+m_elementName+\"'\", e);\n\t\t\t}\n\t\t\n\t\treturn ((T)this);\n\t\t}",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception\n {\n switch (index)\n {\n case IDEXPED:\n setIdexped((Number)value);\n return;\n case IDBULTO:\n setIdbulto((Number)value);\n return;\n case IDBULTOORI:\n setIdbultoOri((Number)value);\n return;\n case LARGO:\n setLargo((Number)value);\n return;\n case ANCHO:\n setAncho((Number)value);\n return;\n case ALTO:\n setAlto((Number)value);\n return;\n case IDTIPOBULTO:\n setIdtipobulto((String)value);\n return;\n case PESOCONT:\n setPesocont((Number)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"private void storeAttribute(final Attr attribute) {\n if (attribute.getNamespaceURI() != null\r\n && attribute.getNamespaceURI().equals(\r\n XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {\r\n // Default namespace xmlns=\"uri goes here\"\r\n if (attribute.getNodeName().equals(XMLConstants.XMLNS_ATTRIBUTE)) {\r\n putInCache(DEFAULT_NS, attribute.getNodeValue());\r\n } else {\r\n // The defined prefixes are stored here\r\n putInCache(attribute.getLocalName(), attribute.getNodeValue());\r\n }\r\n }\r\n }",
"protected LPDMODOMAttribute() {\n }",
"void setString(String attributeValue);",
"String booleanAttributeToGetter(String arg0);",
"@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t}",
"public void setSessionAttribute(String name, Object val, String scope) { \n\t\tthrow new UnsupportedOperationException();\n\t}",
"@JsonSetter(\"persistent\")\r\n public void setPersistent (boolean value) { \r\n this.persistent = value;\r\n }",
"public int getSet() {\n return set;\n }",
"@Override\n\tpublic void attribute(QName qName, String value) {\n\t\t\n\t}",
"protected abstract void _set(String key, Object obj, Date expires);",
"public interface DataAccessor {\n}",
"public void setAttribute(Session ses, String name, Object value);",
"public void setMyExp(MyExp me);",
"public Value makeSetter() {\n Value r = new Value(this);\n r.setters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }",
"@Test\n\tpublic void testSetAttribute_UpdateMode() throws NamingException {\n\t\t// Set original attribute value\n\t\tAttribute attribute = new BasicAttribute(\"cn\", \"john doe\");\n\t\ttested.setAttribute(attribute);\n\n\t\t// Set to update mode\n\t\ttested.setUpdateMode(true);\n\n\t\t// Perform test - update the attribute\n\t\tAttribute updatedAttribute = new BasicAttribute(\"cn\", \"nisse hult\");\n\t\ttested.setAttribute(updatedAttribute);\n\n\t\t// Verify result\n\t\tModificationItem[] mods = tested.getModificationItems();\n\t\tassertEquals(1, mods.length);\n\t\tassertEquals(DirContext.REPLACE_ATTRIBUTE, mods[0].getModificationOp());\n\n\t\tAttribute modificationAttribute = mods[0].getAttribute();\n\t\tassertEquals(\"cn\", modificationAttribute.getID());\n\t\tassertEquals(\"nisse hult\", modificationAttribute.get());\n\t}",
"Attribute getAttribute();",
"public BladeController setAttr(String name, Object value) {\n\t\trequest.setAttribute(name, value);\n\t\treturn this;\n\t}"
] | [
"0.65052044",
"0.6261634",
"0.6214267",
"0.5986962",
"0.5958214",
"0.5950274",
"0.5933389",
"0.5683292",
"0.56788313",
"0.5677801",
"0.5638726",
"0.5619755",
"0.5596705",
"0.55789053",
"0.5564019",
"0.5535916",
"0.5524348",
"0.5521924",
"0.55217946",
"0.54952985",
"0.54864293",
"0.5454467",
"0.5418427",
"0.5416627",
"0.53712577",
"0.5371197",
"0.5359409",
"0.535",
"0.53495204",
"0.53417593",
"0.53417593",
"0.53417593",
"0.53417593",
"0.5323187",
"0.5323187",
"0.53195834",
"0.53188837",
"0.53176516",
"0.53151923",
"0.53151923",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150713",
"0.53150415",
"0.53113365",
"0.5307447",
"0.53012127",
"0.5297862",
"0.5295145",
"0.52903867",
"0.5274904",
"0.52717584",
"0.52656025",
"0.5265391",
"0.52560604",
"0.5253138",
"0.52513313",
"0.52077293",
"0.5206169",
"0.52039814",
"0.52019185",
"0.51961863",
"0.51953727",
"0.51953727",
"0.51941043",
"0.518536",
"0.518337",
"0.51832706",
"0.51828223",
"0.5181736",
"0.51795495",
"0.517868",
"0.5166778",
"0.5165922",
"0.51658195",
"0.51543015",
"0.51493835",
"0.51475227",
"0.51465154",
"0.5144543",
"0.51435775",
"0.5142611",
"0.51397425",
"0.51384676",
"0.5121182",
"0.5116387",
"0.5112091",
"0.5103033",
"0.5096292",
"0.50931704"
] | 0.0 | -1 |
Get accessor for persistent attribute: storebad | public java.lang.Integer getStorebad() throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();",
"String attributeToGetter(String name);",
"Object getAttribute(int attribute);",
"@Override\n\tpublic Object getAttribute(String appKey,String contextpath, String sessionID, String attribute,Session session) {\n\t\tString _attribute = SessionUtil.wraperAttributeName(appKey,contextpath, attribute);\n\t\tObject value = sessionStore.getAttribute(appKey, contextpath, sessionID, _attribute,session);\n\t\tif(session.isStoreReadAttributes() && value != null && readcanstore( value))\n\t\t\tsession.modifyAttribute(_attribute, value, ModifyValue.type_data, ModifyValue.type_read);\t\n\t\treturn value;\n\t}",
"public String getReadWriteAttribute();",
"public abstract IAccessor getAccessor(IContext context);",
"default Attribute getAttribute(AttributeName attributeName) {return (Attribute) attributeName;}",
"boolean hasStoreAttribute();",
"Attribute getAttribute();",
"@Override\n\tpublic Object readAttribute(URI resource, String attrName)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\treturn null;\n\t}",
"java.lang.String getAttribute();",
"public <T> T get(String attr) {\n return (T) (super.get(attr));\n }",
"Object getAttribute(String key);",
"Object getAttribute(String key);",
"public Attribute fetchAttribute(String key, String value);",
"Object getAttribute(String name);",
"Object getAttribute(String name);",
"Object getAttribute(String name);",
"public Integer getIntegerAttribute();",
"public abstract String get();",
"public org.omg.uml.foundation.core.Attribute getAttribute();",
"public Long getLongAttribute();",
"String getAttribute();",
"public GenericAttribute getAttribute () {\n return attribute;\n }",
"public org.python.Object __getattribute__(java.lang.String name);",
"Object getAttribute( String attrName ) throws FileSystemException;",
"public Object get(AttributeDefinition attribute)\n throws UnknownAttributeException\n {\n if(!builtinAttributes.containsKey(attribute.getName()))\n {\n throw new UnknownAttributeException(attribute.getName()+\n \t\t\" declared in \"+attribute.getDeclaringClass().getName()+\n \t\t\" is not a builtin attribute \");\n }\n Method method = (Method)builtinAttributes.get(attribute.getName());\n try\n {\n return method.invoke(this, new Object[0]);\n }\n catch(Exception e)\n {\n throw new BackendException(\"failed to invoke method for builtin attribute \"+\n attribute.getName(), e);\n }\n }",
"public Double getDoubleAttribute();",
"@SuppressWarnings(\"unchecked\")\n\tpublic U accessObject()\n\t{\n\t\treturn (primaryKey == null)?(null):\n\t\t (U)bean(GetUnity.class).getUnited(primaryKey);\n\t}",
"<T> T getSessionAttribute( String key );",
"public abstract int getPersistence();",
"public String getAttr() {\n return attr;\n }",
"protected abstract Object _get(String key);",
"public Object getTransient(Object key);",
"public A force_get()\n {\n throw new UnsupportedOperationException();\n }",
"public int storeAttribute(String key, String value);",
"String booleanAttributeToGetter(String arg0);",
"ISObject forceGet(String key);",
"protected abstract MethodDescription accessorMethod();",
"public Object getAttribute(Object key);",
"public String getStringAttribute();",
"public Attribute fetchAttributeById(int attribId);",
"@Override\n protected AttributeHandler getXEOAttribute(String sAttributeName) {\n AttributeHandler oAttrHandler;\n\t\ttry {\n\t\t\toAttrHandler = super.decodeAttribute( sAttributeName, oBridgeRow.getObject() );\n\t\t} catch ( boRuntimeException e ) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n \n \n return oAttrHandler;\n }",
"public Object getAttribute(String name);",
"public String attribute() {\n return this.attribute;\n }",
"public String getAttributeValue(int id) {\n Attribute attr = super.findById(id, false);\n if (attr != null ) {\n return attr.getValue();\n } else {\n return \"unknown attribute\";\n }\n }",
"public Object get(String aName) { return _attrMap.get(aName); }",
"com.google.protobuf.ByteString getAttributeBytes();",
"public String getAttributeName() {\n/* 85 */ return this.attributeName;\n/* */ }",
"public String getGetter() {\n return \"get\" + getCapName();\n }",
"public HbAttributeInternal getAttribute(String name);",
"private AbstractManagedAttribute findAttribute(String attribute) throws AttributeNotFoundException {\r\n AbstractManagedAttribute att = attributes.get(attribute);\r\n if (att == null) {\r\n throw new AttributeNotFoundException(\"Attribute \" + attribute + \" could not be found\");\r\n }\r\n return att;\r\n }",
"public StructuredData getStructuredDataAttribute();",
"public java.lang.Object getCachedAttributeValue(Symbol attrName, java.lang.Object defaultValue);",
"Object getAttribute(String key)\n throws ProcessingException;",
"public Object findAttributeValue(GuidelineInterpreter glmanager,\n\t\t\tString className, Object obj, String attribute)\n\t\t\t\t\tthrows PCA_Session_Exception {\n\n\t\tKnowledgeBase kb = kbmanager.getKB();\n\t\tObject valueObject = null;\n\t\tif (className.equals(\"Medication\")) {\n\t\t\t// Cls classInstance = kb.getCls(className);\n\t\t\t// check to see if attribute is an attribute of classInstance\n\t\t\t// if yes, get value from obj\n\n\t\t\t// start hacks\n\t\t\tif (attribute.equals(\"daily_dose\")) {\n\t\t\t\tvalueObject = attributeValue(className, (String) obj,\n\t\t\t\t\t\t\"daily_dose\");\n\t\t\t\tif (valueObject != null) {\n\t\t\t\t\tlogger.debug(\"DataHandler findAttributeValue classname= \"\n\t\t\t\t\t\t\t+ className + \" Object= \" + obj.toString()\n\t\t\t\t\t\t\t+ \" valueObject = \" + valueObject.toString());\n\t\t\t\t} else\n\t\t\t\t\tlogger\n\t\t\t\t\t.debug(\"DataHandler findAttributeValue Null valueObject classname= \"\n\t\t\t\t\t\t\t+ className + \" Object= \" + obj.toString());\n\t\t\t\treturn valueObject;\n\t\t\t} else {\n\t\t\t\tif (attribute.equals(\"dose_level\")) {\n\t\t\t\t\tObject dailyDose = attributeValue(className, (String) obj,\n\t\t\t\t\t\t\t\"daily_dose\");\n\t\t\t\t\tlogger.debug(\"in data handler: findAttributeValue class=\"\n\t\t\t\t\t\t\t+ className + \" object=\" + (String) obj\n\t\t\t\t\t\t\t+ \" dailyDose=\" + dailyDose);\n\t\t\t\t\tif (dailyDose != null) {\n\t\t\t\t\t\tCls drug = kb.getCls((String) obj);\n\t\t\t\t\t\tif (drug == null) {\n\t\t\t\t\t\t\tlogger.error(\"Data handler: drug \" + (String) obj\n\t\t\t\t\t\t\t\t\t+ \" not in knowledge base\");\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWhereComparisonFilter where = new WhereComparisonFilter(\n\t\t\t\t\t\t\t\t\"generic_drug\", \"eq\", drug);\n\t\t\t\t\t\tCollection instances = kbmanager.findInstances(kb\n\t\t\t\t\t\t\t\t.getCls(\"Guideline_Drug\"), where, glmanager);\n\t\t\t\t\t\tif ((instances != null) && (!instances.isEmpty())) {\n\t\t\t\t\t\t\tif (instances.size() > 1) {\n\t\t\t\t\t\t\t\tthrow new PCA_Session_Exception(\n\t\t\t\t\t\t\t\t\t\t\"Ambiguous Guideline_Drug instance \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" more than one matches \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ obj);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tGuideline_Drug glDrug = (Guideline_Drug) instances\n\t\t\t\t\t\t\t\t\t\t.iterator().next();\n\t\t\t\t\t\t\t\tlogger\n\t\t\t\t\t\t\t\t.debug(\"in data handler: findAttributeValue glDrug=\"\n\t\t\t\t\t\t\t\t\t\t+ glDrug.getlabelValue());\n\t\t\t\t\t\t\t\tCollection ranges = glDrug\n\t\t\t\t\t\t\t\t\t\t.getdose_level_rangesValue();\n\t\t\t\t\t\t\t\tif (ranges != null) {\n\t\t\t\t\t\t\t\t\tfor (Iterator i = ranges.iterator(); i\n\t\t\t\t\t\t\t\t\t\t\t.hasNext();) {\n\t\t\t\t\t\t\t\t\t\tRange_Mapping_Entry mappingEntry = (Range_Mapping_Entry) i\n\t\t\t\t\t\t\t\t\t\t\t\t.next();\n\t\t\t\t\t\t\t\t\t\tif (mappingEntry\n\t\t\t\t\t\t\t\t\t\t\t\t.withinLimits(((Float) dailyDose)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.floatValue())) {\n\t\t\t\t\t\t\t\t\t\t\tvalueObject = mappingEntry\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getabstract_valueValue()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getName();\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tlogger.warn(\"No Guideline_Drug corresponds to \"\n\t\t\t\t\t\t\t\t\t+ drug.getName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}// end hacks\n\t\tif (valueObject != null)\n\t\t\tlogger\n\t\t\t.debug(\"in comparison filter: findAttributeValue, returning doselevel\"\n\t\t\t\t\t+ valueObject.toString());\n\t\telse\n\t\t\tlogger\n\t\t\t.debug(\"in comparison filter: findAttributeValue, returning null doselevel\");\n\t\treturn valueObject;\n\t}",
"public Object getProperty(String attName);",
"public String get();",
"M getById(Serializable id) throws DataAccessException;",
"StoragePrimitive get(String key);",
"public abstract Object get(String oid) throws OIDDoesNotExistException;",
"public java.lang.String get__OID() throws com.intersys.objects.CacheException {\n com.intersys.cache.Dataholder dh = mInternal.getProperty(\"%%OID\",false);\n return dh.getString();\n }",
"@Override\n\tpublic void saveAttribute(URI resource, String attrName, Object attrValue)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\t\n\t}",
"public int getAttribute() {\n return Attribute;\n }",
"@FameProperty(name = \"accessors\", derived = true)\n public Collection<TWithAccesses> getAccessors() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }",
"public String getStr(String attr) {\n return (String) super.get(attr);\n }",
"@Override\n String get();",
"Attribute createAttribute();",
"Attribute createAttribute();",
"public Object getAttribute(String attribute_name) \n throws AttributeNotFoundException,\n MBeanException,\n ReflectionException {\n if (attribute_name == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute name cannot be null\"), \n \"Cannot invoke a getter of \" + dClassName + \" with null attribute name\");\n }\n\n attribute_name = RunTimeSingleton.decode(attribute_name, \"US-ASCII\"); // HtmlAdapter made from info/admin -> info%2Fadmin\n // \"logging/org.xmlBlaster.engine.RequestBroker\"\n if (attribute_name.startsWith(\"logging/\"))\n attribute_name = attribute_name.substring(8); // \"org.xmlBlaster.engine.RequestBroker\"\n\n try {\n Level level = this.glob.getLogLevel(attribute_name);\n return level.toString();\n }\n catch (ServiceManagerException e) {\n if (attribute_name == null || attribute_name.length() == 0 || \"logging/\".equals(attribute_name)) return Level.INFO.toString();\n throw(new AttributeNotFoundException(\"Cannot find '\" + attribute_name + \"' attribute in \" + dClassName));\n }\n }",
"protected Object getAttrInvokeAccessor(int index, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case SEQUENCENO:\n return getSequenceNo();\n case LINENUMBER:\n return getLineNumber();\n case COUNTRY:\n return getCountry();\n case ATTRIBUTE1:\n return getAttribute1();\n case ATTRIBUTE2:\n return getAttribute2();\n case ATTRIBUTE3:\n return getAttribute3();\n case ATTRIBUTE4:\n return getAttribute4();\n case ATTRIBUTE5:\n return getAttribute5();\n case LASTUPDATEDATE:\n return getLastUpdateDate();\n case LASTUPDATEDBY:\n return getLastUpdatedBy();\n case LASTUPDATELOGIN:\n return getLastUpdateLogin();\n case CREATEDBY:\n return getCreatedBy();\n case CREATIONDATE:\n return getCreationDate();\n case ITEMKEY:\n return getItemKey();\n case ROWID:\n return getRowID();\n default:\n return super.getAttrInvokeAccessor(index, attrDef);\n }\n }",
"public Long getLong(String attr) {\n return (Long) super.get(attr);\n }",
"public abstract T get(String key);",
"IAttributes getAttributes();",
"public int getAtt(){ \r\n return att;\r\n }",
"String get();",
"String get();",
"io.dstore.values.IntegerValue getActive();",
"public Object getRecord(int key) {\n throw new UnsupportedOperationException(\"implement me!\");\n }",
"public Integer getAttrId() {\n return attrId;\n }",
"public Object attribute(String name) {\n return Classes.getFieldValue(this, name);\n }",
"public synchronized Object getAttribute(String key) {\n return attributes.get(key);\n }",
"RakudoObject get_attribute(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name);",
"public java.lang.String getAttributeValue() {\r\n return localAttributeValue;\r\n }",
"public String getSex(){ //\"public\" access allows other classes to retrieve the value of \"sex\", but since there\n // is no setter it cannot be changed from outside the class = Encapsulation/Inkapsling\n return this.sex;\n }",
"Object get(ID id) throws Exception;",
"public Double getDouble(String attr) {\n return (Double) super.get(attr);\n }",
"@Override\n public boolean isAttribute()\n {\n return attribute;\n }",
"private String loadAttributeName() {\n return parseMapField().getKey();\n }",
"@Override\r\n\tpublic String getAttribute() {\n\t\treturn null;\r\n\t}",
"public BigInteger getBigIntegerAttribute();",
"protected abstract Actor getAccessor();",
"@Override\n\tpublic Attribute attribute(final int index) {\n\t\treturn attributes[index];\n\t}",
"private void mappingMethodGet() throws SecurityException, NoSuchMethodException{\n\t\tString aux = upFirstLetter();\n\t\tString methodGet = \"get\" + aux;\n\t\tthis.methodGet = this.classFather.getMethod(methodGet);\n\t}",
"@Override\n public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException {\n if (attribute.equals(\"UpTime\")) {\n return upTime();\n }\n return null;\n }",
"@JsonGetter(\"persistent\")\r\n public boolean getPersistent ( ) { \r\n return this.persistent;\r\n }",
"@Override\n\tpublic Object getAttribute(String arg0, int arg1) {\n\t\treturn null;\n\t}",
"public String[] getInvalidAttribute();",
"Attributes getAttributes();",
"public abstract boolean isPersistent();"
] | [
"0.65564257",
"0.6234294",
"0.6131241",
"0.6101339",
"0.5982182",
"0.5946656",
"0.58618927",
"0.585744",
"0.583194",
"0.57711107",
"0.57669747",
"0.5698569",
"0.5661181",
"0.5661181",
"0.563633",
"0.5599603",
"0.5599603",
"0.5599603",
"0.5575623",
"0.55640113",
"0.55601895",
"0.5555979",
"0.55504483",
"0.5531888",
"0.5520282",
"0.5514083",
"0.5477122",
"0.54732275",
"0.54619724",
"0.545773",
"0.54570794",
"0.5452858",
"0.54386455",
"0.5436345",
"0.54337615",
"0.54087955",
"0.5397154",
"0.53962183",
"0.5395455",
"0.5383862",
"0.53764707",
"0.5369584",
"0.53676295",
"0.5351843",
"0.53424656",
"0.5341797",
"0.5338269",
"0.533011",
"0.5327783",
"0.5309773",
"0.5304429",
"0.52976614",
"0.52909195",
"0.5279892",
"0.5271175",
"0.5271049",
"0.5258656",
"0.52559096",
"0.524057",
"0.5212926",
"0.5208046",
"0.5201928",
"0.5192305",
"0.5188285",
"0.5168743",
"0.51489574",
"0.51444525",
"0.514253",
"0.514253",
"0.51283413",
"0.512535",
"0.5122665",
"0.5121463",
"0.5108004",
"0.5094354",
"0.50907713",
"0.50907713",
"0.5078173",
"0.507294",
"0.50620574",
"0.50559014",
"0.5052933",
"0.5048571",
"0.50437707",
"0.50432134",
"0.50431436",
"0.50394106",
"0.50330704",
"0.5029888",
"0.50254184",
"0.5024002",
"0.502075",
"0.50172466",
"0.5004223",
"0.5001933",
"0.49994993",
"0.49960732",
"0.49894315",
"0.49755293",
"0.49744272"
] | 0.5623917 | 15 |
Set accessor for persistent attribute: storebad | public void setStorebad(java.lang.Integer newStorebad)
throws java.rmi.RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {\n\n }",
"void setInternal(ATTRIBUTES attribute, Object iValue);",
"String attributeToSetter(String name);",
"public void set(File file, String view, String attribute, Object value, boolean create) {\n/* 131 */ throw unsettable(view, attribute);\n/* */ }",
"public int storeAttribute(String key, String value);",
"@Override\n\tpublic void saveAttribute(URI resource, String attrName, Object attrValue)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\t\n\t}",
"void setProperty(String attribute, String value);",
"@Override\npublic void setAttributes() {\n\t\n}",
"void setInt(int attributeValue);",
"public String getReadWriteAttribute();",
"protected abstract void setContextAttribute(String name, Object value);",
"public void set(AttributeDefinition attribute, Object value)\n throws UnknownAttributeException, ModificationNotPermitedException\n {\n if(builtinAttributes.containsKey(attribute.getName()))\n {\n throw new IllegalArgumentException(\"builtin attribute \"+attribute.getName()+\n \"cannot be modified with set method\"); \n }\n else\n {\n throw new UnknownAttributeException(\"not a builtin attribute\");\n }\n }",
"@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t}",
"@Override\n public void setAttribute(boolean f)\n {\n checkState();\n attribute = f;\n }",
"public void setAttributeValue(java.lang.String param) {\r\n localAttributeValueTracker = true;\r\n\r\n this.localAttributeValue = param;\r\n\r\n\r\n }",
"public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;",
"void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws WrongReferenceAttributeValueException;",
"@Override\n\t\tprotected void resetAttribute() {\n\t\t}",
"public void setModified(AttributeDefinition attribute)\n throws UnknownAttributeException\n {\n if(builtinAttributes.containsKey(attribute.getName()))\n {\n throw new IllegalArgumentException(\"builtin attribute \"+attribute.getName()+\n \"cannot be modified this way\"); \n }\n else\n {\n throw new UnknownAttributeException(\"not a builtin attribute\");\n }\n }",
"@Override\n\t\tpublic void setAttribute(String name, Object value) {\n\t\t\t\n\t\t}",
"void setAttribute( String attrName, Object value ) throws FileSystemException;",
"@Override\n\t\tpublic void setAttribute(String name, Object o) {\n\t\t\t\n\t\t}",
"@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }",
"protected LPDMODOMAttribute() {\n }",
"public void setAttrib(String name, String value);",
"protected SLEXMMAttribute(SLEXMMStorageMetaModel storage) {\n\t\tsuper(storage);\n\t}",
"void setString(String attributeValue);",
"public boolean setProperty(String attName, Object value);",
"public void setSessionAttribute(String name, Object val, String scope) { \n\t\tthrow new UnsupportedOperationException();\n\t}",
"@Override\n\tpublic void setAttribute(String arg0, Object arg1) {\n\n\t}",
"@Override\n\tpublic void setValue(final Attribute att, final String value) {\n\n\t}",
"@Override\n\t\tprotected void resetAttribute() {\n\t\t\tsuper.resetAttribute();\n\t\t\tmissing = false;\n\t\t\tmalformed = false;\n\t\t}",
"@Override\n\tpublic Object getAttribute(String appKey,String contextpath, String sessionID, String attribute,Session session) {\n\t\tString _attribute = SessionUtil.wraperAttributeName(appKey,contextpath, attribute);\n\t\tObject value = sessionStore.getAttribute(appKey, contextpath, sessionID, _attribute,session);\n\t\tif(session.isStoreReadAttributes() && value != null && readcanstore( value))\n\t\t\tsession.modifyAttribute(_attribute, value, ModifyValue.type_data, ModifyValue.type_read);\t\n\t\treturn value;\n\t}",
"@Override\n\tpublic void setAttribute(String name, Object o) {\n\t\t\n\t}",
"public void setAttribute(Object key, Object value);",
"public abstract void setValue(Context c, Object v) throws PropertyException;",
"@Override\n\tpublic void setAttribute(String arg0, Object arg1, int arg2) {\n\n\t}",
"String attributeToGetter(String name);",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case SEQUENCENO:\n setSequenceNo((Number)value);\n return;\n case LINENUMBER:\n setLineNumber((Number)value);\n return;\n case COUNTRY:\n setCountry((String)value);\n return;\n case ATTRIBUTE1:\n setAttribute1((String)value);\n return;\n case ATTRIBUTE2:\n setAttribute2((String)value);\n return;\n case ATTRIBUTE3:\n setAttribute3((String)value);\n return;\n case ATTRIBUTE4:\n setAttribute4((String)value);\n return;\n case ATTRIBUTE5:\n setAttribute5((String)value);\n return;\n case LASTUPDATEDATE:\n setLastUpdateDate((Date)value);\n return;\n case LASTUPDATEDBY:\n setLastUpdatedBy((Number)value);\n return;\n case LASTUPDATELOGIN:\n setLastUpdateLogin((Number)value);\n return;\n case CREATEDBY:\n setCreatedBy((Number)value);\n return;\n case CREATIONDATE:\n setCreationDate((Date)value);\n return;\n case ITEMKEY:\n setItemKey((String)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"@Test\n public void setExtraSavesExtra()\n {\n //arrange\n String expectedExtra = \"some user agent extra\";\n ProductInfo actual = new ProductInfo();\n\n //act\n actual.setExtra(expectedExtra);\n\n //assert\n assertEquals(expectedExtra, Deencapsulation.getField(actual, \"extra\"));\n }",
"public abstract void set(M newValue);",
"public void changeAttrName() {\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case EMPLOYEEPERSONID:\n setEmployeePersonId((Number)value);\n return;\n case CODECOMBINATIONID:\n setCodeCombinationId((Number)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"AdditionalAttributes setAttribute(String name, Object value, boolean force);",
"void setAttribute(String key, Object value)\n throws ProcessingException;",
"EAttribute createEAttribute();",
"@JsonSetter(\"persistent\")\r\n public void setPersistent (boolean value) { \r\n this.persistent = value;\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"@Override\n\tpublic void visitAttribute(Object attr) {\n\t}",
"@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }",
"@Test\n\tpublic void testSetAttribute_UpdateMode() throws NamingException {\n\t\t// Set original attribute value\n\t\tAttribute attribute = new BasicAttribute(\"cn\", \"john doe\");\n\t\ttested.setAttribute(attribute);\n\n\t\t// Set to update mode\n\t\ttested.setUpdateMode(true);\n\n\t\t// Perform test - update the attribute\n\t\tAttribute updatedAttribute = new BasicAttribute(\"cn\", \"nisse hult\");\n\t\ttested.setAttribute(updatedAttribute);\n\n\t\t// Verify result\n\t\tModificationItem[] mods = tested.getModificationItems();\n\t\tassertEquals(1, mods.length);\n\t\tassertEquals(DirContext.REPLACE_ATTRIBUTE, mods[0].getModificationOp());\n\n\t\tAttribute modificationAttribute = mods[0].getAttribute();\n\t\tassertEquals(\"cn\", modificationAttribute.getID());\n\t\tassertEquals(\"nisse hult\", modificationAttribute.get());\n\t}",
"public void flushAttributeWriteCache() throws G2AccessException;",
"protected void setAttrInvokeAccessor(int index, Object value, \n AttributeDefImpl attrDef) throws Exception {\n switch (index) {\n case INVOICESTATUS:\n setInvoiceStatus((String)value);\n return;\n case CHECKBOX:\n setCheckBox((Boolean)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"@Pointcut(\"execution(* com.iamscratches.aopdemo.dao.*.set*(..))\")\n\tpublic void setter() {}",
"boolean hasStoreAttribute();",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception\n {\n switch (index) {\n case SUPPLIERID:\n setSupplierId((Number)value);\n return;\n case NAME:\n setName((String)value);\n return;\n case ONHOLDFLAG:\n setOnHoldFlag((String)value);\n return;\n case STARTDATE:\n setStartDate((Date)value);\n return;\n case ENDDATE:\n setEndDate((Date)value);\n return;\n case LASTUPDATEDATE:\n setLastUpdateDate((Date)value);\n return;\n case LASTUPDATEDBY:\n setLastUpdatedBy((Number)value);\n return;\n case CREATIONDATE:\n setCreationDate((Date)value);\n return;\n case CREATEDBY:\n setCreatedBy((Number)value);\n return;\n case LASTUPDATELOGIN:\n setLastUpdateLogin((Number)value);\n return;\n case ATTRIBUTECATEGORY:\n setAttributeCategory((String)value);\n return;\n case ATTRIBUTE1:\n setAttribute1((String)value);\n return;\n case ATTRIBUTE2:\n setAttribute2((String)value);\n return;\n case ATTRIBUTE3:\n setAttribute3((String)value);\n return;\n case ATTRIBUTE4:\n setAttribute4((String)value);\n return;\n case ATTRIBUTE5:\n setAttribute5((String)value);\n return;\n case ATTRIBUTE6:\n setAttribute6((String)value);\n return;\n case ATTRIBUTE7:\n setAttribute7((String)value);\n return;\n case ATTRIBUTE8:\n setAttribute8((String)value);\n return;\n case ATTRIBUTE9:\n setAttribute9((String)value);\n return;\n case ATTRIBUTE10:\n setAttribute10((String)value);\n return;\n case ATTRIBUTE11:\n setAttribute11((String)value);\n return;\n case ATTRIBUTE12:\n setAttribute12((String)value);\n return;\n case ATTRIBUTE13:\n setAttribute13((String)value);\n return;\n case ATTRIBUTE14:\n setAttribute14((String)value);\n return;\n case ATTRIBUTE15:\n setAttribute15((String)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"Attribute createAttribute();",
"Attribute createAttribute();",
"public void setAge(int age) { this.age = age; }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value,\n AttributeDefImpl attrDef) throws Exception {\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\n return;\n }\n super.setAttrInvokeAccessor(index, value, attrDef);\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\r\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\r\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\r\n return;\r\n }\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {\r\n if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {\r\n AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);\r\n return;\r\n }\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n }",
"public void testBeforeSet() throws Exception {\r\n GroovyClassLoader gcl = new GroovyClassLoader();\r\n final Class<?> testClass = gcl.parseClass(\"class Test { def prop = 'hello' }\");\r\n GroovyObject go = (GroovyObject)testClass.newInstance();\r\n\r\n ProxyMetaClass pmc = ProxyMetaClass.getInstance(testClass);\r\n go.setMetaClass(pmc);\r\n\r\n pmc.setInterceptor( new PropertyAccessInterceptor(){\r\n\r\n public Object beforeGet(Object object, String property, InvocationCallback callback) {\r\n return null;\r\n }\r\n\r\n public void beforeSet(Object object, String property, Object newValue, InvocationCallback callback) {\r\n assertEquals(\"prop\", property);\r\n BeanWrapper bean = new BeanWrapperImpl(object);\r\n bean.setPropertyValue(\"prop\",\"success\");\r\n callback.markInvoked();\r\n }\r\n\r\n public Object beforeInvoke(Object object, String methodName, Object[] arguments, InvocationCallback callback) {\r\n return null;\r\n }\r\n\r\n public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {\r\n return null;\r\n }\r\n });\r\n\r\n go.setProperty(\"prop\", \"newValue\");\r\n Object result = go.getProperty(\"prop\");\r\n assertNotNull(result);\r\n assertEquals(\"success\",result);\r\n }",
"@Override\n\tpublic void setAttrVal(String attrName, Object attrVal) {\n\n\t}",
"protected void setAttrInvokeAccessor(int index, Object value, \r\n AttributeDefImpl attrDef) throws Exception {\r\n switch (index) {\r\n default:\r\n super.setAttrInvokeAccessor(index, value, attrDef);\r\n return;\r\n }\r\n }",
"public void setAttribute(Attribute attribute) \n throws AttributeNotFoundException,\n InvalidAttributeValueException,\n MBeanException, \n ReflectionException {\n if (attribute == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute cannot be null\"), \n \"Cannot invoke a setter of \" + dClassName + \" with null attribute\");\n }\n String name = attribute.getName();\n if (name == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute name cannot be null\"), \n \"Cannot invoke the setter of \" + dClassName + \" with null attribute name\");\n }\n\n name = RunTimeSingleton.decode(name, \"US-ASCII\"); // HtmlAdapter made from info/admin -> info%2Fadmin\n // \"logging/org.xmlBlaster.engine.RequestBroker\"\n if (name.startsWith(\"logging/\"))\n name = name.substring(8); // \"org.xmlBlaster.engine.RequestBroker\"\n\n String value = (String)attribute.getValue();\n log.debug(\"Setting log level of name=\" + name + \" to '\" + value + \"'\");\n\n try {\n Level level = Level.toLevel(value);\n this.glob.changeLogLevel(name, level);\n }\n catch (ServiceManagerException e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.getMessage()));\n }\n catch (Throwable e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.toString()));\n }\n }",
"void softPut(String key, Do.Make<Object> lazyValue);",
"@Override\n\tprotected boolean setSaveAttributes() throws Exception {\n\t\treturn false;\n\t}",
"public void setMyExp(MyExp me);",
"public EdmAttribute setupAttribute(String val) {\n EdmAttribute a = new EdmAttribute(val);\n return a;\n }",
"public void setPersistentString(String key, String value);",
"com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();",
"@Test\n public void testAttributeManagement() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n String attributeValue = \"testValue\";\n tag.addAttribute(attributeName, attributeValue);\n assertEquals(\"Wrong attribute value returned\", attributeValue, tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 1, tag.getAttributes().size());\n assertEquals(\"Wrong attribute in map\", attributeValue, tag.getAttributes().get(attributeName));\n tag.removeAttribute(attributeName);\n assertNull(\"Attribute was not removed\", tag.getAttribute(attributeName));\n }",
"@Mixin(EntityPlayerSP.class)\npublic interface AccessorEntityPlayerSP {\n\n @Accessor(\"handActive\")\n void gsSetHandActive(boolean value);\n\n}",
"public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}",
"public void setProperty(String arg0, Object arg1)\n throws UniquePropertyValueConflictException,\n\n EntityPersistenceException {\n\n }",
"public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }",
"protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception\n {\n switch (index)\n {\n case IDEXPED:\n setIdexped((Number)value);\n return;\n case IDBULTO:\n setIdbulto((Number)value);\n return;\n case IDBULTOORI:\n setIdbultoOri((Number)value);\n return;\n case LARGO:\n setLargo((Number)value);\n return;\n case ANCHO:\n setAncho((Number)value);\n return;\n case ALTO:\n setAlto((Number)value);\n return;\n case IDTIPOBULTO:\n setIdtipobulto((String)value);\n return;\n case PESOCONT:\n setPesocont((Number)value);\n return;\n default:\n super.setAttrInvokeAccessor(index, value, attrDef);\n return;\n }\n }",
"final public void setAttr(final String name, final Object value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\tattr.Object = value;\r\n\t\t}\r\n\t}",
"public void setAttr(String attr) {\n this.attr = attr == null ? null : attr.trim();\n }",
"public void setProtected()\n {\n ensureLoaded();\n m_flags.setProtected();\n setModified(true);\n }",
"@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}",
"void setAttribute(String name, Object value);",
"void setAttribute(String name, Object value);"
] | [
"0.62953603",
"0.6217412",
"0.6067174",
"0.6022866",
"0.59677225",
"0.5949112",
"0.5921301",
"0.5822697",
"0.57583165",
"0.5756301",
"0.57183486",
"0.56902564",
"0.5690005",
"0.5686272",
"0.56828326",
"0.5631741",
"0.56242156",
"0.5593322",
"0.5587495",
"0.55642945",
"0.55527157",
"0.55451614",
"0.551287",
"0.5494351",
"0.54861414",
"0.5477971",
"0.5474016",
"0.5466664",
"0.5445043",
"0.5441147",
"0.5438167",
"0.5437695",
"0.54293585",
"0.5419958",
"0.5408928",
"0.53953916",
"0.5393734",
"0.5390949",
"0.53877413",
"0.53867984",
"0.53744835",
"0.53619605",
"0.5359284",
"0.5356894",
"0.535533",
"0.5341956",
"0.5341149",
"0.5335032",
"0.53331536",
"0.5316428",
"0.53121614",
"0.53027475",
"0.52956486",
"0.52952427",
"0.529499",
"0.5289458",
"0.5289458",
"0.5289458",
"0.5289458",
"0.528649",
"0.52781224",
"0.52781224",
"0.52679724",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.5263144",
"0.52587813",
"0.52587813",
"0.52498835",
"0.52462953",
"0.52450603",
"0.52376103",
"0.52357286",
"0.52357197",
"0.52275485",
"0.52255833",
"0.5216189",
"0.52080727",
"0.51999503",
"0.51993406",
"0.51983565",
"0.51969934",
"0.51886994",
"0.51859313",
"0.5178946",
"0.517469",
"0.5173534",
"0.5172835",
"0.5170728",
"0.5170728"
] | 0.0 | -1 |
Sets the pad to be the current contents of the display buffer. | public ColumnOutput setPad() throws IOException {
StringBuilder p = new StringBuilder((getWidth() == UnlimitedWidth)?b.length():getWidth());
sendToOutput(p);
pad = p.toString().subSequence(0, p.length());
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void set_pad(CArrayFacade<Byte> _pad) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 12;\n\t\t} else {\n\t\t\t__dna__offset = 12;\n\t\t}\n\t\tif (__io__equals(_pad, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, _pad)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, _pad);\n\t\t} else {\n\t\t\t__io__generic__copy( get_pad(), _pad);\n\t\t}\n\t}",
"public void set_pad(CArrayFacade<Byte> _pad) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 29;\n\t\t} else {\n\t\t\t__dna__offset = 21;\n\t\t}\n\t\tif (__io__equals(_pad, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, _pad)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, _pad);\n\t\t} else {\n\t\t\t__io__generic__copy( get_pad(), _pad);\n\t\t}\n\t}",
"public void set_pad(CArrayFacade<Byte> _pad) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 14;\n\t\t} else {\n\t\t\t__dna__offset = 14;\n\t\t}\n\t\tif (__io__equals(_pad, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, _pad)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, _pad);\n\t\t} else {\n\t\t\t__io__generic__copy( get_pad(), _pad);\n\t\t}\n\t}",
"public void setPadding( Integer p ){\r\n\t\tpadding = p;\r\n\t}",
"public void setPadding(int padding) {\n this.padding = padding;\n }",
"public HintPad setPadding(int padding) {\r\n\t\tthis.padding = padding;\r\n\t\treturn this;\r\n\t}",
"public void setPadding(Integer padding)\n {\n getStateHelper().put(PropertyKeys.padding, padding);\n }",
"public Ethernet setPad(boolean pad) {\n this.pad = pad;\n return this;\n }",
"public void set_pad1(CArrayFacade<Byte> _pad1) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 60;\n\t\t} else {\n\t\t\t__dna__offset = 60;\n\t\t}\n\t\tif (__io__equals(_pad1, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, _pad1)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, _pad1);\n\t\t} else {\n\t\t\t__io__generic__copy( get_pad1(), _pad1);\n\t\t}\n\t}",
"public boolean isPad() {\n return pad;\n }",
"public void set_pad1(CArrayFacade<Byte> _pad1) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 76;\n\t\t} else {\n\t\t\t__dna__offset = 76;\n\t\t}\n\t\tif (__io__equals(_pad1, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, _pad1)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, _pad1);\n\t\t} else {\n\t\t\t__io__generic__copy( get_pad1(), _pad1);\n\t\t}\n\t}",
"public void loopPad(Pad pad){\r\n // Laat klant een pad lopen\r\n System.out.println(\"Standaard Klant loopt nu pad:\" + pad.getPadNaam() );\r\n }",
"@NonNull\n public Builder setPadding(@NonNull Padding padding) {\n mImpl.setPadding(padding.toProto());\n mFingerprint.recordPropertyUpdate(\n 3, checkNotNull(padding.getFingerprint()).aggregateValueAsInt());\n return this;\n }",
"Pad createPad(String title);",
"public void setPadre (nodeTree pPadre){\n this._padre=pPadre;\n }",
"public void setShapePadding(int padding) {\n this.mShapePadding = padding;\n }",
"private void setupPadding()\n\t{\n\t\tContext context = getContext();\n\t\tResources res = context.getResources();\n\t\tint main = (int) res.getDimension(R.dimen.sp_main);\n\t\tthis.mPadding[0] = main;\n\t\tthis.mPadding[1] = main;\n\t\tthis.mPadding[2] = 0;\n\t\tthis.mPadding[3] = main;\n\t}",
"abstract void setHeaderPadding(boolean headerPadding);",
"private void set(){\n resetBuffer();\n }",
"public void setSPACE(Long SPACE) {\n this.SPACE = SPACE;\n }",
"public void setPadding(float p) {\n\t\tfor(Node node : selected_nodes) {\n\t\t\tnode.setPadding(p);\n\t\t}\n\t}",
"private static BufferedImage pad(BufferedImage in,int padding) {\n\t\tBufferedImage out = new BufferedImage( in.getWidth() + 2*padding, in.getHeight() + 2*padding, BufferedImage.TYPE_INT_ARGB );\n\t\tGraphics2D g = out.createGraphics();\n\t\tg.drawImage(in, 2, 2, null);\n\t\tg.dispose();\n\t\treturn out;\n\t}",
"public void internalSetPadding(int i, int i2, int i3, int i4) {\n }",
"public void saveWithPadding(DataWriter writer) {\n save(writer);\n writer.writeNull(Constants.SHORT_SIZE);\n }",
"public Calc(){\r\n CalcPad();\r\n }",
"Padding createPadding();",
"public static String pad(int fieldWidth, char padChar, String s) {\n StringBuilder sb = new StringBuilder();\n for (int i = s.length(); i < fieldWidth; i++) {\n sb.append(padChar);\n }\n sb.append(s);\n\n return sb.toString();\n }",
"public Graph1 pad () { return new Graph1Pad (C,this); }",
"private Object pad(int ca) {\n\t\tif (ca >= 10)\n\t\t\treturn String.valueOf(ca);\n\t\telse\n\t\t\treturn \"0\" + String.valueOf(ca);\n\n\t\t\n\t}",
"public void printBuffer()\r\n\t{\r\n\t\tint stop;\r\n\t\t\r\n\t\tif (prvsize > 0) {\r\n\t\t\tstop = (buffer[1-currentbuf][prvsize-1] == '\\n' ? prvsize-1 : prvsize);\r\n\t\t\tif (stop != 0) \r\n\t\t\t\tsyserr.println(new String(buffer[1-currentbuf], 0, stop));\r\n\t\t\telse\r\n\t\t\t\tsyserr.println(\"(blank line)\");\r\n\t\t}\r\n\t\tif (bufpos > 0) {\r\n\t\t\tstop = (buffer[currentbuf][bufpos-1] == '\\n' ? bufpos-1 : bufpos);\r\n\t\t\tif (stop != 0) \r\n\t\t\t\tsyserr.println(new String(buffer[currentbuf], 0, stop));\r\n\t\t\telse\r\n\t\t\t\tsyserr.println(\"(blank line)\");\r\n\t\t}\r\n\t}",
"private void constructLog() {\r\n String padStr = new String();\r\n padStr = \"Pad with slices \";\r\n\r\n if (padMode == PAD_FRONT) {\r\n padStr += \" using front slices\";\r\n } else if (padMode == PAD_BACK) {\r\n padStr += \" using back slices\";\r\n } else if (padMode == PAD_HALF) {\r\n padStr += \" using front and back slices\";\r\n }\r\n\r\n historyString = new String(\"PadWithSlices(\" + padStr + \")\\n\");\r\n }",
"public void print(char c) {\n\n if(c == '\\n') {\n x = 0;\n if(++y >= ROWS)\n y = 0;\n return;\n } else if(c == '\\t') {\n print(' ');\n print(' ');\n print(' ');\n print(' ');\n return;\n }\n\n int value = calculateMemValue(c);\n content[y][x] = value;\n\n if(focused == this) {\n int index = (y * Terminal.COLS) + x;\n if(0 <= index && index < (COLS * ROWS))\n mem.screen[index] = (short) value;\n }\n\n if(++x >= COLS) {\n x = 0;\n if(++y >= ROWS)\n y = 0;\n }\n }",
"public void setPadre(java.lang.String newPadre) {\n\t\tif (instanceExtension.needValuesOnMarkDirty())\n\t\t\tinstanceExtension.markDirty(0,getPadre(),newPadre);\n\t\telse\n\t\t\tinstanceExtension.markDirty(0);\n\t\tdataCacheEntry.setPadre(newPadre);\n\t}",
"private void setupDisplay() {\n sizeFirstField_.setText(Double.toString(af_.SIZE_FIRST));\n numFirstField_.setText(Double.toString(af_.NUM_FIRST));\n sizeSecondField_.setText(Double.toString(af_.SIZE_SECOND));\n numSecondField_.setText(Double.toString(af_.NUM_SECOND));\n cropSizeField_.setText(Double.toString(af_.CROP_SIZE));\n thresField_.setText(Double.toString(af_.THRES));\n channelField1_.setText(af_.CHANNEL1);\n channelField2_.setText(af_.CHANNEL2);\n }",
"public void updateDisplayRoom() {\n roomDisplayArray = new String[roomHeight][roomWidth];\n initalizeRoomDisplayArray();\n addDoorsToRoomDisplayArray();\n addContentsToRoomDisplayArray();\n }",
"public int getPadding() {\n return padding;\n }",
"public int addPadding() {\n\t\tCodeItem codeItem = getCodeItem();\n\t\tint padding = codeItem.getSize() % 4;\n\t\tif (padding != 0) {\n\t\t\tif (padding == 2) {\n\t\t\t\tcodeItem.addInstruction(new InstructionFormat10X(0));\n\t\t\t} else {\n\t\t\t\tthrow new RuntimeException(\"Padding can only be 0 or 2 ! (\" + method.getMethodName() + \" \" + method.getClassName() + \" \" + codeItem.getSize() + \" \" + padding + \")\");\n\t\t\t}\n\t\t}\n\t\treturn padding;\n\t}",
"@Override\n public void setPadding(int left, int top, int right, int bottom) {\n super.setPadding(left, top, right, bottom);\n updatePolygonSize(left, top, right, bottom);\n invalidate(left, top, right, bottom);\n }",
"public void display() {\n\t\tapplet.image(applet.loadImage(\"/keypad.png\"), 22,410);\n\t\t// TODO Auto-generated method stub\n\n\t}",
"public void setCellpadding(java.lang.String cellpadding)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CELLPADDING$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CELLPADDING$30);\n }\n target.setStringValue(cellpadding);\n }\n }",
"private void updateDisplayChars() {\n\t\tmShuffleFrag.updateDisplayChars(mCharDisp);\n\t}",
"@SuppressWarnings(\"unused\")\n private void setPadding(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n JSONObject padding = args.getJSONObject(1);\n int left = padding.getInt(\"left\");\n int top = padding.getInt(\"top\");\n int bottom = padding.getInt(\"bottom\");\n int right = padding.getInt(\"right\");\n map.setPadding(left, top, right, bottom);\n this.sendNoResult(callbackContext);\n }",
"private void draw (String printable, StringBuffer canvas) {\r\n \t\t\tcanvas.append(\"| \");\r\n \t\t\t\r\n \t\t\tcanvas.append(printable);\r\n \t\t\tfor (int i=printable.length(); i<width-4; i++) //Fill in the spaces.\r\n \t\t\t{\r\n \t\t\t\tcanvas.append(' ');\r\n \t\t\t}\r\n \t\t\tcanvas.append(\" |\\n\");\r\n \t\t}",
"public void resetBuffer() {\n\n\t}",
"public void setScaleZonePadding(int zonePadding){\n this.mScaleZonePadding = Utils.dp2px(mContext, zonePadding);\n }",
"public void setIndentFiller(String filler) {\n spaceFill = filler;\n }",
"public static String lpadding(String content, int len, char pad){\n StringBuilder sb = new StringBuilder();\n for(int i = 0; i < len - content.length(); i++){\n sb.append(pad);\n }\n sb.append(content);\n return sb.toString();\n }",
"public void setPadre(Nodo parent) {\n this.padre = parent;\n }",
"public void setPadre(Nodo_m_ario padre) {\n\t\tthis.padre = padre;\n\t}",
"private void clear() {\n\t\tif (null != PinPadController) {\n\t\t\tnew Thread() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tPinPadController.PINPad_clear();\n\t\t\t\t};\n\t\t\t}.start();\n\t\t}\n\t}",
"public void xsetCellpadding(org.apache.xmlbeans.XmlString cellpadding)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CELLPADDING$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(CELLPADDING$30);\n }\n target.set(cellpadding);\n }\n }",
"public static void SPsetPaddingForFT(Context context, int number){\n SharedPreferences.Editor edit = context.getSharedPreferences(\"DEFAULTS\", Context.MODE_PRIVATE).edit();\n edit.putInt(\"paddingNumber\", number);\n edit.apply();\n\n ArrayList<Outfit> list = getOutfitList(context);\n if(list.size()>0){\n for(int i = 0 ; i<list.size(); i++){\n list.get(i).setPaddingNumber(number);\n }\n saveOutfitJSON(context, list);\n }\n }",
"void flushDigits() {\n allDigits += preDigits;\n //System.out.append(predigits);\n preDigits.setLength(0);\n }",
"public WriterOptions blockPadding(boolean value) {\n blockPaddingValue = value;\n return this;\n }",
"public void resetBuffer(){\n bufferSet = false;\n init();\n }",
"public void unsetCellpadding()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(CELLPADDING$30);\n }\n }",
"void clear_display(char[][] _display) {\n for (int i = 0; i < 72; i++) {\n for (int j = 0; j < 37; j++) {\n _display[i][j] = ' ';\n }\n }\n }",
"public void setVideoBufferByte(int index, byte data)\n {\n this.videocard.vgaMemory[index] = data;\n }",
"int getPadding();",
"void setPaperSize(short size);",
"@Override\r\n public void display(DirectMediaPlayer mediaPlayer, Memory[] nativeBuffers, BufferFormat bufferFormat) {\r\n if (writable_image == null) {\r\n return;\r\n }\r\n Platform.runLater(() -> {\r\n Memory nativeBuffer = mediaPlayer.lock()[0];\r\n try {\r\n ByteBuffer byteBuffer = nativeBuffer.getByteBuffer(0, nativeBuffer.size());\r\n getPW().setPixels(0, 0, bufferFormat.getWidth(), bufferFormat.getHeight(), pixel_format, byteBuffer, bufferFormat.getPitches()[0]);\r\n }\r\n finally {\r\n mediaPlayer.unlock();\r\n }\r\n });\r\n }",
"void switchPads(final Color colorPadLeft, final Color colorPadCenter, final Color colorPadRight)\r\n\t\t\tthrows ToyPadException;",
"private void resetBuffer() {\n baos.reset();\n }",
"public void displayBoard() {\n System.out.printf(\"%20s\",\"\"); // to add spacing\n for(int i = 0; i < space[0].length; i++) //Put labels for number axis\n {\n System.out.printf(\"%4d\",i+1);\n }\n System.out.println();\n for(int row = 0; row < this.space.length; row++) { //Put letter labels and appropriate coordinate values\n System.out.print(\" \"+ (char)(row+'A') + \"|\");\n for (String emblem: this.space[row]) //coordinate values\n System.out.print(emblem + \" \");\n System.out.println();\n }\n }",
"private static String pad(String src, char fill, int length, boolean isPadRight) {\n\t\tif (src == null) src = \"\"; \n\t\tStringBuilder sb = new StringBuilder();\n\t\tint startLoc = length - src.length();\n\n\t\tint stringLen = src.length();\n\t\tif (stringLen > length) stringLen = length;\n\t\tif (isPadRight) sb.append(src.substring(0, stringLen));\n\t\tfor (int i = 0; i < startLoc; i++) {\n\t\t\tsb.append(fill);\n\t\t}\n\t\t\n\t\tif (! isPadRight)sb.append(src.substring(0, stringLen));\n\n\t\treturn sb.toString();\n\t}",
"public void configure(T aView) { aView.setText(\"Button\"); aView.setPadding(2,2,2,2); }",
"public void setTerminal(TerminalEmulatorField terminal)\r\n\t{\r\n\t\tconnection_.setTerminalDimensions(terminal.getNumCols(), terminal.getNumRows(), \r\n\t\t\t\tterminal.FONT_CHAR_WIDTH, terminal.FONT_CHAR_HEIGHT);\r\n\t}",
"public String pad( String value, int places, String padCharacter )\n {\n \tStringBuilder sb = new StringBuilder();\n \t\n \tsb.append( value );\n \t\n \twhile( sb.length() < places )\n \t{\n \t\tsb.append( padCharacter );\n \t}\n \t\n \treturn sb.toString();\n }",
"public void setPadding(float left, float top, float right, float bottom) {\n\t\tfor(Node node : selected_nodes) {\n\t\t\tnode.setPadding(left, top, right, bottom);\n\t\t}\n\t}",
"public void layoutSetting(PlayerHolder mHolder){\r\n // update the layout width\r\n mHolder.number.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.name.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.twomade.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.twotried.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.threemade.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.threetried.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.ftmade.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.fttried.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.defrebound.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.offrebound.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.assist.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.block.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.steal.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.turnover.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.foul.getLayoutParams().width = MultiDevInit.cellW;\r\n mHolder.point.getLayoutParams().width = MultiDevInit.cellW;\r\n // update the layout height\r\n mHolder.number.getLayoutParams().height = MultiDevInit.recordRowH;\r\n }",
"public Display()\n {\n phrase = \"0\";\n screen = new char[1];\n }",
"public void resetPaddleWidthToOriginal(){\n myRectangle.setWidth(PADDLE_LENGTH);\n myLength = PADDLE_LENGTH;\n }",
"public String padDataForOutputTable(int padding) {\n\t\treturn String.format(\"%-\" + padding + \"s\", this.getWeight());\n\t}",
"private static StringBuffer Pad(int depth) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < depth; i++)\r\n\t\t\tsb.append(\" \");\r\n\t\treturn sb;\r\n\t}",
"public void setJustification(int val) throws IOException {\n writer.write(0x1B);\n writer.write(\"a\");\n writer.write(val);\n writer.flush();\n }",
"public FormatInteger blankFill(){\n fillCharacter = BLANK_CHAR;\n return this;\n }",
"public void originalSpace() {\n\t\tpos.x = 65;\n\t\tpos.y = p.height/2 + 100;\n\t\t\n\t}",
"public static void padWithBytes(ArrayList<Byte> array, int padCount) {\n for (int i = 0; i < padCount; i++) {\n array.add((byte)0);\n }\n }",
"@FXML\r\n private void clearScreen() {\n if(flag==1)txtDisplay.setText(\"\");\r\n }",
"public FormatInteger zeroFill(){\n fillCharacter = ZERO_CHAR;\n return this;\n }",
"@Override\n public void display(AsciiPanel panel){\n panel.clear();\n panel.writeCenter(\"Qui est tu?\", 10);\n }",
"private void setMemory() {\n\t\tlong allMemory = MemoryManager.getPhoneTotalRamMemory();\n\t\tlong freeMemory = MemoryManager.getPhoneFreeRamMemory(this);\n\t\tlong usedMemory = allMemory - freeMemory;\n\t\tint angle = (int) (usedMemory*360/allMemory);\n\t\tclearView.setAngleWithAnim(angle);\n\t}",
"private void writeChar(byte[] bytes) {\n // let terminal do auto wrap around. \n term.writeChar(bytes);\n\n // update cursor \n //int x=term.getCursorX(); \n //int y=term.getCursorY();\n //term.putChar(bytes, x, y);\n // increment: let terminal do auto wrap around. \n //term.moveCursor(1,0); \n\n }",
"public native void setKeyboardLayout(String KLID);",
"private void numberDisplayAlignment() {\n numberDisplay.setAlignment(Pos.CENTER_RIGHT);\n numberDisplay.setPrefSize(20, 10);\n }",
"protected static String pad(int c) {\n if (c >= 10)\n return String.valueOf(c);\n else\n return \"0\" + String.valueOf(c);\n }",
"public final void setDisplay(Display display) {\r\n\t\tthis.display = display;\r\n\t}",
"@Override\n\tpublic void builder(ByteBuffer buffer) {\n\t\tsetV(buffer);\n\t\tsetO(buffer);\n\t\tsetT(buffer);\n\t\tsetLen(buffer);\n\t\tsetContents(buffer);\n\t\tsetTotalByteLength();\n\t}",
"public void draw(Canvas canvas, Paint paint) {\n if (mAutoResize) {\n float sizeTextMain = getResources().getDimensionPixelSize(R.dimen.dialpad_key_numbers_size);\n float sizeTextBlur = getResources().getDimensionPixelSize(R.dimen.btalk_dialpad_key_letters_size);\n mPaintTransparent.setTextSize(sizeTextMain);\n Rect rect = new Rect();\n mPaintTransparent.getTextBounds(\"0\", 0, 1, rect);\n mPaintTransparent.setTextSize(sizeTextBlur);\n\n int heightBottomMain = (getHeight() - rect.height()) / 2;\n int heightBottomBlur = heightBottomMain - mPaddingBottom - mTextBounds.height();\n\n if (heightBottomBlur < 20) {\n int range = MAGIC_DISTANCE - heightBottomBlur;\n mPaddingBottom = mPaddingBottom - range > 0 ? mPaddingBottom - range : 0;\n } else if (heightBottomBlur > 40) {\n int range = heightBottomBlur - MAGIC_DISTANCE;\n mPaddingBottom = mPaddingBottom + range;\n }\n }\n int marginIfNeed = mPaddingLeft;\n int width = mTextBounds.width();\n\n if (mIsCenter) {\n canvas.drawText(mTextStr, (getWidth() - width) / 2 + marginIfNeed,\n getMeasuredHeight() / 2 + mPaddingTop, paint);\n } else {\n canvas.drawText(mTextStr, (getWidth() - width) / 2 + marginIfNeed,\n getMeasuredHeight() - getPaddingBottom() - mPaddingBottom, paint);\n }\n }",
"private static void clearScreen()\n {\n System.out.print('\\u000C');\n }",
"public void setSpaceAt(int x, int y, int val){\n grids[x][y].setValue(val);\n }",
"public void setMargin(float margin) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 28, margin);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 28, margin);\n\t\t}\n\t}",
"public char paddingchar() {\n return paddingChar;\n }",
"public final void setPreviewDisplay(SurfaceHolder holder) throws IOException {\n setPreviewDisplay(holder.getSurface());\n }",
"public native final void setGutter(double gutter)/*-{\n this.gutter = gutter;\n }-*/;",
"int getAutoSkipPadding();",
"@Override\n\tpublic void resetBuffer() {\n\t}",
"public void reset() {\n\t\tif (marker >= 0) {\n\t\t\tsetSize(marker);\n\t\t\tmarker = -1;\n\t\t}\n\t}",
"void setOffset(com.walgreens.rxit.ch.cda.IVLPPDPQ offset);",
"public void resetPaddleWidth(){\n myRectangle.setWidth(myLength);\n }"
] | [
"0.6729716",
"0.6683616",
"0.6676851",
"0.60267794",
"0.5841569",
"0.5722967",
"0.5583968",
"0.5545799",
"0.54630756",
"0.5434166",
"0.54078335",
"0.53491706",
"0.49825418",
"0.4876127",
"0.48452652",
"0.4830505",
"0.4828885",
"0.47967696",
"0.4739706",
"0.47299638",
"0.47190416",
"0.47118458",
"0.46768185",
"0.46640646",
"0.46636263",
"0.4655542",
"0.4621872",
"0.46120977",
"0.45996505",
"0.4594029",
"0.4590077",
"0.45780802",
"0.4574514",
"0.45248517",
"0.45198217",
"0.4506064",
"0.45018703",
"0.45014536",
"0.4499584",
"0.44982952",
"0.44916928",
"0.44793057",
"0.4467343",
"0.44652957",
"0.4453871",
"0.44499773",
"0.4447171",
"0.4440183",
"0.44341543",
"0.44251397",
"0.44056392",
"0.44052082",
"0.44029245",
"0.43955046",
"0.43826345",
"0.4372382",
"0.43664882",
"0.4352794",
"0.4344021",
"0.43369454",
"0.4335905",
"0.433203",
"0.43262872",
"0.43240124",
"0.4318796",
"0.430653",
"0.42901233",
"0.42678818",
"0.42609316",
"0.42535278",
"0.425072",
"0.42457604",
"0.4241019",
"0.42386383",
"0.42247504",
"0.42216155",
"0.42196095",
"0.42031103",
"0.41955063",
"0.41940847",
"0.4190237",
"0.4187534",
"0.4185124",
"0.41842884",
"0.41819307",
"0.41701698",
"0.41690105",
"0.41655493",
"0.4160656",
"0.41589794",
"0.41558275",
"0.41538563",
"0.41486824",
"0.4145024",
"0.41328648",
"0.41261598",
"0.41223127",
"0.41197217",
"0.41195902",
"0.41194677"
] | 0.62764764 | 3 |
TODO Autogenerated method stub | private void combine(char[] chars, int begin) {
if(begin==chars.length) {
String result = String.valueOf(chars);
if(!list.contains(result)) {
list.add(result);
}
return ;
}
for(int i=begin;i<chars.length;i++) {
swap(chars,i,begin);
combine(chars, begin+1);
swap(chars,i,begin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | private void swap(char[] chars, int i, int j) {
char ch = chars[i];
chars[i] = chars[j];
chars[j] = ch;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Created by rohitkumar on 10/31/17. | public interface UpdateTaskDetailRequestListener {
void onTaskDetailUpdated(ApiResponseModel response, NicbitException e);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n public void init() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"public void mo38117a() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n protected void init() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n public void init() {}",
"private void poetries() {\n\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"public void mo4359a() {\n }",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n public void initialize() { \n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"private void strin() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"private void init() {\n\n\n\n }",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"private void getStatus() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"private void m50366E() {\n }",
"@Override\n public void init() {\n }",
"@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"private void initialize() {\n\t\t\n\t}"
] | [
"0.59875417",
"0.58524776",
"0.5830756",
"0.5781254",
"0.5768272",
"0.57507426",
"0.57244426",
"0.56863946",
"0.5685602",
"0.5667897",
"0.5667897",
"0.5667897",
"0.5667897",
"0.5667897",
"0.5667301",
"0.5663032",
"0.5663032",
"0.56544495",
"0.56531715",
"0.5637146",
"0.5634994",
"0.56336594",
"0.56297547",
"0.56297547",
"0.5625577",
"0.55915695",
"0.5589374",
"0.558898",
"0.558898",
"0.558898",
"0.558898",
"0.558898",
"0.558898",
"0.5584608",
"0.55840236",
"0.55840236",
"0.55840236",
"0.5580064",
"0.5580064",
"0.5580064",
"0.55738455",
"0.5571884",
"0.5569069",
"0.55638474",
"0.55638474",
"0.55638474",
"0.5556594",
"0.5554284",
"0.5554284",
"0.554716",
"0.55388683",
"0.5538442",
"0.55202514",
"0.5520161",
"0.5515318",
"0.55113196",
"0.5509915",
"0.55041116",
"0.54942983",
"0.5484819",
"0.5482733",
"0.5482733",
"0.5475975",
"0.5466615",
"0.5465814",
"0.5459591",
"0.54423237",
"0.5432764",
"0.5432764",
"0.5427022",
"0.54256445",
"0.54228365",
"0.5417643",
"0.5417643",
"0.5417643",
"0.5417643",
"0.5417643",
"0.5417643",
"0.5417643",
"0.5410155",
"0.54097056",
"0.5396786",
"0.5388334",
"0.5382801",
"0.5382513",
"0.5377206",
"0.5377206",
"0.5375744",
"0.5374672",
"0.5368847",
"0.5361382",
"0.5360639",
"0.5341402",
"0.53362393",
"0.53302324",
"0.5326271",
"0.5309957",
"0.5307916",
"0.5307916",
"0.5307916",
"0.5307749"
] | 0.0 | -1 |
avoid allocating a new Point object for every position | public static long checkCollision(Asteroid a1, Asteroid a2, long expected_time_of_collision, long time, long time_limit) {
Point p1 = new Point(), p2 = new Point();
// search for collision with other asteroids
double r = a1.radius() + a2.radius();
final int EPSILON_TIME = 720;
for (long ft = -EPSILON_TIME; ft <= EPSILON_TIME; ++ft) {
long t = time + expected_time_of_collision + ft;
if (t <= time) continue;
if (time_limit != -1 && t >= time_limit) break;
int[][] collisions = Asteroid.test_collision(new Asteroid[]{a1, a2}, t);
// if collision, return push to the simulator
if (collisions.length > 0) {
return t;
}
}
return -1; // No collision within deadline
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Point(Point p) {\n\t\tthis.name = p.name;\n\t\tthis.position = p.position.copy();\n\t\tthis.collisionRadius = p.collisionRadius;\n\t}",
"public Point(){\n this.x = 0;\n this.y = 0;\n }",
"@Override\n public MapPoint clone(){\n MapPoint pl = new MapPoint();\n pl.setId(this.pointId);\n pl.setX(this.pointX);\n pl.setY(this.pointY);\n pl.setTags(this.tags);\n return pl;\n }",
"Point clone ();",
"public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }",
"Point createPoint();",
"private void setPoints () {\n\t\tArrayList<Point> emptySpot = new ArrayList<Point>();\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\tif (maze[i][j] == 0) {\n\t\t\t\temptySpot.add(new Point (i, j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(emptySpot);\n\t\tthis.goal = emptySpot.get(0);\n\t\tdouble goalRange = this.goal.getX() + this.goal.getY();\n\t\tfor (int i = 1; i < emptySpot.size(); i++) {\n\t\t\tPoint playerStart = emptySpot.get(i);\n\t\t\tdouble playerRange = playerStart.getX() + playerStart.getY();\n\t\t\tif (Math.abs(playerRange - goalRange) > width/2)\n\t\t\tthis.playerStart = playerStart;\n\t\t}\n\t}",
"public Point(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\n\r\n for (int i=px-3;i<=px+3;i++){\r\n for(int j=py-3;j<=py+3;j++){\r\n if((i>=0) && (i<9) && (j>=0) && (j<9) && ((i!=px)||(j!=py))){\r\n if ((i==px)||(j==py)){\r\n pointList.add(pointCount, new Point(i,j));\r\n pointCount+=1;\r\n } \r\n }\r\n }\r\n }\r\n return pointList;\r\n }",
"public Point()\r\n\t{\r\n\t\tx = y = 0;\r\n\t}",
"public Point getPosition(){\r\n return new Point(this.position);\r\n }",
"public Point(Point obj)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = obj.x;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's x-coordinate\t\n\t\tthis.y = obj.y;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's y-coordinate\n\t}",
"Point()\n\t{\n\t\t//default point\n\t\t//this = properties of this object we are working with\n\t\tthis.x=0;\n\t\tthis.y=0;\n\t\tcountOfPoints++;\n\t}",
"protected Point getNewPointRelatively(Point p){\n\t\treturn new Point((int) (p.getX()-CELL_SIZE),(int) (p.getY()-CELL_SIZE));\n\t}",
"public Point() {\n this.x = Math.random();\n this.y = Math.random();\n }",
"private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }",
"public Object clone() {\n return new PointImpl( this );\n }",
"public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }",
"Point(int x_, int y_){\n x = x_;\n y = y_;\n }",
"Point() {\n this.x = 0;\n this.y = 0;\n }",
"public Position(Position p_p)\n {\n this.x = p_p.x;\n this.y = p_p.y;\n }",
"@Override\r\n\tpublic Point clone() {\r\n\t\tPoint p = new RotatedPoint(this.geoObjectLabel, this.originalPoint, this.centerOfRotation, this.degAngleMeasure);\r\n\t\t\r\n\t\tif (this.getX() != null)\r\n\t\t\tp.setX((UXVariable) this.getX().clone());\r\n\t\tif (this.getY() != null)\r\n\t\t\tp.setY((UXVariable) this.getY().clone());\r\n\t\tp.setInstanceType(this.instanceType);\r\n\t\tp.setPointState(this.pointState);\r\n\t\tp.setConsProtocol(this.consProtocol);\r\n\t\tp.setIndex(this.index);\r\n\t\t\r\n\t\treturn p;\r\n\t}",
"private P clonePoint(P point)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// clone\n\t\t\treturn (P) point.clone();\n\t\t}\n\t\tcatch (CloneNotSupportedException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}",
"public Point(int x,int y){\r\n\t\tthis.pos = x;\r\n\t\tthis.id = y;\r\n\t}",
"public Point getXY()\n\t{\n\t\tPoint newPoint = new Point(x,y);\t\t\t\t\t\t// Create new Point object \n\t\treturn newPoint; \t\t\t\t\t\t\t\t\t\t// Return point's x and y coordinates\n\t}",
"private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }",
"Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"private void definePoints(){\n defineLinePoints(x1, y1, x2, y2);\n defineLinePoints(x1,y1, x3, y3);\n defineLinePoints(x2,y2, x3, y3);\n }",
"Position getNewPosition();",
"public void limpaPontos() {\n\t\tthis.pontos = new ArrayList<Point>();\n\t}",
"void setPosition(Point point);",
"public CoordinateObjects(List<T> points) {\n this.points = new ArrayList<>(points);\n }",
"public Point2D()\n {\n this.x = this.y = 0f;\n }",
"private void updatePointsPosition() {\n\t\tfor (DataFromPointInfo dataFromPointInfo : fromPoints) {\n\t\t\tDataFromPoint fromPoint = dataFromPointInfo.fromPoint;\n\t\t\tfromPoint.setX((int) (getX() + this.getBounds().getWidth()\n\t\t\t\t\t+ HORIZONTAL_OFFSET));\n\t\t\tfromPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataFromPointInfo.yShift));\n\t\t}\n\t\tfor (DataToPointInfo dataToPointInfo : toPoints) {\n\t\t\tDataToPoint toPoint = dataToPointInfo.toPoint;\n\t\t\ttoPoint.setX((int) (getX() - HORIZONTAL_OFFSET));\n\t\t\ttoPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataToPointInfo.yShift));\n\t\t}\n\t}",
"Position createPosition();",
"public Point(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public PointSET() {\n mPoints = new TreeSet<Point2D>();\n }",
"posXY(int x, int y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point getPos(){\n return new Point(getUserFriendlyXPos(),getUserFriendlyYPos());\n }",
"public Point() {\n }",
"public Point() {\n }",
"public Point(int xcoord, int ycoord)\n\t{\n\t\tthis.x= xcoord;\n\t\tthis.y= ycoord;\n\t\tcountOfPoints++;\n\t}",
"@Override\n public GeoPoint clone() {\n return new GeoPoint(this.latitude, this.longitude);\n }",
"public ArrayList<Point> nullPoint() {\n\t\tArrayList<Point> points = new ArrayList<Point>();\n\t\tfor (int r=0; r<rows(); r=r+1) {\n\t\t\tfor (int c=0; c<cols(); c=c+1) {\n\t\t\t\tPoint p = new Point(r,c);\n\t\t\t\tif(get(p)==null) {\n\t\t\t\t\tpoints.add(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn points;\n\t}",
"public PointSET() {\n pointSet = new SET<Point2D>();\n }",
"@Before\n\tpublic void before() {\n\t\tpoint = new Point(-200, 150);\n\t\tpoint1 = new Point(-400, -150);\n\t}",
"public MyPoint1 (double x, double y) {}",
"public void setPosition(Point position);",
"public void case4_Position() {\r\n Position testPosition = new Position(0,0);\r\n\r\n }",
"Point getPosition();",
"Point getPosition();",
"public Point2Dd () {\r\n x = 0;\r\n y = 0;\r\n }",
"private Point getUnsafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p \t\t= new Point();\n\t\t\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t// position isn't occupied\n\t\t\tif(!occupiedPositions.contains(p))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn p;\n\t}",
"public Point(double x, double y) {\n this.xPosition = x;\n this.yPosition = y;\n }",
"private void internalSetPoints(List<Point3D> points) {\n if (points.size() < MINIMUM_SIZE) {\n throw new IllegalArgumentException();\n }\n mPoints = points;\n }",
"public void setPoints(List<GeoPoint> points){\n\t\tclearPath();\n\t\tint size = points.size();\n\t\tmOriginalPoints = new int[size][2];\n\t\tfor (int i=0; i<size; i++){\n\t\t\tGeoPoint p = points.get(i);\n\t\t\tmOriginalPoints[i][0] = p.getLatitudeE6();\n\t\t\tmOriginalPoints[i][1] = p.getLongitudeE6();\n\t\t\tif (!mGeodesic){\n\t\t\t\taddPoint(p);\n\t\t\t} else {\n\t\t\t\tif (i>0){\n\t\t\t\t\t//add potential intermediate points:\n\t\t\t\t\tGeoPoint prev = points.get(i-1);\n\t\t\t\t\tfinal int greatCircleLength = prev.distanceTo(p);\n\t\t\t\t\t//add one point for every 100kms of the great circle path\n\t\t\t\t\tfinal int numberOfPoints = greatCircleLength/100000;\n\t\t\t\t\taddGreatCircle(prev, p, numberOfPoints);\n\t\t\t\t}\n\t\t\t\taddPoint(p);\n\t\t\t}\n\t\t}\n\t}",
"void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }",
"public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }",
"private Point[] getPointArray()\n\t{\n\t\treturn this.pointArray; // This should probably be a copy, to maintain security (?)\n\t}",
"public PointImpl( CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl();\n empty = true;\n centroid = this;\n }",
"public PointSET() {\n //s = new TreeSet<Point2D>(Point2D.X_ORDER);\n }",
"private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }",
"public void assign(Position p) {\n xCoord = p.xCoord;\n yCoord = p.yCoord;\n zCoord = p.zCoord;\n }",
"public Point(Point other) {\n super(other);\n this.x = other.x;\n this.y = other.y;\n this.activity = other.activity;\n this.frame = other.frame;\n this.trajectoryid = other.trajectoryid;\n }",
"public Point(float posX, float posY, float height, boolean relative) {\n super();\n if (relative){\n this.x = posX;\n this.y = posY;\n } else {\n this.x = posX - getReferenceX() * Chunk.getBlocksX();\n this.y = posY - getReferenceY() * Chunk.getBlocksY();\n }\n setHeight(height);\n }",
"public abstract void setPoint(Point p);",
"public abstract Point2D getPosition();",
"public PointSET() {\n\n point2DSET = new SET<>();\n }",
"public Point.Double getPosition(){\r\n return new Point.Double(x, y);\r\n }",
"public Point(double x, double y){\n this.x = x;\n this.y = y;\n }",
"public void newCoord() {\n\t\tx = Data.generateRandomX();\n\t\ty = Data.generateRandomY();\n\t}",
"private Point getSafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p\t\t\t= new Point();\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t//if the point isn't in the array\n\t\t\tif(!occupiedPositions.contains(p)) {\n\t\t\t\t//check the surrounding of the point, need to be a \"safe teleport\"\n\t\t\t\tif(checkSurroundingOfPoint(p)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn p;\n\t}",
"Spawn(LatLng position) {\n this.position = position;\n return;\n }",
"public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public RMPoint getXY() { return new RMPoint(getX(), getY()); }",
"public Point()\n {\n x = -100 + (int) (Math.random() * ((100 - (-100)) + 1)); \n y = -100 + (int) (Math.random() * ((100 - (-100)) + 1));\n //x = (int) (Math.random()); \n //y =(int) (Math.random());\n pointArr[0] = 1;\n pointArr[1] = x;\n pointArr[2] = y;\n //If the point is on the line, is it accepted? I counted it as accepted for now\n if(y >= 3*x){\n desiredOut = 1;\n }\n else\n {\n desiredOut = 0;\n }\n }",
"private GoodPoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n SLOPE_ORDER = new SlopeOrder();\n }",
"public void initSpawnPoints() {\n this.spawnPointList = new ArrayList<Node>();\n \n //Player spawn point location (5,0,47) In Ready Room\n this.addSpawnPoint(5.5f,0,47.5f,90, true);\n //Mob spawn point location (16,0,47) In Zone 2\n this.addSpawnPoint(16.5f, 0, 47.5f, 270, false); \n //Mob spawn point location (21,0,43)\n this.addSpawnPoint(21.5f, 0, 43.5f, 0,false);\n \n //Mob spawners in Zone 3\n this.addSpawnPoint(17.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(29.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(17.5f, 0, 29.5f, 270, false);\n \n //Mob spawners in Zone 4\n this.addSpawnPoint(12.5f, 0, 29.5f, 90, false);\n this.addSpawnPoint(6.5f, 0, 20.5f, 0, false);\n \n //Mob spawners in Zone 5\n this.addSpawnPoint(9.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(17.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(24.5f, 0, 8.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 11.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 14.5f, 270, false);\n }",
"PointDouble() {\n x = y = 0.0;\n }",
"public Point(Vector position) {\n\t\tthis(position, 5.0);\n\t}",
"public void randomizePointer(){\n\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n while(pointerPos.dist(BASE_POS)>280 || pointerPos.dist(BASE_POS)<80 || p.atan2(pointerPos.y-BASE_POS.y,pointerPos.x - BASE_POS.x)>p.radians(60)){\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n }\n }",
"public void setPosition(Point newPosition);",
"protected Place(float x, float y) {\n position = new PointF(x, y);\n }",
"public Point getPosition();",
"public Point getPosition() {\n return new Point(position);\n }",
"public Position(int p_X, int p_Y)\n {\n this.x = p_X;\n this.y = p_Y;\n }",
"public Point randomPoint() \t // creates a random point for gameOjbects to be placed into\r\n\t{\n\t\tint x = rand.nextInt(900);\r\n\t\tx = x + 50;\r\n\t\tint y = rand.nextInt(900);\r\n\t\ty = y + 50;\r\n\t\tPoint p = new Point(x, y);\r\n\t\treturn p;\r\n\t}",
"private Point getUpdatedPoint(Movable obj, double newX, double newY){\n\t if(obj.getMovingScheme() == Movable.APPROX){\n\t return new Point((int) ((newX + GRID_SIZE / 2) / GRID_SIZE),\n (int) ((newY + GRID_SIZE / 2) / GRID_SIZE));\n } else if(obj.getMovingScheme() == Movable.EXACT){\n Point newPoint = obj.getLocation().clone();\n int mapX, mapY;\n switch (obj.getFacing()){\n case LEFT:\n if((mapX = (int)(newX + GRID_SIZE) / GRID_SIZE) == obj.getLocation().getX())\n break;\n newPoint.setX(mapX);\n break;\n case UP:\n if((mapY = (int)(newY + GRID_SIZE) / GRID_SIZE) == obj.getLocation().getY())\n break;\n newPoint.setY(mapY);\n break;\n case RIGHT:\n if((mapX = (int)newX / GRID_SIZE) == obj.getLocation().getX())\n break;\n newPoint.setX(mapX);\n break;\n case DOWN:\n if((mapY = (int)newY / GRID_SIZE) == obj.getLocation().getY())\n break;\n newPoint.setY(mapY);\n break;\n }\n return newPoint;\n }\n return null;\n }",
"private void setPointsAs0() {\n\n for (int counter = 0; counter < countOfPoints; counter++) {\n points[counter] = new Point(0,0);\n }\n\n }",
"public void resetCoordinates(){\n pos=0;\n if(this.pIndex<2){\n this.coordinates[0]=TILE_SIZE*15-DICE_SIZE;}\n else{\n this.coordinates[0]=0;}\n if(this.pIndex%3==0){\n this.coordinates[1]=0;}\n else{\n this.coordinates[1]=TILE_SIZE*15-DICE_SIZE;} \n }",
"public PointSET() {\n points = new SET<Point2D>();\n }",
"public Point[] clone(){\n\t\tPoint[] test = new Point[currentPiece.length];\n\t\tfor(int i = 0; i < currentPiece.length; i ++){\n\t\t\ttest[i] = new Point(currentPiece[i]);\n\t\t}\n\t\treturn test;\n\t}",
"public LocationPoint(){\n this.mLocationID = UUID.randomUUID();\n }",
"public void set(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"public void testGetOldPosition1() {\n WayPointEvent event = new WayPointEvent(edge, wayPoint, offset);\n\n Point pt = event.getOldPosition();\n\n assertEquals(\"Failed to get the correct old position.\", wayPoint, pt);\n\n // verify the point should be set by clone\n pt.x = 876;\n assertEquals(\"The old position getter should return a cloned point.\", wayPoint, event.getOldPosition());\n\n pt = new Point(wayPoint);\n wayPoint.x = 987;\n assertEquals(\"The old position should be set by clone in constructor.\", pt, event.getOldPosition());\n }",
"public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}",
"public Point getPos() {\n return this.pos;\n }",
"public void resetPoints() {\n points = 0;\n }",
"public PointF get_position() { return _position; }"
] | [
"0.6702358",
"0.6557222",
"0.650567",
"0.6471274",
"0.6453684",
"0.6341901",
"0.6334488",
"0.6330545",
"0.63088965",
"0.630381",
"0.6289023",
"0.6283203",
"0.62805545",
"0.6257119",
"0.6236774",
"0.6231754",
"0.62315553",
"0.6208003",
"0.61899924",
"0.61614853",
"0.61495554",
"0.60926926",
"0.6091663",
"0.60880595",
"0.6078108",
"0.6071557",
"0.6068462",
"0.6060441",
"0.5997869",
"0.5991894",
"0.5990186",
"0.5979526",
"0.5975398",
"0.5951052",
"0.59505665",
"0.59324354",
"0.59203863",
"0.5913426",
"0.59097207",
"0.5907579",
"0.5906135",
"0.5906135",
"0.59058213",
"0.59005404",
"0.5898642",
"0.5895897",
"0.5895091",
"0.5891695",
"0.58908534",
"0.58907425",
"0.5889683",
"0.5889683",
"0.5888291",
"0.58855027",
"0.5885043",
"0.5883856",
"0.5880064",
"0.58758575",
"0.5872492",
"0.5866935",
"0.58622295",
"0.5862115",
"0.58604103",
"0.58368343",
"0.58335567",
"0.58323604",
"0.58322877",
"0.58286464",
"0.58242655",
"0.5823352",
"0.5822616",
"0.5821806",
"0.5818031",
"0.5806646",
"0.57980806",
"0.5795836",
"0.5792783",
"0.5790074",
"0.57874566",
"0.5784587",
"0.5782684",
"0.5781872",
"0.5781242",
"0.5779112",
"0.5777285",
"0.57763684",
"0.57753265",
"0.5772363",
"0.57698244",
"0.5761362",
"0.5758704",
"0.5749451",
"0.57477367",
"0.5743158",
"0.5735708",
"0.5720775",
"0.5719349",
"0.57072866",
"0.5705609",
"0.56896216",
"0.5687335"
] | 0.0 | -1 |
Avoid allocating a new Point object for every position | public static Hashtable<Long, ArrayList<CollisionPair>> checkCollision(
Asteroid[] asteroids, long max_time, long real_time, long time_limit) {
int n = asteroids.length;
Point[] asteroid_future_positions = new Point[n];
// Search for collision with other asteroids
double[][] radius_matrix = new double[n][n];
// Not we're only computing total radius for all i<j to save computation time
for (int i = 0; i < n; i++) {
for (int j = i+1; j < n; j++) {
radius_matrix[i][j] = asteroids[i].radius() + asteroids[j].radius();
}
}
Hashtable<Long, ArrayList<CollisionPair>> collisions = new Hashtable<Long, ArrayList<CollisionPair>>();
for (long dt = 0; dt <= max_time; dt++) {
long t = real_time + dt;
if (t >= time_limit) {
break;
}
ArrayList<CollisionPair> collisions_at_t = new ArrayList<CollisionPair>();
for (int i = 0; i < n; i++) {
long epoch = asteroids[i].epoch;
asteroids[i].orbit.positionAt(t - epoch, asteroid_future_positions[i]);
}
// Find lowest energy collision and return push to the simulator
// Not we're only checking distance for all i<j to save computation time
for (int i = 0; i < n; i++) {
for (int j = i+1; j < n; j++) {
if (Point.distance(asteroid_future_positions[i], asteroid_future_positions[j])
< radius_matrix[i][j]) {
CollisionPair collision = new CollisionPair();
collision.asteroid1_index = i;
collision.asteroid2_index = j;
collisions_at_t.add(collision);
}
}
}
// If there was a collision at this time, add it to the table
if (!collisions_at_t.isEmpty()) {
// TODO: Sort collisions by some metric
collisions.put(t, collisions_at_t);
}
}
return collisions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Point(Point p) {\n\t\tthis.name = p.name;\n\t\tthis.position = p.position.copy();\n\t\tthis.collisionRadius = p.collisionRadius;\n\t}",
"public Point(){\n this.x = 0;\n this.y = 0;\n }",
"@Override\n public MapPoint clone(){\n MapPoint pl = new MapPoint();\n pl.setId(this.pointId);\n pl.setX(this.pointX);\n pl.setY(this.pointY);\n pl.setTags(this.tags);\n return pl;\n }",
"public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }",
"Point clone ();",
"Point createPoint();",
"Point()\n\t{\n\t\t//default point\n\t\t//this = properties of this object we are working with\n\t\tthis.x=0;\n\t\tthis.y=0;\n\t\tcountOfPoints++;\n\t}",
"public Point() {\n this.x = Math.random();\n this.y = Math.random();\n }",
"public Point()\r\n\t{\r\n\t\tx = y = 0;\r\n\t}",
"public Point(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"Point() {\n this.x = 0;\n this.y = 0;\n }",
"private void setPoints () {\n\t\tArrayList<Point> emptySpot = new ArrayList<Point>();\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\tif (maze[i][j] == 0) {\n\t\t\t\temptySpot.add(new Point (i, j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(emptySpot);\n\t\tthis.goal = emptySpot.get(0);\n\t\tdouble goalRange = this.goal.getX() + this.goal.getY();\n\t\tfor (int i = 1; i < emptySpot.size(); i++) {\n\t\t\tPoint playerStart = emptySpot.get(i);\n\t\t\tdouble playerRange = playerStart.getX() + playerStart.getY();\n\t\t\tif (Math.abs(playerRange - goalRange) > width/2)\n\t\t\tthis.playerStart = playerStart;\n\t\t}\n\t}",
"public Point(Point obj)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = obj.x;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's x-coordinate\t\n\t\tthis.y = obj.y;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's y-coordinate\n\t}",
"public Object clone() {\n return new PointImpl( this );\n }",
"public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\n\r\n for (int i=px-3;i<=px+3;i++){\r\n for(int j=py-3;j<=py+3;j++){\r\n if((i>=0) && (i<9) && (j>=0) && (j<9) && ((i!=px)||(j!=py))){\r\n if ((i==px)||(j==py)){\r\n pointList.add(pointCount, new Point(i,j));\r\n pointCount+=1;\r\n } \r\n }\r\n }\r\n }\r\n return pointList;\r\n }",
"Point(int x_, int y_){\n x = x_;\n y = y_;\n }",
"public Point getPosition(){\r\n return new Point(this.position);\r\n }",
"public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }",
"private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }",
"Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"protected Point getNewPointRelatively(Point p){\n\t\treturn new Point((int) (p.getX()-CELL_SIZE),(int) (p.getY()-CELL_SIZE));\n\t}",
"@Override\r\n\tpublic Point clone() {\r\n\t\tPoint p = new RotatedPoint(this.geoObjectLabel, this.originalPoint, this.centerOfRotation, this.degAngleMeasure);\r\n\t\t\r\n\t\tif (this.getX() != null)\r\n\t\t\tp.setX((UXVariable) this.getX().clone());\r\n\t\tif (this.getY() != null)\r\n\t\t\tp.setY((UXVariable) this.getY().clone());\r\n\t\tp.setInstanceType(this.instanceType);\r\n\t\tp.setPointState(this.pointState);\r\n\t\tp.setConsProtocol(this.consProtocol);\r\n\t\tp.setIndex(this.index);\r\n\t\t\r\n\t\treturn p;\r\n\t}",
"public Position(Position p_p)\n {\n this.x = p_p.x;\n this.y = p_p.y;\n }",
"public CoordinateObjects(List<T> points) {\n this.points = new ArrayList<>(points);\n }",
"public Point(int x,int y){\r\n\t\tthis.pos = x;\r\n\t\tthis.id = y;\r\n\t}",
"public Point getXY()\n\t{\n\t\tPoint newPoint = new Point(x,y);\t\t\t\t\t\t// Create new Point object \n\t\treturn newPoint; \t\t\t\t\t\t\t\t\t\t// Return point's x and y coordinates\n\t}",
"private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }",
"private P clonePoint(P point)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// clone\n\t\t\treturn (P) point.clone();\n\t\t}\n\t\tcatch (CloneNotSupportedException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}",
"public void limpaPontos() {\n\t\tthis.pontos = new ArrayList<Point>();\n\t}",
"public Point(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public MyPoint1 (double x, double y) {}",
"public Point(int xcoord, int ycoord)\n\t{\n\t\tthis.x= xcoord;\n\t\tthis.y= ycoord;\n\t\tcountOfPoints++;\n\t}",
"public Point2D()\n {\n this.x = this.y = 0f;\n }",
"public Point() {\n }",
"public Point() {\n }",
"void setPosition(Point point);",
"public Point(double x, double y) {\n this.xPosition = x;\n this.yPosition = y;\n }",
"private void definePoints(){\n defineLinePoints(x1, y1, x2, y2);\n defineLinePoints(x1,y1, x3, y3);\n defineLinePoints(x2,y2, x3, y3);\n }",
"public PointSET() {\n pointSet = new SET<Point2D>();\n }",
"public PointSET() {\n mPoints = new TreeSet<Point2D>();\n }",
"@Override\n public GeoPoint clone() {\n return new GeoPoint(this.latitude, this.longitude);\n }",
"public PointImpl( CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl();\n empty = true;\n centroid = this;\n }",
"public ArrayList<Point> nullPoint() {\n\t\tArrayList<Point> points = new ArrayList<Point>();\n\t\tfor (int r=0; r<rows(); r=r+1) {\n\t\t\tfor (int c=0; c<cols(); c=c+1) {\n\t\t\t\tPoint p = new Point(r,c);\n\t\t\t\tif(get(p)==null) {\n\t\t\t\t\tpoints.add(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn points;\n\t}",
"private void updatePointsPosition() {\n\t\tfor (DataFromPointInfo dataFromPointInfo : fromPoints) {\n\t\t\tDataFromPoint fromPoint = dataFromPointInfo.fromPoint;\n\t\t\tfromPoint.setX((int) (getX() + this.getBounds().getWidth()\n\t\t\t\t\t+ HORIZONTAL_OFFSET));\n\t\t\tfromPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataFromPointInfo.yShift));\n\t\t}\n\t\tfor (DataToPointInfo dataToPointInfo : toPoints) {\n\t\t\tDataToPoint toPoint = dataToPointInfo.toPoint;\n\t\t\ttoPoint.setX((int) (getX() - HORIZONTAL_OFFSET));\n\t\t\ttoPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataToPointInfo.yShift));\n\t\t}\n\t}",
"private void internalSetPoints(List<Point3D> points) {\n if (points.size() < MINIMUM_SIZE) {\n throw new IllegalArgumentException();\n }\n mPoints = points;\n }",
"public Point(double x, double y){\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public void setPosition(Point position);",
"public void setPoints(List<GeoPoint> points){\n\t\tclearPath();\n\t\tint size = points.size();\n\t\tmOriginalPoints = new int[size][2];\n\t\tfor (int i=0; i<size; i++){\n\t\t\tGeoPoint p = points.get(i);\n\t\t\tmOriginalPoints[i][0] = p.getLatitudeE6();\n\t\t\tmOriginalPoints[i][1] = p.getLongitudeE6();\n\t\t\tif (!mGeodesic){\n\t\t\t\taddPoint(p);\n\t\t\t} else {\n\t\t\t\tif (i>0){\n\t\t\t\t\t//add potential intermediate points:\n\t\t\t\t\tGeoPoint prev = points.get(i-1);\n\t\t\t\t\tfinal int greatCircleLength = prev.distanceTo(p);\n\t\t\t\t\t//add one point for every 100kms of the great circle path\n\t\t\t\t\tfinal int numberOfPoints = greatCircleLength/100000;\n\t\t\t\t\taddGreatCircle(prev, p, numberOfPoints);\n\t\t\t\t}\n\t\t\t\taddPoint(p);\n\t\t\t}\n\t\t}\n\t}",
"Position createPosition();",
"public Point2Dd () {\r\n x = 0;\r\n y = 0;\r\n }",
"@Before\n\tpublic void before() {\n\t\tpoint = new Point(-200, 150);\n\t\tpoint1 = new Point(-400, -150);\n\t}",
"Position getNewPosition();",
"public Point getPos(){\n return new Point(getUserFriendlyXPos(),getUserFriendlyYPos());\n }",
"PointDouble() {\n x = y = 0.0;\n }",
"public Point(Point other) {\n super(other);\n this.x = other.x;\n this.y = other.y;\n this.activity = other.activity;\n this.frame = other.frame;\n this.trajectoryid = other.trajectoryid;\n }",
"public PointSET() {\n\n point2DSET = new SET<>();\n }",
"private Point[] getPointArray()\n\t{\n\t\treturn this.pointArray; // This should probably be a copy, to maintain security (?)\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n SLOPE_ORDER = new SlopeOrder();\n }",
"Point getPosition();",
"Point getPosition();",
"public abstract void setPoint(Point p);",
"public void newCoord() {\n\t\tx = Data.generateRandomX();\n\t\ty = Data.generateRandomY();\n\t}",
"public Point(Vector position) {\n\t\tthis(position, 5.0);\n\t}",
"private GoodPoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public void case4_Position() {\r\n Position testPosition = new Position(0,0);\r\n\r\n }",
"private void setPointsAs0() {\n\n for (int counter = 0; counter < countOfPoints; counter++) {\n points[counter] = new Point(0,0);\n }\n\n }",
"private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }",
"public Point.Double getPosition(){\r\n return new Point.Double(x, y);\r\n }",
"posXY(int x, int y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point(float posX, float posY, float height, boolean relative) {\n super();\n if (relative){\n this.x = posX;\n this.y = posY;\n } else {\n this.x = posX - getReferenceX() * Chunk.getBlocksX();\n this.y = posY - getReferenceY() * Chunk.getBlocksY();\n }\n setHeight(height);\n }",
"public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }",
"private Point getUnsafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p \t\t= new Point();\n\t\t\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t// position isn't occupied\n\t\t\tif(!occupiedPositions.contains(p))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn p;\n\t}",
"public Point getPosition() {\n return new Point(position);\n }",
"public RMPoint getXY() { return new RMPoint(getX(), getY()); }",
"public LocationPoint(){\n this.mLocationID = UUID.randomUUID();\n }",
"public PointSET() {\n //s = new TreeSet<Point2D>(Point2D.X_ORDER);\n }",
"protected Place(float x, float y) {\n position = new PointF(x, y);\n }",
"public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}",
"Spawn(LatLng position) {\n this.position = position;\n return;\n }",
"public Point getPosition();",
"public abstract Point2D getPosition();",
"public PointSET() {\n points = new SET<Point2D>();\n }",
"public Point()\n {\n x = -100 + (int) (Math.random() * ((100 - (-100)) + 1)); \n y = -100 + (int) (Math.random() * ((100 - (-100)) + 1));\n //x = (int) (Math.random()); \n //y =(int) (Math.random());\n pointArr[0] = 1;\n pointArr[1] = x;\n pointArr[2] = y;\n //If the point is on the line, is it accepted? I counted it as accepted for now\n if(y >= 3*x){\n desiredOut = 1;\n }\n else\n {\n desiredOut = 0;\n }\n }",
"public void assign(Position p) {\n xCoord = p.xCoord;\n yCoord = p.yCoord;\n zCoord = p.zCoord;\n }",
"public Point(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public void setPosition(Point newPosition);",
"public Position(int p_X, int p_Y)\n {\n this.x = p_X;\n this.y = p_Y;\n }",
"private Point getSafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p\t\t\t= new Point();\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t//if the point isn't in the array\n\t\t\tif(!occupiedPositions.contains(p)) {\n\t\t\t\t//check the surrounding of the point, need to be a \"safe teleport\"\n\t\t\t\tif(checkSurroundingOfPoint(p)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn p;\n\t}",
"public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point randomPoint() \t // creates a random point for gameOjbects to be placed into\r\n\t{\n\t\tint x = rand.nextInt(900);\r\n\t\tx = x + 50;\r\n\t\tint y = rand.nextInt(900);\r\n\t\ty = y + 50;\r\n\t\tPoint p = new Point(x, y);\r\n\t\treturn p;\r\n\t}",
"public void initSpawnPoints() {\n this.spawnPointList = new ArrayList<Node>();\n \n //Player spawn point location (5,0,47) In Ready Room\n this.addSpawnPoint(5.5f,0,47.5f,90, true);\n //Mob spawn point location (16,0,47) In Zone 2\n this.addSpawnPoint(16.5f, 0, 47.5f, 270, false); \n //Mob spawn point location (21,0,43)\n this.addSpawnPoint(21.5f, 0, 43.5f, 0,false);\n \n //Mob spawners in Zone 3\n this.addSpawnPoint(17.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(29.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(17.5f, 0, 29.5f, 270, false);\n \n //Mob spawners in Zone 4\n this.addSpawnPoint(12.5f, 0, 29.5f, 90, false);\n this.addSpawnPoint(6.5f, 0, 20.5f, 0, false);\n \n //Mob spawners in Zone 5\n this.addSpawnPoint(9.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(17.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(24.5f, 0, 8.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 11.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 14.5f, 270, false);\n }",
"void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }",
"public void resetPoints() {\n points = 0;\n }",
"public MyPoint1(double x, int y) {\n this.x = x;\n this.y = y;\n }",
"public Point(float x, float y)\n {\n this.x = x;\n this.y = y;\n }",
"public Point[] clone(){\n\t\tPoint[] test = new Point[currentPiece.length];\n\t\tfor(int i = 0; i < currentPiece.length; i ++){\n\t\t\ttest[i] = new Point(currentPiece[i]);\n\t\t}\n\t\treturn test;\n\t}",
"public void set(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }"
] | [
"0.66980416",
"0.665296",
"0.65247947",
"0.6524091",
"0.6506709",
"0.6413443",
"0.6372636",
"0.6366195",
"0.63502675",
"0.63418716",
"0.6307231",
"0.62888056",
"0.62811756",
"0.62662137",
"0.62607276",
"0.6248517",
"0.6246785",
"0.62401193",
"0.6226164",
"0.6178581",
"0.6160322",
"0.61240745",
"0.6094636",
"0.60891646",
"0.608885",
"0.60806817",
"0.6069596",
"0.60629046",
"0.6005113",
"0.5989895",
"0.5989871",
"0.5987399",
"0.5977",
"0.5976314",
"0.596857",
"0.596857",
"0.59682214",
"0.5967145",
"0.59595203",
"0.5929811",
"0.5928857",
"0.59281164",
"0.5919684",
"0.5916088",
"0.5902899",
"0.5895647",
"0.5894773",
"0.58860034",
"0.58841753",
"0.5883553",
"0.5875189",
"0.5873912",
"0.5872571",
"0.5869919",
"0.586603",
"0.5865272",
"0.58650196",
"0.5863251",
"0.5861653",
"0.5856675",
"0.5851822",
"0.5851822",
"0.5844991",
"0.58407885",
"0.58401376",
"0.5838629",
"0.58357614",
"0.5827154",
"0.5826316",
"0.5825843",
"0.58245873",
"0.58234584",
"0.5823149",
"0.5822761",
"0.5817183",
"0.5816185",
"0.5807199",
"0.58070534",
"0.5791695",
"0.5786866",
"0.5785974",
"0.57853276",
"0.57820606",
"0.57817453",
"0.57784605",
"0.5775117",
"0.5770423",
"0.5759038",
"0.5753844",
"0.57428956",
"0.5741814",
"0.57357603",
"0.5733493",
"0.5731055",
"0.5729981",
"0.57187736",
"0.57180965",
"0.5711681",
"0.5707177",
"0.57070553",
"0.57070553"
] | 0.0 | -1 |
Advance the doc values reader to the provided doc. | boolean advanceExact(int docId) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public read(PDDocument doc) throws IOException {\r\n super();\r\n document =doc;\r\n\r\n }",
"public void processDocument() {\n\n\t\t// compact concepts\n\t\tprocessConcepts(concepts);\n\t}",
"public void setDocument(Reader reader) {\n this.reader = new CountingReader(reader);\n }",
"public void update(Gedcomx doc) {\n this.doc = doc;\n sourceDescriptionMap = getSourceDescriptionMap(doc);\n personMap = getPersonMap(doc);\n recordDescriptorMap = getRecordDescriptorMap(doc);\n agentMap = getAgentMap(doc);\n placeMap = getPlaceMap(doc);\n mainSourceDescription = getSourceDescription(doc.getDescriptionRef());\n }",
"public void setDocument(Document doc)\n\t{\n\t\tthis.document = doc;\n\t}",
"public void setDoc(XDoc doc) {\r\n\t\tthis.doc = doc;\r\n\t}",
"@Override\n\tpublic void getNext(JCas j) throws IOException, CollectionException {\n\t\tString s = docElements.get(idx).text();\t\t\n\t\tj.setDocumentText(s);\n\t\tidx++;\n\t//\tj.setDocumentLanguage(language);\n\t//\tread = false\n\t}",
"@Override\n public void setDocWriter(DocWriter docWriter) {\n super.setDocWriter(docWriter);\n if (docWriter != null) {\n // Get our parameters from the indexer\n Map<String, String> indexerParameters = docWriter.indexerParameters();\n if (indexerParameters != null)\n setParameters(indexerParameters);\n }\n }",
"public void setContents(IMutableDocument doc) {\n this.doc = doc;\n this.widget.setContents(doc);\n this.mapper.resetSource(doc.getText());\n }",
"void fill(int docID) throws IOException {\n final int docStoreOffset = docWriter.getDocStoreOffset();\n\n final int end = docID+docStoreOffset;\n while(lastDocID < end) {\n fieldsWriter.skipDocument();\n lastDocID++;\n }\n }",
"@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }",
"private void readIt(XMLElement doc, MembershipService membership) {\r\n Enumeration elements = doc.getChildren();\r\n\r\n while (elements.hasMoreElements()) {\r\n XMLElement elem = (XMLElement) elements.nextElement();\r\n\r\n if (elem.getName().equals(handlernameTag)) {\r\n setHandlerName(elem.getTextValue());\r\n continue;\r\n }\r\n if (membership != null) {\r\n // Set credential\r\n if (elem.getName().equals(credentialTag)) {\r\n Credential credential;\r\n\r\n if (elem.getTextValue() != null) {\r\n try {\r\n credential = membership.makeCredential(elem);\r\n setCredential(credential);\r\n } catch (Exception ce) {\r\n if (LOG.isEnabledFor(Priority.WARN)) {\r\n LOG.warn(\"Credential creation failed\", ce);\r\n }\r\n }\r\n }\r\n continue;\r\n }\r\n }\r\n\r\n // Set payload\r\n if (elem.getName().equals(payloadTag)) {\r\n setPayload(elem.getTextValue());\r\n }\r\n }\r\n }",
"void init(Document doc) {\n mDoc = doc;\n mDoc.getDocumentElement().normalize();\n load();\n }",
"@Override\n public void process(IeDocument document) {\n\n List<Field> fieldList = new ArrayList<>();\n fieldList.addAll(document.findFields(FIELD_NAME));\n if (fieldList.size() > 0) {\n for (Field field : fieldList) {\n String amount =field.getValue();\n if (!amount.equals(\"0.00\")){\n OcrAmountNormalizer normalizer1=new OcrAmountNormalizer();\n amount=normalizer1.normalize(amount);\n field.setValue(amount);\n }\n\n }\n }\n\n }",
"public void collect(int doc, float score)\n {\n assert docs.isEmpty() || docs.getLast() < doc : \"docs out of order\";\n docs.add(doc);\n docScores.add(score);\n maxDoc = Math.max(maxDoc, doc);\n }",
"public void processReturnDocument(ReturnDocument rdoc) {\r\n this.processReturnDispositions(rdoc);\r\n this.processRentals(rdoc);\r\n // this.processDepartmentCredit(rdoc);\r\n this.computeSalesTaxAmount(rdoc);\r\n\r\n }",
"private void readDocument(Attributes attrs) {\n this.state = DOC_TEXT_STATE;\n }",
"public Map<String, String> NextDocument() throws IOException {\n\t\tMap<String, String> oneDoc = new HashMap<String, String>();\n\t\tString docId = \"\";\n\t\tString docTxt = \"\";\n\t\tif ((docId = bf_Reader.readLine())!=null){\n\t\t\tdocTxt = bf_Reader.readLine();\n\t\t\toneDoc.put(docId,docTxt); //put docNo-content pairs into map\n\t\t\treturn oneDoc;\n\t\t}\n\n\t\tbf_Reader.close();\n\n\t\treturn null;\n\t}",
"protected DocumentItem processDocumentRow(DocumentItem doc, RenderableDataItem row) {\n if (row.size() > 3) {\n DocumentItemType type = DocumentItemType.DOCUMENT;\n\n try {\n String s = row.get(0).toString();\n String custom = null;\n int n = s.indexOf(':');\n\n if (n != -1) {\n custom = s.substring(n + 1);\n s = s.substring(0, n);\n }\n\n s = s.toUpperCase(Locale.US);\n type = DocumentItemType.valueOf(s);\n\n if (type == DocumentItemType.CUSTOM) {\n doc.customItemType = custom;\n }\n } catch(Exception e) {\n Platform.ignoreException(null, e);\n }\n\n doc.itemType = type;\n RenderableDataItem item0=row.get(0);\n switch(type) {\n case DOCUMENT :\n if (\"true\".equals(row.get(3).getValue())) {\n mainDocument = doc;\n }\n\n break;\n\n case IMAGE :\n if(item0.getIcon()==null) {\n item0.setIcon(Platform.getAppContext().getResourceAsIcon(\"bv.icon.camera\"));\n }\n break;\n case IMAGE_SLIDES :\n if(item0.getIcon()==null) {\n item0.setIcon(Platform.getAppContext().getResourceAsIcon(\"bv.icon.xray\"));\n }\n break;\n\n default :\n break;\n }\n\n row.get(2).setType(RenderableDataItem.TYPE_DATETIME);\n }\n\n doc.rowData = row;\n\n return doc;\n }",
"public abstract List<T> readDoc(final Document document);",
"public void toReturn(Document doc){\n documents.remove(doc);\n doc.setCopies(doc.copiesNumber() + 1);\n //TODO check data and fee\n //TODO rewrite list of documents\n }",
"public interface DocumentReader\n {\n\t/**\n\t* Read a single Document from the specified file.\n\t* @returns The next Document if there are more, or null if there are not.\n\t*/\n public Document readDocument();\n }",
"protected abstract void parseSource(final Document doc, final Resource.Builder resource);",
"@Override\n\t\tpublic String next() {\n\n\t\t\tString token = super.next();\n\n\t\t\twhile (isJavaDocToken(token))\n\t\t\t\ttoken = super.next();\n\n\t\t\treturn token;\n\t\t}",
"private void collect() {\n\n System.out.println(\"Getting IndexReader...\");\n final IndexReader reader = index.reader();\n\n System.out.println(\"Calling forEachDocument()...\");\n index.forEachDocument(new DocTask() {\n\n int docsDone = 0;\n\n final int totalDocs = reader.maxDoc() - reader.numDeletedDocs();\n\n @Override\n public void perform(BlackLabIndex index, int docId) {\n Map<String, String> metadata = new HashMap<>();\n Document luceneDoc = index.luceneDoc(docId);\n for (IndexableField f: luceneDoc.getFields()) {\n // If this is a regular metadata field, not a control field\n if (!f.name().contains(\"#\")) {\n fieldNames.add(f.name());\n if (f.stringValue() != null)\n metadata.put(f.name(), f.stringValue());\n else if (f.numericValue() != null)\n metadata.put(f.name(), f.numericValue().toString());\n }\n }\n values.add(metadata);\n docsDone++;\n if (docsDone % 100 == 0) {\n int perc = docsDone * 100 / totalDocs;\n System.out.println(docsDone + \" docs exported (\" + perc + \"%)...\");\n }\n }\n });\n }",
"@Test\n public void fieldAdvance() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.write(\"This text is in its normal place.\");\n\n // Below are two ways of using the ADVANCE field to adjust the position of text that follows it.\n // The effects of an ADVANCE field continue to be applied until the paragraph ends,\n // or another ADVANCE field updates the offset/coordinate values.\n // 1 - Specify a directional offset:\n FieldAdvance field = (FieldAdvance) builder.insertField(FieldType.FIELD_ADVANCE, true);\n Assert.assertEquals(FieldType.FIELD_ADVANCE, field.getType()); //ExSkip\n Assert.assertEquals(\" ADVANCE \", field.getFieldCode()); //ExSkip\n field.setRightOffset(\"5\");\n field.setUpOffset(\"5\");\n\n Assert.assertEquals(\" ADVANCE \\\\r 5 \\\\u 5\", field.getFieldCode());\n\n builder.write(\"This text will be moved up and to the right.\");\n\n field = (FieldAdvance) builder.insertField(FieldType.FIELD_ADVANCE, true);\n field.setDownOffset(\"5\");\n field.setLeftOffset(\"100\");\n\n Assert.assertEquals(\" ADVANCE \\\\d 5 \\\\l 100\", field.getFieldCode());\n\n builder.writeln(\"This text is moved down and to the left, overlapping the previous text.\");\n\n // 2 - Move text to a position specified by coordinates:\n field = (FieldAdvance) builder.insertField(FieldType.FIELD_ADVANCE, true);\n field.setHorizontalPosition(\"-100\");\n field.setVerticalPosition(\"200\");\n\n Assert.assertEquals(field.getFieldCode(), \" ADVANCE \\\\x -100 \\\\y 200\");\n\n builder.write(\"This text is in a custom position.\");\n\n doc.save(getArtifactsDir() + \"Field.ADVANCE.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.ADVANCE.docx\");\n\n field = (FieldAdvance) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_ADVANCE, \" ADVANCE \\\\r 5 \\\\u 5\", \"\", field);\n Assert.assertEquals(\"5\", field.getRightOffset());\n Assert.assertEquals(\"5\", field.getUpOffset());\n\n field = (FieldAdvance) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_ADVANCE, \" ADVANCE \\\\d 5 \\\\l 100\", \"\", field);\n Assert.assertEquals(\"5\", field.getDownOffset());\n Assert.assertEquals(\"100\", field.getLeftOffset());\n\n field = (FieldAdvance) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_ADVANCE, \" ADVANCE \\\\x -100 \\\\y 200\", \"\", field);\n Assert.assertEquals(\"-100\", field.getHorizontalPosition());\n Assert.assertEquals(\"200\", field.getVerticalPosition());\n }",
"public DocIndexerXmlExample(Indexer indexer, String fileName, Reader reader) {\n\t\tsuper(indexer, fileName, reader);\n\n\t\t// FilterAdders allow us to specify how the different properties are indexed.\n\n\t\t// Adds a lower case filter to the property, for case-insensitivity.\n\t\tTokenFilterAdder lowerCase = new TokenFilterAdder() {\n\t\t\t@Override\n\t\t\tpublic TokenStream addFilters(TokenStream input) {\n\t\t\t\treturn new LowerCaseFilter(Version.LUCENE_36, input);\n\t\t\t}\n\t\t};\n\n\t\t// Adds lower case and accents filters to the property\n\t\tTokenFilterAdder desensitize = new TokenFilterAdder() {\n\t\t\t@Override\n\t\t\tpublic TokenStream addFilters(TokenStream input) {\n\t\t\t\treturn new RemoveAllAccentsFilter(new LowerCaseFilter(Version.LUCENE_36, input));\n\t\t\t}\n\t\t};\n\n\t\t// Define the properties that make up our complex field\n\n\t\tcontentsField = // main field: actual text; this property will contain the character offsets\n\t\tnew ComplexFieldImpl(\"contents\", desensitize);\n\t\tcontentsField.addAlternative(\"s\"); // case-sensitive version of main value\n\t\tcontentsField.addProperty(\"pos\", lowerCase); // part of speech\n\t\tcontentsField.addProperty(\"hw\", desensitize); // headword\n\t\tcontentsField.addPropertyAlternative(\"hw\", \"s\"); // case-sensitive version of above\n\t}",
"static void processDoc1(Document doc, int docno) throws IOException {\n\t\tString script = JetTest.config.getProperty(\"processDocument\");\n\t\t// if there is a name tagger, clear its cache\n\t\tif (JetTest.nameTagger != null) JetTest.nameTagger.newDocument();\n\t\tSpan all = new Span(0, doc.length());\n\t\tControl.applyScript (doc, all, script);\n\t}",
"public void setDocument(CorrelatorDocument doc) {\n\t\tm_document = doc;\n\t}",
"public DocMap(Gedcomx doc) {\n // Build all the maps.\n update(doc);\n }",
"public ReturnDocument setDocParams(OrderDocument odoc, ReturnDocument returnDoc) {\r\n\r\n returnDoc.setReturnOrderId(returnDoc.getDocumentNumber());\r\n returnDoc.setReturnDocumentStatusCode(MMConstants.OrderStatus.INITIATED);\r\n if (returnDoc.isReturnToVendorRequired())\r\n returnDoc.setReturnTypeCode(MMConstants.CheckinDocument.VENDOR_RETURN_ORDER_LINE);\r\n else\r\n returnDoc.setReturnTypeCode(MMConstants.CheckinDocument.CUSTOMER_ORDER_RETURN);\r\n\r\n Profile profile = null;\r\n\r\n if (odoc != null) {\r\n returnDoc.setCustomerProfileId(odoc.getCustomerProfileId());\r\n returnDoc.setOrderDocumentNumber(odoc.getDocumentNumber());\r\n returnDoc.setOrderDocument(odoc);\r\n\r\n returnDoc.setVendorHeaderGeneratedId(odoc.getVendorHeaderGeneratedId());\r\n returnDoc.setVendorDetailAssignedId(odoc.getVendorDetailAssignedId());\r\n returnDoc.setVendorNm(odoc.getVendorNm());\r\n\r\n returnDoc.setRetrievalBuildingCd(odoc.getDeliveryBuildingCd());\r\n Warehouse warehouse = odoc.getWarehouse();\r\n\r\n if (warehouse == null)\r\n warehouse = StoresPersistableBusinessObject.getObjectByPrimaryKey(Warehouse.class,\r\n odoc.getWarehouseCd());\r\n\r\n if (warehouse != null) {\r\n profile = warehouse.getBillingProfile();\r\n }\r\n }\r\n else {\r\n String initiator = GlobalVariables.getUserSession().getPerson().getPrincipalName();\r\n profile = SpringContext.getBean(ProfileService.class).getDefaultCustomerProfile(\r\n initiator);\r\n }\r\n\r\n if (profile != null)\r\n returnDoc.setCustomerProfileId(profile.getProfileId());\r\n returnDoc.getDocumentHeader().setDocumentDescription(\r\n \"Return of \" + returnDoc.getDocumentNumber());\r\n\r\n return returnDoc;\r\n }",
"public OracleXmlTypeValue(Document doc) {\n this.doc = doc;\n inputType = DOCUMENT;\n }",
"public Document buildDocument(Document doc) throws IOException {\n\t\treturn config.build(taxonomyWriter, doc);\n\t}",
"@Override\n\tpublic IFieldComparator<Long> setNextReader(IAtomicReaderRef context) throws IOException {\n\t\tmCurrentReaderValues = FieldCache.DEFAULT.getLongs(\n\t\t\t\tcontext.getReader(), mField, mParser, mMissingValue != null);\n\t\treturn super.setNextReader(context);\n\t}",
"protected abstract void parseEntries(final Document doc,\n final ContentCleaner contentCleaner,\n final Resource.Builder resource);",
"@Override\n protected void initializeReader() {\n this.fileList = new ArrayList<>();\n this.fileListPosition = new AtomicInteger(0);\n this.currentTextAnnotation = new AtomicReference<>();\n }",
"public void loadDocument(XCDocument doc) {\n\t\tthis.doc = doc;\n\t\tfor (int i=0; i<jtp.getTabCount()-1; i++) {\n\t\t\t((XCDisplay)jtp.getComponentAt(i)).loadDocument();\n\t\t}\n\t}",
"public Map<String, Object> nextDocument() throws IOException {\n // 1. When called, this API processes one document from corpus, and returns its\n // doc number and content.\n // 2. When no document left, return null, and close the file.\n // 3. the HTML tags should be removed in document content.\n if (fileList.size() > 0) {\n Map<String, Object> r = new HashMap<>();\n File dataFile = fileList.pop();\n\n FileInputStream document = new FileInputStream(dataFile);\n byte[] context = new byte[(int) dataFile.length()];\n document.read(context);\n document.close();\n String text = new String(context, \"UTF-8\");\n char[] valueText = text.replaceAll(\"\\\\p{Cc}\", \"\")\n .replaceAll(\"<[^>]*>\", \" \").trim().toCharArray();\n r.put(dataFile.getPath(), valueText);\n return r;\n }\n\n return null;\n\n }",
"public abstract Iterable<String> addDocument(TextDocument doc) throws IOException;",
"public Document readDocument();",
"public void readStoredDocField(IndexReader indexReader, int numberOfDocs) throws IOException {\n\n\t\t// Let's just retrieve the docno (external ID) and title of the first 100 documents in the index\n\n\t\t// store the names of the fields you hope to access in the following set\n\t\tSet<String> fieldset = new HashSet<>();\n\t\tfieldset.add( \"url\" );\n\t\tfieldset.add( \"body\" );\n\t\t// You can add more fields into the set as long as they have been stored at indexing time.\n\t\t// But for efficiency issues, you should only include the fields you are going to use.\n\n\t\tSystem.out.printf( \"%-10s%-15s%-30s\\n\", \"DOCID\", \"url\", \"body\" );\n\n\t\t// iteratively read and print out the first 100 documents' internal IDs, external IDs (DOCNOs), and titles.\n\t\tfor ( int docid = 0; docid < indexReader.maxDoc() && docid < numberOfDocs; docid++ ) {\n\n\t\t\t// The following line retrieves a stored document representation from the index.\n\t\t\t// It will only retrieve the fields you included in the set.\n\t\t\t// There is also a method ixreader.document( docid ), which simply retrieves all the stored fields for a document.\n\t\t\tDocument doc = indexReader.document( docid, fieldset );\n\n\t\t\t// Now you can get the string data previously stored in the field of the document.\n\t\t\t// Again, you can only access the data field's value if you stored the value at index time.\n\t\t\tString url = doc.getField( \"url\" ).stringValue();\n\t\t\tString body = doc.getField( \"body\" ).stringValue();\n\n\t\t\t// You can also store other types of data (such as integers, floats, bytes, etc) in an indexed document.\n\t\t\t// You can access the data using methods such as field.numericValue(), field.binaryValue(), etc.\n\n\t\t\tSystem.out.printf( \"%-10d%-15s%-30s\\n\", docid, url, body );\n\t\t}\n\t}",
"@SuppressWarnings({\"UnusedParameters\"})\n private void processBody(XMLStreamReader reader, Document luceneDoc, float docBoost, Record record, boolean origin)\n throws ParseException, XMLStreamException, IndexServiceException {\n Set<String> boostedFields = null;\n\n long startTime = System.nanoTime();\n\n // Fields\n if (!reader.hasNext()) {\n throw new ParseException(String.format(\"Expected content in %s\", record),\n reader.getLocation().getCharacterOffset());\n }\n while(reader.hasNext()) {\n reader.next();\n skipComments(reader);\n if (reader.getEventType() == XMLStreamReader.START_ELEMENT && SUMMA_FIELDS.equals(reader.getLocalName())\n && SUMMA_NAMESPACE.equals(reader.getName().getNamespaceURI())) {\n log.trace(\"Found <\" + SUMMA_FIELDS + \">. Parsing fields\");\n break;\n }\n }\n\n // TODO: Add check for field-count. If 0, then log a workflow warning\n log.trace(\"Adding fields to Lucene Document for \" + record);\n while (reader.hasNext()) {\n reader.next();\n skipComments(reader);\n if (reader.getEventType() == XMLStreamReader.END_ELEMENT\n && SUMMA_FIELDS.equals(reader.getLocalName())\n && SUMMA_NAMESPACE.equals(reader.getName().getNamespaceURI())) {\n log.trace(\"Reached </\" + SUMMA_FIELDS + \">. No more fields\");\n break;\n }\n if (reader.getEventType() != XMLStreamReader.START_ELEMENT) {\n if (reader.getEventType() == XMLStreamReader.CHARACTERS\n || reader.getEventType() == XMLStreamReader.COMMENT) {\n // Ignore text and comments in between fields\n } else {\n if (reader.getEventType() == XMLStreamReader.END_ELEMENT) {\n log.debug(\"Expected start-element but got \" + XMLUtil.eventID2String(reader.getEventType())\n + \" with name '\" + reader.getLocalName() + \"' in \" + record);\n } else {\n log.debug(\"Expected start-element but got \" + XMLUtil.eventID2String(\n reader.getEventType()) + \" in \" + record);\n }\n }\n continue;\n }\n if (!(SUMMA_FIELD.equals(reader.getLocalName()) &&\n SUMMA_NAMESPACE.equals(reader.getName().getNamespaceURI()))) {\n log.debug(String.format(\n \"The expected element was %s:%s, but the received was %s:%s. Ignoring element\",\n SUMMA_NAMESPACE, SUMMA_FIELD, reader.getName().getNamespaceURI(), reader.getLocalName()));\n continue;\n }\n // <field name=\"author\" boost=\"2.0\">Jens Hansen</field>\n String fieldName = getAttributeValue(reader, SUMMA_NAMESPACE, SUMMA_NAME);\n if (fieldName == null) {\n throw new ParseException(String.format(\"Field without name-attribute in %s\", record),\n reader.getLocation().getCharacterOffset());\n }\n\n Float boost = docBoost;\n try {\n //noinspection DuplicateStringLiteralInspection\n String boostString = getAttributeValue(reader, SUMMA_NAMESPACE, SUMMA_BOOST);\n if (boostString != null) {\n boost *= Float.valueOf(boostString);\n }\n } catch (Exception e) {\n log.debug(\"Exception extracting boost for field \" + fieldName + \" from Record \" + record.getId(), e);\n }\n // TODO: Verify how we handle embedded HTML\n String content = reader.getElementText();\n if (content != null) {\n // TODO: Perform a more complete trim (newline et al)\n content = content.trim();\n if (\"\".equals(content)) {\n continue; // We do not want to store empty content\n }\n\n // As we explicitly assign to NEUTRAL_BOOST and as a false negative is okay, it is safe to compare directly\n //noinspection FloatingPointEquality\n if (boost == NEUTRAL_BOOST || (boostedFields != null && boostedFields.contains(fieldName))) {\n boost = null;\n } else { // We have a boost and the field is not previously boosted\n if (boostedFields == null) {\n boostedFields = new HashSet<>();\n }\n boostedFields.add(fieldName);\n }\n\n LuceneIndexField indexField = addFieldToDocument(descriptor, luceneDoc, fieldName, content, boost);\n if (indexField.isInFreetext()) {\n addToFreetext(descriptor, luceneDoc, fieldName, content);\n }\n } else {\n log.debug(\"No content for field \" + fieldName + \" in \" + record);\n }\n }\n log.trace(\"Extracted and added body-information for \" + record + \" in \"\n + (System.nanoTime() - startTime) + \" ns\");\n }",
"@Override\n public void unpackMarkup(Document doc) throws DocumentFormatException {\n unpackMarkup(doc, (RepositioningInfo)null, (RepositioningInfo)null);\n }",
"private void endDoc() {\n\t\ttry {\n\t\t\t// Report the end of the document to the IndexListener\n\t\t\tindexer.getListener().documentDone(currentDocumentName);\n\n\t\t\t// Store the captured document content in the content store\n\t\t\t// and add the contents of the complex field to the Lucene document\n\t\t\taddContentToLuceneDoc();\n\n\t\t\t// Add the Lucene document to the index\n\t\t\tindexer.add(currentLuceneDoc);\n\n\t\t\t// Report character progress\n\t\t\treportCharsProcessed();\n\n\t\t\t// Reset the contents field for the next document\n\t\t\tcontentsField.clear();\n\n\t\t\t// Should we continue or are we done?\n\t\t\tif (!indexer.continueIndexing())\n\t\t\t\tthrow new MaxDocsReachedException();\n\n\t\t} catch (MaxDocsReachedException e) {\n\n\t\t\t// We've reached our maximum number of documents we'd like to index.\n\t\t\t// This is okay; just rethrow it.\n\t\t\tthrow e;\n\n\t\t} catch (Exception e) {\n\n\t\t\t// Some error occurred.\n\t\t\tthrow ExUtil.wrapRuntimeException(e);\n\n\t\t}\n\t}",
"public void setDocs(Doc[] newDocs) \n {\n\tdocs = newDocs;\n }",
"public void setDocument(Document value) {\n document = value;\n }",
"public Map<String, String> NextDocument() throws IOException {\n\t\tMap<String, String> map = new HashMap<>();\n\t\tStringBuffer content = new StringBuffer();\n\t\tString line = inputStream.readLine();\n\t\tif(line==null) {\n\t\t\tinputStream.close();\n\t\t\treturn null;\n\t\t} else {\n\t\t\tmap.put(\"DOCNO\", line);\n\t\t\tmap.put(\"CONTENT\", inputStream.readLine());\n\t\t\treturn map;\n\t\t}\n\t}",
"public void setDocument(final Document doc) {\n Document old = document;\n if (doc != document && highlighter != null) {\n highlighter.removeAllHighlights();\n }\n document = doc;\n firePropertyChange(StringConstants.TEXT_COMPONENT_DOCUMENT_PROPERTY,\n old, doc);\n setDocumentDirection();\n }",
"void addWordToDoc(int doc,VocabWord word);",
"void addWordsToDoc(int doc,List<VocabWord> words);",
"protected void resolveReferences(OxyDoc doc) throws OxyException {\r\n try {\r\n if (upstr!=null && upstr.length()!=0)\r\n next_up = (Component)doc.getElement(upstr);\r\n if (leftstr!=null && leftstr.length()!=0)\r\n next_left = (Component)doc.getElement(leftstr);\r\n if (downstr!=null && downstr.length()!=0)\r\n next_down = (Component)doc.getElement(downstr);\r\n if (rightstr!=null && rightstr.length()!=0)\r\n next_right = (Component)doc.getElement(rightstr);\r\n } catch (ClassCastException e) {\r\n throw new OxyException(\"error casting next_xx attribute to Component\");\r\n }\r\n }",
"public manageDoc() {\r\r\r\n\r\r\r\n }",
"@Override\r\n protected void parseDocuments()\r\n {\n\r\n }",
"private void UpdateCardFromDoc(Doc doc, CardData newCard) {\n newCard.setTitle(doc.getTitle());\n //newCard.setTopics()\n\n Img img = doc.getImg(); // Doc description\n if (img !=null && img.getUrl() != null) {\n\n Image image = new Image(); // image view\n image.setUrl(img.getUrl());\n\n // TODO: if width or height is zero, the\n // cacher will throw an error.\n if (img.getSize() !=null) {\n image.setHeight(img.getSize().getHeight());\n image.setWidth(img.getSize().getWidth());\n }\n\n newCard.setImg(image);\n }\n newCard.setId(doc.getId());\n newCard.setAuthor(doc.getAuthor());\n newCard.setDate(doc.getDate());\n newCard.setUrl(doc.getUrl());\n newCard.setText(doc.getText());\n\n newCard.setPrismaticActivity(doc.getPrismaticActivity());\n\n if (doc.getFeed() != null) {\n newCard.setFeedName(doc.getFeed().getTitle());\n newCard.setFeedUrl(doc.getFeed().getUrl());\n newCard.setFeedHighResImage(doc.getFeed().getHighResImage());\n newCard.setFeedImage(doc.getFeed().getImage());\n\n }\n }",
"public SimpleDocReader() { }",
"@Override\n public SearchDocument nextDocument(SearchQuery query, int docId) {\n return null;\n }",
"public void next() throws IOException {\r\n if (hasNext()) {\r\n line = next;\r\n next = null;\r\n\r\n int split = line.indexOf('=');\r\n fid = line.substring(0, split);\r\n text = line.substring(split + 1).split(\"\\\\|\", -1);//use -1 as limit to include empty trailing spaces\r\n if (type.getAttributeCount() != text.length)\r\n throw new DataSourceException(\"format error: expected \" + type.getAttributeCount()\r\n + \" attributes, but found \" + text.length + \". [\" + line + \"]\");\r\n } else {\r\n throw new NoSuchElementException();\r\n }\r\n }",
"protected void changeCSV(CSVDocument doc, int row, int col) {\n doc.moveRowUp(row);\n }",
"void readAPFdocument (Document apfDoc, String fileText) {\n\t\tNodeList sourceFileElements = apfDoc.getElementsByTagName(\"source_file\");\n\t\tElement sourceFileElement = (Element) sourceFileElements.item(0);\n\t\tsourceFile = sourceFileElement.getAttribute(\"URI\");\n\t\tsourceType = sourceFileElement.getAttribute(\"SOURCE\");\n\n\t\tNodeList documentElements = apfDoc.getElementsByTagName(\"document\");\n\t\tElement documentElement = (Element) documentElements.item(0);\n\t\tdocID = documentElement.getAttribute(\"DOCID\");\n\n\t\tif (Ace.perfectMentions & !Ace.perfectEntities) {\n\t\t\treadPerfectMentions (apfDoc, fileText);\n\t\t\treturn;\n\t\t}\n\n\t\tNodeList entityElements = apfDoc.getElementsByTagName(\"entity\");\n\t\tfor (int i=0; i<entityElements.getLength(); i++) {\n\t\t\tElement entityElement = (Element) entityElements.item(i);\n\t\t\tAceEntity entity = new AceEntity (entityElement, fileText);\n\t\t\taddEntity(entity);\n\t\t}\n\t\tNodeList valueElements = apfDoc.getElementsByTagName(\"value\");\n\t\tfor (int i=0; i<valueElements.getLength(); i++) {\n\t\t\tElement valueElement = (Element) valueElements.item(i);\n\t\t\tAceValue value = new AceValue (valueElement, fileText);\n\t\t\taddValue(value);\n\t\t}\n\t\tNodeList timexElements = apfDoc.getElementsByTagName(\"timex2\");\n\t\tfor (int i=0; i<timexElements.getLength(); i++) {\n\t\t\tElement timexElement = (Element) timexElements.item(i);\n\t\t\tAceTimex timex = new AceTimex (timexElement, fileText);\n\t\t\taddTimeExpression(timex);\n\t\t}\n\t\tNodeList relationElements = apfDoc.getElementsByTagName(\"relation\");\n\t\tfor (int i=0; i<relationElements.getLength(); i++) {\n\t\t\tElement relationElement = (Element) relationElements.item(i);\n\t\t\tAceRelation relation = new AceRelation (relationElement, this, fileText);\n\t\t\taddRelation(relation);\n\t\t}\n\t\tNodeList eventElements = apfDoc.getElementsByTagName(\"event\");\n\t\tfor (int i=0; i<eventElements.getLength(); i++) {\n\t\t\tElement eventElement = (Element) eventElements.item(i);\n\t\t\tAceEvent event = new AceEvent (eventElement, this, fileText);\n\t\t\taddEvent(event);\n\t\t}\n\t}",
"public void readDocVector(IndexReader indexReader, String fieldName, int docid) throws IOException {\n\n\t\tTerms vector = indexReader.getTermVector( docid, fieldName ); // Read the document's document vector.\n\n\t\t// You need to use TermsEnum to iterate each entry of the document vector (in alphabetical order).\n\t\tSystem.out.printf( \"%-20s%-10s%-20s\\n\", \"TERM\", \"FREQ\", \"POSITIONS\" );\n\t\tTermsEnum terms = vector.iterator();\n\t\tPostingsEnum positions = null;\n\t\tBytesRef term;\n\t\twhile ( ( term = terms.next() ) != null ) {\n\n\t\t\tString termstr = term.utf8ToString(); // Get the text string of the term.\n\t\t\tlong freq = terms.totalTermFreq(); // Get the frequency of the term in the document.\n\n\t\t\tSystem.out.printf( \"%-20s%-10d\", termstr, freq );\n\n\t\t\t// Lucene's document vector can also provide the position of the terms\n\t\t\t// (in case you stored these information in the index).\n\t\t\t// Here you are getting a PostingsEnum that includes only one document entry, i.e., the current document.\n\t\t\tpositions = terms.postings( positions, PostingsEnum.POSITIONS );\n\t\t\tpositions.nextDoc(); // you still need to move the cursor\n\t\t\t// now accessing the occurrence position of the terms by iteratively calling nextPosition()\n\t\t\tfor ( int i = 0; i < freq; i++ ) {\n\t\t\t\tSystem.out.print( ( i > 0 ? \",\" : \"\" ) + positions.nextPosition() );\n\t\t\t}\n\t\t\tSystem.out.println();\n\n\t\t}\n\t}",
"private void setView(LockedDocument doc) {\n\t\ttext1.setText(doc.getTitle());\n\t\ttext2.setText(doc.getContents());\n\t\ttext1.setFocusableInTouchMode(true);\n\t\ttext1.setEnabled(true);\n\t\ttext2.setFocusableInTouchMode(true);\n\t\ttext2.setEnabled(true);\n\t\tlock.setEnabled(false);\n\t\trefresh.setEnabled(false);\n\t\tsave.setEnabled(true);\n\t}",
"private Ref handleRef() throws XMLStreamException{\n String name = reader.getAttributeValue(0);\n nextTag();\n nextTag();\n return new Ref(definedGrammar, name);\n }",
"@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }",
"@Override\n protected void addFields(PdfFile source, Document doc) throws IOException {\n doc.add(createField(SOURCE, downloadService + source.getId()));\n\n String extractedText = extractText(source);\n doc.add(createField(CONTENT, extractedText));\n }",
"public void read() {\n\t\tSystem.out.println(\"word document\");\r\n\t}",
"public void setContent(Document doc) {\n\t\tString text = doc.getContent().toString();\n\t\txmldoc = new NlptoolsshareType();\n\t\tDocumentType docxml = new DocumentType();\n\t\tdocxml.setText(text);\n\t\txmldoc.setDocument(docxml);\n\t}",
"@Override\n public float customScore(int doc, float subQueryScore, float[] valSrcScores) throws IOException {\n\n Document document =context.reader().document(doc);\n IndexableField availabilityIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float availabilityScore = availabilityIf.numericValue().floatValue();\n\n IndexableField accuracyIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float accuracyScore = accuracyIf.numericValue().floatValue();\n\n IndexableField acceptRateIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float acceptRate = acceptRateIf.numericValue().floatValue();\n\n return (1 + availabilityScore * AVAILABILITY_MULTIPLIER\n + accuracyScore * ACCURACY_MULTIPLIER\n + ACCEPT_RATE_MULTIPLIER * acceptRate)\n * subQueryScore;\n\n }",
"protected Object readIntance(Object val) throws IOException, SerializeException {\r\n\t\treturn AdvancedDeserializerUtil.readIntance(super.readInstance(val));\r\n\t}",
"public void prepareForRun(OpenDefinitionsDocument doc) { }",
"@Override\n public void getNext(CAS aCAS) throws IOException, CollectionException {\n // TODO Auto-generated method stub\n JCas jcas;\n try {\n jcas = aCAS.getJCas();\n } catch (CASException e) {\n throw new CollectionException(e);\n }\n jcas.setDocumentText(cas);\n readflag = 0;//read only document and stop here\n }",
"void validateDocument(Document doc) throws ConverterException;",
"@Override\n\t\t\tpublic String toString(int doc) throws IOException {\n\t\t\t\treturn null;\n\t\t\t}",
"public void readFields(ResultSet arg0) throws SQLException {\n\t\tthis.startingPhrase = arg0.getString(1);\n\t\tthis.followingWord = arg0.getString(2);\n\t\tthis.count = arg0.getInt(3);\n\t}",
"public void doReads(Reader reader) throws IOException;",
"@Test\n void docs() {\n Schema schema = new Schema.Parser().parse(SCHEMA_WITH_DOC_TAGS);\n assertEquals(\"This is not a world record.\", schema.getDoc());\n assertEquals(\"Inner Fixed\", schema.getField(\"inner_fixed\").doc());\n assertEquals(\"Very Inner Fixed\", schema.getField(\"inner_fixed\").schema().getDoc());\n assertEquals(\"Inner String\", schema.getField(\"inner_string\").doc());\n assertEquals(\"Inner Enum\", schema.getField(\"inner_enum\").doc());\n assertEquals(\"Very Inner Enum\", schema.getField(\"inner_enum\").schema().getDoc());\n assertEquals(\"Inner Union\", schema.getField(\"inner_union\").doc());\n }",
"public void setDoc_No(java.lang.String doc_No) {\r\n this.doc_No = doc_No;\r\n }",
"JavadocToken nextToken();",
"public void readContent(BinaryDataReader dataReader) throws IOException\n\t{\n\t\t// parse tag data\n\t\tswitch (this.type)\n\t\t{\n\t\tcase BYTE:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase SHORT:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase LONG:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase ASCII:\n\t\t\tthis.content = readAscii(dataReader);\n\t\t\tbreak;\n\t\tcase RATIONAL:\n\t\t\t// convert tag value to long offset for reading large buffer\n\t\t\tthis.content = readRational(dataReader);\n\t\t\tbreak;\n\t\t\t\n\t\tcase UNKNOWN:\n\t\t\tSystem.err.println(\"Could not interpret tag with code: \"\n\t\t\t\t\t+ this.code + \" (\" + this.name + \")\");\n\t\t\tbreak;\n\t\t}\t\t\n\t}",
"public void setNrDoc(java.lang.String nrDoc) {\n this.nrDoc = nrDoc;\n }",
"public Document getDoc1() {\r\n return doc1;\r\n }",
"private void populateFields() {\n\n if (mReportCursor == null) {\n return;\n }\n\n Cursor c = mReportCursor;\n mValueText.setText(c.getString(c.getColumnIndexOrThrow(ReportPeer.KEY_VALUE)));\n }",
"@Override\n public CarDocument readNextRecord(BufferedReader bRdr) throws IOException {\n return null;\n }",
"abstract public TermDocs termDocs(Term t) throws IOException;",
"public void tagDocument (Document doc) {\n\t\tmene.newDocument();\n\t\tVector textSegments = doc.annotationsOfType (\"TEXT\");\n\t\tIterator it = textSegments.iterator ();\n\t\twhile (it.hasNext ()) {\n\t\t\tAnnotation ann = (Annotation)it.next ();\n\t\t\tSpan textSpan = ann.span ();\n\t\t\tSentenceSplitter.split (doc, textSpan);\n\t\t}\n\t\tVector sentences = doc.annotationsOfType (\"sentence\");\n\t\tIterator is = sentences.iterator ();\n\t\twhile (is.hasNext ()) {\n\t\t\tAnnotation sentence = (Annotation)is.next ();\n\t\t\tSpan sentenceSpan = sentence.span();\n\t\t\tTokenizer.tokenize (doc, sentenceSpan);\n\t\t\tLexicon.annotateWithDefinitions(doc, sentenceSpan.start(), sentenceSpan.end());\n\t\t\ttag (doc, sentenceSpan);\n\t\t}\n\t}",
"private void loadBookInformation(String rawPage, Document doc, Book book) {\n BookDetailParser parser = new BookDetailParser();\n SwBook swBook = parser.parseDetailPage(rawPage);\n book.setContributors(swBook.getContributors());\n book.setCover_url(coverUrlParser.parse(doc));\n book.setShort_description(descriptionShortParser.parse(doc));\n book.addPrice(swBook.getPrice().getPrices().get(0));\n book.setTitle(titleParser.parse(doc));\n }",
"private void advanceToNextReader(){\r\n\t\tcurrentReader = null;\r\n\t\treaderQueueIndex++;\r\n\t}",
"public void addDocument(Document doc) {\n\t\tif(doc != null)\n\t\t\tmyDocument.add(doc);\n\t}",
"private void readFromXMLFile(XMLStreamReader reader) throws XMLStreamException {\n while (reader.hasNext())\n {\n int eventType= reader.next();\n switch (eventType){\n case XMLStreamReader.START_ELEMENT:\n String elemName=reader.getLocalName();\n if (elemName.equals(\"student\"))\n {\n try {\n super.save(readStudent(reader));\n } catch (ValidatorException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }",
"private void addContentToLuceneDoc() {\n\t\t// Finish storing the document in the document store (parts of it may already have been\n\t\t// written because we write in chunks to save memory), retrieve the content id, and store\n\t\t// that in Lucene.\n\t\tint contentId = storeCapturedContent();\n\t\tcurrentLuceneDoc.add(new NumericField(ComplexFieldUtil.fieldName(\"contents\", \"cid\"),\n\t\t\t\tStore.YES, false).setIntValue(contentId));\n\n\t\t// Store the different properties of the complex contents field that were gathered in\n\t\t// lists while parsing.\n\t\tcontentsField.addToLuceneDoc(currentLuceneDoc);\n\t}",
"private void setView(UnlockedDocument doc) {\n\t\ttext1.setText(doc.getTitle());\n\t\ttext2.setText(doc.getContents());\n\t\ttext1.setFocusable(false);\n\t\ttext1.setEnabled(false);\n\t\ttext2.setFocusable(false);\n\t\ttext2.setEnabled(false);\n\t\tsave.setEnabled(false);\n\t\tlock.setEnabled(true);\n\t\trefresh.setEnabled(true);\n\t}",
"public void pegarDoc(Denuncia dGeral) {\n\t\t\t\n\t\t\t//-- para a tab endereço --//\n\t\t\ttabEnderecoController.lblDoc.setText(dGeral.getDoc_Denuncia() + \" | SEI nº: \" + dGeral.getDoc_SEI_Denuncia());\n\t\t\ttabEnderecoController.dGeralEnd = dGeral;\n\t\t}",
"@POST\r\n @Consumes\r\n @Path(\"/updatedoc\")\r\n public String updatedoc(Doc doc) throws JSONException {\r\n JSONObject result = new JSONObject();\r\n\r\n try {\r\n Doc d = dDao.getById(doc.getId());\r\n\r\n if (doc.getFinancetarget() != null) {\r\n d.setFinancetarget(doc.getFinancetarget());\r\n }\r\n\r\n if (doc.getCashbackup() != null) {\r\n d.setCashbackup(doc.getCashbackup());\r\n }\r\n\r\n if (doc.getProtectproduct() != null) {\r\n d.setProtectproduct(doc.getProtectproduct());\r\n }\r\n\r\n if (doc.getInvestgoods() != null) {\r\n d.setInvestgoods(doc.getInvestgoods());\r\n }\r\n\r\n if (doc.getHousing() != null) {\r\n d.setHousing(doc.getHousing());\r\n }\r\n\r\n if (doc.getBalance() != null) {\r\n d.setBalance(doc.getBalance());\r\n }\r\n\r\n if (doc.getCashplanning() != null) {\r\n d.setCashplanning(doc.getCashplanning());\r\n }\r\n\r\n if (doc.getRiskmanage() != null) {\r\n d.setRiskmanage(doc.getRiskmanage());\r\n }\r\n\r\n if (doc.getRiskstate() != null) {\r\n d.setRiskstate(doc.getRiskstate());\r\n\r\n }\r\n\r\n if (doc.getInvestplanning() != null) {\r\n d.setInvestplanning(doc.getInvestplanning());\r\n }\r\n\r\n if (doc.getEducationplanning() != null) {\r\n d.setEducationplanning(doc.getEducationplanning());\r\n }\r\n d.setUpdatetime(new Timestamp(System.currentTimeMillis()));\r\n dDao.save(d);\r\n\r\n result.put(\"msg\", \"修改成功\");\r\n result.put(\"status\", 0);\r\n } catch (Exception e) {\r\n result.put(\"msg\", \"发生错误\");\r\n result.put(\"status\", 1);\r\n }\r\n\r\n return result.toString();\r\n }",
"private static interface DefDocumentProcessor\n\t{\n\t\t/**\n\t\t * Called for every element found during processing of the s.t.\n\t\t * path.\n\t\t * @param documentPath an abstract pathname of the document\n\t\t * @throws XMLFormatException if document appears to be corrupted\n\t\t */\n\t\tvoid processElement(File documentPath) \n\t\t\tthrows XMLFormatException;\n\t}",
"public void fileOpened(OpenDefinitionsDocument doc) { }",
"public void fileOpened(OpenDefinitionsDocument doc) { }",
"public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}",
"int docValueCount() throws IOException;",
"protected void setValuesFromAlignment(final SAMRecord rec, final SAMRecord alignment) {\n for (final SAMRecord.SAMTagAndValue attr : alignment.getAttributes()) {\n // Copy over any non-reserved attributes.\n if (RESERVED_ATTRIBUTE_STARTS.indexOf(attr.tag.charAt(0)) == -1) {\n rec.setAttribute(attr.tag, attr.value);\n }\n }\n rec.setReadUnmappedFlag(alignment.getReadUnmappedFlag());\n rec.setReferenceIndex(alignment.getReferenceIndex());\n rec.setAlignmentStart(alignment.getAlignmentStart());\n rec.setReadNegativeStrandFlag(alignment.getReadNegativeStrandFlag());\n if (!alignment.getReadUnmappedFlag()) {\n // only aligned reads should have cigar and mapping quality set\n rec.setCigar(alignment.getCigar()); // cigar may change when a\n // clipCigar called below\n rec.setMappingQuality(alignment.getMappingQuality());\n }\n if (rec.getReadPairedFlag()) {\n rec.setProperPairFlag(alignment.getProperPairFlag());\n rec.setInferredInsertSize(alignment.getInferredInsertSize());\n rec.setMateUnmappedFlag(alignment.getMateUnmappedFlag());\n rec.setMateReferenceIndex(alignment.getMateReferenceIndex());\n rec.setMateAlignmentStart(alignment.getMateAlignmentStart());\n rec.setMateNegativeStrandFlag(alignment.getMateNegativeStrandFlag());\n }\n \n // If it's on the negative strand, reverse complement the bases\n // and reverse the order of the qualities\n if (rec.getReadNegativeStrandFlag()) {\n SAMRecordUtil.reverseComplement(rec);\n }\n \n if (clipAdapters && rec.getAttribute(ReservedTagConstants.XT) != null){\n CigarUtil.softClip3PrimeEndOfRead(rec, rec.getIntegerAttribute(ReservedTagConstants.XT));\n }\n }",
"protected void genReader() {\n\t\t\n\t\tfixReader_h();\n\t\tfixReader_cpp();\n\t}",
"public void setNewSpecAnimationDocument(Document doc) {\n\n\t\tthis.specDocument = doc;\n\t}"
] | [
"0.6003217",
"0.5488902",
"0.5304629",
"0.5284988",
"0.52297395",
"0.5220988",
"0.5216343",
"0.5205717",
"0.51577795",
"0.5146989",
"0.5107303",
"0.50892633",
"0.5056856",
"0.5043595",
"0.5022995",
"0.5019615",
"0.50058824",
"0.4976178",
"0.4970226",
"0.49590692",
"0.49212623",
"0.48737583",
"0.4852808",
"0.48508734",
"0.48365122",
"0.483383",
"0.4827211",
"0.4822146",
"0.48184568",
"0.48044413",
"0.47720838",
"0.47195262",
"0.47172272",
"0.470811",
"0.469076",
"0.46820086",
"0.4679797",
"0.4655259",
"0.46490484",
"0.46473426",
"0.46452802",
"0.46357772",
"0.4635395",
"0.46350837",
"0.46168",
"0.4581327",
"0.45735246",
"0.45554534",
"0.45542485",
"0.45535892",
"0.4545586",
"0.45434958",
"0.4539859",
"0.4537992",
"0.45356166",
"0.4526101",
"0.4523112",
"0.45123148",
"0.4488123",
"0.44871932",
"0.44788486",
"0.44780287",
"0.44717917",
"0.4470809",
"0.44663635",
"0.44632718",
"0.4462441",
"0.44605252",
"0.44577783",
"0.44258034",
"0.4416335",
"0.44154996",
"0.44150534",
"0.441017",
"0.440952",
"0.44078442",
"0.4397865",
"0.43939996",
"0.4389941",
"0.4388404",
"0.4374796",
"0.43746653",
"0.43678355",
"0.43656453",
"0.43615007",
"0.43602034",
"0.43598905",
"0.43542406",
"0.43516287",
"0.4350833",
"0.4349434",
"0.43354347",
"0.43301836",
"0.43284723",
"0.43284723",
"0.4326665",
"0.43157896",
"0.4311641",
"0.4310379",
"0.43034768"
] | 0.46759343 | 37 |
A count of the number of values at this document. | int docValueCount() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getValueCount() {\n return value_.size();\n }",
"public int getValueCount() {\n return value_.size();\n }",
"int getValuesCount();",
"int getMetricValuesCount();",
"public int getCount() {\n return definition.getInteger(COUNT, 1);\n }",
"@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }",
"@Override\n\tpublic int numValues() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"public Integer getCounts() {\n return counts;\n }",
"public final int count() {\n\t\tCountFunction function = new CountFunction();\n\t\teach(function);\n\t\treturn function.getCount();\n\t}",
"public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}",
"public int sizeOfValueArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(VALUE$0);\n }\n }",
"public int count() {\n\t\treturn count;\n\t}",
"public static int numElements() {\n return values().length;\n }",
"public Integer getCount() {\n\t\treturn count;\n\t}",
"public Integer getCount() {\n\t\treturn count;\n\t}",
"int getDocumentCount();",
"final public int getValueCount(int value) {\r\n \treturn this.values[value];\r\n }",
"public int size() {\n return this.values.length;\n }",
"public int getCount(){\n int c = 0;\n for(String s : this.counts){\n c += Integer.parseInt(s);\n }\n return c;\n }",
"public final int numberOfResponseValues()\n\t{\n\t\treturn m_responseValues != null ? m_responseValues.size() : 0;\n\t}",
"public Long getElementCount();",
"public int count(){\r\n\t\tint sum = 0;\r\n for(Integer value: words.values()){\r\n sum += value;\r\n }\r\n return sum;\r\n\t}",
"public int size() {\n return values.size();\n }",
"public int dataCount() {\n return this.root.dataCount();\n }",
"public int size() {\n int size = 0;\n for (Collection<V> value : map.values()) {\n size += value.size();\n }\n return size;\n }",
"public int count() {\r\n return count;\r\n }",
"public int count() {\n return this.count;\n }",
"public java.math.BigInteger getCount()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COUNT$8);\n if (target == null)\n {\n return null;\n }\n return target.getBigIntegerValue();\n }\n }",
"public int count() {\n return count;\n }",
"public Flowable<Integer> counts() {\n return createFlowable(b.updateBuilder, db) //\n .flatMap(Tx.flattenToValuesOnly());\n }",
"public int findAllCount() {\n\t\treturn mapper.selectCount(null);\n\t}",
"public int count() {\n return Query.count(iterable);\n }",
"@XmlAttribute\r\n public Integer getCount() {\r\n return count;\r\n }",
"@Override\n\tpublic int size() {\n\t\tint s = valCount; // saves value of current node\n\t\tfor (int i = 0; i < childCount; ++i) { // then checks all children\n\t\t\ts += children[i].size();\n\t\t}\n\t\treturn s;\n\t}",
"public Integer getCount() {\n return count;\n }",
"public Integer getCount() {\n return count;\n }",
"public Integer getCount() {\n return count;\n }",
"public Integer getCount() {\n return count;\n }",
"public Integer getCount() {\n return count;\n }",
"public Integer getCount() {\n return count;\n }",
"public int getCountOfData (){\n return getData() == null ? 0 : getData().size();\n }",
"int getStateValuesCount();",
"public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }",
"public int getStateValuesCount() {\n return stateValues_.size();\n }",
"public Integer getCount() {\n return count;\n }",
"public long count() {\n\t\treturn 0;\n\t}",
"public long count() {\n\t\treturn 0;\n\t}",
"public long getCount() {\n return count_;\n }",
"public long documentCount() {\n return this.documentCount;\n }",
"public int getDocumentCount() {\n return this.documentCount;\n }",
"public int getTotalCount() {\r\n return root.getTotalCount();\r\n }",
"public int getStateValuesCount() {\n return stateValues_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public long getCount() {\n return count_;\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"@Override\r\n\tpublic int getCollectionTotalCount() {\n\t\treturn data != null ? data.recordCount : 0;\r\n\t}",
"@Override\n public int getNInt() {\n return this.values.length;\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public int getDataCount() {\n return data_.size();\n }",
"public Integer getCount() {\n return this.count;\n }",
"public long getCount()\n\t{\n\t\treturn count;\n\t}",
"public long count() {\n return this.count;\n }",
"public Integer getAllCount() {\n\t\tString sql=\"select count(*) from statistics\";\n\t\tint count = (int)getCount(sql);\n\t\treturn count;\n\t}",
"int getDataCount();",
"int getDataCount();",
"int getDataCount();",
"int getDataCount();",
"int getDataCount();",
"public Integer count() {\n\t\tif(cache.nTriples != null)\n\t\t\treturn cache.nTriples;\n\t\treturn TripleCount.count(this);\n\t}",
"public String getCount() {\r\n\t\treturn this.count;\r\n\t}",
"public final int size() {\n int size = 0;\n final Iterator iterator = this.iterator();\n while (iterator.hasNext()) {\n size++;\n iterator.next();\n }\n return size;\n }",
"public int getDocCount(){\n\t\treturn index.size();\r\n\t}",
"public int size() {\n\t\tint result = 0;\n\t\tfor (E val: this)\n\t\t\tresult++;\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}",
"@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}",
"public int getCount() {\n\t\t\treturn data.size();\n\t\t}",
"public int getOccurrences() {\n\t\treturn this.occurrenceFactors.size();\n\t}",
"public Integer getDocumentCount() {\n return null;\n }",
"public int getCount() {\n if(data.size()<=0) return 1;\n return data.size();\n }",
"public int count() {\n\t Query count = getEntityManager().createQuery(\"select count(u) from \" + getEntityClass().getSimpleName() + \" u\");\n\t return Integer.parseInt(count.getSingleResult().toString());\n\t }",
"public Integer countAll() {\n\t\treturn null;\n\t}",
"public int getValuesSize() {\n return values.size();\n }",
"@Override\r\n\t\tpublic int count() {\n\t\t\treturn 0;\r\n\t\t}",
"public int getDataCount() {\n if (dataBuilder_ == null) {\n return data_.size();\n } else {\n return dataBuilder_.getCount();\n }\n }",
"public int getDataCount() {\n if (dataBuilder_ == null) {\n return data_.size();\n } else {\n return dataBuilder_.getCount();\n }\n }",
"public int size() {\n return count;\n }",
"public Long getCount() {\r\n return count;\r\n }",
"int getRequestedValuesCount();",
"public Long getCount() {\n return count;\n }",
"public int size()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.size();\n\t}",
"public int size() {\n\t\treturn count;\n\t}",
"public int size() {\n\t\treturn count;\n\t}",
"public int size() {\n\t\treturn count;\n\t}",
"public int _count() {\n return _count(\"\");\n }",
"public int getRequestedValuesCount() {\n return requestedValues_.size();\n }",
"public int getRequestedValuesCount() {\n return requestedValues_.size();\n }"
] | [
"0.7982191",
"0.79634035",
"0.7592686",
"0.7445359",
"0.734864",
"0.731924",
"0.72476166",
"0.7220656",
"0.718853",
"0.7049578",
"0.7022104",
"0.69473",
"0.6946533",
"0.6925752",
"0.6925752",
"0.6907697",
"0.6899712",
"0.6894107",
"0.6889231",
"0.68733656",
"0.6869151",
"0.6857546",
"0.68476534",
"0.6847118",
"0.68388253",
"0.6832068",
"0.68288034",
"0.6819988",
"0.6773445",
"0.67661476",
"0.67558265",
"0.6745505",
"0.6744179",
"0.67365164",
"0.67324305",
"0.67324305",
"0.67324305",
"0.67324305",
"0.67324305",
"0.67324305",
"0.6731315",
"0.67285424",
"0.67255855",
"0.6712732",
"0.6711141",
"0.67074525",
"0.67074525",
"0.6699445",
"0.6693201",
"0.6692692",
"0.6687608",
"0.6675489",
"0.6665214",
"0.66593593",
"0.6645675",
"0.6645675",
"0.6645675",
"0.6645675",
"0.6645675",
"0.66354346",
"0.66321886",
"0.66286486",
"0.66286486",
"0.6600812",
"0.6596585",
"0.65894836",
"0.65814996",
"0.65801865",
"0.65801865",
"0.65801865",
"0.65801865",
"0.65801865",
"0.65743876",
"0.65736103",
"0.6569195",
"0.65626395",
"0.65606976",
"0.6553799",
"0.6553799",
"0.6553691",
"0.65524256",
"0.65458906",
"0.6539954",
"0.65392226",
"0.6532678",
"0.6526786",
"0.6517034",
"0.65099514",
"0.65099514",
"0.65085196",
"0.6506002",
"0.65050024",
"0.6504957",
"0.65003663",
"0.6499151",
"0.6499151",
"0.6499151",
"0.6491221",
"0.6491138",
"0.6486035"
] | 0.7897059 | 2 |
Load and format the next value. | Object nextValue() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setNextValue() {\n this.value = this.value * 2;\n }",
"@NotNull\n @JsonProperty(\"nextValue\")\n public String getNextValue();",
"public void setNextValue(final String nextValue);",
"void loadNext();",
"public static String nextVal() {\n StringBuffer buffer = new StringBuffer(BUFFER_SIZE);\n buffer.append(clID);\n Date date = new Date(Timer.now());\n SimpleDateFormat format = new SimpleDateFormat(\".yyyyMMdd.HHmmss.\");\n assert date != null;\n assert buffer != null;\n assert format != null;\n buffer = format.format(date, buffer, new FieldPosition(0));\n buffer.append(String.valueOf(val));\n CLTRID.inc();\n\n return new String(buffer);\n }",
"private Serializable buildStringNextValue(String prefix, int nextValue) {\n\t\tSerializable result = null;\n\t\tString suffix = null;\n\t\tif (isStringFormatDecimal()) {\n\t\t\tif (getStringFormat() != null)\n\t\t\t\tsuffix = String.format(getStringFormat(), nextValue);\n\t\t\telse\n\t\t\t\tsuffix = String.format(\"%018d\", nextValue);\n\n\t\t\tresult = prefix.concat(suffix);\n\t\t} else {\n\t\t\tsuffix = String.valueOf(nextValue);\n\t\t\tresult = prefix.concat(suffix);\n\t\t}\n\t\tlog.debug(\"Custom generated sequence is : \" + result);\n\t\treturn result;\n\t}",
"public void loadValue() {\n int loadInt = assignedDataObject.getInt(name);\n Integer iv = new Integer(loadInt);\n editBeginValue = iv.toString();\n if (!showZero & loadInt == 0) editBeginValue = \"\";\n if (loadInt == 0 & assignedDataObject.getMode() == DataObject.INSERTMODE) editBeginValue = new Integer(defaultValue).toString();\n this.setText(editBeginValue);\n }",
"public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}",
"public Integer getNextValue() {\n return this.nextValue;\n }",
"void next(T value);",
"public String next() {\r\n\t\tif(firstVal) {\r\n\t\t\tfirstVal = true;\r\n\t\t\treturn getOutput();\r\n\t\t}\r\n\r\n\t\t// Build next lexicographic string and we use the getters to return, we use a finder method to accomplish this task.\r\n\t\tStringBuilder build = new StringBuilder(output);\r\n\t\tsetOutput((outputter(build, build.length()-1)).toString());\r\n\t\treturn getOutput();\r\n\t}",
"@Override\r\n public Object next() {\r\n V value = (V) currentCell.value;\r\n currentCell = currentCell.next;\r\n return value;\r\n }",
"private String getLongInstruction(int nextVal) throws java.io.IOException {\n\t\treadUntilEndOfLine(nextVal);\n\t\treturn next;\n\t}",
"public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}",
"public Data nextData()\r\n\t\t{\r\n\t\t\treturn this.nextData;\r\n\t\t}",
"public void setNext(Variable next){\n\t\tthis.next = next;\n\t}",
"@Override\n public double nextDouble() {\n return super.nextDouble();\n }",
"@Override\n public long nextLong() {\n return super.nextLong();\n }",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"public Long next() {\n\t\t\treturn Long.valueOf(nextLong());\n\t\t}",
"public static void initNext() { //ініціалізація лічильника нульовим значенням\n next = 0;\n }",
"public int getNext() {\n return value++;\n }",
"public String getNextField () {\n return nextField.toString();\n }",
"@Override\n public float nextFloat() {\n return super.nextFloat();\n }",
"@Override\n\t\t\tpublic FplValue next() {\n\t\t\t\treturn subListIter.next();\n\t\t\t}",
"@Override\n public T next() {\n current = current.next;\n return current.data;\n }",
"public int nextValue() {\n\t\tint temp = counter;\n\t\tcounter++;\n\t\treturn temp;\n\t}",
"public void next() {\n\t\t}",
"private Token getNextNumber() {\n StringBuilder sb = new StringBuilder();\n boolean isNegative = false;\n boolean isDouble = false;\n\n if (data[currentIndex] == '-') {\n isNegative = true;\n currentIndex++;\n }\n\n while (currentIndex < this.data.length) {\n char currChar = data[currentIndex];\n\n if (currChar == '.') {\n isDouble = true;\n sb.append(currChar);\n currentIndex++;\n continue;\n }\n\n if (Character.isDigit(currChar)) {\n sb.append(currChar);\n currentIndex++;\n } else {\n break;\n }\n }\n\n if (isDouble) {\n double number;\n\n try {\n number = Double.parseDouble(sb.toString());\n } catch (NumberFormatException ex) {\n throw new LexerException(\"Couldn't parse to double\");\n }\n number = isNegative ? -number : number;\n\n return new Token(TokenType.DOUBLE, number);\n } else {\n int number;\n\n try {\n number = Integer.parseInt(sb.toString());\n } catch (NumberFormatException ex) {\n throw new LexerException(\"Couldn't parse to integer\");\n }\n number = isNegative ? -number : number;\n\n return new Token(TokenType.INTEGER, number);\n }\n\n\n }",
"@Override\n\tpublic void onNext(Long value_long) {\n\t\tSystem.out.println(value_long);\n\t\titems.add(value_long);\n\t\t\n\t}",
"public int getNext() {\n synchronized(this) {\n System.out.println(\"For Value: \" + value);\n value = value + 1;\n return value;\n }\n }",
"public void convert(){\n afterValue = firstValue * 1000;\n }",
"@Override\n public double getValue() {\n return currentLoad;\n }",
"String getNext();",
"String getNext();",
"public void setNextData(Data nextData)\r\n\t\t{\r\n\t\t\tthis.nextData = nextData;\r\n\t\t}",
"private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }",
"@Override\n public float nextFloat() {\n nextState();\n return outputFloat();\n }",
"private void findNewNextInStack() {\n if (stack.empty()) {\n next = Chunk.NONE;\n return;\n }\n next = stack.pop();\n long valueReference = INVALID_VALUE_REFERENCE;\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n while (next != Chunk.NONE && valueReference == INVALID_VALUE_REFERENCE) {\n if (!stack.empty()) {\n next = stack.pop();\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n } else {\n next = Chunk.NONE;\n return;\n }\n }\n }",
"public double nextDouble() {\r\n\r\n\t\t//System.out.println(\"cur v\"+curVal);\r\n\t\tcurVal = (long) Math.pow(curVal, 2);\r\n\t\t//System.out.println(\"sq \"+curVal);\r\n\t\t\r\n\t\tLong l = new Long(curVal);\r\n\t\tStringBuffer sb = new StringBuffer(l.toString());\r\n\t\twhile(sb.length() < size){\t\t\t\r\n\t\t\tsb.append(\"7\");\r\n\t\t}\r\n\t\tint zeros = sb.indexOf(\"00\");\t\t\r\n\t\tString s = sb.toString();\r\n\t\tif(-1 != zeros){\r\n\t\t\ts = s.replace('0', '3');\t\t\r\n\t\t}\r\n\t\t//System.out.println(\"padded \"+s);\r\n\t\t\r\n\t\tint start = (s.length() - size) / 2;\t\t\r\n\t\t//System.out.println(\"start \"+start+\" start+s \"+(start+size));\r\n\t\tcurVal = Long.parseLong(s.substring(start, start+size));\r\n\t\t//System.out.println(\"next \"+curVal);\r\n\t\t\r\n\t\treturn (double)curVal/sizeMax;\r\n\t}",
"@Override\n public Integer next(){\n while(!isPowerOfTwo(this.getValue() + 1)){\n super.next(); \n }\n if(this.getValue() == 3)\n super.next();\n Integer save = this.getValue();\n super.next();\n return save;\n }",
"public final void next(java.nio.FloatBuffer fb)\r\n {\r\n fb.put((d0 >>> 8) * 0x1p-24f);\r\n fb.put((d1 >>> 8) * 0x1p-24f);\r\n fb.put((d2 >>> 8) * 0x1p-24f);\r\n updateState();\r\n }",
"public String getNextLabel () {\n return nextLabel;\n }",
"public void next() throws IOException {\r\n if (hasNext()) {\r\n line = next;\r\n next = null;\r\n\r\n int split = line.indexOf('=');\r\n fid = line.substring(0, split);\r\n text = line.substring(split + 1).split(\"\\\\|\", -1);//use -1 as limit to include empty trailing spaces\r\n if (type.getAttributeCount() != text.length)\r\n throw new DataSourceException(\"format error: expected \" + type.getAttributeCount()\r\n + \" attributes, but found \" + text.length + \". [\" + line + \"]\");\r\n } else {\r\n throw new NoSuchElementException();\r\n }\r\n }",
"public double provideNextValue() throws IndexOutOfBoundsException {\n try {\n return valuesList.get(currentIndex++);\n } catch (IndexOutOfBoundsException e) {\n throw new IndexOutOfBoundsException();\n }\n }",
"public int valueAndIncrement() {\n\t\tint x = offset;\n\t\tnext();\n\t\treturn x;\n\t}",
"public int getNextFieldIndex () {\n return labelStart;\n }",
"public Provider<T> getNextValue()\n {\n return this.next;\n }",
"@Override\n public Integer next() {\n Integer res = next;\n advanceIter();\n return res;\n }",
"public void _next() {\n Object o;\n try {\n o = iter.next();\n } catch (NoSuchElementException e) {\n has_next = 0;\n return;\n }\n // resolve object\n if (o == null) {\n has_next = 1;\n next = null;\n } else if (o instanceof IdentityIF) {\n try {\n o = txn.getObject((IdentityIF)o, true);\n if (o == null) {\n _next();\n } else {\n has_next = 1;\n next = (F) o;\n }\n } catch (Throwable t) {\n has_next = -1;\n next = null;\n }\n } else {\n has_next = 1;\n next = (F) o;\n }\n }",
"private void nextNumber() {\n\t\tint old=pos;\n\t\tmany(digits);\n\t\ttoken=new Token(\"num\",program.substring(old,pos));\n }",
"public T next() {\n T temp = this.curr.getData();\n this.curr = this.curr.getNext();\n return temp;\n }",
"private Object getNextElement()\n {\n return __m_NextElement;\n }",
"public static void chartNext() {\n\t\tchartId = (chartId+(hsPage = 1)) % chary.length;\n\t}",
"@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}",
"@Override\n public Integer next() {\n if(peekedVal != null ){\n Integer next = peekedVal;\n peekedVal = null;\n return next;\n }\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n return iter.next();\n\n }",
"public T next(){\n return (T)data[ci++];\n }",
"private Object readResolve() throws ObjectStreamException {\r\n if (this.equals(DatasetRenderingOrder.FORWARD)) {\r\n return DatasetRenderingOrder.FORWARD;\r\n }\r\n else if (this.equals(DatasetRenderingOrder.REVERSE)) {\r\n return DatasetRenderingOrder.REVERSE;\r\n }\r\n return null;\r\n }",
"void visit(final NextVal nextVal);",
"public T next() {\n T temp = this.curr.next.getData();\n this.curr = this.curr.next;\n return temp;\n }",
"public abstract BigInteger nextValue();",
"@Override\n\tpublic IFieldComparator<Long> setNextReader(IAtomicReaderRef context) throws IOException {\n\t\tmCurrentReaderValues = FieldCache.DEFAULT.getLongs(\n\t\t\t\tcontext.getReader(), mField, mParser, mMissingValue != null);\n\t\treturn super.setNextReader(context);\n\t}",
"private void moveNextInternal() {\n int prev = skipWhitespace();\n\n // end of file reached\n if (position >= length) {\n tokenType = CifTokenType.END;\n return;\n }\n\n tokenStart = position;\n tokenEnd = position;\n isEscaped = false;\n char c = data.charAt(position);\n switch (c) {\n case '#':\n skipCommentLine();\n tokenType = CifTokenType.COMMENT;\n break;\n case '\"': case '\\'':\n if (c == '\\'' && isTripleQuoteAtPosition()) {\n eatTripleQuote();\n tokenType = CifTokenType.VALUE;\n break;\n }\n eatEscaped(c);\n tokenType = CifTokenType.VALUE;\n break;\n case ';': // possible multiline value\n // multiline value must start at the beginning of the line\n if (prev == '\\n' || prev == '\\r') {\n eatMultiline();\n } else {\n eatValue();\n }\n tokenType = CifTokenType.VALUE;\n break;\n default:\n if (isImportGet) {\n eatImportGet();\n } else {\n eatValue();\n }\n\n // escaped is always Value\n if (isEscaped) {\n tokenType = CifTokenType.VALUE;\n // _ always means column name, including _import.get\n } else if (data.charAt(tokenStart) == '_') {\n if (inSaveFrame && isImportGet()) {\n isImportGet = true;\n }\n tokenType = CifTokenType.COLUMN_NAME;\n // 5th char needs to be _ for data_ or loop_\n } else if (tokenEnd - tokenStart >= 5 && data.charAt(tokenStart + 4) == '_') {\n if (isData()) {\n tokenType = CifTokenType.DATA;\n } else if (isSave()) {\n tokenType = CifTokenType.SAVE;\n } else if (isLoop()) {\n tokenType = CifTokenType.LOOP;\n } else {\n tokenType = CifTokenType.VALUE;\n }\n // all other tests failed, we are at Value token.\n } else {\n tokenType = CifTokenType.VALUE;\n }\n }\n }",
"public void setNextRecord()\n {\n currRecord++;\n if (monitor != null)\n monitor.setPercentComplete(currRecord / maxRecords * 100);\n }",
"public void next() {\n\t\tSystem.out.println(al.get(pos));\r\n\t\tpos++;\r\n\t}",
"public final void next(java.nio.FloatBuffer fb, int off)\r\n {\r\n fb.put(off++, (d0 >>> 8) * 0x1p-24f);\r\n fb.put(off++, (d1 >>> 8) * 0x1p-24f);\r\n fb.put(off, (d2 >>> 8) * 0x1p-24f);\r\n updateState();\r\n }",
"public long nextLong()\r\n\t{\r\n\t\tif(st == null || !st.hasMoreTokens())\r\n\t\t\tnewst();\r\n\t\treturn Long.parseLong(st.nextToken());\r\n\t}",
"private String getNext() {\n \t\t\n \t\tArrayList<String> reel = game.getType().getReel();\n \t\t\n \t\tRandom generator = new Random();\n \t\tint id = generator.nextInt(reel.size());\n \t\t\n \t\tString nextID = reel.get(id);\n \t\tString[] idSplit = nextID.split(\"\\\\:\");\n \t\t\n \t\tif (idSplit.length == 2) {\n \t\t\treturn nextID;\n \t\t}else {\n \t\t\tString newID;\n \t\t\tnewID = Integer.parseInt(idSplit[0]) + \":0\";\n \t\t\t\n \t\t\treturn newID;\n \t\t}\n \t}",
"public void testNext() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.getValue().inRange(0));\n test1.next();\n assertTrue(test1.getValue().inRange(1));\n test1.next();\n assertTrue(test1.getValue().inRange(2));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }",
"@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}",
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"@Override\n public String nextString() {\n last = (last + 1) % str.length;\n return str[last];\n }",
"private void loadNextTip(boolean prev) {\n\t\t// just to make sure that we never exceed the array index bound\n\t\t// assure that a valid daily tip is choosen\n\t\tif (prev) {\n\t\t\tnextHelpText -= 2;\n\t\t}\n\t\tif (nextHelpText < 0) {\n\t\t\tnextHelpText = helpTexts.length - 1;\n\t\t}\n\t\tif (nextHelpText >= helpTexts.length) {\n\t\t\tnextHelpText = 0;\n\t\t}\n\t\ttry {\n\t\t\thelpText.setPage(helpTexts[nextHelpText++]);\n\t\t} catch (IOException ioe) {\n\t\t\tbigInterface.getConsole().postMessage(\n\t\t\t\t\t\"ERROR loading the next daily tip: \" + helpTexts[nextHelpText - 1], BIGConsole.ERROR);\n\t\t}\n\t\t// store the index for the next tip\n\t\tparser.set(configFileKeyNext, new Integer(nextHelpText).toString());\n\t}",
"Node(T theValue, Node theNext) {\n if (theValue == null)\n throw new RuntimeException(\"Null is not accepted for data\");\n value = theValue;\n next = theNext;\n }",
"@Override\n public Object next() {\n Object retval = this.nextObject;\n advance();\n return retval;\n }",
"@Override\n\t\tpublic T1 next() {\n\t\t\treturn (T1)_items[getindex(++_current)];\n\t\t}",
"public int next() {\n\treturn _current < _last ? _data[_current++] : END;\n }",
"private void eatValue() {\n while (position < length) {\n switch (data.charAt(position)) {\n case '\\t': case '\\n': case '\\r': case ' ':\n tokenEnd = position;\n return;\n default:\n position++;\n break;\n }\n }\n tokenEnd = position;\n }",
"public int getNextUnSafeSequence(){ return value++;}",
"public byte NEXT() {\r\n\t\t//log(\"Frame.NEXT mp=\"+mp);\r\n\t\tint addr=base+(mp++);\r\n\t\tbyte b=heap.readByte(addr);\r\n\t\t//log(\"Frame.NEXT addr=\"+addr+\"; byte=\"+b+\" \"+hexByte(b));\r\n\t\treturn b;\r\n\t}",
"@Override\n\tpublic String getNextSequenceValue(String sequence) {\n\t\treturn \"\";\n\t}",
"public void incValue(){\n\t\tif(this.value < 9){\n\t\t\tthis.value++;\n\t\t}\n\t\telse{\n\t\t\tthis.value = 0;\n\t\t}\n\t}",
"protected final Object readResolve() throws ObjectStreamException {\r\n return Index.valueOf(_value);\r\n }",
"public Index next() {\n return Index.valueOf(value + 1);\n }",
"public long next() {\n long ret = prev;\n prev = current;\n current = ret + current;\n return ret;\n }",
"private void fetchStringValue(Tuple next, String columnName,\n ColumnValueAnalysisResult result) throws IOException,\n AnalysisException, ExecException {\n\t\tInteger order = AlpinePigSummaryStatistics.analyzingColumns.length*generator.getColumnOrder(columnName);\n\t\t//order = 0;\n\n\t\tresult.setMaxNA(true);\n\t\tresult.setQ1NA(true);\n\t\tresult.setMedianNA(true);\n\t\tresult.setQ3NA(true);\n\t\tresult.setMinNA(true);\n\t\tresult.setAvgNA(true);\n\t\tresult.setDeviationNA(true);\n\t\tresult.setZeroCountNA(true);\n\t\tresult.setPositiveValueCountNA(true);\n\t\tresult.setNegativeValueCountNA(true);\n\n\t\tresult.setMinNA(true);\n\n\t\tresult.setCount(null==next.get(order+1)?0:DataType.toLong(next.get(order+1)));\n\t\tresult.setUniqueValueCount(null==next.get(order+7)?0:DataType.toLong(next.get(order+7)));\n\t\tresult.setNullCount(null==next.get(order+2)?0:DataType.toLong(next.get(order+2)));\n\t\tresult.setEmptyCount(null==next.get(order+2)?0:DataType.toLong(next.get(order+2)));\n\t\tif(-1==result.getUniqueValueCount()){\n\t\t\tresult.setUniqueValueCountNA(true);\n\t\t}\n\n\t\tresult.setTop01Value(null == next.get(order + 14) ? 0 : (next.get(order + 14)));\n\t\tresult.setTop01Count(null == next.get(order + 15) ? 0 : DataType.toLong(next.get(order + 15)));\n\t\tresult.setTop02Value(null == next.get(order + 16) ? 0 : (next.get(order + 16)));\n\t\tresult.setTop02Count(null == next.get(order + 17) ? 0 : DataType.toLong(next.get(order + 17)));\n\t\tresult.setTop03Value(null == next.get(order + 18) ? 0 : (next.get(order + 18)));\n\t\tresult.setTop03Count(null == next.get(order + 19) ? 0 : DataType.toLong(next.get(order + 19)));\n\t\tresult.setTop04Value(null == next.get(order + 20) ? 0 : (next.get(order + 20)));\n\t\tresult.setTop04Count(null == next.get(order + 21) ? 0 : DataType.toLong(next.get(order + 21)));\n\t\tresult.setTop05Value(null == next.get(order + 22) ? 0 : (next.get(order + 22)));\n\t\tresult.setTop05Count(null == next.get(order + 23) ? 0 : DataType.toLong(next.get(order + 23)));\n\t\tresult.setTop06Value(null == next.get(order + 24) ? 0 : (next.get(order + 24)));\n\t\tresult.setTop06Count(null == next.get(order + 25) ? 0 : DataType.toLong(next.get(order + 25)));\n\t\tresult.setTop07Value(null == next.get(order + 26) ? 0 : (next.get(order + 26)));\n\t\tresult.setTop07Count(null == next.get(order + 27) ? 0 : DataType.toLong(next.get(order + 27)));\n\t\tresult.setTop08Value(null == next.get(order + 28) ? 0 : (next.get(order + 28)));\n\t\tresult.setTop08Count(null == next.get(order + 29) ? 0 : DataType.toLong(next.get(order + 29)));\n\t\tresult.setTop09Value(null == next.get(order + 30) ? 0 : (next.get(order + 30)));\n\t\tresult.setTop09Count(null == next.get(order + 31) ? 0 : DataType.toLong(next.get(order + 31)));\n\t\tresult.setTop10Value(null == next.get(order + 32) ? 0 : (next.get(order + 32)));\n\t\tresult.setTop10Count(null == next.get(order + 33) ? 0 : DataType.toLong(next.get(order + 33)));\n\n\n\t}",
"public TurnHelper next() {\n return values()[ordinal() + 1];\n }",
"public synchronized Pair<K, V> next() throws IOException {\n\t\t\treturn data.next();\n\t\t}",
"public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }",
"public int getNextValue() {\n\t\tRandom randomGenerator = new Random();\n\t\tint randomInt = randomGenerator.nextInt(100) + 1;\n\t\treturn randomInt;\n\t}",
"@Override\r\n\tpublic void next() {\n\n\t}",
"public E next(){\r\n E data = node.getData();\r\n node = node.getNext();\r\n return data;\r\n }",
"public final double setNext\r\n ( DataID dID // input\r\n , double value // input\r\n )\r\n {\r\n double result = 0.0;\r\n \r\n // &&& There must be a better way than this...\r\n switch ( dID )\r\n {\r\n case DATA_A:\r\n result = set( DataID.DATA_C, value );\r\n break;\r\n case DATA_B:\r\n result = set( DataID.DATA_A, value );\r\n break;\r\n case DATA_C:\r\n result = set( DataID.DATA_B, value );\r\n break;\r\n default:\r\n System.out.printf( \"TriangleData.setNext() called with %d\\n\"\r\n , dID.ordinal()\r\n ); \r\n } // switch\r\n\r\n return result;\r\n \r\n }",
"@Override\n public V next() throws NoSuchElementException {\n Object result;\n if (this.hasNext()) {\n result = myHashMap.getTable()[this.number].getValue();\n this.number++;\n } else {\n throw new NoSuchElementException(\"\");\n }\n return (V) result;\n }",
"public void next(){\n if(stageNum < (defineStageNum)) {\n stageNum++;\n }else {\n stageNum = startStageNum;\n }\n }",
"private void updateMax(int next) {\n while (val < next) {\n val = next;\n }\n }",
"@Override\n\tpublic void next() {\n\t\t\n\t}",
"@Override\r\n public Integer next() {\r\n // Time complexity: O(1), where the problem size N \r\n // represents the size of the sequence to generate.\r\n if (!hasNext()) // check if the current element has a next element in this sequence\r\n return null; \r\n int current = next; // set the current element to next\r\n generatedCount++; // increment the number of generated elements so far\r\n next *= RATIO; // set the next element (adds the common ratio to the current number)\r\n return current; // return the current number as the generated one\r\n }",
"synchronized public long peek() {\n return currValue;\n }",
"private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {\n\n DatumType type = tag.type;\n @NotNull JsonToken token = currentToken();\n // null?\n if (token == JsonToken.VALUE_NULL) return type.createValue(null);\n // error?\n final @Nullable String firstFieldName;\n if (token == JsonToken.START_OBJECT) { // can be a record or an error\n firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)\n if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());\n } else firstFieldName = null;\n // datum\n final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);\n return datum.asValue();\n }"
] | [
"0.6452794",
"0.6354825",
"0.6265074",
"0.61319804",
"0.6128912",
"0.6098526",
"0.5970803",
"0.5749756",
"0.568146",
"0.5670271",
"0.5637124",
"0.56332374",
"0.5537614",
"0.5455077",
"0.54314613",
"0.54181516",
"0.5407382",
"0.54060674",
"0.5388013",
"0.53608936",
"0.5334684",
"0.5328283",
"0.530779",
"0.5299433",
"0.52901995",
"0.52888215",
"0.5269961",
"0.52689034",
"0.52680445",
"0.5261483",
"0.5243001",
"0.52396876",
"0.5211881",
"0.5196068",
"0.5196068",
"0.5192361",
"0.51881737",
"0.5184992",
"0.5177256",
"0.51729983",
"0.5161483",
"0.51578534",
"0.51466835",
"0.5129967",
"0.51093614",
"0.50983286",
"0.5093302",
"0.5092418",
"0.5080794",
"0.5078366",
"0.50744265",
"0.5042133",
"0.5024815",
"0.50164616",
"0.50152344",
"0.50083417",
"0.5006093",
"0.49992377",
"0.4997244",
"0.49906877",
"0.4984759",
"0.49828136",
"0.49732006",
"0.49690282",
"0.49628988",
"0.49520507",
"0.49465716",
"0.49444428",
"0.49422914",
"0.49223828",
"0.49219593",
"0.4921454",
"0.49095446",
"0.49083012",
"0.49061173",
"0.49028283",
"0.48982733",
"0.4897582",
"0.48947638",
"0.4894387",
"0.48877898",
"0.48811188",
"0.48762244",
"0.4874614",
"0.48677707",
"0.48633438",
"0.48574722",
"0.48536265",
"0.48485482",
"0.484086",
"0.48404852",
"0.48376858",
"0.4835668",
"0.48352453",
"0.48347655",
"0.48299068",
"0.4820559",
"0.4819378",
"0.48159057",
"0.48080954"
] | 0.64502114 | 1 |
get best move for current game situation | private Move getBestMove() {
System.out.println("getting best move");
ChessConsole.printCurrentGameState(this.chessGame);
System.out.println("thinking...");
List<Move> validMoves = generateMoves(false);
int bestResult = Integer.MIN_VALUE;
Move bestMove = null;
for (Move move : validMoves) {
executeMove(move);
//System.out.println("evaluate move: "+move+" =========================================");
int evaluationResult = -1 * negaMax(this.maxDepth,"");
//System.out.println("result: "+evaluationResult);
undoMove(move);
if( evaluationResult > bestResult){
bestResult = evaluationResult;
bestMove = move;
}
}
System.out.println("done thinking! best move is: "+bestMove);
return bestMove;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }",
"PrioritizedMove getBestMoveFor(int player, int desiredLength);",
"public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }",
"private Move getBestMove(Node node) {\n Move bestMove = null;\n double best_val = Integer.MIN_VALUE;\n for (Node child : node.getChildren()) {\n double payOff = (child.getPlays() == 0) ? 0 : (child.getWins() / child.getPlays());\n if (child.getPlays() == 0) {\n System.out.println(\"No records for play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", board: \" + Arrays.deepToString(child.getState().getBoard()));\n } else {\n System.out.println(\"payOff: \" + payOff + \", play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", plays: \" + child.getPlays() + \", wins: \" + child.getWins());\n }\n if (payOff > best_val) {\n best_val = payOff;\n bestMove = child.getState().getMove();\n }\n }\n System.out.println();\n return bestMove;\n }",
"@Override\r\n\t\tpublic Action BestMove(AI_Domain game) {\r\n\t\t\t return new Action(minimax(game,true,depth,true,null).getPath());\r\n\t\t}",
"public Move pickBestMove(Board board) {\n\t\treturn null;\n\t}",
"private NewMove findBestMove(ChessGameNode node, char player ) {\r\n\t\tChessGameNode[] childrenNodes = node.getChildren();\r\n\t\tint currentValue = this.rootNode.getValue();\r\n\t\tint bestValue = 0;\r\n\t\tNewMove bestMove = null;\r\n\t\tfor( ChessGameNode childNode : childrenNodes) {\r\n\t\t\tif (childNode != null) {\r\n\t\t\t\tif (player == 'w') {\r\n\t\t\t\t\tif (childNode.getValue() >= currentValue) {\r\n\t\t\t\t\t\tbestValue = childNode.getValue();\r\n\t\t\t\t\t\tbestMove = childNode.getOriginalMove();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (player == 'b') {\r\n\t\t\t\t\tif (childNode.getValue() <= currentValue) {\r\n\t\t\t\t\t\tbestValue = childNode.getValue();\r\n\t\t\t\t\t\tbestMove = childNode.getOriginalMove();\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}\r\n\t\treturn bestMove;\r\n\t}",
"private double[] chooseBestMove(List<double[]> possibleMoves) {\n double bestScore = 0;\n int indexBest = 0;\n for (int i = 0; i < possibleMoves.size(); i++) {\n if (possibleMoves.get(i)[4] > bestScore) {\n bestScore = possibleMoves.get(i)[4];\n indexBest = i;\n }\n }\n return possibleMoves.get(indexBest);\n }",
"public NewMove getBestMove(char player) {\r\n\t\tinitRootNode(player);\r\n\t\tcreateChildrenNodes(this.rootNode);\r\n\t\tNewMove bestMove = findBestMove(this.rootNode, player);\r\n\t\tbestMove.getUnit().show();\r\n\t\tSystem.out.println(bestMove.getUnit().getColor());\r\n\t\tSystem.out.println(bestMove.getUnit().getX());\r\n\t\treturn bestMove;\r\n\t}",
"public MoveNode getBestMove() {\n if (rootValues.isEmpty()) {\n return null;\n }\n\n MoveNode moveNode = rootValues.get(0);\n int maxScore = moveNode.getMinimaxValue();\n\n for(MoveNode m : rootValues) {\n if(m.getMinimaxValue() > maxScore) {\n moveNode = m;\n maxScore = m.getMinimaxValue();\n }\n }\n\n return moveNode;\n }",
"@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}",
"private Move guessBestMove(Piece player, Board board, double cutoff) {\n Board newBoard = new Board(board);\n Move bestSoFar;\n Iterator<Move> moveIterator = board.iterator();\n bestSoFar = moveIterator.next();\n newBoard.retract();\n while (moveIterator.hasNext()) {\n Move nextMove = moveIterator.next();\n int val = eval(newBoard);\n newBoard.makeMove(nextMove);\n if (eval(newBoard) > val) {\n bestSoFar = nextMove;\n val = eval(newBoard);\n if (val >= cutoff) {\n break;\n }\n }\n newBoard.retract();\n }\n return bestSoFar;\n }",
"public abstract void makeBestMove();",
"private int getSmartMove(char[] boardConfig) {\n\n ArrayList<Integer> emptySpaces = getEmptySpaces(boardConfig);\n\n double bestScore = -1;\n String bestChoice = \"\";\n int move = 0;\n\n //Loop through each empty space on the board\n for (Integer emptySpace : emptySpaces) {\n int space = emptySpace;\n\n char[] tempBoard = new char[boardConfig.length];\n\n //Create a copy of the board array\n System.arraycopy(boardConfig, 0, tempBoard, 0, boardConfig.length);\n\n //Add the current player's piece to the current empty spot\n tempBoard[space] = game.getPlayer() == 0 ? 'X' : 'O';\n\n //Get a string from the possible move board\n String tempBoardString = boardToString(tempBoard);\n\n //Attempt to get the possible move board configuration data from the long term memory\n BoardRecord record = longTermMemory.get(tempBoardString);\n\n //Check if a record was found\n if (record != null) {\n\n //Calculate the score of the current move in question\n float currentValue = (float) (record.getWins() - record.getLosses()) / (record.getLosses() + record.getWins() + record.getTies());\n\n //If the new move is better than the current best move choose it\n if (currentValue > bestScore) {\n bestScore = currentValue;\n move = space;\n bestChoice = tempBoardString;\n }\n }\n }\n\n if (!Objects.equals(bestChoice, \"\")) {\n shortTermMemory.add(bestChoice);\n return move;\n } else {\n return getRandomMove(boardConfig);\n }\n }",
"private int getBestMove(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return 0;\n }\n if (depth > STEP_BACK_DEPTH) {\n try {\n Thread.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n if (shouldStop()) {\n Log.d(Constants.MY_TAG,\"out CalculatingBot\");\n unlock();\n return 0;\n }\n }\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return minimum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n return minimum;\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return maximum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n return maximum;\n }\n }",
"public static int findBestMove(Board board, PieceType playerPiece) {\n int bestVal = -1000;\n int row = -1;\n int col = -1;\n\n // Traverse all cells, evaluate minimax function\n // for all empty cells. And return the cell\n // with optimal value.\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n // Check if cell is empty\n if (board.getBoard()[i][j] == 0) {\n // Make the move\n board.getBoard()[i][j] = playerPiece.getValue();\n\n // compute evaluation function for this\n // move.\n int moveVal = minimax(board, playerPiece, 0, false);\n\n // Undo the move\n board.getBoard()[i][j] = 0;\n\n // If the value of the current move is\n // more than the best value, then update\n // best/\n if (moveVal > bestVal) {\n row = i;\n col = j;\n bestVal = moveVal;\n }\n }\n }\n }\n return (col + 1) + (row * board.getGame().getGridType().getSize());\n }",
"@Override\n /**\n * Selects a move based on the current game state\n */\n public Move selectMove() {\n Game game = this.game.copy();\n List<Move> moves = game.getValidMoves(this.player);\n Collections.shuffle(moves);\n\n // Create a thread pool\n Executor executor = Executors.newFixedThreadPool(this.threadCount);\n CompletionService<MinimaxEngineWorker> service = new ExecutorCompletionService<MinimaxEngineWorker>(executor);\n\n // Determine the value of each move using the thread pool\n for (Move move : moves) {\n service.submit(new MinimaxEngineWorker(game, move, this.hashMap));\n }\n\n Move bestMove = null;\n double bestMoveValue = Double.NEGATIVE_INFINITY;\n int movesSize = moves.size();\n long moveCount = 0;\n long hashMapHits = 0;\n for (int i = 0; i < movesSize; i++) {\n try {\n // Block until a worker thread finishes\n MinimaxEngineWorker worker = service.take().get();\n\n // Report progress\n moveCount += worker.moveCount;\n hashMapHits += worker.hashMapHits;\n this.setProgress((double) i / movesSize, moveCount, hashMapHits);\n\n // Update the best move\n if (bestMove == null || worker.moveValue >= bestMoveValue) {\n bestMove = worker.move;\n bestMoveValue = worker.moveValue;\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }\n \n // Clear the hashmap\n this.hashMap.clear();\n Runtime.getRuntime().gc();\n\n return bestMove;\n }",
"public int[] getMove() {\n int[] bestMove = new int[] {-1, -1, -1};\n int bestEval = Integer.MIN_VALUE;\n for (final BoardTree child : this.children) {\n if (child.evaluation > bestEval) {\n bestEval = child.evaluation;\n bestMove = child.prevMove;\n }\n if (VERBOSE) {\n System.out.println(Arrays.toString(child.prevMove)+\":\"+child.evaluation);\n }\n }\n delTree(this);\n\n if (VERBOSE) {\n System.out.println(\"Chose eval: \"+bestEval);\n }\n return bestMove;\n }",
"public PossibleMove getBestCatMove(int[][] currentBoard, int round){\n\t\t//looks at each option\n\t\troundLims.put(round, -10000);\n\t\tint bestscore = -10000;\n\t\tPossibleMove bestmove = null;\n\t\t\n\t\tArrayList<PossibleMove> moves;\n\t\tmoves = Dog.allLegalMoves(currentBoard);\n\t\t\n\t\tfor(PossibleMove option: moves){\n\t\t\tint score;\n\t\t\tif(Cat.wins(option.getBoard())){\n\t\t\t\tscore = -1000;\n\t\t\t}\n\t\t\telse if(Dog.wins(option.getBoard())){\n\t\t\t\tscore = 1000;\n\t\t\t\treturn option;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tscore = miniMax(option, (round+1), currentBoard);\n\t\t\t}\n\t\t\tif (score > bestscore){\n\t\t\t\t\tbestscore = score; \n\t\t\t\t\tbestmove = option;\n\t\t\t\t}\n\t\t\tif(score>roundLims.get(round)){\n\t\t\t\troundLims.put(round, score);\n\t\t\t}\n\t\t}\n\t recursiveLimit= recursiveLimitOrig;\n\t return bestmove;\n\t}",
"public MoveEvaluation computeBest (int ply, IGameState s, IPlayer player, IPlayer opponent) {\n\t\tthis.original = player;\n\t\tthis.state = s.copy();\n\t\tMoveEvaluation move = minimax(ply, IComparator.MAX, player, opponent);\n\t\treturn move;\n\t}",
"public Location computerMove()\n\t{\n\t\tArrayList<Location> possibleLocs = new ArrayList<Location>();\n\t\tfor (int row = 0; row < grid.length; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < grid[0].length; col++)\n\t\t\t{\n\t\t\t\tLocation temp = new Location(row, col);\n\t\t\t\tif (!isOccupied(temp))\n\t\t\t\t\tpossibleLocs.add(temp);\n\t\t\t}\n\t\t}\n\t\tfor (int count = 0; count < possibleLocs.size(); count++)\n\t\t{\n\t\t\tif (checkWin(1, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t\telse if (checkWin(0, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t}\n\t\treturn possibleLocs.get((int) (Math.random() * possibleLocs.size()));\n\t}",
"protected Direction selectMove() {\n Map<Integer, Direction> positive, negative;\n // Add the directions that contains negative stations in a negative set\n // And every other direction in a positive set\n positive = new HashMap<Integer,Direction>(16);\n negative = new HashMap<Integer,Direction>(16);\n for (Direction d : Direction.directions) {\n int result = checkMove(d);\n if (result == 1) {\n positive.put(positive.size(), d);\n } else if (result == 0) {\n negative.put(negative.size(), d);\n } else {\n continue;\n }\n }\n // If there is no positive move, choose a RANDOM negative move\n if (positive.isEmpty()) {\n return negative.get(rand.nextInt(negative.size()));\n } else { // Otherwise choose a RANDOM positive move\n return positive.get(rand.nextInt(positive.size()));\n }\n }",
"@Override\n\tpublic GridCell execute() {\n\t\t//1. if there is a winning position, take it\n\t\tArrayList<GridCell> winningCell = TicTacToeBoardExaminer.getWinningPositions(board, side);\n\t\tif (winningCell.size() > 0) {\n\t\t\tGridCell move = winningCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//2. if there is a losing position, block it\n\t\tArrayList<GridCell> losingCell = TicTacToeBoardExaminer.getLosingPositions(board, side);\n\t\tif (losingCell.size() > 0) {\n\t\t\tGridCell move = losingCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//TODO: Implement checking of forks. This will get you to 100% win or tie rate\n\t\t\n\t\t//3. Otherwise get the optimal position\n\t\tGridCell optimal = TicTacToeBoardExaminer.getOptimal(board, side);\n\t\tif (optimal != null)\n\t\t\treturn optimal;\n\t\t\n\t\t//4. Otherwise just move randomly\n\t\telse \n\t\t\treturn new RandomStrategy(board, side).execute();\n\t\t\n\t}",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"private Move defaultMoveInGoodPlace(PentagoBoard b0) {\n \tPentagoBoard b = (PentagoBoard)b0.clone();\n \tList<Move> moves = b.getMovesFor(getColor());\n \tfor(Move m: moves) {\n \t\tPentagoMove pM = (PentagoMove)m;\n \t\tif(havMyNeighbour(b,getColor(), pM.getPlaceX(), pM.getPlaceY()) == false)\n \t\t\tcontinue;\n \t\tif(canWinInRow(b,pM.getPlaceY(),getColor())) {\n \t\t\tb.doMove(m);\n \t\t\tif(canWinOpponentNow(b) != null) { // przeciwnik nie moze wygrac po moim ruchu\n \t\t\tb.undoMove(m);\n \t\t\tcontinue;\n \t\t}\n \t\t\treturn m;\n \t\t}\n \t\tif(canWinInColumn(b,pM.getPlaceX(),getColor())) {\n \t\t\tb.doMove(m);\n \t\t\tif(canWinOpponentNow(b) != null) { // przeciwnik nie moze wygrac po moim ruchu\n \t\t\tb.undoMove(m);\n \t\t\tcontinue;\n \t\t}\n \t\t\treturn m;\n \t\t}\n \t}\n \treturn null;\n }",
"private void intelligentDecideMove() {\n\t\tMonster target=nearestEnemy();\r\n\t\tif(target!=null){\t\t\t\t//FIRST PRIORITY: pursue the target if it can be seen.\r\n\t\t\tswitchStates(PURSUIT);\r\n\t\t\ttargetTile=new Tile(target.currentTile);\r\n\t\t\t//saveMove();\r\n\t\t\tmonster.moveTowards(target);\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\ttargetLostResponse();\r\n\t\t\t}\r\n\t}",
"private Pair decideMovement(Entity e) {\n Pair pos = gameMap.getCoordinatesFor(e.getId());\n Movable movable = mm.get(e);\n Array<Pair> reachableCells = gameMap.pathFinder.getReachableCells(pos.x, pos.y, movable);\n ImmutableBag<Integer> enemies = groupAI.getEnemies(e);\n if (enemies.size() == 0) return reachableCells.get(MathUtils.random(reachableCells.size-1));\n\n // The best enemy you are considering chasing and its score\n int targetEnemy = -1;\n float bestScore = 0f;\n\n // The current enemy you are checking out and its score\n int id;\n float score;\n\n // How far away is the enemy? How many enemies are within a small radius of it?\n int distance, count;\n\n for (int i = 0; i < enemies.size(); i++) {\n count = 1;\n Pair target = gameMap.getCoordinatesFor(enemies.get(i));\n distance = MapTools.distance(pos.x, pos.y, target.x, target.y);\n for (Pair cell : MapTools.getNeighbors(target.x, target.y, 6)) {\n id = gameMap.getEntityAt(cell.x, cell.y);\n if (!enemies.contains(id)) continue;\n count++;\n }\n\n score = groupAI.entityScores.get(enemies.get(i)) * count / (1 + distance / 5);\n if (score > bestScore) {\n bestScore = score;\n targetEnemy = enemies.get(i);\n }\n }\n\n if (targetEnemy > -1) {\n Pair target = gameMap.getCoordinatesFor(targetEnemy);\n Path path = gameMap.pathFinder.findPath(pos.x, pos.y, target.x, target.y, movable, true);\n for (int i = 0; i < path.getLength(); i++) {\n Step step = path.getStep(i);\n Pair p = new Pair(step.getX(),step.getY());\n if (reachableCells.contains(p, false)) return p;\n }\n }\n return reachableCells.get(MathUtils.random(reachableCells.size-1));\n }",
"@Override\r\n\t// Precondition: During testing the AI is associated with the 'O', the odd number move.\r\n \tpublic Point desiredMove(TicTacToeGame theGame) {\n\t\t\r\n\t\tchar[][] board = theGame.getTicTacToeBoard();\r\n\t\tPoint dPoint;\r\n\t //check for win\r\n\t\tdPoint = winOrBlock(board,'O');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"winning\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//check for block\r\n\t\tdPoint = winOrBlock(board,'X');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"blocking\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//otherwise pick random loc\r\n\t\tRandom randy = new Random(); \r\n\t int randX = randy.nextInt(3);\r\n\t int randY = randy.nextInt(3);\r\n\t while(!theGame.available(randX, randY)) {\r\n\t \trandX = randy.nextInt(3);\r\n\t \trandY = randy.nextInt(3);\r\n\t }\r\n\t System.out.println(\"random\");\r\n\t return new Point(randX, randY);\r\n\t}",
"private static double bestMoveHelper(Board board, int pliesLeft) {\n\t\tif (TRANSPOSITION_TABLE.containsKey(board.getHashCode())) {\n\t\t\treturn TRANSPOSITION_TABLE.get(board.getHashCode());\n\t\t}\n\t\tif (pliesLeft == 1 || board.isOver()) {\n\t\t\treturn recordEvaluation(board, board.evaluate());\n\t\t}\n\t\tBinaryOperator<Double> optimumFinder = board.whoseMove().isWhite() ? Math::max : Math::min;\n\t\treturn recordEvaluation(board, board.getLegalMoves().stream()\n\t\t\t\t.map(bindAtEnd(BasicDepthBasedMinimax::bestMoveHelper, pliesLeft - 1).compose(board::performMove))\n\t\t\t\t.reduce(optimumFinder).get());\n\t}",
"public synchronized String computeMove() {\n if (game == null) {\n System.err.println(\"CODE ERROR: AI is not attached to a game.\");\n return \"0,0\";\n }\n\n char[] board = (char[]) game.getStateAsObject();\n\n //Choose a smart move if that AI is set to \"Smart\" or if the random value equals 2\n if (aiType == 1) {\n if(useHeat && ((int) (Math.random() * heat)) == 2){\n return \"\" + getRandomMove(board);\n }\n else{\n return \"\" + getSmartMove(board);\n }\n } else {\n return \"\" + getRandomMove(board);\n }\n }",
"public int getComMove() {\n\n int move;\n\n // Checks if a computer played a move in that spot\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = COM_PLAYER;\n\n if (winCheck() == 3) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // Check to block human player from winning\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = REAL_PLAYER;\n\n if (winCheck() == 2) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // If play spot is empty, then make move\n do {\n move = randMove.nextInt(getBoardSize());\n } while (playBoard[move] == REAL_PLAYER || playBoard[move] == COM_PLAYER);\n setMove(COM_PLAYER, move);\n\n return move;\n }",
"private int[] getBestMoveAndScoreDifference(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return new int[] {0,-1};\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return new int[] {minimum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n return new int[] {minimum,move};\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return new int[] {maximum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n return new int[] {maximum,move};\n }\n }",
"public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }",
"@Override\n\tpublic Move stateMachineSelectMove(long timeout)\n\t\t\tthrows TransitionDefinitionException, MoveDefinitionException, GoalDefinitionException {\n\t\tlong start = System.currentTimeMillis();\n\t\tList<Move> moves = getStateMachine().getLegalMoves(getCurrentState(), getRole());\n\t\tMove bestMove = moves.get(0);\n\t\tint bestScore = 0;\n\t\tfor (Move move: moves) {\n\t\t\tint result = getMinScore(getRole(), move, getCurrentState(), 0, 100);\n\t\t\tif (result > bestScore) {\n\t\t\t\tbestScore = result;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t}\n\n\t\tlong stop = System.currentTimeMillis();\n\t\tnotifyObservers(new GamerSelectedMoveEvent(moves, bestMove, stop - start));\n\t\treturn bestMove;\n\t}",
"private Move findBestMove(Piece player, Board board, int depth,\n double cutoff) {\n Board newBoard = new Board(board);\n Move bestSoFar = newBoard.iterator().next();\n Iterator<Move> moveIterator = board.iterator();\n if (newBoard.piecesContiguous(player)) {\n return bestSoFar;\n } else if (newBoard.piecesContiguous(player.opposite())) {\n return guessBestMove(player, newBoard, cutoff);\n } else if (depth == 0) {\n return guessBestMove(player, newBoard, cutoff);\n }\n while (moveIterator.hasNext()) {\n Move nextMove = moveIterator.next();\n newBoard.makeMove(nextMove);\n int boardValue = eval(newBoard);\n Move response = findBestMove(player.opposite(),\n newBoard, depth - 1, -boardValue);\n newBoard.makeMove(response);\n int responseVal = eval(newBoard);\n newBoard.retract();\n newBoard.retract();\n if (-responseVal > boardValue) {\n boardValue = -responseVal;\n bestSoFar = nextMove;\n if (boardValue >= cutoff) {\n break;\n }\n }\n }\n return bestSoFar;\n }",
"public PentagoMove chooseMove(PentagoBoardState boardState) {\n\n // You probably will make separate functions in MyTools.\n // For example, maybe you'll need to load some pre-processed best opening\n // strategies...\n Move myMove = boardState.getRandomMove();\n MyTools.simulateGame(boardState, (PentagoMove) myMove);\n MyTools.setPlayer(player_id);\n\n\n if(boardState.getTurnNumber()<3){\n myMove = MyTools.initialMove(boardState);\n }else{\n myMove = MyTools.myTurn(boardState);\n }\n PentagoMove winningMove = MyTools.gameWinnable(boardState);\n if(winningMove != null){\n System.out.println(\"Game Over!\");\n return winningMove;\n }\n int heuristic = MyTools.getHeuristic((PentagoMove)myMove, boardState);\n System.out.println(\"The heuristic is:\" + heuristic);\n PentagoMove m = (PentagoMove) myMove;\n // Return your move to be processed by the server.\n System.out.println(\"PLaying at: x=\"+ ((PentagoMove) myMove).getMoveCoord().getX()+ \", y=\" +((PentagoMove) myMove).getMoveCoord().getY());\n return ((PentagoMove) myMove);\n }",
"public static GameState getBestMove(Vector<GameState> states){\n int index = 0;\n double max = 0;\n double v = 0;\n\n // find state with max value and save its index\n for(int i = 0; i < states.size(); i++){\n v = minMaxPruning(states.get(i), depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);\n if(max < v){\n max = v;\n index = i;\n }\n }\n return states.get(index);\n }",
"private Move getBestMove(RaceTrack track, CellData[][] cells,\n\t\t\tPair<Integer, Integer> pos, Pair<Integer, Integer> speed, int depth) {\n\t\tCellData cellData = cells[pos.getLeft()][pos.getRight()];\n\n\t\tMap<Pair<Integer, Integer>, Character> availableMoves = new HashMap<>();\n\t\tint contX = pos.getLeft() + speed.getLeft();\n\t\tint contY = pos.getRight() + speed.getRight();\n\n\t\tPair<Integer, Integer> cont0 = Pair.of(contX, contY);\n\t\tif (cellData.getLegalMoves().contains(cont0)) {\n\t\t\tavailableMoves.put(cont0, '0');\n\t\t}\n\t\tPair<Integer, Integer> contL = Pair.of(contX - 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contL)) {\n\t\t\tavailableMoves.put(contL, 'L');\n\t\t}\n\t\tPair<Integer, Integer> contR = Pair.of(contX + 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contR)) {\n\t\t\tavailableMoves.put(contR, 'R');\n\t\t}\n\t\tPair<Integer, Integer> contU = Pair.of(contX, contY - 1);\n\t\tif (cellData.getLegalMoves().contains(contU)) {\n\t\t\tavailableMoves.put(contU, 'U');\n\t\t}\n\t\tPair<Integer, Integer> contD = Pair.of(contX, contY + 1);\n\t\tif (cellData.getLegalMoves().contains(contD)) {\n\t\t\tavailableMoves.put(contD, 'D');\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> moveMap = new HashMap<>();\n\n\t\tfor (Pair<Integer, Integer> move : availableMoves.keySet()) {\n\t\t\tint moveValue = getMoveValue(cells, pos.getLeft(), pos.getRight(),\n\t\t\t\t\tmove.getLeft(), move.getRight());\n\t\t\tmoveMap.put(move, moveValue);\n\t\t}\n\n\t\tList<Pair<Integer, Integer>> allMoves = new ArrayList<>(\n\t\t\t\tmoveMap.keySet());\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(moveMap.get(o2), moveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tPair<Integer, Integer> bestMove = allMoves.get(0);\n\n\t\tif ((depth == 0) || (moveMap.get(bestMove) > 0)) {\n\t\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\t\tavailableMoves.get(bestMove));\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> newMoveMap = new HashMap<>();\n\t\tfor (Pair<Integer, Integer> move : allMoves) {\n\t\t\tPair<Integer, Integer> newSpeed = Pair.of(\n\t\t\t\t\tmove.getLeft() - pos.getLeft(),\n\t\t\t\t\tmove.getRight() - pos.getRight());\n\t\t\tint moveValue = getBestMove(track, cells, move, newSpeed, depth - 1).value;\n\t\t\tnewMoveMap.put(move, moveValue);\n\t\t}\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(newMoveMap.get(o2), newMoveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tbestMove = allMoves.get(0);\n\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\tavailableMoves.get(bestMove));\n\t}",
"public Coordinate getNextMove() {\n\n if (targetMode && salvationMode == false) {\n\n Coordinate bestNextTarget;\n\n if (!fixedDirection) { // direction is not known\n\n int maxCount = 0;\n bestNextTarget = this.previousTarget;\n\n // find the best target around the last target //\n\n if (inBound(this.axis.y + 1, this.axis.x)) {\n maxCount = countGrid[this.axis.y + 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + 1);\n direction = 0; // north by default\n }\n\n if (inBound(this.axis.y - 1, this.axis.x)) {\n if (countGrid[this.axis.y - 1][this.axis.x] > maxCount) {\n maxCount = countGrid[this.axis.y - 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - 1);\n direction = 2;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x + 1)) { // try east\n if (countGrid[this.axis.y][this.axis.x + 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x + 1];\n bestNextTarget = new Coordinate(this.axis.x + 1, this.axis.y);\n direction = 1;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x - 1)) { // try west\n if (countGrid[this.axis.y][this.axis.x - 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x - 1];\n bestNextTarget = new Coordinate(this.axis.x - 1, this.axis.y);\n direction = 3;\n }\n }\n\n seekAgain = false;\n\n } else { // direction is known\n\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y);\n\n if (direction == 0) { // north\n if (inBound(this.axis.y + distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n } else { // else go south\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n direction = 2;\n }\n\n } else if (direction == 1) { // east\n if (inBound(this.axis.y, this.axis.x + distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n } else { // else go west\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n direction = 3;\n }\n\n } else if (direction == 2) { // south\n if (inBound(this.axis.y - distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n } else { // else go north\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n direction = 0;\n }\n\n } else if (direction == 3) { // west\n if (inBound(this.axis.y, this.axis.x - distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n } else { // else go east\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n direction = 1;\n }\n }\n }\n\n this.previousTarget = bestNextTarget;\n\n } else {\n this.previousTarget = getGlobalHighestCount();\n }\n\n toExclude.add(new Coordinate(this.previousTarget.y, this.previousTarget.x));\n\n this.countGrid[this.previousTarget.y][this.previousTarget.x] = 0;\n\n return this.previousTarget;\n }",
"private Coordinate firstMoveHeuristics(TicTacToeModel model, PossibleBoard possibleBoard) {\n BoardSpace[][] board = possibleBoard.board;\n\n if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION) {\n if (board[0][0].getIcon() == Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return new Coordinate(0, TicTacToeModel.BOARD_DIMENSION - 1);\n }\n } else if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION - 1) {\n if (model.cornerTaken()) {\n return new Coordinate(TicTacToeModel.BOARD_DIMENSION/2, TicTacToeModel.BOARD_DIMENSION/2);\n } else if (board[TicTacToeModel.BOARD_DIMENSION/2][TicTacToeModel.BOARD_DIMENSION/2].getIcon() != Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return model.getCornerNextToEdge();\n }\n }\n\n return null;\n }",
"public int getBestMove(ModelInterface field, List<IRatingMechanism> ratingMechanisms, Token owner) {\n tree = new Tree(field, ratingMechanisms, owner);\n // minimize or maximize each level\n for (int i = Tree.MAXDEPTH - 1; i > 0; i--) {\n //System.out.println(\"max/min level \" + i);\n List<Node> currLevel = tree.getLevel(i);\n if (!currLevel.isEmpty()) {\n \n if (currLevel.get(0).getCurrentOwner() == owner) {\n \n for (Node node : currLevel) {\n maximize(node);\n }\n \n } else {\n \n for (Node node : currLevel) {\n minimize(node);\n }\n }\n }\n }\n\n // debug\n for (int i = 0; i < tree.getLevel(1).size(); i++) {\n System.out.println(tree.getLevel(1).get(i).getMove().toString());\n }\n\n PossibleMove minMove = tree.getLevel(1).get(0).getMove();\n for (int i = 0; i < tree.getLevel(1).size(); i++) {\n if (tree.getLevel(1).get(i).getMove().getRating() < minMove.getRating()) {\n minMove = tree.getLevel(1).get(i).getMove();\n }\n }\n return minMove.getMove();\n }",
"public Move calculateMove(Location location) {\r\n\t\tDirection newDirection;\r\n\r\n\t\tArrayList<Location> neighbors = location.getNeighbors(location, map, 2);\r\n\t\t// remove neighbors that are mine or neutral\r\n\t\tneighbors = location.getEnemies(location, map, myID);\r\n\r\n\t\tif (location.getSite().strength == 0) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\t\tif ((location.getSite().strength < 5 || location.getSite().strength < 4 * location.getSite().production)\r\n\t\t\t\t&& location.getSite().isAllowed(location.getSite().production)) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\r\n\t\tif(neighbors.size() == 0) {\r\n\r\n\t\t\tif (isSafe(location)) {\r\n\t\t\t\tnewDirection = getClosestBoundary(location);\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tnewDirection = getBestNeighbor(location);\r\n\t\t\tif (newDirection != Direction.STILL) {\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\t\t\tnewDirection = chooseBestDirection(location);\r\n\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\treturn new Move(location, newDirection);\r\n\t\t}\r\n\t\tnewDirection = getClosestEnemy(location);\r\n\t\tLocation.planMove(location, newDirection);\r\n\t\treturn new Move(location, newDirection);\r\n\t}",
"private double getHeuristic(MapLocation current, MapLocation goal) {\n\t\treturn Math.max(Math.abs(current.x - goal.x), Math.abs(current.y - goal.y));\n\t}",
"public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }",
"public Move makeFirstMove(){\n bestWord = new ArrayList<>();\n getStartingWord( tray , bestWord, \"\", 0); //maxScore get's updated in here.\n if (maxScore == 0){ return null; }\n //right now the AI is dumb and always starts on the first tile.... this is only safe with boardSize/2 >= 7\n Move move =\n new Move(bestWord , Constants.BOARD_DIMENSIONS/2 ,\n Constants.BOARD_DIMENSIONS/2 - (bestWord.size() / 2) , true , maxScore , bot);\n //refillTray();\n return move;\n }",
"public void performMove() {\n\t\tfor (int x = 0; x <= size-1; x++)\n\t\t\tfor (int y = 0; y <= size-1; y++)\n\t\t\t\tlocalBoard[y][x] = 0;\n\t\t\n\t\t//reset the flag that indicates if a move has been found that decreases the heuristic\n\t\tfoundBetterMove = false;\n\t\t\n\t\t//fill in the appropriate heuristic values\n\t\tpopulateHillValues();\n\t\tArrayList<PotentialMove> myBestList = new ArrayList<PotentialMove>();\n\n\t\t//Find the square with the lowest heuristic value. this should really write the values to an array. \n\t\tint squareDifferential = -1;\n\t\t//String outValue = \"\";\n\t\tfor (int y = 0; y <= size-1; y++) {\n\t\t\tfor (int x = 0; x <= size-1; x++){\n\t\t\t\t//outValue = outValue + localBoard[y][x];\n\t\t\t\tif (squareDifferential < 0) //lowestSquareFound not found yet \n\t\t\t\t{\n\t\t\t\t\tif ((NQueens.queens[x] != y) && //set if the current square isn't already occupied by a queen\n\t\t\t\t\t\t\t(localBoard[NQueens.queens[x]][x] >= localBoard[y][x])) {\n\t\t\t\t\t\tif (localBoard[y][x] == localBoard[NQueens.queens[x]][x])\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) > squareDifferential) { // find the square with the largest differential in value from the queen in the column\n\t\t\t\t\tmyBestList.clear();\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t}\n\t\t\t\telse if (((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) == squareDifferential) && // the differential is equal to the current best differential\n\t\t\t\t\t\t(NQueens.queens[x] != y)) { // and isn't already occupied by a queen\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t}\n\t\t\t\t//else the square is higher, has a queen or isn't marginally better than the current queen's position in the row\n\t\t\t}\n\t\t\t//outValue = outValue + \"\\n\";\n\t\t}\n\t\t//JOptionPane.showMessageDialog(null, outValue);\n\t\t\n\t\tif (myBestList.isEmpty())\n\t\t\treturn;\n\t\t\n\t\tint listSize = myBestList.size();\n\t\tPotentialMove bestMove;\n\t\t\n\t\t//grab the non-Sideways moves first\n\t\tfor (int i = 0; i < listSize; i++) {\n\t\t\tif (!(myBestList.get(i).isSideways)) {\n\t\t\t\tbestMove = myBestList.get(i);\n\t\t\t\tfoundBetterMove = true;\n\t\t\t\tsidewaysMoves = 0;\n\t\t\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sidewaysMoves > MAXSIDEWAYSMOVES) { // hit MAXSIDEWAYSMOVES consecutive sideways moves, mark as unsolvable\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//all available moves sideways moves, let's select one randomly\n\t\tRandom generator = new Random();\n\t\tint randomElement = generator.nextInt(listSize);\n\t\t\n\t\tbestMove = myBestList.get(randomElement);\n\t\tfoundBetterMove = true;\n\t\tsidewaysMoves++;\n\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t}",
"public static PentagoMove excecuteMiniMax(PentagoBoardState bs, int depth) {\n\t\tlong timerStart = System.currentTimeMillis();\n\t\tPentagoMove bestMove = null;\n\t\tint highestVal = Integer.MIN_VALUE;\n\t\tint lowestVal = Integer.MAX_VALUE;\n\t\tint currentVal = 0;\n\t\tint possibleMoves = bs.getAllLegalMoves().size();\n\t\tfor (PentagoMove move : bs.getAllLegalMoves()) {\n\t\t\tPentagoBoardState stateClone = (PentagoBoardState) bs.clone();\n\t\t\tstateClone.processMove(move);\n\t\t\tif(bs.getTurnPlayer() == 0) {\n\t\t\t\tMax(stateClone, depth-1);\n\t\t\t}\n\t\t\telse if(bs.getTurnPlayer() == 1) {\n\t\t\t\tMin(stateClone, depth-1);\n\t\t\t}\n\t\t\tif (bs.getTurnPlayer() == 0 && currentVal >= highestVal) {\n\t\t\t\thighestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\telse if (bs.getTurnPlayer() == 1 && currentVal <= lowestVal) {\n\t\t\t\tlowestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\tif (System.currentTimeMillis() - timerStart >= 1900) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlong totalTime = System.currentTimeMillis() - timerStart;\n\t\tSystem.out.println(totalTime);\n\t\treturn bestMove;\n\t}",
"public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }",
"private Pair<Double, Move> minimax(OthelloBoard board, OthelloSide side, int depth, int max_depth, \n\t\t\t\t\t\t\t\tMove m, double alpha, double beta) {\n\t\tdouble bestScore;\n\t\tint turncount = turn;\n\t\tMove bestMove;\n\t\t//System.out.println(\"Start of minimax. Depth: \" + depth + \" Side: \" + side);\n\t /* int state = board.getState();\n\t\tif (state == OthelloBoard.DRAW)\n\t return new Pair<Double, Move>(0, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.BLACK)) \n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m); \n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);\n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.BLACK))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);*/\n\t\tif(board.isDone()) {\n\t\t\tdouble endgame = board.countBlack() - board.countWhite();\n\t\t\treturn new Pair<Double, Move>(endgame, m);\n\t\t}\n\t\tif(depth == max_depth) {\n\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\treturn new Pair<Double, Move>(mdScore, m);\t\t\t\n\t\t} else {\n\t\t\tLinkedList<Move> moveList = getMoveList(board, side);\n\t\t\tif(depth == 0) {\n\t \t\t\tLinkedList<Move> corners = new LinkedList<Move>();\n\t\t\t\tfor(Move mv : moveList) {\n\t\t\t\t\tif(board.isCorner(mv)) {\n\t\t\t\t\t\tcorners.add(mv);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(corners.size() != 0) {\n\t\t\t\t\tMove bcorner = null;\n\t\t\t\t\tdouble best = -Double.MAX_VALUE;\n\t\t\t\t\tfor(Move ml : corners) {\n\t\t\t\t\t\tdouble temp = evalMove(board, side, ml);\n\t\t\t\t\t\tif(temp > best) {\n\t\t\t\t\t\t\tbest = temp;\n\t\t\t\t\t\t\tbcorner = ml;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn new Pair<Double, Move>(best, bcorner);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(moveList.toString());\n\t\t\tbestScore = -Double.MAX_VALUE;\n\t\t\tbestMove = new Move(1,1);\n\t\t\tif(moveList.size() == 0) {\n\t\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\t\treturn new Pair<Double, Move>(mdScore, m);\n\t\t\t} else {\n\t\t\t\tfor(int i = 0; i < moveList.size(); i++) {\n\t\t\t\t\tOthelloBoard tempBoard = board.copy();\n\t\t\t\t\tMove move = moveList.get(i);\n\t\t\t\t\ttempBoard.move(move, side);\n\t\t\t\t\talpha = -(minimax(tempBoard, side.opposite(), depth + 1, max_depth, move, -beta, -alpha)).score;\n\t\t\t\t\t//System.out.println(\"Side: \" + side);\n\t\t\t\t\t//System.out.println(\"alpha (before IF): \" + alpha);\n\t\t\t\t\t//System.out.println(\"bestScore (before IF): \" + bestScore);\n\t\t\t\t\tif(beta <= alpha) {\n\t\t\t\t\t\treturn new Pair<Double, Move>(alpha, move);\n\t\t\t\t\t}\n\t\t\t\t\tif(alpha > bestScore ) {\n\t\t\t\t\t\tbestScore = alpha;\n\t\t\t\t\t\tbestMove = move;\n\t\t\t\t\t\t//bestMove.copy(move);\n\t\t\t\t\t\t//System.out.println(\"theScore(IF): \" + alpha);\n\t\t\t\t\t\t//System.out.println(\"bestScore(IF): \" + bestScore);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new Pair<Double, Move>(bestScore, bestMove);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic Direction getMove() {\n\t\t//Equal probability for each of the 8 compass direction, as well as staying stationary\n\t\treturn choices[this.random.nextInt(9)];\n\t}",
"private Outcome minMax(PossibleBoard posBoard, Icon icon, int depth) {\n Outcome outcome = new Outcome();\n Result result = posBoard.determineOutcome();\n boolean maximiseWin = icon == getIcon();\n\n // BASE CASE\n if (result.gameComplete()) {\n outcome.score = result.getBonus();\n outcome.moveToMake = posBoard.coor;\n outcome.depth = depth;\n return outcome;\n }\n\n ArrayList<PossibleBoard> posNextBoards = getPossibleNextBoards(posBoard, icon);\n int optimalScore = (maximiseWin ? Integer.MIN_VALUE : Integer.MAX_VALUE);\n Coordinate optimalCoor = new Coordinate(0,0);\n int optimalDepth = Integer.MAX_VALUE;\n\n for (PossibleBoard posNextBoard : posNextBoards) {\n Outcome nextOutcome = minMax(posNextBoard, (icon == Icon.CROSSES ? Icon.NOUGHTS : Icon.CROSSES), depth + 1);\n\n if (maximiseWin && nextOutcome.score >= optimalScore) {\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n } else if (!maximiseWin && nextOutcome.score <= optimalScore){\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n }\n }\n\n outcome.moveToMake = optimalCoor;\n outcome.score = optimalScore;\n outcome.depth = optimalDepth;\n return outcome;\n }",
"public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }",
"protected Object[] getBestMove(Solution soln, Move[] moves, ObjectiveFunction objectiveFunction, TabuList tabuList, AspirationCriteria aspirationCriteria, boolean maximizing, boolean chooseFirstImprovingMove)\n/* */ {\n/* 260 */ int threads = getThreads();\n/* 261 */ if (threads == 1)\n/* */ {\n/* 263 */ return SingleThreadedTabuSearch.getBestMove(soln, moves, objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 271 */ Move bestMove = null;\n/* 272 */ double[] bestMoveVal = null;\n/* 273 */ boolean bestMoveTabu = false;\n/* 274 */ NeighborhoodHelper[] helpers = getHelpers();\n/* */ \n/* */ \n/* 277 */ int numGroups = helpers.length;\n/* 278 */ int nominalSize = moves.length / numGroups;\n/* 279 */ Move[][] moveGroups = new Move[numGroups][];\n/* */ \n/* */ \n/* 282 */ for (int i = 0; i < numGroups - 1; i++)\n/* */ {\n/* 284 */ moveGroups[i] = new Move[nominalSize];\n/* 285 */ System.arraycopy(moves, i * nominalSize, moveGroups[i], 0, nominalSize);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 291 */ moveGroups[(numGroups - 1)] = new Move[nominalSize + moves.length % numGroups];\n/* 292 */ System.arraycopy(moves, (numGroups - 1) * nominalSize, moveGroups[(numGroups - 1)], 0, moveGroups[(numGroups - 1)].length);\n/* */ \n/* */ \n/* */ \n/* 296 */ for (int i = 0; i < numGroups; i++) {\n/* 297 */ helpers[i].setWork(soln, moveGroups[i], objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 304 */ Object[][] bestMoves = new Object[numGroups][];\n/* 305 */ for (int i = 0; i < numGroups; i++)\n/* */ {\n/* */ \n/* 308 */ Object[] contender = helpers[i].getBestMove();\n/* */ \n/* */ \n/* 311 */ Move newMove = (Move)contender[0];\n/* 312 */ double[] newObjVal = (double[])contender[1];\n/* 313 */ boolean newMoveTabu = ((Boolean)contender[2]).booleanValue();\n/* */ \n/* */ \n/* */ \n/* 317 */ if (bestMove == null)\n/* */ {\n/* 319 */ bestMove = newMove;\n/* 320 */ bestMoveVal = newObjVal;\n/* 321 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 327 */ else if (SingleThreadedTabuSearch.isFirstBetterThanSecond(newObjVal, bestMoveVal, maximizing))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 335 */ if ((bestMoveTabu) || (!newMoveTabu)) {\n/* 336 */ bestMove = newMove;\n/* 337 */ bestMoveVal = newObjVal;\n/* 338 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* 344 */ else if ((bestMoveTabu) && (newMoveTabu)) {\n/* 345 */ bestMove = newMove;\n/* 346 */ bestMoveVal = newObjVal;\n/* 347 */ bestMoveTabu = newMoveTabu;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 355 */ return new Object[] { bestMove, bestMoveVal, new Boolean(bestMoveTabu) };\n/* */ }",
"@Override\n\tpublic Direction getMove() {\n if (ticks < MAX_TICKS_PER_ROUND - 100) {\n Direction[] dirs = Direction.values();\n return dirs[random.nextInt(dirs.length)];\n } else {\n // Move towards boat\n int deltaX = 0;\n int deltaY = 0;\n if (currentLocation.getX() < 0)\n deltaX = 1;\n else if (currentLocation.getX() > 0)\n deltaX = -1;\n\n if (currentLocation.getY() < 0)\n deltaY = 1;\n else if (currentLocation.getY() > 0)\n deltaY = -1;\n\n if (deltaX > 0 && deltaY == 0) {\n return Direction.E;\n } else if (deltaX > 0 && deltaY > 0) {\n return Direction.NE;\n } else if (deltaX > 0 && deltaY < 0) {\n return Direction.SE;\n } else if (deltaX == 0 && deltaY == 0) {\n return Direction.STAYPUT;\n } else if (deltaX == 0 && deltaY < 0) {\n return Direction.N;\n } else if (deltaX == 0 && deltaY > 0) {\n return Direction.S;\n } else if (deltaX < 0 && deltaY == 0) {\n return Direction.W;\n } else if (deltaX < 0 && deltaY > 0) {\n return Direction.NW;\n } else if (deltaX < 0 && deltaY < 0) {\n return Direction.NE;\n } else {\n throw new RuntimeException(\"I HAVE NO IDEA\");\n }\n }\n\t}",
"int chooseMove();",
"@Override\r\n\tpublic int move(int lastMove, int[] takenList, int depthLimit) \r\n\t{\r\n\t\tGameState myState = new GameState(takenList, lastMove);\r\n\t\tdouble maxValue = max_value(myState, depthLimit);\r\n\t\tint myBestMove = myState.bestMove;\r\n\t\tif (myState.leaf) //why did i do this\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn myBestMove;\r\n\t}",
"@Override\n public AlgorithmResult chooseBestMove(MinMaxEnum currentMinMax, List<AlgorithmResult> algorithmResults) {\n AlgorithmResult bestResult;\n if (currentMinMax == MinMaxEnum.MAX)\n bestResult = Collections.max(algorithmResults, Comparator.comparing(AlgorithmResult::getScore));\n else bestResult = Collections.min(algorithmResults, Comparator.comparing(AlgorithmResult::getScore));\n\n return bestResult;\n }",
"public static Pair<Integer, PentagoMove> miniMaxAlgo(PentagoBoardState boardState, int depth, int playerTurn) {\n\t\t\n\t\tArrayList<PentagoMove> possibleMoves = boardState.getAllLegalMoves();\n\t\tint score = 0;\n\t\t\n\t\t//assign a high or low value to begin with, no move can have that high/low a value\n\t\tif (playerTurn == 1) {\n\t\t\tscore = Integer.MIN_VALUE;\n\t\t}\n\t\telse {\n\t\t\tscore = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint currentScore;\n\t\tPentagoMove chosenMove = null;\n\t\t\n\t\t//when all moves have been propagated up to the depth desired, find the most valuated move\n\t\tif (possibleMoves.size() == 0 || depth == 0) {\n\t\t\tscore = heuristic(boardState);\n\t\t}\n\t\telse {\n\t\t\t//iterating through all possible moves\n\t\t\tfor(int i = 0; i < possibleMoves.size(); i++) {\n\t\t\t\t\n\t\t\t\t//cloning board to predict 2 moves ahead (depth is 2)\n\t\t\t\tPentagoBoardState clone = (PentagoBoardState) boardState.clone();\n\t\t\t\tclone.processMove(possibleMoves.get(i));\n\t\t\t\tint player = 1 - playerTurn;\n\t\t\t\t\n\t\t\t\t//0 = white, trying to maximize\n\t\t\t\tif (player == 0) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is higher, make it the new current score, then use minimize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore >= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t//1 = black, trying to minimize\n\t\t\t\telse if (player == 1) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is lower, make it the new current score, then use maximize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore <= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//decided to go with pair to avoid having separated methods for the score and the move\n\t\t//it is easy to extract the required value using .getKey() or .getValue()\n\t\tPair<Integer, PentagoMove> answer = new Pair<>(score, chosenMove);\n\t\treturn answer;\n\t}",
"public Move chooseMove(PentagoBoardState boardState) {\r\n try {\r\n if (heuristicOnly) {\r\n System.out.println(\"chose from heuristic\");\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n if (mcts == null) {\r\n mcts = new MonteCarloUCT();\r\n }\r\n return mcts.nextMove(new LowMemoryBoardState(boardState));\r\n } catch (OutOfMemoryError e) {\r\n /*\r\n if the memory limit is exceeded, we *attempt* to free memory\r\n by nullifying our mcts and asking the JVM to garbage collect.\r\n Since this is a serious error, we switch the instance to use\r\n a heuristic exclusively, to prevent going over the memory limit\r\n again.\r\n */\r\n mcts = null;\r\n System.gc();\r\n this.heuristicOnly = true;\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n }",
"public int moves() {\r\n if (!isSolvable) return -1;\r\n return goal.previousMoves;\r\n }",
"public Move chooseMove(PentagoBoardState boardState) {\n // You probably will make separate functions in MyTools.\n // For example, maybe you'll need to load some pre-processed best opening\n // strategies...\n \t\n PentagoBoardState cloneBoard = (PentagoBoardState) boardState.clone();\n \n \n Move myMove = null;\n int myPlayer = boardState.getTurnPlayer();\n if(boardState.getTurnNumber() == 0 || boardState.getTurnNumber() == 1) {\n \t//For the first two rounds.\n \t//Place at the center of each quadrant.\n \tif(boardState.getPieceAt(1, 1) == null) {//TL center is null.\n \t\tmyMove = new PentagoMove(1,1,Quadrant.TR,Quadrant.BL,myPlayer);\n \t}else if(boardState.getPieceAt(4, 1) == null) {//TR center is null.\n \t\tmyMove = new PentagoMove(4,1,Quadrant.TL,Quadrant.TR,myPlayer);\n \t}else if(boardState.getPieceAt(1, 4) == null) {//BL center is null\n \t\tmyMove = new PentagoMove(1,4,Quadrant.TL,Quadrant.BL,myPlayer);\n \t}else {myMove = new PentagoMove(4,4,Quadrant.TL,Quadrant.BR,myPlayer);}\n }\n \n else {//Do a-b pruning.\n myMove = MyTools.max_value(cloneBoard, Integer.MIN_VALUE, Integer.MAX_VALUE, 3).getMove();\n }\n \n // Return your move to be processed by the server.\n return myMove;\n }",
"public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }",
"public Move makeSubsequentMove(){\n Move move = null;\n maxScore = 0;\n bestWord = new ArrayList<Tile>();\n for (Anchor anchor : findAnchors()){\n ArrayList<Tile> inputTiles = new ArrayList<Tile>(tray);\n inputTiles.add(anchor.anchorTile);\n findHighestScoringWord(inputTiles, new ArrayList<Tile>(), \"\", 0, anchor);\n }\n if (bestWord == null || bestWord.size() == 0){\n //should i have some kind of get new tray of tiles thing?\n return move;\n } else {\n int startCol;\n int startRow;\n if (currentAnchor.isAcross()){\n startCol = currentAnchor.col - getAnchorPosition(currentAnchor, bestWord);\n startRow = currentAnchor.row;\n } else {\n startCol = currentAnchor.col;\n startRow = currentAnchor.row - getAnchorPosition(currentAnchor, bestWord);\n }\n\n move = new Move(bestWord , startRow , startCol ,currentAnchor.isAcross(), maxScore , bot);\n //move.execute(Board?);\n }\n return move;\n }",
"private synchronized Object[] getBestMove()\n/* */ {\n/* 580 */ while (this.workToDo)\n/* 581 */ synchronized (this) {\n/* 582 */ try { wait();\n/* */ } catch (InterruptedException e) {\n/* 584 */ e.printStackTrace(SingleThreadedTabuSearch.err); } } return this.bestMove;\n/* */ }",
"public MahjongSolitaireMove findMove()\n {\n // MAKE A MOVE TO FILL IN \n MahjongSolitaireMove move = new MahjongSolitaireMove();\n\n // GO THROUGH THE ENTIRE GRID TO FIND A MATCH BETWEEN AVAILABLE TILES\n for (int i = 0; i < gridColumns; i++)\n {\n for (int j = 0; j < gridRows; j++)\n {\n ArrayList<MahjongSolitaireTile> stack1 = tileGrid[i][j];\n if (stack1.size() > 0)\n {\n // GET THE FIRST TILE\n MahjongSolitaireTile testTile1 = stack1.get(stack1.size()-1);\n for (int k = 0; k < gridColumns; k++)\n {\n for (int l = 0; l < gridRows; l++)\n {\n if (!((i == k) && (j == l)))\n { \n ArrayList<MahjongSolitaireTile> stack2 = tileGrid[k][l];\n if (stack2.size() > 0) \n {\n // AND TEST IT AGAINST THE SECOND TILE\n MahjongSolitaireTile testTile2 = stack2.get(stack2.size()-1);\n \n // DO THEY MATCH\n if (testTile1.match(testTile2))\n {\n // YES, FILL IN THE MOVE AND RETURN IT\n move.col1 = i;\n move.row1 = j;\n move.col2 = k;\n move.row2 = l;\n return move;\n }\n }\n }\n }\n }\n }\n }\n }\n // WE'VE SEARCHED THE ENTIRE GRID AND THERE\n // ARE NO POSSIBLE MOVES REMAINING\n return null;\n }",
"public int getIntelligentMove(int[] availableMoves, int[] board){\n for (int move : availableMoves){\n int[] tempBoard = board.clone();\n tempBoard[move] = 1;\n int result = checkWinner(tempBoard);\n if (result == 1){\n return move;\n }\n \n }\n \n // Check if user can win, if so then block\n \n for (int move : availableMoves){\n int[] tempBoard = board.clone();\n tempBoard[move] = -1;\n int result = checkWinner(tempBoard);\n if (result == 2){\n return move;\n }\n \n }\n \n // If middle is available, take it\n for (int move: availableMoves){\n if (move == 4){\n return move;\n }\n }\n \n // Move into a corner in a row/col that the user is in\n int cornerMove = checkCorners(board, availableMoves);\n if (cornerMove >= 0){\n \n }\n \n // Otherwise, take random move\n Random rand = new Random();\n int possibleMoves = availableMoves.length;\n int moveIndex = rand.nextInt(possibleMoves);\n \n return availableMoves[moveIndex];\n \n \n }",
"private MNKCell findOneMoveWin(final MNKGameState winState) {\n for (MNKCell c : board.getFreeCells()) {\n MNKGameState result = board.markCell(c.i, c.j);\n board.unmarkCell();\n if (result == winState) return c;\n }\n return null;\n }",
"public void executeMove(Game game) {\n int bestScore = 0;\n int comScore = 0;\n Board board = game.getBoard();\n int col = (board.getCols());\n int row = (board.getRows());\n \n // Basic for loop to go through and grab each gem and call the score policy on it\n // it stores the best opton in best score\n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n comScore = game.getPolicy().scoreMove(i,ii,board);\n if(comScore >= bestScore){\n bestScore = comScore;\n }\n }\n }\n \n // This for loop makes a Coord with the rows and col i and ii to keep track of where the best gem was located \n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n if(game.getPolicy().scoreMove(i,ii,board) == bestScore){\n holder.add(new Coord(i,ii));\n }\n }\n }\n \n // For loop to choose the best Gem out of the holders Coords to call \"removeGemAdjustScore()\"\n for(int i = 0; i < holder.size(); i++){\n if(holder.size() == 1){\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n \n // Resets the holder and best score for the next move\n holder = new ArrayList<Coord>();\n bestScore = 0;\n \n }",
"Execution getClosestDistance();",
"private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}",
"private int getBestMoveForBlack(int moveToLookForwardFor) {\n String boardString = this.toString();\n String desiredBoard =\n alphabeta(\n boardString,\n moveToLookForwardFor * 2,\n Integer.MIN_VALUE,\n Integer.MAX_VALUE,\n true)\n .getValue();\n\n for (int i = 0; i < 9; i++) {\n Board newBoard = new Board(boardString);\n newBoard.makeAMove(i);\n\n if (newBoard.toString().equals(desiredBoard)) return i;\n }\n\n return -1;\n }",
"public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }",
"private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }",
"public int minimax(Tile[][] board, int depth, boolean isMaximizing) {\n int result = WinnerChecker.checkWinner();\r\n if(result != 2) {\r\n return result;\r\n }\r\n\r\n int bestScore = 0;\r\n if(isMaximizing){\r\n bestScore = 1;\r\n for(int i = 0; i< 3; i++){\r\n for(int j = 0; j< 3; j++){\r\n // Is the spot available?\r\n if(board[i][j].text.getText().isEmpty()){\r\n board[i][j].text.setText(\"O\");\r\n TicTacToeApp.previous_move = board[i][j];\r\n int score = minimax(board, depth+1,false);\r\n board[i][j].text.setText(\"\");\r\n bestScore = Math.min(score, bestScore);\r\n }\r\n }\r\n }\r\n }else{\r\n bestScore = -1;\r\n for(int i = 0; i< 3; i++){\r\n for(int j = 0; j< 3; j++){\r\n // Is the spot available?\r\n if(board[i][j].text.getText().isEmpty()){\r\n board[i][j].text.setText(\"X\");\r\n TicTacToeApp.previous_move = board[i][j];\r\n int score = minimax(board, depth+1,true);\r\n board[i][j].text.setText(\"\");\r\n bestScore = Math.max(score, bestScore);\r\n }\r\n }\r\n }\r\n }\r\n return bestScore;\r\n }",
"private String hardMove() {\n return super.makeAMove(getBestMoveForBlack(FORESEEN_MOVES * 2));\n }",
"public Move get1stMove(Game game, CheckersSetup setup, checkersSetup.Board board, ArrayList<Move> choices) {\n\t\tviewedPos = null;\n\t\t//TESTING\n\t\tnumPosRecorded = 0;\n\t\t//END TESTING\n\t\t\n\t\tnumJumpsAlreadyDoneThisTurn = 0;\n\t\t\n\t\tBasicCheckersAIFunctions.printAllAIPlayerOptions(setup, isDarkPlayer);\n\t\t\n\t\tdesiredTurn = getBestMoveBasedOnSearchOfDepthN(setup, isDarkPlayer, this.depth);\n\t\t\n\t\tArrayList<Move> desiredMoves= desiredTurn.getMovesFor1Turn();\n\t\t\n\t\t BasicCheckersAIFunctions.PrintDesiredMoves(desiredMoves);\n\t\t\n\t\tif(desiredMoves.get(0).isJump()) {\n\t\t\tnumJumpsAlreadyDoneThisTurn++;\n\t\t}\n\t\t\n\t\t//TESTING (Display)\n\t\tSystem.out.println(\"Number of positions analysed for AI with Tree: \" + numPosRecorded);\n\t\tif(viewedPos!=null) {\n\t\t\tSystem.out.println(\"Height of tree: \" + viewedPos.getHeightOfTree());\n\t\t}\n\t\tSystem.out.println();\n\t\t//END TESTING\n\t\t\n\t\treturn desiredMoves.get(0);\n\t}",
"public Direction nextMove(Game gameState) {\n\n // Create a copy of this game state and walk in the first direction\n Game curr = new Game(gameState);\n curr.step(directions[0]);\n\n // Set the current minimum found cost and index to this first direction's cost\n int minCost = getCost(curr);\n int minIndex = 0;\n\n // Loop through the other directions\n for (int i = 1, max = directions.length; i < max; i++) {\n\n // Create a copy of this game state and walk in a new direction\n curr = new Game(gameState);\n curr.step(directions[i]);\n int thisCost = getCost(curr);\n\n // Check if this new cost is lower than previous ones and if so, update minCost and minIndex accordingly\n if (thisCost < minCost) {\n minCost = thisCost;\n minIndex = i;\n }\n }\n\n // Return the direction corresponding to this minimum cost\n return directions[minIndex];\n }",
"public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"private static int getHeuristic(MazeState current, HashSet<MazeState> goals) {\n\t\tint lowestCost = Integer.MAX_VALUE;\n\t\tint currentCost = 0;\n\t\tfor (MazeState goal : goals) {\n\t\t\tcurrentCost = Math.abs(current.col - goal.col) + Math.abs(current.row - goal.row);\n\t\t\tif (currentCost <= lowestCost) {\n\t\t\t\tlowestCost = currentCost;\n\t\t\t}\n\t\t}\n\t\treturn currentCost;\n\t}",
"public Guess getMove(int moveID) {\n\t\treturn guessList[moveID];\n\t}",
"public int getWhoseMove() {\n\t\treturn playerToMove;\n\t}",
"protected Movable findFarthestEnemy(ArrayList<Movable> moving){\n\t\tdouble farthest = Integer.MIN_VALUE;\n\t\tint idxOfMob = -1;\n\t\t// Search for the farthest enemy within the range\n\t\tfor(int i = 0; i < moving.size(); i++){\n\t\t\tif(moving.get(i) instanceof Mob){\n\t\t\t\tMob mob = (Mob)moving.get(i);\n\t\t\t\tdouble tempEnemyPosX = mob.getX();\n\t\t\t\tdouble tempEnemyPosY = mob.getY();\n\t\t\t\tdouble tempFarthest = MainMethods.distance(x\n\t\t\t\t\t\t+ img.getWidth(null) / 2, y + img.getHeight(null) / 2,\n\t\t\t\t\t\ttempEnemyPosX, tempEnemyPosY);\n\t\t\t\tif(tempFarthest <= range && tempFarthest >= farthest){\n\t\t\t\t\tfarthest = tempFarthest;\n\t\t\t\t\tidxOfMob = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(idxOfMob == -1){\n\t\t\treturn null;\n\t\t}\n\t\treturn moving.get(idxOfMob);\n\t}",
"protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }",
"private int minimax(TicTacToeBoard board, Cell thisTeam) throws TicTacToeException {\n\t\tint maxScore = -1;\n\t\tint multiplyer = 1;\n\t\tif(thisTeam != team) {\n\t\t\tmultiplyer = -1;\n\t\t}\n\t\tTicTacToeWinner winner = board.winner();\n\t\tif(winner != null) {\n\t\t\treturn evaluateWinner(winner.getCell());\n\t\t}\n\t\t\n\t\tList<Location> possibleMoves = board.emptySlots();\n\t\tint thisScore;\n\t\tTicTacToeBoard currentBoard;\n\t\t\n\t\tfor(Location l: possibleMoves) {\n\t\t\tcurrentBoard = board.copy();\n\t\t\tcurrentBoard.makeMove(thisTeam, l);\n\t\t\tthisScore = multiplyer*minimax(currentBoard, TicTacToeBoard.oppositePlayer(thisTeam));\n\t\t\tif(thisScore >= maxScore) {\n\t\t\t\tmaxScore = thisScore;\n\t\t\t}\n\t\t}\n\t\treturn multiplyer*maxScore;\n\t}",
"Execution getFarthestDistance();",
"public Attack getBestOpponentAttack()\n\t{\n\t\treturn bestOpponentAttack;\n\t}",
"@Override\n\tpublic BoardLocation findBestLocWhenStuck() {\n\t\treturn null;\n\t}",
"public Action getBestAction() {\n long startTime = System.currentTimeMillis();\n\n // Continue iterating through the search algorithm until the time limit\n // is reached\n while (System.currentTimeMillis() < startTime + timeLimit) {\n Node newNode = selectAndExpandNewNode();\n double randomPlayout = simulateRandomPlayout(newNode);\n backPropagate(newNode, randomPlayout);\n }\n\n // Technically this function will take us slightly over timeLimit, but\n // that's why a buffer is removed from timeLimit when passed to this\n // class\n return bestActionFromFinishedTree();\n }",
"private Game findBestUpcomingGame(List<Game> games,\n Map<String, Integer> previous, int time) {\n Game bestGame = null;\n int bestScore = -1;\n for (Game game : games) {\n if (game.isFinal()) continue;\n Team team1 = game.getTeam1();\n Team team2 = game.getTeam2();\n int minLagViolation = 0;\n int maxLagViolation = 0;\n int earliestStartViolation = 0;\n int latestStartViolation = 0;\n int score;\n Object previousTimeTeam1 = previous.get(team1.getName());\n Object previousTimeTeam2 = previous.get(team2.getName());\n \n earliestStartViolation += calculateEarliestStartViolation(game, time);\n latestStartViolation += calculateLatestStartViolation(game, time);\n if (previousTimeTeam1 != null) {\n minLagViolation += calculateMinLagViolation(team1, time, (int) previousTimeTeam1);\n maxLagViolation += calculateMaxLagViolation(team1, time, (int) previousTimeTeam1);\n }\n if (previousTimeTeam2 != null) {\n minLagViolation += calculateMinLagViolation(team2, time, (int) previousTimeTeam2);\n maxLagViolation += calculateMaxLagViolation(team2, time, (int) previousTimeTeam2);\n }\n\n score = MAX_LAG_WEIGHT * maxLagViolation \n + MIN_LAG_WEIGHT * minLagViolation \n + EARLIEST_START_WEIGHT * earliestStartViolation \n + LATEST_START_WEIGHT * latestStartViolation;\n if (bestScore < 0 || score < bestScore) {\n bestScore = score;\n bestGame = game;\n }\n }\n // no improvement found, use first game\n if (bestGame == null) {\n bestGame = games.get(0);\n }\n \n return bestGame;\n }",
"public int getMoves(int choose)\r\n {\r\n int uWinMov=0, uFavMov=0, cWinMov=0;\r\n \r\n switch (choose)\r\n {case 1: //AI uses code number \"1\" to get User's winning moves\r\n if ((uRockW>uPapW)&&(uRockW>uSciW))\r\n {uWinMov=3;}\r\n else if ((uPapW>uRockW)&&(uPapW>uSciW))\r\n {uWinMov=2;}\r\n else\r\n {uWinMov=1;}\r\n return uWinMov;\r\n \r\n case 2: //AI uses code number \"2\" to get User's most used move\r\n if ((uRock>uPap)&&(uRock>uSci))\r\n {uFavMov=3;}\r\n else if ((uPap>uRock)&&(uPap>uSci))\r\n {uFavMov=2;}\r\n else\r\n {uFavMov=1;}\r\n return uWinMov;\r\n \r\n case 3: //AI uses code number \"3\" to get its own winning moves\r\n if ((cRockW>cPapW)&&(cRockW>cSciW))\r\n {cWinMov=3;}\r\n else if ((cPapW>cRockW)&&(cPapW>cSciW))\r\n {cWinMov=2;}\r\n else\r\n {cWinMov=1;}\r\n return cWinMov;\r\n \r\n default: //Error message for erronous input by AI\r\n {JOptionPane.showMessageDialog(null, \r\n \"Error: unknown chooser value - WinCalc.getMoves 272\", \r\n \"digiRPS - ERROR\", \r\n JOptionPane.ERROR_MESSAGE);\r\n break;\r\n }\r\n }\r\n \r\n return uWinMov;\r\n }",
"public int moves() {\n if (!isSolvable()) {\n return -1;\n } else {\n return minNode.getMove();\n }\n\n }",
"protected int getMove() \t\t\t\t{\treturn move;\t\t}",
"public Move findOptimalMove(String board[][], int computerMoves, boolean isPruning) {\n\t\tint bestVal = -Integer.MAX_VALUE;\n\n\t\tint moveI = -9;\n\t\tint moveJ = -9;\n\n\t\tint step = 0;\n\t\tint alpha = -Integer.MAX_VALUE;\n\t\tint beta = Integer.MAX_VALUE;\n\n\t\tboard = buildSmallBoard(board);\n\n\t\tfor (int i = startI; i < endI; i++) {\n\n\t\t\tfor (int j = startJ; j < endJ; j++) {\n\n\t\t\t\tif (!hasAdjacent(i, j, board, computerMoves))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (board[i][j].equals(\"-\")) {\n\n\t\t\t\t\tboard[i][j] = \"X\";\n\n\t\t\t\t\tint moveVal = isPruning ? minimaxAB(board, false, step, alpha, beta, computerMoves)\n\t\t\t\t\t\t\t: minimax(board, false, step, computerMoves);\n\n\t\t\t\t\tboard[i][j] = \"-\";\n\t\t\n\t\t\t\t\tif (moveVal > bestVal) {\n\t\t\t\t\t\tmoveI = i;\n\t\t\t\t\t\tmoveJ = j;\n\t\t\t\t\t\tbestVal = moveVal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new Move(moveI, moveJ);\n\t}",
"public MoveNode getMinimaxMove() {\n return minimaxMove;\n }",
"private MNKCell findOneMoveLoss(final MNKGameState lossState) {\n MNKCell randomCell = null;\n if (board.getFreeCells().length == 1 || (randomCell = pickRandomNonClosingCell(null)) == null)\n return null; // cannot check for enemy's next move when it doesn't exist\n\n board.markCell(randomCell.i, randomCell.j);\n MNKCell c = findOneMoveWin(lossState);\n board.unmarkCell(); // remove the marked randomCell\n if (c != null) return c;\n\n // test the randomCell we selected at first. It may be a one-move loss cell\n // get a new random cell different from the previous and call it cc\n MNKCell cc = pickRandomNonClosingCell(randomCell);\n if (board.markCell(cc.i, cc.j) != MNKGameState.OPEN) {\n // randomCell puts us in a draw, ignore that\n board.unmarkCell();\n return null;\n }\n MNKGameState result =\n board.markCell(randomCell.i, randomCell.j); // let the enemy take the random ane\n board.unmarkCell();\n board.unmarkCell();\n return result == lossState ? randomCell : null;\n }",
"private MoveEvaluation minimax (int ply, IComparator comp, \n\t\t\tIPlayer player, IPlayer opponent) {\n\n\t\t// Try to improve on this lower-bound (based on selector). Reflects no move possible.\n\t\tMoveEvaluation best = new MoveEvaluation (comp.initialValue());\n\n\t\t// get all moves for this player and generate the boards that result\n\t\t// from making these moves. Select maximum of children if we are MAX\n\t\t// and minimum of children if we are MIN\n\t\tIterator<IGameMove> it = player.validMoves(state).iterator(); \n\t\twhile (it.hasNext()) {\n\t\t\tIGameMove move = it.next();\n\t\t\t\n\t\t\tmove.execute(state);\n\t\t\tnumComputationalStates++;\n\t\t\t\n\t\t\t// debugging output along the way...\n\t\t\tif (numComputationalStates % 100 == 0) {\n\t\t\t\tSystem.out.println (numComputationalStates);\n\t\t\t}\n\t\t\t\n\t\t\tMoveEvaluation pathMove = alreadyDetermined(state);\n\t\t\t\n\t\t\tif (pathMove == null) {\n\t\t\t\tint trial;\n\t\t\t\tif (ply <= 0) {\n\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t} else {\n\t\t\t\t\t// Recursively evaluate position. Compute MiniMax and swap\n\t\t\t\t\t// player and opponent, synchronously with MIN and MAX. If no move is\n\t\t\t\t\t// associated, then evaluate the generated board from original player\n\t\t\t\t\tMoveEvaluation me = minimax (ply-1, comp.opposite(), opponent, player);\n\t\t\t\t\tif (me.move == null) {\n\t\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrial = me.score;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpathMove = new MoveEvaluation (move, trial);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmove.undo(state);\n\t\t\t\n\t\t\t// If we are selected as the better move, then update accordingly\n\t\t\tif (comp.compare(best.score, pathMove.score) < 0) {\n\t\t\t\tbest = new MoveEvaluation (move, pathMove.score); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// this move was selected for the gameState. record it. If it is null, then the game has\n\t\t// already been won or this is a draw; in either case, we will let recursive parent take\n\t\t// care of the scoring. Even add when no move, so we can keep track of the WON games.\n\t\taddToList(state, best);\n\t\t\n\t\treturn best;\n\t}",
"private String mediumMove() {\n int a = getBestMoveForBlack(FORESEEN_MOVES * 2);\n System.out.println(\"Moving \" + a);\n return super.makeAMove(a);\n }",
"private Direction moveToGoal() throws GameActionException {\n Direction toGoal = location.directionTo(goal);\n if (rc.canMove(toGoal)) {\n return toGoal;\n } else {\n return getHandOnWall();\n }\n }",
"protected int getMove(){\r\n\t\treturn this.move;\r\n\t}",
"private Constants.MOVE runAway(Game game) {\n if (pacmanInfo.getLastIndex() >= 0) {\n return game.getApproximateNextMoveAwayFromTarget(this.getOwnNodeIndex(game), pacmanInfo.getLastIndex(),\n game.getGhostLastMoveMade(ghost), Constants.DM.PATH);\n }\n //move towards the lair if not already there\n if (game.getDistance(this.getOwnNodeIndex(game), game.getCurrentMaze().lairNodeIndex, Constants.DM.PATH) > 10) {\n return game.getApproximateNextMoveAwayFromTarget(this.getOwnNodeIndex(game), game.getCurrentMaze().lairNodeIndex,\n game.getGhostLastMoveMade(ghost), Constants.DM.PATH);\n }\n return Constants.MOVE.NEUTRAL;\n }"
] | [
"0.844335",
"0.7810666",
"0.7701466",
"0.7658236",
"0.7523338",
"0.74973524",
"0.7467554",
"0.73368084",
"0.7330862",
"0.73137474",
"0.7308101",
"0.7224689",
"0.72177976",
"0.7214007",
"0.72075766",
"0.713564",
"0.7073713",
"0.70652974",
"0.69968635",
"0.69868207",
"0.6917803",
"0.68929636",
"0.6882863",
"0.6849375",
"0.6848216",
"0.6842445",
"0.68109727",
"0.68097174",
"0.67907023",
"0.6788364",
"0.67667884",
"0.6758973",
"0.67581284",
"0.6740889",
"0.6739718",
"0.67393774",
"0.67255855",
"0.67242986",
"0.6692319",
"0.6688632",
"0.66789734",
"0.66765",
"0.6658992",
"0.6657028",
"0.6653101",
"0.66464275",
"0.6639928",
"0.66358835",
"0.6584283",
"0.6582716",
"0.65731335",
"0.6564574",
"0.6560726",
"0.6551778",
"0.6536368",
"0.65253735",
"0.65183145",
"0.6514966",
"0.6505674",
"0.6502946",
"0.64974475",
"0.64960206",
"0.6485951",
"0.64779705",
"0.64668584",
"0.64567286",
"0.64418775",
"0.6429174",
"0.6427367",
"0.6409075",
"0.64033496",
"0.64030606",
"0.640268",
"0.63996214",
"0.63829666",
"0.6377262",
"0.6373904",
"0.636172",
"0.63591415",
"0.6357046",
"0.63551146",
"0.6352258",
"0.6340586",
"0.6331773",
"0.62942517",
"0.6281759",
"0.627869",
"0.6277356",
"0.6275425",
"0.6275158",
"0.627152",
"0.6268634",
"0.62590104",
"0.62547255",
"0.62511504",
"0.624575",
"0.6245345",
"0.624484",
"0.6240227",
"0.6237147"
] | 0.84961295 | 0 |
we are using the same chessGame instance, so no need to do anything here. | @Override
public void moveSuccessfullyExecuted(Move move) {
System.out.println("executed: "+move);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void newGame() {\n\n //reset game board before initializing newgame\n clearGame();\n \n whiteplayer = new Player(\"white\", chessboard, this);\n blackplayer = new Player(\"black\", chessboard, this);\n colorsTurn = \"white\";\n gamelog.logCurrentTurn(colorsTurn);\n\n }",
"private void playGame() {\n do {\n new Round(this);\n } while (!winner.isPresent());\n }",
"public void run() {\n Scanner cin = new Scanner(System.in, \"UTF-8\");\n boolean quit = false;\n chess = new Chess();\n Player temp;\n boolean check = false;\n Pawnposition p = null;\n int checknew = 0;\n\n while (!quit) {\n System.out.print(\"Chess> \");\n String str = cin.nextLine();\n if (str.length() <= 0) {\n System.out.println(\"Error! Not support this command1!\\n\");\n }\n else {\n String[] cmd = str.split(\" \");\n if (\"new\".startsWith(cmd[0]) && cmd.length == 2) {\n if(cmd[1].equals(\"SINGLE\")||(cmd[1].equals(\"single\"))){\n chess = new Chess();\n checknew = 1;\n }\n if(cmd[1].equals(\"HOTSEAT\")){\n chess = new Chess();\n }\n }\n else if (\"help\".startsWith(cmd[0]) && cmd.length == 1) {\n this.showHelp();\n }\n else if (\"quit\".startsWith(cmd[0]) && cmd.length == 1) {\n return;\n }\n else if (\"move\".startsWith(cmd[0]) && cmd.length == 3) {\n Cell f = new Cell(this.inputChange(cmd[1].charAt(0)), this.inputChange(cmd[1].charAt(1)));\n Cell t = new Cell(this.inputChange(cmd[2].charAt(0)), this.inputChange(cmd[2].charAt(1)));\n\n check = chess.move(f, t);\n if (check == true) {\n if ((chess.getState().getWinner() == Player.BLACK) || (chess.getState().getWinner() == Player.WHITE)) {\n Player tempforwin = this.chess.getState().getCurrentPlayer();\n System.out.println(tempforwin + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n System.out.println(\"Game over. \" + tempforwin + \" has won\");\n continue;\n }\n if (this.chess.getState().getCurrentPlayer() == Player.WHITE) {\n temp = Player.BLACK;\n System.out.println(temp + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n }\n if (this.chess.getState().getCurrentPlayer() == Player.BLACK) {\n temp = Player.WHITE;\n System.out.println(temp + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n if(checknew == 1) {\n p = this.chess.minmax(0, Player.BLACK);\n if (p == null) {\n System.out.println(\"Fehler bei p\");\n } else if (p.getresult() == 0) {\n System.out.println(\"Fehler bei p.r\");\n } else if (p.getcellt() == null) {\n System.out.println(\"Fehler bei p.getcellt\");\n } else if (p.getcellf() == null) {\n System.out.println(\"Fehler bei p.getcellf\");\n } else {\n this.chess.move(p.getcellf(), p.getcellt());\n }\n }\n }\n }\n if (this.chess.ifmiss() == false && chess.getState().getWinner() == null) {\n System.out.println(this.chess.getState().getCurrentPlayer() + \" must miss a turn\");\n this.chess.getState().setCurrentPlayer(this.chess.getState().getCurrentPlayer());\n }\n\n\n }\n else if (\"print\".startsWith(cmd[0]) && cmd.length == 1) {\n if (chess == null) {\n System.out.println(\"Error! Fehler chess\");\n }\n else {\n chess.print();\n }\n }\n else {\n System.out.println(\"Error! Not support this command!\");\n }\n }\n }\n }",
"public void checkGame() {\n\n\t}",
"public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }",
"@Override\n public void run() {\n if(mGame.getmGameStatus() == Game.GameStatus.ONGOING){\n\n // If turn was toggled:\n if(mGame.getmCurrentlyPlaying() != mPlayerGamePiece) {\n\n // Updating colors for profile areas:\n mOpponentProfileArea.setBackgroundResource(R.drawable.user_area_green);\n mOpponentUsername.setBackgroundResource(R.color.colorGreenDarkAlpha);\n mPlayerProfileArea.setBackgroundResource(R.drawable.user_area_gray);\n mPlayerUsername.setBackgroundResource(R.color.colorGrayDarkAlpha);\n\n // Now A.I. opponent should make a move:\n makeAIMove();\n\n }\n\n // Otherwise, player gets another turn:\n else{\n mPlayableTiles = mGame.getmBoard().getPlayableTiles(mPlayerGamePiece);\n showGuidelines();\n mIsAllowedToPlay = true;\n }\n\n }\n\n else{ // Otherwise, game has ended.\n handleGameEnding();\n }\n\n }",
"public static void newGame(){\n\t\tsetUp.buildBoard(8,8);\n\t\tfor(int i = 0; i < boardBoundsRow * boardBoundsColumn; i++){\n\t\t\tJPanel selectedTile = (JPanel) userInterface.boardButtons.getComponent(i);\n\t\t\tselectedTile.removeAll();\n\t\t\tselectedTile.revalidate();\n\t\t}\n\t\tuserInterface.addBlackPiece();\n\t\tuserInterface.addWhitePiece();\n\t\tuserInterface.check.setText(\"You are not in check\");\n\t\tking.blackKingCheck = false;\n\t\tking.whiteKingCheck = false;\n\t\tturn = \"white\";\n\t\tString playerTurn = \"Player turn: \";\n\t\tuserInterface.turn.setText(playerTurn.concat(turn));\n\t\tundoMoveClass.clearStacks();\n\t}",
"public void runGame() {\r\n\t\ttry {\r\n\t\t\thost.startNewGame(width, height, false);\r\n\t\t\tguest.startNewGame(width, height, true);\r\n\t\t\tnotifyStartGame(width, height);\r\n\t\t} catch(Exception e) {return;}\r\n\t\twhile(!game.isGameOver()) {\r\n\t\t\tcurrentPlayer = game.getCurrentPlayer();\r\n\t\t\tMove move;\r\n\t\t\ttry {\r\n\t\t\t\tmove = currentPlayer.getNextMove();\r\n\t\t\t} catch(Exception e) { return ;}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tif(game.isValidMove(move)) {\r\n\t\t\t\t\tgame.registerMove(move);\r\n\t\t\t\t\thost.registerMove(move);\r\n\t\t\t\t\tguest.registerMove(move);\r\n\t\t\t\t\tnotifyMove(move);\r\n\t\t\t\t}\r\n\t\t\t} catch (IllegalMove e) { }\r\n\t\t\tcatch (Exception e) { return; }\r\n\t\t}\r\n\n\t\ttry {\r\n\t\t\thost.finishGame(game.getResult(host));\r\n\t\t\tguest.finishGame(game.getResult(guest));\r\n\t\t\tnotifyFinishGame(game.getResult(host));\r\n\t\t} catch( Exception e) { return; }\n\t}",
"public Chess() {\n\t\t// TODO Auto-generated constructor stub\n\t\tchessBoard = new int[BOARD_LENGTH][BOARD_LENGTH];\n\t\tpieces = new AbstractPiece[BOARD_NUM_PIECES];\n\t\toldPosition = new Point();\n\t\tokToMove = false;\n\t\tpieceCounter = 0;\n\t\tpieceChosen = 0;\n\t\tnumClicks = 0; \n\t}",
"private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }",
"@Override\n\t public void run() {\n\t \tSnakeGame game = new SnakeGame();\n\t }",
"public void run() {\n if(mPlayerGamePiece == mGame.getmCurrentlyPlaying()){\n mPlayableTiles = mGame.getmBoard().getPlayableTiles(mPlayerGamePiece);\n showGuidelines();\n mIsAllowedToPlay = true;\n }\n // Otherwise, opponent begins:\n else{\n mIsAllowedToPlay = false;\n makeAIMove();\n }\n\n }",
"public Game() {\n\t\tthis.board = new Board();\n\t\tthis.pieces = new HashMap<Chess.Color, List<Piece>>();\n\t\tthis.pieces.put(Chess.Color.WHITE, new ArrayList<Piece>());\n\t\tthis.pieces.put(Chess.Color.BLACK, new ArrayList<Piece>());\n\t\tthis.moveStack = new Stack<Move>();\n\t}",
"public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }",
"public ChessRunner(){\n\t\taddMouseListener(this);\n\t\tfor(int i=0;i<8;i++){\n\t\t\tfor (int j=1;j<7;j++)\n\t\t\t\tif(j==1)\n\t\t\t\t\tboard[i][j] = new BlackPawn();\n\t\t\t\telse if(j==6)\n\t\t\t\t\tboard[i][j] = new WhitePawn();\n\t\t\t\telse\n\t\t\t\t\tboard[i][j]= new BlankPiece();\n\t\t}\n\t\tboard[1][0] = new BlackKnight();\n\t\tboard[6][0] = new BlackKnight();\n\t\tboard[0][0] = new BlackRook();\n\t\tboard[7][0] = new BlackRook();\n\t\tboard[2][0] = new BlackBishop();\n\t\tboard[5][0] = new BlackBishop();\n\t\tboard[4][0] = new BlackKing();\n\t\tboard[3][0] = new BlackQueen();\n\t\t\n\t\tboard[1][7] = new WhiteKnight();\n\t\tboard[6][7] = new WhiteKnight();\n\t\tboard[0][7] = new WhiteRook();\n\t\tboard[7][7] = new WhiteRook();\n\t\tboard[2][7] = new WhiteBishop();\n\t\tboard[5][7] = new WhiteBishop();\n\t\tboard[4][7] = new WhiteKing();\n\t\tboard[3][7] = new WhiteQueen();\n\t\t\n\t}",
"public static void main(String[] args) {\n\n chessGUI g = new chessGUI();\n\n /*\n // test Root-1\n System.out.println(\"Hello World!\");\n Board test = new Board();\n test.printBoard();\n Piece king1 = new King(1, new Position(2,2), test);\n Piece king2 = new King(1, new Position(1,1), test);\n Piece ROOK3 = new Rook(-1, new Position(1,2), test);\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(ROOK3.getRow(), ROOK3.getCol(), ROOK3);\n test.printBoard();\n Object r = ROOK3;\n if (r instanceof Rook){\n System.out.println(\"r instanceof Rook\");\n //r = (Rook) r;\n //System.out.println(((King) k).getBoard()==null);\n //.printBoard();\n int result = ((Rook) r).judgeMove(3,2);\n System.out.println(\"result\"+result);\n }\n\n // test Bishop\n Board test = new Board();\n test.printBoard();\n Piece king1 = new King(1, new Position(2,2), test);\n Piece king2 = new King(-1, new Position(1,1), test);\n Piece king3 = new King(1, new Position(2,3), test);\n\n Piece bishop = new Bishop(-1, new Position(1,2), test);\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n test.putPieceOnBoard(bishop.getRow(), bishop.getCol(), bishop);\n test.printBoard();\n Object r = bishop;\n if (r instanceof Bishop){\n System.out.println(\"r instanceof Bishop\");\n // 2,1 == 0\n // 2,3 == 1\n // 4,5 == -3\n int result = ((Bishop) r).judgeMove(4,5);\n System.out.println(\"result\"+result);\n }\n\n\n // test Queen\n Board test = new Board();\n test.printBoard();\n Piece king1 = new King(1, new Position(2,2), test);\n Piece king2 = new King(-1, new Position(1,1), test);\n Piece king3 = new King(1, new Position(2,3), test);\n\n Piece queen = new Queen(-1, new Position(3,2), test);\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n test.putPieceOnBoard(queen.getRow(), queen.getCol(), queen);\n test.printBoard();\n Object r = queen;\n if (r instanceof Queen){\n System.out.println(\"r instanceof Queen\");\n // 4,3 == 0\n // 2,2 == 1\n // 1,4 == -3\n // 3,2 == -2\n\n // 1,4 == -3\n // 5,2 == 0\n // 5,4 == 0\n // 1,0 == 0\n\n // 0,2 == -3\n // 2,3 == 1\n\n }\n Piece king4 = new King(1, new Position(4,1), test);\n test.putPieceOnBoard(king4.getRow(), king4.getCol(), king4);\n test.printBoard();\n // 4,1 == 1\n // 5, 0 == -3\n // 5, 5 == -4\n int result = ((Queen) r).judgeMove(5,5);\n System.out.println(\"result\"+result);\n\n //test Knight\n Board test = new Board();\n test.printBoard();\n Piece king1 = new King(1, new Position(2,2), test);\n Piece king2 = new King(-1, new Position(1,1), test);\n Piece king3 = new King(1, new Position(2,3), test);\n Piece queen = new Queen(-1, new Position(3,3), test);\n Piece queen1 = new Queen(1, new Position(3,1), test);\n\n Piece knight = new Knight(-1, new Position(1,2), test);\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n test.putPieceOnBoard(queen.getRow(), queen.getCol(), queen);\n test.putPieceOnBoard(queen1.getRow(), queen1.getCol(), queen1);\n test.putPieceOnBoard(knight.getRow(), knight.getCol(), knight);\n test.printBoard();\n Object r = knight;\n if (r instanceof Knight){\n System.out.println(\"r instanceof Knight\");\n // 2,0 == 0\n // 3,1 == 1\n // 3,3 == -3\n // 2,3 == -4\n int result = ((Knight) r).judgeMove(3,1);\n System.out.println(\"result\"+result);\n }\n\n //test Pawn\n Board test = new Board();\n Piece king1 = new King(-1, new Position(2,2), test);\n Piece king2 = new King(-1, new Position(1,1), test);\n Piece king3 = new King(-1, new Position(3,3), test);\n Piece king4 = new King(1, new Position(4,0), test);\n\n Piece pawn = new Pawn(1, new Position(1,3), test);\n Piece pawn_1 = new Pawn(-1, new Position(5,1), test);\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n test.putPieceOnBoard(king4.getRow(), king4.getCol(), king4);\n test.putPieceOnBoard(pawn.getRow(), pawn.getCol(), pawn);\n test.putPieceOnBoard(pawn_1.getRow(), pawn_1.getCol(), pawn_1);\n\n test.printBoard();\n // pawn 2,2 = 1\n // pawn 2,3 = 0\n // pawn -3, 0 = -1\n // pawn 1,3 = -2\n // pawn 0,3 = -4\n // pawn 3,3 = -3\n\n\n //(Pawn) pawn).isFirstMove = 0;\n\n // pawn[-1] 6,1 = -4\n // pawn[-1] 4,0 = 1\n // pawn[-1] 4,1 = 0\n // pawn[-1] 3,1 = 0\n int result = ((Pawn) pawn_1).judgeMove(3,1);\n\n System.out.println(\"result\"+result);\n\n Board test = new Board();\n Piece king1 = new King(1, new Position(2,2), test);\n Piece king2 = new King(-1, new Position(1,1), test);\n Piece king3 = new King(1, new Position(2,3), test);\n Piece queen = new Queen(-1, new Position(3,3), test);\n Piece queen1 = new Queen(1, new Position(3,1), test);\n\n Piece rook = new Rook(-1, new Position(1,2), test);\n\n test.putPieceOnBoard(king1.getRow(), king1.getCol(), king1);\n test.putPieceOnBoard(king2.getRow(), king2.getCol(), king2);\n test.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n test.putPieceOnBoard(queen.getRow(), queen.getCol(), queen);\n test.putPieceOnBoard(queen1.getRow(), queen1.getCol(), queen1);\n test.putPieceOnBoard(rook.getRow(), rook.getCol(), rook);\n test.printBoard();\n\n // 2,2 = 1\n // 1,3 = 0\n // 1,5 = 0\n // -1,0 = -1\n // 1,2 = -2\n // 1,0 = -3\n // 0,0 = -4\n int result = ((Rook) rook).judgeMove(1,3);\n\n System.out.println(\"result\"+result);\n */\n\n /* test startingBoard()\n Board board = new Board();\n board.startingBoard();\n board.printBoard();\n */\n\n //test pawnThread();\n /*\n Board board = new Board();\n Piece kingwhite = new King(1, new Position(2,2), board);\n Piece kingblack = new King(-1, new Position(5,2), board);\n Piece king3 = new King(1, new Position(3,4), board);\n Piece p1 = new Pawn(1, new Position(4,1), board);\n Piece p2 = new Pawn(-1, new Position(4,3), board);\n Piece p3 = new Pawn(1, new Position(3,1), board);\n Piece p4 = new Pawn(-1, new Position(1,1), board);\n\n board.putPieceOnBoard(kingwhite.getRow(),kingwhite.getCol(),kingwhite);\n board.putPieceOnBoard(kingblack.getRow(),kingblack.getCol(),kingblack);\n board.putPieceOnBoard(king3.getRow(), king3.getCol(), king3);\n board.putPieceOnBoard(p1.getRow(), p1.getCol(), p1);\n board.putPieceOnBoard(p2.getRow(), p2.getCol(), p2);\n board.putPieceOnBoard(p3.getRow(), p3.getCol(), p3);\n board.putPieceOnBoard(p4.getRow(), p4.getCol(), p4);\n\n board.printBoard();\n // true\n System.out.println(board.pawnThread(-1*kingblack.getColor(),kingblack.getRow(),kingblack.getCol()));\n // false\n System.out.println(board.pawnThread(-1*kingwhite.getColor(),kingwhite.getRow(),kingwhite.getCol()));\n // true\n System.out.println(board.pawnThread(-1*king3.getColor(),king3.getRow(),king3.getCol()));\n */\n\n //test kingThread();\n /*\n Board board = new Board();\n Piece king1 = new King(1, new Position(2,2), board);\n Piece king2 = new King(-1, new Position(5,2), board);\n\n Piece p1 = new King(1, new Position(3,2), board);\n Piece p2 = new King(-1, new Position(5,1), board);\n Piece p3 = new King(1, new Position(4,1), board);\n Piece p4 = new King(1, new Position(4,3), board);\n\n\n board.putPieceOnBoard(king1.getRow(),king1.getCol(),king1);\n board.putPieceOnBoard(king2.getRow(),king2.getCol(),king2);\n board.putPieceOnBoard(p1.getRow(), p1.getCol(), p1);\n board.putPieceOnBoard(p2.getRow(), p2.getCol(), p2);\n board.putPieceOnBoard(p3.getRow(), p3.getCol(), p3);\n board.putPieceOnBoard(p4.getRow(), p4.getCol(), p4);\n board.printBoard();\n //false\n System.out.println(board.kingThread(-1*king1.getColor(),king1.getRow(),king1.getCol()));\n //true\n System.out.println(board.kingThread(-1*king2.getColor(),king2.getRow(),king2.getCol()));\n //true\n System.out.println(board.kingThread(-1*p4.getColor(),p4.getRow(),p4.getCol()));\n //false\n System.out.println(board.kingThread(-1*p1.getColor(),p1.getRow(),p1.getCol()));\n */\n\n\n //test knightThread();\n /*\n Board board = new Board();\n Piece k1 = new King(1, new Position(2,2), board);\n Piece k2 = new King(-1, new Position(5,2), board);\n Piece k3 = new King(-1, new Position(6,4), board);\n\n Piece p1 = new Knight(-1, new Position(0,3), board);\n Piece p2 = new Knight(-1, new Position(5,1), board);\n Piece p3 = new Knight(1, new Position(4,1), board);\n Piece p4 = new Knight(1, new Position(4,4), board);\n\n\n board.putPieceOnBoard(k1.getRow(),k1.getCol(),k1);\n board.putPieceOnBoard(k2.getRow(),k2.getCol(),k2);\n board.putPieceOnBoard(k3.getRow(),k3.getCol(),k3);\n board.putPieceOnBoard(p1.getRow(), p1.getCol(), p1);\n board.putPieceOnBoard(p2.getRow(), p2.getCol(), p2);\n board.putPieceOnBoard(p3.getRow(), p3.getCol(), p3);\n board.putPieceOnBoard(p4.getRow(), p4.getCol(), p4);\n board.printBoard();\n //true\n System.out.println(board.knightThread(-1*k1.getColor(),k1.getRow(),k1.getCol()));\n //true\n System.out.println(board.knightThread(-1*k2.getColor(),k2.getRow(),k2.getCol()));\n //false\n System.out.println(board.knightThread(-1*k3.getColor(),k3.getRow(),k3.getCol()));\n */\n\n //test bishopQueenThread();\n/*\n Board board = new Board();\n //board.bishopQueenThread(1, 3,4);\n\n Piece k1 = new King(1, new Position(2,2), board);\n Piece k2 = new King(-1, new Position(5,2), board);\n Piece k3 = new King(1, new Position(6,4), board);\n\n Piece p1 = new Bishop(-1, new Position(0,3), board);\n Piece p2 = new Bishop(-1, new Position(5,1), board);\n Piece p3 = new Bishop(1, new Position(3,0), board);\n Piece p4 = new Bishop(1, new Position(4,4), board);\n Piece p5 = new Bishop(-1, new Position(5,5), board);\n\n\n board.putPieceOnBoard(k1.getRow(),k1.getCol(),k1);\n board.putPieceOnBoard(k2.getRow(),k2.getCol(),k2);\n board.putPieceOnBoard(k3.getRow(),k3.getCol(),k3);\n board.putPieceOnBoard(p1.getRow(), p1.getCol(), p1);\n board.putPieceOnBoard(p2.getRow(), p2.getCol(), p2);\n board.putPieceOnBoard(p3.getRow(), p3.getCol(), p3);\n board.putPieceOnBoard(p4.getRow(), p4.getCol(), p4);\n board.putPieceOnBoard(p5.getRow(), p5.getCol(), p5);\n board.printBoard();\n //false\n System.out.println(board.bishopQueenThread(-1*k1.getColor(),k1.getRow(),k1.getCol()));\n //true\n System.out.println(board.bishopQueenThread(-1*k2.getColor(),k2.getRow(),k2.getCol()));\n //true\n System.out.println(board.bishopQueenThread(-1*k3.getColor(),k3.getRow(),k3.getCol()));\n */\n\n //test rookQueenThread\n\n /*\n Piece k1 = new King(1, new Position(2,2), board);\n Piece k2 = new King(1, new Position(5,2), board);\n Piece k3 = new King(-1, new Position(6,4), board);\n\n Piece p1 = new Rook(-1, new Position(0,3), board);\n Piece p2 = new Rook(-1, new Position(5,1), board);\n Piece p3 = new Rook(1, new Position(3,0), board);\n Piece p4 = new Rook(1, new Position(4,4), board);\n Piece p5 = new Rook(-1, new Position(5,5), board);\n\n\n board.putPieceOnBoard(k1.getRow(),k1.getCol(),k1);\n board.putPieceOnBoard(k2.getRow(),k2.getCol(),k2);\n board.putPieceOnBoard(k3.getRow(),k3.getCol(),k3);\n board.putPieceOnBoard(p1.getRow(), p1.getCol(), p1);\n board.putPieceOnBoard(p2.getRow(), p2.getCol(), p2);\n board.putPieceOnBoard(p3.getRow(), p3.getCol(), p3);\n board.putPieceOnBoard(p4.getRow(), p4.getCol(), p4);\n board.putPieceOnBoard(p5.getRow(), p5.getCol(), p5);\n board.printBoard();\n //false\n System.out.println(board.rookQueenThread(-1*k1.getColor(),k1.getRow(),k1.getCol()));\n //true\n System.out.println(board.rookQueenThread(-1*k2.getColor(),k2.getRow(),k2.getCol()));\n //true\n System.out.println(board.rookQueenThread(-1*k3.getColor(),k3.getRow(),k3.getCol()));\n */\n\n\n }",
"private static void play(Board chess, Scanner scan) {\r\n boolean whiteCanCastle = true;\r\n boolean blackCanCastle = true;\r\n\r\n // Get's user's choice\r\n // Split into the <old x position>, <old y position>, <new x position>, <new y position>\r\n for (int i = 0; i < 100; i++) {\r\n // Gets the user's requested move, moves the pieces (with move verification), and prints the final board\r\n int[] move = Tasks.getMove(chess, scan);\r\n boolean valid = chess.move(move[1], move[0], move[3], move[2], move[4], move[5]);\r\n if (move[4] == 99 && valid) {whiteCanCastle = false;}\r\n else if (move[4] == -99 && valid) {blackCanCastle = false;}\r\n chess.printBoard();\r\n }\r\n // System.out.println(\"50 Move Rule Exceeded!\\nGame Over!\");\r\n }",
"private void startNewGame(){\n if (selectedPiece!=null)\n selectedPiece.setBackground(getDefaultColor(selectedPiece));\n selectedPiece = null;\n setAllToDefaultColor();\n setDefulatMessage();\n board = new ChessBoard(1, false);\n for(int row = 0 ; row < ROWS; row++){\n for(int col = 0; col < COLS ; col++){\n setButtonIcon(row,col);\n }\n }\n }",
"public Chessboard(Context context, String sn) {\n super(context);\n setOnTouchListener(this);\n getHolder().addCallback(this);\n board = new ArrayList<>();\n pieces = new ArrayList<>();\n selected = new ArrayList<>();\n points = new int[]{0, 0};\n thread = new chessMainThread(getHolder(), this);\n setFocusable(true);\n whiteTurn = true;\n gameOn = true;\n textPaint = new Paint();\n textPaint.setColor(Color.WHITE);\n textPaint.setTextSize(60);\n\n sessionName = sn;\n\n database = FirebaseDatabase.getInstance();\n DatabaseReference chessRef = database.getReference(\"chess/\" + sessionName + \"/chessMove\");\n chessRef.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n // format - xOrigin,yOrigin/xDest,yDest\n String value = snapshot.getValue(String.class);\n if(!(value == null)){\n String[] values = value.split(\"/\"); // 5,4/3,2/true -> [5,4][3,2][true]\n String[] originVal = values[0].split(\",\");\n String[] destVal = values[1].split(\",\");\n int[] origin = new int[]{Integer.parseInt(originVal[0]), Integer.parseInt(originVal[1])};\n int[] destination = new int[]{Integer.parseInt(destVal[0]), Integer.parseInt(destVal[1])};\n movePieceFromDB(origin, destination);\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n //something something error\n }\n });\n }",
"@Override\n public void use(Game game) {\n\n // ChooseTarget chooseTarget=new ChooseTarget(\"Select where do you want to move\",availableSquare);\n // game.notifyObservers(chooseTarget);\n game.getController().setGoOn(false);\n\n Worker worker = (Worker) game.getTargetInUse();\n game.getController().setCanSkip(true);\n\n if (game.getTargetSelected().getSquare().getWorker() != null && ((Worker) game.getTargetInUse()).getMandatorySquare() == null) {\n game.setTargetSelected(game.getTargetSelected().getSquare().getWorker());\n Worker w1 = (Worker) game.getTargetSelected();\n w1.setMandatorySquare(((Worker) game.getTargetInUse()).getHistoryPos().get(0));\n game.getController().setCanSkip(false);\n }\n\n if (worker.getMandatorySquare() != null) {\n //game.getTargetInUse().getSquare().removeWorker();\n game.getController().setCanSkip(false);\n game.getCurrentPlayer().setHasBeenMoved(true);\n worker.getMandatorySquare().setWorker((Worker) game.getTargetInUse());\n UpdateEvent event = new UpdateEvent(game.squareToJsonArrayGenerator());\n game.notifyObservers(event);\n // worker.setMandatorySquare(null);\n return;\n }\n\n if (worker.getCanBeMoved()) {\n if (availableSquare.contains(game.getTargetSelected().getSquare())) {\n game.getTargetInUse().getSquare().removeWorker();\n game.getCurrentPlayer().setHasBeenMoved(true);\n game.getTargetSelected().getSquare().setWorker((Worker) game.getTargetInUse());\n availableSquare.clear();\n UpdateEvent event = new UpdateEvent(game.squareToJsonArrayGenerator());\n game.notifyObservers(event);\n\n if (worker.getSquare().getLevel() == 3 && worker.getHistoryPos().get(worker.getHistoryPos().size() - 2).getLevel() < 3) {\n for (Worker w : game.getCurrentPlayer().getWorkers())\n if (w.equals(worker)) {\n game.setWinner(game.getCurrentPlayer());\n TurnState state = new NotifyVictoryState();\n game.getController().setState(state);\n state.executeState(game.getController());\n break;\n }\n }\n // availableSquare.add((worker.getHistoryPos().get(0));\n } else { game.notifyCurrent(new ExceptionEvent(\"target not available\"));\n game.getController().apply(new UndoCommand(), (VirtualView) game.getCurrentView());\n }\n } else new ExceptionEvent(\"you can't move\");\n //worker.setActualPos(target.getSquare());\n // worker.getHistoryPos().add(target.getSquare());\n\n //creazione evento+gestione skippable\n //game.getCurrentPlayer().setInQue(false);\n }",
"@Override\n public void run() {\n if(mGame.getmGameStatus() == Game.GameStatus.ONGOING){\n\n // If turn was toggled:\n if(mGame.getmCurrentlyPlaying() != opponentPiece) {\n\n // Updating colors for profile areas:\n mPlayerProfileArea.setBackgroundResource(R.drawable.user_area_green);\n mPlayerUsername.setBackgroundResource(R.color.colorGreenDarkAlpha);\n mOpponentProfileArea.setBackgroundResource(R.drawable.user_area_gray);\n mOpponentUsername.setBackgroundResource(R.color.colorGrayDarkAlpha);\n\n // Now Player should make a move:\n showGuidelines();\n mIsAllowedToPlay = true;\n\n }\n\n // Otherwise, opponent gets another turn:\n else{\n makeAIMove();\n }\n\n }\n\n else{ // Otherwise (game has ended)\n handleGameEnding();\n }\n\n }",
"@Override\n public void newGame() {\n //TODO Implement this method\n }",
"public void RunGame(){\r\n \r\n for (int i=0;i<numberoplayers;i++){ \r\n if (Objects.equals(Players.get(i).numofdestroyedships,numberofships))\r\n {\r\n Leave(Players.get(i));\r\n }\r\n if (Players.size()==1){\r\n Stop(Players.get(0));\r\n return ;\r\n }\r\n Square attackmove=Players.get(i).AttackOpponent();\r\n if (attackmove==null){\r\n if (i==1)\r\n i=-1;\r\n continue;\r\n }\r\n //know the player name and the attack point and add it to the list\r\n moves.add(new ToturialClass(Players.get(i).name,attackmove.x,attackmove.y,new Date()));\r\n //to know the targeted player\r\n int temp=i+1;\r\n if (temp==2)\r\n temp=0;\r\n AttackResult result=Players.get(temp).AcceptAttack(attackmove); \r\n Players.get(i).AcceptAttackResult(result);\r\n playerboard.repaintafterupdate();\r\n \r\n if (i==1)\r\n i=-1;\r\n }\r\n }",
"void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }",
"public ChessBoard() {\n initComponents();\n createChessBoard();\n\n }",
"public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }",
"public void startGame() {\n\t\tfor(Chess.RowConfiguration rowConfiguration : Chess.getRowConfigurations()) {\n\t\t\tint row = rowConfiguration.row;\n\t\t\tClass[] pieceClasses = rowConfiguration.pieces;\n\t\t\tChess.Color sideColor = rowConfiguration.sideColor;\n\n\t\t\tfor(int col = 0; col < Chess.NUM_COLS; col++) {\n\t\t\t\taddPiece(pieceClasses[col], sideColor, board.getSpot(row, col));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.inPlay = true;\n\t\t\n\t\tstartNewTurn();\n\t\t\n\t\tif(eventListener != null) {\n\t\t\teventListener.onGameStarted();\n\t\t}\n\t}",
"public void newGame() {\n\t\tplayer1Score = 0;\r\n\t\tplayer2Score = 0;\r\n\t\tif (score != null) {\r\n\t\t\tdrawScore();\r\n\t\t}\r\n\t\treset();\r\n\t}",
"public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }",
"private void gameOver() {\n\t\t\n\t}",
"private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }",
"public Game() {\n whitePlayer = new AwfulAIPlayer(Colour.WHITE, board);\n blackPlayer = new HumanPlayer(Colour.BLACK, board);\n\n sharedBoard = new CompositeBitBoard(whitePlayer.getOccupied(), blackPlayer.getOccupied());\n }",
"public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}",
"public GameMain()\n {\n allenBad = new AllenSucks(this);\n }",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"public void newTurn() {\n int[] playersAlive = GameEngine.playersAlive();\n if (playersAlive[0] > 0) {\n turnData.clear();\n Die dice = new Die();\n thrown = dice.main();\n turnOnePlayer();\n\n } else {\n GameEngine.theEnd(playersAlive[1]);\n }\n }",
"protected void updateGameState() {\n }",
"public static void main(String[] args)\n {\n // put your code here\n //display an initial menu on the screen describe what the program is about\n \n System.out.println(\"This is Game Of Chess\");\n //initialize a new chessGame\n chessGame NewGame=new chessGame(\"Player1\",\"Player2\");\n int counter=0;//setup counter=0\n int Srow = 0; //inititalize the Srow that will be asked equal to 0\n int Scol= 0;//inititalize the Scol that will be asked equal to 0\n //retrieve and display the chessBoard from this initialized game\n NewGame.board.PrintChessBoard();\n //keep on asking the user to move the knight to a new location until “quit” is typed in\n //each time the knight is moved, display the board with the new location\n \n while(true)\n { // Scans the next token of the input as an line\n System.out.println(\"Press Enter to Play the game OR Type 'quit' and Press Enter to end the game OR Type 'reset' and Press enter to restart the game\");\n Scanner reader = new Scanner(System.in); // Reading from System.in\n String start = reader.nextLine();\n \n if(start.equals(\"quit\")==true)\n { System.out.println(\"Thank You for the playing the game.\");\n System.exit(0);\n }else if(start.equals(\"reset\")== true){//reset case.if user types reset\n System.out.println(\"The Game has been successfully reset.\");//show the error message\n System.out.println();//gaps\n System.out.println();//gaps\n String[] arg ={};//setup a new argument of string\n playGame.main(arg);//and call the main function again with the new argument{}\n \n }else{\n \n if(counter %2 == 0){//player turns\n System.out.println(\"Player 1's turn\");\n \n do{\n System.out.println(\"Enter any value for source row from 0-7\");\n Srow=reader.nextInt();\n while(Srow < 0 || Srow > 7 ){\n System.out.println(\"Out of bound Values!. Enter any value for source row from 0-7: \");\n Srow = reader.nextInt(); \n }\n System.out.println(\"Enter any value for source column from 0-7\");\n Scol=reader.nextInt();\n while(Scol < 0 || Scol > 7){ \n System.out.println(\"Out of bound Values!. Enter any value for source column from 0-7\");\n Scol = reader.nextInt();\n } \n if(NewGame.getBoard().isPieceAt (Srow, Scol) == true && \"Player1\".equals(NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).getOwner())== false){\n System.out.println();\n System.out.println(\"Not Your turn\");\n System.out.println(\"Player 1's turn\");\n }\n if(NewGame.board.isPieceAt(Srow,Scol) == false){\n System.out.println(\"Unfortunately,there is no piece at the location\");\n }\n \n \n }while(NewGame.getBoard().isPieceAt (Srow, Scol) == false || \"Player1\".equals(NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).getOwner())== false);\n System.out.println(\"Enter any value for destination row from 0-7\");\n int Drow=reader.nextInt();\n while(Drow < 0 || Drow > 7){\n System.out.println(\"Out of bound values!. Enter any value for destination row from 0-7\");\n Drow = reader.nextInt();\n }\n System.out.println(\"Enter any value for destination column from 0-7\");\n int Dcol=reader.nextInt();\n while(Dcol < 0 || Dcol > 7){\n System.out.println(\"Out of bound values!. Enter any value for destination column from 0-7\");\n Dcol = reader.nextInt();\n }\n if(NewGame.getBoard().isPieceAt(Srow,Scol)==true){\n if( NewGame.getBoard().getPieceAt(new ChessLocation(Srow,Scol)).checkLineOfSight(new ChessLocation(Srow,Scol),new ChessLocation(Drow,Dcol))==true && NewGame.getBoard().isPieceAt(Drow,Dcol)== false){\n NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).moveto(new ChessLocation(Drow,Dcol));\n counter++;\n }else if(NewGame.getBoard().isPieceAt(Drow,Dcol)==true){\n NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).moveto(new ChessLocation(Drow,Dcol));\n counter++;\n }\n }else if(NewGame.getBoard().isPieceAt(Srow,Scol)==false){\n System.out.println(\"Unfortunately,there is no piece at the location\");\n }\n \n }else{\n System.out.println(\"Player 2's turn\");\n \n do{\n System.out.println(\"Enter any value for source row from 0-7\");\n Srow=reader.nextInt();\n while(Srow < 0 || Srow > 7 ){\n System.out.println(\"Out of bound Values!. Enter any value for source row from 0-7: \");\n Srow = reader.nextInt(); \n }\n System.out.println(\"Enter any value for source column from 0-7\");\n Scol=reader.nextInt();\n while(Scol < 0 || Scol > 7){ \n System.out.println(\"Out of bound Values!. Enter any value for source column from 0-7\");\n Scol = reader.nextInt();\n } \n if(NewGame.getBoard().isPieceAt (Srow, Scol) == true && \"Player2\".equals(NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).getOwner())== false){\n System.out.println();\n System.out.println(\"Not Your turn\");\n System.out.println(\"Player 2's turn\");\n }\n if(NewGame.board.isPieceAt(Srow,Scol) == false){\n System.out.println(\"Unfortunately,there is no piece at the location\");\n }\n }while(NewGame.getBoard().isPieceAt (Srow, Scol) == false || \"Player2\".equals(NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).getOwner())== false);\n System.out.println(\"Enter any value for destination row from 0-7\");\n int Drow=reader.nextInt();\n while(Drow < 0 || Drow > 7){\n System.out.println(\"Out of bound values!. Enter any value for destination row from 0-7\");\n Drow = reader.nextInt();\n }\n System.out.println(\"Enter any value for destination column from 0-7\");\n int Dcol=reader.nextInt();\n while(Dcol < 0 || Dcol > 7){\n System.out.println(\"Out of bound values!. Enter any value for destination column from 0-7\");\n Dcol = reader.nextInt();\n }\n if(NewGame.getBoard().isPieceAt(Srow,Scol)==true){\n if( NewGame.getBoard().getPieceAt(new ChessLocation(Srow,Scol)).checkLineOfSight(new ChessLocation(Srow,Scol),new ChessLocation(Drow,Dcol))==true && NewGame.getBoard().isPieceAt(Drow,Dcol)== false){\n NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).moveto(new ChessLocation(Drow,Dcol));\n counter++;\n }else if(NewGame.getBoard().isPieceAt(Drow,Dcol)==true){\n NewGame.board.getPieceAt(new ChessLocation(Srow,Scol)).moveto(new ChessLocation(Drow,Dcol));\n counter++;\n }\n }else if(NewGame.getBoard().isPieceAt(Srow,Scol)==false){\n System.out.println(\"Unfortunately,there is no piece at the location\");\n }\n }\n \n \n \n \n \n NewGame.board.PrintChessBoard();\n }\n \n }\n \n }",
"public void otherChess()\n {\n // Receive the column from the other player\n int col = theClient.recvInt();\n int row;\n // Find the unoccupied row from bottom to up to put the chess on\n for (row = ROWS - 1; row >= 0; row-- )\n {\n if (chessBoard[row][col] == 0)\n {\n break;\n }\n }\n // Put the chess from the other player on the board\n chessBoard[row][col] = other;\n grid[row][col].setIcon(new ImageIcon(otherURL));\n // If the column is full, disable the corresponding button\n if (row == 0)\n {\n drop[col].setEnabled(false);\n }\n // Check whether the other player wins.\n // If the other player wins, show the message dialog and tell the player\n // \"You lose\".\n // Then exit the system, terminate the game.\n if (win(row, col, other))\n {\n out.println(\"Lose.\");\n JOptionPane.showMessageDialog(null, \"You lose.\");\n System.exit(0);\n }\n // Else if the chess board is full, tie\n // Show the message dialog and tell the player \"Tie\".\n // Then exit the system, terminate the game.\n else if (full())\n {\n out.println(\"Tie.\");\n JOptionPane.showMessageDialog(null, \"Tie.\");\n System.exit(0);\n }\n }",
"public CheckersGame(CheckersData passedBoard) {\n boardData = passedBoard;\n }",
"public void doNewGame() {\n setGameInProgress(false);\n console(\"New Game\");\n if (gameInProgress() == true) {\n // This should not be possible, but it doens't hurt to check.\n console(\"Finish the current game first!\");\n return;\n }\n\n boardData.setUpGame(); // Set up the pieces.\n currentPlayer = CheckersData.RED; // RED moves first.\n legalMoves = boardData.getLegalMoves(CheckersData.RED); // Get RED's legal moves.\n selectedRow = -1; // RED has not yet selected a piece to move.\n console(\"Red: Make your move.\");\n setGameInProgress(true);\n refreshBoard();\n }",
"public void StartGame(){\n log(\"Game started\");\n\n myTile = 74;\n opponentTile = 14;\n bombs=3;\n hp=3;\n turnNumber = 1;\n lastTurnPowerup = 1;\n powerup_confusion = false;\n powerup_godmode = false;\n bombs_location = new ArrayList<>();\n powerup_location = new ArrayList<>();\n canPlaceBomb = true;\n invulnerable = false;\n confused = false;\n\n ImageView player2 = (ImageView) findViewById(R.id.square_14);\n ImageView player1 = (ImageView) findViewById(R.id.square_74);\n player1.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player2.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n String playerStarterId = getIntent().getStringExtra(getResources().getString(R.string.game_player_starter));\n\n /**\n * decides who gets to start according to the algorithm in MultiplayerManager.java\n */\n// if(playerStarterId.equals(mMyId)){\n// myTurn = true;\n// showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n// }else{\n// myTurn = false;\n// showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n// }\n\n /**\n * fallback incase the previous method doesnt work\n */\n try{\n if(sharedPreferences.getString(\"brick\", null).contains(\"Arafat\")){\n myTurn = true;\n ShotsCaller = true;\n showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n }else{\n myTurn = false;\n ShotsCaller = false;\n showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n }\n }catch (NullPointerException e){\n myTurn = false;\n ShotsCaller = false;\n }\n }",
"public Game() \n {\n gameLoaded = false;\n }",
"public void initGame() {\n this.game = new Game();\n }",
"public GameSession()\r\n {\r\n red = new Player(\"Red\");\r\n blue = new Player(\"Blue\");\r\n \r\n gameBoard = new Board();\r\n \r\n redRounds = 0;\r\n blueRounds = 0;\r\n \r\n currentRedScore = 0;\r\n currentBlueScore = 0;\r\n \r\n matchEnd = false;\r\n roundEnd = false;\r\n \r\n redWin = false;\r\n blueWin = false;\r\n \r\n move[0] = -1;\r\n move[1] = -1;\r\n \r\n line[0] = -1;\r\n line[1] = -1;\r\n }",
"public GameState() {\n positionToPieceMap = new HashMap<Position, Piece>();\n }",
"public void switchGame() {\n \tplayerController.clearKeysPressed();\n game.game1 = !game.game1;\n if (game.game1) {\n \tgame.gameSnapshot = game.game1Snapshot;\n \tgame.rooms = game.game1Rooms;\n \tgame.characters = game.game1Characters;\n \tgame.player = game.player1;\n } else {\n \tgame.gameSnapshot = game.game2Snapshot;\n \tgame.rooms = game.game2Rooms;\n \tgame.characters = game.game2Characters;\n \tgame.player = game.player2;\n }\n \n currentNPCs = game.gameSnapshot.map.getNPCs(game.player.getRoom());\n getTileRenderer().setMap(game.player.getRoom().getTiledMap());\n getTileRenderer().clearPeople();\n getTileRenderer().addPerson((List<AbstractPerson>) ((List<? extends AbstractPerson>) currentNPCs));\n getTileRenderer().addPerson(game.player);\n }",
"protected Game getGame() {\n return game;\n }",
"@Override\n public boolean isUsable(Game game) {\n// game.getCurrentPlayer().setInQue(true);\n availableSquare.clear();\n Boolean result = false;\n Worker worker = (Worker) game.getTargetInUse();\n if (game.getTargetSelected() != null) {\n game.getCurrentPlayer().setInQue(false);\n game.getController().setGoOn(true);\n return true;\n }\n // if(game.getTargetSelected().getSquare().getWorker()==null) {\n for (Square s : worker.getSquare().getAdjacentSquares()) {\n if (s.getLevel() < 4 && (s.getWorker() == null || s.getWorker().getC() != worker.getC()) && ((worker.getCanMoveUp() && worker.getSquare().getLevel() == s.getLevel() - 1) || (worker.getSquare().getLevel() > s.getLevel() - 1)))\n availableSquare.add(s);\n }\n result = true;\n List<SquareToJson> availableSquares = new ArrayList<>();\n for (Square s1 : availableSquare)\n availableSquares.add(new SquareToJson(s1.getLevel(), \"\", s1.getCoordinateX(), s1.getCoordinateY()));\n\n SquareToJson[][] map = game.squareToJsonArrayGenerator();\n\n ChooseTarget chooseTarget = new ChooseTarget(\"Where do you want to move?\", availableSquares, map);\n UpdateEvent event = new UpdateEvent(map);\n game.notifyObservers(event);\n game.notifyCurrent(chooseTarget);\n\n //}\n /*else{\n game.getCurrentPlayer().setInQue(false);\n game.getController().setGoOn(true);\n return true;\n }*/\n if (worker.getSquareNotAvailable() != null)\n availableSquare.remove(worker.getSquareNotAvailable());\n\n if (availableSquare.size() == 0) {\n game.getCurrentPlayer().setDefeat(true);\n result = false;\n game.getCurrentPlayer().setInQue(false);\n game.getController().setGoOn(false);\n return result;\n }\n worker.setCanBeMoved(result);\n game.getCurrentPlayer().setInQue(true);\n game.getController().setGoOn(true);\n return result;\n }",
"public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }",
"public void run() {\n System.out.println(\"Starting game!\");\n this.clients[0].startgame();\n this.clients[1].startgame();\n\n this.clients[0].setError(this::error);\n this.clients[1].setError(this::error);\n\n for (int moveNum = 0; !this.board.gameOver(); moveNum = (moveNum + 1) % 2) {\n ChessConnection player = this.clients[moveNum];\n\n player.make_move();\n\n String[] move;\n try {\n move = player.parseCommand();\n }\n catch (NullPointerException e) {\n System.err.println(\"Could not read response from client\");\n error();\n break;\n }\n\n if (!move[0].equals(ChessConnection.MOVE)) {\n if (move[0].equals(ChessConnection.CHOSE)) {\n Piece p = Piece.createPiece(this.board, ChessColor.valueOf(move[2]), move[1], parseInt(move[3]), parseInt(move[4]));\n this.board.chosePiece(p);\n this.clients[0].chose(p);\n this.clients[1].chose(p);\n moveNum++;\n continue;\n }\n\n if (error)\n break;\n\n System.err.printf(\"Invalid Command from client: %s\\n\", move[0]);\n error();\n break;\n }\n\n int startRow = Integer.parseInt(move[1]);\n int startCol = Integer.parseInt(move[2]);\n int row = Integer.parseInt(move[3]);\n int col = Integer.parseInt(move[4]);\n\n try {\n Piece p = this.board.pieceAt(startRow, startCol);\n this.board.movePiece(p, row, col);\n }\n catch (PawnInterrupt e) {\n this.board.choosePiece(e.getPawn());\n this.clients[(moveNum + 1) % 2].choose(e.getPawn().getRow(), e.getPawn().getCol());\n }\n catch (ChessException e) {\n e.printStackTrace();\n error();\n break;\n }\n\n /* No error */\n this.clients[0].move_made(startRow, startCol, row, col);\n this.clients[1].move_made(startRow, startCol, row, col);\n }\n\n if (!error) {\n /* Tell the client if they won or not */\n if (this.board.getWinner() == ChessColor.BLACK) {\n this.clients[0].game_won();\n this.clients[1].game_lost();\n } else if (this.board.getWinner() == ChessColor.WHITE) {\n this.clients[1].game_won();\n this.clients[0].game_lost();\n } else {\n this.clients[0].game_tied();\n this.clients[1].game_tied();\n }\n }\n\n /* parseCommand on each thread should exit because socket closed */\n this.clients[0].close();\n this.clients[1].close();\n }",
"public BoardGame()\n\t{\n\t\tplayerPieces = new LinkedHashMap<String, GamePiece>();\n\t\tplayerLocations = new LinkedHashMap<String, Location>();\n\t\t\n\t}",
"protected void newGame()\n { game.reset();\n if (first) \n game.move(game.genMove(TicGame.PLAYER_O),\n TicGame.PLAYER_O);\n first = !first;\n repaint();\n gameBegin(); \n }",
"public void runTheGame() {\n\t\txPlayer.setOpponent(oPlayer);\n\t\toPlayer.setOpponent(xPlayer);\n\t\tboard.display();\n\t\txPlayer.play();\n\t}",
"public Game() {\n board = new FourBoard();\n }",
"@Override\n public void buildAndSetGameLoop() {\n }",
"public boolean refreshGame() {\n\n\t\tif(currentRoom.isStoryActive()) {\n\t\t\tcurrentRoom.draw(bufferedG);\n\t\t\tp1.draw(bufferedG, up1, up2, up3, down1, down2, down3, left1,\n\t\t\t\t\tleft2, left3, right1, right2, right3,imgWeapon);\n\t\t\tPlayer p;\n\t\t\tfor(int i =0;i<players.size();i++) {\n\t\t\t\tp = players.get(i);\n\t\t\t\tif(p != null) {\n\t\t\t\t\tp.draw(bufferedG, up1, up2, up3, down1, down2, down3, left1,\n\t\t\t\t\t\t\tleft2, left3, right1, right2, right3,imgWeapon);\n\t\t\t\t\tif(i != Integer.parseInt(playerRef.getKey())) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(storyCount==0) {\n\t\t\t\tfor(int i =0;i<players.size();i++) {\n\t\t\t\t\tp = players.get(i);\n\t\t\t\t\tif(p != null) {\n\t\t\t\t\t\tframe.removeKeyListener(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tframe.removeKeyListener(p1);\n\t\t\t\tstoryCount++;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\telse if(!currentRoom.isStoryActive() && storyCount!=0) {\n\t\t\tPlayer p;\n\t\t\tfor(int i =0;i<players.size();i++) {\n\t\t\t\tp = players.get(i);\n\t\t\t\tif(p != null) {\n\t\t\t\t\tframe.addKeyListener(p1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tframe.addKeyListener(p1);\n\t\t\tstoryCount=0;\n\t\t}\n\n\n\t\n\t\tif(!loaded) {\n\t\t\treturn true;\n\t\t}\n\t\tcurrentRoom.draw(bufferedG);\n\t\tPlayer p;\n\t\tfor(int i =0;i<players.size();i++) {\n\t\t\tp = players.get(i);\n\t\t\tif(p != null) {\n\t\t\t\tp.draw(bufferedG, up1, up2, up3, down1, down2, down3, left1,\n\t\t\t\t\t\tleft2, left3, right1, right2, right3, imgWeapon);\n\t\t\t\tif(i != Integer.parseInt(playerRef.getKey())) {\n\t\t\t\t\tp1.collisionCheck(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tp1.draw(getBufferedGraphics(), up1, up2, up3, down1, down2, down3, left1,\n\t\t\t\tleft2, left3, right1, right2, right3, imgWeapon);\n\t\tWeapon temp=p1.getWeapon();\n\t\tenemies.collide(currentRoom);\n\t\tenemies.collide(temp);\n\t\tenemies.collide(p1);\n\t\tboolean collided = currentRoom.collisionCheck(p1);\n\t\tif(!collided)\n\t\t\tp1.move();\n\t\tif(p1.getHealth()<=0) {\n\t\t\tplayerRef.removeValueAsync();\n\t\t\treturn true;\n\n\n\t\t}\n\t\tPlayerData data = new PlayerData();\n\t\tdata.x = p1.getX();\n\t\tdata.y = p1.getY();\n\t\tdata.up = p1.getUp();\n\t\tdata.down = p1.getDown();\n\t\tdata.left = p1.getLeft();\n\t\tdata.right = p1.getRight();\n\t\tdata.health = p1.getHealth();\n\t\tdata.swing = p1.getSwing();\n\t\tplayerRef.setValueAsync(data);\n\n\n\t\n\t\tenemies.moveAll(p1.getX(), p1.getY());\n\n\n\t\t\n\t\tenemies.drawAll(bufferedG, p1.getX(), p1.getY());\n\t\tif(currentRoom instanceof EnemyRoom) {\n\t\t\t((EnemyRoom) currentRoom).reduceEnemiesLeft(enemies);\n\t\t}\n\n\n\t\tif(currentRoom.checkWhetherCanMoveToNextRoom()) {\n\t\t\tif(currentRoom instanceof EnemyRoom) {\n\t\t\t\tif(p1.getHitbox().intersects(((EnemyRoom) currentRoom).getHitboxForNextRoomPlate())){\n\t\t\t\t\tcurrentRoom = rooms.pop();\n\t\t\t\t\tframe.addMouseListener(currentRoom);\n\t\t\t\t\tif(currentRoom instanceof BossRoom) {\n\n\t\t\t\t\t\tint temp1=0;\n\t\t\t\t\t\tfor(int i =0;i<players.size();i++) {\n\t\t\t\t\t\t\tif(players.get(i)!=null) {\n\t\t\t\t\t\t\t\ttemp1 =i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.out.println(temp);\n\t\t\t\t\t\tif(currentRoom instanceof BossRoom && Integer.parseInt(playerRef.getKey())==temp1)\n\t\t\t\t\t\t\tenemies.spawnRoomEnemiesForBossRoom((BossRoom)currentRoom);\n\n\t\t\t\t\t\tp1.setX(550);\n\t\t\t\t\t\tp1.setY(100);\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentRoom instanceof EnemyRoom) {\n\t\t\t\t\t\tenemies.spawnRoomEnemies(((EnemyRoom) currentRoom).getOriginalNumberOfEnemies());\n\t\t\t\t\t\tp1.setX(550);\n\t\t\t\t\t\tp1.setY(100);\n\t\t\t\t\t}\n\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(currentRoom instanceof BossRoom) {\n\t\t\t\tif(p1.getHitbox().intersects(((EnemyRoom) currentRoom).getHitboxForNextRoomPlate())){\n\t\t\t\t\tcurrentRoom = rooms.pop();\n\t\t\t\t\tframe.addMouseListener(currentRoom);\n\t\t\t\t\t\n\t\t\t\t\tint temp1=0;\n\t\t\t\t\tfor(int i =0;i<players.size();i++) {\n\t\t\t\t\t\tif(players.get(i)!=null) {\n\t\t\t\t\t\t\ttemp1 =i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(currentRoom instanceof EnemyRoom) {\n\t\t\t\t\t\tenemies.spawnRoomEnemies(((EnemyRoom) currentRoom).getOriginalNumberOfEnemies());\n\t\t\t\t\t}\n\n\t\t\t\t\tp1.setX(550);\n\t\t\t\t\tp1.setY(100);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\trepaint();\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic void runInstincts() throws GameActionException {\n\t\t\r\n\t}",
"public void paint(Graphics g){\r\n super.paintComponent(g);\r\n for(int row = 0; row < 8; row++) {\r\n for (int col = 0; col < 8; col++) {\r\n if((row % 2 == 0 && col % 2 == 0) || (row % 2 != 0 && col % 2 != 0)){\r\n g.setColor(Color.gray.brighter()); //pale yellow\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n else{\r\n g.setColor(Color.gray.darker()); //dark brown\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n if ((currentPlayer.getColor()==checks[row][col])) {\r\n g.setColor(Color.darkGray.darker());\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.nextMove[row][col] == 1) {\r\n g.setColor(Color.getHSBColor(98,70,43));\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.checks[row][col] != 0) {\r\n if (this.checks[row][col] == WHITE) {\r\n drawPiece(row, col, g, Color.yellow.brighter());\r\n if (row == 7)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n else{\r\n drawPiece(row, col, g, Color.black);\r\n if (row == 0)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(isOver && isGame){\r\n gameOverDisplay(g);\r\n }\r\n }",
"@Override\n public void receiveInfo(GameInfo info) {\n\n //only update the state if info is a game state\n if (info instanceof ShogiState) {\n\n // update our state, then display\n this.state = (ShogiState) info;\n this.myPieces = state.getBoard();\n\n if (usingRulesScreen) return;\n if (usingDropsScreen) return;\n if (usingHistoryScreen) return;\n\n\n gui = myActivity.findViewById(R.id.shogiBoard);\n gui.myPieces = this.myPieces;\n\n //finds the player's king\n int kingRow = 0;\n int kingCol = 0;\n for(int i = 0; i < 9; i++){\n for(int j = 0; j < 9; j++){\n if (myPieces[i][j] != null){\n Piece possKing = myPieces[i][j];\n if(possKing.getPlayer() == 0 &&\n possKing.getType() == Piece.PieceType.KING){\n kingRow = i;\n kingCol = j;\n }\n }\n }\n }\n\n //if the king is in check, notify the player\n if(state.determinePlayerInCheck(0, this.myPieces, kingRow, kingCol)){\n new AlertDialog.Builder(getTopView().getContext())\n .setTitle(\"You are in check!\")\n .setMessage(\"Your king is in danger. You should move it.\")\n\n // A null listener allows the button to dismiss the dialog and take no further action.\n .setNegativeButton(\"Ok\", null)\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n }\n\n\n if (info instanceof IllegalMoveInfo) {\n\n Log.d(\"ShogiHP\", \"illegal move\");\n\n\n\n if (super.getflash()) {\n\n try {\n flashButton();\n } catch (InterruptedException ignored) {\n\n\n }\n }\n\n gui.invalidate();\n }\n\n gui.invalidate();\n\n }\n }",
"@Override\r\n\tpublic void updateGameFinished() {\n\t\t\r\n\t}",
"public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}",
"public void run() {\n board = new Board();\n\n // Initialiseer de game board and\n // print this with empty content\n initGame();\n board.paint();\n\n //speel één maal (spelers spelen om de beurt)\n do {\n playerTurn(currentPlayer);\n board.paint();\n updateGame(currentPlayer);\n\n // game-over ? print een message\n if (currentState == GameState.CROSS_WON) {\n System.out.println(\"'X' won! thanks for playing!\");\n } else if (currentState == GameState.NOUGHT_WON) {\n System.out.println(\"'O' won! thanks for playing!\");\n } else if (currentState == GameState.DRAW) {\n System.out.println(\"It's Draw! thanks for playing!\");\n }\n // andere speler's beurt\n currentPlayer = (currentPlayer == Mark.CROSS) ? Mark.NOUGHT : Mark.CROSS;\n }\n // repeat tot game-over\n while (currentState == GameState.PLAYING);\n\n }",
"public void startGameState(){\n\n ArrayList<Integer> checkeredSpaces = new ArrayList<Integer>(Arrays.asList(1, 3, 5, 7, 8, 10, 12, 14, 17, 19, 21,\n 23, 24, 26, 28, 30, 33, 35, 37, 39, 41, 42, 44, 46, 48,\n 51, 53, 55, 56, 58, 60, 62));\n\n\n\n for(int i =0; i < 63; i++){\n if(!checkeredSpaces.contains(i)){\n //set all black spaces to null on the board\n mCheckerBoard.add(null);\n }\n else if(i < 24){\n //set first three rows to red checkers\n mCheckerBoard.add(new Checker((i/2), true));\n }\n else if(i < 40){\n //set middle two rows to null\n mCheckerBoard.add(null);\n }\n else{\n //set top three row to black checkers\n mCheckerBoard.add(new Checker((i/2), false));\n }\n }\n\n }",
"@Override\n public void run()\n {\n while (game.gameBoard.tokens.size()>0)\n {\n game.gameBoard.drawPiece(this);\n }\n }",
"public void run() {\r\n\t\tcount = 270;\r\n\t\twhile(!gameOver()) {\r\n\t\t\tmoveGame();\r\n\t\t}\r\n\t\tif (laser != null)\r\n\t\t\tremove(laser);\r\n\t\tdisplayResults();\r\n\t}",
"public void newGame() {\n init();\n updateScoreBoard();\n Toast.makeText(getContext(), \"New Game started\", Toast.LENGTH_LONG).show();\n }",
"private void newGame(){\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n boardSquares[i][j].setBackground(Color.WHITE);\r\n boardRep[i][j] = 0;\r\n \r\n }\r\n }\r\n for (int i = 0; i < 7; i++) {\r\n currentFilled[i] = 0;\r\n moveSelect[i].setEnabled(true);\r\n }\r\n winnerText.setText(\"No Winner Yet\"); //clear winner text and 4s tracker\r\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 4; j++) {\r\n horizontal4s[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n vertical4s[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 4; j++) {\r\n diagonalTLBR4s[i][j] = 0;\r\n diagonalTRBL4s[i][j] = 0;\r\n }\r\n }\r\n }",
"void changepos(MouseEvent e, pieces chessPiece) \n { \n for(int beta : chessPiece.movnum)\n { \n if (chessPiece.color == 0 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allWhitePositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false;\n \n \n \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/\n }\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = false;\n }\n else if (chessPiece.color == 1 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allBlackPositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false; \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/}\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = true;\n }\n }//for ends\n \n }",
"public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }",
"ChessGame(ChessConnection player_one, ChessConnection player_two) {\n this.clients = new ChessConnection[2];\n this.error = false;\n\n this.clients[0] = player_one;\n this.clients[1] = player_two;\n this.board = new ChessBoard();\n this.board.initBoard();\n }",
"@Override\n public void loadGame() {\n\n }",
"@Override\n\tpublic void update(Game game) {\n\t\t\n\t}",
"void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }",
"private Game() {\n\t\tlabyrinth = Labyrinth.getInstance();\n\t\tplayer = Player.getInstance();\n\n\t\tcandies = new HashMap<>();\n\t\tenemies = new HashMap<>();\n\t\tbuttons = new HashMap<>();\n\n\t\tgenerateCandies();\n\t\tgenerateEnemies();\n\t\t//generateButtons();\n\n\t\tscore = Score.getInstance();\n\n\t\t//Put the door randomly.\n int coordX = ThreadLocalRandom.current().nextInt(0, 16);\n int coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tthis.door = Door.getInstance(coordX, coordY);\n\t}",
"protected Game getGame(){\n\t\treturn game;\n\t}",
"public void makesHereBack(){this.piece.affect();}",
"public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }",
"public void loadGame() {\n game.loadGame();\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}",
"public void newGame() {\n\n\n inGame = true;\n mines_left = mines+ePirate+mPirate+hPirate;\n\n all_cells = rows * cols;\n field = new int[all_cells];\n\n for (int i = 0; i < all_cells; i++)\n field[i] = COVER_FOR_CELL;\n\n statusbar.setText(Integer.toString(mines_left));\n\n // draw the board -- pass to the undo array\n drawBoard(mines) ; // now rocks\n drawBoard(ePirate) ;\n drawBoard(mPirate) ;\n drawBoard(hPirate) ;\n\n }",
"public GameManager(GraphicsContext gc){\n \n mouseClickSubs = new ArrayList<>();\n mouseMoveSubs = new ArrayList<>();\n discardPile = new ArrayList<>();\n winner = 0;\n\n // Init gameDrawer\n graphicsContext = gc;\n gameDrawer = new GameDrawer(this);\n \n // Init CurrentPlayer dan oppositePlayer\n currentPlayer = new Player(false);\n oppositePlayer = new Player(true);\n \n // Generate kartu dan masukin ke player yang bersangkutan, dan simpan ke drawListnya GameDrawer\n DataLoader dl = new DataLoader();\n try {\n dl.loadCards(currentPlayer, oppositePlayer);\n } catch (Exception e) {\n System.out.println(e.toString());\n // Data pada csv tidak valid, perlu restart...\n }\n if (currentPlayer.getPlayerDeck().size() > 60 || 40 > currentPlayer.getPlayerDeck().size()) {\n throw new Error(\"Player 1 has an invalid deck size. Decks need to have 40 to 60 cards.\");\n }\n if (oppositePlayer.getPlayerDeck().size() > 60 || 40 > oppositePlayer.getPlayerDeck().size()) {\n throw new Error(\"Player 2 has an invalid deck size. Decks need to have 40 to 60 cards.\");\n }\n\n for (Card card : currentPlayer.getPlayerDeck()) {\n gameDrawer.addToDrawList(card.getSprite());\n card.getSprite().changePos(55, 656, true);\n card.getSprite().changeScale(-0.32, 0.32, true);\n }\n for (Card card : oppositePlayer.getPlayerDeck()) {\n gameDrawer.addToDrawList(card.getSprite());\n card.getSprite().changePos(55, 64, true);\n card.getSprite().changeScale(-0.32, 0.32, true);\n }\n \n // Init exit button dan masukin spritenya ke drawlistnya gamedrawer\n // Masukin 7 kartu ke tangan kedua player\n for (int i = 0; i < 7; i++) {\n currentPlayer.addPlayerHands(currentPlayer.getCardFromDeck());\n }\n for (int i = 0; i < 7; i++) {\n oppositePlayer.addPlayerHands(oppositePlayer.getCardFromDeck());\n }\n\n // Init tombol endturn\n registerMouseClick(new EndButton(this));\n\n // Init state dengan draw phase\n gameState = new DrawPhase(this);\n gameState.startTurn();\n }",
"public GameHandler() {\n boardGraph = new BoardGraph();\n reset();\n }",
"public void startGame() {\n\n // Initialize both players\n players[0] = new Player(\"Paras\", true);\n players[1] = new Player(\"Computer\", false);\n\n // Initialize ChessBoard\n board = new ChessBoard(8);\n movesPlayed = new ArrayList<>();\n\n // Keep playing game until GameStatus is BLACK_WIN or WHITE_WIN\n while (true) {\n\n processTurn(players[0]);\n if (this.status == GameStatus.WHITE_WIN) {\n System.out.println(\"P1 win!\");\n break;\n }\n\n processTurn(players[1]);\n if (this.status == GameStatus.BLACK_WIN) {\n System.out.println(\"P2 win!\");\n break;\n }\n }\n\n }",
"@Override\r\n public int playGameLoop() {\r\n return 0;\r\n }",
"public Game2(Starter starter){\r\n chromaticManager = starter.chromaticManager;\r\n this.starter=starter;\r\n }",
"private void init() {\n\t\tpossibleFlips = new HashSet<Square>();\n\t\t\n\t\tfor (int i = 0; i < dimensions.x; ++i) {\n\t\t\tfor (int j = 0; j < dimensions.y; ++j) {\n\t\t\t\tboard[i][j] = new Square(Square.SquareType.Empty, i, j, this);\n\t\t\t}\n\t\t}\n\t\tswitch (boardType) {\n\t\tcase Tiny:\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 2, 2, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 3, 2, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 3, 3, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 2, 3, this));\n\t\t\tbreak;\n\t\tcase Standard:\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 3, 3, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 4, 3, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 4, 4, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 3, 4, this));\n\t\t\tbreak;\n\t\tcase Giant:\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 5, 5, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 6, 5, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Red, 6, 6, this));\n\t\t\tplacePiece(new Square(Square.SquareType.Black, 5, 6, this));\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tsetHighlightedSquare(0, 0);\n\t\t// Calculate possible moves with black to play\n\t\tCalculatePossibleMoves(true);\n\t}",
"public ChessPiece getPiece(){return piece;}",
"public void run() {\n GameBoard board = new GameBoard(nrows, ncols);\n\n\n }",
"@Override\r\n public boolean playTurn()\r\n {\n System.out.println(\"current bid = \" + currentBid);\r\n currentBid = players[currentPlayer].playHand(currentBid);\r\n\r\n System.out.println(\"Player bid = \" + currentBid);\r\n // Add hand played to discard pile\r\n discards.add(currentBid.getHand());\r\n // Offer all other players the chance to call cheat\r\n int callee = -1;\r\n {\r\n int[] calls = new int[MINPLAYERS];\r\n int i = 0;\r\n for (int j = 0; j < players.length; ++j)\r\n {\r\n // don't allow us to call cheat on ourselves\r\n if (currentPlayer == j)\r\n continue;\r\n Player p = players[j];\r\n if (p.callCheat(currentBid, currentPlayer))\r\n calls[i++] = j;\r\n }\r\n if (i > 0)\r\n callee = calls[rg.nextInt(i)];\r\n }\r\n\r\n if (callee != -1)\r\n {\r\n System.out.println(\"Player called cheat by Player \" + (callee+1));\r\n if (isCheat(currentBid)) //CHEAT CALLED CORRECTLY\r\n {\r\n for (Player p : players)\r\n p.broadcastCheat(currentPlayer, callee, true);\r\n //Give the discard pile of cards to currentPlayer who then has to play again\r\n players[currentPlayer].addHand(discards);\r\n System.out.println(\"Player cheats!\");\r\n System.out.println(\"Adding cards to player \"+\r\n (currentPlayer+1) + \" \" + players[currentPlayer]);\r\n }\r\n else //CHEAT CALLED INCORRECTLY\r\n {\r\n for (Player p : players)\r\n p.broadcastCheat(currentPlayer, callee, false);\r\n System.out.println(\"Player Honest\");\r\n currentPlayer = callee; // set the currentPlayer to callee\r\n // later on we'll increase this, so it's the person after\r\n // they who called's turn.\r\n players[currentPlayer].addHand(discards);\r\n System.out.println(\"Adding cards to player \"+\r\n (currentPlayer+1) + players[currentPlayer]);\r\n }\r\n //If cheat is called, current bid reset to an empty bid with rank two whatever\r\n //the outcome\r\n currentBid = new Bid();\r\n //Discards now reset to empty\r\n discards = new Hand();\r\n }\r\n else\r\n {\r\n System.out.println(\"No Cheat Called\");\r\n }\r\n /*\r\n Game bug fix:\r\n The design of the game, as given, was floored in conjuction with\r\n the required implementations of the strategies.\r\n A scenario can arise where one player has all the twos and the other\r\n has none, but it's their turn to play.\r\n The player with all the twos can consitently correctly call cheat on the\r\n player, as they have to claim to of laid a 2.\r\n\r\n This is easily fixed by moving the turn to the player after the one who\r\n just got called out\r\n */\r\n currentPlayer = (currentPlayer+1) % nosPlayers;\r\n return true;\r\n }",
"public Game(Boolean newGame) throws IOException, InterruptedException {\n if (newGame)\n\n { market = new Market();\n reserve = new Reserve();\n\n productionCardDecks = new ArrayList<>();\n\n deckProductionCardOneBlu = new DeckProductionCardOneBlu();\n deckProductionCardTwoBlu = new DeckProductionCardTwoBlu();\n deckProductionCardThreeBlu = new DeckProductionCardThreeBlu();\n\n deckProductionCardOneGreen = new DeckProductionCardOneGreen();\n deckProductionCardTwoGreen = new DeckProductionCardTwoGreen();\n deckProductionCardThreeGreen = new DeckProductionCardThreeGreen();\n\n deckProductionCardOneViolet = new DeckProductionCardOneViolet();\n deckProductionCardTwoViolet = new DeckProductionCardTwoViolet();\n deckProductionCardThreeViolet = new DeckProductionCardThreeViolet();\n\n deckProductionCardOneYellow = new DeckProductionCardOneYellow();\n deckProductionCardTwoYellow = new DeckProductionCardTwoYellow();\n deckProductionCardThreeYellow = new DeckProductionCardThreeYellow();\n\n\n productionCardDecks.add(deckProductionCardOneBlu);\n productionCardDecks.add(deckProductionCardTwoBlu);\n productionCardDecks.add(deckProductionCardThreeBlu);\n productionCardDecks.add(deckProductionCardOneGreen);\n productionCardDecks.add(deckProductionCardTwoGreen);\n productionCardDecks.add(deckProductionCardThreeGreen);\n productionCardDecks.add(deckProductionCardOneViolet);\n productionCardDecks.add(deckProductionCardTwoViolet);\n productionCardDecks.add(deckProductionCardThreeViolet);\n productionCardDecks.add(deckProductionCardOneYellow);\n productionCardDecks.add(deckProductionCardTwoYellow);\n productionCardDecks.add(deckProductionCardThreeYellow);\n\n deckLeaderCard= new DeckLeaderCard();}\n else {\n restoreGame();\n }\n this.isOver=false;\n\n }",
"@Override\n\tpublic void run() {\n\t\t\n\t\twhile(isItOk==true){\n\t\t\t\n\t\t\tif(!holder.getSurface().isValid())\n\t\t\t\tcontinue;\n\t\t\tfor(i=0;i<increment;i++)\n\t\t\t\t{draw(pos);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tpos++;\n if(pos==17)\n pos=1;}\n\t\t\t\t\n\t\t\tfor( i=0;i<15;i++)\n\t\t\t\t{\n\t\t\t\tdraw(pos);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(200);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tdraw(0);\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\tif(pos%4==1)\n\t\t\tpuzzleNo=1;\n\t\telse if(pos%4==2)\n\t\t\tpuzzleNo=2;\n\t\telse if(pos%4==3)\n\t\t\tpuzzleNo=3;\n\t\telse if(pos%4==0)\n\t\t\tpuzzleNo=4;\n\t\t\n\t\t\t\n\t\t\tIntent myIntent = new Intent(Levelintro.this,Game.class);\n\t\t\tmyIntent.putExtra(\"puzzleNo\", puzzleNo);\n\t\t\tstartActivity(myIntent);\n\t\t \n\t\t}\n\t\t\t/*try {\n\t\t\t\tThread.sleep(time);\n\t\t\t\t\n\t\t\tcnt++;\n\t\t\t\t\n\t\t\t\tif(time==50)\n\t\t\t\t\ttime=1400;\n\t\t\t\tif(cnt==1)\n\t\t\t\t\t{time=time-20;\n\t\t\t\t\tcnt=0;}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif(Math.abs(x1-x)<80 && Math.abs(y- y1)<80)\n\t\t\t\tscore++;\n\t\t\telse\n\t\t\t\t{ \n\t\t\t\t\tMAX=score;\n\t\t\t\t\tscore=0;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(200);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tBundle b = new Bundle();\n\t\t\t\tb.putString(\"score\", MAX+\"\");\n\t\t\t\tIntent i = new Intent(Surfaces.this,GameOver.class);\n\t\t\t\ti.putExtras(b);\n\t\t\t\tstartActivity(i);\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t*/\n\t\t\n\t}",
"public void newGame() {\n gameString = playerPlays = computerPlays = \"\";\n pScore = cScore = 0;\n setLabels();\n }",
"public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }",
"public void mousePressed(MouseEvent e){\r\n\t //reset the label\r\n\t if(isBlack) label.setText(\"\t\tWhite's Turn\");\r\n\t else label.setText(\"\t\tBlack's Turn\");\r\n\t \r\n //Do nothing when game is over\r\n if(gameOver) return;\r\n \r\n String colorName=isBlack?\"Black\":\"White\";\r\n\r\n //Convert coordinate to index \r\n xIndex=(e.getX()-MARGIN+GRID_SPAN/2)/GRID_SPAN;\r\n yIndex=(e.getY()-MARGIN+GRID_SPAN/2)/GRID_SPAN;\r\n\r\n //Do nothing when outside the board\r\n if(xIndex<0||xIndex>ROWS||yIndex<0||yIndex>COLS)\r\n return;\r\n\r\n //Do nothing when current position already occupied\r\n if(findChess(xIndex,yIndex))return;\r\n\r\n //if valid, Draw a new chess at current position and add index to the chessList \r\n Point ch=new Point(xIndex,yIndex,isBlack?Color.black:Color.white);\r\n chessList[chessCount++]=ch;\r\n repaint();//run paintComponent\r\n\r\n\r\n //if someone wins, give a message\r\n if(isWin()){\r\n String msg=String.format(\"Congratulations��%s won��\", colorName); \r\n JOptionPane.showMessageDialog(this, msg);\r\n gameOver=true;\r\n }\r\n isBlack=!isBlack;\r\n }",
"private void gameOver() {\n\t\tgameOver=true;\n\t}",
"public void setGame() {\n }",
"@Override\n public void resetGame() {\n\n }",
"public abstract void process(final King pKing, final Piece pPiece, final Chess pChess);",
"public void newGame()\n\t{\n\t\tplanet.setLevel(0);\n\t\tship.resetScore();\n\t\tstopThreads();\n\t\tplanet = new Planet(750,600);\n\t\tship = new Ship(20.0,750,600,planet);\n\t\tbuttonPanel.update(ship,planet);\n\t\tgamePanel.update(ship,planet);\n\n\t\trestartThreads();\n\t}",
"@Override\n public void newGame(ICrossingStrategy gameStrategy) {\n\n }"
] | [
"0.67132986",
"0.6514451",
"0.6510284",
"0.637662",
"0.6289097",
"0.626308",
"0.62438786",
"0.6226732",
"0.621936",
"0.621515",
"0.6172738",
"0.6171729",
"0.61497235",
"0.6136117",
"0.61331105",
"0.61271316",
"0.61121356",
"0.61063415",
"0.6102375",
"0.6095273",
"0.60940635",
"0.60720074",
"0.6070324",
"0.6067951",
"0.6016366",
"0.600625",
"0.60059",
"0.5989971",
"0.59869754",
"0.59838766",
"0.5983391",
"0.5976349",
"0.5971994",
"0.59587646",
"0.5946789",
"0.5910524",
"0.59069824",
"0.5905165",
"0.58976734",
"0.58851105",
"0.58755153",
"0.58708555",
"0.5858711",
"0.5856948",
"0.5849358",
"0.58454174",
"0.58449525",
"0.5844286",
"0.5841549",
"0.58391595",
"0.58374745",
"0.5830917",
"0.5829939",
"0.5815849",
"0.5808419",
"0.5789992",
"0.5779357",
"0.5778984",
"0.57786053",
"0.577669",
"0.57720387",
"0.57627547",
"0.57594514",
"0.57528085",
"0.5748344",
"0.57426715",
"0.57421637",
"0.57400846",
"0.5738498",
"0.5736176",
"0.57346624",
"0.5732646",
"0.57318664",
"0.57300335",
"0.5727646",
"0.5723471",
"0.5718741",
"0.5716865",
"0.5700166",
"0.5699687",
"0.5696539",
"0.5695743",
"0.56949157",
"0.56901294",
"0.56893146",
"0.5687426",
"0.5685203",
"0.5684317",
"0.568229",
"0.56807524",
"0.5680691",
"0.56767434",
"0.5676283",
"0.5675874",
"0.5672472",
"0.5672421",
"0.5671146",
"0.5670638",
"0.56649315",
"0.566284",
"0.5661425"
] | 0.0 | -1 |
evaluate current game state according to nega max algorithm | private int negaMax(int depth, String indent) {
if (depth <= 0
|| this.chessGame.getGameState() == ChessGame.GAME_STATE_END_WHITE_WON
|| this.chessGame.getGameState() == ChessGame.GAME_STATE_END_BLACK_WON){
return evaluateState();
}
List<Move> moves = generateMoves(false);
int currentMax = Integer.MIN_VALUE;
for(Move currentMove : moves){
executeMove(currentMove);
//ChessConsole.printCurrentGameState(this.chessGame);
int score = -1 * negaMax(depth - 1, indent+" ");
//System.out.println(indent+"handling move: "+currentMove+" : "+score);
undoMove(currentMove);
if( score > currentMax){
currentMax = score;
}
}
//System.out.println(indent+"max: "+currentMax);
return currentMax;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private double evaluate() {\n // check for draws first, most lickely\n if (board.gameState() == MNKGameState.DRAW) return 0;\n else if (board.gameState() == MY_WIN) return 2 * M * N; // 2 times max depth\n else if (board.gameState() == ENEMY_WIN) return -2 * M * N;\n else {\n evaluated++;\n // keep the heuristic evaluation between 1 and -1\n return board.value();\n }\n }",
"private static int evalState(GameState state){\n Move m = state.getMove();\n int counter = 0;\n\n // return directly if we encouter win or loss\n if(m.isXWin()){\n return 10000;\n }\n else if(m.isOWin()){\n return -1;\n }\n\n Vector<Integer> points = new Vector<Integer>();\n points.setSize(state.BOARD_SIZE*2+2);\n int player;\n Collections.fill(points, 1);\n int scaling = 4;\n int value = 0;\n\n for(int row = 0; row < state.BOARD_SIZE; row ++){\n for(int col = 0; col < state.BOARD_SIZE; col ++){\n player = state.at(row, col);\n\n // add points to the vector, increase by a factor for every new entry\n if(player == 1){\n points.set(row, points.get(row)*scaling);\n points.add(state.BOARD_SIZE + col, points.get(state.BOARD_SIZE - 1 + col)*scaling);\n\n // if it's in the first diagonal\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, points.get(state.BOARD_SIZE*2)*scaling);\n }\n\n // checking other diagonal\n if(counter%state.BOARD_SIZE-1 == 0 && row+col != 0){\n points.add(state.BOARD_SIZE*2 + 1, points.get(state.BOARD_SIZE*2)*scaling);\n }\n }\n // if an enemy player is encoutered null the value of the row/col\n else if(player == 2){\n points.set(row, 0);\n points.set(state.BOARD_SIZE + col, 0);\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, 0);\n }\n if(counter%state.BOARD_SIZE-1 == 0){\n points.add(state.BOARD_SIZE*2 + 1, 0);\n }\n }\n counter++;\n }\n }\n\n // if we have nulled the point we don't count it for the value of the state\n for(Integer i: points){\n if(i > 1){\n value += i;\n }\n }\n //System.err.println(\"Value: \" + value);\n return value;\n }",
"@Override\r\n\tpublic double max_value(GameState s, int depthLimit) \r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn stateEvaluationValue;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMax = Double.NEGATIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.bestMove = -1;\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tdouble tempMax = currMax;\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 1; //assign it to player 1\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMax = Math.max(currMax, min_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (tempMax < currMax)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\t\t\t\r\n\t\t\treturn currMax;\r\n\t\t}\r\n\r\n\r\n\t}",
"private int maxValue(Node state, int alpha, int beta) {\n\t\t\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, false);\n\t\t}\n\t\t\n\t\tint v = Integer.MIN_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\t\t\t\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\tint value = this.minValue(state.result(move), alpha, beta);\n\t\t\tif (v < value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\t\n\t\t\tif (v >= beta) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\t\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\talpha = Math.max(v, alpha);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}",
"@Override\n\tpublic double stateEvaluator(GameState s)\n\t{\r\n\t\tint count = 0;\n\t\tif (s.takenList[1] == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse if(s.lastMove == 1)\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length ; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.5;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (isPrime(s.lastMove))\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0 && i % s.lastMove == 0) // i = 4, % 2\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.7;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn 0.7;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tint largestPrime = 2;\r\n\t\t\tfor (int i = 2; i < (s.lastMove/2); i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.lastMove % i == 0 && isPrime(i))\r\n\t\t\t\t{\r\n\t\t\t\t\tlargestPrime = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = largestPrime; i <= s.lastMove; i+= largestPrime)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.6;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.6;\r\n\t\t\t}\r\n\r\n\t\t}\n\t}",
"private Move alphaBetaSearch(Node state) {\n\t\t\n\t\tint v = this.maxValue(state, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t\t\n\t\tthis.nodesExplored--;\n\t\tthis.nodesExploredThisTurn--;\n\t\t\n\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\treturn this.bestMoveSoFar;\n\t\t}\n\n\t\tif (Math.abs(v) == Integer.MAX_VALUE / 2 || Math.abs(v) == Math.abs(Integer.MIN_VALUE / 2) ) {\n\t\t\t\n\t\t\tthis.isEndGameStatusFound = true;\n\t\t\treturn state.getBestMove();\n\t\t}\n\t\t\n\t\treturn state.getBestMove();\n\t}",
"private int alphaBetaMinimax (GameTreeNode node, int alpha, int beta, boolean isMax, Map<GameTreeNode, Integer> visited) {\n\n if(node.remaining == 0) {\n //System.out.println(\"Terminal State: Up : Score \" + node.score);\n return node.score;\n }\n if(visited.containsKey(node)) {\n //System.out.println(\"Memoized State: Up : Score \" + visited.get(node));\n return visited.get(node);\n }\n \n \n if(isMax) {\n int minimaxScore = Integer.MIN_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n \n if(expandingChild == null) {\n break;\n }\n \n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.max(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, false, visited));\n alpha = Math.max(alpha, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n else {\n int minimaxScore = Integer.MAX_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n if(expandingChild == null) {\n break;\n }\n //\n \n //\n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.min(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, true, visited));\n beta = Math.min(beta, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n }",
"private double evalState(LabyrinthGameState state) {\n double score = 0;\n\n //Assign Percentages of Score\n final double treasureValTotal = 80; //Based on number of treasures left\n final double nearTreasureValTotal = 15; //Based on proximity to treasure\n final double typeTileValTotal = 1; //Based on which tile you are on\n final double numberOfConnectionsValTotal = 4; //Based on how many places you can move\n\n double treasureVal = 0;\n double nearTreasureVal = 0;\n double typeTileVal = 0;\n double numberOfConnectionsVal = 0;\n\n //calculating your treasure points\n treasureVal = (6.0 - (double)(state.getPlayerDeckSize(\n Player.values()[playerNum])))/6.0*treasureValTotal;\n\n int [] yourPos = state.getPlayerLoc(Player.values()[playerNum]).getLoc();\n int [] treasurePos = state.findTreasureLoc(Player.values()[playerNum]);\n if (treasurePos[0] == -1) {\n nearTreasureVal = (10.0 - findDistance(yourPos, findHome()))\n / 10.0 * nearTreasureValTotal;\n } else {\n nearTreasureVal = (10.0 - findDistance(yourPos, treasurePos))\n / 10.0 * nearTreasureValTotal;\n }\n\n //calculating points for the type of tile it can end on\n switch (state.getPlayerLoc(Player.values()[playerNum]).getType()) {\n case STRAIGHT:\n typeTileVal = 5.0 / 10.0 * typeTileValTotal;\n break;\n case INTERSECTION:\n typeTileVal = typeTileValTotal;\n break;\n default:\n typeTileVal = 3.0 / 10.0 * typeTileValTotal;\n break;\n }\n\n //calculating points based on # of connections created\n numberOfConnectionsVal = ((double)generatePossibleMoveActions(state).size()\n /49.0*numberOfConnectionsValTotal);\n\n //calculating final score\n score = (treasureVal + nearTreasureVal +\n typeTileVal + numberOfConnectionsVal)/100.0;\n\n return score;\n }",
"private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}",
"private int evaluate(boolean maximizing) {\n int selfEval = getCountOfStonesFor(this);\n selfEval += countOfMills(this) * 5;\n selfEval += countOfPossibleMills(this) * 15;\n\n int opponentEval = getCountOfStonesFor(opponent);\n opponentEval += countOfMills(opponent) * 5;\n opponentEval += countOfPossibleMills(opponent) * 15;\n\n return (selfEval - opponentEval) * (maximizing ? 1 : -1);\n }",
"private int evaluateState() {\r\n\r\n\t\t// add up score\r\n\t\t//\r\n\t\tint scoreWhite = 0;\r\n\t\tint scoreBlack = 0;\r\n\t\tfor (Piece piece : this.chessGame.getPieces()) {\r\n\t\t\tif(piece.getColor() == Piece.COLOR_BLACK){\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else if( piece.getColor() == Piece.COLOR_WHITE){\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else{\r\n\t\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\t\"unknown piece color found: \"+piece.getColor());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// return evaluation result depending on who's turn it is\r\n\t\tint gameState = this.chessGame.getGameState();\r\n\t\t\r\n\t\tif( gameState == ChessGame.GAME_STATE_BLACK){\r\n\t\t\treturn scoreBlack - scoreWhite;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_WHITE){\r\n\t\t\treturn scoreWhite - scoreBlack;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_END_WHITE_WON\r\n\t\t\t\t|| gameState == ChessGame.GAME_STATE_END_BLACK_WON){\r\n\t\t\treturn Integer.MIN_VALUE + 1;\r\n\t\t\r\n\t\t}else{\r\n\t\t\tthrow new IllegalStateException(\"unknown game state: \"+gameState);\r\n\t\t}\r\n\t}",
"public interface MiniMaxState extends State {\r\n\t/**\r\n\t * Determine if this state is a state in which MAX acts (we, as opposed to\r\n\t * the opponent that we have no control over).\r\n\t * \r\n\t * @return true if MAX acts, false if opponent acts\r\n\t */\r\n\tpublic boolean isMaxState();\r\n\r\n\t/**\r\n\t * Determine the \"utility\" of the state, is usually called when a\r\n\t * terminating state is visited. Should be a positive value (not exceeding\r\n\t * +9999999) if we're doing well, a negative value (not below -9999999) if\r\n\t * we're doing badly.\r\n\t * \r\n\t * @return the utility of the state\r\n\t */\r\n\tpublic double utility();\r\n\r\n}",
"public boolean isMaxState();",
"protected abstract int evaluate(GameState state, String playername);",
"public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }",
"public int minimax(TablutBoardState boardState, boolean isMax, int depth, int alpha, int beta) {\n\t\tif (boardState.gameOver()){\n\t\t\t//System.out.println(\"reach endgame in minimax\");\n\t\t\tif (boardState.getWinner() == boardState.MUSCOVITE) {\n\t return 1000;\n\t }else if (boardState.getWinner()==boardState.SWEDE){\n\t \treturn -1000;\n\t }else{\n\t \treturn 0;\n\t }\n\t\t}\n\t\tif (depth == 0){\n\t\t\t//System.out.println(\"reach bottom in minimax\");\n return heuristic(boardState);\n }\n\t\t//int bestValue;\n\n\t\tif(isMax){\n\t\t\tint bestValue = Integer.MIN_VALUE;\n\t\t\tHashMap<Integer,TablutMove> moveScore = new HashMap<>();\n\t\t\tfor(TablutMove move : boardState.getAllLegalMoves()){\n\t\t\t\tTablutBoardState cloneBS = (TablutBoardState) boardState.clone();\n\t\t\t\tcloneBS.processMove(move);\n\t\t\t\tint val = minimax(cloneBS,false,depth-1,alpha,beta);\n\t\t\t\tmoveScore.put(new Integer(val),move); \n\t\t\t\tbestValue = max(bestValue,val);\n\t\t\t\talpha = max(alpha,bestValue);\n\t\t\t\t//System.out.println(\"alpha: \"+alpha+\", beta: \"+beta);\n\t\t\t\tif (beta <= alpha){\n\t\t\t\t\t//System.out.println(\"prunning: alpha: \"+alpha+\" and beta: \"+beta);\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tInteger index= Collections.max(moveScore.keySet());\n\t\t\tif(depth == DEPTH){\n\t\t\t\t//System.out.println(\"update move from max\");\n\t\t\t\tbestMove = moveScore.get(index);\n\t\t\t}\n\t\t\t\n moveScore = null;\n\t\t\treturn bestValue;\n\t\t\t\n\t\t}else{\n\t\t\tint bestValue = Integer.MAX_VALUE;\n\t\t\tHashMap<Integer,TablutMove> moveScore = new HashMap<>();\n\t\t\tfor(TablutMove move : boardState.getAllLegalMoves()){\n\t\t\t\tTablutBoardState cloneBS = (TablutBoardState) boardState.clone();\n\t\t\t\tcloneBS.processMove(move);\n\t\t\t\tint val = minimax(cloneBS,true,depth-1,alpha,beta);\n\t\t\t\tmoveScore.put(new Integer(val),move); \n\t\t\t\tbestValue = min(bestValue,val);\n\t\t\t\tbeta = min(beta,bestValue);\n\t\t\t\t//System.out.println(\"alpha: \"+alpha+\", beta: \"+beta);\n\t\t\t\tif(beta<= alpha){\n\t\t\t\t\t//System.out.println(\"prunning: alpha: \"+alpha+\" and beta: \"+beta);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tInteger index= Collections.min(moveScore.keySet());\n\t\t\tif(depth == DEPTH){\n\t\t\t\t//System.out.println(\"update move from min\");\n\t\t\t\tbestMove = moveScore.get(index);\n\t\t\t}\n moveScore = null;\n\t\t\treturn bestValue;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//return 0;\n\t}",
"public void evaluate()\r\n {\r\n\tdouble max = ff.evaluate(chromos.get(0),generation());\r\n\tdouble min = max;\r\n\tdouble sum = 0;\r\n\tint max_i = 0;\r\n\tint min_i = 0;\r\n\r\n\tdouble temp = 0;\r\n\r\n\tfor(int i = 0; i < chromos.size(); i++)\r\n\t {\r\n\t\ttemp = ff.evaluate(chromos.get(i),generation());\r\n\t\tif(temp > max)\r\n\t\t {\r\n\t\t\tmax = temp;\r\n\t\t\tmax_i = i;\r\n\t\t }\r\n\r\n\t\tif(temp < min)\r\n\t\t {\r\n\t\t\tmin = temp;\r\n\t\t\tmin_i = i;\r\n\t\t }\r\n\t\tsum += temp;\r\n\t }\r\n\r\n\tbestFitness = max;\r\n\taverageFitness = sum/chromos.size();\r\n\tworstFitness = min;\r\n\tbestChromoIndex = max_i;;\r\n\tworstChromoIndex = min_i;\r\n\tbestChromo = chromos.get(max_i);\r\n\tworstChromo = chromos.get(min_i);\r\n\t\r\n\tevaluated = true;\r\n }",
"public static int run(State curr_state, char player) {\n\t\tint result = 0;\r\n\t\t//Calls the max_value part because dark plays first, wants max value\r\n\t\tif(player == '1'){\r\n\t\t\t//Returns number of times the max function runs\r\n\t\t\tresult = max_value(curr_state);\r\n\t\t}\r\n\t\t//Start at min, as light's turn, and it wants min value and\r\n\t\t//therefore subsequently will call min_value nd return\r\n\t\telse if(player == '2'){\r\n\t\t\tresult = min_value(curr_state);\t\r\n\t\t}\r\n\t\t//Return the number of states , i.e., minCounter + max Counter\r\n\t\t//Return minCounter + maxCounter;\r\n\t\treturn result;\r\n\t}",
"private List<Double> MinimaxAlgorithm(MinimaxNode<GameState> node, int dataCount){\n if(node.getNumberOfChildren() == 0){ //checks to see if terminal node\n List<Double> heuristics = new ArrayList();\n heuristics.addAll(calculateHeuristic(node.getState()));\n return heuristics;\n }\n else{ //will maximise all the scores for each player.\n double value = Double.NEGATIVE_INFINITY;\n double checkValue;\n int bestMove;\n List<Double> heuristics = new ArrayList();\n if(node.getIfChanceNode()){ //checks if current node is a chance node, if so, times \n for (int i = 0; i < node.getChildren().size(); i++){\n List<Double> tempHeuristics = new ArrayList();\n tempHeuristics.addAll(MinimaxAlgorithm(node.getChildren().get(i),dataCount+1));\n checkValue = node.getChildren().get(i).getProbability() * tempHeuristics.get(node.getNodeIndex());\n value = Math.max(value, checkValue);//maximises the score.\n if(checkValue == value){\n heuristics.addAll(tempHeuristics); \n }\n if(dataCount == 0){//checks if this is the root node\n if(checkValue == value){\n MinimaxPlayer.optimalMoves = node.getChildren().get(i).getState().getOrientation(node.getNodeIndex()); \n }\n } \n }\n }\n else{\n for (int i = 0; i < node.getChildren().size(); i++){\n List<Double> tempHeuristics = new ArrayList();\n tempHeuristics.addAll(MinimaxAlgorithm(node.getChildren().get(i),dataCount+1));\n checkValue = tempHeuristics.get(node.getNodeIndex());\n value = Math.max(value, checkValue);//maximises the score.\n if(checkValue == value){\n heuristics.addAll(tempHeuristics); \n }\n if(dataCount == 0){//checks if this is the root node\n if(checkValue == value){\n MinimaxPlayer.optimalMoves = node.getChildren().get(i).getState().getOrientation(node.getNodeIndex()); \n }\n } \n } \n }\n return heuristics;\n } \n }",
"public int eval()\n\t\t{\n\t\t\tif (p[BLACK]==0) return MAX+1;\t//black=0 then white win then return max\n\t\t\tif (p[WHITE]==0) return MIN-1;\t//white=0 then black win then return min\n\t\t\tint bl=getNumberOne(p[0]);int wh=getNumberOne(p[1]);\n\t\t\treturn wh-bl;\n\t\t}",
"@Override\n public void postRound() {\n super.postRound();\n Integer res = 0;\n if(this.algorithm_choosed!=-1){\n switch(this.algorithm_choosed) {\n case 1:\n if((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.first_Algorithm){\n this.first_Algorithm = true;\n Tools.appendToOutput(\"Algorithm1 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm1 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 2:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.second_Algorithm) {\n this.second_Algorithm = true;\n Tools.appendToOutput(\"Algorithm2 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm2 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 3:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.third_Algorithm) {\n this.third_Algorithm = true;\n Tools.appendToOutput(\"Algorithm3 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3 find this size of max matching \"+res+\"\\n\");\n this.tempFourth = res;\n }\n break;\n case 4:\n if(!this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1) {\n Integer c = 0;\n this.fourth_algorithm = true;\n Tools.appendToOutput(\"Maximal converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Maximal matching size is = \"+res+\"\\n\");\n //log.logln(\"Try to find the optimum!!!\");\n for (Iterator<Node> it = Tools.getNodeList().iterator(); it.hasNext();) {\n MS4Node node = (MS4Node) it.next();\n if(node.isMarried()){\n c+=1;\n }\n node.setFindTheOptimum();\n node.end_flag = false;\n }\n this.printTheMarriages();\n //log.logln(\"Total number of nodes married = \"+c);\n this.tempFourth = res;\n }\n if(this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1 && !this.approximazion_alg){\n Tools.appendToOutput(\"RES ---->\"+res+\"\\n\");\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isSecondMatchDone()){\n //Tools.appendToOutput(\"**NODE with a success in MATCH SECOND ==\"+node.ID+\" \\n\");\n node.setColorToEdgeAndNodes(Color.BLACK, Tools.getNodeByID(node.pointingNode));\n Tools.getNodeByID(node.pointingNode).setColor(node.defaultColor);\n node.setColorToEdgeAndNodes(Color.MAGENTA, Tools.getNodeByID(node.getP_v()));\n ((MS4Node)Tools.getNodeByID(node.getP_v())).isMarried = true;\n MS4Node married = (MS4Node)Tools.getNodeByID(node.getPointingNode());\n married.setColorToEdgeAndNodes(Color.MAGENTA,Tools.getNodeByID(married.getP_v()));\n ((MS4Node)Tools.getNodeByID(married.getP_v())).isMarried = true;\n }\n }\n Integer newRes = checkingIfAllNodesHasFinished();\n Tools.appendToOutput(\"Approx algorithm converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"New Maximal matching size is = \"+newRes+\" so improved by \"+(newRes-tempFourth)+\"\\n\");\n //log.logln(\"--------------------APPROX RESULT-----------------------------\");\n Integer count = 0;\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isMarried()) {\n count++;\n }\n }\n this.printTheMarriages();\n //log.logln(\"----------------NUMBER OF MARRIED : \"+count+\"-----------------------------\");\n this.approximazion_alg = true;\n break;\n }\n case 5:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.fifth_algorithm) {\n this.fifth_algorithm = true;\n Tools.appendToOutput(\"Algorithm3_probabilistic converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3_probabilistic find this size of max matching \" + res + \"\\n\");\n }\n\n }\n }\n }",
"private int gameState() {\n\t\t\n\t\tint gameNotOver = 0;\n\t\tint gameOverWinnerX = 1;\n\t\tint gameOverWinnerO = 2;\n\t\tint gameOverTie = 3;\n\t\t\n\t\t\n\t\t\n\t\t//Win Vertically \n\t\t// 0 3 6 , 1 4 7 , 2 5 8\n\t\t\t\t\n\t\t//Win Horizontally\n\t\t//0 1 2 , 3 4 5 , 6 7 8 \n\t\t\t\t\n\t\t//Win Diagonally\n\t\t// 0 4 8 , 2 4 6\n\t\t\t\t\n\t\t//Assuming it's an equal grid\n\t\t\t\t\n\t\tMark winningMark = null;\n\t\t\t\t\n\t\tboolean hasFoundWinner = false;\n\t\t\t\t\n\t\tint row = 0;\n\t\tint column = 0;\n\t\t\t\t\n\t\t//Horizontal Winner Test\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[ROW_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\twhile (column < COLUMN_COUNT) {\n\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\tcolumn ++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tcolumn = 0;\n\t\t\trow++;\t\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// Vertical Winner Test\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = 0;\n\n\t\twhile (!hasFoundWinner && column < COLUMN_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[ROW_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\trow = 0;\n\t\t\tcolumn++;\t\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//Diagonal Winner Test \"\\\"\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[COLUMN_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\t\t\t\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tcolumn++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//Diagonal Test \"/\"\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = COLUMN_COUNT - 1;\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[COLUMN_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\t\t\t\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tcolumn--;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If there are no moves left, and there is no winner, game ends inn a tie \n\t\t\n\t\tboolean foundNoMove = false;\n\t\tfor (int i = 0; i < movesArray.length; i++) {\n\t\t\tif (movesArray[i] == NO_MOVE) {\n\t\t\t\tfoundNoMove = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!foundNoMove && !hasFoundWinner) {\n\t\t\treturn gameOverTie;\n\t\t}\n\t\t\n\t\t// If there is no winner and there are still moves left, game is not over\n\t\t\n\t\treturn gameNotOver;\n\t\t\n\t}",
"public static void main(String[] args) {\n\n\n\n\n\n ModelInterface model = new GameField(6, 7);\n Token blue = Token.BLUE;\n Token red = Token.RED;\n\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, blue);\n model.setFieldStatus(2, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, red);\n model.setFieldStatus(2, red);\n\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n \n List<IRatingMechanism> ratingMechanisms = new ArrayList<IRatingMechanism>();\n ratingMechanisms.add(new MWin());\n ratingMechanisms.add(new MWinNot());\n// ratingMechanisms.add(new MGeneralPosition());\n// ratingMechanisms.add(new MTwoStonesWithSpaceChecking());\n// ratingMechanisms.add(new MCatch22());\n\n Tree tree = new Tree(model, ratingMechanisms, blue);\n System.out.println(tree.toString());\n\n MiniMaxAlgorithm instance = new MiniMaxAlgorithm();\n int result = instance.getBestMove(model, ratingMechanisms, blue);\n System.out.println(\"\" + result);\n\n\n\n\n\n }",
"@Override\n public A makeDecision(S state) {\n metrics = new Metrics();\n StringBuffer logText = null;\n P player = game.getPlayer(state);\n List<A> results = orderActions(state, game.getActions(state), player, 0);\n timer.start();\n currDepthLimit = 0;\n do {\n incrementDepthLimit();\n if (logEnabled)\n logText = new StringBuffer(\"depth \" + currDepthLimit + \": \");\n heuristicEvaluationUsed = false;\n ActionStore<A> newResults = new ActionStore<>();\n for (A action : results) {\n double value = minValue(game.getResult(state, action), player, Double.NEGATIVE_INFINITY,\n Double.POSITIVE_INFINITY, 1);\n if (timer.timeOutOccurred())\n break; // exit from action loop\n newResults.add(action, value);\n if (logEnabled)\n logText.append(action).append(\"->\").append(value).append(\" \");\n }\n if (logEnabled)\n System.out.println(logText);\n if (newResults.size() > 0) {\n results = newResults.actions;\n if (!timer.timeOutOccurred()) {\n if (hasSafeWinner(newResults.utilValues.get(0)))\n break; // exit from iterative deepening loop\n else if (newResults.size() > 1\n && isSignificantlyBetter(newResults.utilValues.get(0), newResults.utilValues.get(1)))\n break; // exit from iterative deepening loop\n }\n }\n } while (!timer.timeOutOccurred() && heuristicEvaluationUsed);\n return results.get(0);\n }",
"final Value getValue(int maxDepth){\n\t\t\n\t\t//if this state is at the max depth return the value of this state\n\t\tif(maxDepth == depth)\n\t\t\treturn evaluateState();\n\t\t\n\t\t//if not - must continue expanding tree\n\t\t\n\t\tAction[] possibleActions = this.getPossibleActions();\n\t\t\n\t\t//get the value of the the child states and return the best choice\n\t\t//depending on which player's turn it is.\n\t\tState[] children = expand(possibleActions);\n\t\t\n\t\t//if there are no sub-states, then this is an end state\n\t\tif(children==null || children.length==0)\n\t\t\treturn evaluateState();\n\t\t\n\t\t//set the depth of the children to one more than the depth of this state\n\t\tfor(State s : children)\n\t\t\ts.setDepth(this.depth+1);\n\t\t\n\t\t//get an array of values from the array of children\n\t\tValue[] values = new Value[children.length];\n\t\tfor(int i = 0; i<children.length; i++)\n\t\t\tvalues[i] = children[i].getValue(maxDepth);\n\t\t\n\t\t\n\t\t//get the index of the player that will take an action from this state\n\t\tint turn = this.getTurn();\n\t\t\n\t\t/* If a player will take an action from this state:\n\t\t * \n\t\t * find the value of the child states that is best\n\t\t * for the player who will take make the move from this state \n\t\t */\n\t\tif(turn >= 0)\n\t\t\treturn values[Value.getBestValueIndex(values, turn)];\n\t\t\n\t\t/* If a random action will take place from this state:\n\t\t * \n\t\t * Calculate the value of this state based on the probability\n\t\t * of each sub-state\n\t\t */\n\t\t\n\t\t//weight each value\n\t\tfor(int i = 0; i<values.length; i++)\n\t\t\tvalues[i].weight(possibleActions[i].getProbability());\n\t\t\n\t\t//return the sum of all the weighted values of all the sub-states\n\t\treturn new Value(values);\n\t\t\n\t}",
"public int evaluate() {\n\t\treturn history + heuristic;\n\t}",
"private int[] maxValue(int[][] currentState, int[] alpha, int[] beta, int depth) {\n int[] bestMove = new int[]{MinimaxUtilties.freeCentralColumn(currentState), Integer.MIN_VALUE, 0};\n\n if (terminalTest(currentState) != 0) {\n return new int[]{0, utility(currentState), maxDepth - depth};\n }\n\n if (depth < 1){\n return new int[]{0, utility(currentState), maxDepth};\n }\n\n if (terminalTest(currentState) == 0 && depth > 0) {\n // find all possible actions for this player from the current game state\n ArrayList<Integer> possibleActions = actions(currentState, 1);\n\n // check if each possible action is better than the best action so far\n for (int i = 0; i < possibleActions.size(); i++) {\n int column = possibleActions.get(i);\n int[][] resultOfAction = result(currentState, column, 1);\n\n // returns [column that was chosen, utility of choosing it]\n int[] currentResult = new int[]{column, minValue(resultOfAction, alpha, beta, depth - 1)[1], maxDepth - depth};\n\n // found a new best action\n // new move is better, or equal to best move but has shallower depth\n if (currentResult[1] > bestMove[1] || (currentResult[1] == bestMove[1] && currentResult[2] < bestMove[2])) {\n bestMove = currentResult;\n }\n\n if (bestMove[1] > alpha[1] || (bestMove[1] == alpha[1] && bestMove[2] < alpha[2])) alpha = bestMove; // new best action is better than the current alpha action\n\n if (alpha[1] >= beta[1]) return alpha; // beta cut-off\n }\n }\n\n return bestMove;\n }",
"public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public int getVarimaxIterations(){\n return this.nVarimax;\n }",
"public void runMaxProductNonrecursive() throws AlgorithmException\n {\n _runMaxProduct();\n _fg.updateEdgeAnnotation();\n\n //System.out.println(printAdj());\n }",
"private static double minMaxPruning(GameState state, int depth, double alpha, double beta){\n\n double v = 0;\n\n // A vector containing all possible children states if this current state\n Vector<GameState> nextStates = new Vector<GameState>();\n state.findPossibleMoves(nextStates);\n\n /**\n // Try testing win/loss before going into depth search\n Move m = state.getMove();\n\n if(m.isXWin()){\n return 1000+depth;\n }\n\n else if(m.isOWin()){\n return -1;\n }\n */\n if (depth==0 || nextStates.size()==0){\n v = evalState(state);\n }\n\n // 2 is 'O' so if nextPlayer is 2 it means that the current player is 'X'\n else if (state.getNextPlayer() == 1){\n v=Double.NEGATIVE_INFINITY;\n\n for(GameState s: nextStates){\n v = Math.max(v, minMaxPruning(s,depth-1, alpha, beta));\n alpha = Math.max(alpha, v);\n if(beta <= alpha) {\n return v;\n }\n }\n }\n // 1 is 'X' so if nextplayer is 1 it means that the current player is 'O'\n else if (state.getNextPlayer() == 2){\n v=Double.POSITIVE_INFINITY;\n\n for(GameState s: nextStates){\n v= Math.min(v,minMaxPruning(s,depth-1, alpha, beta));\n beta = Math.min(beta, v);\n if( beta <= alpha ) {\n return v;\n }\n }\n }\n return v;\n }",
"public abstract double getHeuristic(State state);",
"private int tournament()\r\n {\r\n\tint out = spinTheWheel();\r\n\tdouble max = ff.evaluate(chromos.get(out),generation());\r\n\tdouble temp_fitness = 0;\r\n\tint temp_index = 0;\r\n\r\n\tfor(int i = 0; i < selPara - 1 + tourStep*generation(); i++)\r\n\t {\r\n\t\ttemp_index = spinTheWheel();\r\n\t\ttemp_fitness = ff.evaluate(chromos.get(temp_index),generation());\r\n\t\tif(temp_fitness > max)\r\n\t\t {\r\n\t\t\tmax = temp_fitness;\r\n\t\t\tout = temp_index;\r\n\t\t }\r\n\t }\r\n\treturn out;\r\n }",
"public int recurseReward(int initialState) {\n\t\tint maxValue = -100000;\n\t\t\n\t\tfor(int action = 0; action < this.columns; action++) {\n\t\t\tif(!isActionLegal(initialState, action)){\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tint potNewState = getStateActionMap(initialState, action);\n\t//\t\t\tint pNewColumns = potNewState % (int)Math.sqrt(this.rows);\n\t//\t\t\tint pNewRows = (potNewState - pNewColumns)/(int)Math.sqrt(this.rows);\n\t\t\t\t\n\t\t\t\tif(this.qGrid[initialState][action] > maxValue) {\n\t\t\t\t\tmaxValue = this.qGrid[initialState][action];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"De max value is: \" + maxValue);\n\t\treturn maxValue;\n\t}",
"@Override\r\n\tpublic int move(int lastMove, int[] takenList, int depthLimit) \r\n\t{\r\n\t\tGameState myState = new GameState(takenList, lastMove);\r\n\t\tdouble maxValue = max_value(myState, depthLimit);\r\n\t\tint myBestMove = myState.bestMove;\r\n\t\tif (myState.leaf) //why did i do this\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn myBestMove;\r\n\t}",
"public MoveNode ab(PentagoBoardState pbs,int myscore, int alpha, int beta,int amimaxplayer, int depth,int requireddepth){\n\n int bestmovescore;\n PentagoMove bestmove;\n\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n Collections.shuffle(legalmoves); //helps avoid worst run time if all good moves are at the end of array list\n\n MoveNode moveNode =new MoveNode(new PentagoMove(0,0,0,0,0),0);\n\n if (depth==requireddepth){\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n moveNode.value = evaluate(pbs);\n return moveNode;\n\n }\n else if (pbs.getWinner() != Board.NOBODY){ //check win since we are at leafnode\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n int movescore = evaluate(pbs);\n if (movescore<-1200000){\n moveNode.value = -999999999; //assign loss value\n } //Losing Move\n else if (movescore>1200000){\n moveNode.value = 999999999; //assign win value\n } // Winning Move\n return moveNode;\n\n }\n //do max player\n if (amimaxplayer ==1){\n int currentvalue = -999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 0, depth + 1, requireddepth); // run recursion till leaf node or depth reached\n if (scoreAfterMove.value > currentvalue) { //see if current best value is lower than the new value if so replace\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n\n }\n\n alpha = Math.max(alpha,currentvalue);\n if (alpha>=beta){ // break loop if alpha more than beta\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue+\" my alpha is \" + alpha + \" my beta is \" + beta);\n\n return currentmovenode;\n }\n //do min player\n else if (amimaxplayer==0){\n int currentvalue = 999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 1, depth + 1, requireddepth);\n if (scoreAfterMove.value < currentvalue) {\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n //System.out.println(\"I am min plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n }\n beta = Math.min(beta,currentvalue);\n if (alpha>=beta){\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n return currentmovenode;\n }\n //System.out.println(\"move val \" + moveNode.value);\n return moveNode;\n }",
"public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }",
"public boolean[] eGreedyAction()\n\t{\n\t\t// initialize variables\n\t\tRandom generator = new Random();\n\t\t\n\t\t// find best action\n\t\tList<boolean[]> validActions = getValidActions();\n\t\t\n\t\t// initiate values for comparison\n\t\tStateActionPair sap = new StateActionPair(state, validActions.get(0));\n\t\tboolean[] bestAction = sap.action;\n\t\t\n\t\tdouble bestValue= getStateActionValue(sap);\n\t\t\n\t\tfor(int i=1; i<validActions.size(); i++)\n\t\t{\n\t\t\tsap = new StateActionPair(state, validActions.get(i));\n\t\t\tdouble qValue = getStateActionValue(sap);\n\t\t\tif( qValue > bestValue )\n\t\t\t{\n\t\t\t\tbestAction = sap.action;\n\t\t\t\tbestValue = qValue;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// choose random action\n\t\tif( generator.nextDouble() < epsilon )\t\n\t\t{\n\t\t\tList<boolean[]> randomActions = new ArrayList<boolean[]>(validActions);\n\t\t\trandomActions.remove(bestAction);\t// don't choose the best action\n\t\t\tboolean[] randomAction = randomActions.get(generator.nextInt(randomActions.size()));\n\t\t\treturn randomAction;\n\t\t}\n\t\t\n\n\t\treturn bestAction;\t// choose best action\n\t}",
"public double[] getState(){\n if (AgentType.Abstraction == SimpleExperiment.activeAgentType) {\n // Abstraction agent type\n return this.getCustomState();\n }\n else {\n // System.out.println(\"E[\" + marioEgoPos[0] + \",\" + marioEgoPos[1] + \"] F[\" + marioFloatPos[0] + \",\" + marioFloatPos[1] + \"]\");\n\n // other agent type\n double[] state = new double[10];\n\n // CLOSEST TWO ENEMIES\n state[0] = isMarioAbleToJump ? 1 : 0;\n state[1] = isMarioOnGround ? 1 : 0;\n state[2] = isMarioAbleToShoot ? 1 : 0;//marioMode;//\n float xdiff = marioFloatPos[0] - prevMarioPos[0];\n float ydiff = marioFloatPos[1] - prevMarioPos[1];\n state[3] = xdiff < 0 ? 0 : (xdiff == 0 ? 1 : 2);\n state[3] += 3*(ydiff < 0 ? 0 : (ydiff == 0 ? 1 : 2));\n\n state[4] = enemies(1, 0);\n state[5] = enemies(3, 1);\n state[6] = 0;//enemies(5, 3);\n\n state[7] = obstacle();\n\n int[] enemy = closestEnemy();\n if(Math.abs(enemy[0]) < 11 && Math.abs(enemy[1]) < 11){\n state[8] = enemy[0]+10;\n state[9] = enemy[1]+10;\n } else {\n state[8] = 21;\n state[9] = 21;\n }\n\n //state[10] = marioFloatPos[0];\n //state[11] = marioFloatPos[1];\n\n return state;\n }\n }",
"static double addHeuristic1(GameState c, boolean isMaxNode) {\n\t\t// Value returned will be absolute. If its max node, this config is good\n\t\t// then value will be positive. If its min node,\n\t\t// and this config is good for min, then value will be negative\n\n\t\tint i, j, vacant_spaces;\n\t\t// Compute : Feasible Moves for self\n\t\tint self_feasible_moves = 0;\n\t\tint self_remaining_moves = 0;\n\t\tint opponent_feasible_moves = 0;\n\t\tint opponent_remaining_moves = 0;\n\n\t\t// Go through the board and figure out vacant spots\n\t\tvacant_spaces = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tif (c.getWeight(i) == 0) {\n\t\t\t\tvacant_spaces++;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 1; i <= GameState.MAX_WEIGHT; i = i + 1) {\n\t\t\t// Check if self have the weight\n\t\t\tif (c.IHaveWeight(i)) {\n\t\t\t\tself_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\t// Place it and see if you tip\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\tself_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if opponent has this weight\n\t\t\tif (c.opponentHasWeight(i)) {\n\t\t\t\topponent_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\t// Place the weight and see if you tip\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\topponent_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Need to take the max because one of the players may have played one\n\t\t// chance less\n\t\tif (self_remaining_moves == 0 && opponent_remaining_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (self_remaining_moves > opponent_remaining_moves)\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (self_remaining_moves * vacant_spaces);\n\t\telse\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (opponent_remaining_moves * vacant_spaces);\n\t}",
"public void loadUpdate()\n {\n HashMap<Location, State> updated = gm.update();\n if(updated == null)\n {\n lastScore = 0;\n buttonPlay.setText(\"Nowa gra\");\n buttonPlay.setPrefWidth(100);\n tl.stop();\n nng.updateFitnessOfCurrent(score);\n if(currentPlayer.equals(\"Trening\"))\n {\n monitor.stop();\n buttonPlay.fire();\n }\n return;\n }\n clear();\n score = 0;\n for (Location l : updated.keySet())\n addToBoard(l, updated.get(l));\n\n //Tutaj powinienes chyba dac \"Czlowiek\", bo reszta funkcji jest dla sieci neuronowej\n if(currentPlayer.equals(\"Gra\"))\n return;\n //Ocenia kazdy mozliwy ruch i wybiera najlepszy wedlug sieci neuronowej\n Direction[] directions = new Direction[] {Direction.UP, Direction.DOWN, Direction.LEFT, Direction.RIGHT};\n Direction bestDirection = Direction.UP;\n NeuralNetwork decider = currentPlayer.equals(\"Trening\") ? nng.getCurrent() : nn;\n double bestEval = -10;\n for (Direction direction : directions)\n {\n if(direction.isOpposite(gm.getDirection()))\n continue;\n Location present = gm.getSnake().getLocation();\n double front = -2;\n Location inFront = null;\n try\n {\n inFront = new Location(present.getX() + direction.getX(), present.getY() + direction.getY());\n } catch (LossException e)\n {\n front = -1;\n }\n if(front == -2)\n front = stateToDouble(updated.get(inFront));\n Direction relativeLeft = Direction.getRelativeLeft(direction);\n double left = -2;\n Location toLeft = null;\n try\n {\n toLeft = new Location(present.getX() + relativeLeft.getX(), present.getY() + relativeLeft.getY());\n } catch (LossException e)\n {\n left = -1;\n }\n if(left == -2)\n left = stateToDouble(updated.get(toLeft));\n if(direction.equals(Direction.getRelativeLeft(gm.getDirection())) && !gm.getSnake().getTail().isEmpty())\n left = 0;\n Direction relativeRight = Direction.getRelativeRight(direction);\n double right = -2;\n Location toRight = null;\n try\n {\n toRight = new Location(present.getX() + relativeRight.getX(), present.getY() + relativeRight.getY());\n } catch (LossException e)\n {\n right = -1;\n }\n if(right == -2)\n right = stateToDouble(updated.get(toRight));\n if(direction.equals(Direction.getRelativeRight(gm.getDirection())) && !gm.getSnake().getTail().isEmpty())\n right = 0;\n double delta = Math.sqrt(Math.pow(present.getX() - gm.getFood().getX(), 2) + Math.pow(present.getY() - gm.getFood().getY(), 2)) - Math.sqrt(Math.pow(present.getX() + direction.getX() - gm.getFood().getX(), 2) + Math.pow(present.getY() + direction.getY() - gm.getFood().getY(), 2));\n double eval = decider.calcOutput(new double[] {delta, left, front, right});\n if(eval > bestEval)\n {\n bestEval = eval;\n bestDirection = direction;\n }\n decider.reset();\n }\n gm.setPendingDirection(bestDirection);\n }",
"private double maxValue(Board state, int depth, double alpha, double beta) {\n if(terminalTest(state, depth))\n return utility(state);\n\n double value = Double.NEGATIVE_INFINITY;\n for(Move action: actions(state)){\n Board nextState = new Board(state);\n\n value = Math.max(value,\n minValue(result(nextState, action),\n depth-1, alpha, beta));\n\n if(value >= beta)\n return value;\n\n alpha = Math.max(alpha, value);\n }\n\n return value;\n }",
"public void setVarimaxMaximumIterations(int max){\n this.nVarimaxMax = max;\n }",
"private static int max_value_with_pruning(State curr_state, int alpha, int beta) {\n\t\tcounterPruning++;\r\n\r\n\t\t//If s is a terminal state, return its game value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\t//If there is no valid move available but it is not a terminal node\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn beta;\r\n\t\t}\r\n\r\n\t\treturn alpha;\r\n\t}",
"public int alphabetaSearch(BoardState state, int maxDepth) {\n\t\tint[] pits = new int[6];\r\n\t\t\r\n\t\t// state to check moves\r\n\t\tBoardState move = state;\r\n\t\r\n\t\t// initializing the alpha and the beta value\r\n\t\tint alpha = Integer.MIN_VALUE;\r\n\t\tint beta = Integer.MAX_VALUE;\r\n\t\t\r\n\t\tint bestPit = 0;\r\n\r\n\t\t// for loop to get the SBE of the pits\r\n\t\tfor (int i = 0; i <= 5; i++) {\r\n\r\n\t\t\t// checking if the move is legal\r\n\t\t\tif (state.isLegalMove(1, i)) {\r\n\r\n\t\t\t\t// variable set to max since node at depth 1 is a max value\r\n\t\t\t\tint v = minValue(move.applyMove(1, i), maxDepth, maxDepth - 1, alpha, beta);\r\n\r\n\t\t\t\t// updating the alpha value based on our search\r\n\t\t\t\tif (v > alpha) {\r\n\t\t\t\t\talpha = v;\r\n\t\t\t\t\tbestPit = i;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// pruning\r\n\t\t\t\tif (beta <= alpha)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bestPit;\r\n\t}",
"public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }",
"public static GameState getBestMove(Vector<GameState> states){\n int index = 0;\n double max = 0;\n double v = 0;\n\n // find state with max value and save its index\n for(int i = 0; i < states.size(); i++){\n v = minMaxPruning(states.get(i), depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);\n if(max < v){\n max = v;\n index = i;\n }\n }\n return states.get(index);\n }",
"public static Pair<Integer, PentagoMove> miniMaxAlgo(PentagoBoardState boardState, int depth, int playerTurn) {\n\t\t\n\t\tArrayList<PentagoMove> possibleMoves = boardState.getAllLegalMoves();\n\t\tint score = 0;\n\t\t\n\t\t//assign a high or low value to begin with, no move can have that high/low a value\n\t\tif (playerTurn == 1) {\n\t\t\tscore = Integer.MIN_VALUE;\n\t\t}\n\t\telse {\n\t\t\tscore = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint currentScore;\n\t\tPentagoMove chosenMove = null;\n\t\t\n\t\t//when all moves have been propagated up to the depth desired, find the most valuated move\n\t\tif (possibleMoves.size() == 0 || depth == 0) {\n\t\t\tscore = heuristic(boardState);\n\t\t}\n\t\telse {\n\t\t\t//iterating through all possible moves\n\t\t\tfor(int i = 0; i < possibleMoves.size(); i++) {\n\t\t\t\t\n\t\t\t\t//cloning board to predict 2 moves ahead (depth is 2)\n\t\t\t\tPentagoBoardState clone = (PentagoBoardState) boardState.clone();\n\t\t\t\tclone.processMove(possibleMoves.get(i));\n\t\t\t\tint player = 1 - playerTurn;\n\t\t\t\t\n\t\t\t\t//0 = white, trying to maximize\n\t\t\t\tif (player == 0) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is higher, make it the new current score, then use minimize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore >= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t//1 = black, trying to minimize\n\t\t\t\telse if (player == 1) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is lower, make it the new current score, then use maximize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore <= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//decided to go with pair to avoid having separated methods for the score and the move\n\t\t//it is easy to extract the required value using .getKey() or .getValue()\n\t\tPair<Integer, PentagoMove> answer = new Pair<>(score, chosenMove);\n\t\treturn answer;\n\t}",
"@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}",
"public int gameState() {\n \tboolean check = isCheck(turn);\n \t\n \t//change this code to be some sort of checkmate detection\n \tif(check) {\n \t\t//we need to check whether there is a legal move that puts the king out of check\n \t\t//we need to loop through all pieces of the same color as the turn and make all legal moves\n \t\t//then after each move, check whether the king is still in check\n \t\t\n \t\t//first generate a list of all pieces for the turn color\n \t\tArrayList<Piece> pieces = getPieces(turn);\n \t\t\n \t\tboolean freedom;\n \t\t\n \t\t//now for each piece, check whether moving that piece can get the king out of check\n \t\tfor(int i = 0; i < pieces.size(); i++) {\n \t\t\tfreedom = simulate(pieces.get(i));\n \t\t\tif(freedom) {\n \t \t\tupdateCheckMove(false);\n \t \t\tSystem.out.println(\"Check on \" + turn + \" King!\");\n \t\t\t\treturn 2; //if the king can move, then the game isn't over yet\n \t\t\t}\n \t\t}\n \t\t\n \t\t//the game is over if we reach this far, so we can assume checkmate\n \t\t//resignation logic will probably be specific to Display class\n \t\t\n \t\tupdateCheckMove(true);\n \t\t\n \t\tif(turn == PieceColor.White) return -1; //black win if white king in check and can't move\n \t\tif(turn == PieceColor.Black) return 1;\n \t}\n \t\n \t//if all of these fail, the game isn't over yet\n \treturn 2;\n }",
"public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }",
"public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"private double eval(final GameStateModule game) {\n int player = game.getActivePlayer();\n int ourScore = 6*(threeInCol(game, player) + threeInRow(game, player) + threeInPos(game, player) + threeInNeg(game, player))\n + 3*(twoInCol(game, player) + twoInRow(game, player) + twoInPos(game, player) + twoInNeg(game, player));\n int theirScore = 7*(threeInCol(game, 2/player) + threeInRow(game, 2/player) + threeInPos(game, 2/player) + threeInNeg(game, 2/player))\n + 4*(twoInCol(game, 2/player) + twoInRow(game, 2/player) + twoInPos(game, 2/player) + twoInNeg(game, 2/player));\n return ourScore - theirScore;\n }",
"protected double eval(S state, P player) {\n if (game.isTerminal(state)) {\n return game.getUtility(state, player);\n } else {\n heuristicEvaluationUsed = true;\n return (utilMin + utilMax) / 2;\n }\n }",
"public int maxValue(BoardState state, int maxDepth, int currentDepth, int alpha, int beta) {\n\t\tif (currentDepth == 0)\r\n\t\t\treturn sbe(state);\r\n\r\n\t\t// initializing the smaller possible number to x\r\n\t\tint v = Integer.MIN_VALUE;\r\n\r\n\t\tfor (int i = 0; i <= 5; i++) {\r\n\r\n\t\t\t// checking if a move is legal\r\n\t\t\tif (state.isLegalMove(1, i)) {\r\n\r\n\t\t\t\t// updating our max value to v\r\n\t\t\t\tv = Math.max(v, minValue(state.applyMove(1, i), maxDepth, currentDepth - 1, alpha, beta));\r\n\t\t\t\talpha = Math.max(alpha, v);\r\n\t\t\t\t\r\n\t\t\t\t// Pruning\r\n\t\t\t\tif (beta <= alpha) \t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (v == Integer.MIN_VALUE) {\r\n\t\t\treturn sbe(state);\r\n\t\t}\r\n\r\n\t\treturn v;\r\n\t}",
"public double getBestSolutionEvaluation();",
"public E runGA(int maxGens, int popSize, boolean findMax) {\n this.popSize = popSize;\n\n createInitialPop();\n\n while (whichGen <= maxGens) {\n evalPop();\n currGen = createGen();\n whichGen++;\n }\n\n return getResult(findMax);\n }",
"public int maxKilledEnemies(char[][] grid) {\n if( grid.length == 0 ) return 0;\n \n int m = grid.length, n = grid[0].length;\n \n MyNode[][] dp = new MyNode[m][n];\n \n //initialize matrix\n for(int i = 0; i < m; i++){\n for(int j = 0; j < n; j++){\n dp[i][j] = new MyNode();\n }\n }\n \n //scan the input and update matrix\n //read values from top left\n for(int i = 0; i < m; i++){\n for(int j = 0; j < n; j++){\n //skip walls\n if( grid[i][j] == 'W' ) continue;\n //accumulate enemys\n if( grid[i][j] == 'E' ){\n dp[i][j].top = 1;\n dp[i][j].left = 1;\n }\n //accumulate enemys from top\n dp[i][j].top += i > 0? dp[i-1][j].top : 0;\n //accumulate enemys from left\n dp[i][j].left += j > 0? dp[i][j-1].left : 0;\n }\n }\n \n int result = 0;\n \n //scan the input and update matrix\n //read values from bot right\n for(int i = m-1; i >= 0; i--){\n for(int j = n-1; j >= 0; j--){\n //skip walls\n if( grid[i][j] == 'W' ) continue;\n //accumulate enemys\n if( grid[i][j] == 'E' ){\n dp[i][j].bot = 1;\n dp[i][j].right = 1;\n }\n //accumulate enemys from bot\n dp[i][j].bot += i + 1 < m? dp[i+1][j].bot : 0;\n //accumulate enemys from right\n dp[i][j].right += j + 1 < n? dp[i][j+1].right : 0;\n \n //update result if possible \n if(grid[i][j] == '0') result = Math.max(result, dp[i][j].top + dp[i][j].bot + dp[i][j].left + dp[i][j].right );\n }\n } \n \n return result;\n }",
"public void evaluate() {\n for (Chromosome chromo : chromosomes) {\n double chromoGH = chromo.getTotalGH();\n if (chromo.isValid()) {\n this.validChromosomes++;\n if (chromoGH > this.getBestScore()) {\n this.bestScore = chromoGH;\n this.setBestChromo(chromo);\n }\n }\n //Log.debugMsg(chromo.getTotalGH().toString());\n// this.map.put(chromoGH, chromo);\n }\n }",
"public double maxValue(S state, P player, double alpha, double beta, int depth) {\n updateMetrics(depth);\n if (game.isTerminal(state) || depth >= currDepthLimit || timer.timeOutOccurred()) {\n return eval(state, player);\n } else {\n double value = Double.NEGATIVE_INFINITY;\n for (A action : orderActions(state, game.getActions(state), player, depth)) {\n value = Math.max(value, minValue(game.getResult(state, action), //\n player, alpha, beta, depth + 1));\n if (value >= beta)\n return value;\n alpha = Math.max(alpha, value);\n }\n return value;\n }\n }",
"public void executeevaluate() {\n \t\tString board = conf.getProperty(\"gamesman.board\");\n \t\tif (board == null)\n \t\t\tUtil.fatalError(\"Please specify a hash to evaluate\");\n \t\tBigInteger val = new BigInteger(board);\n \t\tSystem.out.println(gm.primitiveValue(gm.hashToState(val)));\n \t}",
"private void doEpsilon(){\n\t\tcurrentState = \"q0\";\n\t}",
"public static void main(String[] args) {\r\n MiniMaxNode node;\r\n TTTState3x3 state=new TTTState3x3();\r\n state=new TTTState3x3(state, TTTState3x3.MOVE_O[1][1]);\r\n System.out.println(state);\r\n state=new TTTState3x3(state, TTTState3x3.MOVE_X[2][1]);\r\n System.out.println(state);\r\n while (!state.goal() && state.successor().length>0) {\r\n node=MiniMaxNode.minimaxSearch(state);\r\n System.out.println(node.getAction());\r\n state=new TTTState3x3(state, node.getAction());\r\n System.out.println(state);\r\n }\r\n \r\n }",
"static int[] getState(Node root){\n if(root==null)\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,0,0};\n\n int[] leftAns = getState(root.left);\n int[] rightAns = getState(root.right);\n\n if(root.val<leftAns[1] || root.val> rightAns[0]){\n //failed\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,-1, Math.max(leftAns[3], rightAns[3])};\n }\n else {//(root.val>leftAns[1] && root.val<rightAns[0]){\n\n return new int[] { Math.min(leftAns[0], root.val), Math.max(rightAns[1], root.val) , leftAns[2]+rightAns[2]+1, Math.max(leftAns[2]+rightAns[2]+1,\n Math.max(leftAns[3], rightAns[3])) };\n\n }\n\n\n }",
"public static PentagoMove excecuteMiniMax(PentagoBoardState bs, int depth) {\n\t\tlong timerStart = System.currentTimeMillis();\n\t\tPentagoMove bestMove = null;\n\t\tint highestVal = Integer.MIN_VALUE;\n\t\tint lowestVal = Integer.MAX_VALUE;\n\t\tint currentVal = 0;\n\t\tint possibleMoves = bs.getAllLegalMoves().size();\n\t\tfor (PentagoMove move : bs.getAllLegalMoves()) {\n\t\t\tPentagoBoardState stateClone = (PentagoBoardState) bs.clone();\n\t\t\tstateClone.processMove(move);\n\t\t\tif(bs.getTurnPlayer() == 0) {\n\t\t\t\tMax(stateClone, depth-1);\n\t\t\t}\n\t\t\telse if(bs.getTurnPlayer() == 1) {\n\t\t\t\tMin(stateClone, depth-1);\n\t\t\t}\n\t\t\tif (bs.getTurnPlayer() == 0 && currentVal >= highestVal) {\n\t\t\t\thighestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\telse if (bs.getTurnPlayer() == 1 && currentVal <= lowestVal) {\n\t\t\t\tlowestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\tif (System.currentTimeMillis() - timerStart >= 1900) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlong totalTime = System.currentTimeMillis() - timerStart;\n\t\tSystem.out.println(totalTime);\n\t\treturn bestMove;\n\t}",
"public MoveWrapper minimax(GameBoardState gameState, int depth, MoveWrapper alpha, MoveWrapper beta,\n\t\t\tboolean maximizingPlayer) {\n\n\t\tMoveWrapper maxEval = new MoveWrapper(gameState.getLeadingMove(), Integer.MIN_VALUE); // -infinity\n\n\t\tif (gameState.isTerminal() || AgentController.getAvailableMoves(gameState, playerTurn).isEmpty() || depth == 0) {\n\t\t\tnodesExamined++;\n\t\t\tmaxEval.setMoveReward((int) AgentController.getGameEvaluation(gameState, playerTurn));\n//\t\t\tSystem.out.println(\"in terminal statement \" + maxEval.getMoveReward());\n\t\t\treturn maxEval;\n\t\t}\n\n\t\tif (maximizingPlayer) {\n\n\t\t\tfor (ObjectiveWrapper move : AgentController.getAvailableMoves(gameState, playerTurn)) {\n\t\t\t\tMoveWrapper eval = minimax(AgentController.getNewState(gameState, move), depth - 1, alpha, beta, false);\n\n\t\t\t\tif (eval.getMoveReward() > maxEval.getMoveReward()) { \n\t\t\t\t\tmaxEval.setObjectiveInformation(move);\n\t\t\t\t\tmaxEval.setMoveReward(eval.getMoveReward());\n//\t\t\t\t\tSystem.out.println(\"Player: \" + playerTurn + \"Maximizing - Depth: \" + depth + \", eval value: \" + eval.getMoveReward() + \", maxEval value: \" + maxEval.getMoveReward());\n\t\t\t\t}\n\n\t\t\t\t// alpha beta pruning\n\t\t\t\t if (eval != null && alpha.compareTo(eval) < 0) {\n\t\t\t\t alpha = eval;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if (beta.compareTo(alpha) <= 0) {\n\t\t\t\t prunedCounter++;\n\t\t\t\t break;\n\t\t\t\t }\n\t\t\t}\n\t\t\treturn maxEval;\n\n\t\t} else {\n\t\t\tMoveWrapper minEval = new MoveWrapper(gameState.getLeadingMove(), Integer.MAX_VALUE); // +infinity\n\n\t\t\tfor (ObjectiveWrapper move : AgentController.getAvailableMoves(gameState, GameTreeUtility.getCounterPlayer(playerTurn))) {\n\t\t\t\tMoveWrapper eval = minimax(AgentController.getNewState(gameState, move), depth - 1, alpha, beta, true);\n\n\t\t\t\tif (eval.getMoveReward() < minEval.getMoveReward()) { \n\t\t\t\t\tminEval.setObjectiveInformation(move);\n\t\t\t\t\tminEval.setMoveReward(eval.getMoveReward());\n//\t\t\t\t\tSystem.out.println(\"Player: \" + playerTurn + \"Minimizing - Depth: \" + depth + \", eval value: \" + eval.getMoveReward() + \", minEval value: \" + minEval.getMoveReward());\n\t\t\t\t}\n\n\t\t\t\t// alpha beta pruning\n\t\t\t\t if (eval != null && beta.compareTo(eval) > 0) {\n\t\t\t\t beta = eval;\n\t\t\t\t }\n\t\t\t\t if (beta.compareTo(alpha) <= 0) {\n\t\t\t\t prunedCounter++;\n\t\t\t\t break;\n\t\t\t\t }\n\t\t\t}\n\t\t\treturn minEval;\n\t\t}\n\n\t}",
"public static int applyMinMax(int d, BoardModel model, boolean maximizingTeam, int alpha, int beta, boolean whiteTeam, int startDepth) {\n //base case, figure out determinaion of game over\n\n // printMap(model);\n // System.out.println(\"Depth: \"+d);\n \n\n //allPossibleMoves moveTree = new allPossibleMoves();\n int[] currentQueen;\n ArrayList<int[]> whiteQueens = new ArrayList<>();\n ArrayList<int[]> blackQueens = new ArrayList<>();\n ArrayList<int[]> myQueens = new ArrayList<>();\n // possibleMove bestestMove = null;\n\n// for (int count = 0; count < model.queenPositions.size(); count++) {\n// if (model.getTile(model.queenPositions.get(count)).equals(POS_MARKED_BLACK)) {\n// blackQueens.add(model.queenPositions.get(count));\n// // System.out.println(\"Black: \"+model.getTile(model.queenPositions.get(count)));\n// } else {\n// whiteQueens.add(model.queenPositions.get(count));\n// // System.out.println(\"White: \"+model.getTile(model.queenPositions.get(count)));\n// }\n// }\n//set black and white queens \n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n if (model.getTile(new int[]{jam, pb}).equals(POS_MARKED_WHITE)) {\n whiteQueens.add(new int[]{jam, pb});\n }\n if (model.getTile(new int[]{jam, pb}).equals(POS_MARKED_BLACK)) {\n blackQueens.add(new int[]{jam, pb});\n }\n }\n }\n if (maximizingTeam){\n if (whiteTeam){\n myQueens = whiteQueens;\n }\n else{\n myQueens = blackQueens;\n }\n }\n if (!maximizingTeam){\n if (whiteTeam){\n myQueens = blackQueens;\n }\n else{\n myQueens = whiteQueens;\n }\n }\n \n if (d == 0 || findAllMoves(model,myQueens).isEmpty() ) {\n return baseCase(model, whiteTeam);\n }\n\n // System.out.println(\"White Queens identified as: \" + whiteQueens.get(0)[0] + \"\" + whiteQueens.get(0)[1] + \" \" + whiteQueens.get(1)[0] + whiteQueens.get(1)[1] + \" \" + whiteQueens.get(2)[0] + whiteQueens.get(2)[1] + \" \" + whiteQueens.get(3)[0] + whiteQueens.get(3)[1]);\n //if (whiteTeam) {\n // myQueens = whiteQueens;\n //} else {\n // myQueens = blackQueens;\n // }\n // perform a check to see which side we are on. \n // System.out.println(\"Status: \"+maximizingTeam);\n if (maximizingTeam) {\n // System.out.println(\"Maximizing turn\");\n if (whiteTeam) {\n myQueens = whiteQueens;\n } else {\n myQueens = blackQueens;\n }\n\n int maxEval = -1000000;\n // considering this move was played. \n\n // printMap(model);\n // System.out.println();\n //find all children from this state\n ArrayList<ArrayList<int[]>> children = findAllMoves(model, myQueens);\n if (children.size() == 0){\n return baseCase(model, whiteTeam);\n }\n if(children.size()==0 && d == startDepth){\n System.out.println(\"We Lost :( \");\n }\n // printMap(model);\n // System.out.println();\n for (int i = 0; i < children.size(); i++) {\n\n String m1 = stringMap(model);\n\n BoardModel recursionModel = new BoardModel(10);\n\n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n recursionModel.setTile(new int[]{jam, pb}, model.getTile(new int[]{jam, pb}));\n }\n }\n recursionModel.queenPositions = new ArrayList<>();\n for (int x = 0; x < model.queenPositions.size(); x++) {\n recursionModel.queenPositions.add(model.queenPositions.get(x));\n }\n\n // printMap(recursionModel);\n recursionModel.moveQueen(children.get(i).get(0), children.get(i).get(1));\n recursionModel.setTile(children.get(i).get(2), POS_MARKED_ARROW);\n // System.out.println(\"max recursive call\");\n int childVal = applyMinMax(d - 1, recursionModel, false, alpha, beta, whiteTeam, startDepth);\n recursionModel.moveQueen(children.get(i).get(1), children.get(i).get(0));\n recursionModel.setTile(children.get(i).get(2), POS_AVAILABLE);\n\n String m2 = stringMap(model);\n // System.out.println(\"Check board Validity Max: \"+m1.equals(m2));\n\n maxEval = max(maxEval, childVal);\n if (d == startDepth) {\n ArrayList<int[]> blah = new ArrayList<int[]>();\n blah.add(children.get(i).get(0));\n blah.add(children.get(i).get(1));\n blah.add(children.get(i).get(2));\n blah.add(new int[]{childVal});\n maxMinMoves.add(blah);\n }\n alpha = max(maxEval, alpha);\n // System.out.println(\"A: \"+alpha);\n if (alpha >= beta) {\n break;\n }\n }\n return maxEval;\n\n } else {\n // System.out.println(\"Minimizing turn\");\n if (!whiteTeam) {\n myQueens = whiteQueens;\n } else {\n myQueens = blackQueens;\n }\n\n int maxEval = 1000000;\n // considering this move was played. \n\n // printMap(model);\n // System.out.println();\n //find all children from this state\n ArrayList<ArrayList<int[]>> children = findAllMoves(model, myQueens);\n if (children.size() == 0){\n return baseCase(model, whiteTeam);\n }\n if(children.size()==0 && d == startDepth){\n System.out.println(\"We Lost :( \");\n }\n // printMap(model);\n // System.out.println();\n for (int i = 0; i < children.size(); i++) {\n\n String m1 = stringMap(model);\n\n BoardModel recursionModel = new BoardModel(10);\n\n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n recursionModel.setTile(new int[]{jam, pb}, model.getTile(new int[]{jam, pb}));\n }\n }\n recursionModel.queenPositions = new ArrayList<>();\n for (int x = 0; x < model.queenPositions.size(); x++) {\n recursionModel.queenPositions.add(model.queenPositions.get(x));\n }\n\n // printMap(recursionModel);\n recursionModel.moveQueen(children.get(i).get(0), children.get(i).get(1));\n recursionModel.setTile(children.get(i).get(2), POS_MARKED_ARROW);\n // System.out.println(\"min recursive call\");\n int childVal = applyMinMax(d - 1, recursionModel, true, alpha, beta, whiteTeam, startDepth);\n recursionModel.moveQueen(children.get(i).get(1), children.get(i).get(0));\n recursionModel.setTile(children.get(i).get(2), POS_AVAILABLE);\n\n String m2 = stringMap(model);\n // System.out.println(\"Check board Validity Max: \"+m1.equals(m2));\n\n maxEval = min(maxEval, childVal);\n if (d == startDepth) {\n ArrayList<int[]> blah = new ArrayList<int[]>();\n blah.add(children.get(i).get(0));\n blah.add(children.get(i).get(1));\n blah.add(children.get(i).get(2));\n blah.add(new int[]{childVal});\n maxMinMoves.add(blah);\n }\n beta = min(maxEval, alpha);\n // System.out.println(\"A: \"+alpha);\n if (alpha >= beta) {\n break;\n }\n }\n return maxEval;\n }\n\n }",
"@Override\r\n\tpublic double min_value(GameState s, int depthLimit)\r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\t\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn -(stateEvaluationValue);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMin = Double.POSITIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\t\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\t\r\n\t\t\t\tdouble tempMin = currMin;\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 2;\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMin = Math.min(currMin, max_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (currMin < tempMin)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\r\n\t\t\treturn currMin;\r\n\r\n\t\t}\r\n\t}",
"public float getBestScore(GameModel startingState) {\n\n float bestScore = 0;\n for (int i = 0; i < NUM_SIMULATIONS; i++) {\n bestScore = max(bestScore, simulateAndGetScore(GameModel.copyOf(startingState)));\n }\n\n return bestScore;\n }",
"public int[] getPlay(final Board board) {\n final boolean maximizing = false;\n BoardStateNode origin = new BoardStateNode(Board.copyState(board.getBoard()), null);\n\n List<BoardStateNode> nextMoves = origin.getChildren(!maximizing);\n\n double value = Double.NEGATIVE_INFINITY;\n steps = 0;\n for (BoardStateNode possibility : nextMoves) {\n double result = getResult(possibility, maximizing);\n if (result > value) {\n value = result;\n nextMove = possibility;\n }\n }\n\n //System.out.println(\"Nodes visited: \" + steps);\n return nextMove.getPlay();\n }",
"private int minValue(Node state, int alpha, int beta) {\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, true);\n\t\t}\n\t\t\n\t\tint v = Integer.MAX_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000)\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tint value = this.maxValue(state.result(move), alpha, beta);\n\t\t\tif (v > value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\n\t\t\tif (v <= alpha) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\tbeta = Math.min(v, beta);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}",
"public static void main(String[] args) throws InterruptedException, NumberFormatException, IOException {\n\n\t\tint game = 0;\n\t\tFile fileToBeModified = new File(\"src/Game/winCount.txt\");\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileToBeModified));\n\n\t\tint whiteWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"White Wins:\" + whiteWin);\n\t\tint blackWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Black Wins:\" + blackWin);\n\t\tint stalemates = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Stalemates:\" + stalemates);\n\n\t\tint currWhiteWin = 0;\n\t\tint currBlackWin = 0;\n\t\tint currStalemate = 0;\n\n\t\tlong start= System.currentTimeMillis();\n\n\t\tBoardState board = new BoardState();\n\t\tMinimaxAI minimaxBlackPlayer = new MinimaxAI(5);\n\t\tMinimaxAI minimaxWhitePlayer = new MinimaxAI(5);\n\t\tAlphaBetaAI abBlackPlayer = new AlphaBetaAI(5);\n\t\tAlphaBetaAI abWhitePlayer = new AlphaBetaAI(5);\n\t\twhile (game <=30) {\t\n\t\t\tfor (int y = 8; y > 0; y--) {\n\t\t\t\tfor (int x = 1; x <= 8; x++) {\n\t\t\t\t\tSystem.out.print(board.getTile(x, y) + \"\\t\");\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tint turn = 1;\n\t\t\twhile (!board.gameOver()) {\n\t\t\t\tif (board != null) {\n\t\t\t\t\tif (board.isWhiteTurn) {\n\t\t\t\t\t\t//board = abWhitePlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxWhitePlayer.minimaxPlay(board);\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//board = abBlackPlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxBlackPlayer.minimaxPlay(board);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Turn #\" + turn++);\n\t\t\t\t\tboard.printBoard();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tTimeUnit.MILLISECONDS.sleep(250);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (board.whiteWin()) {\n\t\t\t\tSystem.out.println(\"White Wins\");\n\t\t\t\twhiteWin++;\n\t\t\t\tcurrWhiteWin++;\n\t\t\t}else if(board.blackWin()){\n\t\t\t\tSystem.out.println(\"Black Wins\");\n\t\t\t\tblackWin++;\n\t\t\t\tcurrBlackWin++;\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Stalemate\");\n\t\t\t\tstalemates++;\n\t\t\t\tcurrStalemate++;\n\t\t\t}\n\t\t\t\n//\t\t\tboard.reset();\n//\t\t\tgame++;\n\t\t\tbreak;\n\t\t}\n\n\t\tlong elapsed = System.currentTimeMillis() - start;\n\t\tSystem.out.println(\"Time Elapsed: \" + elapsed);\n\n\t\tFileWriter writer = new FileWriter(fileToBeModified);\n\t\twriter.write(Integer.toString(whiteWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(blackWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(stalemates));\n\t\tSystem.out.println(\"White Wins:\" + currWhiteWin);\n\t\tSystem.out.println(\"Black Wins:\" + currBlackWin);\n\t\tSystem.out.println(\"Stalemates:\" + currStalemate);\n\t\treader.close();\n\t\twriter.close();\n\t}",
"@Test\n public void genNeighStateProbability() {\n double[] metrics = new double[STATES.length * STATES.length];\n double sum = 0;\n Random rand = new Random();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (x == y) {\n metrics[i] = 0;\n } else {\n double d = Math.abs(rand.nextGaussian());//Math.exp(-Math.abs(STATES[x] - STATES[y]) / 3) * Math.abs(rand.nextGaussian());\n metrics[i] = d;\n sum += d;\n }\n }\n final double finalSum = sum;\n metrics = DoubleStream.of(metrics).map(d -> d / finalSum).toArray();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (metrics[i] > 0.01) {\n System.out.printf(\"%d:%d:%.4f\\n\", STATES[x], STATES[y], metrics[i]);\n }\n }\n }",
"@Override\n\tpublic double evaluate(IChromosome a_subject) {\n\n\t\t// Get Weights\n\t\tGene[] genes = a_subject.getGenes();\n\t\tdouble[] weights = new double[9];\n\t\tfor (int i = 0; i < genes.length; i++) {\n\t\t\tweights[i] = (double) genes[i].getAllele();\n\t\t}\n\n\t\tdouble totalValue = 0.0;\n\n\t\tfor (int i = 0; i < NUM_GAMES; i++) {\n\t\t\t// Initialize Game\n\t\t\tState s = new State();\n\t\t\t// new TFrame(s);\n\t\t\tdouble numPiecesPlayed = 0.0d;\n\t\t\twhile (!s.hasLost() && numPiecesPlayed < MAX_PIECES) {\n\t\t\t\ts.makeMove(findNextMove(s, weights));\n\t\t\t\t// s.draw();\n\t\t\t\t// s.drawNext(0, 0);\n\t\t\t\tnumPiecesPlayed++;\n\t\t\t\t// try {\n\t\t\t\t// Thread.sleep(10);\n\t\t\t\t// } catch (InterruptedException e) {\n\t\t\t\t// e.printStackTrace();\n\t\t\t\t// }\n\t\t\t}\n\t\t\ttotalValue += (double) s.getRowsCleared() + numPiecesPlayed / 100000d;\n\t\t}\n\n\t\treturn totalValue;\n\t}",
"public void evaluate(int maxIteration) throws NodeException {\n\t\t// Reset all the nodes.\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t\tint iteration = 0;\n\t\twhile (iteration < maxIteration) {\n\t\t\tboolean stabilized = true;\n\t\t\t// Refresh all nodes.\n\t\t\tfor (Node node : nodes)\n\t\t\t\tif (node.refresh())\n\t\t\t\t\tstabilized = false;\n\t\t\t// A network has stabilized if no actions have occurred.\n\t\t\tif (stabilized)\n\t\t\t\tbreak; // Escape.\n\t\t\t// Increment the iteration.\n\t\t\titeration++;\n\t\t}\n\t}",
"public void runAStar() \n\t{\n\t\tLinkedList<GameState> que = new LinkedList<GameState>();//new liked list to hold all the legal moves\n\t\topen.add(startS);//add the start node to the open queue so the while loop can start\n\t\tcountOpen++;\n\t\tint c = 0;\n\t\t//while the open que is not empty and it has not reached its max then run the algorithm\n\t\t//this also prevents the code from running forever if the goal state is not reachable\n\t\twhile(countOpen<1000 && !open.isEmpty())//&& c<6) \n\t\t{\n\t\t\tGameState curr = open.peek();//set the curr node to what we think is the games tate with the loewst F(n)\n\t\t\t//GameState temp = open.remove();\n\t\t\tfor(GameState v : open)//this goes through all the gamestates in the open lists \n\t\t\t{\n\t\t\t\tif(v.getPriority()<curr.getPriority()) //this checks to see if there are any other gamestates in the open list with a lower f(n)\n\t\t\t\t{\n\t\t\t\t\tcurr = v;//if there is set curr to that gamestate\n\t\t\t//\t\tSystem.out.println(\"this is the small curr node:\");\n\t\t\t//\t\tcurr.printGameState();\n\t\t\t\t}\n\t\t\t}\n\t\t\topen.remove(curr);////set the current node to the beingin of open and remove curr node from open\n\t\t\t//System.out.println(\"this is the curr node:\");\n\t\t\t//curr.printGameState();\n\t\t\tcountOpen--;\n\t\t\tclosed.add(curr);//add curr node to the closed list\n\t\t\tcountClosed++;\n\t\t\tif(isGoalState(curr, goalS)) //check to see if the current games state is the goal\n\t\t\t{\n\t\t\t\tprintAns(closed);//print the order of how it got to the goal state\n\t\t\t\tbreak;//get out of the loop\n\t\t\t}\n\t\t\telse //if curr is not the goal state\n\t\t\t{\n\t\t\t\tque = successor(curr);//find all of the legal moves from the current game state\n\t\t\t\t//System.out.println(\"This is the curr\");\n\t\t\t\t//printClosed(que);\n\t\t\t\t//printOpen(open);\n\t\t\t\t//System.out.println(\"This is the closed\");\n\t\t\t\t//printClosed(closed);\n\t\t\t\t//open.\n\t\t\t\tboolean bk = false;//this is a booklean to determine if we need to break out of the loop\n\t\t\t\tfor(GameState i: que) //go through all of the legal moves\n\t\t\t\t{\n\t\t\t\t\tif(isGoalState(i, goalS)) //if any of the legal moves is the goal state then\n\t\t\t\t\t{\n\t\t\t\t\t\tclosed.add(i);//add the legal move to the closed\n\t\t\t\t\t\tcountClosed++;\n\t\t\t\t\t\tprintAns(closed);//print the order of how it got to the goal state\n\t\t\t\t\t\tbk = true;//set the need to break to true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (bk) {break;}//break out of the loop\n\t\t\t\t//this is where we check to see if any of the legal moves are already in closed\n\t\t\t\tfor(GameState i: closed) //loop through the closed \n\t\t\t\t{\n\t\t\t\t\tfor(GameState z: que) //loop thorugh the legal moves\n\t\t\t\t\t{\n\t\t\t\t\t\tif(same(i, z)) //if the two are the same then\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tz.setVisited(true);//set visited to true so we dont accidentally add it to the open list\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(GameState i: que) ///lets loop though the legal moves again\n\t\t\t\t{\n\t\t\t\t\tif(i.getVisited()!=true )//&& !same(i, z))if the gamestate not in closed\n\t\t\t\t\t{\n\t\t\t\t\t\topen.add(i);//add the game state to the open queue\n\t\t\t\t\t\tcountOpen++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc++;\n\t\t\t}\n\t\t}\n\t}",
"public MoveEvaluation computeBest (int ply, IGameState s, IPlayer player, IPlayer opponent) {\n\t\tthis.original = player;\n\t\tthis.state = s.copy();\n\t\tMoveEvaluation move = minimax(ply, IComparator.MAX, player, opponent);\n\t\treturn move;\n\t}",
"@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}",
"protected Move alphaBetaSearch() {\n\n\t\tdouble value = maxValue(this.parent, Double.NEGATIVE_INFINITY,\n\t\t\t\tDouble.POSITIVE_INFINITY);\n\t\tSystem.out.println(\"value-alpha-beta = \" + value);\n\t\t\n\t\tdouble maxVal = Double.NEGATIVE_INFINITY;\n\t\tMove idealMove = new Move();\n\t\tfor (Node tempNode : this.parent.children) {\n\t\t\tSystem.out.println(\"tempNode.getEvalValue() = \" \n\t\t+ tempNode.getEvalValue());\n\n\t\t\tif (tempNode.getEvalValue() >= maxVal) {\n\t\t\t\t\tidealMove = tempNode.getMove();\n\t\t\t\t\tmaxVal = tempNode.getEvalValue();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(this.forcedMove != null)\n\t\t\treturn this.forcedMove;\n\t\treturn idealMove;\n\n\t}",
"protected int runMode() {\n\t\tint resultLap = Parameter.NO_WINNER;\n\t\tint currentLap = 0;\n\t\twhile(currentLap < nbTests && resultLap == Parameter.NO_WINNER) {\n\t\t\trunLap(currentLap);\n\t\t\tlogLap(currentLap);\n\t\t\t\n\t\t\tresultLap = getLapResult();\n\t\t\tcurrentLap++;\n\t\t}\n\t\t\n\t\treturn resultLap;\n\t}",
"public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"private Pair<Double, Move> minimax(OthelloBoard board, OthelloSide side, int depth, int max_depth, \n\t\t\t\t\t\t\t\tMove m, double alpha, double beta) {\n\t\tdouble bestScore;\n\t\tint turncount = turn;\n\t\tMove bestMove;\n\t\t//System.out.println(\"Start of minimax. Depth: \" + depth + \" Side: \" + side);\n\t /* int state = board.getState();\n\t\tif (state == OthelloBoard.DRAW)\n\t return new Pair<Double, Move>(0, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.BLACK)) \n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m); \n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);\n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.BLACK))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);*/\n\t\tif(board.isDone()) {\n\t\t\tdouble endgame = board.countBlack() - board.countWhite();\n\t\t\treturn new Pair<Double, Move>(endgame, m);\n\t\t}\n\t\tif(depth == max_depth) {\n\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\treturn new Pair<Double, Move>(mdScore, m);\t\t\t\n\t\t} else {\n\t\t\tLinkedList<Move> moveList = getMoveList(board, side);\n\t\t\tif(depth == 0) {\n\t \t\t\tLinkedList<Move> corners = new LinkedList<Move>();\n\t\t\t\tfor(Move mv : moveList) {\n\t\t\t\t\tif(board.isCorner(mv)) {\n\t\t\t\t\t\tcorners.add(mv);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(corners.size() != 0) {\n\t\t\t\t\tMove bcorner = null;\n\t\t\t\t\tdouble best = -Double.MAX_VALUE;\n\t\t\t\t\tfor(Move ml : corners) {\n\t\t\t\t\t\tdouble temp = evalMove(board, side, ml);\n\t\t\t\t\t\tif(temp > best) {\n\t\t\t\t\t\t\tbest = temp;\n\t\t\t\t\t\t\tbcorner = ml;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn new Pair<Double, Move>(best, bcorner);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(moveList.toString());\n\t\t\tbestScore = -Double.MAX_VALUE;\n\t\t\tbestMove = new Move(1,1);\n\t\t\tif(moveList.size() == 0) {\n\t\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\t\treturn new Pair<Double, Move>(mdScore, m);\n\t\t\t} else {\n\t\t\t\tfor(int i = 0; i < moveList.size(); i++) {\n\t\t\t\t\tOthelloBoard tempBoard = board.copy();\n\t\t\t\t\tMove move = moveList.get(i);\n\t\t\t\t\ttempBoard.move(move, side);\n\t\t\t\t\talpha = -(minimax(tempBoard, side.opposite(), depth + 1, max_depth, move, -beta, -alpha)).score;\n\t\t\t\t\t//System.out.println(\"Side: \" + side);\n\t\t\t\t\t//System.out.println(\"alpha (before IF): \" + alpha);\n\t\t\t\t\t//System.out.println(\"bestScore (before IF): \" + bestScore);\n\t\t\t\t\tif(beta <= alpha) {\n\t\t\t\t\t\treturn new Pair<Double, Move>(alpha, move);\n\t\t\t\t\t}\n\t\t\t\t\tif(alpha > bestScore ) {\n\t\t\t\t\t\tbestScore = alpha;\n\t\t\t\t\t\tbestMove = move;\n\t\t\t\t\t\t//bestMove.copy(move);\n\t\t\t\t\t\t//System.out.println(\"theScore(IF): \" + alpha);\n\t\t\t\t\t\t//System.out.println(\"bestScore(IF): \" + bestScore);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new Pair<Double, Move>(bestScore, bestMove);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic Rank getMax(Set<StrategyState<State,Memory>> strategyStates) {\n\t\tValidate.notEmpty(strategyStates);\n\t\tRankFunction<State> rankFunction = this.getRankFunction(strategyStates.iterator().next().getMemory());\n\t\treturn rankFunction.getMaximum(GRUtils.getStates(strategyStates));\n\t}",
"@Override\r\n\tpublic double evaluate(int[][] board, int currentPlayer) {\n\t\r\n\tdouble score;\t\r\n\tfinal int RANDOM_WEIGHT=5; // weight factor\r\n\t\r\n\tMaximumDisksEvaluation ob = new MaximumDisksEvaluation();\r\n\tCornerEvaluation ob1 = new CornerEvaluation();\r\n\tCornerClosenessEvaluation ob2 = new CornerClosenessEvaluation();\r\n\tFrontierEvaluation ob3 = new FrontierEvaluation();\r\n\tStabilityEvaluation ob4 = new StabilityEvaluation();\r\n\tPositionalEvaluation ob5 = new PositionalEvaluation();\r\n\tMobilityEvaluation ob6 = new MobilityEvaluation();\r\n\t\r\n\tscore = ob.evaluate(board, currentPlayer) + ob1.evaluate(board, currentPlayer) + ob2.evaluate(board, currentPlayer) + ob6.evaluate(board, currentPlayer) + ob3.evaluate(board, currentPlayer) + ob5.evaluate(board, currentPlayer) ; \r\n\t\r\n\treturn score;\r\n\t\r\n\t}",
"public void solve() {\n\t\tArrayList<Piece> pieceListBySize = new ArrayList<Piece>(pieceList);\n\t\tCollections.sort(pieceListBySize);\t// This is done since the order\n\t\t\t\t\t\t\t\t\t\t\t// of piece placements does not matter.\n\t\t\t\t\t\t\t\t\t\t\t// Placing larger pieces down first lets\n\t\t\t\t\t\t\t\t\t\t\t// pruning occur sooner.\n\t\t\n\t\t/**\n\t\t * Calculates number of resets needed for a game board.\n\t\t * A \"reset\" refers to a tile that goes from the solved state to\n\t\t * an unsolved state and back to the solved state.\n\t\t * \n\t\t * This is the calculation used for pruning.\n\t\t */\n\t\t\n\t\tArrayList<Integer> areaLeft = new ArrayList<Integer>();\n\t\tareaLeft.add(0);\n\t\tint totalArea = 0;\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\ttotalArea += pieceListBySize.get(i).numberOfFlips;\n\t\t\tareaLeft.add(0, totalArea);\n\t\t}\n\t\tint totalResets = (totalArea - gameBoard.flipsNeeded) / (gameBoard.goal + 1);\n\t\tSystem.out.println(\"Total Resets: \" + totalResets);\n\t\t\n\t\t/* \n\t\tint highRow = 0;\n\t\tint highCol = 0;\n\t\tint[][] maxDim = new int[2][pieceListBySize.size()];\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\tif (highRow < pieceListBySize.get(i).rows)\n\t\t\t\thighRow = pieceListBySize.get(i).rows;\n\t\t\t\n\t\t\tif (highCol < pieceListBySize.get(i).cols)\n\t\t\t\thighCol = pieceListBySize.get(i).cols;\n\t\t\t\n\t\t\tmaxDim[0][i] = highRow;\n\t\t\tmaxDim[1][i] = highCol;\n\t\t}\n\t\t*/\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\tNode<GameBoard> currentNode = new Node<GameBoard>(gameBoard);\n\t\tStack<Node<GameBoard>> stack = new Stack<Node<GameBoard>>();\n\t\tstack.push(currentNode);\n\t\t\n\t\twhile (!stack.isEmpty()) {\n\t\t\tnodeCount++;\n\t\t\t\n\t\t\tNode<GameBoard> node = stack.pop();\n\t\t\tGameBoard current = node.getElement();\n\t\t\tint depth = node.getDepth();\n\t\t\t\n\t\t\t// Checks to see if we reach a solved state.\n\t\t\t// If so, re-order the pieces then print out the solution.\n\t\t\tif (depth == pieceListBySize.size() && current.isSolved()) {\n\t\t\t\tArrayList<Point> moves = new ArrayList<Point>();\n\t\t\t\t\n\t\t\t\twhile (node.parent != null) {\n\t\t\t\t\tint index = node.level - 1;\n\t\t\t\t\tint sequence = pieceList.indexOf(pieceListBySize.get(index));\n\t\t\t\t\tPoint p = new Point(current.moveRow, current.moveCol, sequence);\n\t\t\t\t\tmoves.add(p);\n\t\t\t\t\t\n\t\t\t\t\tnode = node.parent;\n\t\t\t\t\tcurrent = node.getElement();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCollections.sort(moves);\n\t\t\t\tfor (Point p : moves) {\n\t\t\t\t\tSystem.out.println(p);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Nodes opened: \" + nodeCount);\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\t\tSystem.out.println(\"Elapsed Time: \" + ((endTime - startTime) / 1000) + \" secs.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tPiece currentPiece = pieceListBySize.get(depth);\n\t\t\tint pieceRows = currentPiece.rows;\n\t\t\tint pieceCols = currentPiece.cols;\n\t\t\t\n\t\t\tPriorityQueue<Node<GameBoard>> pQueue = new PriorityQueue<Node<GameBoard>>();\n\t\t\t\n\t\t\t// Place piece in every possible position in the board\n\t\t\tfor (int i = 0; i <= current.rows - pieceRows; i++) {\n\t\t\t\tfor (int j = 0; j <= current.cols - pieceCols; j++) {\n\t\t\t\t\tGameBoard g = current.place(currentPiece, i, j);\n\t\t\t\t\t\n\t\t\t\t\tif (totalResets - g.resets < 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t// Put in the temporary priority queue\n\t\t\t\t\tpQueue.add(new Node<GameBoard>(g, node));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Remove from priority queue 1 at a time and put into stack.\n\t\t\t// The reason this is done is so that boards with the highest reset\n\t\t\t// count can be chosen over ones with fewer resets.\n\t\t\twhile (!pQueue.isEmpty()) {\n\t\t\t\tNode<GameBoard> n = pQueue.remove();\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }",
"@Override\n\tpublic void executeMove(Game game) {\n\t\t//initiatizes the coordinate array and score\n\t\tint[]coor=new int[2];\n\t\tint score=0;\n\t\t//loops trough each coodrinate to see which would yield the highest score\n\t\t//and save that coordinate\n\t\tfor(int x = 0; x<game.getBoard().getRows(); x++){\n\t\t\tfor(int y=0; y<game.getBoard().getCols();y++){\n\t\t\t\tif(game.getBoard().validGemAt(x, y)){\n\t\t\t\t\tint current=game.getPolicy().scoreMove(x, y, game.getBoard());\n\t\t\t\t\t//when a bigger score is found it saves it \n\t\t\t\t\tif(current>score){\n\t\t\t\t\t\tscore = current;\n\t\t\t\t\t\tcoor[0]=x;\n\t\t\t\t\t\tcoor[1]=y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//calls the game to adjust score \n\t\tgame.removeGemAdjustScore(coor[0], coor[1]);\n\n\t}",
"public void hardMode(Boolean hitResult) throws LocationHitException{\r\n\t\tint x = 0, y = 0;\r\n\t\tint mostProbable;\r\n\r\n\t\tif (minMax == 0) {\r\n\t\t\tmostProbable = 1;\r\n\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\tif (probabilityGrid[i][j] > mostProbable) {\r\n\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tminMax = 1;\r\n\t\t} else {\r\n\t\t\tmostProbable = 1000;\r\n\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\tif (probabilityGrid[i][j] < mostProbable && probabilityGrid[i][j] > 0) {\r\n\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tminMax = 0;\r\n\t\t}\r\n\r\n\t\tif (!hitResult && direction.isEmpty()) {\r\n\t\t\tboolean newHit = false;\r\n\t\t\twhile (!newHit) {\r\n\t\t\t\tif (Player.userGrid[x][y] == 2 || Player.userGrid[x][y] == 3) {\r\n\t\t\t\t\tprobabilityGrid[x][y] = -1;\r\n\t\t\t\t\tif (minMax == 0) {\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] > mostProbable) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 1;\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] < mostProbable && probabilityGrid[i][j] > 0) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tnewHit = true;\r\n\t\t\t}\r\n\t\t} else if (direction.isEmpty()) {\r\n\t\t\thitFound.add(hitX + \";\" + hitY);\r\n\t\t\tcounter++;\r\n\t\t\tif ((hitX + 1) < 9) {\r\n\t\t\t\tx = hitX + 1;\r\n\t\t\t\ty = hitY;\r\n\t\t\t\tdirection = \"HorizontalFront\";\r\n\t\t\t} else {\r\n\t\t\t\tx = hitX - 1;\r\n\t\t\t\ty = hitY;\r\n\t\t\t\tdirection = \"HorizontalBack\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (direction.equals(\"HorizontalFront\")) {\r\n\t\t\t\tint tempX = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\tint tempY = Integer.parseInt(hitFound.get(0).split(\";\")[1]);\r\n\t\t\t\tif (hitResult && (hitX + 1 < 9)) {\r\n\t\t\t\t\tcounter++;\r\n\t\t\t\t\tx = hitX + 1;\r\n\t\t\t\t\ty = hitY;\r\n\t\t\t\t} else if (tempX > 0) {\r\n\t\t\t\t\tx = tempX - 1;\r\n\t\t\t\t\ty = tempY;\r\n\t\t\t\t\tdirection = \"HorizontalBack\";\r\n\t\t\t\t} else if ((Integer.parseInt(hitFound.get(0).split(\";\")[1]) + 1 < 11)) {\r\n\t\t\t\t\tx = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\t\ty = Integer.parseInt(hitFound.get(0).split(\";\")[1]) + 1;\r\n\t\t\t\t\tdirection = \"VerticalFront\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tx = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\t\ty = Integer.parseInt(hitFound.get(0).split(\";\")[1]) - 1;\r\n\t\t\t\t\tdirection = \"VerticalBack\";\r\n\t\t\t\t}\r\n\t\t\t} else if (direction.equals(\"HorizontalBack\")) {\r\n\t\t\t\tif (hitResult && (hitX > 0)) {\r\n\t\t\t\t\tcounter++;\r\n\t\t\t\t\tx = hitX - 1;\r\n\t\t\t\t\ty = hitY;\r\n\t\t\t\t} else if (Integer.parseInt(hitFound.get(0).split(\";\")[1]) + 1 < 11 && counter < 2) {\r\n\t\t\t\t\tx = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\t\ty = Integer.parseInt(hitFound.get(0).split(\";\")[1]) + 1;\r\n\t\t\t\t\tdirection = \"VerticalFront\";\r\n\t\t\t\t} else if (counter < 2) {\r\n\t\t\t\t\tx = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\t\ty = Integer.parseInt(hitFound.get(0).split(\";\")[1]) - 1;\r\n\t\t\t\t\tdirection = \"VerticalBack\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (minMax == 0) {\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] > mostProbable) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 1;\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] < mostProbable && probabilityGrid[i][j] > 0) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdirection = \"\";\r\n\t\t\t\t\thitFound.clear();\r\n\t\t\t\t\tcounter = 0;\r\n\t\t\t\t}\r\n\t\t\t} else if (direction.equals(\"VerticalFront\") && counter < 2) {\r\n\t\t\t\tif (hitResult && (hitY + 1 < 11)) {\r\n\t\t\t\t\tx = hitX;\r\n\t\t\t\t\ty = hitY + 1;\r\n\t\t\t\t} else if (Integer.parseInt(hitFound.get(0).split(\";\")[1]) > 0) {\r\n\t\t\t\t\tx = Integer.parseInt(hitFound.get(0).split(\";\")[0]);\r\n\t\t\t\t\ty = Integer.parseInt(hitFound.get(0).split(\";\")[1]) - 1;\r\n\t\t\t\t\tdirection = \"VerticalBack\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (minMax == 0) {\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] > mostProbable) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 1;\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] < mostProbable && probabilityGrid[i][j] > 0) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdirection = \"\";\r\n\t\t\t\t\thitFound.clear();\r\n\t\t\t\t\tcounter = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (hitResult && (hitY > 0) && counter < 2) {\r\n\t\t\t\t\tx = hitX;\r\n\t\t\t\t\ty = hitY - 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (minMax == 0) {\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] > mostProbable) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 1;\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\t\t\t\tif (probabilityGrid[i][j] < mostProbable && probabilityGrid[i][j] > 0) {\r\n\t\t\t\t\t\t\t\t\tmostProbable = probabilityGrid[i][j];\r\n\t\t\t\t\t\t\t\t\tx = i;\r\n\t\t\t\t\t\t\t\t\ty = j;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tminMax = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdirection = \"\";\r\n\t\t\t\t\thitFound.clear();\r\n\t\t\t\t\tcounter = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tprobabilityGrid[x][y] = -1;\r\n\t\thitX = x;\r\n\t\thitY = y;\r\n\r\n\t\tint hitCoord[] = { x, y };\r\n\t\tsetCoords(hitCoord);\r\n\r\n\t\tif (Player.userGrid[x][y] == 1) {\r\n\t\t\t// change the grid value from 1 to 2 to signify hit\r\n\t\t\tPlayer.userGrid[x][y] = 2;\r\n\t\t\tString coordx = Integer.toString(x);\r\n\t\t\tString coordy = Integer.toString(y);\r\n\t\t\tif(!time1) {\r\n\t\t\t\ttimea=java.lang.System.currentTimeMillis();\r\n\t\t\t\ttime1=!time1;\r\n\t\t\t}else if(!time2) {\r\n\t\t\t\ttimeb=java.lang.System.currentTimeMillis();\r\n\t\t\t\t\ttime2=!time2;\r\n\t\t\t}else {\r\n\t\t\t\tdouble t=timeb-timea;\r\n\t\t\t\tif(t<3000) {\r\n\t\t\t\t\tsetScore(20);\r\n\t\t\t\t}\r\n\t\t\t\ttime1=false;\r\n\t\t\t\ttime2=false;\r\n\t\t\t\ttimea=0;\r\n\t\t\t\ttimeb=0;\r\n\t\t\t\t\r\n\t\t\t}//if time between consecutive hit is less than 3 seconds ,then bonus score\r\n\t\t\tsetScore(10);\r\n\t\t\tPlayer.coordinatesHit.add(coordx + \",\" + coordy);\r\n\t\t\tsetReply(\"It's a Hit!!!!!\");\r\n\t\t} else if (Player.userGrid[x][y] == 0) {\r\n\t\t\tPlayer.userGrid[x][y] = 3;\r\n\t\t\tsetScore(-1);\r\n\t\t\tsetReply(\"It's a miss!!!!!\");\r\n\t\t} else if (Player.userGrid[x][y] == 2 || Player.userGrid[x][y] == 3) {\r\n\t\t\tsetReply(\"The location has been hit earlier\");\r\n\t\t\t//throw new LocationHitException(\"The location has been hit earlier\");\r\n\r\n\t\t}\r\n\r\n\t}",
"public void useNormalVarimax(){\n this. varimaxOption = true;\n }",
"private static void GideonsMove() {\r\n\t\tPrint print = new Print();\r\n\t\tprint.board(game);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints the entire gameBoard.\r\n\t\t\r\n\t\tboolean flag = true;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//true = Gideon's move | false = user's move\r\n\t\t\r\n\t\tArrayList<Integer> moves = MoveGenerator.Gen(flag, gamePieces);\t\t\t\t\t\t\t//returns all the legal moves possible to make by the player.\r\n\t\tPrint.moves(moves);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints all the moves returned by the Gen method.\r\n\t\t\r\n\t\t//System.out.println(\"\\n\\n Gideon will play......\" \r\n\t\t\t\t\t\t//+\"Feature coming soon, until then keep practicing\\n\");\r\n\t\t \r\n\t\tMiniMax minimax = new MiniMax(game, moves);\t\t\t\t\t\t\t\t\t\t\t\t//Declaring and initializing MiniMax object with parameters game and moves\r\n\r\n\t\tif(moves.size() < 6) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Will increment the MiniMax MAX_DEPTH size by 1 if the legal moves are less than 6\r\n\t\t\tminimax.incrementMAX_DEPTH();\r\n\t\t}\r\n\t\t\r\n\t\tlong start_time = System.nanoTime();\t\t\t\t\t\t\t\t\t\t\t\t\t//Time before starting MiniMax\r\n\t\t\r\n\t\tString gideonsMove = minimax.start();\t\t\t\t\t\t\t\t\t\t\t\t\t//Starting MiniMax\r\n\t\r\n\t\tdouble elapsed = System.nanoTime()-start_time;\t\t\t\t\t\t\t\t\t\t\t//Total time taken by MiniMax=Time after MiniMax is finished-Time before MiniMax was started\r\n\t elapsed=elapsed/1000000000;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Converting to seconds\r\n\t \r\n\t\tSystem.out.print(\"\\n\\n Gideon's move: \"+\r\n\t\t\t\tGideonsMoveConvertor.convert(gideonsMove)+\"\\n\\n\");\t\t\t\t\t\t\t\t//Changing GideonsMove to A1B2 format\r\n\t\t\r\n\t\tUpdateBoard boardUpdater = new UpdateBoard();\r\n\t\t\r\n\t\tgame = boardUpdater.playMove(gideonsMove, game, gamePieces, flag, false, true);\t\t\t//Executing the legal move on the gameBoard\r\n\t\tgamePieces = game.getGamePiecesArray();\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the updated copy of the Game Pieces Array\r\n\t\tgame.updateGameBoard();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Updating the String copy of the game board (required to print the updated gameBoard)\r\n\t\t\r\n\t\tSystem.out.println(\"Depth used for this iteration --> \"+minimax.getMAX_DEPTH());\t\t//Printing the MAX_DEPTH used by MiniMax to calculate the best move\r\n\t\tSystem.out.println(\"Time Taken for MiniMax --> \"+elapsed);\t\t\t\t\t\t\t\t//Printing time taken by MiniMax to calculate the best move\r\n\t\tSystem.out.println(\"\\n ========================\");\r\n\t\tplayersMove();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Player's turn to make a move\r\n\t\t\r\n\t}",
"private int checkerboardToState(int[][] paraCheckerboard) {\n\t\tint resultState = 0;\n\t\tint tempExponential = 1;\n\t\tfor (int i = 0; i < SIZE; i++) {\n\t\t\tfor (int j = 0; j < SIZE; j++) {\n\t\t\t\tresultState += paraCheckerboard[i][j] * tempExponential;\n\t\t\t\ttempExponential *= SIZE;\n\t\t\t} // Of for j\n\t\t} // Of for i\n\n\t\treturn resultState;\n\t}",
"public void doTestRun(int finalState) {\n\t\tint initialState = (int) (Math.random() * this.rows);\n\t\tint nextState = -1;\n\t\t\n\t\tif(initialState == finalState) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Spawning at: \" + initialState);\n\t\t\n\t\twhile(initialState != finalState) {\n\t\t\tint maxReward = -100000;\n\t\t\tnextState = initialState;\n\t\t\t\n\t\t\tfor(int j = 0; j < this.columns; j++) {\n\t\t\t\tif(this.qGrid[initialState][j] > maxReward) {\n\t\t\t\t\tmaxReward = this.qGrid[initialState][j];\n\t\t\t\t\tnextState = getStateActionMap(initialState, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint tState = initialState;\n\t\t\tinitialState = nextState;\n\t\t\tnextState = tState;\n\t\t\t\n\t\t\tSystem.out.println(\"Taking next step from \" + nextState + \" to \" + initialState + \"! For reward: \" + this.grid[nextState][initialState]);\n\t\t}\n\t\t\n\n\t}",
"public int computeGameSituation() {\n\t\treturn computeGameSituation(checkerboard);\n\t}",
"protected void evolve()\n\t\t{\tif(this_gen < NUMBER_GENERATIONS) {\n\t\t\t\t// Create a new generation.\n\t\t\t\tfloat avg_fit=Float.MIN_VALUE, max_fit=Float.MIN_VALUE, sum_fit=0;\n\t\t\t\tfloat tot_wait=0, avg_wait=0, tot_move=0, avg_move=0;\n\n\t\t\t\tfor(int i=0;i<NUMBER_INDIVIDUALS;i++) {\n\t\t\t\t\tfloat fit = calcFitness(inds[i]);\n\t\t\t\t\tinds[i].setFitness(fit);\n\t\t\t\t\tsum_fit\t += fit;\n\t\t\t\t\tmax_fit = fit>max_fit ? fit : max_fit;\n\t\t\t\t\ttot_wait += inds[i].getWait();\n\t\t\t\t\ttot_move += inds[i].getMove();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tavg_wait = tot_wait/NUMBER_INDIVIDUALS;\n\t\t\t\tavg_move = tot_move/NUMBER_INDIVIDUALS;\n\t\t\t\tavg_fit = sum_fit/NUMBER_INDIVIDUALS;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Stats of prev. gen: (a-wait,a-move)=(\"+avg_wait+\",\"+avg_move+\")\"+\" (a-fit,mx-fit)=(\"+avg_fit+\",\"+max_fit+\")\");\n\t\t\t\tSystem.out.println(\"Evolving...\");\n\t\t\t\t\n\t\t\t\t// Sorts the current Individual-array on fitness, descending\n\t\t\t\tinds = sortIndsArr(inds);\n\t\t\t\t\n\t\t\t\tint num_mating = (int) Math.floor(NUMBER_INDIVIDUALS*(1-ELITISM_FACTOR));\n\t\t\t\tint num_elitism = (int) Math.ceil(NUMBER_INDIVIDUALS*ELITISM_FACTOR);\n\t\t\t\tif(num_mating%2!=0) {\n\t\t\t\t\tnum_mating--;\n\t\t\t\t\tnum_elitism++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIndividual[] newInds = new Individual[NUMBER_INDIVIDUALS];\n\t\t\t\t\n\t\t\t\t// Tournament selection\n\t\t\t\tfor(int i=0;i<num_mating;i+=2) {\n\t\t\t\t\tIndividual mamma=null, pappa=null;\n\t\t\t\t\tfloat chn_mum = random.nextFloat();\n\t\t\t\t\tfloat chn_pap = random.nextFloat();\n\t\t\t\t\tfloat fit_mum, sum_fit2=0, sum_fit3=0;\n\t\t\t\t\tint index_mum = -1;\n\t\t\t\t\t\n\t\t\t\t\tfor(int j=0;j<NUMBER_INDIVIDUALS;j++) {\n\t\t\t\t\t\tsum_fit2 += (inds[j].getFitness()/sum_fit);\n\t\t\t\t\t\tif(chn_mum <= sum_fit2) {\n\t\t\t\t\t\t\tmamma = inds[j];\n\t\t\t\t\t\t\tindex_mum = j;\n\t\t\t\t\t\t\tfit_mum = mamma.getFitness();\n\t\t\t\t\t\t\tsum_fit2 = sum_fit-fit_mum;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor(int j=0;j<NUMBER_INDIVIDUALS;j++) {\n\t\t\t\t\t\tif(j!=index_mum) {\n\t\t\t\t\t\t\tsum_fit3 += (inds[j].getFitness()/sum_fit2);\n\t\t\t\t\t\t\tif(chn_pap <= sum_fit3) {\n\t\t\t\t\t\t\t\tpappa = inds[j];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"Mating...: \"+mamma.getFitness()+\",\"+pappa.getFitness());\n\t\t\t\t\tIndividual[] kids = mate(mamma, pappa);\n\t\t\t\t\tnewInds[i]\t= kids[0];\n\t\t\t\t\tnewInds[i+1]= kids[1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Elitism\n\t\t\t\tfor(int i=0;i<num_elitism;i++) {\n\t\t\t\t\tnewInds[i+num_mating] = inds[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tinds = newInds;\t\t\t\t\t\t\t\t\n\t\t\t\tthis_gen++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Done with evolving\");\n\t\t\t\t// set the best individual as the ruling champ?\n\t\t\t\t// do nothing\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"static int getMaxCoinValGeeks(int arr[], int n)\n {\n // Create a table to store solutions of subproblems\n int table[][] = new int[n][n];\n int gap, gapStartIndx, gapEndIndx, x, y, z;\n\n // Fill table using above recursive formula.\n // Note that the tableis filled in diagonal\n // fashion (similar to http://goo.gl/PQqoS),\n // from diagonal elements to table[0][n-1]\n // which is the result.\n for (gap = 0; gap < n; ++gap)\n {\n // both gapStartIndx and gapEndIndx are incremented in each loop iteration\n // for each gap, gapStartIndx keeps moving\n // gapEndIndx is always gap more than the gapStartIndx\n // when gap == 0, gapStartIndx = gapEndIndx\n // table[i,j] identifies the max value obtained by the player who picks first\n // first player = i to get val[i] , range of coins left = i+1, j\n // second player max value = table[i+1,j], range of coins left = i+2, j\n // first player max value = table[i+2,j]. So total value for player 1 is\n // val[i] + table[i+2, j]\n // first player picks j to get val[j], range of coins left i, j-1.\n // second player max = table[i, j-1] range of coins left i, j-2\n // first player max = table[i,j-2]\n // so for finding max value for a p\n for (gapStartIndx = 0, gapEndIndx = gap; gapEndIndx < n; ++gapStartIndx, ++gapEndIndx)\n {\n // Here x is value of F(i+2, j),\n // y is F(i+1, j-1) and z is\n // F(i, j-2) in above recursive formula\n // if gapStartIndx and gapEndIndx are two or more apart\n x = ((gapStartIndx + 2) <= gapEndIndx) ? table[gapStartIndx + 2][gapEndIndx] : 0;\n y = ((gapStartIndx + 1) <= (gapEndIndx - 1)) ? table[gapStartIndx +1 ][gapEndIndx - 1] : 0;\n z = (gapStartIndx <= (gapEndIndx - 2)) ? table[gapStartIndx][gapEndIndx - 2]: 0;\n\n table[gapStartIndx][gapEndIndx] = Math.max(arr[gapStartIndx] +\n Math.min(x, y), arr[gapEndIndx] +\n Math.min(y, z));\n }\n }\n\n return table[0][n - 1];\n }",
"public MarkovDecisionProcess(int totalWorkloadLevel, int totalGreenEnergyLevel, int totalBatteryLevel, double prob[][][][], int maxTimeInterval) {\r\n\t\tthis.totalWorkloadLevel = totalWorkloadLevel;\r\n\t\tthis.totalGreenEnergyLevel = totalGreenEnergyLevel;\r\n\t\tthis.totalBatteryLevel = totalBatteryLevel;\r\n\t\tthis.prob = prob;\r\n\t\tthis.maxTimeInterval = maxTimeInterval;\r\n\t\t\r\n\t\t//Initial State, we set it at [0,0,0]\r\n\t\tinitialState = new State(0, 0, 0, 1, -999, -1);\r\n\t\tinitialState.setPath(initialState.toString());\r\n\t\t\r\n\t\tgrid = new State[maxTimeInterval][totalWorkloadLevel][totalGreenEnergyLevel][totalBatteryLevel]; \r\n\t\t\r\n\t\t//initialize the reward matix as all 0\r\n\t\trewardMatrix = new double[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tbatteryLevelMatrix = new int[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tactionMatrix = new String[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tfor(int i = 0; i < maxTimeInterval; i++) {\r\n\t\t\tfor(int j = 0; j < totalWorkloadLevel*totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalWorkloadLevel*totalGreenEnergyLevel; k++) {\r\n\t\t\t\t\trewardMatrix[i][j][k] = 0.0;\r\n\t\t\t\t\tbatteryLevelMatrix[i][j][k] = 0;\r\n\t\t\t\t\tactionMatrix[i][j][k] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t//Initialize actions space, \r\n\t\tnumActions = totalWorkloadLevel * totalBatteryLevel;\r\n\t\t\r\n\t\tfor(int t =0; t < maxTimeInterval; t++) {\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\tgrid[t][i][j][k] = new State(i ,j, k, prob[t][i][j][k], 0.0, t);\r\n\t\t\t\t\tif( t == maxTimeInterval - 1) {\r\n\t\t\t\t\t\tgrid[t][i][j][k].setTerminate();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\t\r\n\t\treachableStates = new Vector(totalWorkloadLevel*totalGreenEnergyLevel*totalBatteryLevel);\r\n\t\t\t\r\n\t}",
"public int gameOver(){\n\t\tfor(int i=0;i<3;i++){\n\t\t\tif(banmen[i][0]==1&&banmen[i][1]==1&&banmen[i][2]==1){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(banmen[0][i]==1&&banmen[1][i]==1&&banmen[2][i]==1){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(banmen[i][0]==2&&banmen[i][1]==2&&banmen[i][2]==2){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tif(banmen[0][i]==2&&banmen[1][i]==2&&banmen[2][i]==2){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}\n\t\tif(banmen[0][0]==1&&banmen[1][1]==1&&banmen[2][2]==1){\n\t\t\treturn 1;\n\t\t}\n\t\tif(banmen[0][2]==1&&banmen[1][1]==1&&banmen[2][0]==1){\n\t\t\treturn 1;\n\t\t}\n\t\tif(banmen[0][0]==2&&banmen[1][1]==2&&banmen[2][2]==2){\n\t\t\treturn 2;\n\t\t}\n\t\tif(banmen[0][2]==2&&banmen[1][1]==2&&banmen[2][0]==2){\n\t\t\treturn 2;\n\t\t}\n\t\tfor(int i=0;i<3;i++){\n\t\t\tfor(int j=0;j<3;j++){\n\t\t\t\tif(banmen[i][j]==0){\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}"
] | [
"0.7092399",
"0.69232374",
"0.68224406",
"0.67673165",
"0.67570066",
"0.65509194",
"0.6539742",
"0.6481702",
"0.64794666",
"0.64486223",
"0.6394819",
"0.63594675",
"0.63210154",
"0.62925184",
"0.6275498",
"0.6251788",
"0.62452495",
"0.6228118",
"0.6217239",
"0.61908495",
"0.61840904",
"0.61506295",
"0.61452097",
"0.6003897",
"0.5989191",
"0.59776103",
"0.59734267",
"0.595843",
"0.59555304",
"0.5948664",
"0.5935839",
"0.5923623",
"0.5923527",
"0.5917535",
"0.58983773",
"0.5897882",
"0.58896035",
"0.58860576",
"0.5857201",
"0.58556855",
"0.5845951",
"0.58246064",
"0.582039",
"0.580548",
"0.58015406",
"0.58010894",
"0.57974094",
"0.5793894",
"0.57924616",
"0.57860047",
"0.57758945",
"0.5747961",
"0.573389",
"0.57180107",
"0.5710665",
"0.57092226",
"0.5707332",
"0.5702335",
"0.5701001",
"0.569453",
"0.56896704",
"0.56820107",
"0.567004",
"0.56699044",
"0.5661707",
"0.56492966",
"0.5629453",
"0.5623623",
"0.5619671",
"0.5608393",
"0.56017584",
"0.55971026",
"0.5586197",
"0.5583526",
"0.55785525",
"0.5578542",
"0.55753136",
"0.55722326",
"0.5569664",
"0.5569607",
"0.5569375",
"0.5560527",
"0.55427337",
"0.5526552",
"0.5520318",
"0.55163425",
"0.5510254",
"0.55087864",
"0.54986376",
"0.5490957",
"0.5487386",
"0.5483577",
"0.5473545",
"0.5470682",
"0.54703796",
"0.54608315",
"0.54590327",
"0.5452722",
"0.544999",
"0.5444851"
] | 0.67492074 | 5 |
Execute specified move. This will also change the game state after the move has been executed. | private void executeMove(Move move) {
//System.out.println("executing move");
this.chessGame.movePiece(move);
this.chessGame.changeGameState();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void moveSuccessfullyExecuted(Move move) {\n\t\tSystem.out.println(\"executed: \"+move);\r\n\t}",
"GameState performMove(String guid, String username, int x, int y) throws GameStateException, GamePlayException;",
"private void executeMove(Move move, char symbol) {\n if (this.isValidMove(move) == 'V') {\n this.board[move.row][move.col] = symbol;\n }\n }",
"@Override\n\tpublic void executeMove(Player player, Board gameBoard, int turn, int startRow, int startCol, int endRow,\n\t\t\tint endCol) {\n\t\t\n\t}",
"private GameState doMove(Move move, Player player, GameState state) {\n\t\tGameState newState = state.deepClone();\n\t\tplayer = Main.getSWController().getPlayerController().getPlayer(player.getName(), newState);\n\t\tswitch (move.getAction()) {\n\t\tcase OLYMPIA:\n\t\tcase BUILD:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tplayer.getBoard().addCard(move.getCard());\n\t\t\tplayer.setChooseCard(null);\n\t\t\tif (move.getCard().getEffects() != null)\n\t\t\t\tfor (Effect effect : move.getCard().getEffects())\n\t\t\t\t\tif (effect.getType() == EffectType.WHEN_PLAYED)\n\t\t\t\t\t\teffect.run(player, newState, newState.isTwoPlayers());\n\t\t\tif (move.getTradeOption() != null)\n\t\t\t\tMain.getSWController().getPlayerController().doTrade(newState, player, move.getTradeOption());\n\t\t\tbreak;\n\t\tcase PLACE_SLOT:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tswitch (player.getBoard().nextSlot()) {\n\t\t\tcase 0:\n\t\t\t\tplayer.getBoard().slot1();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tplayer.getBoard().slot2();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tplayer.getBoard().slot3();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tplayer.getBoard().fill(player.getBoard().nextSlot());\n\t\t\tplayer.setChooseCard(null);\n\t\t\tif (move.getTradeOption() != null)\n\t\t\t\tMain.getSWController().getPlayerController().doTrade(newState, player, move.getTradeOption());\n\t\t\tbreak;\n\t\tcase SELL:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tplayer.addCoins(3);\n\t\t\tplayer.setChooseCard(null);\n\t\t}\n\n\t\treturn newState;\n\t}",
"void doMove(int move, int piece) {\n //makes a move on the offscreen board\n currentBoard.makeMove(move, piece);\n //displays the move in the GUI\n changeColourSquare(move);\n //changes turn\n turn = !turn;\n }",
"@Override\n\tprotected void execute() {\n\t\tif(Robot.clawSubsystem.clawGetState() == Value.kForward) {\n\t\t\t// If we aren't already, retract\n\t\t\tRobot.clawSubsystem.clawClose();\n\t\t\ttry {\n\t\t\t\t// wait 5 seconds\n\t\t\t\tSystem.out.println(\"Waiting and trying to move\");\n\t\t\t\t//Thread.sleep(5000);\t\t\t\t\t\t\t\t\t//Blocking Method @TODO replace with sensor/ nonblocking method\n\t\t\t} finally {\n\t\t\t\tSystem.out.println(\"Done\");\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\t// check if solenoid is retracted\n\t\telse if (Robot.clawSubsystem.clawGetState() == Value.kReverse) {\n\t\t\t// If we aren't already, extend\n\t\t\tRobot.clawSubsystem.clawOpen();\n\t\t\ttry {\n\t\t\t\t// wait 5 seconds\n\t\t\t\tSystem.out.println(\"Waiting and trying to move\");\n\t\t\t\t//Thread.sleep(5000);\t\t\t\t\t\t\t\t\t//Blocking Method @TODO replace with sensor/ nonblocking method\n\t\t\t} finally {\n\t\t\t\tSystem.out.println(\"Done\");\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\t//If we are neither extended nor retracted, leave it alone\n\t\telse {\n\t\t\tSystem.out.println(\"What?\");\n\t\t}\t \n\t}",
"@Override\n\tpublic void excute() {\n\t\tmoveEvent.move(commandinfo.getValue() * 200);\n\t}",
"@Override\r\n\tpublic void makeMove(A action) {\r\n\t\tgame.execute(action);\r\n\t}",
"@Override\n public void execute() {\n String nextPlayer = CModel.getInstance().getCurrGame().advancePlayerTurn();\n if(nextPlayer.equals(CModel.getInstance().getMyUser().getUserName())) {\n CModel.getInstance().setCurrGameState(new MyTurn());\n }\n else {\n //update the player stats\n CModel.getInstance().setCurrGameState(new NotMyTurn());\n }\n CModel.getInstance().updatePlayerStatsView();\n }",
"public void execute() {\r\n\t\tif(policy.moveByPolicy(level2d))\r\n\t\titem.move_up(level2d);\r\n\t\telse\r\n\t\t\tSystem.out.println(\"cant do the action\");\r\n\t\t\r\n\t}",
"@Override\n\tpublic GridCell execute() {\n\t\t//1. if there is a winning position, take it\n\t\tArrayList<GridCell> winningCell = TicTacToeBoardExaminer.getWinningPositions(board, side);\n\t\tif (winningCell.size() > 0) {\n\t\t\tGridCell move = winningCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//2. if there is a losing position, block it\n\t\tArrayList<GridCell> losingCell = TicTacToeBoardExaminer.getLosingPositions(board, side);\n\t\tif (losingCell.size() > 0) {\n\t\t\tGridCell move = losingCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//TODO: Implement checking of forks. This will get you to 100% win or tie rate\n\t\t\n\t\t//3. Otherwise get the optimal position\n\t\tGridCell optimal = TicTacToeBoardExaminer.getOptimal(board, side);\n\t\tif (optimal != null)\n\t\t\treturn optimal;\n\t\t\n\t\t//4. Otherwise just move randomly\n\t\telse \n\t\t\treturn new RandomStrategy(board, side).execute();\n\t\t\n\t}",
"protected void execute() {\r\n \tmanipulator.moveElevator(speed);\r\n }",
"private void move(MoveAction moveAction) {\n Move move = moveAction.getLoad();\n Container selectedContainer = mContainersManager.getContainer(move.getBowlNumber());\n boolean anotherRound = false;\n\n if (isAValidMove(move.getPlayer(), selectedContainer)) {\n anotherRound = spreadSeedFrom(move.getBowlNumber());\n\n if (isGameEnded()) {\n Action gameEnded;\n if (!mEvenGame) {\n gameEnded = new Winner(mWinner, getRepresentation(), mContainersManager.getAtomicMoves());\n } else {\n gameEnded = new EvenGame(getRepresentation(), mContainersManager.getAtomicMoves());\n }\n\n postOnTurnContext(gameEnded);\n } else {\n postOnTurnContext(new BoardUpdated(getRepresentation(),\n anotherRound, mContainersManager.getAtomicMoves()));\n }\n\n } else if (!isGameEnded()) {\n postOnTurnContext(new InvalidMove(\n move,\n getRepresentation(),\n mActivePlayer\n ));\n }\n\n\n }",
"public void executeCommand(ChessPiece piece)\n {\n piece.getBoardMediator().movePiece(piece);\n }",
"protected void execute() {\n \tRobot.driveSubsystem.runLeftSide(howFastWeWantToMove);\n }",
"@Override\r\n public void run() {\r\n move();\r\n }",
"public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }",
"public void act() \r\n {\r\n move();\r\n }",
"public int doAction(GameBoard gameBoard, PlayerMove playerMove, List<Player> roundPlayerOrder, Turn turn){\n\n this.playerMove = playerMove;\n switch (playerMove.getTypeOfChoice()){\n case PICK:\n return pickExecution(playerMove, gameBoard);\n\n case PASS:\n return 0;\n\n default:\n return 3000;\n }\n }",
"@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}",
"public void execute(A action) {\n\t\tS testState=action.applyTo(currentState);\n\t\tif (stop ||testState.equals(null)){\n\t\t\tString text=\"Impossible to make the action: \";\n\t\t\t\n\t\t\tif(stop){\n\t\t\t\ttext+=\"The game was stopped before \";\n\t\t\t}\n\t\t\telse if(testState.equals(null)){\n\t\t\t\ttext+=\"The game should start before realize an action\";\n\t\t\t}\n\t\t\t\n\t\t\tGameError error=new GameError(text);\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Error, null,currentState, error, error.getMessage()));\n\t\t\tthrow error;\n\t\t\t\n\t\t\t\t\t\n\t\t}else{\n\t\t\tthis.currentState=testState;\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Change, action, currentState, null,\"The game has change\"));\n\t\t\t\t\n\t\t}\n\t\t\t\n\t\n \t}",
"public void executegenmoves() {\n \t\tObject state = gm.hashToState(new BigInteger(conf.getProperty(\"gamesman.hash\")));\n \t\tfor (Object nextstate : gm.validMoves(state)) {\n \t\t\tSystem.out.println(gm.stateToHash(nextstate));\n \t\t\tSystem.out.println(gm.displayState(nextstate));\n \t\t}\n \t}",
"public void move() throws InstructionExecutionException\r\n\t{\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\tStreet street=this.getHeadingStreet();\r\n\t\t\tif(street==null){\r\n\t\t\t\tString err=\"WALL·E says: There is no street in direction \"+this.getCurrentHeading();\r\n\t\t\t\tif(isSwing()){\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, err);\r\n\t\t\t\t}\r\n\t\t\t\tthrow new InstructionExecutionException(err);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tPlace nextPlace=street.nextPlace(this.currentPlace);\r\n\t\t\tif (street.isOpen()){\r\n\t\t\t\tthis.currentPlace=nextPlace;\r\n\t\t\t\tif(isSwing()){\r\n\t\t\t\t\tthis.navigationPanel.updateCell(currentDirection, nextPlace);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tString err=\"WALL·E says: Arrggg, there is a street but it is closed!\";\r\n\t\t\t\tif(isSwing()){\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, err);\r\n\t\t\t\t}\r\n\t\t\t\tthrow new InstructionExecutionException(err);\r\n\t\t\t}\r\n\t\t}catch (Exception e){\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t}",
"public void setMove(int move) {\n this.move = move;\n }",
"@Override\n\tpublic void moveExecFinished(ReadOnlyBoard board, Counter player,\n\t\t\tCounter nextPlayer) {\n\n\t}",
"protected void execute() {\n \tif(Robot.robotState != Robot.RobotState.Climbing)\n \t\tRobot.shooter.speed(speed);\n }",
"public abstract Position executeMovement(Position pos, Surface surface);",
"public void act() \n {\n move(5);\n turn(4);\n }",
"public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}",
"public boolean execute(int action, Point nextposition, double x, double y, int direction) {\n Player currentPlayer = getTurn();\n boolean success = false;\n if (action == 0) {\n success = currentPlayer.walk(board, nextposition);\n }\n if (action == 1) {\n success = currentPlayer.putPlank(board, x, y, direction);\n }\n if (action == 2) {\n winner = getPlayer(1-currentPlayer.getLabel());\n return true;\n }\n// if (isWin(getTurn(), getTurn().getPosition())) {\n// return true;\n// }\n // move is valid, finish and switch turns.\n isWin(currentPlayer, currentPlayer.getPosition());\n if (success) {\n finish();\n return true;\n }\n return false;\n }",
"public void act(){\n\t\tTile[] possibleMoves = game.getAllNeighbours(currentPosition);\r\n\t\tTile targetTile = possibleMoves[rng.nextInt(4)];\r\n\t\tmove(targetTile);\r\n\t}",
"P applyMovement(M move);",
"public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}",
"public PuzzleState move(int row, int column, Operation op);",
"@Override\n public void executeAction(Game game) {\n game.tryPlaceBomb(this.player.getId());\n game.tryDoMove(this.player.getId(), this.direction);\n }",
"@Override\n \t\t\t\tpublic void doMove() {\n \n \t\t\t\t}",
"public abstract void move(int newXPosition, int newYPosition, PiecePosition position) throws BoardException;",
"@Override\r\n public void makeMove(Board board) {\n System.out.println(\"Next to Play: \" + SidetoString(switchSide(board.currentSide))); //Prompt information, similar to example script.\r\n System.out.println(PlayertoString());\r\n System.out.println(\"This is probably a good move!\");\r\n Random random = new Random();\r\n List<Move> MovePool = board.getAllValidMovesForPlayers(getSide()); //Get all available Moves.\r\n float StartTime = System.nanoTime();\r\n Move move = MovePool.get(random.nextInt(MovePool.size())); //Get a random Move.\r\n float EndTime = System.nanoTime();\r\n board.processMove(move, getSide()); //Make Move then print out time taken, similar to example script.\r\n System.out.println(\"Move made: \" + board.PieceTypeToString(board.getPieceType(move.sequence.get(move.length - 1).end_row, move.sequence.get(move.length - 1).end_col)) + \": \" + move.toString());\r\n TurnTime = ((EndTime - StartTime) / 1000000000.f);\r\n System.out.format(\"Time taken: %.3f\\n\", TurnTime);\r\n TotalTimeTaken += TurnTime;\r\n TurnTime = 0;\r\n }",
"protected void execute() {\n\t\tshooter.runShooter(power);\n\t}",
"public void singleMove(int move) {\n moveCO(move);\n moveCP(move);\n moveEO(move);\n moveEP(move);\n }",
"public State execute(int command, State state);",
"public boolean makeMove(GameState gameState);",
"public void commitMove() {\n // Nothing currently staged\n if ( board.currentState() == Board.NORMAL ) {\n // Dilemma - nulling this now helps the gui know that nothing was committed\n // However, it prevents us from referencing the previous move if an errant commit occurs\n lastCommittedMove = null;\n return;\n }\n\n lastCommittedMove = Assistant.WordPlay.boardMakeMove(board, this.masterDictionary());\n board.finishPlayingTiles();\n\n // Move was invalid\n if ( lastCommittedMove == null ) { return; }\n \n // Commit the move and re-draw tiles\n board.add(lastCommittedMove);\n drawNewTiles(lastCommittedMove);\n\n if ( rack.size() == 0 ) {\n state = GAMEOVER;\n moves = new MovePackage();\n } else {\n moves = Assistant.WordPlay.boardFindall(board, rack, masterDictionary());\n }\n }",
"protected void execute() {\n \tdouble moveValue = -1.0;\n \t\n \tif (useSmoothing) {\n\t \tif (Robot.clawElevator.getContainerHeight() == 0) {\n\t \t\t// TODO Something or other\n\t \t} else {\n\t \t\tdouble percentError = Math708.getPercentError(Robot.clawElevator.getTravelDistance(), Constants.CLAW_ELEVATOR_DOWN_TRAVEL_DISTANCE[Math.abs(Robot.clawElevator.getContainerHeight() - 3)]);\n\t \t\t\n\t \t\tif (percentError <= 0.5) {\n\t \t\tmoveValue = Math708.makeWithin(percentError, moveValue, -Constants.CLAW_ELEVATOR_MOTOR_MINIMUM);\n\t \t}\n\t \t}\n \t}\n \t\n \tRobot.clawElevator.manualMove(moveValue);\n }",
"public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);",
"public void performActions(){\n GameInformation gi = this.engine.getGameInformation();\n\n if(gi.getTeam() == 0)\n this.engine.performPlayerAction(\n new MoveAction(src, dst)\n );\n\n }",
"public void move() {\n process(2);\n }",
"boolean doMove();",
"public void turn(Player player,String move) {\n String[] art = move.split(\" \");\n int x=Integer.parseInt(art[1]);\n int y=Integer.parseInt(art[2]);\n board.mark(player.getMark(),x-1,y-1);\n board.checkFinishCondition();\n if(board.isFinished()){\n finished = true;\n winner = order;\n }\n int aux = (order + 1) % 2;\n order = aux;\n }",
"public void move(){\n System.out.println(\"I can't move...\");\n }",
"public abstract boolean changeMove();",
"@Override\n protected void execute() \n {\n move(Robot.oi.mechJoystick);\n }",
"public static void mctsDoMove(int move, int[] board, int curPlayer){\n int xq = move & 0xf;\n int yq = (move & 0xf0) >> 4;\n int xm = (move & 0xf00) >> 8;\n int ym = (move & 0xf000) >> 12;\n int xs = (move & 0xf0000) >> 16;\n int ys = (move & 0xf00000) >> 20;\n \n board[yq*GRID+xq] = BLANK;\n board[ym*GRID+xm] = curPlayer;\n board[ys*GRID+xs] = ARROW;\n }",
"public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }",
"void playerMove(State state);",
"public boolean executeMove(Game game) throws UnsupportedOperationException{\n throw new UnsupportedOperationException(GENERIC_EXECUTION_ERROR_MESSAGE);\n }",
"public void setMove(int move){\n this.move = move;\n }",
"public void act() {\n\t\tif (canMove2()) {\n\t\t\tsteps += 2;\n\t\t\tmove();\n\t\t} else {\n\t\t\tturn();\n\t\t\tsteps = 0;\n\t\t}\n\t}",
"public void play(IMove move) {\n if (isGameOver || move.getPlayer() != currentTurn) {\n return;\n }\n\n move.accept(this);\n\n if (!isGameOver) {\n endTurn();\n }\n }",
"public void execute() {\n RobotContainer.drive.turnToAngle(this.angle, turnSpeed);\n }",
"public abstract void move(Position position);",
"protected void execute() {\n \toi.updateToggleLift();\n if(oi.toggleOnLift){\n \t// The commands here will occur if the TorqueLift toggle switch\n \t// is activated. All code here will only run after the button\n \t// has been toggled.\n \tif (limitswitch.getReadyState()) { \n \ttorquelift.swap();\n \ttorquelift.moveAllMotors(oi.getLiftSpeed());\n \t} else {\n \t\t// activates when the limit switch is pressed\n \t\ttorquelift.moveAllMotors(oi.getLiftYUpSpeed());\n \t}\n } else {\n \t// The commands here will occur normally, when the TorqueLift is\n \t// not activated.\n \treturn;\n }\n }",
"public void performMove(RubiksMove move) {\n RubiksCube initialState = new RubiksCube(this);\n\n printCube(\"PRE: \" + move);\n\n switch (move) {\n case UP:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.UP);\n\n break;\n case DOWN:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.DOWN);\n\n break;\n case LEFT:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.LEFT);\n\n break;\n case RIGHT:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.RIGHT);\n\n break;\n case FRONT:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.FRONT);\n\n break;\n case BACK:\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.BACK);\n\n break;\n case UP2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.UP);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.UP);\n\n break;\n case DOWN2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.DOWN);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.DOWN);\n\n break;\n case LEFT2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.LEFT);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.LEFT);\n\n break;\n case RIGHT2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.RIGHT);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.RIGHT);\n\n break;\n case FRONT2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.FRONT);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.FRONT);\n\n break;\n case BACK2:\n\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.BACK);\n initialState = new RubiksCube(this);\n moveFaceClockwise(initialState, RubiksFace.RubiksFacePosition.BACK);\n\n break;\n case INVERSE_UP:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.UP);\n\n break;\n case INVERSE_DOWN:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.DOWN);\n\n break;\n case INVERSE_LEFT:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.LEFT);\n\n break;\n case INVERSE_RIGHT:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.RIGHT);\n\n break;\n case INVERSE_FRONT:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.FRONT);\n\n break;\n case INVERSE_BACK:\n\n moveFaceAntiClockwise(initialState, RubiksFace.RubiksFacePosition.BACK);\n\n break;\n }\n\n printCube(\"POST: \" + move);\n\n }",
"ProgramState execute(ProgramState state) ;",
"protected void execute() {\r\n if (machineState != 5) {\r\n shootAtBeginAutonomous();\r\n } else if (machineState == 5) {\r\n if (!lineFound()) {\r\n initalizeFeederAndShooter();\r\n Robot.chassis.driveMecanumNormalized(-0.5, 0, 0);\r\n } else {\r\n driveOnLine();\r\n shootOnce();\r\n }\r\n }\r\n }",
"public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}",
"@Override\n public void update(Move move) {\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n if (move == null) {\n printBoard();\n System.out.println(\"Opponent Passed\");\n return;\n }\n System.out.println(\"Your turn: \"+player);\n board.update(move, enemy.player);\n printBoard();\n\n }",
"protected void execute() { \n\n double move = driveCommand.getValue();\n double turn = angleCommand.getValue();\n\n SmartDashboard.putNumber(\"move\", move);\n SmartDashboard.putNumber(\"turn\", turn);\n //add the values to the drive class\n Robot.drive.arcadeDrive(-move, turn);\n // Robot.drive.setMoveVisionAssist(move);\n // Robot.drive.setTurnVisionAssist(turn);\n }",
"@Override\n public Optional<String> execute() {\n /* Put the game engine into XBoard mode. */\n GameState.setXBoardMode(true);\n\n /* Send a new line over to XBoard to let it know we're ready to kick some ass. */\n return Optional.of(\"\");\n }",
"@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"하늘을 날다\");\n\t}",
"public abstract void makeMove(GameStatus gameStatus);",
"public void play(long move)\r\n {\r\n bitboard ^= mask;\r\n mask |= move;\r\n moves++;\r\n }",
"public State execute(Agent a, State s) {\n\n\t\tint dir;\n\t\tint newDir;\n\t\tVacuumState state = null;\n\n\t\tif (s instanceof VacuumState)\n\t\t\tstate = (VacuumState)s;\n\t\telse\n\t\t\tSystem.out.println(\"ERROR - Argument to TurnLeft.execute() is not of type VacuumState\");\n\n\t\t/* since we will be copying the state and bumps depend only on the\n current move, unset the bump condition */\n\t\tstate.setBump(false);\n\n\t\tdir = state.getAgentDir();\n\n\t\tnewDir = dir - 1;\n\t\tif (newDir < 0)\n\t\t\tnewDir = 3;\n\t\tstate.setAgentDir(newDir);\n\t\treturn state;\n\t}",
"@Override\n\tdefault void onExecution(Player player, Position start, Position end) {\n\n\t\tForceMovement forceMovement = new ForceMovement(player.getPosition(),\n\t\t\t\tnew Position(player.getX(), player.getY() - 3, player.getHeight()), 12, 2, Direction.SOUTH);\n\t\tWorld.schedule(new ForceMovementTask(player, 0, forceMovement, new Animation(5043)) {\n\t\t\t@Override\n\t\t\tprotected void onCancel(boolean logout) {\n\t\t\t\tsuper.onCancel(logout);\n\t\t\t\tWorld.schedule(new Task(1) {\n\t\t\t\t\tint ticks = 0;\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void execute() {\n\t\t\t\t\t\tswitch (ticks++) {\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tplayer.move(new Position(player.getX(), player.getY(), player.getHeight() + 1));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tplayer.move(end);\n\t\t\t\t\t\t\tcancel();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}",
"public void move(){\n\t\t\n\t}",
"void move();",
"public void act() {\n\t\tif (canMove()) {\n\t\t\tif (isOnBase()) {\n\t\t\t\tif (steps < baseSteps) {\n\t\t\t\t\tmove();\n\t\t\t\t\tsteps++;\n\t\t\t\t} else {\n\t\t\t\t\tturn();\n\t\t\t\t\tturn();\n\t\t\t\t\tturn();\n\t\t\t\t\tsteps = 0;\n\t\t\t\t}\n\t\t\t} else if (steps == baseSteps / 2) {\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tsteps++;\n\t\t\t} else if (steps == baseSteps + 1) {\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tsteps = 0;\n\t\t\t} else {\n\t\t\t\tmove();\n\t\t\t\tsteps++;\n\t\t\t}\n\t\t} else {\n\t\t\tturn();\n\t\t\tturn();\n\t\t\tturn();\n\t\t\tsteps = 0;\n\t\t}\n\t}",
"public void move();",
"public void move();",
"@Override\n\tpublic GameState execute(GameState initial) {\n\t\tGameState g = new GameState(initial, this);\n\n\t\tCard c = null;\n\t\tswitch (moveOrigin) {\n\t\tcase DRAW_PILE:\n\t\t\tc = g.board.drawPile.remove();\n\t\t\tbreak;\n\n\t\tcase PLAY_POSITION:\n\t\t\tPlayPosition p = g.board.playPositions[cardIntitialPlayAreaColumn];\n\t\t\tc = p.removeCardFromPile();\n\t\t\tbreak;\n\n\t\tcase SCORING_POSITION:\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"Non-sensical to have a scoring move from a scoring position\");\n\t\t}\n\n\t\tg.board.scoringPositions[destinationColumn].addCardToPile(c);\n\n\t\treturn g;\n\t}",
"@Override\n public void executeState(Controller controller) {\n // controller.getGame().setEndTurn(false);\n\n controller.setUndoCheckFlag(false);\n controller.setGoOn(true);\n controller.getGame().setTargetSelected(null);\n controller.getGame().setTargetInUse(null);\n\n\n controller.getGame().setCurrentPlayer(controller.getNextPlayer(controller.getGame().getCurrentPlayer()));\n controller.saveAll();\n controller.setCanSkip(false);\n Player currentPlayer= controller.getGame().getCurrentPlayer();\n currentPlayer.setHasBeenMoved(false);\n currentPlayer.setHasBuilt(false);\n currentPlayer.setDefeat(false);\n currentPlayer.setInQue(false);\n\n\n Square square [][]=controller.getGame().getField().getSquares();\n\n for(int x=0; x<5;x++)\n for(int y=0; y<5; y++)\n square[x][y].setStart_level(square[x][y].getLevel());\n\n\n for(Worker w: currentPlayer.getWorkers()){\n w.setSquareNotAvailable(null);\n w.setMandatorySquare(null);\n w.resetHystoricPos();\n w.setCanBeMoved(true);\n w.setCanBuild(true);\n }\n\n currentPlayer.getGod().setCantDo(new ArrayList<>());\n\n\n\n }",
"public void move() {\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t}",
"public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}",
"public boolean move();",
"@Override\n public void run(GameState gameState, MoveMaker move)\n throws AssertionError,\n UnsupportedOperationException,\n IllegalArgumentException {\n out.println(\"This is just an example\");\n\n // Set up the GameState for the test\n gameState.setWhoseTurn(0);\n\n // Do something in the game with the MoveMaker interface\n move.endTurn();\n\n // Check the GameState responded as expected\n // The tester will mark a test as failed if an assert is false\n assert (gameState.getWhoseTurn() == 1);\n move.endTurn();\n assert (gameState.getWhoseTurn() == 0);\n\n // The tester will automatically print the things every test\n // should have. These include a smiley, and \"You Are Awesome!\"\n }",
"public abstract Piece movePiece(Move move);",
"public EvalMove(double eval, Move move) {\n this.eval = eval;\n this.move = move;\n }",
"private void HandleOnMoveStart(Board board, Piece turn){}",
"@Override\n public void run() {\n chosenActionUnit.run(getGame(), inputCommands);\n }",
"private static void runSoldier() throws GameActionException {\n\t\tif (rc.isActive()) {\n//\t\t\tint mapLoc = rc.readBroadcast(0);\n\t\t\tint mapLoc = 1010;\n\t\t\tif (curLoc.equals(new MapLocation(mapLoc / 100, mapLoc % 100))) {\n//\t\t\t\trc.construct(RobotType.PASTR);\n\t\t\t} else {\n\t\t\t\tsimpleMove(curLoc.directionTo(new MapLocation(mapLoc / 100, mapLoc % 100)));\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public boolean applyMove(Move m) {\n // Ensure the from and to are reasonable\n if (m.from > 80 || m.to > 80 || m.from == m.to)\n return false;\n\n // Check the move\n // FIXME: This should be uncommented once you have getMoves working!!\n \n // if (!isValidMove(m))\n // return false;\n \n //remove the hash value where you are about to apply the move\n hash ^= rand[m.from * 3 + board[m.from]] ^ rand[m.to * 3 + 0];\n\n\n // Apply the move\n int temp = board[m.from];\n board[m.from] = board[m.to];\n board[m.to] = temp;\n \n turnCount++;\n \n //put the new hash value after you apply the move\n hash ^= rand[m.from * 3 + 0] ^ rand[m.to * 3 + board[m.to]];\n \n \n // Update whose turn it is\n swapTurn();\n\n return true;\n }",
"protected void execute ()\n\t{\n\t\t//Take and process new image every .5 seconds\n\t\tif (System.currentTimeMillis() % 500 == 0)\n\t\t{\n\t\t\tSubsystems.goalVision.processNewImage();\n\t\t}\n\n\t\tif (Subsystems.goalVision.getProportionalGoalX() < X_OFFSET\n\t\t - DEADBAND)\n\t\t//the goal is to the left\n\t\t{\n\t\t\t//turn left\n\t\t\tSubsystems.transmission.drive(motorRatio, -motorRatio);\n\t\t}\n\t\t//the goal is to the right\n\t\telse if (Subsystems.goalVision.getProportionalGoalX() > X_OFFSET\n\t\t + DEADBAND)\n\t\t{\n\t\t\t//turn right\n\t\t\tSubsystems.transmission.drive(-motorRatio, motorRatio);\n\t\t}\n\t}",
"public Move movePiece(int turn) {\n\t\tboolean error = false;\n\t\tString moveInput = null;\n\t\tString origin = null;\n\t\tboolean isCorrectTurn = false;\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tdo {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Which piece would you like to move?\");\n\t\t\t\t\torigin = keyboard.next();\n\n\t\t\t\t\tif(validateInput(origin)) {\n\t\t\t\t\t\tSystem.out.println(\"Error in input, please try again\");\n\t\t\t\t\t\terror = true; \n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\terror = false;\n\t\t\t\t\t}\n\n\t\t\t\t}while(error);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString xOrigin = origin.substring(0, 1);\n\t\t\t\tint yOrigin = Integer.parseInt(origin.substring(1,2));\n\t\t\t\tint convertedXOrigin = convertXPosition(xOrigin);\n\t\t\t\tyOrigin -= 1;\n\t\t\t\t\nif((board.getBoard()[yOrigin][convertedXOrigin] == turn) || (board.getBoard()[yOrigin][convertedXOrigin] == (turn + 2))) {\n\t\t\t\tisCorrectTurn = true;\n\t\t\t\tChecker checker = validatePiece(convertedXOrigin, yOrigin);\t\n\t\t\t\tdo {\n\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Where would you like to move\");\n\t\t\t\t\t\t moveInput = keyboard.next();\n\t\t\t\t\t\tif(validateInput(moveInput)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Error in Input, please try again\");\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = false;\n\t\t\t\t\t\t//\tSystem.out.println(\"No errors found with input move\");\n\t\t\t\t\t\t}\n\n\t\t\t\t} while(error);\n\t\t\t\t\n\t\t\t\tString xMove = moveInput.substring(0, 1);\n\t\t\t\tint yMove = Integer.parseInt(moveInput.substring(1,2));\n\t\t\t\tint convertedXMove = convertXPosition(xMove);\n\t\t\t\tyMove -= 1;\n\t\t\t\tboolean isMovingRight = isMovingRight(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tboolean isMovingDown = isMovingDown(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tMove move = null;\n\t\t\t\t\n\t\t\t\t//checks to see if the move itself is valid\n\t\t\t\ttry {\nif(isMoveValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\tif(isSpaceTaken(convertedXMove, yMove)) {\n\t\t\t\t\t//System.out.println(\"Space is taken\");\n\t\t\t\t\tif(isPieceEnemy(convertedXMove, yMove, checker, turn)) {\n\t\t\t\t\t\tif(isJumpValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\t\t\t\tif(isMovingRight) {\n\t\t\t\t\t\t\t\t//checks to see if the piece is moving up or down\n\t\t\t\t\t\t\t\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right and down\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right, but up\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means its moving left and down\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means it's moving left and up\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//System.out.println(\"Space isn't taken\");\n\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintBoard();\n\t\t\t\t\t\treturn move;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\tupdateBoard(move);\n\t\t\t\t\t\n\t\t\t\t\tprintBoard();\n\t\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Error in move\");\n\t\t\t\t//System.out.println(\"It's not your turn\");\n\t\t\t\tisCorrectTurn = false;\n\t\t\t\t}\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tSystem.out.println(\"NullPointerException - Error\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n}\n\n\n\n\t\t\t\t\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\tupdateBoard(move);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error in Input. Please try again\");\n\t\t\t}\n\t\t\n\t\t}while(!isCorrectTurn);\n\n\t\tprintBoard();\n\t\treturn null;\n\t\t\n\t}",
"@Override\n public void execute() {\n if (Players.getLocal().getAnimation() == -1) {\n // Teleport to Edgeville if we aren't there, walk to the bank if we are.\n if (!Constants.TO_BANK_AREA.contains(Players.getLocal())) {\n Lodestone.EDGEVILLE.teleport();\n } else {\n if (!Constants.BANK_AREA.contains(Players.getLocal())) {\n Walking.newTilePath(Constants.TO_BANK).traverse();\n Task.sleep(1000);\n }\n }\n }\n }",
"protected void execute() {\n \tRobot.debug.Update(Robot.lift.DebugMotionMagic());\n }",
"protected void execute() {\n\t\tthrottle = getThrottle();\n\t\tturn = getCorrectTurnValue();\n\t\tforward = getForward();\n\t\tright = (forward - turn) * throttle;\n\t\tleft = (forward + turn) * throttle;\n\n\t\tRobot.driveTrain.driveManual(right, left);\n\t\tif (Robot.oi.bShiftUp.get()) {\n\t\t\tRobot.driveTrain.shiftToHigh(true);\n\t\t} else if (Robot.oi.bShiftDown.get()) {\n\t\t\tRobot.driveTrain.shiftToHigh(false);\n\t\t}\n\t}",
"public void runStateMachine() {\n switch(m_currentState) {\n case PoweringUpState:\n if (this.doPowerUpStuff()) {\n this.setRobotState(RobotState.InitializingDataState);\n }\n break;\n case InitializingDataState:\n\n if (this.initializeData()) {\n // Load some commands for our robot.\n // We could definitely load these from a different file.\n System.out.println(\"-------- Populating Command Queue --------\");\n m_robotQueue.addCommand(new MoveToLocationXY(1.0, 2.0, 2.0));\n m_robotQueue.addCommand(new MoveToLocationXY(-1.0, -2.0, 1.0));\n m_robotQueue.addCommand(new RotateDegrees(180.0, 22.5));\n\n System.out.println(\"\\n-------- Entering Main Robot State --------\");\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n break;\n case IdleWaitingForCommandState:\n if (m_robotQueue.isCommandPending()) {\n\n m_currentCommand = m_robotQueue.getNextCommand();\n\n // m_currentCommand is a generic Object. Let's see what it actually is...\n String commandName = m_currentCommand.getClass().toString();\n System.out.println(\"* Got new command. Processing: \" + commandName);\n\n // Change robot state depending on the type of command we found.\n switch (commandName) {\n // NOTE: This \"class xyz\" text compare is kind of weird,\n // We could probably find a better way.\n case \"class commands.MoveToLocationXY\":\n this.setRobotState(RobotState.MovingToLocationState);\n break;\n case \"class commands.RotateDegrees\":\n this.setRobotState(RobotState.RotatingState);\n break;\n default:\n System.out.println(\"Unrecognized command \" + commandName);\n }\n System.out.println();\n\n } else if (m_currentCommand != null) {\n m_currentCommand = null; // Doing nothing. Clear current command.\n }\n break;\n case MovingToLocationState:\n MoveToLocationXY moveCmd = (MoveToLocationXY) m_currentCommand;\n try {\n if (moveCmd.runUntilComplete()) {\n // Done moving, process next item in command queue\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n } catch (InterruptedException e) { // for Thread.sleep - demo only\n e.printStackTrace();\n }\n break;\n case RotatingState:\n RotateDegrees rotateCmd = (RotateDegrees) m_currentCommand; // Cast to correct type.\n try {\n if (rotateCmd.runUntilComplete()) {\n // Done moving, process next item in command queue\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n } catch (InterruptedException e) { // for Thread.sleep - demo only\n e.printStackTrace();\n }\n break;\n case SearchingForTargetsState:\n // TODO - implement SearchTarget demo behavior\n break;\n }\n }",
"void makeMove(String move) {\n if (!isLegal(move)) {\n throw new IllegalArgumentException(\"This is an illegal move.\");\n }\n int column = Integer.parseInt(move.substring(2)) - 1;\n int row = Integer.parseInt(move.substring(0, 1)) - 1;\n _board[column][row] = currPlayer;\n alternatePlayer(currPlayer);\n }",
"public abstract void move();"
] | [
"0.6872983",
"0.6550122",
"0.65446734",
"0.65214735",
"0.6462614",
"0.645402",
"0.6418463",
"0.6416011",
"0.6386",
"0.6335238",
"0.62839997",
"0.6266031",
"0.62121534",
"0.617418",
"0.6166734",
"0.6163431",
"0.6114189",
"0.6110803",
"0.60963255",
"0.6070507",
"0.6069633",
"0.6063478",
"0.6042619",
"0.60330915",
"0.6027242",
"0.60180414",
"0.60163724",
"0.6013285",
"0.60063446",
"0.5998204",
"0.59939635",
"0.5985095",
"0.5978239",
"0.59501034",
"0.59452343",
"0.59394205",
"0.5926924",
"0.59227335",
"0.589877",
"0.589498",
"0.5890369",
"0.587682",
"0.58676356",
"0.5853581",
"0.5852605",
"0.58499527",
"0.58481485",
"0.5842297",
"0.583438",
"0.5831229",
"0.5831113",
"0.58272314",
"0.5816304",
"0.5816278",
"0.58124316",
"0.5810977",
"0.580305",
"0.5791195",
"0.5784802",
"0.5777098",
"0.577629",
"0.577033",
"0.57575727",
"0.57562214",
"0.57420963",
"0.57392174",
"0.5725541",
"0.5719535",
"0.57056093",
"0.5705332",
"0.5702873",
"0.5701736",
"0.569802",
"0.5696044",
"0.5689785",
"0.5686164",
"0.56857324",
"0.56751984",
"0.5675098",
"0.5675098",
"0.56738675",
"0.5667295",
"0.56631786",
"0.56608236",
"0.56606793",
"0.5651224",
"0.5649718",
"0.5648966",
"0.5648661",
"0.56467026",
"0.56457114",
"0.56412065",
"0.56389016",
"0.5634966",
"0.5633923",
"0.56249934",
"0.5622525",
"0.56197757",
"0.5619533",
"0.56179965"
] | 0.8288972 | 0 |
generate all possible/valid moves for the specified game | private List<Move> generateMoves(boolean debug) {
List<Piece> pieces = this.chessGame.getPieces();
List<Move> validMoves = new ArrayList<Move>();
Move testMove = new Move(0,0,0,0);
int pieceColor = (this.chessGame.getGameState()==ChessGame.GAME_STATE_WHITE
?Piece.COLOR_WHITE
:Piece.COLOR_BLACK);
// iterate over all non-captured pieces
for (Piece piece : pieces) {
// only look at pieces of current players color
if (pieceColor == piece.getColor()) {
// start generating move
testMove.sourceRow = piece.getRow();
testMove.sourceColumn = piece.getColumn();
// iterate over all board rows and columns
for (int targetRow = Piece.ROW_1; targetRow <= Piece.ROW_8; targetRow++) {
for (int targetColumn = Piece.COLUMN_A; targetColumn <= Piece.COLUMN_H; targetColumn++) {
// finish generating move
testMove.targetRow = targetRow;
testMove.targetColumn = targetColumn;
if(debug) System.out.println("testing move: "+testMove);
// check if generated move is valid
if (this.validator.isMoveValid(testMove, true)) {
// valid move
validMoves.add(testMove.clone());
} else {
// generated move is invalid, so we skip it
}
}
}
}
}
return validMoves;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void executegenmoves() {\n \t\tObject state = gm.hashToState(new BigInteger(conf.getProperty(\"gamesman.hash\")));\n \t\tfor (Object nextstate : gm.validMoves(state)) {\n \t\t\tSystem.out.println(gm.stateToHash(nextstate));\n \t\t\tSystem.out.println(gm.displayState(nextstate));\n \t\t}\n \t}",
"public List<ScoredMove> allValidMoves(GameState gm){\n\t\tList<ScoredMove> validMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for draw move\n\t\tif (getDeckSize() > 0) {\n\t\t\tvalidMoves.add(new ScoredMove(ACTION.DRAW, null, null));\n\t\t}\n\t\t/*\n\t\telse {\n\t\t\t// check for discarding move (note: only allowing if decksize is empty)\n\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\tif (!(c instanceof MerchantShip)) {\n\t\t\t\t\tvalidMoves.add(new ScoredMove(ACTION.DISCARD, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\tvalidMoves.addAll(allDiscardMoves(gm));\n\t\t\n\t\t// check for playing merchant ships\n\t\tvalidMoves.addAll(allmShipMoves(gm));\n\t\t\n\t\t// add all attacks\n\t\tvalidMoves.addAll(allAttackMoves(gm));\n\t\t\n\t\tif (super.getVerbosity()) {\n\t\t\tSystem.out.println(\"Valid moves found: \" + validMoves.size());\n\t\t}\n\t\treturn validMoves;\n\t}",
"private ArrayList<Move> generatePossibleMovesFor(Player player) {\n ArrayList<Point> selfStonePlacements = new ArrayList<>();\n ArrayList<Point> opponentStonePlacements = new ArrayList<>();\n for (int x = 0; x < field.length; x++)\n for (int y = 0; y < field[x].length; y++) {\n if (field[x][y] == null)\n continue;\n if (field[x][y] == this.color)\n selfStonePlacements.add(new FieldPoint(x, y));\n if (field[x][y] == opponent.getColor())\n opponentStonePlacements.add(new FieldPoint(x, y));\n }\n\n ArrayList<Move> possibleMoves = new ArrayList<>();\n\n // Check if player is in set phase or only has three stones left\n if (!player.isDoneSetting()) {\n // Every free field is a possible move\n for (Point point : pointsOfMovement) {\n if (opponentStonePlacements.contains(point) || selfStonePlacements.contains(point))\n continue;\n possibleMoves.add(new StoneMove(null, point));\n }\n } else if (player.isDoneSetting() && getCountOfStonesFor(player) > 3) {\n // Move is only possible if the neighbour field of a stone is free\n for (Point point : player == opponent ? opponentStonePlacements : selfStonePlacements) {\n for (Point neighbour : neighbourPoints.get(point)) {\n if (opponentStonePlacements.contains(neighbour) || selfStonePlacements.contains(neighbour))\n continue;\n possibleMoves.add(new StoneMove(point, neighbour));\n }\n }\n } else {\n for (Point point : player == opponent ? opponentStonePlacements : selfStonePlacements) {\n for (Point another : pointsOfMovement) {\n if (opponentStonePlacements.contains(point) || selfStonePlacements.contains(point))\n continue;\n possibleMoves.add(new StoneMove(point, another));\n }\n }\n }\n\n Collections.shuffle(possibleMoves);\n return possibleMoves;\n }",
"static List<Move> generateLegalMoves(Position pos) {\n\t\tList<Move> moves = new ArrayList<>();\n\n\t\t// for (int square : pos.pieces) {\n\t\t// \tif (pos.pieces.size() > 32) {\n\t\t// \t\tSystem.out.println(\"problem\" + pos.pieces.size());\n\t\t// \t}\n\t\t// \tif (pos.at(square) != 0 && Piece.isColor(pos.at(square), pos.toMove)) {\n\t\t// \t\tint piece = pos.at(square);\n\t\t// \t\tint name = Piece.name(piece);\n\t\t// \t\tif (name == Piece.Pawn) {\n\t\t// \t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t// \t\t\tif (square + step >= 0 && square + step < 64) {\n\t\t// \t\t\t\t// 1 square\n\t\t// \t\t\t\tif (pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'q'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'b'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'n'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'r'));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step));\n\t\t// \t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// 2 squares\n\t\t// \t\t\t\tif ((square < 16 && pos.toMove == 'w') || square > 47 && pos.toMove == 'b') {\n\t\t// \t\t\t\t\tif (pos.board.squares[square + 2*step] == 0 && pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + 2*step));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t\t// capture\n\t\t// \t\t\t\t// right\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][3] > 0) {\n\t\t// \t\t\t\t\tint target = square + step + 1;\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\telse {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\t\t\t\n\t\t// \t\t\t\t\t} \n\t\t// \t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// left\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][2] > 0) {\n\t\t// \t\t\t\t\tint target = square + step - 1;\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\telse {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\t\t\t\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t}\t\t\t\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\tfor (int offset : MoveData.KnightOffsets.get(square)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\tif (!Piece.isColor(pos.board.squares[square + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tMove move = new Move(square, square + offset);\n\t\t// \t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t}\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse {\n\t\t// \t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t// \t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t// \t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t// \t\t\t\tint maxDist = MoveData.DistanceToEdge[square][dir];\n\t\t// \t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\n\t\t// \t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t// \t\t\t\t\tint squareIdx = square + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, squareIdx));\n\t\t// \t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\n\t\t// \t\t\t\t\t\t\tbreak;\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tbreak;\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\t\t\t\t\t\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\t// \t}\n\t\t// }\n\n\t\tfor (int i = 0; i < 64; i++) {\n\t\t\tif (pos.board.squares[i] != 0 && Piece.isColor(pos.board.squares[i], pos.toMove)) {\n\t\t\t\tint piece = pos.board.squares[i];\n\t\t\t\tint name = Piece.name(piece);\n\t\t\t\tif (name == Piece.Pawn) {\n\t\t\t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t\t\t\tif (i + step >= 0 && i + step < 64) {\n\t\t\t\t\t\t// 1 square\n\t\t\t\t\t\tif (pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'q'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'b'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'n'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'r'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step));\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 2 squares\n\t\t\t\t\t\tif ((i < 16 && pos.toMove == 'w') || i > 47 && pos.toMove == 'b') {\n\t\t\t\t\t\t\tif (pos.board.squares[i + 2*step] == 0 && pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + 2*step));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// capture\n\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][3] > 0) {\n\t\t\t\t\t\t\tint target = i + step + 1;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// left\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][2] > 0) {\n\t\t\t\t\t\t\tint target = i + step - 1;\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor (int offset : MoveData.KnightOffsets.get(i)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[i + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tMove move = new Move(i, i + offset);\n\t\t\t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t\t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t\t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t\t\t\t\tint maxDist = MoveData.DistanceToEdge[i][dir];\n\t\t\t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\t\t\t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t\t\t\t\t\tint squareIdx = i + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, squareIdx));\n\t\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// castling\t\t\n\t\tif (pos.toMove == 'w' && !underAttack(pos, pos.whiteKing, 'b')) {\t\t\t\n\t\t\tif (pos.castlingRights.whiteKingSide && pos.at(Board.H1) == (Piece.Rook | Piece.White)) {\n\t\t\t\tif (pos.at(Board.F1) == Piece.Empty && pos.at(Board.G1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F1, 'b') && !underAttack(pos, Board.G1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.G1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif (pos.castlingRights.whiteQueenSide && pos.at(Board.A1) == (Piece.Rook | Piece.White)) {\t\t\t\t\n\t\t\t\tif (pos.at(Board.B1) == Piece.Empty && pos.at(Board.C1) == Piece.Empty && pos.at(Board.D1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D1, 'b') && !underAttack(pos, Board.C1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.C1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\telse if (pos.toMove == 'b' && !underAttack(pos, pos.blackKing, 'w')){\n\t\t\tif (pos.castlingRights.blackKingSide && pos.at(Board.H8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.F8) == Piece.Empty && pos.at(Board.G8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F8, 'w') && !underAttack(pos, Board.G8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.G8));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pos.castlingRights.blackQueenSide && pos.at(Board.A8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.B8) == Piece.Empty && pos.at(Board.C8) == Piece.Empty && pos.at(Board.D8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D8, 'w') && !underAttack(pos, Board.C8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.C8));\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// filter illegal moves\n\t\tList<Move> legalMoves = new ArrayList<>();\n\t\tchar color = pos.toMove;\n\t\tfor (Move move : moves) {\n\t\t\tpos.makeMove(move);\n\t\t\tif (!kingInCheck(pos, color)) {\n\t\t\t\tlegalMoves.add(move);\n\t\t\t}\t\t\t\n\t\t\tpos.undoMove();\n\t\t}\n\n\t\treturn legalMoves;\n\t}",
"public void generateSolutionList() {\n // Will probably solve it in a few years\n while (!isSolved()) {\n RubiksMove move = RubiksMove.random();\n solutionMoves.add(move);\n performMove(move);\n }\n }",
"@Override\n public ArrayList<xMCTSStringGameState> getPossibleMoves(xMCTSStringGameState gameState)\n {\n\t ArrayList<xMCTSStringGameState> posMoves = new ArrayList<xMCTSStringGameState>();\n\t if (gameStatus(gameState) == xMCTSGame.status.ONGOING) {\n\t \t String activeCard = gameState.toString().substring(gameState.toString().length() - 2, gameState.toString().length());\n\t \t int gridSize = SIZE*2;\n\t for (int i = 0; i < gridSize; i += 2) {\n\t for (int j = 0; j < gridSize; j += 2) {\n\t int pos = i * SIZE + j;\n\t if (gameState.toString().charAt(pos) == '_') {\n\t String temp = gameState.toString().substring(0, pos)\n\t \t\t + activeCard\n\t + gameState.toString().substring(pos + 2,\n\t gameState.toString().length());\n\t posMoves.add(new xMCTSStringGameState(temp, 0.0, 0));\n\t }\n\t }\n\n\t }\n\t }\n\t else {\n\t \t // System.out.println(\"No moves can be made from this state\");\n\t \t// callsFromFullBoards++;\n\t \t// System.out.println(\"There have been \" + callsFromFullBoards + \"attempts to get possible moves from a full board\");\n\t }\n\t return posMoves;\n }",
"public List<Move> validMoves(){\n List<Move> results = new LinkedList<>();\n int kingVal = turn == WHITE ? WHITE_KING : BLACK_KING;\n int kingX = 0, kingY = 0;\n List<Piece> checks = null;\n kingSearch:\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n if (board[y][x] == kingVal){\n kingX = x;\n kingY = y;\n checks = inCheck(x,y);\n break kingSearch;\n }\n }\n }\n if (checks.size() > 1){ // must move king\n for (int x = -1; x < 2; x++){\n for (int y = -1; y < 2; y++){\n if (kingX+x >= 0 && kingX + x < 8 && kingY+y >= 0 && kingY+y < 8){\n int val = board[kingY+y][kingX+x];\n if (val == 0 || turn == WHITE && val > WHITE_KING || turn == BLACK && val < BLACK_PAWN){\n // may still be a move into check, must test at end\n results.add(new Move(kingVal, kingX, kingY, kingX+x, kingY+y, val, 0, this));\n }\n }\n }\n }\n } else { // could be in check TODO: split into case of single check and none, identify pin/capture lines\n int queen = turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN;\n int knight = turn == WHITE ? WHITE_KNIGHT : BLACK_KNIGHT;\n int rook = turn == WHITE ? WHITE_ROOK : BLACK_ROOK;\n int bishop = turn == WHITE ? WHITE_BISHOP : BLACK_BISHOP;\n for (int y = 0; y < 8; y++) {\n for (int x = 0; x < 8; x++) {\n int piece = board[y][x];\n if (piece == (turn == WHITE ? WHITE_PAWN : BLACK_PAWN)) { // pawns\n // regular | 2 move\n if (board[y+turn][x] == 0){\n if (y+turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x, y + turn, 0, queen, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, knight, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, rook, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, bishop, this));\n }\n else {\n results.add(new Move(piece, x, y, x, y + turn, 0, 0, this));\n if ((y == (turn == WHITE ? 1 : 6)) && board[y + 2 * turn][x] == 0) { // initial 2 move\n results.add(new Move(piece, x, y, x, y + 2*turn, 0, 0, this));\n }\n }\n }\n // capture\n for (int dx = -1; dx <= 1; dx += 2){\n if (x + dx >= 0 && x + dx < 8) {\n int val = board[y+turn][x+dx];\n if (val > 0 && (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n if (y + turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x+dx, y + turn, val, queen, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, knight, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, rook, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, bishop, this));\n } else {\n results.add(new Move(piece, x, y, x+dx, y + turn, val, 0, this));\n }\n }\n if (val == 0 && y == (turn == WHITE ? 4 : 3) && x+dx == enPassant){ // en passant\n results.add(new Move(piece, x, y, x+dx, y + turn, 0, 0, this));\n }\n }\n }\n\n } else if (piece == knight) { // knights TODO: lookup table\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -2; dy <= 2; dy += 4){\n if (x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n if (x+dy >= 0 && x + dy < 8 && y + dx >= 0 && y + dx < 8){\n int val = board[y+dx][x+dy];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dy,y+dx,val,0,this));\n }\n }\n }\n }\n } else if (piece == bishop) { // bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == rook) { // rooks\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN)) { // queens\n // Diagonals - same as bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_KING : BLACK_KING)) { // king\n for (int dx = -1; dx < 2; dx++){\n for (int dy = -1; dy < 2; dy++){\n if ((dx != 0 || dy != 0) && x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n }\n }\n }\n }\n }\n // castle\n if (checks.size() == 0){\n if (turn == WHITE && (castles & 0b11) != 0){//(castles[0] || castles[1])){\n board[0][4] = 0; // remove king to avoid check test collisions with extra king\n if ((castles & WHITE_SHORT) != 0 && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n //if (castles[0] && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 6, 0, 0, 0, this));\n }\n if ((castles & WHITE_LONG) != 0 && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 &&\n inCheck(3,0).size() == 0){\n //if (castles[1] && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 && inCheck(3,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 2, 0, 0, 0, this));\n }\n board[0][4] = WHITE_KING;\n }else if (turn == BLACK && (castles & 0b1100) != 0){//(castles[2] || castles[3])) {\n board[7][4] = 0; // remove king to avoid check test collisions with extra king\n //if (castles[2] && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n if ((castles & BLACK_SHORT) != 0 && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 6, 7, 0, 0, this));\n }\n //if (castles[3] && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 && inCheck(3, 7).size() == 0) {\n if ((castles & BLACK_LONG) != 0 && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 &&\n inCheck(3, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 2, 7, 0, 0, this));\n }\n board[7][4] = BLACK_KING;\n }\n }\n }\n List<Move> fullLegal = new LinkedList<>();\n for (Move m : results){\n makeMove(m);\n turn = -turn;\n if (m.piece == WHITE_KING || m.piece == BLACK_KING){\n if (inCheck(m.toX,m.toY).size() == 0){\n fullLegal.add(m);\n }\n }else if (inCheck(kingX,kingY).size() == 0){\n fullLegal.add(m);\n }\n turn = -turn;\n undoMove(m);\n }\n Collections.sort(fullLegal, (o1, o2) -> o2.score - o1.score); // greatest score treated as least so appears first\n return fullLegal;\n }",
"abstract public List<Move> getPossibleMoves();",
"ArrayList<Move> legalMoves() {\n ArrayList<Move> result = new ArrayList<Move>();\n int f, b;\n Move m;\n for (int i = 1; i < 8; i++) {\n for (int j = 1; j < 8; j++) {\n if (get(i,j).side() == _turn) {\n f = forward(j, i);\n b = backward(j, i);\n c = _col[j];\n r = _row[i];\n m = Move.create(j, i, j - b, i - b);\n addMove(result, m);\n m = Move.create(j, i, j + b, i + b);\n addMove(result, m);\n m = Move.create(j, i, j + f, i - f);\n addMove(result, m);\n m = Move.create(j, i, j - f, i + f);\n addMove(result, m);\n m = Move.create(j, i, j + c, i);\n addMove(result, m);\n m = Move.create(j, i, j - c, i);\n addMove(result, m);\n m = Move.create(j, i, j, i + r);\n addMove(result, m);\n m = Move.create(j, i, j, i - r);\n addMove(result, m);\n } else {\n continue;\n }\n }\n }\n return result;\n }",
"List<ValidMove> getValidMoves();",
"public ArrayList<PentagoGame> nextPossibleMoves() {\n ArrayList<PentagoGame> children = new ArrayList<>();\n for(int i = 0; i < 6; i++) { // for each row I can place a piece\n for(int j = 0; j < 6; j++) { // for each column\n for(int k = 0; k < 4; k++ ) { // for each board to rotate\n for(int d = 0; d < 2; d ++) {// for each direction to rotate\n boolean leftRotate = false;\n if(d == 0) {\n leftRotate = true;\n }\n Move move = new Move(i, j, k, leftRotate);\n if(validMove(whosTurn(), move)) {\n PentagoGame tempGame = new PentagoGame(this);\n tempGame.playPiece(whosTurn(), move);\n tempGame.rotateBoard(whosTurn(), move);\n tempGame.turnOver();\n move.setGameState(tempGame);\n move.setUtility(calulateUtility(move));\n // todo\n children.add(tempGame);\n }\n }\n }\n }\n }\n\n return children;\n }",
"public static LinkedList<LinkedList<TicTacToeGame>> generateAllGames(int lines, int columns, int winLength){\n\n LinkedList<LinkedList<TicTacToeGame>> allGames = new LinkedList<LinkedList<TicTacToeGame>>();\n LinkedList<TicTacToeGame> gamesList = new LinkedList<TicTacToeGame>();\n TicTacToeGame newGame = new TicTacToeGame(lines, columns, winLength);\n gamesList.add(0, newGame);\n allGames.add(0, gamesList);\n\n boolean generate = true;\n\n while ( generate ) {\n \n generate = false;\n LinkedList<TicTacToeGame> list = new LinkedList<TicTacToeGame>();\n\n for( TicTacToeGame game: gamesList ) {\n\n for ( int i = 0 ; i < lines*columns ; i++ ) {\n\n if ( game.valueAt(i) == CellValue.EMPTY && game.getGameState() == GameState.PLAYING ) {\n\n newGame = new TicTacToeGame(game, i);\n boolean valid = true;\n\n for ( TicTacToeGame otherGame: list ) {\n\n if ( newGame.equals(otherGame) ) {\n valid = false;\n break;\n }\n\n }\n\n if ( valid ) {\n list.add(newGame);\n }\n\n if ( newGame.getGameState() == GameState.PLAYING ) {\n generate = true;\n }\n\n }\n\n }\n\n }\n\n gamesList = list;\n allGames.addLast(gamesList);\n\n }\n\n return allGames;\n\n\t}",
"public abstract ArrayList<Move> possibleMoves(Board board);",
"public static int generateMoves(BoardState bs, long[] moves) {\n int count = 0;\n //int from, int to, int special, int movPiece, int content, int pawnStart\n int piece, tmp_piece, pIndex, index;\n int sq, tmp_sq, pieceNum, dir;\n\n int turn = bs.turn;\n int opponent = turn ^ 1;\n int pawn = PAWN_BY_COLOR[turn];\n\n //PAWNS\n for (pieceNum = 0; pieceNum < bs.pieceNum[pawn]; pieceNum++) {\n sq = bs.pieceArray[pawn][pieceNum];\n assert (isOnboard(sq));\n\n tmp_sq = sq + MOVES_PAWN_STRAIGHT[turn];\n if (bs.pieces[tmp_sq] == EMPTY) {\n count = addPawnMove(bs, sq, tmp_sq, 0, 0, turn, moves, count);\n tmp_sq += MOVES_PAWN_STRAIGHT[turn];\n if (((RANKS_MAP[sq] == RANK_7 && turn == BLACK)\n || (RANKS_MAP[sq] == RANK_2 && turn == WHITE))\n && bs.pieces[tmp_sq] == EMPTY) {\n count = addPawnMove(bs, sq, tmp_sq, 0, 1, turn, moves, count);\n }\n }\n\n tmp_sq = sq + MOVES_PAWNS[turn][0];\n if (isOnboard(tmp_sq) && PIECE_COLORS[bs.pieces[tmp_sq]] == opponent) {\n count = addPawnMove(bs, sq, tmp_sq, bs.pieces[tmp_sq], 0, turn, moves, count);\n }\n if (isOnboard(bs.enPas) && bs.enPas == tmp_sq) { //En passant check\n int move = Moves.generateMove(sq, tmp_sq, 1, pawn, EMPTY, 0);\n count = addMove(move, moves, count, 105);\n }\n\n tmp_sq = sq + MOVES_PAWNS[turn][1];\n if (isOnboard(tmp_sq) && PIECE_COLORS[bs.pieces[tmp_sq]] == opponent) {\n count = addPawnMove(bs, sq, tmp_sq, bs.pieces[tmp_sq], 0, turn, moves, count);\n }\n if (isOnboard(bs.enPas) && bs.enPas == tmp_sq) { //En passant check\n int move = Moves.generateMove(sq, tmp_sq, 1, pawn, EMPTY, 0);\n count = addMove(move, moves, count, 105);\n }\n }\n\n //Bishops, Rooks & Queens\n pIndex = SLIDERS_INDEX[turn];\n piece = SLIDERS[pIndex++];\n while (piece != -1) {\n for (pieceNum = 0; pieceNum < bs.pieceNum[piece]; pieceNum++) {\n sq = bs.pieceArray[piece][pieceNum];\n for (index = 0; index < MOVES_ALL[piece].length; index++) {\n dir = MOVES_ALL[piece][index];\n tmp_sq = sq;\n\n //Slide loop\n while (isOnboard(tmp_sq += dir)) {\n tmp_piece = bs.pieces[tmp_sq];\n if (tmp_piece != EMPTY) {\n if (PIECE_COLORS[tmp_piece] == opponent) {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, tmp_piece, 0);\n count = addCaptureMove(bs, move, moves, count);\n }\n break; //Stop sliding\n } else {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n }\n }\n piece = SLIDERS[pIndex++];\n }\n //Kings & Knights\n pIndex = MOVERS_INDEX[turn];\n while ((piece = MOVERS[pIndex]) != -1) {\n for (pieceNum = 0; pieceNum < bs.pieceNum[piece]; pieceNum++) {\n sq = bs.pieceArray[piece][pieceNum];\n for (index = 0; index < MOVES_ALL[piece].length; index++) {\n dir = MOVES_ALL[piece][index];\n tmp_sq = sq + dir;\n if (isOnboard(tmp_sq)) {\n tmp_piece = bs.pieces[tmp_sq];\n if (tmp_piece != EMPTY) {\n if (PIECE_COLORS[tmp_piece] == opponent) {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, tmp_piece, 0);\n count = addCaptureMove(bs, move, moves, count);\n }\n } else {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n }\n }\n pIndex++;\n }\n\n //Castling\n if (turn == WHITE) {\n if ((bs.castlePerms & WKCA) != 0\n && bs.pieces[F1] == EMPTY\n && bs.pieces[G1] == EMPTY\n && !bs.isSquareThreatened(E1, BLACK)\n && !bs.isSquareThreatened(F1, BLACK)) {\n int move = Moves.generateMove(E1, G1, 1, W_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n if ((bs.castlePerms & WQCA) != 0\n && bs.pieces[D1] == EMPTY\n && bs.pieces[C1] == EMPTY\n && bs.pieces[B1] == EMPTY\n && !bs.isSquareThreatened(E1, BLACK)\n && !bs.isSquareThreatened(D1, BLACK)) {\n int move = Moves.generateMove(E1, C1, 1, W_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n } else {\n if ((bs.castlePerms & BKCA) != 0\n && bs.pieces[F8] == EMPTY\n && bs.pieces[G8] == EMPTY\n && !bs.isSquareThreatened(E8, WHITE)\n && !bs.isSquareThreatened(F8, WHITE)) {\n int move = Moves.generateMove(E8, G8, 1, B_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n if ((bs.castlePerms & BQCA) != 0\n && bs.pieces[D8] == EMPTY\n && bs.pieces[C8] == EMPTY\n && bs.pieces[B8] == EMPTY\n && !bs.isSquareThreatened(E8, WHITE)\n && !bs.isSquareThreatened(D8, WHITE)) {\n int move = Moves.generateMove(E8, C8, 1, B_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n\n return count;\n }",
"public LinkedList<Move> getPossibleMoves() {\n\t\tAIPossibleMoves.clear();\n\t\tint xOrigin = 0, yOrigin = 0, xMove1 = 0, xMove2 = 0, yMove1 = 0, yMove2 = 0;\n\t\tMove move = null;\t\n\t\t\tint type = 0;\n\t\t\tfor(Checker checker: model.whitePieces) {\n\t\t\t\t\n\t\t\t\txOrigin = checker.getCurrentXPosition();\n\t\t\t\tyOrigin = checker.getCurrentYPosition();\n\t\t\t\txMove1 = (checker.getCurrentXPosition() - 1);\n\t\t\t\txMove2 = (checker.getCurrentXPosition() + 1);\n\t\t\t\tyMove1 = (checker.getCurrentYPosition() - 1);\n\t\t\t\tyMove2 = (checker.getCurrentYPosition() + 1);\n\t\t\t\ttype = checker.getType();\n\t\t\t\tswitch(type) {\n\t\t\t\tcase 2:\n\n\t\t\t\t\tif((xMove1 < 0) || (yMove1 <0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t\t//System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \n\t\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t\t// System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t\t//Moving up and left isMovingRight,IsMovingDown\n\t\t\t\t\tif((xMove1 <0) || (yMove1 < 0)) {\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving up and right\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove1 < 0) || (yMove2 > 7)) {\n\t\t\t\t//\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving down and left isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove2, false, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove2, false, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove2 > 7)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t//moving down and right isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove2, true, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove2, true, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tbreak;\t\n\t\t\t\t}\t\n\t\t\t\n\t\t\t}\n\n\t\t\treturn AIPossibleMoves;\n\t\t\t\n\t\t}",
"@Override\n\tpublic void makeMove(Game game) \n\t{\n\t\t\n\t\tint row1,col1,row2,col2;\n\t\tCheckers tttGame = (Checkers) game;\n\t\t\n\t\tboolean first = true;\n\n\t\t\tcorrectmove= false;\n\t\t\tSystem.out.println(\"Insert target (row,column) and destination (row, column) ([0,7])\");\n\n\t\t\trow1 = tttGame.x1;\n\t\t\tcol1 = tttGame.y1;\n\t\t\trow2 = tttGame.x2;\n\t\t\tcol2 = tttGame.y2;\n\t\t\tSystem.out.println(row1 + \" \" + col1 + \" \" + row2 + \" \" + col2 + \" \" + role);\n\t\t\t\n\t\t\tfirst=false;\n\t\tcorrectmove= tttGame.isValidCell(row1, col1, row2, col2,role);\n\t\tSystem.out.println(correctmove);\n\n\t\tif(correctmove)\n\t\t{\n\t\t\ttttGame.board[row2][col2]= tttGame.board[row1][col1];\n\t\t\tif(row2==0 && role==0) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\telse if(row2==7 && role==1) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\ttttGame.board[row1][col1]=0;\n\t\t\tif(abs(row1-row2)==2)\n\t\t\t{\n\t\t\t\tint x= (row1+ row2)/2;\n\t\t\t\tint y= (col1+ col2)/2;\n\t\t\t\ttttGame.board[x][y]=0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"invalid move!\");\n\t\t}\n\t\t\n//\t\ttttGame.board[row][col] = role;\n\t}",
"Iterator<BoardPosition> possibleMovingPositions(BoardPosition from, Game game, Map<BoardPosition, Piece> pieceMap);",
"public void makeMove(Game game) {\n\t\t\n\t\tint row,col;\n\t\tTickTackToe tttGame = (TickTackToe) game;\n\t\tView.playerNameSet(name);\n while(true){\n \n if(View.selectedCol!=-1){\n col=View.selectedCol;\n View.selectedCol=-1;\n if(tttGame.isValidCell(col))\n break;\n else{\n JOptionPane.showMessageDialog(this,\"Please Choose Another Column\", \"Alert\", JOptionPane.PLAIN_MESSAGE);\n \n }\n }\n }\n \n\t\t/*boolean first = true;\n\t\tdo\n\t\t{\n\t\t\tif(first) \tSystem.out.println(\"Insert column [0,2]\");\n\t\t\telse System.out.println(\"Invalid input! Insert column [0,2] again.\");\n\t\t\t//row = in.nextInt();\n\t\t\tcol = in.nextInt();\n\t\t\tfirst=false;\n\t\t}while(!tttGame.isValidCell(col));*/\n\t\t\n \n for(row=tttGame.row-1;row>=0;row--){\n \n if(tttGame.board[row][col]==-1){\n tttGame.board[row][col] = role;\n \n \n break;\n }\n \n }\n\t\t\n\t}",
"public static HashSet<gameState> Actions(gameState currentState) {\n\t\t\n\t\tHashSet<gameState> possibleStates = new HashSet<gameState>();\n\t\t\n\t\t\n\t\t// Store which player goes next after this player plays\n\t\tint nextNextUp;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tnextNextUp = 1;\n\t\t} else {\n\t\t\tnextNextUp = 0;\n\t\t}\n\t\t\n\t\t// Store corresponding characters for each player\n\t\t// DARK(X) - 0, LIGHT(O) - 1\n\t\tchar myTile;\n\t\tchar opponentTile;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tmyTile = 'x';\n\t\t\topponentTile = 'o';\n\t\t} else {\n\t\t\tmyTile = 'o';\n\t\t\topponentTile = 'x';\n\t\t}\n\n\t\t\n\n\t\t// Check the entire board of the state \n\t\tfor (int i = 0; i<boardSize; i++) {\n\t\t\tfor (int j = 0; j<boardSize; j++) {\n\t\t\t\t\n\t\t\t\t// If the tile is my tile\n\t\t\t\tif (currentState.getBoard()[i][j] == '_') {\n\t\t\t\t\t\n\t\t\t\t\tchar[][] moveBoard = createNewBoard(currentState);\n\t\t\t\t\t\n\t\t\t\t\t// Up\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// If it is an opponent tile, then you keep going up until you either my tile (fail) or\n\t\t\t\t\t\t// a blank space (success/move possible)\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=i;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Down\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=i;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j-1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=j;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j+1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=j;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j-1] == opponentTile) { \n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j+1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j-1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j+1] == opponentTile) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\tif (!compareBoards(moveBoard, currentState.getBoard())) {\n\t\t\t\t\t\tgameState move = new gameState(moveBoard, nextNextUp);\t\t\n\t\t\t\t\t\tpossibleStates.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\n\t\treturn possibleStates;\n\t\t\n\t\t\n\t\t\n\t}",
"List<Move> getLegalMoves(Player player);",
"@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}",
"public int[] getAllPossibleMoves(boolean ignore) {\n int[] validMoves;\n int[] validMovesResized;\n int validMovesIndex = 0;\n int startRow = this.getRow();\n int startCol = this.getCol();\n \n validMoves = new int[28]; // For a bishop, there are a maximum of 14 possible squares it could move to\n\n // First move from the bishops spot up diagonally to the right (ie col++, row++)\n for (int i = startCol+1, j = startRow+1; i<=8 && j<8; i++,j++) {\n validMoves[validMovesIndex] = i; // the col\n validMoves[validMovesIndex + 1] = j; // the row\n validMovesIndex = validMovesIndex + 2;\n }\n\n // Next move from the bishops start spot down diagonally to the right (ie col++, row--)\n for (int i = startCol+1, j = startRow-1; i<=8 && j>0; i++,j--) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n\n // Next move from the bishops start spot down diagonally to the left (ie col--, row--)\n for (int i = startCol-1, j = startRow-1; i>0 && j>0; i--,j--) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n // Next move from the bishops start spot up diagonally to the left (ie col--, row++)\n for (int i = startCol-1, j = startRow+1; i>0 && j<=8; i--,j++) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n \n // depending on the position of the bishop, the final array of possible moves may not have 14 squares\n // although that is the maximum. Create a new array of the actual size and copy into it.\n validMovesResized = Arrays.copyOf(validMoves, validMovesIndex);\n return validMovesResized;\n }",
"@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}",
"public void generateGame() {\n clearGame();\n\n //generate new game\n SudokuGenerator generator = new FullGenerator();\n generator.generateSudoku(this);\n\n //set start locations\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n int value = board.getSquareValue(i, j);\n if (value != 0) { // startlocation\n startLocations.add(new int[] {i, j});\n }\n }\n }\n }",
"@Test\n void testAllLegalMoves() {\n \tplayer1 = new HumanPlayer(\"Arnold\");\n player2 = new HumanPlayer(\"Intelligent Twig\");\n gameState = new GameState(Arrays.asList(player1, player2));\n board = gameState.getBoard();\n \n Set<PlayableMove> moves = Move.allLegalMoves(gameState);\n\n assertTrue(moves.stream().allMatch(e -> e.isLegal()));\n assertEquals(44, moves.size());\n }",
"private void generateLegalMovesPlayer(char player) {\r\n\r\n\t\t// loop through the unitLIst and generate all the moves a player can make\r\n\t\tfor (Unit unit : this.unitList) {\r\n\t\t\tif (unit != null && unit.getColor() == player) {\r\n\t\t\t\tunit.getLegalMoves();\r\n\t\t\t\tinsertMovesIntoMoveList(unit, unit.getMoveList());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void compute_possible_moves(Board s){\n\t\tint b [][] = s.board;\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tfor (int i = 0;i < b.length;i++) {\n\t\t\tfor (int j = 0;j < b[i].length;j++) {\n\t\t\t\tif(b[i][j] == 0){\n\t\t\t\t\tx = i;\n\t\t\t\t\ty = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tint left [][];\n\t\tint right [][];\n\t\tint up [][];\n\t\tint down [][];\n\t\tpossible_boards.clear();\n\t\tif(x - 1 != -1 && x >= 0 && x < 3){\n\t\t\t//up is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\n\t\t\tint temp = temporary_board[x - 1][y];\n\t\t\ttemporary_board[x - 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tup = temporary_board;\n\n\t\t\tBoard up_board = new Board(up);\n\t\t\tpossible_boards.add(up_board);\n\n\t\t}\n\t\tif(x + 1 != 3 && x >= 0 && x < 3){\n\t\t\t//down is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x + 1][y];\n\t\t\ttemporary_board[x + 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tdown = temporary_board;\n\t\t\tBoard down_board = new Board(down);\n\t\t\tpossible_boards.add(down_board);\n\t\t}\n\t\tif(y - 1 != -1 && y >= 0 && y < 3){\n\t\t\t//left move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y - 1];\n\t\t\ttemporary_board[x][y - 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tleft = temporary_board;\n\t\t\tBoard left_board = new Board(left);\n\t\t\tpossible_boards.add(left_board);\n\n\t\t}\n\t\tif(y + 1 != 3 && y >= 0 && y < 3){\n\t\t\t//right move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y + 1];\n\t\t\ttemporary_board[x][y + 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tright = temporary_board;\n\t\t\tBoard right_board = new Board(right);\n\t\t\tpossible_boards.add(right_board);\n\n\t\t}\n\n\t}",
"public List<String> legalMoves() {\n List<String> result = new ArrayList<>();\n for (int col = 1; col < _board.length + 1; col += 1) {\n for (int row = 1; row < _board.length + 1; row += 1) {\n String move = row + \",\" + col;\n if (isLegal(move)) {\n result.add(move);\n }\n }\n }\n return result;\n }",
"public List<Grid> getPossibleMoves(Grid g){\n\t\tint i=g.row, j=g.col;\n\t\tif(i>=0 && i<data.length && j>=0 && j<data[i].length){\n\t\t\tList<Grid> list=new ArrayList<>();\n\t\t\tif(isFree(i, j-1)) list.add(new Grid(i,j-1));\n\t\t\tif(isFree(i-1, j-1)) list.add(new Grid(i-1,j-1));\n\t\t\tif(isFree(i-1, j)) list.add(new Grid(i-1,j));\n\t\t\tif(isFree(i-1, j+1)) list.add(new Grid(i-1,j+1));\n\t\t\tif(isFree(i, j+1)) list.add(new Grid(i,j+1));\n\t\t\tif(isFree(i+1, j+1)) list.add(new Grid(i+1,j+1));\n\t\t\tif(isFree(i+1, j)) list.add(new Grid(i+1,j));\n\t\t\tif(isFree(i+1, j-1)) list.add(new Grid(i+1,j-1));\n\t\t\treturn list;\n\t\t}\n\t\treturn null;\n\t}",
"public ArrayList<Move> generateMoves(Board board, Piece piece){\r\n\t\treturn generateMoves(board, piece, true, true);\r\n\t}",
"@Override\n public Collection<Move> calculateLegalMoves(Board board) {\n System.out.println(\"INSIDE Knight: calculateLegalMoves()\");\n System.out.println(\"------------------------------>\\n\");\n\n //ArrayList of moves used to store all possible legal moves.\n final List<Move> legalMoves = new ArrayList<>();\n\n //Iterate the constant class array of piece offsets.\n for(final int currentCandidate : CANDIDATE_MOVE_COORDS){\n //Add the current coordinate of the piece to each offset, storing as a destination coordinate.\n final int candidateDestinationCoord = this.piecePosition + currentCandidate;\n\n //If the destination coordinate is within legal board bounds (between 0 and 64)...\n if(BoardUtils.isValidCoord(candidateDestinationCoord)){\n //Check to see if the piece is in the first column and its destination would move it outside the board.\n if(isfirstColumnExclusion(this.piecePosition, currentCandidate) ||\n isSecondColumnExclusion(this.piecePosition, currentCandidate) ||\n isSeventhColumnExclusion(this.piecePosition, currentCandidate) ||\n isEighthColumnExclusion(this.piecePosition, currentCandidate)){\n continue; //Continue the loop if any of these methods return true\n }\n\n //Store the tile of the destination coordinate.\n final Tile candidateDestinationTile = board.getTile(candidateDestinationCoord);\n\n //If the tile is not marked as occupied by the Tile class...\n if(!candidateDestinationTile.isOccupied()){\n //Add the move to the list of legal moves as a non-attack move.\n legalMoves.add(new MajorMove(board, this, candidateDestinationCoord));\n }\n else{\n //Otherwise, get the type and alliance of the piece at the destination.\n final Piece pieceAtDestination = candidateDestinationTile.getPiece();\n final Alliance pieceAlliance = pieceAtDestination.getPieceAlliance();\n\n //If the piece at the occupied tile's alliance differs...\n if(this.pieceAlliance != pieceAlliance){\n //Add the move to the list of legal moves as an attack move.\n legalMoves.add(new MajorAttackMove(board, this, candidateDestinationCoord, pieceAtDestination));\n }\n }\n }\n }\n\n //Return the list of legal moves.\n return legalMoves;\n }",
"public static void generateMoveDatabase(boolean rook) {\n\t\tlong validMoves = 0;\n\t\tint variations;\n\t\tint varCount;\n\t\tint index, i, j;\n\t\tlong mask;\n\t\tint magicIndex;\n\t\tint[] setBitsMask = new int[64];\n\t\tint[] setBitsIndex = new int[64];\n\t\tint bitCount = 0;\n\t\t// Loop through each index in the board\n\t\tfor (index = 0; index < 64; index++) {\n\n\t\t\tmask = rook ? CoreConstants.occupancyMaskRook[index]\n\t\t\t\t\t: CoreConstants.occupancyMaskBishop[index];\n\t\t\tgetIndexSetBits(setBitsMask, mask);\n\t\t\tbitCount = Long.bitCount(mask);\n\t\t\tvarCount = (int) (1L << bitCount);\n\t\t\t// Go through each possible variation\n\t\t\tfor (i = 0; i < varCount; i++) {\n\t\t\t\tCoreConstants.occupancyVariation[index][i] = 0;\n\t\t\t\tgetIndexSetBits(setBitsIndex, i);\n\t\t\t\tfor (j = 0; setBitsIndex[j] != -1; j++) {\n\t\t\t\t\tCoreConstants.occupancyVariation[index][i] |= (1L << setBitsMask[setBitsIndex[j]]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Generate moves for the piece considering each possible\n\t\t\t// variation\n\t\t\t// Then add moves to the lookup table\n\t\t\t// Indexed by the the position of the piece and a second index based\n\t\t\t// on the precomputed magic numbers\n\t\t\tvariations = (int) (1L << bitCount);\n\t\t\tfor (i = 0; i < variations; i++) {\n\t\t\t\tvalidMoves = 0;\n\t\t\t\tif (rook) {\n\t\t\t\t\tmagicIndex = (int) ((CoreConstants.occupancyVariation[index][i]\n\t\t\t\t\t\t\t* CoreConstants.magicNumbersRook[index]) >>> CoreConstants.magicShiftRook[index]);\n\t\t\t\t\tfor (j = index + 8; j < 64; j += 8) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index - 8; j >= 0; j -= 8) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index + 1; j % 8 != 0; j++) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index - 1; j % 8 != 7 && j >= 0; j--) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tCoreConstants.magicMovesRook[index][magicIndex] = validMoves;\n\t\t\t\t} else {\n\t\t\t\t\tmagicIndex = (int) ((CoreConstants.occupancyVariation[index][i]\n\t\t\t\t\t\t\t* CoreConstants.magicNumbersBishop[index]) >>> CoreConstants.magicShiftBishop[index]);\n\t\t\t\t\tfor (j = index + 9; j % 8 != 0 && j < 64; j += 9) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index - 9; j % 8 != 7 && j >= 0; j -= 9) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index + 7; j % 8 != 7 && j < 64; j += 7) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (j = index - 7; j % 8 != 0 && j >= 0; j -= 7) {\n\t\t\t\t\t\tvalidMoves |= (1L << j);\n\t\t\t\t\t\tif ((CoreConstants.occupancyVariation[index][i] & (1L << j)) != 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tCoreConstants.magicMovesBishop[index][magicIndex] = validMoves;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void getMoves(Player p, GameSquare[][] board) {\n\t\t// keep track of the number of possible moves\n\t\t// and number of unique pieces you could move\n\t\tint moveCount = 0;\n\t\tint uniquePieceCount = 0;\n\n\t\tArrayList<GameSquare> playerSpotsWithPieces = p.places;\n\t\tArrayList<GameSquare> validMoves;\n\n\t\t// for each square with a piece on it\n\t\t// find out where you can move that piece\n\t\tfor (GameSquare currentSquare : playerSpotsWithPieces) {\n\t\t\tvalidMoves = new ArrayList<GameSquare>();\n\n\t\t\t// grab all valid moves from\n\t\t\tvalidMoves.addAll(currentSquare.getValidMoves(board));\n\t\t\tif (validMoves.size() > 0)\n\t\t\t\tuniquePieceCount++;\n\t\t\tfor (GameSquare move : validMoves) {\n\t\t\t\tSystem.out.printf(\"%s at <%d:%d> can move to <%d:%d>\\n\", currentSquare.pieceType(), currentSquare.x,\n\t\t\t\t\t\tcurrentSquare.y, move.x, move.y);\n\t\t\t\tmoveCount++;\n\t\t\t}\n\t\t}\n\n\t\t// print the number of possible moves and number of unique pieces that\n\t\t// can be moved\n\t\tSystem.out.printf(\"%d legal moves (%d unique pieces) for %s player\", moveCount, uniquePieceCount,\n\t\t\t\tp.color.toString().toLowerCase());\n\n\t}",
"private List<Coordinate> getAvailableMoves(ImmutableGameBoard gameBoard) {\n List<Coordinate> availableMoves = new ArrayList<Coordinate>();\n\n for (int x = 0; x < gameBoard.getWidth(); x++) {\n for (int y = 0; y < gameBoard.getHeight(); y++) {\n if(gameBoard.getSquare(x, y) == TicTacToeGame.EMPTY)\n availableMoves.add(new Coordinate(x, y));\n }\n }\n\n return availableMoves;\n }",
"private void generateMoves(AINode root, int i) {\n\n //Make All Rotates\n AINode rotateNode = new AINode(root.copyState());\n for (int j = 0; j <= i; j++) {\n rotateNode.getState().checkRotate(true);\n }\n\n //Checks all possible slide locations\n for (int j = 0; j < 12; j++ ) {\n if (rotateNode.getState().getDisabledArrow().ordinal() == j) {\n continue;\n }\n AINode slideNode = new AINode(rotateNode.copyState());\n slideNode.getState().checkSlideTile(Arrow.values()[j]);\n\n //Checks all possible move locations for each slide location\n List<int[]> movePlaces = generatePossibleMoveActions(\n slideNode.getState());\n for (int[] spot : movePlaces) {\n AINode moveNode = new AINode(slideNode.copyState());\n moveNode.getState().checkMovePawn(spot[0], spot[1]);\n\n double eval = evalState(moveNode.getState());\n synchronized (possibleMoves) {\n possibleMoves.add(new double[]{i, j, spot[0], spot[1], eval});\n }\n }\n }\n }",
"public void createGame() {\n boolean foundValid = false;\n\n while (! foundValid) {\n createRandomGame();\n foundValid = checkRules();\n }\n\n printBoard();\n }",
"private List<int[]> generatePossibleMoveActions(LabyrinthGameState state) {\n List<Tile> tiles = new ArrayList<>();\n Tile orig = state.getPlayerLoc(Player.values()[playerNum]);\n tiles.add(orig);\n this.calculatePossibleMoves(orig, tiles);\n List<int[]> locations = new ArrayList<>();\n for (Tile spot : tiles) {\n int[] loc = new int[2];\n loc[0] = spot.getX();\n loc[1] = spot.getY();\n locations.add(loc);\n }\n return locations;\n }",
"public ArrayList<Cell> getPseudoLegalMoves() {\n\n Cell[][] board = Board.getBoard();\n ArrayList<Cell> moves = new ArrayList<Cell>();\n\n //Possible ways to move a knight\n int[][] possibleOffsets = {{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,1},{2,-1}};\n\n for(int i=0; i<possibleOffsets.length; i++){\n int x = possibleOffsets[i][0] + getRow();\n int y = possibleOffsets[i][1] + getColumn();\n\n //Making sure we dont leave the board\n if(x >= board.length || x < 0\n || y >= board.length || y < 0)\n continue;\n\n //Making sure destination does not contain a friendly piece\n if(Board.containsPieceOfColor(x,y,this.getColor()))\n continue;\n\n moves.add(board[x][y]);\n }\n\n return moves;\n }",
"public void makeMove() {\n ArrayList<Field> myFields = new ArrayList<>();\n for (Field[] fieldsRow : fields) {\n for (Field field : fieldsRow) {\n if(field != null && this.equals(field.getPlayer())) {\n myFields.add(field);\n }\n }\n }\n bestMove[0] = myFields.get(0);\n bestMove[1] = myFields.get(0);\n\n Random rand = new Random();\n for(Field destination : destinationFields) {\n if(canMove()) break;\n destinationField = destination;\n for (Field origin : myFields) {\n for(int i = 0; i < origin.getNeighbours().length; ++i) {\n Field neighbour = origin.getNeighbours()[i];\n if(neighbour != null) {\n if(neighbour.getPlayer() == null) {\n if(valueOfMove(origin, neighbour) > valueOfMove(bestMove[0], bestMove[1])) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n } else if(valueOfMove(origin, neighbour) == valueOfMove(bestMove[0], bestMove[1])) {\n if(rand.nextBoolean()) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n }\n }\n } else {\n Field nextField = neighbour.getNeighbours()[i];\n if(nextField != null) {\n correctJumpPaths(origin,null, origin);\n }\n }\n }\n }\n }\n }\n }",
"private Cell[] allPossibleMoves(Cell source) {\n\t\tCell[] moves = new Cell[2 * Board.BOARD_SIZE - 2]; // Вертикаль и горизонталь, которые бьет ладья\n\t\tint columnIndex = source.getColumn();\n\t\tint rowIndex = source.getRow();\n\t\tint k = 0;\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != rowIndex) {\n\t\t\t\tmoves[k++] = new Cell(columnIndex, i);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != columnIndex) {\n\t\t\t\tmoves[k++] = new Cell(i, rowIndex);\n\t\t\t}\n\t\t}\n\t\treturn moves;\n\t}",
"public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"@Test(timeout=2000) public void testMovesToReach(){\r\n GameStateSpace states = new GameStateSpace(this.initial);\r\n // For every target state based on the initial game look at a\r\n // target and calculate the moves to reach it\r\n for(int target=0; target<this.targetGameMoves.size(); target++){\r\n GameAndMoves gm = this.targetGameMoves.get(target);\r\n ZombieTrapGame targetGame = gm.game;\r\n List<String> expectMoves = gm.moves;\r\n List<String> actualMoves = states.movesToReach(targetGame);\r\n StringBuilder sb = new StringBuilder(this.name+\"\\n\");\r\n sb.append(\"TARGET GAME NUMBER \"+target+\"\\n\");\r\n \r\n // Check if the moves are equal to the expectation\r\n if(expectMoves==null && actualMoves==null){\r\n continue;\r\n }\r\n else if(expectMoves !=null && expectMoves.equals(actualMoves)){\r\n continue;\r\n }\r\n else if(expectMoves!=null && actualMoves==null){\r\n sb.append(\"State misidentified as NOT reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n // If equal length do they produce the correct board: could be\r\n // alternate paths to the same state\r\n ZombieTrapGame game = this.initial.copy();\r\n for(String move : actualMoves){\r\n doShift(game,move);\r\n }\r\n\r\n // ADD THIS CODE to fix a bug in the original test cases\r\n if(expectMoves==null && actualMoves!=null){\r\n sb.append(\"State misidentified as IS reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n if(!game.equals(targetGame)){ // Moves don't lead to target state\r\n sb.append(\"Actual move sequence does not lead to target state\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n } \r\n // Different path but same length, not an error\r\n else if(actualMoves.size() == expectMoves.size()){\r\n continue;\r\n }\r\n // Check if the moves are longer than the expected\r\n else if(actualMoves.size() > expectMoves.size()){\r\n sb.append(\"Actual move sequence is longer than the expected move sequence\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n // A shorter path!?\r\n else {\r\n sb.append(\"Actual move sequence is SHORTER than the expected move sequence\\n\");\r\n sb.append(\"YOU HAVE DISCOVERED A BUG IN THE TEST CASES: NOTIFY THE COURSE INSTRUCTOR\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n }",
"void generateBoard(){\r\n rearrangeSolution();\r\n makeInitial();\r\n }",
"@Override\r\n\tpublic ArrayList<String> allPossibleMoves(boolean whoPlays) {\r\n\t\t\r\n\t\tArrayList<String> Moves = new ArrayList<String>();\r\n\t\t\r\n\t\tif(whoPlays) {\r\n\t\t\tif( (new Board2048model(this)).moveUP()) \r\n\t\t\tMoves.add(\"UP\");\r\n\t\t\tif( (new Board2048model(this)).moveDOWN()) \r\n\t\t\tMoves.add(\"DOWN\");\r\n\t\t\tif( (new Board2048model(this)).moveRIGHT()) \r\n\t\t\tMoves.add(\"RIGHT\");\r\n\t\t\tif( (new Board2048model(this)).moveLEFT()) \r\n\t\t\tMoves.add(\"LEFT\");\r\n\t\t\t}\r\n\t\telse { \r\n\t\t\tfor( int i = 0; i < rows_size ; i++) {\r\n\t\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\t\tif(isEmpty(i,j)) {\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(2)));\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(4)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t}\r\n\treturn Moves;\r\n\t}",
"public ArrayList<ArrayList<Move>> getMoves(int color){//TODO\n \tArrayList<ArrayList<Move>> moves = new ArrayList<ArrayList<Move>>();\n \tboolean jumpsExist = false;\n \t//look for jumps\n \t//search the board for pieces of your color\n for (int i=0; i<8; i++){\n \tfor(int j=0; j<8; j++){\n \t\t//if the piece is the right color\n \t\tif ((gameState.getStateOfSquare(i, j) != 0)&&(gameState.getStateOfSquare(i, j)%2 == color)){\n// \t\t\tSystem.out.println(\"found a piece you own\");\n \t\t\t//find all jumps of that piece\n \t\t\t//get jumps\n \t\t\tArrayList<ArrayList<Move>> jumps = getJumps(color, i, j);\n \t\t\t//if there are jumps return only the jumps\n \t\t\tif (jumps.isEmpty() == false){\n \t\t\t\tmoves.addAll(jumps);\n \t\t\t\tjumpsExist = true;\n \t\t\t}\n \t\t}\n \t}\n }\n if (jumpsExist == false){\n\t //look for diagonals\n\t \t//search the board for pieces of your color\n\t for (int i=0; i<8; i++){\n\t \tfor(int j=0; j<8; j++){\n\t \t\t//if the piece is the right color\n\t \t\tif ((gameState.getStateOfSquare(i, j) != 0)&&(gameState.getStateOfSquare(i, j)%2 == color)){\n//\t \t\t\tSystem.out.println(\"found a piece you own\");\n\t \t\t\t//get diagonals\n\t \t\t\t//try up right\n\t \t\t\tMove tryMove = new Move(i,j,i+1,j+1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try up left\n\t \t\t\ttryMove = new Move(i,j,i-1,j+1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try down right\n\t \t\t\ttryMove = new Move(i,j,i+1,j-1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try down left\n\t \t\t\ttryMove = new Move(i,j,i-1,j-1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t }\n\t }\n if (moves.isEmpty() == true){\n \tnoMoves = true;\n }\n \t\t\t//\n \treturn moves;\n }",
"private static void playersMove() {\r\n\t\tPrint print = new Print(); \r\n\t\tprint.board(game); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints the entire gameBoard.\r\n\t\t\r\n\t\tboolean flag = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//true = Get Gideon's move | false = Get User's move\r\n\t\r\n\t\tArrayList<Integer> moves = MoveGenerator.Gen(flag, gamePieces);\t\t\t\t\t\t\t//returns all the legal moves possible to make by the player.\r\n\t\tPrint.moves(moves);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints all the moves returned by the Gen method.\r\n\t\t\r\n\t\tSystem.out.print(\"\\n\\n Enter your move: \");\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tString userInput = kb.next();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Captures the players move\r\n\t\t\r\n\t\tboolean moveCheck = CheckUserInput.checkMove(userInput, moves);\t\t\t\t\t\t\t//Checks if the move entered by the player is in the legal move list\r\n\t\t\r\n\t\tString formattedUserInput = null;\r\n\t\t\r\n\t\tif(!moveCheck)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Recall the playersMove() method if the move entered by the user is illegal\r\n\t\t\tplayersMove();\r\n\r\n\t\tformattedUserInput = FormatInput.formatUserMove(userInput);\t\t\t\t\t\t\t//Formatting the user's move to make it as an executable move on the board\r\n\t\t\r\n\t\t//System.out.println(formattedUserInput);\r\n\t\t\r\n\t\tUpdateBoard boardUpdater = new UpdateBoard();\r\n\t\tgame = boardUpdater.playMove(formattedUserInput,game, gamePieces, flag, false, true); //Executing the legal move on the gameBoard\r\n\t\tgamePieces = game.getGamePiecesArray();\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the updated copy of the Game Pieces Array\r\n\t\tgame.updateGameBoard();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Updating the String copy of the game board (required to print the updated gameBoard)\r\n\t\t\r\n\t\tSystem.out.println(\"\\n ========================\");\r\n\t\tGideonsMove();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Gideon's turn to make a move\r\n\t\r\n\t}",
"ArrayList<int[]> findValidMoves();",
"public ArrayList<Move> getPossibleMoves() \n\t{\n\t\tArrayList<Move> possibleMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(int i = - 1; i <= 1; i += 2)\n\t\t{\n\t\t\tfor(int j = -1; j <= 1; j += 2)\n\t\t\t{\n\t\t\t\tLocation currentLoc = new Location(getLoc().getRow() + j, getLoc().getCol() + i);\n\t\t\t\t\n\t\t\t\tif(getBoard().isValid(currentLoc))\n\t\t\t\t{\n\t\t\t\t\tif(getBoard().getPiece(currentLoc) == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tArrayList<Node> move = new ArrayList<Node>();\n\t\t\t\t\t\tmove.add(getNode());\n\t\t\t\t\t\tmove.add(getBoard().getNode(currentLoc));\n\t\t\t\t\t\t\n\t\t\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(ArrayList<Node> move : getNextJumps(getLoc(), new ArrayList<Location>()))\n\t\t{\n\t\t\tif(move.size() > 1)\n\t\t\t{\n\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Move> jumpMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(Move possibleMove : possibleMoves)\n\t\t{\n\t\t\tif(!possibleMove.getJumped().isEmpty())\n\t\t\t{\n\t\t\t\tjumpMoves.add(possibleMove);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!jumpMoves.isEmpty())\n\t\t{\n\t\t\treturn jumpMoves;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn possibleMoves;\n\t\t}\n\t}",
"public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Override\n public Map<Coordinate, List<Coordinate>> getAllLegalMoves(List<Integer> playerStates) {\n Map<Coordinate, List<Coordinate>> allLegalMoves = new TreeMap<>();\n for (List<GamePiece> row: myGamePieces) {\n for(GamePiece currPiece: row){\n if (playerStates.contains(currPiece.getState()) || currPiece.getState() == myEmptyState) {\n Coordinate currCoord = currPiece.getPosition();\n List<Coordinate> moves = currPiece.calculateAllPossibleMoves(getNeighbors(currPiece), playerStates.get(0));\n if (moves.size() > 0) {\n allLegalMoves.put(currCoord, moves);\n }\n }\n }\n }\n return allLegalMoves;\n }",
"public void getPossibleMoves() { \n\t\t\tsuper.getPossibleMoves();\n\t\t\tfor (int i = 0; i < Math.abs(xrange); i++) {\n\t\t\t\tif (currentx + xrange - ((int) Math.pow(-1,color)*i) >= 0) { \n\t\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + xrange - ((int) Math.pow(-1,color)*i) ][currenty]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( currentx - 1 >= 0 && currenty - 1 >= 0 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1].isOccupiedByOpponent()) {\t// Diagonol left space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1]);\n\t\t\t}\n\t\t\tif (currentx - 1 >= 0 && currenty + 1 <= 7 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1].isOccupiedByOpponent()) { \t//Diagonol right space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1]);\n\t\t\t}\n\t\t\t\n\t}",
"public static void main(String[] args) {\n final int NUM_OF_POSSIBLE_MOVES = 18;\n Move[] moves = new Move[NUM_OF_POSSIBLE_MOVES];\n\n //gives memory\n for(int i = 0; i < NUM_OF_POSSIBLE_MOVES; i++){\n moves[i] = new Move();\n }\n\n //sets the moves\n moves[0].setMove(0,1,3);\n moves[1].setMove(0,2,5);\n moves[2].setMove(1,3,6);\n moves[3].setMove(1,4,8);\n moves[4].setMove(2,4,7);\n moves[5].setMove(2,5,9);\n moves[6].setMove(3,6,10);\n moves[7].setMove(3,7,12);\n moves[8].setMove(4,7,11);\n moves[9].setMove(4,8,13);\n moves[10].setMove(5,8,12);\n moves[11].setMove(5,9,14);\n moves[12].setMove(3,4,5);\n moves[13].setMove(6,7,8);\n moves[14].setMove(7,8,9);\n moves[15].setMove(10,11,12);\n moves[16].setMove(11,12,13);\n moves[17].setMove(12,13,14);\n\n for(int i = 0; i < 5; i++){\n System.out.println(\" ===\" + i + \"===\");\n\n int[] cell = init(i);\n show(cell);\n\n System.out.println();\n }\n\n }",
"public List<Move> getValidMoves(Board board, boolean checkKing) {\n List<Move> moves = new ArrayList<Move>();\n\n // if no board given, return empty list\n if (board == null)\n return moves;\n\n // checks moves where the pawn advances a rank\n advance(board, moves);\n // checks moves where the pawn captures another piece\n capture(board, moves);\n // checks en passant moves\n enPassant(board, moves);\n\n // check that move doesn't put own king in check\n if (checkKing)\n for(int i = 0; i < moves.size(); i++)\n if (board.movePutsKingInCheck(moves.get(i), this.color)) {\n // if move would put king it check, it is invalid and\n // is removed from the list\n moves.remove(moves.get(i));\n // iterator is decremented due to the size of the list\n // decreasing.\n i--;\n }\n return moves;\n }",
"List<Move> legalMoves(Piece side) {\r\n legalMovesArr = new ArrayList<Move>();\r\n HashSet<Square> pieceSide = pieceLocations(side);\r\n for (Square pieces : pieceSide) {\r\n for (int i = 0; i <= 8; i++) {\r\n Move x = mv(pieces, sq(pieces.col(), i));\r\n legalMovesArr.add(x);\r\n }\r\n for (int j = 0; j <= 8; j++) {\r\n Move y = mv(pieces, sq(j, pieces.row()));\r\n legalMovesArr.add(y);\r\n }\r\n while (legalMovesArr.remove(null));\r\n }\r\n return legalMovesArr;\r\n }",
"@Override\n public Map<Direction, List<Coordinate>> getPossibleMoves() {\n\n Map<Direction, List<Coordinate>> moves = new HashMap<>();\n\n Coordinate coordinate = this.getCoordinate();\n int row = coordinate.getRow();\n int col = coordinate.getCol();\n\n //Jumps\n List<Coordinate> jumps = new ArrayList<>();\n\n //\n //\n ////\n int tempRow1 = row - 2;\n int tempCol1 = col - 1;\n Coordinate tempCoordinate1 = new Coordinate(tempRow1, tempCol1);\n if (Board.inBounds(tempCoordinate1)) {\n jumps.add(tempCoordinate1);\n }\n\n ////\n //\n //\n int tempRow2 = row + 2;\n int tempCol2 = col - 1;\n Coordinate tempCoordinate2 = new Coordinate(tempRow2, tempCol2);\n if (Board.inBounds(tempCoordinate2)) {\n jumps.add(tempCoordinate2);\n }\n\n //////\n //\n int tempRow3 = row - 1;\n int tempCol3 = col - 2;\n Coordinate tempCoordinate3 = new Coordinate(tempRow3, tempCol3);\n if (Board.inBounds(tempCoordinate3)) {\n jumps.add(tempCoordinate3);\n }\n\n ///////\n //\n int tempRow4 = row - 1;\n int tempCol4 = col + 2;\n Coordinate tempCoordinate4 = new Coordinate(tempRow4, tempCol4);\n if (Board.inBounds(tempCoordinate4)) {\n jumps.add(tempCoordinate4);\n }\n\n ////\n //\n //\n int tempRow5 = row + 2;\n int tempCol5 = col + 1;\n Coordinate tempCoordinate5 = new Coordinate(tempRow5, tempCol5);\n if (Board.inBounds(tempCoordinate5)) {\n jumps.add(tempCoordinate5);\n }\n\n //\n //\n ////\n int tempRow6 = row - 2;\n int tempCol6 = col + 1;\n Coordinate tempCoordinate6 = new Coordinate(tempRow6, tempCol6);\n if (Board.inBounds(tempCoordinate6)) {\n jumps.add(tempCoordinate6);\n }\n\n //\n //////\n int tempRow7 = row + 1;\n int tempCol7 = col - 2;\n Coordinate tempCoordinate7 = new Coordinate(tempRow7, tempCol7);\n if (Board.inBounds(tempCoordinate7)) {\n jumps.add(tempCoordinate7);\n }\n\n //\n //////\n int tempRow8 = row + 1;\n int tempCol8 = col + 2;\n Coordinate tempCoordinate8 = new Coordinate(tempRow8, tempCol8);\n if (Board.inBounds(tempCoordinate8)) {\n jumps.add(tempCoordinate8);\n }\n\n if (!jumps.isEmpty()) {\n moves.put(Direction.Jump, jumps);\n }\n return moves;\n }",
"public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }",
"@Override\r\n\tpublic void getLegalMoves() {\r\n\t\tint pawnX = this.getX();\r\n\t\tint pawnY = this.getY();\r\n\t\tchar pawnColor = getColor();\r\n\t\tTile[][] chessBoard = SimpleChess.getChessBoard();\r\n\t\tcheckInFront(chessBoard,pawnX,pawnY,pawnColor);\r\n\t\tcheckDiagonal(chessBoard,pawnX,pawnY,pawnColor);\r\n\t}",
"public void executeMove(Game game) {\n int bestScore = 0;\n int comScore = 0;\n Board board = game.getBoard();\n int col = (board.getCols());\n int row = (board.getRows());\n \n // Basic for loop to go through and grab each gem and call the score policy on it\n // it stores the best opton in best score\n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n comScore = game.getPolicy().scoreMove(i,ii,board);\n if(comScore >= bestScore){\n bestScore = comScore;\n }\n }\n }\n \n // This for loop makes a Coord with the rows and col i and ii to keep track of where the best gem was located \n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n if(game.getPolicy().scoreMove(i,ii,board) == bestScore){\n holder.add(new Coord(i,ii));\n }\n }\n }\n \n // For loop to choose the best Gem out of the holders Coords to call \"removeGemAdjustScore()\"\n for(int i = 0; i < holder.size(); i++){\n if(holder.size() == 1){\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n \n // Resets the holder and best score for the next move\n holder = new ArrayList<Coord>();\n bestScore = 0;\n \n }",
"public List<Move> getAvailableSpaces() {\n List<Move> availableMoves = new ArrayList<>();\n for (int i = 0; i < LENGTH; i++) {\n for (int j = 0; j < LENGTH; j++) {\n Move move = new Move(i, j);\n if (isValidMove(move)) {\n availableMoves.add(move);\n }\n }\n }\n return availableMoves;\n }",
"public void aiMove(int turn)\n\t{\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint choice = 0;\n\t\t/*\n\t\t * Picks a random move on the first turn\n\t\t */\n\t\tif (turn == 0 )\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\trow = (int) (Math.random() * 3);\n\t\t\t\tcol = (int) (Math.random() * 3);\n\t\t\t\tchoice = (int) (Math.random() * (ai.size()-1));\n\t\t\t\tif (board[row][col] == 0) \n\t\t\t\t{\t\t// valid move (empty slot)\n\t\t\t\t\tboard[row][col] = ai.get(choice);\n\t\t\t\t\tdraw.drawMove(col, row,ai.get(choice));\n\t\t\t\t\tai.remove(choice);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * Otherwise checks every number, and every square for a winning move\n\t\t */\n\t\telse\n\t\t{\n\t\t\tboolean madeMove = false;\n\t\t\twhile (true) \t\t\t\t\t\t\t\t\t\n\t\t\t{\n\t\t\t\tif (madeMove == true)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (int a = 0; a <ai.size(); a++)\n\t\t\t\t{\n\t\t\t \t\tfor (int x = 0; x < 3; x++)\t\t\t\t\t//loops through all squares and checks if free\n\t\t\t \t\t{\n\t\t\t \t\t\tfor ( int y = 0; y < 3; y++)\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\tif (madeMove == false)\n\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\tif( board[x][y] == 0)\n\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t\tif (((x == 0 && y == 0)\t\t\t\t\t//checks for first diagonal and then if it is the winning move\n\t\t\t\t \t\t\t\t\t\t|| (x == 1 && y == 1) \n\t\t\t\t \t\t\t\t\t\t|| (x == 2 && y == 2)))\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\tif (Math.abs(board[0][0] + board[1][1] + board[2][2]) + ai.get(a) == 15)\n\t\t\t\t \t\t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\t\trow = x;\n\t\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t\tif (((x == 0 && y == 2) \t\t\t//checks second diagonal for winning move\n\t\t\t\t\t \t\t\t\t\t\t|| (x == 1 && y == 1) \n\t\t\t\t\t \t\t\t\t\t\t|| (x == 2 && y == 0)))\n\t\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t\t\tif (Math.abs(board[0][2] + board[1][1] + board[2][0]) + ai.get(a) == 15)\n\t\t\t\t \t\t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\t\trow = x;\n\t\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t\t}\n\t\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\t\telse if ((Math.abs(board[x][0] + board[x][1] + board[x][2]) + ai.get(a) == 15))\t//checks for winning row\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\trow = x;\n\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t\telse if ((Math.abs(board[0][y] + board[1][y] + board[2][y]) + ai.get(a) == 15)) //checks for winning column\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\trow = x;\n\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t}\n\t\t\t \t\tif (madeMove == false)\t\t\t\t\t\t//if a winning move can't be found, a random one is made\n\t \t\t\t\t{\n\t\t\t\t\t\tchoice = (int) (Math.random() * (ai.size()-1));\n\t \t\t\t\t\trow = (int) (Math.random() * 3);\n\t \t\t\t\t\tcol = (int) (Math.random() * 3);\n\t \t\t\t\t\tif (board[row][col] == 0) \n\t \t\t\t\t\t{\t\t\t// valid move (empty slot)\n\t \t\t\t\t\t\tboard[row][col] = ai.get(choice);\n\t \t\t\t\t\t\tdraw.drawMove(col, row, ai.get(choice));\n\t \t\t\t\t\t\tai.remove(choice);\n\t \t\t\t\t\t\tmadeMove = true;\n\t \t\t\t\t\t\tbreak;\n\t \t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void getPossibleMoves() {\n\t\tGameWindow.potentialMoves.clear();\n\t}",
"public PossibleMove[] getPossibleMoves(Coordinate from);",
"private static void GideonsMove() {\r\n\t\tPrint print = new Print();\r\n\t\tprint.board(game);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints the entire gameBoard.\r\n\t\t\r\n\t\tboolean flag = true;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//true = Gideon's move | false = user's move\r\n\t\t\r\n\t\tArrayList<Integer> moves = MoveGenerator.Gen(flag, gamePieces);\t\t\t\t\t\t\t//returns all the legal moves possible to make by the player.\r\n\t\tPrint.moves(moves);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints all the moves returned by the Gen method.\r\n\t\t\r\n\t\t//System.out.println(\"\\n\\n Gideon will play......\" \r\n\t\t\t\t\t\t//+\"Feature coming soon, until then keep practicing\\n\");\r\n\t\t \r\n\t\tMiniMax minimax = new MiniMax(game, moves);\t\t\t\t\t\t\t\t\t\t\t\t//Declaring and initializing MiniMax object with parameters game and moves\r\n\r\n\t\tif(moves.size() < 6) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Will increment the MiniMax MAX_DEPTH size by 1 if the legal moves are less than 6\r\n\t\t\tminimax.incrementMAX_DEPTH();\r\n\t\t}\r\n\t\t\r\n\t\tlong start_time = System.nanoTime();\t\t\t\t\t\t\t\t\t\t\t\t\t//Time before starting MiniMax\r\n\t\t\r\n\t\tString gideonsMove = minimax.start();\t\t\t\t\t\t\t\t\t\t\t\t\t//Starting MiniMax\r\n\t\r\n\t\tdouble elapsed = System.nanoTime()-start_time;\t\t\t\t\t\t\t\t\t\t\t//Total time taken by MiniMax=Time after MiniMax is finished-Time before MiniMax was started\r\n\t elapsed=elapsed/1000000000;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Converting to seconds\r\n\t \r\n\t\tSystem.out.print(\"\\n\\n Gideon's move: \"+\r\n\t\t\t\tGideonsMoveConvertor.convert(gideonsMove)+\"\\n\\n\");\t\t\t\t\t\t\t\t//Changing GideonsMove to A1B2 format\r\n\t\t\r\n\t\tUpdateBoard boardUpdater = new UpdateBoard();\r\n\t\t\r\n\t\tgame = boardUpdater.playMove(gideonsMove, game, gamePieces, flag, false, true);\t\t\t//Executing the legal move on the gameBoard\r\n\t\tgamePieces = game.getGamePiecesArray();\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the updated copy of the Game Pieces Array\r\n\t\tgame.updateGameBoard();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Updating the String copy of the game board (required to print the updated gameBoard)\r\n\t\t\r\n\t\tSystem.out.println(\"Depth used for this iteration --> \"+minimax.getMAX_DEPTH());\t\t//Printing the MAX_DEPTH used by MiniMax to calculate the best move\r\n\t\tSystem.out.println(\"Time Taken for MiniMax --> \"+elapsed);\t\t\t\t\t\t\t\t//Printing time taken by MiniMax to calculate the best move\r\n\t\tSystem.out.println(\"\\n ========================\");\r\n\t\tplayersMove();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Player's turn to make a move\r\n\t\t\r\n\t}",
"public void setValidMoves(){\r\n int row = (int)this.space.getX();\r\n int column = (int)this.space.getY();\r\n int max = puzzleSize-1;\r\n if (row < max)\r\n this.validMoves.add(new Point(row+1, column));\r\n if (row > 0)\r\n this.validMoves.add(new Point(row-1, column));\r\n if (column < max)\r\n this.validMoves.add(new Point(row, column+1));\r\n if (column > 0)\r\n this.validMoves.add(new Point(row, column-1));\r\n }",
"public List<Move> getValidMoves(Player player) {\n LinkedList<Move> listOfMoves = new LinkedList<>();\n Pawn aPawn;\n int Size;\n Size = getSize();\n\n //parcours du plateau pour trouver tous les pions de player\n for (int numLine = 0; numLine < Size; numLine++) {\n for (int numCol = 0; numCol < Size; numCol++) {\n\n aPawn = field[numLine][numCol];\n if (aPawn != null) {\n if (aPawn.getPlayer().getColor() == player.getColor()) { //if the pawn belong to player\n addValidMovesAux(numCol, numLine, listOfMoves, player);\n }\n }\n }\n }\n return listOfMoves;\n }",
"public static boolean hasWinningMove(int[][] gamePlay){\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(gamePlay[i][j]==1){\n\t\t\t\t\tfor(int k=1;k<9;k++){\n\t\t\t\t\t\tint[] root={i,j};\n\t\t\t\t\t\tint[] root1={i,j};\n\t\t\t\t\t\tint[] source=root;\n\t\t\t\t\t\tsource=calculatePosition(root,k);\n\t\t\t\t\t\t//System.out.println(\"Looking in direction \"+k+\" For root\"+i+\",\"+j);\n\t\t\t\t\t\tif(isValidLocation(source)){ \n\t\t\t\t\t\t\tif(gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\tint[] newSource=calculatePosition(source,k);\n\t//System.out.println(\"Two contigous isValid:\"+isValidLocation(newSource)+\"newSource(\"+newSource[0]+\",\"+newSource[1]+\")\"+\" gamePlay:\"+(isValidLocation(newSource)?gamePlay[newSource[0]][newSource[1]]:-1));\n\t\t\t\t\t\t\t\tif(isValidLocation(newSource)){ \n\t\t\t\t\t\t\t\t\tif(gamePlay[newSource[0]][newSource[1]]==0){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking in opposite direction\");\n\t\t\t\t\t\t\t\t\t//Lookup in opposite direction\n\t\t\t\t\t\t\t\t\tnewSource=calculatePosition(root1,9-k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(newSource) && gamePlay[newSource[0]][newSource[1]]==1){\n\t\t\t\t\t\t\t\t\t\t//System.out.println(\"Valid Location:\"+newSource[0]+\" \"+newSource[1]+\" gamePlay\"+gamePlay[newSource[0]][newSource[1]]);\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}else if(gamePlay[source[0]][source[1]]==0){\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking for alternate\");\n\t\t\t\t\t\t\t\t\tsource=calculatePosition(source,k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(source) && gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//System.out.println(\"Invalid direction or no move here isValid:\"+isValidLocation(source)+\"Source(\"+source[0]+\",\"+source[1]+\")\"+\" gamePlay:\"+(isValidLocation(source)?gamePlay[source[0]][source[1]]:-1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public ArrayList<Pair<Coord,Coord>> returnMoves(Board b) {\r\n\t\t//copy Piece grid\r\n\t\tPiece[][] g = b.getGrid();\r\n\t\t\r\n\t\t//return array of all the possible moves\r\n\t\tArrayList<Pair<Coord,Coord>> possibleMoves = new ArrayList<Pair<Coord,Coord>>();\r\n\r\n\t\t//System.out.println(team + \": (\" + c.y + \", \" + c.x + \")\");\r\n\t\t//if the team is moving north (white team)\r\n\t\tif(team) {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y-1][c.x] == null && g[c.y-2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-2,c.x),null));\r\n\t\t\t\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y-1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y-1][c.x-1]!=null && (!g[c.y-1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y-1][c.x+1]!=null && (!g[c.y-1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==3 && g[c.y-1][c.x-1]==null && g[c.y][c.x-1]!=null && !g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==3 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && !g[c.y][c.x+1].team\r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t//if the team is moving south (black team)\r\n\t\t} else {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y+1][c.x] == null && g[c.y+2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+2,c.x),null));\r\n\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y+1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y+1][c.x-1]!=null && (g[c.y+1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y+1][c.x+1]!=null && (g[c.y+1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==4 && g[c.y+1][c.x-1]==null && g[c.y][c.x-1]!=null && g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==4 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && g[c.y][c.x+1].team \r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\treturn possibleMoves;\r\n\t}",
"public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }",
"public void RunGame(){\r\n \r\n for (int i=0;i<numberoplayers;i++){ \r\n if (Objects.equals(Players.get(i).numofdestroyedships,numberofships))\r\n {\r\n Leave(Players.get(i));\r\n }\r\n if (Players.size()==1){\r\n Stop(Players.get(0));\r\n return ;\r\n }\r\n Square attackmove=Players.get(i).AttackOpponent();\r\n if (attackmove==null){\r\n if (i==1)\r\n i=-1;\r\n continue;\r\n }\r\n //know the player name and the attack point and add it to the list\r\n moves.add(new ToturialClass(Players.get(i).name,attackmove.x,attackmove.y,new Date()));\r\n //to know the targeted player\r\n int temp=i+1;\r\n if (temp==2)\r\n temp=0;\r\n AttackResult result=Players.get(temp).AcceptAttack(attackmove); \r\n Players.get(i).AcceptAttackResult(result);\r\n playerboard.repaintafterupdate();\r\n \r\n if (i==1)\r\n i=-1;\r\n }\r\n }",
"private static ArrayList<Point> getCurrentlyValidMoves(){\n ArrayList<Point> currentlyValidMoves = new ArrayList<Point>();\n //iterate through the gameboard, checking if the move is valid\n for( int row = 0; row < 8; row++ ){\n for( int column = 0; column < 8; column++ ){\n if( gamepieces[ row ][ column ] == BACKGROUND_COLOR && isMoveValid( row, column ) ){\n //if it is valid, add it to our list\n currentlyValidMoves.add( new Point( row, column ) );\n }\n }\n }\n return currentlyValidMoves;\n }",
"public PossibleMoves getPossibleMoves(State state){\n if(possibleMoves == null){\n possibleMoves = new PossibleMoves(state);\n }\n return possibleMoves;\n }",
"public String autoPlayAdvanced(int sign) {\n boolean validTurn = false;\n int temp1 = 0;\n int temp2 = 0;\n int sign2 = 0;\n //copy the board\n TicTacToe TTTemp = new TicTacToe(TTT.getSize());\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n //player turn finding\n if (sign == 1) {\n sign2 = 2;\n } else {\n sign2 = 1;\n }\n\n int done = 0;\n //cycle to determine \"best\" or random move\n while (!validTurn) {\n switch (done) {\n case 0: //Win condition check\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign, i, j);\n\n //if after changing empty tile to your sign...\n switch (TTTemp.check(sign)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 1;\n break;\n case \"Tie\":\n done = 1;\n break loop;\n default: //won in any way\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n }\n }\n break;\n case 1: //Player win condition check\n //copy board again\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign2, i, j);\n\n //if after changing empty tile to player sign...\n switch (TTTemp.check(sign2)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 2;\n break;\n case \"Tie\":\n done = 2;\n break loop;\n default: //player might win\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n\n }\n }\n break;\n default: //if \"best\" move wasn't found mark a random tile\n temp1 = new Random().nextInt(TTT.getSize());\n temp2 = new Random().nextInt(TTT.getSize());\n validTurn = TTT.safeChangeTile(sign, temp1, temp2);\n break;\n }\n }\n\n // return selected tile\n return temp1 + \" \" + temp2;\n }",
"List gen() {\n\tList ret = new ArrayList();\n\n\tlong emptySlots = ~(pieceBits[LIGHT] | pieceBits[DARK]);\n\tif (side == LIGHT) {\n\tlong moves = (pawnBits[LIGHT] >> 8) & emptySlots;\n\tlong keep = moves;\n\twhile (moves != 0) {////// bouger le pion d'une case\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 8, theMove, 16);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((keep & 0x0000ff0000000000L) >> 8) & emptySlots;// bouge le pion\n\t\twhile (moves != 0) {//bouger le pion de deux case\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 16, theMove, 24);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((pawnBits[LIGHT] & 0x00fefefefefefefeL) >> 9)\n\t\t& pieceBits[DARK];\n\t\twhile (moves != 0) {//pion qui mange un autre pion\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 9, theMove, 17);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((pawnBits[LIGHT] & 0x007f7f7f7f7f7f7fL) >> 7)\n\t\t& pieceBits[DARK];\n\t\twhile (moves != 0) {// manger a droite\n\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove + 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t} else {\n\tlong moves = (pawnBits[DARK] << 8) & emptySlots;\n\tlong keep = moves;\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 8, theMove, 16);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((keep & 0xff0000L) << 8) & emptySlots;\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 16, theMove, 24);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[DARK] & 0x00fefefefefefefeL) << 7)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[DARK] & 0x007f7f7f7f7f7f7fL) << 9)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 9, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t}\n\tlong pieces = pieceBits[side] ^ pawnBits[side];\n\twhile (pieces != 0) {\n\tint i = getLBit(pieces);\n\tint p = piece[i];\n\tfor (int j = 0; j < offsets[p]; ++j)\n\tfor (int n = i;;) {\n\tn = mailbox[mailbox64[n] + offset[p][j]];\n\tif (n == -1)\n\tbreak;\n\tif (color[n] != EMPTY) {\n\tif (color[n] == xside)\n\tgenPush(ret, i, n, 1);\n\tbreak;\n\t}\n\tgenPush(ret, i, n, 0);\n\tif (!slide[p])\n\tbreak;\n\t}\n\tpieces &= (pieces - 1);\n\t}\n\n\t/* petit rock */\n\tif (side == LIGHT) {\n\tif (((castle & 1) != 0) && (piece[F1] == EMPTY)\n\t&& (piece[G1] == EMPTY))\n\tgenPush(ret, E1, G1, 2);\n\tif (((castle & 2) != 0) && (piece[D1] == EMPTY)\n\t&& (piece[C1] == EMPTY) && (piece[B1] == EMPTY))\n\tgenPush(ret, E1, C1, 2);\n\t} else {\n\tif (((castle & 4) != 0) && (piece[F8] == EMPTY)\n\t&& (piece[G8] == EMPTY))\n\tgenPush(ret, E8, G8, 2);\n\tif (((castle & 8) != 0) && (piece[D8] == EMPTY)\n\t&& (piece[C8] == EMPTY) && (piece[B8] == EMPTY))\n\tgenPush(ret, E8, C8, 2);\n\t}\n\n\t/* generate en passant moves */\n\tif (ep != -1) {\n\tif (side == LIGHT) {\n\tif (COL(ep) != 0 && color[ep + 7] == LIGHT\n\t&& piece[ep + 7] == PAWN)\n\tgenPush(ret, ep + 7, ep, 21);\n\tif (COL(ep) != 7 && color[ep + 9] == LIGHT\n\t&& piece[ep + 9] == PAWN)\n\tgenPush(ret, ep + 9, ep, 21);\n\t} else {\n\tif (COL(ep) != 0 && color[ep - 9] == DARK\n\t&& piece[ep - 9] == PAWN)\n\tgenPush(ret, ep - 9, ep, 21);\n\tif (COL(ep) != 7 && color[ep - 7] == DARK\n\t&& piece[ep - 7] == PAWN)\n\tgenPush(ret, ep - 7, ep, 21);\n\t}\n\t}\n\treturn ret;\n\t}",
"private ArrayList<int[][]> possiblePuzzleMoves(int[][] currentPuzzle) {\n ArrayList<int [][]> possibleMoves = new ArrayList<>();\n //find zero\n int zeroRow = 0;\n int zeroCol = 0;\n for(int i = 0; i < currentPuzzle.length; i++) {\n for (int j = 0; j < currentPuzzle[i].length; j++) {\n if(currentPuzzle[i][j] == 0) {\n zeroRow = i;\n zeroCol = j;\n break;\n }\n }\n }\n\n //check if zero isn't in top row\n if(zeroRow > 0) {\n int [][]newPuzzleConfig = copy(currentPuzzle);\n int tileAbove = newPuzzleConfig[zeroRow - 1][zeroCol];\n newPuzzleConfig[zeroRow - 1][zeroCol] = 0;\n newPuzzleConfig[zeroRow][zeroCol] = tileAbove;\n possibleMoves.add(newPuzzleConfig);\n }\n\n //check if zero isn't in bottom row\n if(zeroRow < 2) {\n int [][]newPuzzleConfig = copy(currentPuzzle);\n int tileBelow = newPuzzleConfig[zeroRow + 1][zeroCol];\n newPuzzleConfig[zeroRow + 1][zeroCol] = 0;\n newPuzzleConfig[zeroRow][zeroCol] = tileBelow;\n possibleMoves.add(newPuzzleConfig);\n\n }\n\n //check if zero isn't in left col\n if(zeroCol > 0) {\n int [][]newPuzzleConfig = copy(currentPuzzle);\n int tileToLeft = newPuzzleConfig[zeroRow][zeroCol-1];\n newPuzzleConfig[zeroRow][zeroCol-1] = 0;\n newPuzzleConfig[zeroRow][zeroCol] = tileToLeft;\n possibleMoves.add(newPuzzleConfig);\n }\n\n //check if zero isn't in right col\n if(zeroCol < 2) {\n int [][]newPuzzleConfig = copy(currentPuzzle);\n int tileToRight = newPuzzleConfig[zeroRow][zeroCol+1];\n newPuzzleConfig[zeroRow][zeroCol+1] = 0;\n newPuzzleConfig[zeroRow][zeroCol] = tileToRight;\n possibleMoves.add(newPuzzleConfig);\n }\n return possibleMoves;\n }",
"public void Move(){\n for(int i = 0; i < moveList.length; i++){\n playerString = \"\";\n switch(moveList[i]) {\n case 1: {\n //TODO: Visited points to others\n System.out.println(\"Moving up!\");\n //Logic for fitness score might need to be moved\n if(!(game.mazeArray[game.playerPosition.getPlayerY() -1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() - 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 10;\n }\n game.moveUp();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 2: {\n System.out.println(\"Moving left!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() -1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() -1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveLeft();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 3: {\n System.out.println(\"Moving right!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() +1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() +1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveRight();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 4: {\n System.out.println(\"Moving down!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY() +1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n freedomPoints += 1;\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveDown();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n default: {\n System.out.println(\"End of line\");\n break;\n //You shouldn't be here mate.\n }\n }\n }\n\n }",
"public abstract HashSet<Location> getPossibleMovements(GameBoard board);",
"public Collection<Key> getAllPossibleMoves(Key currentKey,\n\t\t\tint numberGeneratedSoFarLength) {\n\n\t\tif (KeyPad.isFirstTwoRows(currentKey)) {\n\t\t\tif (isFirstMove(numberGeneratedSoFarLength)) {\n\t\t\t\taddTwoStepForwardToPositionCache(currentKey);\n\t\t\t} else if (isSecondMove(numberGeneratedSoFarLength)) {\n\t\t\t\tremoveTwoStepForwardFromPositionCache(currentKey);\n\t\t\t}\n\t\t}\n\n\t\treturn positionCache.get(currentKey);\n\t}",
"@Override\n\tpublic ArrayList<String> getAvailableSolutions(int player) {\n\t\tArrayList<String> moves = new ArrayList<String>();\n\t\tfor (int col = 0; col < board.getCOLS(); ++col) {\n\t\t\tif(validMove(col)){\n\t\t\t\tmoves.add(\"5,\"+col); \n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn moves;\n\t}",
"public boolean legalMove(ArrayList<Point2D> inputMove,ArrayList<Object> Gamestate){\n FooHistory currentGameState = (FooHistory) Gamestate.get(0);\n ArrayList<Point2D> player1moves= currentGameState.getCurrentState().get(0);\n ArrayList<Point2D> player2moves= currentGameState.getCurrentState().get(1);\n //System.out.println(\"Player1 moves in FooRules: \"+ player1moves);\n \n if(inputMove.size()==1){\n for(ArrayList<Point2D> array: currentGameState.getCurrentState()){\n for(Point2D point:array){\n if(inputMove.get(0).getX()==point.getX() && inputMove.get(0).getY()==point.getY()){\n System.out.println(\"Ilegal Move\");\n return false;\n }\n }\n }\n return true;\n }\n else{//Deals with moving a piece to take pieces\n if(adjacent(inputMove.get(0),inputMove.get(1))){//Makes sure the two input moves are adjacent\n if(currentGameState.getTurnCount()%2==1){ //Player 1's turn\n for(Point2D point:player2moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n if(currentGameState.getTurnCount()%2==0){//Player 2's turn\n for(Point2D point:player1moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n }\n System.out.println(\"Ilegal Move\"); \n return false; \n }\n \n }",
"public ChesspairingTournament generateNextRound(ChesspairingTournament tournament) {\n\t\tthis.mTournament = tournament;\n\t\tthis.mTournament.setParringSummary(Tools.buildParringStarted());\n\t\t// more tan 1 players\n\t\tif (mTournament.getPlayers().size() < 2) {\n\t\t\tthrow new IllegalStateException(\"Please ad at least 2 players or more\");\n\t\t}\n\n\t\t// more rounds than totalRounds? For the moment I do not want to deal\n\t\t// with this use case\n\t\tif (mTournament.getTotalRounds() <= mTournament.getRounds().size()) {\n\t\t\tthrow new IllegalStateException(\"You are trying to generate more rounds than totalRounds\");\n\t\t}\n\n\t\tboolean validationOk = validateOrder();\n\t\tif (!validationOk) {\n\t\t\treturn mTournament;\n\t\t}\n\n\t\tList<ChesspairingRound> rounds = this.mTournament.getRounds();\n\t\tif (rounds.size() <= 0) {\n\t\t\tgenerateFirstRound();\n\t\t\treturn this.mTournament;\n\t\t}\n\n\t\t// make sure that the next round can be generated\n\t\tif (!canIGenerateNextRound()) {\n\t\t\tmTournament.getParringSummary().setShortMessage(PairingSummary.PARRING_NOT_OK);\n\t\t\tmTournament.getParringSummary().setLongMessage(\"You can not generate the next round!\");\n\t\t\treturn mTournament;\n\t\t}\n\n\t\tint roundNumber = mTournament.getRounds().size();\n\t\tcomputeInitialTournamentState(roundNumber);\n\n\t\tcomputeNextRound(roundNumber + 1);\n\t\t// order games points,elo,index\n\n\t\tList<ChesspairingGame> games = this.generatedRound.getGames();\n\t\t// index\n\t\t// the smallest index first\n\t\tCollections.sort(games, new Comparator<ChesspairingGame>() {\n\t\t\t@Override\n\t\t\tpublic int compare(ChesspairingGame o1, ChesspairingGame o2) {\n\t\t\t\tint indexO1 = getHighestIndex(o1);\n\t\t\t\tint indexO2 = getHighestIndex(o2);\n\t\t\t\treturn Integer.compare(indexO1, indexO2);\n\t\t\t}\n\t\t});\n\n\t\t// the highest elo first\n\t\tCollections.sort(games, new Comparator<ChesspairingGame>() {\n\t\t\t@Override\n\t\t\tpublic int compare(ChesspairingGame o1, ChesspairingGame o2) {\n\t\t\t\tint eloO1 = getHighestElo(o1);\n\t\t\t\tint eloO2 = getHighestElo(o2);\n\t\t\t\t// the highest value should be ordered first so wee multiply by\n\t\t\t\t// -1\n\t\t\t\treturn -1 * Integer.compare(eloO1, eloO2);\n\t\t\t}\n\t\t});\n\n\t\t// the highest points first\n\t\tCollections.sort(games, new Comparator<ChesspairingGame>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(ChesspairingGame o1, ChesspairingGame o2) {\n\t\t\t\tDouble pointsO1 = getHighestPoints(o1);\n\t\t\t\tDouble pointsO2 = getHighestPoints(o2);\n\t\t\t\treturn -1 * Double.compare(pointsO1, pointsO2);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * number the games\n\t\t */\n\t\tint i = 1;\n\t\tfor (ChesspairingGame game : games) {\n\t\t\tgame.setTableNumber(i++);\n\t\t}\n\t\t//if buy game ad this game also to the games list\n\t\tif (this.buyGame != null){\n\t\t\tthis.buyGame.setTableNumber(i);\n\t\t\tgames.add(this.buyGame);\n\t\t}\n\t\t// add the generated round to the tournament\n\t\tthis.setRound(this.generatedRound);\n\t\treturn this.mTournament;\n\t}",
"public static void main(String[] args) {\r\n Scanner scnr = new Scanner(System.in);\r\n Random rand = new Random();\r\n goal = rand.nextInt(90) + 10;\r\n moves = 0;\r\n String input;\r\n GameList list = new GameList();\r\n for(int i = 0; i < LIST_SIZE; i++) {\r\n list.addNode(new GameNode(rand));\r\n \r\n\r\n }\r\n \r\n while(!list.contains(goal)) {\r\n System.out.println(\"Goal: \" + goal + \" Moves Taken: \" + moves);\r\n System.out.println(list.toString());\r\n System.out.print(\"Number and Operation \"+ GameOperator.ALL_OPERATORS +\" to Apply: \");\r\n input = scnr.nextLine();\r\n input = input.trim();\r\n if (input.toLowerCase().equals(\"quit\"))return; \r\n if(inputValid(input)) {\r\n readInput(input, list);\r\n moves++;\r\n }else {\r\n System.out.println(\"Invalid input. Commands must be in number followed by operator format.\");\r\n System.out.println(\"Example: 8x\");\r\n }\r\n \r\n }\r\n System.out.println(\"Congratulations! You completed the game in \" + (moves) + \" moves\");\r\n \r\n }",
"public List<ScoredMove> allmShipMoves(GameState gm){\n\t\t\n\t\tList<ScoredMove> mShipMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\tif (getHand().hasMShip()) {\n\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\tif (c instanceof MerchantShip) {\n\t\t\t\t\tmShipMoves.add(new ScoredMove(ACTION.PLAY_MERCHANT_SHIP, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn mShipMoves;\n\t}",
"public List<ScoredMove> allAttackMoves(GameState gm) {\n\t\tList<ScoredMove> attackMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for attacking battles\n\t\tif (gm.getBattleList().size() > 0) {\n\t\t\tfor (Battle b: gm.getBattleList()) {\n\t\t\t\tif (!b.isBattleUsingTrumps()) {\n\t\t\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\t\t\tif (c instanceof PirateShip) {\n\t\t\t\t\t\t\tif (canPirateShipCardAttack(b, (PirateShip)c)){\n\t\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\t\tif (c instanceof Trump) {\n\t\t\t\t\t\tif (canTrumpCardAttack(b, (Trump)c)) {\n\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn attackMoves;\n\t}",
"public void solve() {\n\t\tArrayList<Piece> pieceListBySize = new ArrayList<Piece>(pieceList);\n\t\tCollections.sort(pieceListBySize);\t// This is done since the order\n\t\t\t\t\t\t\t\t\t\t\t// of piece placements does not matter.\n\t\t\t\t\t\t\t\t\t\t\t// Placing larger pieces down first lets\n\t\t\t\t\t\t\t\t\t\t\t// pruning occur sooner.\n\t\t\n\t\t/**\n\t\t * Calculates number of resets needed for a game board.\n\t\t * A \"reset\" refers to a tile that goes from the solved state to\n\t\t * an unsolved state and back to the solved state.\n\t\t * \n\t\t * This is the calculation used for pruning.\n\t\t */\n\t\t\n\t\tArrayList<Integer> areaLeft = new ArrayList<Integer>();\n\t\tareaLeft.add(0);\n\t\tint totalArea = 0;\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\ttotalArea += pieceListBySize.get(i).numberOfFlips;\n\t\t\tareaLeft.add(0, totalArea);\n\t\t}\n\t\tint totalResets = (totalArea - gameBoard.flipsNeeded) / (gameBoard.goal + 1);\n\t\tSystem.out.println(\"Total Resets: \" + totalResets);\n\t\t\n\t\t/* \n\t\tint highRow = 0;\n\t\tint highCol = 0;\n\t\tint[][] maxDim = new int[2][pieceListBySize.size()];\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\tif (highRow < pieceListBySize.get(i).rows)\n\t\t\t\thighRow = pieceListBySize.get(i).rows;\n\t\t\t\n\t\t\tif (highCol < pieceListBySize.get(i).cols)\n\t\t\t\thighCol = pieceListBySize.get(i).cols;\n\t\t\t\n\t\t\tmaxDim[0][i] = highRow;\n\t\t\tmaxDim[1][i] = highCol;\n\t\t}\n\t\t*/\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\tNode<GameBoard> currentNode = new Node<GameBoard>(gameBoard);\n\t\tStack<Node<GameBoard>> stack = new Stack<Node<GameBoard>>();\n\t\tstack.push(currentNode);\n\t\t\n\t\twhile (!stack.isEmpty()) {\n\t\t\tnodeCount++;\n\t\t\t\n\t\t\tNode<GameBoard> node = stack.pop();\n\t\t\tGameBoard current = node.getElement();\n\t\t\tint depth = node.getDepth();\n\t\t\t\n\t\t\t// Checks to see if we reach a solved state.\n\t\t\t// If so, re-order the pieces then print out the solution.\n\t\t\tif (depth == pieceListBySize.size() && current.isSolved()) {\n\t\t\t\tArrayList<Point> moves = new ArrayList<Point>();\n\t\t\t\t\n\t\t\t\twhile (node.parent != null) {\n\t\t\t\t\tint index = node.level - 1;\n\t\t\t\t\tint sequence = pieceList.indexOf(pieceListBySize.get(index));\n\t\t\t\t\tPoint p = new Point(current.moveRow, current.moveCol, sequence);\n\t\t\t\t\tmoves.add(p);\n\t\t\t\t\t\n\t\t\t\t\tnode = node.parent;\n\t\t\t\t\tcurrent = node.getElement();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCollections.sort(moves);\n\t\t\t\tfor (Point p : moves) {\n\t\t\t\t\tSystem.out.println(p);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Nodes opened: \" + nodeCount);\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\t\tSystem.out.println(\"Elapsed Time: \" + ((endTime - startTime) / 1000) + \" secs.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tPiece currentPiece = pieceListBySize.get(depth);\n\t\t\tint pieceRows = currentPiece.rows;\n\t\t\tint pieceCols = currentPiece.cols;\n\t\t\t\n\t\t\tPriorityQueue<Node<GameBoard>> pQueue = new PriorityQueue<Node<GameBoard>>();\n\t\t\t\n\t\t\t// Place piece in every possible position in the board\n\t\t\tfor (int i = 0; i <= current.rows - pieceRows; i++) {\n\t\t\t\tfor (int j = 0; j <= current.cols - pieceCols; j++) {\n\t\t\t\t\tGameBoard g = current.place(currentPiece, i, j);\n\t\t\t\t\t\n\t\t\t\t\tif (totalResets - g.resets < 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t// Put in the temporary priority queue\n\t\t\t\t\tpQueue.add(new Node<GameBoard>(g, node));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Remove from priority queue 1 at a time and put into stack.\n\t\t\t// The reason this is done is so that boards with the highest reset\n\t\t\t// count can be chosen over ones with fewer resets.\n\t\t\twhile (!pQueue.isEmpty()) {\n\t\t\t\tNode<GameBoard> n = pQueue.remove();\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"public static boolean validMove(String move, Person p, Board building )\n {\n Room[][] map = building.getMap();\n move = move.toLowerCase().trim();\n switch (move) {\n case \"n\":\n if (p.getxLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()-1][p.getyLoc()].getName());\n map[p.getxLoc()-1][p.getyLoc()].enterRoom(p,building);\n return true;\n }\n else\n {\n return false;\n }\n case \"e\":\n if (p.getyLoc()< map[p.getyLoc()].length -1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc() + 1].getName());\n map[p.getxLoc()][p.getyLoc() + 1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"s\":\n if (p.getxLoc() < map.length - 1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()+1][p.getyLoc()].getName());\n map[p.getxLoc()+1][p.getyLoc()].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"w\":\n if (p.getyLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc()-1].getName());\n map[p.getxLoc()][p.getyLoc()-1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n default:\n break;\n\n }\n return true;\n }",
"@Test\n public void testThatCorrectMovesAreFound() {\n Solver solver = new Solver();\n PuzzleState state = new PuzzleState(Arrays.asList(CANNIBAL, CANNIBAL),\n Arrays.asList(MISSIONARY, MISSIONARY, CANNIBAL, MISSIONARY), PuzzleState.Position.LEFT_BANK);\n\n // get available moves\n List<Move> moves = solver.getAvailableMoves(state);\n\n Move expectedMove = new Move(Move.Direction.LEFT_TO_RIGHT, Arrays.asList(CANNIBAL, CANNIBAL));\n assertEquals(\"Only two moves should be available!\", 2, moves.size());\n assertTrue(\"List of moves doesn't contain exptected move!\", moves.contains(expectedMove));\n }",
"private ArrayList<Integer> generateUnitMoves(char myType, int mSpot) {\n //Keep track of character moves (cm)\n ArrayList<Integer> cm = new ArrayList<Integer>();\n int row = mSpot / Cols;\n int col = mSpot % Cols;\n\n //We only need to worry about overstepping the\n //range of colomns. Overstepping rows will\n //be pruned out in \"pruneIllegals\"\n if (myType == 'N') {\n //Get Knight moves\n if (col >= 1) {\n cm.add(new Integer(mSpot - Cols - Cols - 1));\n cm.add(new Integer(mSpot + Cols + Cols - 1));\n }\n if (col < Cols - 1) {\n cm.add(new Integer(mSpot - Cols - Cols + 1));\n cm.add(new Integer(mSpot + Cols + Cols + 1));\n }\n if (col >= 2) {\n cm.add(new Integer(mSpot - Cols - 2));\n cm.add(new Integer(mSpot + Cols - 2));\n }\n if (col < Cols - 1) {\n cm.add(new Integer(mSpot - Cols + 2));\n cm.add(new Integer(mSpot + Cols + 2));\n }\n } else if (myType == 'R') {\n //Rook Moves\n //Get moves along Rows\n for (int i = 0; i < Rows; i++) {\n if (i == row) { continue; }\n cm.add(new Integer((i * Cols) + col));\n }\n\n //Get moves along Cols\n for (int i = 0; i < Cols; i++) {\n if (i == col) { continue; }\n cm.add(new Integer((row * Cols) + i));\n }\n } else if (myType == 'B') {\n //Bishop Moves\n\n //Diagonal movement\n //East movements\n for(int i = 1; i < Cols - col; i++) {\n cm.add(new Integer(mSpot + (i*Cols) + i));\n cm.add(new Integer((mSpot - (i*Cols)) + i));\n }\n //West movements\n for(int i = 1; i <= col; i++) {\n cm.add(new Integer((mSpot + (i*Cols)) - i));\n cm.add(new Integer((mSpot - (i*Cols)) - i));\n }\n } else if (myType == 'P') {\n //Pawn Moves\n if (col >= 1) {\n cm.add(new Integer((mSpot - Cols) - 1));\n }\n if (col < Cols - 1) {\n cm.add(new Integer((mSpot - Cols) + 1));\n }\n } else if (myType == 'Q') {\n //Queen Moves\n\n //Get moves along Rows\n for (int i = 0; i < Rows; i++) {\n if (i == row) { continue; }\n cm.add(new Integer((i * Cols) + col));\n }\n\n //Get moves along Cols\n for (int i = 0; i < Cols; i++) {\n if (i == col) { continue; }\n cm.add(new Integer((row * Cols) + i));\n }\n\n //Diagonal movement\n //East movements\n for(int i = 1; i < Cols - col; i++) {\n cm.add(new Integer(mSpot + (i*Cols) + i));\n cm.add(new Integer((mSpot - (i*Cols)) + i));\n }\n //West movements\n for(int i = 1; i <= col; i++) {\n cm.add(new Integer((mSpot + (i*Cols)) - i));\n cm.add(new Integer((mSpot - (i*Cols)) - i));\n }\n } else if (myType == 'K') {\n //King Movement\n if (col >= 1) {\n cm.add(new Integer((mSpot - Cols) - 1));\n cm.add(new Integer(mSpot - 1));\n cm.add(new Integer((mSpot + Cols) - 1));\n }\n if (col < Cols - 1) {\n cm.add(new Integer((mSpot - Cols) + 1));\n cm.add(new Integer(mSpot + 1));\n cm.add(new Integer((mSpot + Cols) + 1));\n }\n cm.add(new Integer(mSpot - Cols));\n cm.add(new Integer(mSpot + Cols));\n }\n return cm;\n }",
"private float generateLegalMoves(Node n, int depth, double A, double B, int player) {\n\t\tdouble val = (player == 1 ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);\n\t\t\n\t\tGamepiece[] playerPieces = (player == 1 ? g_board.getWhiteQueens() : g_board.getBlackQueens());\n\t\t\n\t\tfor(Gamepiece Queen : playerPieces) {\n\t\t\tint[] pos = Queen.position();\n\t\t\t\n\t\t\tint x = pos[0];\n\t\t\tint y = pos[1];\n\t\t\tint to_x = 0, to_y = 0, a_x = 0, a_y = 0;\n\t\t\t\n\t\t\t// Try to move up\n\t\t\tfor(int i = 1; i < (10 - y) && board[y + i][x] instanceof Blank; i++) {\n\t\t\t\tto_x = x;\n\t\t\t\tto_y = (y + i);\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down (with special case => can shoot to queen's origin square)\n\t\t\t\tfor(int j = 1; j <= to_y && (board[to_y - j][to_x] instanceof Blank || (to_y - j == y)); j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left\n\t\t\t\tfor(int j = 1; j <= to_x && board[to_y][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move right\n\t\t\tfor(int i = 1; i < (10 - x) && board[y][x + i] instanceof Blank; i++) {\n\t\t\t\tto_x = x + i;\n\t\t\t\tto_y = y;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left (with special case => can shoot to queen's origin square)\n\t\t\t\tfor(int j = 1; j <= to_x && (board[to_y][to_x - j] instanceof Blank || (to_x - j) == x); j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move down\n\t\t\tfor(int i = 1; i <= y && board[y - i][x] instanceof Blank; i++) {\n\t\t\t\tto_x = x;\n\t\t\t\tto_y = y - i;\n\t\t\t\t\n\t\t\t\t// Try to shoot up (With special case arrow loc = queen start)\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && (board[to_y + j][to_x] instanceof Blank || to_y + j == y); j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left (with special case => can shoot to queen's origin square)\n\t\t\t\tfor(int j = 1; j <= to_x && (board[to_y][to_x - j] instanceof Blank || (to_x - j) == x); j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move left\n\t\t\tfor(int i = 1; i <= x && board[y][x - i] instanceof Blank; i++) {\n\t\t\t\tto_x = x - i;\n\t\t\t\tto_y = y;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right (with special case)\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && (board[to_y][to_x + j] instanceof Blank || (to_x + j == x)); j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left (with special case => can shoot to queen's origin square)\n\t\t\t\tfor(int j = 1; j <= to_x && (board[to_y][to_x - j] instanceof Blank || (to_x - j) == x); j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move up-right\n\t\t\tfor(int i = 1; i < (10 - y) && i < (10 - x) && board[y + i][x + i] instanceof Blank; i++) {\n\t\t\t\tto_x = x + i;\n\t\t\t\tto_y = y + i;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left\n\t\t\t\tfor(int j = 1; j <= to_x && board[to_y][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left (with special case)\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && (board[to_y - j][to_x - j] instanceof Blank || ((to_y - j) == y && (to_x - j) == x)); j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move down-right\n\t\t\tfor(int i = 1; i <= y && i < (10 - x) && board[y - i][x + i] instanceof Blank; i++) {\n\t\t\t\tto_x = x + i;\n\t\t\t\tto_y = y - i;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left\n\t\t\t\tfor(int j = 1; j <= to_x && board[to_y][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left (with special case)\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && (board[to_y + j][to_x - j] instanceof Blank || ((to_y + j) == y && (to_x - j) == x)); j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move up-left\n\t\t\tfor(int i = 1; i < (10 - y) && i <= x && board[y + i][x - i] instanceof Blank; i++) {\n\t\t\t\tto_x = x - i;\n\t\t\t\tto_y = y + i;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left\n\t\t\t\tfor(int j = 1; j <= to_x && board[to_y][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && board[to_y + j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right (with special case)\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && (board[to_y - j][to_x + j] instanceof Blank || ((to_y - j) == y && (to_x + j) == x)); j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Try to move down-left\n\t\t\tfor(int i = 1; i <= y && i <= x && board[y - i][x - i] instanceof Blank; i++) {\n\t\t\t\tto_x = x - i;\n\t\t\t\tto_y = y - i;\n\t\t\t\t\n\t\t\t\t// Try to shoot up\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && board[to_y + j][to_x] instanceof Blank; j++) {\n\t\t\t\t\t// Finish constructing the move\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\t// Create a new node with the move and this node as its parent\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI board\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\t// Recursive call back to alphaBeta to search deeper\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Undo the move made at this level\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\t// If we've reached a point where A >= B, break out of the entire move generation process\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot right\n\t\t\t\tfor(int j = 1; j < (10 - to_x) && board[to_y][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x + j;\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down \n\t\t\t\tfor(int j = 1; j <= to_y && board[to_y - j][to_x] instanceof Blank; j++) {\n\t\t\t\t\ta_x = to_x;\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot left\n\t\t\t\tfor(int j = 1; j <= to_x && board[to_y][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = to_y;\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-right (with special case)\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j < (10 - to_x) && (board[to_y + j][to_x + j] instanceof Blank || ((to_y + j) == y && (to_x + j) == x)); j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-right\n\t\t\t\tfor(int j = 1; j <= to_y && j < (10 - to_x) && board[to_y - j][to_x + j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x + j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot up-left\n\t\t\t\tfor(int j = 1; j < (10 - to_y) && j <= to_x && board[to_y + j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y + j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to shoot down-left\n\t\t\t\tfor(int j = 1; j <= to_y && j <= to_x && board[to_y - j][to_x - j] instanceof Blank; j++) {\n\t\t\t\t\ta_x = (to_x - j);\n\t\t\t\t\ta_y = (to_y - j);\n\t\t\t\t\tint move = encodeMove(x, y, to_x, to_y, a_x, a_y);\n\t\t\t\t\t\n\t\t\t\t\tNode child = new Node(move, n);\n\t\t\t\t\tn.addChild(child);\n\t\t\t\t\t\n\t\t\t\t\tg_board.doMove(move);\n\t\t\t\t\t\n\t\t\t\t\tif(player == 1) {\n\t\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, 2));\n\t\t\t\t\t\tA = Math.max(val, A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, 1));\n\t\t\t\t\t\tB = Math.min(val, B);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_board.undoMove();\n\t\t\t\t\t\n\t\t\t\t\tif(A >= B) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(A >= B) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(A >= B) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we found no successor moves for this child then this player can't move and therefore loses.\n\t\tif(n.getChildren() == null || n.getChildren().isEmpty()) {\n//\t\t\tval = (float)(player == 1 ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);\n//\t\t\tleaves++;\n\t\t\tval = alphaBeta(n, 0, A, B, player);\n\t\t}\n\t\t\n\t\tn.setScore((float)val);\n\t\t\n\t\treturn (float)val;\n\t}",
"public static int[][] getAllBasicMoves(int[][] board, int player) {\r\n\t\t\r\n\t\tint[][] moves = new int [0][4];\r\n\t\tint[][] SaveMoves = new int [0][4];/*save our moves of the soldures*/\r\n\t\tint[][] positions = playerDiscs(board,player);\r\n\t\tint SumAllMove=0;/*varibel ho count all the posible moves*/\r\n\t\t\r\n\t\tfor(int IPD=0;IPD<positions.length;IPD=IPD+1){/*running on all the solduers*/\r\n\t\t\t//tow loops running in the 4 moves of the soldures\r\n\t\t\tfor(int indxMove1=-1;indxMove1<2;indxMove1=indxMove1+2){\r\n\t\t\t\tfor(int indxMove2=-1;indxMove2<2;indxMove2=indxMove2+2){\r\n\t\t\t\t\tboolean MovePossible = isBasicMoveValid(board,player,positions[IPD][0],positions[IPD][1],positions[IPD][0]+indxMove1,positions[IPD][1]+indxMove2);/*is the move is legal*/\r\n\t\t\t\t\tif (MovePossible){/*if the move legal enter the move in the arry*/\r\n\t\t\t\t\t\tSumAllMove=SumAllMove+1;\r\n\t\t\t\t\t\tSaveMoves = moves;\r\n\t\t\t\t\t\tmoves = new int [SumAllMove][4];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][0]=positions[IPD][0];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][1]=positions[IPD][1];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][2]=positions[IPD][0]+indxMove1;\r\n\t\t\t\t\t\tmoves [SumAllMove-1][3]=positions[IPD][1]+indxMove2;\r\n\t\t\t\t\t\tif (SumAllMove>1) {\r\n\t\t\t\t\t\t\tfor (int idxSAM1=SumAllMove-2;idxSAM1>-1;idxSAM1=idxSAM1-1){\r\n\t\t\t\t\t\t\tfor (int idxSAM2=0;idxSAM2<4;idxSAM2=idxSAM2+1){\r\n\t\t\t\t\t\t\t\tmoves[idxSAM1][idxSAM2]=SaveMoves[idxSAM1][idxSAM2];\r\n\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn moves;\r\n\t}",
"public void makeMove(GameVersion game){\n\t\t\n\t\twhile(!this.inputType.waitForValidUserInput(game)){\n\t\t\ttry {Thread.sleep(500); }catch(InterruptedException e) {}\n\t\t}\n\t\tint userInput = this.inputType.getUserInput(game);\n\t\tgame.board.playChip(userInput, this);\n\t}",
"public int[][] legalMoves() {\n return legalMoves[nextPiece];\n }",
"private void getMoves(ArrayList<Move> moves, int k) {\n for (int i = -1; i <= 1; i += 1) {\n for (int j = -1; j <= 1; j += 1) {\n char nextCol = (char) (col(k) + i);\n char nextRow = (char) (row(k) + j);\n if (validSquare(nextCol, nextRow)) {\n Move rec = Move.move(col(k),\n row(k), nextCol, nextRow);\n if (legalMove(rec)) {\n moves.add(rec);\n }\n }\n }\n }\n }",
"@Override\n public ArrayList<AState> getAllPossibleStates(AState state){\n MazeState s = (MazeState)state;\n ArrayList<AState> moves = new ArrayList<AState> ();\n\n\n int row = s.getState().getRowIndex();\n int col = s.getState().getColumnIndex();\n int [][] matrix = mySearchableMaze.getMazeMatrix();\n\n\n if(row+1 < matrix.length){\n if( matrix[row+1][col]==0 ){\n moves.add(new MazeState(new Position(row+1,col),false,s.getCost()+1));\n\n }\n }\n if(row-1 >= 0 ){\n if( matrix[row-1][col]==0){\n moves.add(new MazeState(new Position(row-1,col),false,s.getCost()+1));\n\n }\n }\n if(col+1 < matrix[0].length ){\n if( matrix[row][col+1]==0 ){\n moves.add(new MazeState(new Position(row,col+1),false,s.getCost()+1));\n\n }\n }\n if(col-1 >= 0 ){\n if( matrix[row][col-1]==0 ){\n moves.add(new MazeState(new Position(row,col-1),false,s.getCost()+1));\n }\n }\n return moves;\n }",
"void getMoves(ArrayList<Move> moves) {\n if (gameOver()) {\n return;\n }\n if (jumpPossible()) {\n for (int k = 0; k <= MAX_INDEX; k += 1) {\n getJumps(moves, k);\n }\n } else {\n for (int k = 0; k <= MAX_INDEX; k += 1) {\n getMoves(moves, k);\n }\n }\n }",
"public Set<Move> getMovesForPlayer(Player player) {\n\t\tfinal Set<Move> moveList = new HashSet<Move>();\n\t\tfor (Map.Entry<Position, Piece> entry : positionToPieceMap.entrySet()) {\n\t\t\tfinal Position positionFrom = entry.getKey();\n\t\t\tfinal Piece piece = entry.getValue();\n\t\t\tif (player == piece.getOwner()) {\n\t\t\t\tfor (char column = Position.MIN_COLUMN; column <= Position.MAX_COLUMN; column++) {\n\t\t\t\t\tfor (int row = Position.MIN_ROW; row <= Position.MAX_ROW; row++) {\n\t\t\t\t\t\tfinal Position positionTo = new Position(column, row);\n\t\t\t\t\t\tif (!positionFrom.equals(positionTo)) {\n\t\t\t\t\t\t\tfinal Piece possiblePieceOnPosition = getPieceAt(positionTo);\n\t\t\t\t\t\t\tif (possiblePieceOnPosition == null || possiblePieceOnPosition.getOwner() != player) { //can move to free position \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //or position where enemy is placed\n\t\t\t\t\t\t\t\tif (piece instanceof Pawn) {\n\t\t\t\t\t\t\t\t\tPawn pawn = (Pawn) piece;\n\t\t\t\t\t\t\t\t\tpawn.isValidFightMove(positionFrom, positionTo);\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfinal boolean isKnight = (piece instanceof Knight); // knight can jump over sheets\n\t\t\t\t\t\t\t\tif (piece.isValidMove(positionFrom, positionTo) && !isBlocked(positionFrom, positionTo, isKnight)) {\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn moveList;\n\t}",
"public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static String searchSmart(int player,int mode,int move){\n\tboolean flag = false;\r\n\tString inp = null;\r\n\tint row=0,col=0;\r\n\tint row1=-1,col1=-1;\r\nif(mode==3){\r\n\tif(move==2){\r\n\t\tif(gamebd[0][1]==2||gamebd[1][0]==2){\r\n\t\t\tinp=3+\" \"+3;\r\n\t\t\treturn inp;\r\n\t\t}\r\n\t\t\r\n\t\telse if(gamebd[2][1]==2||gamebd[1][2]==2){\r\n\t\t\tinp=1+\" \"+1;\r\n\t\t\treturn inp;\r\n\t\t}}\r\n}\r\nfor(int i=0;i<3;i++){//checks if any of the rows have 2 computer moves and third empty so as to fill it and win\r\n\tint count=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int j=0;j<3;j++){\r\n\t\tif(gamebd[i][j]==player){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(gamebd[i][j]==0)\r\n\t\t\t\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=j;\r\n\t\t}\r\n\t}\r\n\r\n\tif(count==2&&row1>=0&&col1>=0){\r\n\t\t//System.out.println(\"rowon\");\r\n\t\trow=row1+1;\r\n\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}}\r\nfor(int j=0;j<3;j++){//checks if any of the columns have 2 computer moves and third empty so as to fill it and win\r\n\r\n\tint count=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=0;i<3;i++){\r\n\t\tif(gamebd[i][j]==player){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(gamebd[i][j]==0)\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=j;\r\n\t\t}\r\n\t}\r\n\tif(count==2&&row1>=0&&col1>=0){\r\n\t\trow=row1+1;\r\n\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}}\r\n//The below code checks if any of the diagonals have 2 computer moves and third empty so as to fill it or 2 human moves and third empty so as to block it \r\nint count=0;\r\nint countopp=0;\r\nrow1=-1;\r\ncol1=-1;\r\nfor(int i=0;i<3;i++){\t\r\nif(gamebd[i][i]==player)\r\n\t\tcount ++;\t\r\nif(gamebd[i][i]==0)\r\n\t\trow1=col1=i;\r\n}\r\n\tif((count==2)&&row1>=0&&col1>=0)\r\n\t{\r\n\t\tcol=row=(row1+1);\r\n\tinp=row+\" \"+col;\r\n\tflag=true;\r\n\treturn inp;\r\n}\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=0;i<3;i++){\t\r\n\t\tif(gamebd[i][i]!=player&&gamebd[i][i]>0)\r\n\t\t\t\tcountopp ++;\t\r\n\t\tif(gamebd[i][i]==0)\r\n\t\t\t\trow1=col1=i;\r\n\t\t\t}\r\n\tif((countopp==2)&&row1>=0&&col1>=0)\r\n\t{\r\n\t\tcol=row=(row1+1);\r\n\tinp=row+\" \"+col;\r\n\tflag=true;\r\n\treturn inp;\r\n}\r\n\t count=0;\r\n\t countopp=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=2;i>=0;i--){\r\n\t\tif(gamebd[i][2-i]==player)\r\n\t\t\tcount ++;\r\n\t\tif(gamebd[i][2-i]==0)\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=2-i;\r\n\t\t}\r\n\t\t}\r\n\t\tif((count==2)&&row1>=0&&col1>=0)\r\n\t\t{\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}\r\n\t\trow1=-1;\r\n\t\tcol1=-1;\r\n\t\tfor(int i=2;i>=0;i--){\r\n\t\t\tif(gamebd[i][2-i]!=player&&gamebd[i][2-i]>0)\r\n\t\t\tcountopp++;\r\n\t\t\tif(gamebd[i][2-i]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=2-i;\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tif((countopp==2)&&row1>=0&&col1>=0)\r\n\t\t\t{\r\n\t\t\t\trow=row1+1;\r\n\t\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}\r\n\tfor(int i=0;i<3;i++){//checks if any of the rows have 2 human moves and third empty so as to block it and not allow human to win\r\n\t\t countopp=0;\r\n\t\t row1=-1;\r\n\t\t\tcol1=-1;\r\n\t\tfor(int j=0;j<3;j++){\r\n\t\t\tif(gamebd[i][j]!=player&&gamebd[i][j]>0){\r\n\t\t\t\tcountopp++;\r\n\t\t\t}\r\n\t\t\tif(gamebd[i][j]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=j;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(countopp==2&&row1>=0&&col1>=0){\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}}\r\n\tfor(int j=0;j<3;j++){//checks if any of the columns have 2 human moves and third empty so as to block human and not allow to win\r\n\t\t countopp=0;\r\n\t\t row1=-1;\r\n\t\t\tcol1=-1;\r\n\t\tfor(int i=0;i<3;i++){\r\n\t\t\tif(gamebd[i][j]!=player&&gamebd[i][j]>0){\r\n\t\t\t\tcountopp++;\r\n\t\t\t}\r\n\t\t\tif(gamebd[i][j]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=j;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(countopp==2&&row1>=0&&col1>=0){\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}}\r\nif(flag==false){//Now since all cases are checked(of winning and not allowing human to win), computer will play a random move\r\nRandom rand = new Random();\r\nint min=0;\r\nint max=2;\r\nint a,b;\r\ndo{\r\n\t a = rand.nextInt(max-min+1)+min;\r\n\t b = rand.nextInt(max-min+1)+min;\r\n\t //System.out.println(a+\"\"+b);\r\n}while(gamebd[a][b]!=0);\r\ninp=(a+1)+\" \"+(b+1);\r\n}\r\nreturn inp;\r\n}",
"public List<int[][]> evaluate(IBoard board){\n\n int area = board.getHeight() * board.getWidth();\n\n int[][] newArray = new int[area][2];\n\n int k = 0;\n\n while (k < newArray.length) {\n for (int i = 0; i < board.getHeight(); i++) {\n for (int j = 0; j < board.getWidth(); j++) {\n newArray[k][0] = i;\n newArray[k][1] = j;\n k++;\n }\n }\n }\n\n List<int[][]> Allmoves = new ArrayList<>();\n\n int res = newArray.length / board.getHeight();\n\n /*For rows*/\n int q = 0;\n int w = res;\n\n for (int i = 0; i < res; i++) {\n int[][] arr = new int[res][2];\n\n int e = 0;\n\n for (int j = q; j < w; j++) {\n arr[e][0] = newArray[j][0];\n arr[e][1] = newArray[j][1];\n e++;\n }\n\n w += res;\n q += res;\n\n Allmoves.add(arr);\n\n }\n\n /*For columns*/\n int r = 0;\n for (int i = 0; i < res; i++) {\n\n int[][] arr = new int[res][2];\n int e = 0;\n\n for (int j = 0; j < res; j++) {\n arr[e][0] = newArray[r][0];\n arr[e][1] = newArray[r][1];\n\n r += res;\n e++;\n }\n r = 0;\n r += i + 1;\n\n Allmoves.add(arr);\n }\n\n /*For diagonal - 1*/\n int[][] arr = new int[res][2];\n int d1 = res + 1;\n int d = 0;\n int e = 0;\n for (int i = 0; i < res; i++) {\n arr[e][0] = newArray[d][0];\n arr[e][1] = newArray[d][1];\n d += d1;\n e++;\n }\n\n Allmoves.add(arr);\n\n int[][] arr1 = new int[res][2];\n int d2 = res - 1;\n int D = res - 1;\n int p = 0;\n for (int i = 0; i < res; i++) {\n arr1[p][0] = newArray[D][0];\n arr1[p][1] = newArray[D][1];\n D += d2;\n p++;\n }\n\n Allmoves.add(arr1);\n\n return Allmoves;\n\n }",
"public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}",
"@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }"
] | [
"0.7277468",
"0.7002333",
"0.69568753",
"0.69183683",
"0.67289346",
"0.670219",
"0.66529924",
"0.66436225",
"0.6632071",
"0.66312504",
"0.65726995",
"0.6478182",
"0.64636457",
"0.6387306",
"0.63530004",
"0.633815",
"0.63355",
"0.63081557",
"0.63050807",
"0.6302512",
"0.63023555",
"0.62744766",
"0.6273193",
"0.62643015",
"0.62567",
"0.62537843",
"0.6242286",
"0.62371796",
"0.62226295",
"0.6200063",
"0.6192097",
"0.618334",
"0.6164958",
"0.61595297",
"0.61592066",
"0.61581665",
"0.6125901",
"0.6108553",
"0.61062217",
"0.60993373",
"0.6098772",
"0.60952926",
"0.60929936",
"0.6091805",
"0.60608757",
"0.60431075",
"0.6034993",
"0.6018482",
"0.6011975",
"0.6000358",
"0.59749854",
"0.59685934",
"0.59651273",
"0.5957138",
"0.59364736",
"0.59018517",
"0.5896369",
"0.58800733",
"0.58734685",
"0.58724636",
"0.5870345",
"0.58545965",
"0.5836433",
"0.5819236",
"0.5813178",
"0.58049804",
"0.57936084",
"0.5781119",
"0.5779205",
"0.5776181",
"0.57653093",
"0.5764069",
"0.57612365",
"0.5755188",
"0.57449675",
"0.5739005",
"0.5736122",
"0.57266796",
"0.5716308",
"0.57160395",
"0.57078815",
"0.5689952",
"0.56873435",
"0.56816787",
"0.5677152",
"0.56607455",
"0.5655224",
"0.5654353",
"0.56509906",
"0.56460786",
"0.5643054",
"0.5640251",
"0.5639028",
"0.5632123",
"0.56302464",
"0.5620015",
"0.56006444",
"0.5598823",
"0.55971515",
"0.5596826"
] | 0.66502607 | 7 |
evaluate the current game state from the view of the current player. High numbers indicate a better situation for the current player. | private int evaluateState() {
// add up score
//
int scoreWhite = 0;
int scoreBlack = 0;
for (Piece piece : this.chessGame.getPieces()) {
if(piece.getColor() == Piece.COLOR_BLACK){
scoreBlack +=
getScoreForPieceType(piece.getType());
scoreBlack +=
getScoreForPiecePosition(piece.getRow(),piece.getColumn());
}else if( piece.getColor() == Piece.COLOR_WHITE){
scoreWhite +=
getScoreForPieceType(piece.getType());
scoreWhite +=
getScoreForPiecePosition(piece.getRow(),piece.getColumn());
}else{
throw new IllegalStateException(
"unknown piece color found: "+piece.getColor());
}
}
// return evaluation result depending on who's turn it is
int gameState = this.chessGame.getGameState();
if( gameState == ChessGame.GAME_STATE_BLACK){
return scoreBlack - scoreWhite;
}else if(gameState == ChessGame.GAME_STATE_WHITE){
return scoreWhite - scoreBlack;
}else if(gameState == ChessGame.GAME_STATE_END_WHITE_WON
|| gameState == ChessGame.GAME_STATE_END_BLACK_WON){
return Integer.MIN_VALUE + 1;
}else{
throw new IllegalStateException("unknown game state: "+gameState);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int evalState(GameState state){\n Move m = state.getMove();\n int counter = 0;\n\n // return directly if we encouter win or loss\n if(m.isXWin()){\n return 10000;\n }\n else if(m.isOWin()){\n return -1;\n }\n\n Vector<Integer> points = new Vector<Integer>();\n points.setSize(state.BOARD_SIZE*2+2);\n int player;\n Collections.fill(points, 1);\n int scaling = 4;\n int value = 0;\n\n for(int row = 0; row < state.BOARD_SIZE; row ++){\n for(int col = 0; col < state.BOARD_SIZE; col ++){\n player = state.at(row, col);\n\n // add points to the vector, increase by a factor for every new entry\n if(player == 1){\n points.set(row, points.get(row)*scaling);\n points.add(state.BOARD_SIZE + col, points.get(state.BOARD_SIZE - 1 + col)*scaling);\n\n // if it's in the first diagonal\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, points.get(state.BOARD_SIZE*2)*scaling);\n }\n\n // checking other diagonal\n if(counter%state.BOARD_SIZE-1 == 0 && row+col != 0){\n points.add(state.BOARD_SIZE*2 + 1, points.get(state.BOARD_SIZE*2)*scaling);\n }\n }\n // if an enemy player is encoutered null the value of the row/col\n else if(player == 2){\n points.set(row, 0);\n points.set(state.BOARD_SIZE + col, 0);\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, 0);\n }\n if(counter%state.BOARD_SIZE-1 == 0){\n points.add(state.BOARD_SIZE*2 + 1, 0);\n }\n }\n counter++;\n }\n }\n\n // if we have nulled the point we don't count it for the value of the state\n for(Integer i: points){\n if(i > 1){\n value += i;\n }\n }\n //System.err.println(\"Value: \" + value);\n return value;\n }",
"public void displayCurrentState(State game);",
"protected abstract int evaluate(GameState state, String playername);",
"private int gameState() {\n\t\t\n\t\tint gameNotOver = 0;\n\t\tint gameOverWinnerX = 1;\n\t\tint gameOverWinnerO = 2;\n\t\tint gameOverTie = 3;\n\t\t\n\t\t\n\t\t\n\t\t//Win Vertically \n\t\t// 0 3 6 , 1 4 7 , 2 5 8\n\t\t\t\t\n\t\t//Win Horizontally\n\t\t//0 1 2 , 3 4 5 , 6 7 8 \n\t\t\t\t\n\t\t//Win Diagonally\n\t\t// 0 4 8 , 2 4 6\n\t\t\t\t\n\t\t//Assuming it's an equal grid\n\t\t\t\t\n\t\tMark winningMark = null;\n\t\t\t\t\n\t\tboolean hasFoundWinner = false;\n\t\t\t\t\n\t\tint row = 0;\n\t\tint column = 0;\n\t\t\t\t\n\t\t//Horizontal Winner Test\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[ROW_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\twhile (column < COLUMN_COUNT) {\n\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\tcolumn ++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tcolumn = 0;\n\t\t\trow++;\t\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// Vertical Winner Test\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = 0;\n\n\t\twhile (!hasFoundWinner && column < COLUMN_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[ROW_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\trow = 0;\n\t\t\tcolumn++;\t\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//Diagonal Winner Test \"\\\"\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[COLUMN_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\t\t\t\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tcolumn++;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//Diagonal Test \"/\"\n\t\t\t\t\n\t\trow = 0;\n\t\tcolumn = COLUMN_COUNT - 1;\n\t\t\t\t\n\t\twhile (!hasFoundWinner && row < ROW_COUNT) {\n\t\t\t\t\t\n\t\t\tMark[] markArray = new Mark[COLUMN_COUNT];\n\t\t\t\t\t\n\t\t\tint index = 0;\n\t\t\t\t\t\n\t\t\twhile (row < ROW_COUNT) {\n\t\t\t\t\t\t\n\t\t\t\tmarkArray[index] = getMark(row, column);\n\t\t\t\trow++;\n\t\t\t\tcolumn--;\n\t\t\t\tindex++;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif (allElementsEqual(markArray)) {\n\t\t\t\thasFoundWinner = true;\n\t\t\t\twinningMark = markArray[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\tif (hasFoundWinner) {\n\t\t\tif (winningMark == Mark.X) {\n\t\t\t\treturn gameOverWinnerX;\n\t\t\t}\n\t\t\tif (winningMark == Mark.O) {\n\t\t\t\treturn gameOverWinnerO;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If there are no moves left, and there is no winner, game ends inn a tie \n\t\t\n\t\tboolean foundNoMove = false;\n\t\tfor (int i = 0; i < movesArray.length; i++) {\n\t\t\tif (movesArray[i] == NO_MOVE) {\n\t\t\t\tfoundNoMove = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!foundNoMove && !hasFoundWinner) {\n\t\t\treturn gameOverTie;\n\t\t}\n\t\t\n\t\t// If there is no winner and there are still moves left, game is not over\n\t\t\n\t\treturn gameNotOver;\n\t\t\n\t}",
"public int gameState() {\n \tboolean check = isCheck(turn);\n \t\n \t//change this code to be some sort of checkmate detection\n \tif(check) {\n \t\t//we need to check whether there is a legal move that puts the king out of check\n \t\t//we need to loop through all pieces of the same color as the turn and make all legal moves\n \t\t//then after each move, check whether the king is still in check\n \t\t\n \t\t//first generate a list of all pieces for the turn color\n \t\tArrayList<Piece> pieces = getPieces(turn);\n \t\t\n \t\tboolean freedom;\n \t\t\n \t\t//now for each piece, check whether moving that piece can get the king out of check\n \t\tfor(int i = 0; i < pieces.size(); i++) {\n \t\t\tfreedom = simulate(pieces.get(i));\n \t\t\tif(freedom) {\n \t \t\tupdateCheckMove(false);\n \t \t\tSystem.out.println(\"Check on \" + turn + \" King!\");\n \t\t\t\treturn 2; //if the king can move, then the game isn't over yet\n \t\t\t}\n \t\t}\n \t\t\n \t\t//the game is over if we reach this far, so we can assume checkmate\n \t\t//resignation logic will probably be specific to Display class\n \t\t\n \t\tupdateCheckMove(true);\n \t\t\n \t\tif(turn == PieceColor.White) return -1; //black win if white king in check and can't move\n \t\tif(turn == PieceColor.Black) return 1;\n \t}\n \t\n \t//if all of these fail, the game isn't over yet\n \treturn 2;\n }",
"private void gameState(){\r\n\t\tadd(gamePanel,BorderLayout.CENTER);\r\n\t\t\r\n\t\tif((cost + current) <= loss){\r\n\t\t\tSystem.out.println(\"The Game is Up.\");\r\n\t\t\tgamePanel.add(gameOver);\r\n\t\t\tsearchPanel.setVisible(false);\r\n\t\t\tgamePanel.setVisible(true);\r\n\t\t}else if((cost + current) >= profit){\r\n\t\t\tSystem.out.println(\"The Game is On!\");\r\n\t\t\tgamePanel.add(gameOn);\r\n\t\t\tsearchPanel.setVisible(false);\r\n\t\t\tgamePanel.setVisible(true);\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic double stateEvaluator(GameState s)\n\t{\r\n\t\tint count = 0;\n\t\tif (s.takenList[1] == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse if(s.lastMove == 1)\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length ; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.5;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (isPrime(s.lastMove))\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0 && i % s.lastMove == 0) // i = 4, % 2\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.7;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn 0.7;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tint largestPrime = 2;\r\n\t\t\tfor (int i = 2; i < (s.lastMove/2); i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.lastMove % i == 0 && isPrime(i))\r\n\t\t\t\t{\r\n\t\t\t\t\tlargestPrime = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = largestPrime; i <= s.lastMove; i+= largestPrime)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.6;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.6;\r\n\t\t\t}\r\n\r\n\t\t}\n\t}",
"private double evaluate() {\n // check for draws first, most lickely\n if (board.gameState() == MNKGameState.DRAW) return 0;\n else if (board.gameState() == MY_WIN) return 2 * M * N; // 2 times max depth\n else if (board.gameState() == ENEMY_WIN) return -2 * M * N;\n else {\n evaluated++;\n // keep the heuristic evaluation between 1 and -1\n return board.value();\n }\n }",
"public static int run(State curr_state, char player) {\n\t\tint result = 0;\r\n\t\t//Calls the max_value part because dark plays first, wants max value\r\n\t\tif(player == '1'){\r\n\t\t\t//Returns number of times the max function runs\r\n\t\t\tresult = max_value(curr_state);\r\n\t\t}\r\n\t\t//Start at min, as light's turn, and it wants min value and\r\n\t\t//therefore subsequently will call min_value nd return\r\n\t\telse if(player == '2'){\r\n\t\t\tresult = min_value(curr_state);\t\r\n\t\t}\r\n\t\t//Return the number of states , i.e., minCounter + max Counter\r\n\t\t//Return minCounter + maxCounter;\r\n\t\treturn result;\r\n\t}",
"public GameState getGameState();",
"private double evalState(LabyrinthGameState state) {\n double score = 0;\n\n //Assign Percentages of Score\n final double treasureValTotal = 80; //Based on number of treasures left\n final double nearTreasureValTotal = 15; //Based on proximity to treasure\n final double typeTileValTotal = 1; //Based on which tile you are on\n final double numberOfConnectionsValTotal = 4; //Based on how many places you can move\n\n double treasureVal = 0;\n double nearTreasureVal = 0;\n double typeTileVal = 0;\n double numberOfConnectionsVal = 0;\n\n //calculating your treasure points\n treasureVal = (6.0 - (double)(state.getPlayerDeckSize(\n Player.values()[playerNum])))/6.0*treasureValTotal;\n\n int [] yourPos = state.getPlayerLoc(Player.values()[playerNum]).getLoc();\n int [] treasurePos = state.findTreasureLoc(Player.values()[playerNum]);\n if (treasurePos[0] == -1) {\n nearTreasureVal = (10.0 - findDistance(yourPos, findHome()))\n / 10.0 * nearTreasureValTotal;\n } else {\n nearTreasureVal = (10.0 - findDistance(yourPos, treasurePos))\n / 10.0 * nearTreasureValTotal;\n }\n\n //calculating points for the type of tile it can end on\n switch (state.getPlayerLoc(Player.values()[playerNum]).getType()) {\n case STRAIGHT:\n typeTileVal = 5.0 / 10.0 * typeTileValTotal;\n break;\n case INTERSECTION:\n typeTileVal = typeTileValTotal;\n break;\n default:\n typeTileVal = 3.0 / 10.0 * typeTileValTotal;\n break;\n }\n\n //calculating points based on # of connections created\n numberOfConnectionsVal = ((double)generatePossibleMoveActions(state).size()\n /49.0*numberOfConnectionsValTotal);\n\n //calculating final score\n score = (treasureVal + nearTreasureVal +\n typeTileVal + numberOfConnectionsVal)/100.0;\n\n return score;\n }",
"private void determineState() {\n if ( .66 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.HIGH ) {\n currentState = HealthState.HIGH;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"highHealth\" ) ) );\n }\n }\n } else if ( .33 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.MEDIUM ) {\n currentState = HealthState.MEDIUM;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"mediumHealth\" ) ) );\n }\n }\n } else if ( .0 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.LOW ) {\n currentState = HealthState.LOW;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"lowHealth\" ) ) );\n }\n }\n }\n }",
"private void updateState() {\n switch (game.getGameState()) {\n case GAME:\n gamePlay();\n break;\n case ONE:\n lostTurnByOne();\n break;\n case READY:\n readyToPlay();\n break;\n case START:\n startGame();\n break;\n case TURN:\n startTurn();\n break;\n case FINISH:\n finishGame();\n break;\n }\n }",
"public GameState getState(){\n\t\tGameState State=new GameState(this.points, this.currentBoard.getState());\n\t\t\n\t\treturn State;\n\t}",
"public int status() \n {\n \tif (stonesCount(7,12) != 0 && stonesCount(0,5) != 0)\n \t\treturn GAME_NOT_OVER;\n \telse if (stonesCount(7,13) < stonesCount(0,6))\n \t\treturn GAME_OVER_WIN;\n \telse if (stonesCount(7,13) == stonesCount(0,6))\n \t\treturn GAME_OVER_TIE;\n \telse\n \t\treturn GAME_OVER_LOSE;\n }",
"public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }",
"public int computeGameSituation() {\n\t\treturn computeGameSituation(checkerboard);\n\t}",
"public void winGame() {\r\n if (data.gameState == 3) \r\n data.winner = 1;\r\n else if (data.gameState == 4) \r\n data.winner = 2;\r\n data.victoryFlag = true;\r\n data.gameState = 5;\r\n }",
"public int gameStatus() {\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tif((Grid[x][0] == Grid[x][1]) && (Grid[x][1] == Grid[x][2]))\n \t\t\t\tif(Grid[x][0] != 0 && Grid[x][1] != 0 && Grid[x][2] != 0)\n \t\t\t\t\treturn Grid[x][0];\n \t\t}\n \t\tfor(int y=0;y<3;y++) {\n \t\t\tif((Grid[0][y] == Grid[1][y]) && (Grid[1][y] == Grid[2][y])) \n \t\t\t\tif(Grid[0][y] != 0 && Grid[1][y] != 0 && Grid[2][y] != 0)\n \t\t\t\t\treturn Grid[0][y];\n \t\t}\n \t\tif(Grid[0][0] == Grid[1][1] && Grid[1][1] == Grid[2][2]) \n \t\t\tif(Grid[0][0] != 0 && Grid[1][1] != 0 && Grid[2][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tif(Grid[2][0] == Grid[1][1] && Grid[1][1] == Grid[0][2])\n \t\t\tif(Grid[2][0] != 0 && Grid[1][1] != 0 && Grid[0][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tfor(int y = 0;y<3;y++) {\n \t\t\t\tif(Grid[x][y] == 0)\n \t\t\t\t\treturn 0;\n \t\t\t}\n \t\t}\n \t\treturn 3;\t\t\n \t}",
"public GameState won() {\n if ( (board[0][0] != TileState.BLANK) && (board[0][0] == board[0][1]) && (board[0][0] == board[0][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[1][0] != TileState.BLANK) && (board[1][0] == board[1][1]) && (board[1][0] == board[1][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[2][0] != TileState.BLANK) && (board[2][0] == board[2][1]) && (board[2][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][1]) && (board[0][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ( (board[0][2] != TileState.BLANK) && (board[0][2] == board[1][1]) && (board[0][2] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][0]) && (board[0][0] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][1] != TileState.BLANK) && (board[0][1] == board[1][1]) && (board[0][1] == board[2][1])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][2] != TileState.BLANK) && (board[0][2] == board[1][2]) && (board[0][2] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if (movesPlayed == 9)\n return GameState.DRAW;\n return GameState.IN_PROGRESS;\n }",
"private boolean checkGameStatus() {\n int res = model.getWinner();\n if (res == Model.DRAW) {\n draw();\n return false;\n } else if (res == Model.WHITE) {\n whiteScore++;\n view.getPrompt().setText(whiteName + \" win!\");\n prepareRestart();\n return false;\n } else if (res == Model.BLACK) {\n blackScore++;\n view.getPrompt().setText(blackName + \" win!\");\n prepareRestart();\n return false;\n }\n return true;\n }",
"private void update() {\n\t\t// Every frame will update these variables, independent of game state\n\t\tmCamera.update();\n\t\tfloat deltaTime = Gdx.graphics.getDeltaTime();\n mHealthText = \"Castle Strength: \" + mCastleHealth;\n mRoundScoreText = \"This Round Score: \" + mRoundScore;\n\t\tmTotalScoreText = \"Total Game Score: \" + mTotalScore;\n\n\t\t// Switch statement to handle game state\n\t\tswitch (mGameState) {\n\t\t\tcase STATE_PRE_GAME:\n\t\t\t\t// Before the game starts, the first two buttons (new game and resume) are visible\n\t\t\t\tmButtons[0].setVisible(true);\n\t\t\t\tmButtons[1].setVisible(true);\n\t\t\t\tcheckStartNewGameButton();\n\t\t\t\tcheckLoadGameButton();\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_START:\n\t\t\t\tmButtons[2].setVisible(true);\n\t\t\t\thandleRoundStart();\n\t\t\t\tcheckPauseGameButton();\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_PLAY:\n\t\t\t\tmButtons[2].setVisible(true);\n\t\t\t\tif(!mPaused) {\n\t\t\t\t\thandleStandardGameplay(deltaTime);\n\t\t\t\t\tcheckPauseGameButton();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmButtons[3].setVisible(true);\n\t\t\t\t\tcheckResumeGameButton();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_OVER:\n\t\t\t\tmButtons[4].setVisible(true);\n\t\t\t\tmButtons[5].setVisible(true);\n\t\t\t\tmButtons[6].setVisible(true);\n\t\t\t\tcheckRepairCastleButton();\n\t\t\t\tcheckSaveGameButton();\n\t\t\t\tcheckNextRoundButton();\n\t\t\t\tbreak;\n\t\t\tcase STATE_GAME_OVER:\n\t\t\t\tmButtons[0].setVisible(true);\n\t\t\t\tcheckStartNewGameButton();\n\t\t\t\tbreak;\n\t\t}\n\n\n\t}",
"private void processPlayersInMyGame(int gameNumber, String playerHandle, PlayerState state, boolean seesKibitz) {\n Game game = tournamentService.findGame(gameNumber);\n if (game == null) {\n return;\n }\n switch (state) {\n case WAITING:\n game.observerCountCurrent--;\n break;\n case OBSERVING:\n game.observerCountCurrent++;\n if (game.observerCountMax < game.observerCountCurrent) {\n game.observerCountMax = game.observerCountCurrent;\n }\n //Fall through...\n case PLAYING:\n // command.qChanPlus(playerHandle, CHANNEL_USCL);\n default:\n }\n }",
"public String getPlayerState() {\n String playerState = name + \" \" + actionArray[0] \n + \" \" + actionArray[1] + \" \" + actionArray[2] + \" \" + colorID + \" \";\n return playerState;\n }",
"public GameState GetState(){\n\t\treturn this.state;\n\t}",
"interface GameState {\n String WAITING_FOR_SECOND_PLAYER = \"WAITING_FOR_SECOND_PLAYER\";\n String TURN_HARE = \"TURN_HARE\";\n String TURN_HOUND = \"TURN_HOUND\";\n String WIN_HARE_BY_ESCAPE = \"WIN_HARE_BY_ESCAPE\";\n String WIN_HARE_BY_STALLING = \"WIN_HARE_BY_STALLING\";\n String WIN_HOUND = \"WIN_HOUND\";\n }",
"public void checkGameStatus() {\n everyTenthGoalCongrats();\n randomPopUpBecauseICan();\n }",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"public boolean checkState(){\r\n\t\t//Check if we have enough users\r\n\t\tfor (Map.Entry<String, Role> entry : roleMap.entrySet()){\r\n\t\t\tString rid = entry.getKey();\r\n\t\t\tRole role = roleMap.get(rid);\r\n\t\t\tlog.info(\"Veryifying \" + rid);\t\t\t\r\n\t\t\tif(!roleCount.containsKey(rid)){\r\n\t\t\t\tlog.severe(\"Unsure of game state.\" + rid + \" not found in roleCount\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t\r\n\t\t\t} else if(role.getMin() > roleCount.get(rid)) {\r\n\t\t\t\t\tlog.info(\"minimum number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t} else if(role.getMax() < roleCount.get(rid)) { //probably don't need this one but cycles are cheap\r\n\t\t\t\tlog.severe(\"OVER MAXIMUM number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if we do reach here we've reached a critical mass of players. But we still need them to load the screen\r\n\t\t\r\n\t\tif((this.getGameState() != GAMESTATE.RUNNING) ||(this.gameState !=GAMESTATE.READY_TO_START) ) {\r\n\t\t\tsetGameState(GAMESTATE.CRITICAL_MASS);\r\n\t\t\tlog.info(\"have enough players for game\");\r\n\t\t}\r\n\t\t//if the users are done loading their screen, let us know and then we can start\r\n\t\tif (!userReady.containsValue(false)){\r\n\t\t\tsetGameState(GAMESTATE.READY_TO_START);\r\n\t\t\tlog.info(\"Gamestate is running!!\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"protected void updateGameState() {\n }",
"public int evaluate() {\n\t\treturn history + heuristic;\n\t}",
"public BlackjackClientState get_state() {\n ArrayList<String> cards = new ArrayList<>();\n ArrayList<String> cards2 = new ArrayList<>();\n for (Card c : player_cards)\n cards.add(c.toString());\n\n // Calculate the current state of the game\n int player_hand = get_hand_val(player_cards);\n if (player_hand > 21)\n player_busted = true;\n else if (player_hand == 21)\n player_stand = true;\n\n String player_count = Integer.toString(player_hand);\n\n if (player_stand || player_busted) {\n house_deal();\n for (Card c : house_cards)\n cards2.add(c.toString());\n int house_hand = get_hand_val(house_cards);\n String house_count = Integer.toString(house_hand);\n if (house_hand > 21)\n return new BlackjackClientState(id, true, player_busted ? \"Draw\" : \"You Win!\", player_count,\n house_count, cards, cards2);\n else if (house_hand > player_hand)\n return new BlackjackClientState(id, true, \"You lose\", player_count, house_count, cards, cards2);\n else if (!player_busted)\n return new BlackjackClientState(id, true, house_hand == player_hand ? \"Draw\" : \"You Win!\", player_count,\n house_count, cards, cards2);\n else\n return new BlackjackClientState(id, true, \"You lose\", player_count, house_count, cards, cards2);\n }\n\n return new BlackjackClientState(id, false, null, player_count, \"?\", cards, cards2);\n }",
"public int evalBoard(){\n if (wins('o')){\n return 3;\n }\n // Return 0 if human wins\n else if (wins('b')){\n return 0;\n }\n //Return 2 if game is draw\n else if (isDraw()){\n return 2;\n }\n // Game is not a draw and no player has won. Game is still undecided.\n else {\n return 1;\n }\n }",
"public void loadUpdate()\n {\n HashMap<Location, State> updated = gm.update();\n if(updated == null)\n {\n lastScore = 0;\n buttonPlay.setText(\"Nowa gra\");\n buttonPlay.setPrefWidth(100);\n tl.stop();\n nng.updateFitnessOfCurrent(score);\n if(currentPlayer.equals(\"Trening\"))\n {\n monitor.stop();\n buttonPlay.fire();\n }\n return;\n }\n clear();\n score = 0;\n for (Location l : updated.keySet())\n addToBoard(l, updated.get(l));\n\n //Tutaj powinienes chyba dac \"Czlowiek\", bo reszta funkcji jest dla sieci neuronowej\n if(currentPlayer.equals(\"Gra\"))\n return;\n //Ocenia kazdy mozliwy ruch i wybiera najlepszy wedlug sieci neuronowej\n Direction[] directions = new Direction[] {Direction.UP, Direction.DOWN, Direction.LEFT, Direction.RIGHT};\n Direction bestDirection = Direction.UP;\n NeuralNetwork decider = currentPlayer.equals(\"Trening\") ? nng.getCurrent() : nn;\n double bestEval = -10;\n for (Direction direction : directions)\n {\n if(direction.isOpposite(gm.getDirection()))\n continue;\n Location present = gm.getSnake().getLocation();\n double front = -2;\n Location inFront = null;\n try\n {\n inFront = new Location(present.getX() + direction.getX(), present.getY() + direction.getY());\n } catch (LossException e)\n {\n front = -1;\n }\n if(front == -2)\n front = stateToDouble(updated.get(inFront));\n Direction relativeLeft = Direction.getRelativeLeft(direction);\n double left = -2;\n Location toLeft = null;\n try\n {\n toLeft = new Location(present.getX() + relativeLeft.getX(), present.getY() + relativeLeft.getY());\n } catch (LossException e)\n {\n left = -1;\n }\n if(left == -2)\n left = stateToDouble(updated.get(toLeft));\n if(direction.equals(Direction.getRelativeLeft(gm.getDirection())) && !gm.getSnake().getTail().isEmpty())\n left = 0;\n Direction relativeRight = Direction.getRelativeRight(direction);\n double right = -2;\n Location toRight = null;\n try\n {\n toRight = new Location(present.getX() + relativeRight.getX(), present.getY() + relativeRight.getY());\n } catch (LossException e)\n {\n right = -1;\n }\n if(right == -2)\n right = stateToDouble(updated.get(toRight));\n if(direction.equals(Direction.getRelativeRight(gm.getDirection())) && !gm.getSnake().getTail().isEmpty())\n right = 0;\n double delta = Math.sqrt(Math.pow(present.getX() - gm.getFood().getX(), 2) + Math.pow(present.getY() - gm.getFood().getY(), 2)) - Math.sqrt(Math.pow(present.getX() + direction.getX() - gm.getFood().getX(), 2) + Math.pow(present.getY() + direction.getY() - gm.getFood().getY(), 2));\n double eval = decider.calcOutput(new double[] {delta, left, front, right});\n if(eval > bestEval)\n {\n bestEval = eval;\n bestDirection = direction;\n }\n decider.reset();\n }\n gm.setPendingDirection(bestDirection);\n }",
"private boolean playLevel() {\n // Opens panel of tiles with dimensions appropriate to the current level.\n // Starts the viewer for each model cell.\n // Shows the initial state of all cells in the model.\n for (int l = 0; l < model.getHeight(); l++)\n for (int c = 0; c < model.getWidth(); c++)\n view.setTile(l,c, CellTile.newInstance( model.getCell(l,c) ));\n while ( play() ) // Process one input event (mouse or keyboard)\n status.setMoves( model.getMoves() );\n return winGame(); // Verify win conditions; false: finished without complete\n }",
"public void updateState() {\n\n if (channelPopularityScore >= 0 && channelPopularityScore <= 1000) {\n setCurrentState(StateName.UNPOPULAR);\n } else if (channelPopularityScore >= 1000 && channelPopularityScore <= 10000) {\n setCurrentState(StateName.MILDLY_POPULAR);\n } else if (channelPopularityScore >= 10001 && channelPopularityScore <= 100000) {\n setCurrentState(StateName.HIGHLY_POPULAR);\n } else if (channelPopularityScore >= 100001 && channelPopularityScore <= Integer.MAX_VALUE) {\n setCurrentState(StateName.ULTRA_POPULAR);\n } else {\n }\n }",
"void computeResult() {\n // Get the winner (null if draw).\n roundWinner = compareTopCards();\n\n\n if (roundWinner == null) {\n logger.log(\"Round winner: Draw\");\n logger.log(divider);\n // Increment statistic.\n numDraws++;\n\n } else {\n logger.log(\"Round winner: \" + roundWinner.getName());\n\t logger.log(divider);\n this.gameWinner = roundWinner;\n if (roundWinner.getIsHuman()) {\n // Increment statistic.\n humanWonRounds++;\n }\n }\n\n setGameState(GameState.ROUND_RESULT_COMPUTED);\n }",
"public GameState getGameState(){\n return this.gameState;\n }",
"public static void getGameSituationTest() {\n\t\tVTicTacToe tempEnvironment = new VTicTacToe();\n\t\tint[] tempTestStates = { 0, 13, 39, 26, 17060 };\n\n\t\tint tempResult;\n\t\tfor (int i = 0; i < tempTestStates.length; i++) {\n\t\t\ttempResult = tempEnvironment.computeGameSituation(tempTestStates[i]);\n\t\t\tSystem.out.println(\"The game situation of \" + tempTestStates[i] + \" is: \" + tempResult);\n\t\t} // Of for i\n\t}",
"GameState getGameState() {\n return gameState;\n }",
"public GameState getGameState() {\n return this.state;\n }",
"public void calculateResult() {\n\t\tfor (GameEngineCallback callback : callbacks) {\n\t\t\t// Roll for house\n\t\t\tthis.rollHouse(INITIAL_DELAY, FINAL_DELAY, DELAY_INCREMENT);\n\t\t\t\n\t\t\tfor (Player player : this.players.values()) {\n\t\t\t\t// Players who are playing must have a bet and a score\n\t\t\t\t// This conditional may not be required in Assignment 2\n\t\t\t\tif (player.getBet() > 0 && player.getRollResult()\n\t\t\t\t\t\t.getTotalScore() > 0) {\n\t\t\t\t\t// Compare rolls, set result and add/subtract points\n\t\t\t\t\tif (this.houseDice.getTotalScore() > player.\n\t\t\t\t\t\t\tgetRollResult().getTotalScore()) {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.LOST;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Subtract bet from player points\n\t\t\t\t\t\tint points = player.getPoints() - player.getBet();\n\t\t\t\t\t\tthis.setPlayerPoints(player, points);\n\t\t\t\t\t}\n\t\t\t\t\telse if (houseDice.getTotalScore() == player.\n\t\t\t\t\t\t\tgetRollResult().getTotalScore()) {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.DREW;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No change to points on a draw\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.WON;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add bet to player points\n\t\t\t\t\t\tint points = player.getPoints() + player.getBet();\n\t\t\t\t\t\tthis.setPlayerPoints(player, points);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Display result\n\t\t\t\t\tcallback.gameResult(this.getPlayer(player.getPlayerId()), \n\t\t\t\t\t\t\tthis.getPlayer(player.getPlayerId()).getGameResult(), this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public GameState getGameState() {\n return this.gameState;\n }",
"public interface IState {\n int getLevel();\n\n float getClock();\n\n int getLives();\n\n int getCurrentScore();\n\n int getRequiredScore();\n\n boolean isGameOver();\n\n @Override\n String toString();\n}",
"private void evaluateStage(){\n switch (currentStage){\n case EGG: if (getLifetime() >= ModelSettings.brood_lifetime_egg)\n currentStage = LARVAE;\n break;\n case LARVAE: if (getLifetime() >= ModelSettings.brood_lifetime_larvae)\n currentStage = PUPAE;\n break;\n case PUPAE: if (getLifetime() >= ModelSettings.brood_lifetime_pupae)\n System.out.println(\"This pupae is now an adult!\");\n //TODO trigger manager\n break;\n }\n }",
"public GameState getGameState() {\n return this.gameState;\n }",
"public int[] getCurrentTrueState() {\n\t\tint[] ret = { mrRoboto.y, mrRoboto.x, mrRoboto.h };\n\t\treturn ret;\n\t}",
"public double[] getState(){\n if (AgentType.Abstraction == SimpleExperiment.activeAgentType) {\n // Abstraction agent type\n return this.getCustomState();\n }\n else {\n // System.out.println(\"E[\" + marioEgoPos[0] + \",\" + marioEgoPos[1] + \"] F[\" + marioFloatPos[0] + \",\" + marioFloatPos[1] + \"]\");\n\n // other agent type\n double[] state = new double[10];\n\n // CLOSEST TWO ENEMIES\n state[0] = isMarioAbleToJump ? 1 : 0;\n state[1] = isMarioOnGround ? 1 : 0;\n state[2] = isMarioAbleToShoot ? 1 : 0;//marioMode;//\n float xdiff = marioFloatPos[0] - prevMarioPos[0];\n float ydiff = marioFloatPos[1] - prevMarioPos[1];\n state[3] = xdiff < 0 ? 0 : (xdiff == 0 ? 1 : 2);\n state[3] += 3*(ydiff < 0 ? 0 : (ydiff == 0 ? 1 : 2));\n\n state[4] = enemies(1, 0);\n state[5] = enemies(3, 1);\n state[6] = 0;//enemies(5, 3);\n\n state[7] = obstacle();\n\n int[] enemy = closestEnemy();\n if(Math.abs(enemy[0]) < 11 && Math.abs(enemy[1]) < 11){\n state[8] = enemy[0]+10;\n state[9] = enemy[1]+10;\n } else {\n state[8] = 21;\n state[9] = 21;\n }\n\n //state[10] = marioFloatPos[0];\n //state[11] = marioFloatPos[1];\n\n return state;\n }\n }",
"public void displayGameState() {\n\t\tif (this.mazeData.getState().equals(\"quit\")) {\n\t\t\tSystem.out.println(\"Good bye!\");\n\t\t} else if (this.mazeData.getState().equals(\"goal found\")) {\n\t\t\tthis.mazeViewBuilder.updateCurrentPosition(this.mazeData.getCurrentPosition());\n\t\t\tString[] mazeDisplay = this.mazeViewBuilder.getMazeDisplay();\n\t\t\tthis.clearConsole();\n\t\t\tfor (int i = 0; i < mazeDisplay.length; i++) {\n\t\t\t\tSystem.out.println(mazeDisplay[i]);\n\t\t\t}\n\t\t\tSystem.out.println(\"Congratulation, you found the goal!\");\n\t\t} else {\n\t\t\tSystem.out.println(this.mazeData.getState());\n\t\t}\n\t}",
"public int evaluate(int[][] gameBoard) {\n for (int r = 0; r < 3; r++) {\n if (gameBoard[r][0] == gameBoard[r][1] && gameBoard[r][1] == gameBoard[r][2]) {\n if (gameBoard[r][0] == ai)\n return +10;\n else if (gameBoard[r][0] == human)\n return -10;\n }\n }\n // Checking for Columns for victory.\n for (int c = 0; c < 3; c++) {\n if (gameBoard[0][c] == gameBoard[1][c] && gameBoard[1][c] == gameBoard[2][c]) {\n //gameLogic.getWinType();\n if (gameBoard[0][c] == ai)\n return +10;\n else if (gameBoard[0][c] == human)\n return -10;\n }\n }\n // Checking for Diagonals for victory.\n if (gameBoard[0][0] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][2]) {\n if (gameBoard[0][0] == ai)\n return +10;\n else if (gameBoard[0][0] == human)\n return -10;\n }\n if (gameBoard[0][2] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][0]) {\n if (gameBoard[0][2] == ai)\n return +10;\n else if (gameBoard[0][2] == human)\n return -10;\n }\n // Else if none of them have won then return 0\n return 0;\n }",
"public void terrainStates(){\n \tif(statesPad.getRawButton(portButton)){terrainStates = portState;}\n \telse if(statesPad.getRawButton(chevellButton)){terrainStates = chevellState;}\n \telse if(statesPad.getRawButton(ballGrabButton)){terrainStates = ballGrabState;}\n \telse if(statesPad.getRawButton(driveStateButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(lowBarButton)){terrainStates = lowBarState;}\n \telse if(statesPad.getRawButton(roughButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(rockButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(moatButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(rampartButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(drawButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(sallyButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(statesPadDefault) || drivePad.getRawButton(defaultButton)){terrainStates = driveState;}\n \t\n \tswitch (terrainStates) {\n\t \tcase 1: \n\t \t\tport();\n\t \t\tSystem.out.println(\"HERE IN ONE\");\n\t break;\n\t \tcase 2:\t\n\t \t\tchevell();\n\t \t\tSystem.out.println(\"HERE IN TWO\");\n\t \tbreak;\n\t case 3:\n\t \troughT();\n\t \tSystem.out.println(\"HERE IN THREE\");\n\t \tbreak;\n\t case 4: \n\t \tmoat();\n\t \tSystem.out.println(\"HERE IN FOUR\");\n\t \tbreak;\n\t case 5:\n\t \trampart();\n \t\t\tSystem.out.println(\"HERE IN FIVE\");\n \t\t\tbreak;\n\t case 6: \n\t \tdrawBridge();\n \t\t\tSystem.out.println(\"HERE IN SIX\");\n \t\t\tbreak;\n\t case 7: \n\t \tsallyPort();\n \t\t\tSystem.out.println(\"HERE IN SEVEN\");\n \t\t\tbreak;\n\t case 8: \n\t \tlowBar();\n\t \tSystem.out.println(\"HERE IN EIGHT\");\n\t \tbreak;\n\t case 9: \n\t \trockWall();\n \t\t\tSystem.out.println(\"HERE IN NINE\");\n \t\t\tbreak;\n\t case 10: \n\t \tballGrab();\n\t\t\t\tSystem.out.println(\"HERE IN TEN\");\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\tdrivingState();\n\t\t\t\tSystem.out.println(\"HERE IN TWELVE\");\n\t\t\t\tbreak;\n\t default: \n\t \t//reset all of the states\n\t \tportSwitch \t\t= 0;\n\t \tchevellSwitch\t= 0;\n\t \tballGrabSwitch\t= 0;\n\t \tdriveSwitch\t\t= 0;\n\t \tliftArm();\n\t \twheelArms();\n\t \tSystem.out.println(\"HERE IN DEFAULT\");\n \t}\n \tSystem.out.println(\"OUTSIDE THE SWITCH\");\n }",
"void check_game_state() {\n // Game over\n if (lives <= 0){ // No lives left\n end_game();\n }\n for (Alien alien : aliens){ // Aliens reached bottom of screen\n if (alien.y_position + alien.alien_height >= ship.y_position) {\n end_game();\n break;\n }\n }\n\n // Empty board\n if (aliens.isEmpty()) { // All aliens defeated\n if (level < 3) { // Level up\n level_up();\n alien_setup();\n }\n else { // Victory\n end_game();\n }\n }\n }",
"public void updateState(boolean gameDone){\r\n if (animation == 0) {\r\n if (this.state==this.color){\r\n if (this.travel!=0)\r\n this.state=this.color+256;\r\n else\r\n if (idle_counter == 3)\r\n this.state=this.color+264;\r\n }\r\n else if (this.state>=16) {\r\n if (this.state<=31) {\r\n if (this.state+8>31 && !gameDone)\r\n this.state=this.color;\r\n else {\r\n this.state += 8;\r\n }\r\n }\r\n else if (this.state<=63){\r\n if (this.state+8<=63)\r\n this.state+=8;\r\n }\r\n else if (this.state <= 103){\r\n if (this.state + 8 > 103)\r\n this.state=this.color;\r\n else\r\n this.state += 8;\r\n }\r\n else if (this.state<=159){\r\n if (this.state+8>159)\r\n this.state=this.color;\r\n else\r\n this.state += 8;\r\n }\r\n else if (this.state<=255){\r\n if (this.state + 8 > 255) \r\n this.state = this.color;\r\n else\r\n this.state += 8;\r\n if (this.state>=184 && this.state<=199)\r\n this.positionY-=7;\r\n else if (this.state>=208 && this.state<=223)\r\n this.positionY+=7;\r\n }\r\n else if (this.state<264)\r\n this.state=this.color;\r\n else if (idle_counter==3)\r\n this.state=this.color; \r\n }\r\n }\r\n if (idle_counter==3)\r\n idle_counter=0;\r\n if (animation >= 4 && !gameDone) {\r\n animation = 0;\r\n idle_counter++;\r\n }\r\n //creates a slowmo effect once the game is done\r\n else if (animation==18 && gameDone){\r\n animation = 0;\r\n idle_counter++;\r\n }\r\n else \r\n animation++;\r\n \r\n }",
"public IGameAlgo.GameState getGameState (GameBoard.GameMove move){\n\t\t/*\n\t\t * If last move made by computer,check if computer wins.\n\t\t */\n\t\tif(this.board[lastMove.getRow()][lastMove.getColumn()]==BoardSigns.COMPUTER.getSign()) {\n\t\t\t if(\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[0][1] == BoardSigns.COMPUTER.getSign() && board[0][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[1][0] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[1][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[2][0] == BoardSigns.COMPUTER.getSign() && board[2][1] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[1][0] == BoardSigns.COMPUTER.getSign() && board[2][0] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][1] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][1] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.COMPUTER.getSign() && board[1][2] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][0] == BoardSigns.COMPUTER.getSign())\n\t\t )\n\t\t\t\t return GameState.PLAYER_LOST;\t\t\t\t\t\t \n\t\t}\n\t\t/*\n\t\t * If last move made by player,check if player wins.\n\t\t */\n\t\telse {\n\t\t\t if(\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[0][1] == BoardSigns.PLAYER.getSign() && board[0][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[1][0] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[1][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[2][0] == BoardSigns.PLAYER.getSign() && board[2][1] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[1][0] == BoardSigns.PLAYER.getSign() && board[2][0] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][1] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][1] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.PLAYER.getSign() && board[1][2] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][0] == BoardSigns.PLAYER.getSign())\n\t\t )\n\t\t\t\t return GameState.PLAYER_WON;\t\n\t\t}\n\t\t/*\n\t\t * No one wins,check if in progress or game ends with tie.\n\t\t */\n\t\t\n\t\t //check if exist empty spots. \n\t\t\tfor(int i=0;i<3;i++)\n\t\t\tfor(int j=0;j<3;j++)\n\t\t\t\tif(board[i][j]==TicTacTow.BoardSigns.BLANK.getSign()) \n\t\t\t\t return GameState.IN_PROGRESS;\n\t\t\treturn GameState.TIE;\t\t\t\n\t}",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"public Player getState() {\n\t\treturn state;\n\t}",
"public GameState getState() {\n\t\treturn state;\n\t}",
"public static double evaluate(Player player, State state) {\n\t\treturn Value.playerScore(player, state) - Value.playerScore(player.getOpponent(), state);\n\t}",
"public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }",
"public int getStateOfMovement(){ return stateOfMovement; }",
"@Test\n\tpublic final void testGameUpdateAndDraw() {\n\t\tgsm = GameStateManager.getInstance();\n\t\t// System.out.println(gsm.getCurrentState());\n\t\t// System.out.println(GameStateManager.MENUSTATE);\n\t\t// assertEquals(gsm.getCurrentState(), GameStateManager.MENUSTATE);\n\t\t// gsm.setState(GameStateManager.LEVELSTATE);\n\t\tassertEquals(gsm.getCurrentState(), GameStateManager.LEVELSTATE);\n\t\tfor (int i = 0; i < 6000; i++) {\n\t\t\tgsm.update();\n\t\t\tgsm.draw(g2d);\n\t\t}\n\t}",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"private static void updateGame()\n {\n GameView.gameStatus.setText(\"Score: \" + computerScore + \"-\" + playerScore);\n if (computerScore + playerScore == NUM_CARDS_PER_HAND) {\n if (computerScore > playerScore) {\n GameView.gameText.setText(\"Computer Wins!\");\n Timer.stop = true;\n }\n else if (playerScore > computerScore) {\n GameView.gameText.setText(\"You win!\");\n Timer.stop = true;\n }\n else {\n GameView.gameText.setText(\"Tie game!\"); \n Timer.stop = true;\n }\n }\n }",
"@PlayerState\n public abstract int getPlayerState();",
"void updateGameState(GameState gameState);",
"public final boolean updateState(GameStateEvent e) {\n if (e == null) {\n getUtils().log(Logger.Level.WARNING, this.getClass(), \"State update function was passed null\");\n return false;\n }\n switch (e) {\n case RESET:\n reset();\n gameState = GameState.LOBBY;\n return true;\n case INIT:\n if (gameState == GameState.LOBBY) {\n if (init()) {\n gameState = GameState.INITIATING;\n return true;\n }\n }\n return false;\n case START:\n if (gameState == GameState.INITIATING) {\n if (start()) {\n gameState = GameState.ACTIVE;\n return true;\n }\n }\n return false;\n case PAUSE:\n if (gameState == GameState.ACTIVE) {\n if (pause()) {\n gameState = GameState.PAUSED;\n return true;\n }\n }\n return false;\n case RESUME:\n if (gameState == GameState.PAUSED) {\n if (resume()) {\n gameState = GameState.ACTIVE;\n return true;\n }\n }\n return false;\n case END:\n if (gameState == GameState.ACTIVE) {\n if (end()) {\n gameState = GameState.ENDED;\n return true;\n }\n }\n return false;\n default:\n getUtils().log(Logger.Level.WARNING, this.getClass(), \"Invalid GameStateEvent passed to GameInstance #\" + gameID\n + \"\\nThis is probably a bug! Please report it to https://github.com/uhcmanager/uhcautomation\");\n return false;\n }\n }",
"public SimplePoolGameState evaluateShot(SimplePoolMove shot) {\r\n\t\tapplyShot(shot);\r\n\t\tSimplePoolGameState gameState = TurnOver;\r\n\t\tif (shot.somethingPotted())\r\n\t\t\tgameState = table().isBallsLeftOnTable() ? TurnContinued : GameOver;\r\n\t\treturn shot.isFoul() ? gameState.forFoul() : gameState;\r\n\t}",
"public int getCurrentState() {\n return myState;\n }",
"public abstract void showWin(GameStateInterface state);",
"public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }",
"private void announceRoundResult()\n {\n // Last actions of each player, to compare\n GameAction fpAction = firstPlayer.getLastAction();\n GameAction spAction = secondPlayer.getLastAction();\n\n // Display first IA game\n if (!hasHuman)\n {\n if (fpAction instanceof RockAction)\n {\n animateSelectedButton(firstPlayerRock, true);\n }\n else if (fpAction instanceof PaperAction)\n {\n animateSelectedButton(firstPlayerPaper, true);\n }\n else if (fpAction instanceof ScissorsAction)\n {\n animateSelectedButton(firstPlayerScissors, true);\n }\n }\n // Display second IA game\n if (spAction instanceof RockAction)\n {\n animateSelectedButton(secondPlayerRock, false);\n }\n else if (spAction instanceof PaperAction)\n {\n animateSelectedButton(secondPlayerPaper, false);\n }\n else if (spAction instanceof ScissorsAction)\n {\n animateSelectedButton(secondPlayerScissors, false);\n }\n\n\n // First player has played something ==> look at result\n if (firstPlayer.hasAlreadyPlayed())\n {\n switch (fpAction.versus(spAction))\n {\n case WIN:\n updateResultIcons(true, false);\n break;\n case DRAW:\n updateResultIcons(false, true);\n break;\n case LOSE:\n updateResultIcons(false, false);\n break;\n }\n }\n // First player didn't play ==> draw or loose\n else\n {\n // Draw\n if (!secondPlayer.hasAlreadyPlayed())\n {\n updateResultIcons(false, true);\n }\n // Lose\n else\n {\n updateResultIcons(false, false);\n }\n }\n }",
"public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }",
"protected double eval(S state, P player) {\n if (game.isTerminal(state)) {\n return game.getUtility(state, player);\n } else {\n heuristicEvaluationUsed = true;\n return (utilMin + utilMax) / 2;\n }\n }",
"PlayerState getPlayerState() {\n return playerState;\n }",
"public void printCurrentState() {\n\t\t//getX() and getY() are methods from the Point class\n\t\tSystem.out.println(\"Avatar location: \" + avatar.getLocation().getX() + \",\" + avatar.getLocation().getY());\n\t\tSystem.out.println(\"Points: \" + avatar.getScore());\n\t}",
"@Override\n public void update() {\n if (Screen.checkState(GameState.RUNNING)) {\n healthToDraw = getPlayer().getHealth();\n maxHealthToDraw = getPlayer().getMaxHealth();\n minesToDraw = getPlayer().getCurrentMines();\n maxMinesToDraw = getPlayer().getMaxMines();\n currentLevelToDraw = Screen.getRoomHandler().getCurrentLevel();\n defenseToDraw = getPlayer().getDefense();\n speedToDraw = getPlayer().getSpeed();\n rangeToDraw = getPlayer().getSmallPlayerRange();\n damageToDraw = getPlayer().getPlayerDamage();\n playerRings = getPlayer().getRings();\n skillsToDraw = new Skill[4];\n for (int i = 0; i < getPlayer().getSkills().size(); i++) {\n if ( i < 4) {\n skillsToDraw[i] = getPlayer().getSkills().get(i);\n }\n }\n }\n }",
"public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }",
"public int eval()\n\t\t{\n\t\t\tif (p[BLACK]==0) return MAX+1;\t//black=0 then white win then return max\n\t\t\tif (p[WHITE]==0) return MIN-1;\t//white=0 then black win then return min\n\t\t\tint bl=getNumberOne(p[0]);int wh=getNumberOne(p[1]);\n\t\t\treturn wh-bl;\n\t\t}",
"public void stateChanged(ChangeEvent e) {\n\t\tupdatePits();\n\t\tSystem.out.println(\"Player 0 score: \" + model.getMancalas()[0]);\n\t\tSystem.out.println(\"Player 1 score: \" + model.getMancalas()[1]);\n\t\tleftScore.setText( Integer.toString(model.getMancalas()[1]));\n\t\trightScore.setText( Integer.toString(model.getMancalas()[0]));\n\t\tSystem.out.println(\"It is now player: \" + model.getPlayer() + \"'s turn\");\n\t\t\n\t}",
"public void executeevaluate() {\n \t\tString board = conf.getProperty(\"gamesman.board\");\n \t\tif (board == null)\n \t\t\tUtil.fatalError(\"Please specify a hash to evaluate\");\n \t\tBigInteger val = new BigInteger(board);\n \t\tSystem.out.println(gm.primitiveValue(gm.hashToState(val)));\n \t}",
"public int computeGameSituation(int paraState) {\n\t\tint[][] tempCheckerboard = stateToCheckerboard(paraState);\n\t\t// System.out.println(\"The checkerboard is: \" +\n\t\t// Arrays.deepToString(tempCheckerboard));\n\n\t\treturn computeGameSituation(tempCheckerboard);\n\t}",
"boolean goalState() {\n\t\treturn (numbersLeft == 0);\n\t}",
"@Override\n public int calculateBattleValue() {\n return calculateBattleValue(false, false);\n }",
"abstract void showGameState();",
"public void stateChange() {\n\t\tif (Qclicks > 3 && mini == GameState.questions) {\n\t\t\t/*\n\t\t\t * This makes all of the buttons disappear except for the continue\n\t\t\t * button\n\t\t\t */\n\t\t\tstage.clear();\n\t\t\tstage.addActor(next);\n\t\t}\n\t\tif (Gdx.input.justTouched()) {\n\t\t\tif (mini == GameState.start) {\n\t\t\t\tint x = Gdx.input.getX();\n\t\t\t\tint y = Gdx.input.getY();\n\t\t\t\tscore = 0;\n\t\t\t\tclicks = 0;\n\t\t\t\tQclicks = 0;\n\t\t\t\t// font.setScale(0.25f);\n\t\t\t\tif(x > 240 && x < 445 && y > 322 && y < 350){\n\t\t\t\t\tmini = GameState.questions;\n\t\t\t\t}\n\t\t\t} else if (mini == GameState.score) {\n\t\t\t\tint numc = (int) (percentCorrect * (numTries * 4)) + score;\n\t\t\t\tnumTries++;\n\t\t\t\tpercentCorrect = ((float) numc) / ((float) (numTries * 4));\n\t\t\t\tif (score >= 3) {\n\t\t\t\t\tnumSuccess++;\n\t\t\t\t}\n\t\t\t\tif (needToReview.size() == 0) {\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t\tmini = GameState.review;\n\t\t\t} else if (mini == GameState.review) {\n\t\t\t\treviewNum++;\n\t\t\t\tif (needToReview.size() == reviewNum) {\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"@Test\n void getCurrentRewardsFromUpgradeTest() {\n EnumMap<CardPoints,Integer> oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 3);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); //index/state = 0, cost stage 1\n assertEquals(oracle, this.wonder.getProp().get(this.wonder.getState()).y); //index/state = 0, cost stage 1\n\n wonder.setState(wonder.getState() + 1); // stage one is build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n //reward is an effect, so no cardpoints\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 1, cost stage 2\n\n wonder.setState(wonder.getState() + 1); // 2 stage build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 7);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 2, cost stage 3\n wonder.setState(wonder.getState() + 1); // Build the last stage\n\n //return an outIndexError when we call this method\n }",
"public static void main(String[] args) throws InterruptedException, NumberFormatException, IOException {\n\n\t\tint game = 0;\n\t\tFile fileToBeModified = new File(\"src/Game/winCount.txt\");\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileToBeModified));\n\n\t\tint whiteWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"White Wins:\" + whiteWin);\n\t\tint blackWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Black Wins:\" + blackWin);\n\t\tint stalemates = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Stalemates:\" + stalemates);\n\n\t\tint currWhiteWin = 0;\n\t\tint currBlackWin = 0;\n\t\tint currStalemate = 0;\n\n\t\tlong start= System.currentTimeMillis();\n\n\t\tBoardState board = new BoardState();\n\t\tMinimaxAI minimaxBlackPlayer = new MinimaxAI(5);\n\t\tMinimaxAI minimaxWhitePlayer = new MinimaxAI(5);\n\t\tAlphaBetaAI abBlackPlayer = new AlphaBetaAI(5);\n\t\tAlphaBetaAI abWhitePlayer = new AlphaBetaAI(5);\n\t\twhile (game <=30) {\t\n\t\t\tfor (int y = 8; y > 0; y--) {\n\t\t\t\tfor (int x = 1; x <= 8; x++) {\n\t\t\t\t\tSystem.out.print(board.getTile(x, y) + \"\\t\");\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tint turn = 1;\n\t\t\twhile (!board.gameOver()) {\n\t\t\t\tif (board != null) {\n\t\t\t\t\tif (board.isWhiteTurn) {\n\t\t\t\t\t\t//board = abWhitePlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxWhitePlayer.minimaxPlay(board);\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//board = abBlackPlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxBlackPlayer.minimaxPlay(board);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Turn #\" + turn++);\n\t\t\t\t\tboard.printBoard();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tTimeUnit.MILLISECONDS.sleep(250);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (board.whiteWin()) {\n\t\t\t\tSystem.out.println(\"White Wins\");\n\t\t\t\twhiteWin++;\n\t\t\t\tcurrWhiteWin++;\n\t\t\t}else if(board.blackWin()){\n\t\t\t\tSystem.out.println(\"Black Wins\");\n\t\t\t\tblackWin++;\n\t\t\t\tcurrBlackWin++;\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Stalemate\");\n\t\t\t\tstalemates++;\n\t\t\t\tcurrStalemate++;\n\t\t\t}\n\t\t\t\n//\t\t\tboard.reset();\n//\t\t\tgame++;\n\t\t\tbreak;\n\t\t}\n\n\t\tlong elapsed = System.currentTimeMillis() - start;\n\t\tSystem.out.println(\"Time Elapsed: \" + elapsed);\n\n\t\tFileWriter writer = new FileWriter(fileToBeModified);\n\t\twriter.write(Integer.toString(whiteWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(blackWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(stalemates));\n\t\tSystem.out.println(\"White Wins:\" + currWhiteWin);\n\t\tSystem.out.println(\"Black Wins:\" + currBlackWin);\n\t\tSystem.out.println(\"Stalemates:\" + currStalemate);\n\t\treader.close();\n\t\twriter.close();\n\t}",
"public void gameUpdate() {\n\t\t\n\t\t// Remember our homeTilePosition at the first frame\n\t\tif (bwapi.getFrameCount() == 1) {\n\t\t\tint cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Terran_Command_Center.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Zerg_Hatchery.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Protoss_Nexus.ordinal(), 0, 0);\n\t\t\thomePositionX = bwapi.getUnit(cc).getX();\n\t\t\thomePositionY = bwapi.getUnit(cc).getY();\n\t\t\n\t\t\tResourceManager.getInstance().gameStart(bwapi.getMyUnits());\n\t\t}\n\t\t\n\t\t/*\n\t\tif(ResourceManager.getInstance().numWorkers() == 10 && ScoutManager.getInstance().numScouts() == 0) {\n\t\t\tbwapi.printText(\"Assigning a scout\");\n\t\t\tneedsScout();\n\t\t}\n\t\t*/\n\t\t\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.gameUpdate();\n\t\t\n\t\t// Draw debug information on screen\n\t\tdrawDebugInfo();\n\n\t\t\n\t\t// Call the act() method every 30 frames\n\t\tif (bwapi.getFrameCount() % 30 == 0) {\n\t\t\tact();\n\t\t}\n\t}",
"@Test\n public void testBasicScorer() {\n assertEquals(0, stateScorer.scoreState(builder().build(), TwoPlayerKey.PLAYER_1));\n\n //The other player has won if they occupy every node on the board:\n assertEquals(-1, stateScorer.scoreState(builder().allOccupiedBy(TwoPlayerKey.PLAYER_2).build(), TwoPlayerKey.PLAYER_1));\n\n //I have won if I occupy every node on the board:\n assertEquals(1, stateScorer.scoreState(builder().allOccupiedBy(TwoPlayerKey.PLAYER_1).build(), TwoPlayerKey.PLAYER_1));\n }",
"public Result determineOutcome() {\n for (int row = 0; row < TicTacToeModel.BOARD_DIMENSION; row++) {\n if (rowScore[row] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (rowScore[row] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n for (int col = 0; col < TicTacToeModel.BOARD_DIMENSION; col++) {\n if (colScore[col] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (colScore[col] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n if (leftDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (rightDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (leftDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n if (rightDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n\n if (freeSpace == 0) return Result.DRAW;\n\n return Result.INCOMPLETE;\n }",
"private long opponent_winning_position() {\r\n return compute_winning_position(bitboard ^ mask, mask);\r\n }",
"public boolean isStateActive(State state) {\n\t\tswitch (state) {\n\t\t\tcase main_region_digitalwatch :\n\t\t\t\treturn stateVector[0].ordinal() >= State.main_region_digitalwatch\n\t\t\t\t\t\t.ordinal()\n\t\t\t\t\t\t&& stateVector[0].ordinal() <= State.main_region_digitalwatch_Display_glowing_GlowDelay\n\t\t\t\t\t\t\t\t.ordinal();\n\t\t\tcase main_region_digitalwatch_Time_counting_Counting :\n\t\t\t\treturn stateVector[0] == State.main_region_digitalwatch_Time_counting_Counting;\n\t\t\tcase main_region_digitalwatch_Display_refreshing_RefreshingTime :\n\t\t\t\treturn stateVector[1].ordinal() >= State.main_region_digitalwatch_Display_refreshing_RefreshingTime\n\t\t\t\t\t\t.ordinal()\n\t\t\t\t\t\t&& stateVector[1].ordinal() <= State.main_region_digitalwatch_Display_refreshing_RefreshingTime_timeView_hideAlarm\n\t\t\t\t\t\t\t\t.ordinal();\n\t\t\tcase main_region_digitalwatch_Display_refreshing_RefreshingTime_timeView_showAlarm :\n\t\t\t\treturn stateVector[1] == State.main_region_digitalwatch_Display_refreshing_RefreshingTime_timeView_showAlarm;\n\t\t\tcase main_region_digitalwatch_Display_refreshing_RefreshingTime_timeView_hideAlarm :\n\t\t\t\treturn stateVector[1] == State.main_region_digitalwatch_Display_refreshing_RefreshingTime_timeView_hideAlarm;\n\t\t\tcase main_region_digitalwatch_Display_refreshing_RefreshingChrono :\n\t\t\t\treturn stateVector[1] == State.main_region_digitalwatch_Display_refreshing_RefreshingChrono;\n\t\t\tcase main_region_digitalwatch_Display_chrono_countingChrono :\n\t\t\t\treturn stateVector[2] == State.main_region_digitalwatch_Display_chrono_countingChrono;\n\t\t\tcase main_region_digitalwatch_Display_chrono_ChoroStart :\n\t\t\t\treturn stateVector[2] == State.main_region_digitalwatch_Display_chrono_ChoroStart;\n\t\t\tcase main_region_digitalwatch_Display_glowing_GlowOff :\n\t\t\t\treturn stateVector[3] == State.main_region_digitalwatch_Display_glowing_GlowOff;\n\t\t\tcase main_region_digitalwatch_Display_glowing_GlowOn :\n\t\t\t\treturn stateVector[3] == State.main_region_digitalwatch_Display_glowing_GlowOn;\n\t\t\tcase main_region_digitalwatch_Display_glowing_GlowDelay :\n\t\t\t\treturn stateVector[3] == State.main_region_digitalwatch_Display_glowing_GlowDelay;\n\t\t\tdefault :\n\t\t\t\treturn false;\n\t\t}\n\t}",
"private void evaluateWin(boolean finalCheck)\r\n\t{\r\n\t\t// Stores player and dealer scores in local variables, rather than repeatedly call the get methods\r\n\t\tint scoreP = player1.getTotal();\r\n\t\tint scoreD = dealer.getTotal();\r\n\t\t\r\n\t\t// first check: is the game still going? If it has ended, then no evaluation needs to be made\r\n\t\tif ( !endGame )\r\n\t\t{\r\n\t\t\t/* second check: is this the final evaluation? if not, the first block of statements executes.\r\n\t\t\tIf Player == 21 and Dealer == 21, Tie\r\n\t\t\tIf Player == 21 and Dealer != 21, Player wins\r\n\t\t\tIf Player != 21 and Dealer == 21, Dealer wins\r\n\t\t\tIf Player > 21, Dealer wins at any number\r\n\t\t\tIf Player > Dealer at the end of the game and no one has busted or hit 21, Player wins\r\n\t\t\tThe last check is performed only if finalCheck is true.\r\n\t\t\t*/\r\n\t\t\tif ( !finalCheck )\r\n\t\t\t{\r\n\t\t\t\tif (scoreP > BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\tendGame = true;\r\n\t\t\t\t}\r\n\t\t\t\telse if (scoreP == BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end scoreP > BUST_SCORE\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (scoreD > BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end ScoreP <= BUST SCORE\r\n\t\t\t} // end finalCheck = false\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Final victory condition check\r\n\t\t\t\tif ( dealer.getTotal() < player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( dealer.getTotal() == player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...1\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} // end finalCheck = true\r\n\t\t\r\n\t\t} // end endGame = false if\r\n\t\r\n\t}",
"private char getGameStatus() {\n int row;\n int col;\n\n Map<Character, Integer> lineCounts = new HashMap<>();\n\n for (row = 0; row < this.boardSize; row++) {\n countLine(getLineStatus(this.board[row]), lineCounts);\n }\n\n for (col = 0; col < this.boardSize; col++) {\n countLine(getLineStatus(getColumn(col)), lineCounts);\n }\n\n countLine(getLineStatus(getMajorDiag()), lineCounts);\n countLine(getLineStatus(getSubDiag()), lineCounts);\n\n boolean player1Won = lineCounts.getOrDefault(players[0].symbol, 0) > 0;\n boolean player2Won = lineCounts.getOrDefault(players[1].symbol, 0) > 0;\n boolean boardIsFull = lineCounts.getOrDefault(' ', 0) == 0;\n if (player1Won && player2Won) // both players completed lines, it is a tie\n return 'T';\n if (player1Won)\n return players[0].symbol;\n if (player2Won)\n return players[1].symbol;\n if (boardIsFull)\n return 'T';\n return '?';\n }",
"public byte getState(){\n\t\t/*\n\t\tOFFLINE((byte)0),\n ONLINE((byte)1),\n SAVING((byte)2);\n\t\t */\n\t\t//getWorld().getcWorld().update(this);\n\t\treturn state;\n\t}"
] | [
"0.71734226",
"0.6819385",
"0.6752606",
"0.6725033",
"0.6711375",
"0.6705088",
"0.6637057",
"0.6465204",
"0.6440099",
"0.63837343",
"0.6343338",
"0.6335542",
"0.63288784",
"0.63066375",
"0.63036567",
"0.62720364",
"0.62611854",
"0.6219124",
"0.6167398",
"0.61258936",
"0.6095818",
"0.60798955",
"0.60633963",
"0.6033062",
"0.59881514",
"0.59854263",
"0.59737754",
"0.59736866",
"0.5968064",
"0.59612864",
"0.5938767",
"0.59311527",
"0.5926978",
"0.5926034",
"0.59190494",
"0.59168786",
"0.59166956",
"0.5912155",
"0.58907455",
"0.5878347",
"0.5871275",
"0.5869462",
"0.58667105",
"0.5844518",
"0.5834497",
"0.5821915",
"0.5816064",
"0.58116066",
"0.5802179",
"0.5780547",
"0.57778084",
"0.57693475",
"0.57600594",
"0.57491827",
"0.57452387",
"0.57415885",
"0.5740658",
"0.57396454",
"0.5737151",
"0.5731205",
"0.5727521",
"0.5716965",
"0.5716965",
"0.5716965",
"0.5716965",
"0.5716965",
"0.5716965",
"0.5707869",
"0.5702947",
"0.5701431",
"0.5700593",
"0.569463",
"0.5692051",
"0.5691253",
"0.56807774",
"0.56782377",
"0.56680226",
"0.5666002",
"0.5657955",
"0.56573886",
"0.56572723",
"0.56492746",
"0.56454295",
"0.5642338",
"0.5640078",
"0.5638109",
"0.5634642",
"0.5629229",
"0.5628497",
"0.5624642",
"0.5623914",
"0.56164956",
"0.5611203",
"0.5610187",
"0.56020063",
"0.5600426",
"0.5598307",
"0.5590577",
"0.55849004",
"0.5571098"
] | 0.73694324 | 0 |
get the evaluation bonus for the specified position | private int getScoreForPiecePosition(int row, int column) {
byte[][] positionWeight =
{ {1,1,1,1,1,1,1,1}
,{2,2,2,2,2,2,2,2}
,{2,2,3,3,3,3,2,2}
,{2,2,3,4,4,3,2,2}
,{2,2,3,4,4,3,2,2}
,{2,2,3,3,3,3,2,2}
,{2,2,2,2,2,2,2,2}
,{1,1,1,1,1,1,1,1}
};
return positionWeight[row][column];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getBonusExp();",
"int getBonusExp();",
"float getBonusExp();",
"@Override\n public BigDecimal evaluate(TextMap args, String variableName) {\n return null;\n\n// return first.getBonus();\n }",
"public abstract int positionBonus();",
"public abstract int getBonus();",
"public double getBonus(){\r\n return bonus;\r\n }",
"public int getScore()\n {\n return points + extras;\n }",
"public int getBonus() {\n throw new UnsupportedOperationException(\"TODO: Implement\");\n\n }",
"public int getBonusExp() {\n return bonusExp_;\n }",
"public int getBonusExp() {\n return bonusExp_;\n }",
"public float getBonusExp() {\n return bonusExp_;\n }",
"public int getBonus(){\n return bonus;\n }",
"public int getBonusExp() {\n return bonusExp_;\n }",
"public int getBonusExp() {\n return bonusExp_;\n }",
"public int getBonus() {\n\t\treturn bonus;\n\t}",
"public float getBonusExp() {\n return bonusExp_;\n }",
"private double individualEvaluation() {\n\t\t//System.out.println(\"indE\"+ myValues.get(myAction.getPurpose()).getStrength(null));\n\t\treturn myValues.get(myAction.getPurpose()).getStrength(null);\n\t}",
"public Float getBonusRank() {\n return bonusRank;\n }",
"int getScoreValue();",
"public int getValueOfBonus() {\n return valueOfBonus;\n }",
"public BigDecimal getRecommendPosition() {\n return recommendPosition;\n }",
"public BigDecimal getRewardPoint() {\n return rewardPoint;\n }",
"@Override\n protected int getBonusPoints() {\n return leadership + experience;\n }",
"int getCurEXP();",
"int getCurEXP();",
"float getEvaluationResult();",
"double getActiveOperand();",
"public Integer getEvaluate() {\n return evaluate;\n }",
"public Polynomial getPolynom(int position) {\n return collection.get(position);\n }",
"public int getCoordinatingExp()\n\t{\n\t\treturn m_skillCoordExp;\n\t}",
"public double getRatingAt(int pos) {\n return this.usersRatings.get(pos).getRating();\n }",
"int getBonusHP();",
"@Override\n\tpublic BonusInterface getBonus() {\n\t\treturn bonus;\n\t}",
"public static int yatzyBonus(int limit, int bonus, int... result) {\n int score = 0;\n if (totalSum(result) >= limit) {\n score = bonus;\n }\n return score;\n }",
"public int getExpRequirement(int level, boolean isPromoted) {\r\n // TODO I have no idea what the exp table is above 25.\r\n if (level > 25 && !isPromoted) {\r\n return level * level * level * _expTable[1];\r\n }\r\n int index = level - 1;\r\n\r\n if (index < 0 || index > _expTable.length - 1) {\r\n _log.error(\"level index out of bounds: \" + level);\r\n return _expTable[_expTable.length - 1];\r\n }\r\n\r\n return _expTable[index];\r\n }",
"@Override\n\tpublic double bonus() {\n\t\treturn 0;\n\t}",
"public int returnPoints()\n {\n return score ;\n }",
"public int scoreSpec(){\n List<Player> players = state.getPlayers();\n int currentBonusScore = 0;\n int otherBonus = 0;\n for(int i = 0; i < players.size(); i++){\n if( i == state.getCurrentPlayerId()){\n currentBonusScore += bonusScore(players.get(i));\n }\n else{\n otherBonus += bonusScore(players.get(i));\n }\n }\n return currentBonusScore-otherBonus;\n }",
"public double getXp(SkillType name) {\n return levelsXp.get(name);\n }",
"Float getScore();",
"public double getExamMark(Result r) {\n\t\tfor (int i = 0; i < r.getAllGrades().size(); i ++) {\n\t\t\tGrade tempG = r.getAllGrades().get(i);\n\t\t\t// Exam\n\t\t\tif (Objects.equals(gradeType.EXAM, tempG.getType())) {\n\t\t\t\treturn tempG.getMark();\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"int getBonusMoney();",
"public Float getBonusRepurchase() {\n return bonusRepurchase;\n }",
"public double getScore() {\n return score - penalty;\n }",
"public int xp(){\n return this.xp;\n }",
"public int getScore() {\n return getStat(score);\n }",
"public PositionalAccuracy getPosAccuracy()\n {\n\treturn this.posAccuracy;\n }",
"public int bonusScore(Player p){\n int score = p.getBombRange() + p.getNumberBombRemaining() + p.getNumberMoveRemaining();\n return score;\n }",
"float getScore();",
"float getScore();",
"public int calculateExtraPoints() {\n if (rank.equals(Rank.JACK)) {\n return JACK_EXTRA_POINT;\n } else if (rank.equals(Rank.ACE)) {\n return ACE_EXTRA_POINT;\n } else if (rank.equals(Rank.TWO) && suit.equals(Suit.CLUBS)) {\n return TWO_CLUBS_EXTRA_POINT;\n } else if (rank.equals(Rank.TEN) && suit.equals(Suit.DIAMONDS)) {\n return TEN_DIAMONDS_EXTRA_POINT;\n } else {\n return NO_EXTRA_POINT;\n }\n }",
"int getScore();",
"public int getCurEXP() {\n return curEXP_;\n }",
"public int getCurEXP() {\n return curEXP_;\n }",
"public Float getBonusReference() {\n return bonusReference;\n }",
"@Override\n public int getBasicValue() {\n return minBonus;\n }",
"public int giveRaise(int bonus) {\n if (bonus >= 0) {\n this.salary += bonus;\n }\n return this.salary;\n }",
"public int getScorePoints() {\n/* 75 */ return this.scorePoints;\n/* */ }",
"boolean hasBonusExp();",
"boolean hasBonusExp();",
"boolean hasBonusExp();",
"int getRewardTrackValue();",
"@Override\r\n\tpublic int getRewardPrice(int i) {\n\t\treturn 0;\r\n\t}",
"public void getBonusPoints(){\n\t\tif((this.player[Dominoes.getPlayerIndex()].hand.size() == 0) && (Dominoes.missedRounds == 0)){\n\t\t\tshort bonusScore = 0;\n\t\t\tfor(byte i = 0; i < this.player.length; i++){\n\t\t\t\tif(i != Dominoes.getPlayerIndex()){\n\t\t\t\t\tbonusScore += (this.player[i].hand.size() * 5);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.player[Dominoes.getPlayerIndex()].score += bonusScore;\n\t\t}\n\t}",
"public int getExperience();",
"public abstract float getScore();",
"public int getCurEXP() {\n return curEXP_;\n }",
"public int getCurEXP() {\n return curEXP_;\n }",
"Float getAutoScore();",
"public abstract double experience();",
"double getY() { return pos[1]; }",
"int getPokeballValue();",
"public BigDecimal getReward() {\n return reward;\n }",
"double getTotalReward();",
"public double get(RatingMatrixEntry pref) {\n return estimates[pref.getIndex()];\n }",
"public int getMod() {\n return (int) Math.floor((base + bonus - 10) / 2);\n }",
"private static int getBonus(int sales) {\n if (sales > 5000) {\n\n return sales / 10;\n\n }\n return 0;\n }",
"public double getProfit(){\n return getPrice() * PROFIT_IN_PERCENTS / 100;\n }",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getScore();",
"public double getReward() {\n if (inGoalRegion()) {\n return REWARD_AT_GOAL;\n } else {\n return REWARD_PER_STEP;\n }\n }",
"public int getTrainingExp()\n\t{\n\t\treturn m_skillTrainingExp;\n\t}",
"public int getExperiencePoints() {\n return experiencePoints;\n }",
"@Override\r\n public Evaluation getEvaluation ()\r\n {\r\n return evaluation;\r\n }",
"public int getScore(int index) {\n return ranking.get(index).getvalue();\n }",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"public abstract double evaluate(Point p);",
"public int evaluate() {\n\t\treturn history + heuristic;\n\t}",
"float getSteamSupplyRating2();",
"public long getBonusAmount() {\r\n return bonusAmount;\r\n }",
"public int getScore()\n {\n return currentScore;\n }",
"@Column(name = \"exp_gained\", precision = 10)\n\t@Override\n\tpublic Integer getExpGained() {\n\t\treturn (Integer) getValue(3);\n\t}",
"@Override\n\tpublic int evaluate(){\n\t\treturn term.evaluate() + exp.evaluate();\n\t}",
"public float evaluate() \n {\n return evaluate(expr, expr.length()-1);\n }",
"public int getAnswer() {\n return myMinCoins;\n }",
"public int getExperienceForLevel(int level) {\r\n int points = 0;\r\n int output = 0;\r\n for (int lvl = 1; lvl <= level; lvl++) {\r\n points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));\r\n if (lvl >= level) {\r\n return output;\r\n }\r\n output = (int) Math.floor(points / 4);\r\n }\r\n return 0;\r\n }",
"public double getCost() {\n return quantity*ppu;\n\n }",
"@Override\n public double evaluate(GameState state, int id) {\n ArrayList<Double> scores = new ArrayList<>();\n for (int i = 0; i < 2; i++) {\n List<Double> bullets = new BulletDistanceFeature().extract(state, i);\n double angle = new OrientationFeature().extract(state, i);\n double positionScore = new PositionScoreFeature().extract(state, i);\n\n // take log of bullet distance to magnify the importance of ones closer to you\n double bulletScore = bullets.stream().mapToDouble(Math::log).sum();\n\n scores.add((bulletScore * this.bulletDist) + (angle * this.orientation) + positionScore * this.position);\n }\n return this.courage * scores.get(id) - scores.get(1 - id);\n }"
] | [
"0.65316975",
"0.65316975",
"0.6487006",
"0.63929754",
"0.6140929",
"0.603118",
"0.58684015",
"0.58069795",
"0.58031946",
"0.5763941",
"0.5763048",
"0.57383895",
"0.5734857",
"0.5712715",
"0.57122374",
"0.57058984",
"0.57040703",
"0.5637343",
"0.56337625",
"0.5624852",
"0.5623341",
"0.5617163",
"0.55863243",
"0.55703294",
"0.5559781",
"0.5559781",
"0.5549358",
"0.553949",
"0.5536521",
"0.5516118",
"0.5485366",
"0.5472686",
"0.5472361",
"0.5466335",
"0.54518384",
"0.54399425",
"0.54269606",
"0.54187167",
"0.5413771",
"0.54093075",
"0.53775495",
"0.53775",
"0.5374586",
"0.5331587",
"0.53264767",
"0.53180414",
"0.53179836",
"0.5302294",
"0.5300012",
"0.52835584",
"0.52835584",
"0.52684337",
"0.52631557",
"0.5262039",
"0.5261433",
"0.5253365",
"0.5250532",
"0.5249094",
"0.524887",
"0.52446777",
"0.52446777",
"0.52446777",
"0.5233937",
"0.5227523",
"0.5225296",
"0.52224636",
"0.52221924",
"0.52171993",
"0.521708",
"0.51998436",
"0.5190241",
"0.518717",
"0.51818675",
"0.5176302",
"0.51740265",
"0.5172014",
"0.5169925",
"0.5148609",
"0.514054",
"0.51403475",
"0.5139369",
"0.51366985",
"0.5135511",
"0.5124855",
"0.5112537",
"0.5105604",
"0.5105604",
"0.5105604",
"0.5105604",
"0.5100933",
"0.50983024",
"0.5094808",
"0.50945663",
"0.50907505",
"0.5087294",
"0.50819796",
"0.50814646",
"0.50693816",
"0.506794",
"0.50578874",
"0.50564057"
] | 0.0 | -1 |
get the evaluation score for the specified piece type | private int getScoreForPieceType(int type){
switch (type) {
case Piece.TYPE_BISHOP: return 30;
case Piece.TYPE_KING: return 99999;
case Piece.TYPE_KNIGHT: return 30;
case Piece.TYPE_PAWN: return 10;
case Piece.TYPE_QUEEN: return 90;
case Piece.TYPE_ROOK: return 50;
default: throw new IllegalArgumentException("unknown piece type: "+type);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int evaluateState() {\r\n\r\n\t\t// add up score\r\n\t\t//\r\n\t\tint scoreWhite = 0;\r\n\t\tint scoreBlack = 0;\r\n\t\tfor (Piece piece : this.chessGame.getPieces()) {\r\n\t\t\tif(piece.getColor() == Piece.COLOR_BLACK){\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else if( piece.getColor() == Piece.COLOR_WHITE){\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else{\r\n\t\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\t\"unknown piece color found: \"+piece.getColor());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// return evaluation result depending on who's turn it is\r\n\t\tint gameState = this.chessGame.getGameState();\r\n\t\t\r\n\t\tif( gameState == ChessGame.GAME_STATE_BLACK){\r\n\t\t\treturn scoreBlack - scoreWhite;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_WHITE){\r\n\t\t\treturn scoreWhite - scoreBlack;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_END_WHITE_WON\r\n\t\t\t\t|| gameState == ChessGame.GAME_STATE_END_BLACK_WON){\r\n\t\t\treturn Integer.MIN_VALUE + 1;\r\n\t\t\r\n\t\t}else{\r\n\t\t\tthrow new IllegalStateException(\"unknown game state: \"+gameState);\r\n\t\t}\r\n\t}",
"private static double score(char piece, State state, int row, int col) {\n\t\treturn upScore(piece, state, row, col) + upRightScore(piece, state, row, col) + rightScore(piece, state, row, col) +\n\t\t\t\tdownRightScore(piece, state, row, col) + downScore(piece, state, row, col) + downLeftScore(piece, state, row, col) + \n\t\t\t\tleftScore(piece, state, row, col) + upLeftScore(piece, state, row, col);\n\t}",
"public int evaluate (Player p) {\r\n\t\t/* Adding players hand and the cards from the game board */\r\n\t\t\r\n\t\tfor (Card c: p.hand) {\r\n\t\t\tcards.add(c);\r\n\t\t}\r\n\t\tfor (Card c: board) {\r\n\t\t\tcards.add(c);\r\n\t\t}\r\n\t\t/*Return the value based on the card evaluated. Will check in\r\n\t\t * order to the strength of the hand starting from the \r\n\t\t * strongest hand in order to avoid overlapping between certain \r\n\t\t * hands. (Ex. Three pair includes two pair but three pair will be \r\n\t\t * checked first)*/\r\n\t\tif (hasRoyalFlush(cards)) \r\n\t\t\treturn ROYALFLUSH;\r\n\t\t else if (hasStraightFlush(cards)) \r\n\t\t\treturn STRAIGHTFLUSH;\r\n\t\t else if (hasQuads(cards)) \r\n\t\t\treturn QUADS;\r\n\t\t else if (hasFlush(cards)) \r\n\t\t\treturn FLUSH;\r\n\t\t else if (hasStraight(cards)) \r\n\t\t\treturn STRAIGHT;\r\n\t\t else if (hasSet(cards)) \r\n\t\t\treturn SET;\r\n\t\t else if (hasTwoP(cards)) \r\n\t\t\treturn TWOPAIR;\r\n\t\t else if (hasPair(cards)) \r\n\t\t\treturn PAIR;\r\n\t\t else \r\n\t\t\treturn HIGHCARD;\r\n\t\t\r\n\t}",
"public int getGrade(char type, int num)\n\t{\n\t\tint iGrade;\n\t\tswitch(type)\n\t\t{\n\t\t\tcase 'q':\n\t\t\tcase 'Q':\n\t\t\t\tif(quizzesGraded>=num)\n\t\t\t\t{\n\t\t\t\t\tswitch(num)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\tiGrade=quiz1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tiGrade=quiz2;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\tiGrade=quiz3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\tiGrade=quiz4;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\tiGrade=quiz5;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\tcase 'p':\n\t\t\tcase 'P':\n\t\t\t\tif(projGraded>=num)\n\t\t\t\t{\n\t\t\t\t\tswitch(num)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\tiGrade=proj1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tiGrade=proj2;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\tiGrade=proj3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\tiGrade=proj4;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\tcase 'T':\n\t\t\t\tif(testGraded>=num)\n\t\t\t\t{\n\t\t\t\t\tswitch(num)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\tiGrade=test1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tiGrade=test2;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\tiGrade=test3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\t\tif(recordedFinalExam==true)\n\t\t\t\t{\n\t\t\t\tiGrade=finalExam;\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiGrade=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tiGrade= -1;\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn iGrade;\n\t}",
"public String getPieceType() {\n return pieceType;\n }",
"float getEvaluationResult();",
"int getScoreValue();",
"public float evaluate(PhraseInfo p) {\n int numChords = p.gen.prog.get(p.gen.progIndex).size();\n int tn = Math.min(phraseLen, (int)Math.round(targetNotes * ((numChords + 1) / 3.0))); // not directly proportional.\n // scores: 50, 49, 46, 41, 34, 25 etc.\n int score = Math.max(0, 50 - (int)Math.round(Math.pow(Math.abs(p.noteCount - tn), 2)));\n return (float)Math.min(1.0f, score/50.0f);\n }",
"public double average(char type)\n\t{\n\t\tdouble dAverage;\n\t\tswitch(type)\n\t\t{\n\t\t\tcase 't':\n\t\t\tcase 'T':\n\t\t\t\tswitch(testGraded)\n\t\t\t\t{\t\n\t\t\t\t\tcase 1: \n\t\t\t\t\t\tdAverage=test1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdAverage= ((1.0 * test1 + test2)/2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdAverage= ((1.0 * test1 + test2 + test3)/3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdAverage=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\tcase 'Q':\n\t\t\t\tswitch(quizzesGraded)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tdAverage=quiz1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdAverage= ((1.0 * quiz1 + quiz2)/2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdAverage= ((1.0 * quiz1 + quiz2 + quiz3)/3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdAverage= ((1.0 * quiz1 + quiz2 + quiz3 + quiz4)/4);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tdAverage= ((1.0 * quiz1 + quiz2 + quiz3 + quiz4 + quiz5)/5);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdAverage=-1;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\tcase 'P':\n\t\t\t\tswitch(projGraded)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tdAverage=(proj1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdAverage=((1.0 * proj1 + proj2)/2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdAverage=((1.0 * proj1 + proj2 + proj3)/3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdAverage=((1.0 * proj1 + proj2 + proj3 + proj4)/4);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdAverage=-1;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdAverage=-1;\n\t\t\t\n\t\t}\n\t\treturn dAverage;\n\t}",
"public PieceType getPieceType() {\r\n\t\treturn piece;\r\n\t}",
"public Integer getEvaluate() {\n return evaluate;\n }",
"public abstract float getScore();",
"public void setPieceType(String type) {\n pieceType = type;\n }",
"int getScore();",
"float getScore();",
"float getScore();",
"public abstract double evaluate(Point p);",
"Float getScore();",
"protected abstract void calcScores();",
"int getEvaluations();",
"@Override\r\n\tpublic BoardEvaluation evaluate(IBoard board, PlayerColor color) {\n\t\tBoardAnalyzer analyzer = board.getAnalyzer();\r\n\r\n\t\tBoardEvaluation e = new BoardEvaluation();\r\n\r\n\t\tint white = 0;\r\n\t\tint black = 0;\r\n\r\n\t\tList<IPiece> pieces = board.getAllPieces();\r\n\r\n\t\tint[] pawnCount = new int[2];\r\n\t\tint[] bishopCount = new int[2];\r\n\t\tint[] knightCount = new int[2];\r\n\t\tfor (IPiece piece : pieces) {\r\n\t\t\tif (piece.getColor() == PlayerColor.WHITE) {\r\n\t\t\t\twhite += piece.getPieceValue();\r\n\t\t\t} else {\r\n\t\t\t\tblack += piece.getPieceValue();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint index = piece.getColor().ordinal();\r\n\t\t\tif (piece instanceof Pawn) {\r\n\t\t\t\tpawnCount[index]++;\r\n\t\t\t} else if (piece instanceof Bishop) {\r\n\t\t\t\tbishopCount[index]++;\r\n\t\t\t} else if (piece instanceof Knight) {\r\n\t\t\t\tknightCount[index]++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint totalPieceValue = white + black;\r\n\t\tint blackIndex = PlayerColor.BLACK.ordinal();\r\n\t\tint whiteIndex = PlayerColor.WHITE.ordinal();\r\n\t\tblack += extraBishopValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraKnightValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraPawnValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\twhite += extraBishopValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraKnightValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraPawnValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\r\n\t\t// Stalemate\r\n\t\tif (analyzer.isStalemate()) {\r\n\t\t\te.draw = true;\r\n\t\t\tblack += 90;\r\n\t\t} else if (analyzer.canClaimDraw()) {\r\n\t\t\tif (board.getTurn() == PlayerColor.WHITE) {\r\n\t\t\t\t// White can stop black from claiming draw\r\n\t\t\t\t//black += 50;\r\n\t\t\t} else {\r\n\t\t\t\t// Black can claim draw immediately!\r\n\t\t\t\te.draw = true;\r\n\t\t\t\tblack += 4;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Checkmate ?\r\n\t\tif (analyzer.isCheckmate(PlayerColor.BLACK)) {\r\n\t\t\twhite += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (analyzer.isCheckmate(PlayerColor.WHITE)) {\r\n\t\t\tblack += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (color == null) {\r\n\t\t\te.value = white - black;\r\n\t\t} else if (color == PlayerColor.BLACK) {\r\n\t\t\te.value = Math.abs(white - FULL_BOARD_VALUE);\r\n\t\t} else {\r\n\t\t\te.value = Math.abs(black - FULL_BOARD_VALUE);\r\n\t\t}\r\n\r\n\t\treturn e;\r\n\t}",
"private double getScore() {\n double score = 0;\n score += getRBAnswers(R.id.radiogroup1, R.id.radiobutton_answer12);\n score += getRBAnswers(R.id.radiogroup2, R.id.radiobutton_answer21);\n score += getRBAnswers(R.id.radiogroup3, R.id.radiobutton_answer33);\n score += getRBAnswers(R.id.radiogroup4, R.id.radiobutton_answer41);\n score += getCBAnswers();\n score += getTextAns();\n score = Math.round(score / .0006);\n score = score / 100;\n return score;\n }",
"protected abstract int evaluate(GameState state, String playername);",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"int definePassingScore(Speciality speciality) throws LogicException;",
"private double individualEvaluation() {\n\t\t//System.out.println(\"indE\"+ myValues.get(myAction.getPurpose()).getStrength(null));\n\t\treturn myValues.get(myAction.getPurpose()).getStrength(null);\n\t}",
"private String runRecommendation(LeagueOfLegendsAccount account, String difficultyLevel) {\r\n if (difficultyLevel.equals(\"Beginner\")) {\r\n return championRecommendation(account, \"Beginner\");\r\n } else if (difficultyLevel.equals(\"Novice\")) {\r\n return championRecommendation(account, \"Novice\");\r\n } else if (difficultyLevel.equals(\"Advanced\")) {\r\n return championRecommendation(account, difficultyLevel);\r\n } else {\r\n return \"Not an existing classification of difficulty (Beginner, Novice, Advanced)\";\r\n }\r\n }",
"private double retrieveScore(Job job, Worker worker) {\n\t\tdouble score = 0;\n\t\t// Compute drivers license criteria\n\t\tscore += new BooleanCriteria(true, worker.isDriversLicense()).getScore();\n\t\t// Compute certificates criteria\n\t\tscore += new ListCriteria<String>(job.getRequiredCertificates(), worker.getCertificates()).getScore();\n\t\t// Compute location criteria\n\t\tscore += new LocationCriteria(job.getLocation(), worker.getJobSearchAddress(), worker.getJobSearchAddress().getMaxJobDistance()).getScore();\n\t\treturn score;\n\t}",
"public int addGrade(char type, int grade)\n\t{\n\t\tint iVal;\n\t\tswitch(type)\n\t\t{\n\t\t\tcase 'q':\n\t\t\tcase 'Q':\n\t\t\t\tif(quizzesGraded <= 4)\n\t\t\t\t{\n\t\t\t\t\tswitch(quizzesGraded)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tquiz1 = grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.quizzesGraded = quizzesGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tquiz2=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.quizzesGraded = quizzesGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: \n\t\t\t\t\t\t\tquiz3=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.quizzesGraded = quizzesGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tquiz4=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.quizzesGraded = quizzesGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tquiz5=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.quizzesGraded = quizzesGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tiVal=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiVal=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\tcase 'P':\n\t\t\t\tif(projGraded<4)\n\t\t\t\t{\n\t\t\t\t\tswitch(projGraded)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tproj1=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.projGraded = projGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tproj2=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.projGraded = projGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tproj3=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.projGraded = projGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tproj4=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.projGraded = projGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tiVal=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiVal=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\tcase 'T':\n\t\t\t\tif(testGraded<3)\n\t\t\t\t{\n\t\t\t\t\tswitch(testGraded)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\ttest1=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.testGraded = testGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\ttest2=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.testGraded = testGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\ttest3=grade;\n\t\t\t\t\t\t\tiVal=0;\n\t\t\t\t\t\t\tthis.testGraded = testGraded+=1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tiVal=-1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiVal=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\t\tif(recordedFinalExam==false)\n\t\t\t\t{\n\t\t\t\t\tfinalExam=grade;\n\t\t\t\t\tthis.recordedFinalExam=true;\n\t\t\t\t\tiVal=0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiVal=-1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tiVal=-1;\n\t\t}\n\t\treturn iVal;\n\t}",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getScore();",
"int score();",
"int score();",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"public double getBestScore();",
"public String getType() {\n\t\treturn String.valueOf(this.pieceType);\n\t}",
"@Override\r\n public Evaluation getEvaluation ()\r\n {\r\n return evaluation;\r\n }",
"public int getScore() {\n return getStat(score);\n }",
"@Override\r\n\tpublic double evaluate(int[][] board, int currentPlayer) {\n\t\r\n\tdouble score;\t\r\n\tfinal int RANDOM_WEIGHT=5; // weight factor\r\n\t\r\n\tMaximumDisksEvaluation ob = new MaximumDisksEvaluation();\r\n\tCornerEvaluation ob1 = new CornerEvaluation();\r\n\tCornerClosenessEvaluation ob2 = new CornerClosenessEvaluation();\r\n\tFrontierEvaluation ob3 = new FrontierEvaluation();\r\n\tStabilityEvaluation ob4 = new StabilityEvaluation();\r\n\tPositionalEvaluation ob5 = new PositionalEvaluation();\r\n\tMobilityEvaluation ob6 = new MobilityEvaluation();\r\n\t\r\n\tscore = ob.evaluate(board, currentPlayer) + ob1.evaluate(board, currentPlayer) + ob2.evaluate(board, currentPlayer) + ob6.evaluate(board, currentPlayer) + ob3.evaluate(board, currentPlayer) + ob5.evaluate(board, currentPlayer) ; \r\n\t\r\n\treturn score;\r\n\t\r\n\t}",
"@Test\n public void testScoreUpdate() {\n try {\n final BestEvalScore score = new BestEvalScore(\"thjtrfwaw\");\n double expected = 0;\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n final Evaluation eval = new Evaluation(2);\n eval.eval(0,1);\n eval.eval(1,1);\n\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(0,1);\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(1,1);\n eval.eval(1,1);\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to create instance!\", e);\n }\n\n\n }",
"private int getScoreForPiecePosition(int row, int column) {\r\n\t\tbyte[][] positionWeight =\r\n\t\t{ {1,1,1,1,1,1,1,1}\r\n\t\t ,{2,2,2,2,2,2,2,2}\r\n\t\t ,{2,2,3,3,3,3,2,2}\r\n\t\t ,{2,2,3,4,4,3,2,2}\r\n\t\t ,{2,2,3,4,4,3,2,2}\r\n\t\t ,{2,2,3,3,3,3,2,2}\r\n\t\t ,{2,2,2,2,2,2,2,2}\r\n\t\t ,{1,1,1,1,1,1,1,1}\r\n\t\t };\r\n\t\treturn positionWeight[row][column];\r\n\t}",
"private double evaluate() {\n // check for draws first, most lickely\n if (board.gameState() == MNKGameState.DRAW) return 0;\n else if (board.gameState() == MY_WIN) return 2 * M * N; // 2 times max depth\n else if (board.gameState() == ENEMY_WIN) return -2 * M * N;\n else {\n evaluated++;\n // keep the heuristic evaluation between 1 and -1\n return board.value();\n }\n }",
"public int getScore()\n {\n return points + extras;\n }",
"public int getMaterialScore(PieceColor color) {\n \tint score = 0;\n \tArrayList<Piece> pieces = getPieces(color);\n \tfor(int i = 0; i < pieces.size(); ++i) {\n \t\tscore += pieces.get(i).getValue();\n \t}\n \t\n \treturn score;\n }",
"public int evalPref(Schedule sched) {\n\t\t\n\t\tint failCount = 0;\n\t\tint index = -1;\n\t\tCourse workingCourse;\n\t\tLab workingLab;\n\t\tint testCount = 0;\n\t\t\n\t\t\n\t\tfor(int i = 0;i<preferences.size();i++)\n\t\t{\n\t\t\tindex = preferences.get(i).getY().getIndex();\n\t\t\t\n\t\t\tif(preferences.get(i).getY().getClass() == Course.class) //is a course\n\t\t\t{\n\t\t\t\tworkingCourse = sched.getCourses().get(index);\n\t\t\t\t\n\t\t\t\tif(workingCourse.getSlot() != preferences.get(i).getX())\n\t\t\t\t{\n\t\t\t\t\tfailCount += preferences.get(i).getZ();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //is a lab\n\t\t\t{\n\t\t\t\tworkingLab = sched.getLabs().get(index);\n\t\t\t\t\n\t\t\t\tif(workingLab.getSlot() != preferences.get(i).getX())\n\t\t\t\t{\n\t\t\t\t\tfailCount += preferences.get(i).getZ();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\ttestCount += preferences.get(i).getZ();\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(testCount);\n\t\treturn failCount;\n\t\t\n\t\t/*\n\t\tArrayList<Course> uniqueCourses = new ArrayList<Course>();\n\t\tArrayList<Course> uniqueLabs = new ArrayList<Course>();\n\t\t\n\t\tArrayList<Pair<Course, Integer>> cRunningTotals = new ArrayList<Pair<Course, Integer>>();\n\t\tArrayList<Pair<Course, Integer>> lRunningTotals = new ArrayList<Pair<Course, Integer>>();\n\t\t\n\t\tArrayList<Course> cHasPrefMet = new ArrayList<Course>();\t\n\t\tArrayList<Lab> lHasPrefMet = new ArrayList<Lab>();\n\t\t\n\t\tboolean continueChecking = true;\n\t\tCourse prefCourse, workingCourse;\n\t\tLab prefLab, workingLab;\n\t\tTimeSlot prefTimeSlot, workingTimeSlot;\n\t\tint prefValue;\n\t\tint totalToReturn = 0;\n\t\t\n\t\t//Traverse through preferences to find the unique courses and labs\n\t\t//because each lab and course can have more than one \n\t\tfor(int i = 0;i<preferences.size();i++)\n\t\t{\n\t\t\tif(preferences.get(i).getY().getClass() == Course.class)//working with a course\n\t\t\t{\n\t\t\t\tif(!uniqueCourses.contains(preferences.get(i).getY()))\n\t\t\t\t{\n\t\t\t\t\tuniqueCourses.add(preferences.get(i).getY());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //working with a class\n\t\t\t{\n\t\t\t\tif(!uniqueLabs.contains((Lab) preferences.get(i).getY()))\n\t\t\t\t{\n\t\t\t\t\tuniqueLabs.add((Lab)preferences.get(i).getY());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Now have two lists that contains all the unique courses and labs\n\t\t//-----\n\t\t\n\n\t\tfor(int i = 0; i<uniqueCourses.size();i++)\n\t\t{\n\t\t\tcRunningTotals.add(new Pair<Course, Integer>(uniqueCourses.get(i), 0));\n\t\t}\n\t\t\n\n\t\tfor(int i = 0; i<uniqueLabs.size();i++)\n\t\t{\n\t\t\tlRunningTotals.add(new Pair<Course, Integer>(uniqueLabs.get(i), 0));\n\t\t}\n\t\t\n\t\t//Have a running total pair for each unique course\n\t\t//When we find one that meets a single preference\n\t\t//then set that total to zero and don't change it anymore \n\t\t\n\t\t//Go through the preferences check if they are upheld\n\t\tfor(int i = 0; i<preferences.size();i++)\n\t\t{\n\t\t\tprefTimeSlot = preferences.get(i).getX();\n\t\t\tprefValue = preferences.get(i).getZ();\n\t\t\tcontinueChecking = true;\n\t\t\t\n\t\t\t//If it's a lab, if not, must be a class\n\t\t\tif(preferences.get(i).getY().getClass() == Lab.class)\n\t\t\t{\n\t\t\t\tprefLab = (Lab) preferences.get(i).getY();\n\t\t\t\t\n\t\t\t\t//Want to check if we have met a preference for this course already\n\t\t\t\t//If we have, we don't need to do a check for this preference s\n\t\t\t\tfor(int j = 0;j<lHasPrefMet.size();j++)\n\t\t\t\t{\n\t\t\t\t\tif(prefLab.equals(lHasPrefMet.get(j)))\n\t\t\t\t\t\tcontinueChecking = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(continueChecking == true)\n\t\t\t\t{\n\t\t\t\t\t//Have to find this lab in the schedule and look to see if\n\t\t\t\t\t//it's in the correct time slot\nA:\t\t\t\t\tfor(int j = 0;j<sched.getLabs().size();j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tworkingLab = sched.getLabs().get(j);\n\t\t\t\t\t\tworkingTimeSlot = workingLab.getSlot();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(workingLab.equals(prefLab))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif((workingTimeSlot.getDay().equals(prefTimeSlot.getDay())) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getStartTime() == prefTimeSlot.getStartTime()) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getMaxNum() == prefTimeSlot.getMaxNum())\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//If we met the pref, we add it so this course won't be \n\t\t\t\t\t\t\t\t//checked again cause a course can have more than 1 pref. and\n\t\t\t\t\t\t\t\t//Obviously not all can be met\n\t\t\t\t\t\t\t\tlHasPrefMet.add(workingLab);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Find this lab in lRunningTotals and set it to zero\n\t\t\t\t\t\t\t\t\nX:\t\t\t\t\t\t\t\tfor(int k = 0; k<lRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLab temp;\n\t\t\t\t\t\t\t\t\ttemp = (Lab) lRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingLab))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlRunningTotals.set(k, new Pair<Course, Integer>(prefLab, 0));\n\t\t\t\t\t\t\t\t\t\tbreak X;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak A;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//The lab did not meet the preferences being tested\n\t\t\t\t\t\t\t\t//so we need to add it's prefValue to the total for \n\t\t\t\t\t\t\t\t//that unique course\nQ:\t\t\t\t\t\t\t\tfor(int k = 0; k<lRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLab temp;\n\t\t\t\t\t\t\t\t\tint tempTotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttempTotal = lRunningTotals.get(k).getValue();\n\t\t\t\t\t\t\t\t\ttemp = (Lab) lRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingLab))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlRunningTotals.set(k, new Pair<Course, Integer>(prefLab, tempTotal + prefValue));\n\t\t\t\t\t\t\t\t\t\tbreak Q;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak A;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//SO, they are the same class, now check time slot and break out\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //If the preference is talking about a course\n\t\t\t{\n\n\t\t\t\tprefCourse = preferences.get(i).getY();\n\t\t\t\t//Want to check if we have met a preference for this course already\n\t\t\t\tfor(int j = 0;j<cHasPrefMet.size();j++)\n\t\t\t\t{\n\t\t\t\t\tif(prefCourse.equals(cHasPrefMet.get(j)))\n\t\t\t\t\t\tcontinueChecking = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(continueChecking == true)\n\t\t\t\t{\n\t\t\t\t\t//Have to find this course in the schedule and look to see if\n\t\t\t\t\t//it's in the correct time slot\nB:\t\t\t\t\tfor(int j = 0;j<sched.getCourses().size();j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tworkingCourse = sched.getCourses().get(j);\n\t\t\t\t\t\tworkingTimeSlot = workingCourse.getSlot();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(workingCourse.equals(prefCourse))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tSystem.out.print(workingCourse.getDepartment());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingCourse.getNumber());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingCourse.getSection());\n\t\t\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.print(workingTimeSlot.getDay());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingTimeSlot.getStartTime());\n\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tSystem.out.print(prefTimeSlot.getDay());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + prefTimeSlot.getStartTime());\n\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((workingTimeSlot.getDay().equals(prefTimeSlot.getDay())) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getStartTime() == prefTimeSlot.getStartTime()) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getMaxNum() == prefTimeSlot.getMaxNum())\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t//Same ideas as when doing labs\n\t\t\t\t\t\t\t\tcHasPrefMet.add(workingCourse);\nY:\t\t\t\t\t\t\t\tfor(int k = 0; k<cRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tCourse temp;\n\t\t\t\t\t\t\t\t\ttemp = cRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingCourse))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcRunningTotals.set(k, new Pair<Course, Integer>(prefCourse, 0));\n\t\n\t\t\t\t\t\t\t\t\t\tbreak Y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak B;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\nP:\t\t\t\t\t\t\t\tfor(int k = 0; k<cRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tCourse temp;\n\t\t\t\t\t\t\t\t\tint tempTotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttempTotal = cRunningTotals.get(k).getValue();\n\t\t\t\t\t\t\t\t\ttemp = cRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingCourse))\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcRunningTotals.set(k, new Pair<Course, Integer>(prefCourse, tempTotal + prefValue));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tbreak P;\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak B;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add up our fail totals\n\t\tfor(int i = 0;i<cRunningTotals.size();i++)\n\t\t{\n\t\t\ttotalToReturn += cRunningTotals.get(i).getValue();\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0;i<lRunningTotals.size();i++)\n\t\t{\n\t\t\ttotalToReturn += lRunningTotals.get(i).getValue();\n\t\t}\n\t\t\n\t\t\n\t\treturn totalToReturn;\n\t\t\n\t\t*/\n\t}",
"public static int ratePieceAvailability(){\n\t\tint rating=0, bishopCount=0;\n for (int i=0;i<64;i++) {\n switch (AlphaBeta.chessBoard[i/8][i%8]) {\n case \"P\": rating+=100;\n break;\n case \"R\": rating+=500;\n break;\n case \"K\": rating+=300;\n break;\n case \"B\": bishopCount++;\n break;\n case \"Q\": rating+=900;\n break;\n }\n }\n if (bishopCount>=2) {\n \trating+=300*bishopCount;\n } else {\n if (bishopCount==1) {rating+=250;}\n }\n return rating;\n\t}",
"@Override\r\n public double getGrade ()\r\n {\r\n if (evaluation != null) {\r\n return evaluation.grade;\r\n } else {\r\n // No real interest\r\n return Evaluation.ALGORITHM;\r\n }\r\n }",
"public String getSpecScore(int specScore, int scoreType)\r\n throws ULMSSysException\r\n {\r\n return codeMaintainDAO.getSpecScore(specScore, scoreType);\r\n }",
"public Const evaluate();",
"int calculatePoints(IYatzyHand hand, HandType type);",
"abstract String getScoreString();",
"public String getEvaluate() {\r\n return evaluate;\r\n }",
"public int getInstabilityScore();",
"public String getEvaluate() {\n return evaluate;\n }",
"public int evaluateAsInt();",
"int givePropScore(int propSize, int crownNum) throws Exception;",
"public ResourceMap getPromoteKnightCost(ProgressCardType type) {\n ResourceMap costWithSmith = new ResourceMap();\n if (type == ProgressCardType.SMITH){\n costWithSmith.put(ResourceKind.GRAIN, 0);\n return costWithSmith;\n }\n\n return promoteKnightCost;\n }",
"private static ResultsObject evaluateWinner(String player1Choice, String player2Choice, String player1Type) {\n if (player1Choice == player2Choice) {\n return setDisplayMessage(\"It is a tie!\", \"\", player2Choice, player1Choice, player1Type);\n } else {\n switch (player1Choice) {\n case \"ROCK\":\n if (player2Choice == \"SCISSORS\") {\n return setDisplayMessage(\"Player 1 wins!\", Weapon.WeaponMessages.ROCK.message, player2Choice, player1Choice, player1Type);\n } else {\n return setDisplayMessage(\"Player 2 wins!\", Weapon.WeaponMessages.PAPER.message, player2Choice, player1Choice, player1Type);\n }\n case \"PAPER\":\n if (player2Choice == \"ROCK\") {\n return setDisplayMessage(\"Player 1 wins!\", Weapon.WeaponMessages.PAPER.message, player2Choice, player1Choice, player1Type);\n } else {\n return setDisplayMessage(\"Player 2 wins!\", Weapon.WeaponMessages.SCISSORS.message, player2Choice, player1Choice, player1Type);\n }\n case \"SCISSORS\":\n if (player2Choice == \"PAPER\") {\n return setDisplayMessage(\"Player 1 wins!\", Weapon.WeaponMessages.SCISSORS.message, player2Choice, player1Choice, player1Type);\n } else {\n return setDisplayMessage(\"Player 2 wins!\", Weapon.WeaponMessages.ROCK.message, player2Choice, player1Choice, player1Type);\n }\n default:\n return setDisplayMessage(\"Please enter: ROCK - PAPER - SCISSORS\", \"\", \"\", \"\", player1Type);\n }\n }\n }",
"public int evaluate() {\n\t\treturn history + heuristic;\n\t}",
"Result evaluate();",
"public double getScore() {\r\n return score;\r\n }",
"protected double eval(S state, P player) {\n if (game.isTerminal(state)) {\n return game.getUtility(state, player);\n } else {\n heuristicEvaluationUsed = true;\n return (utilMin + utilMax) / 2;\n }\n }",
"int getCriterionTypeValue();",
"public PracticeResult getHighestGradingByMember(Member member, String practiceType);",
"@Override\r\n\tpublic double getScore() {\n\t\treturn score;\r\n\t}",
"public double getPercent(char type)\n\t{\n\t\tdouble dPercent;\n\t\tswitch(type)\n\t\t{\n\t\t\tcase 'q':\n\t\t\tcase 'Q':\n\t\t\t\tdPercent=pctQ;\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\tcase 'P':\n\t\t\t\tdPercent=pctP;\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\tcase 'T':\n\t\t\t\tdPercent=pctT;\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\t\tdPercent=pctF;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdPercent= -1;\n\t\t}\n\t\treturn dPercent;\n\t\t\n\t}",
"public TypeCheckerProofRule getRule ( ) ;",
"public double evaluateLevel(Level level)\n\t{\n\t\treturn 1.0;\n\t}",
"private double evalState(LabyrinthGameState state) {\n double score = 0;\n\n //Assign Percentages of Score\n final double treasureValTotal = 80; //Based on number of treasures left\n final double nearTreasureValTotal = 15; //Based on proximity to treasure\n final double typeTileValTotal = 1; //Based on which tile you are on\n final double numberOfConnectionsValTotal = 4; //Based on how many places you can move\n\n double treasureVal = 0;\n double nearTreasureVal = 0;\n double typeTileVal = 0;\n double numberOfConnectionsVal = 0;\n\n //calculating your treasure points\n treasureVal = (6.0 - (double)(state.getPlayerDeckSize(\n Player.values()[playerNum])))/6.0*treasureValTotal;\n\n int [] yourPos = state.getPlayerLoc(Player.values()[playerNum]).getLoc();\n int [] treasurePos = state.findTreasureLoc(Player.values()[playerNum]);\n if (treasurePos[0] == -1) {\n nearTreasureVal = (10.0 - findDistance(yourPos, findHome()))\n / 10.0 * nearTreasureValTotal;\n } else {\n nearTreasureVal = (10.0 - findDistance(yourPos, treasurePos))\n / 10.0 * nearTreasureValTotal;\n }\n\n //calculating points for the type of tile it can end on\n switch (state.getPlayerLoc(Player.values()[playerNum]).getType()) {\n case STRAIGHT:\n typeTileVal = 5.0 / 10.0 * typeTileValTotal;\n break;\n case INTERSECTION:\n typeTileVal = typeTileValTotal;\n break;\n default:\n typeTileVal = 3.0 / 10.0 * typeTileValTotal;\n break;\n }\n\n //calculating points based on # of connections created\n numberOfConnectionsVal = ((double)generatePossibleMoveActions(state).size()\n /49.0*numberOfConnectionsValTotal);\n\n //calculating final score\n score = (treasureVal + nearTreasureVal +\n typeTileVal + numberOfConnectionsVal)/100.0;\n\n return score;\n }",
"public static char typeScore() \n {\n\n System.out.println(\"\\t Do you have (S)AT scores or (A)CT scores?\");\n String response = console.next();\n \n if(response.equalsIgnoreCase(\"S\"))\n {\n return Character.toUpperCase(response.charAt(0)); \n }\n else if(response.equalsIgnoreCase(\"A\"))\n {\n return Character.toUpperCase(response.charAt(0));\n }\n else\n {\n throw new IllegalArgumentException(\"Invalid score type. Must be S, s, A, or a.\");\n }\n }",
"public List<Pair<T>> computeRating(List<Pair<T>> samples,int ratingType){\n\t\treturn RatingFunction.getInstance().compute(samples, ratingType,level);\n\t}",
"public int checkPiece(String colour, char type) {\n\t\tint location = -1;\n\t\tfor (Piece p : this.getPieces()) {\n\t\t\tlocation ++;\n\t\t\tif (p.getColour().equals(colour)) {\n\t\t\t\tif (p.getType() == type) {\n\t\t\t\t\treturn location;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"protected abstract List<Double> calcScores();",
"public double getScore() {\n double compositeScore = this.normaliseViewingTime();\n if (this.normalisedRating > 0) {\n compositeScore *= this.normalisedRating;\n }\n else {\n compositeScore *= ((double)RANGE / (double)2) / (double)RANGE;\n }\n return compositeScore;\n }",
"public long getScoreEssay(Essay essay, String answer)\n {\n return 0;\n }",
"public Text getScore() {\n \treturn T;\n }",
"@Test\n public void typeTest() {\n assertTrue(red_piece.getType() == Piece.Type.SINGLE);\n red_piece.king();\n assertTrue(red_piece.getType() == Piece.Type.KING);\n assertTrue(white_piece.getType() == Piece.Type.SINGLE);\n }",
"protected abstract Value evaluate();",
"public static int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"private synchronized void evaluate(int indexOfInterest) {\r\n\r\n switch (indexOfInterest) {\r\n case 0: //evaluating values on the X axis\r\n if ((Math.abs(peakValue) >= 1.3) && (Math.abs(peakValue) <= 3.2) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.2) && (Math.abs(peakValue) <= 4.2) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 4.2) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n\r\n case 1: //evaluating values on the Y axis\r\n if (event.getEventType().equals(DrivingEventType.BRAKE)) {\r\n if ((Math.abs(peakValue) >= 1.75) && (Math.abs(peakValue) <= 3.3) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && (Math.abs(peakValue) <= 5.5) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 5.5) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n } else if (event.getEventType().equals(DrivingEventType.ACCELERATION)) {\r\n if ((Math.abs(peakValue) >= 0.9) && (Math.abs(peakValue) <= 2.5) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 2.5) && (Math.abs(peakValue) <= 3.3) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n }\r\n }\r\n }",
"public int score() {\n return score;\n }",
"public static int getScore()\n {\n return score;\n }",
"public int score() {\n return hand.handVal(0);\n }",
"private String[] evaluate()\n {\n //there must be some recommender selected by the user on the UI\n if (selectedRecommenderPanel.getObject() == null\n || selectedRecommenderPanel.getObject().getTool() == null) {\n LOG.error(\"Please select a recommender from the list\");\n return null;\n }\n\n //get all the source documents related to the project\n Map<SourceDocument, AnnotationDocument> listAllDocuments = documentService\n .listAllDocuments(project, userDao.getCurrentUser());\n\n //create a list of CAS from the pre-annotated documents of the project\n List<CAS> casList = new ArrayList<>();\n listAllDocuments.forEach((source, annotation) -> {\n try {\n CAS cas = documentService.createOrReadInitialCas(source);\n casList.add(cas);\n }\n catch (IOException e1) {\n LOG.error(\"Unable to render chart\", e1);\n return;\n }\n });\n \n IncrementalSplitter splitStrategy = new IncrementalSplitter(TRAIN_PERCENTAGE,\n INCREMENT, LOW_SAMPLE_THRESHOLD);\n\n @SuppressWarnings(\"rawtypes\")\n RecommendationEngineFactory factory = recommenderRegistry\n .getFactory(selectedRecommenderPanel.getObject().getTool());\n RecommendationEngine recommender = factory.build(selectedRecommenderPanel.getObject());\n \n if (recommender == null) {\n LOG.warn(\"Unknown Recommender selected\");\n return null;\n }\n \n if (!evaluate) {\n return getEvaluationScore(evaluationResults);\n }\n\n evaluationResults = new ArrayList<EvaluationResult>();\n \n // create a list of comma separated string of scores from every iteration of\n // evaluation.\n while (splitStrategy.hasNext()) {\n splitStrategy.next();\n\n try {\n EvaluationResult evaluationResult = recommender.evaluate(casList, splitStrategy);\n \n if (evaluationResult.isEvaluationSkipped()) {\n LOG.warn(\"Evaluation skipped. Chart cannot to be shown\");\n continue;\n }\n\n evaluationResults.add(evaluationResult);\n }\n catch (RecommendationException e) {\n LOG.error(e.toString(),e);\n continue;\n }\n }\n\n return getEvaluationScore(evaluationResults);\n }",
"public static int getScore()\n\t{\n\t\treturn score;\n\t}",
"private Player getPlayerFromType(String type, Piece piece) {\n if (type.equalsIgnoreCase(\"human\")) {\n return new Human(this.project, piece);\n } else if (type.equalsIgnoreCase(\"random\")) {\n return new Random(this.project, piece);\n } else if (type.equalsIgnoreCase(\"bad\")) {\n return new Bad(this.project, piece);\n }\n return new Good(this.project, piece);\n }",
"static void scoreSkunkRoll(SkunkType type, int kitty, Player activePlayer) { //refactored: Extract Method to remove duplicate scoring code\n\t\tint chipChange = 0;\n\t\tswitch(type) {\n\t\t\tcase SINGLE_SKUNK:\n\t\t\t\tchipChange = 1;\n\t\t\t\tbreak;\n\t\t\tcase DOUBLE_SKUNK:\n\t\t\t\tchipChange = 4;\n\t\t\t\tbreak;\n\t\t\tcase DEUCE_SKUNK:\n\t\t\t\tchipChange = 2;\n\t\t\t\tbreak;\n\t\t}\n\t\tkitty += chipChange;\n\t\tactivePlayer.setNumberChips(activePlayer.getNumberChips() - chipChange);\n\t\tactivePlayer.setTurnScore(0);\n\t\tif(type == SkunkType.DOUBLE_SKUNK) {\n\t\t\tactivePlayer.setRoundScore(0);\n\t\t}\n\t}",
"public Double getScore() {\n return this.score;\n }",
"public Double getScore() {\n return this.score;\n }",
"public abstract double evaluer(SolutionPartielle s);",
"public int getPiece() {\n return piece;\n }",
"public abstract double evaluateFitness();",
"public char calculate() {\n int average = java.util.stream.IntStream.of(testScores).sum() / testScores.length;\n return Grades.getGrade(average);\n }",
"public int getScore()\n {\n // put your code here\n return score;\n }",
"@java.lang.Override\n public speech.multilang.Params.DecisionPointParams.Type getType() {\n @SuppressWarnings(\"deprecation\")\n speech.multilang.Params.DecisionPointParams.Type result = speech.multilang.Params.DecisionPointParams.Type.valueOf(type_);\n return result == null ? speech.multilang.Params.DecisionPointParams.Type.UNKNOWN : result;\n }",
"public double getScore() {\r\n return mScore;\r\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.ScoreAnalysis getScoreAnalysis();",
"private String determinePieceType(Piece p) {\n\t\tif (p.isShield()) {\n\t\t\treturn \"shield\";\n\t\t} else if (p.isBomb()) {\n\t\t\treturn \"bomb\";\n\t\t} else {\n\t\t\treturn \"pawn\";\n\t\t}\n\t}"
] | [
"0.60220385",
"0.59144837",
"0.58513623",
"0.57892454",
"0.5725882",
"0.5678074",
"0.5666949",
"0.56345093",
"0.5575285",
"0.55702776",
"0.55605596",
"0.55164313",
"0.5503031",
"0.5477546",
"0.54682535",
"0.54682535",
"0.543971",
"0.5435749",
"0.54044",
"0.5398982",
"0.53910846",
"0.53606254",
"0.5359062",
"0.5342357",
"0.5342357",
"0.5342357",
"0.5342357",
"0.53238",
"0.5319968",
"0.53174394",
"0.531731",
"0.5287723",
"0.52562475",
"0.52517056",
"0.52517056",
"0.52442163",
"0.5212833",
"0.5209014",
"0.5205916",
"0.520388",
"0.519738",
"0.51919764",
"0.51890033",
"0.51657397",
"0.5163745",
"0.5151788",
"0.5149404",
"0.51459485",
"0.5139207",
"0.51354265",
"0.51265544",
"0.5086744",
"0.50849736",
"0.5071388",
"0.50696266",
"0.5069129",
"0.5069021",
"0.5056998",
"0.5044638",
"0.50369745",
"0.5033678",
"0.50327253",
"0.5024808",
"0.502428",
"0.5021419",
"0.50146526",
"0.5007555",
"0.4993607",
"0.49916285",
"0.49874672",
"0.49841085",
"0.49817747",
"0.4971434",
"0.49656376",
"0.49595395",
"0.49589208",
"0.49572462",
"0.49567828",
"0.49551228",
"0.49538502",
"0.49479446",
"0.49479422",
"0.49467772",
"0.49426314",
"0.4942266",
"0.4938817",
"0.4934926",
"0.4934414",
"0.49314862",
"0.49258116",
"0.49258116",
"0.49229056",
"0.49129",
"0.49123925",
"0.49067685",
"0.4903197",
"0.4900957",
"0.48940247",
"0.4892166",
"0.48918912"
] | 0.76281273 | 0 |
TODO Autogenerated method stub | @Override
public Classe getClasse(String id) {
return classeRepository.findById(id).get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public List<Classe> getClasses() {
return classeRepository.findAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Creating hash table with Gradewise Reserved Quantity | private void crtHSTRESQT()
{
try
{
hstRESQT.clear();
M_strSQLQRY = "Select sr_prdcd, sum( isnull(sr_resqt,0)- isnull(sr_dspqt,0)) sr_resqt from fg_srtrn where SR_CMPCD='"+cl_dat.M_strCMPCD_pbst+"' AND ( isnull(sr_resqt,0)- isnull(sr_dspqt,0))>0 and sr_stsfl<>'X' and SUBSTRING(ltrim(str(sr_prdcd,20,0)),1,2) "+ (flgXPSFL ? "=" : "<>") + "'SX' group by sr_prdcd";
//System.out.println(M_strSQLQRY);
M_rstRSSET = cl_dat.exeSQLQRY1(M_strSQLQRY);
if(M_rstRSSET==null || !M_rstRSSET.next())
return;
while (true)
{
hstRESQT.put(M_rstRSSET.getString("SR_PRDCD").toString(),M_rstRSSET.getString("SR_RESQT").toString());
//System.out.println(M_rstRSSET.getString("SR_PRDCD").toString()+" : "+M_rstRSSET.getString("SR_RESQT").toString());
if(!M_rstRSSET.next())
break;
}
M_rstRSSET.close();
}
catch(Exception L_EX)
{
setMSG(L_EX + " crtHSTRESQT",'E');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int generateHash(StudentClass item)\n {\n \t return item.hashCode() % tableSize;\n }",
"public int hashCode()\r\n\t{\n\t\treturn (i % 9); //this will make the values to store in the table based on size of hashtable is 9 and calculation will be (i %9)\r\n\t}",
"private HashMap getGradeRangeMap() {\n\t\tHashMap map = new HashMap();\n\t\tGradeRangeHelper grh;\n\t\tgrh = new GradeRangeHelper(\"Primary elementary\", \"DLESE:Primary elementary\", 0, 2);\n\t\tmap.put(grh.value, grh);\n\t\tgrh = new GradeRangeHelper(\"Intermediate elementary\", \"DLESE:Intermediate elementary\", 3, 5);\n\t\tmap.put(grh.value, grh);\n\t\tgrh = new GradeRangeHelper(\"Middle school\", \"DLESE:Middle school\", 6, 8);\n\t\tmap.put(grh.value, grh);\n\t\tgrh = new GradeRangeHelper(\"High school\", \"DLESE:High school\", 9, 12);\n\t\tmap.put(grh.value, grh);\n\t\treturn map;\n\t}",
"public void createTotalTable() {\r\n totalTable = new HashMap<>();\r\n //create pair table\r\n\r\n //fill with values\r\n Play[] twenty = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] nineteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] eightteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] seventeen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] sixteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fifteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fourteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] thirteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] twelve = {Play.NONE, H, H, H, S, S, S, H, H, H, H, H};\r\n Play[] eleven = {Play.NONE, H, D, D, D, D, D, D, D, D, D, H};\r\n Play[] ten = {Play.NONE, H, D, D, D, D, D, D, D, D, H, H};\r\n Play[] nine = {Play.NONE, H, H, D, D, D, D, H, H, H, H, H};\r\n Play[] eight = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] seven = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] six = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] five = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n\r\n totalTable.put(5, five);\r\n totalTable.put(6, six);\r\n totalTable.put(7, seven);\r\n totalTable.put(8, eight);\r\n totalTable.put(9, nine);\r\n totalTable.put(10, ten);\r\n totalTable.put(11, eleven);\r\n totalTable.put(12, twelve);\r\n totalTable.put(13, thirteen);\r\n totalTable.put(14, fourteen);\r\n totalTable.put(15, fifteen);\r\n totalTable.put(16, sixteen);\r\n totalTable.put(17, seventeen);\r\n totalTable.put(18, eightteen);\r\n totalTable.put(19, nineteen);\r\n totalTable.put(20, twenty);\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + itemCode;\n\t\tresult = prime * result + ((itemName == null) ? 0 : itemName.hashCode());\n\t\tresult = prime * result + ((material == null) ? 0 : material.hashCode());\n\t\tresult = prime * result + quantity;\n\t\tresult = prime * result + ((size == null) ? 0 : size.hashCode());\n\t\tresult = prime * result + unitPrice;\n\t\treturn result;\n\t}",
"@Override\n public int hashCode() {\n return Objects.hash(product, quantity);\n }",
"public HashTableChained() {\r\n num_buckets = 101; //prime number close to 100\r\n hash_table = new DList[num_buckets]; \r\n }",
"@Override\n public int hashCode() {\n return Objects.hash(name, unit, price, minimum, numUnits);\n }",
"@Override\n public int hashCode() {\n\treturn (rowIndex * 10) + colIndex; \n }",
"public void createPairTable() {\r\n //create total Table\r\n pairTable = new HashMap<>();\r\n\r\n //fill with values \r\n Play[] cAce = {Play.NONE, P, P, P, P, P, P, P, P, P, P, P};\r\n Play[] cTen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] cNine = {Play.NONE, S, P, P, P, P, P, S, P, P, S, S};\r\n Play[] cEight = {Play.NONE, P, P, P, P, P, P, P, P, P, P, P};\r\n Play[] cSeven = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n Play[] cSix = {Play.NONE, H, P, P, P, P, P, H, H, H, H, H};\r\n Play[] cFive = {Play.NONE, H, D, D, D, D, D, D, D, D, H, H};\r\n Play[] cFour = {Play.NONE, H, H, H, H, P, P, H, H, H, H, H};\r\n Play[] cThree = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n Play[] cTwo = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n\r\n pairTable.put(1, cAce);\r\n pairTable.put(2, cTwo);\r\n pairTable.put(3, cThree);\r\n pairTable.put(4, cFour);\r\n pairTable.put(5, cFive);\r\n pairTable.put(6, cSix);\r\n pairTable.put(7, cSeven);\r\n pairTable.put(8, cEight);\r\n pairTable.put(9, cNine);\r\n pairTable.put(10, cTen);\r\n pairTable.put(11, cAce);\r\n }",
"@Override\n\t\tpublic int hashCode() {\n\t\t\treturn (int) (this.sum * 100 + this.index);\n\t\t}",
"@Override\n\tpublic int hashCode() {\n\t\treturn Objects.hashCode(super.hashCode(), getAmount(), getSize(), fluid);\n\t}",
"@Override\r\n public int hashCode()\r\n {\r\n if(this.isEmpty()) return 0;\r\n\r\n /**\r\n * En este caso es recomendable usar la funcion Arrays.hashCode porque\r\n * garantiza un hash unico para cada array.\r\n * Si se usa la suma, los objetos \"ab\" y \"ba\" tendrian el mismo hash.\r\n */\r\n return Arrays.hashCode(this.table);\r\n }",
"public void createHashedVector() {\n Double val;\n for(int i=0; i < this.size; i++) {\n val = this.get(i);\n if(val !=0) {\n this.hmap.put(i, val);\n }\n } \n }",
"void generateGradeCard(String studentId);",
"private int[] genKeys() {\n HashSet<Integer> set = new HashSet<Integer>();\n HashSet<int[]> next = new HashSet<int[]>();\n rowKeys = new HashMap<Integer, Integer>();\n int[] rowKeys2combo = new int[keySize];\n\n // 1st set starts with 0004, 0040, 0400, 4000\n int counter = 0;\n int key;\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n\n final int splitIdx = counter;\n\n // 2nd set starts with 0003, 0030, 0300, 3000\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize - 1;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n return genKeyLink(splitIdx, rowKeys2combo);\n }",
"public DesignHashmap() {\n\t\ttable = new boolean[buckets][];\n\t}",
"public QuantDataHashTable() {\n\t\t\n\t\tquantData = new Hashtable<String, Double>();\n\t\t\n\t}",
"public Hashtable<String,Stock> createMap(){\n\tHashtable table = new Hashtable<String, Stock>();\n\treturn table;\n}",
"@Override\n\tpublic int hashCode() {\n\t\treturn StudentNum;\n\t}",
"private void allocateValues(Hashtable<String, Double> data) {\n\t\tfor(String key:data.keySet()) {\n\t\t\tif(this.salesByPromo.containsKey(key)) {\n\t\t\t\tdouble input = this.salesByPromo.get(key)+ data.get(key);\n\t\t\t\tthis.setSalesByPromo(key, input);\n\t\t\t} else {\n\t\t\t\tthis.setSalesByPromo(key, data.get(key));\n\t\t\t}\n\t\t}\n\t}",
"public GiftHashTable(int capacity) {\r\n GiftList = new HashTableMap<>(capacity);\r\n names = new LinkedList<>();\r\n totalCost = 0;\r\n totalGifts = 0;\r\n }",
"@Override\n public int hashCode()\n {\n // uses roll no to verify the uniqueness\n // of the object of Student class\n final int temp = 14;\n int ans = 1;\n ans = temp * ans + rollno;\n return ans;\n }",
"private void rehash() {\n\t HashEntry[] oldArray = array;\n\n\t // Create a new double-sized, empty table\n\t allocateArray(2 * oldArray.length);\n\t occupied = 0;\n\t theSize = 0;\n\n\t // Copy table over\n\t for (HashEntry entry : oldArray) {\n\t if (entry != null && entry.isActive)\n\t add(entry.element);\n\t }\n\t }",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tHashtable<Temp, String> h = new Hashtable<>();\r\n\t\th.put(new Temp(1), \"A\");\r\n\t\th.put(new Temp(25), \"B\");\r\n\t\th.put(new Temp(30), \"C\");\r\n\t\th.put(new Temp(10), \"D\");\r\n\t\tSystem.out.println(h);\r\n\t\t//{30=C, 10=D, 25=B, 1=A}---when hashcode returns i\r\n\t\t//{25=B, 30=C, 1=A, 10=D}---when hashcode returns i%9\r\n\t\t\r\n\t\t//constructor with initial capacity\r\n\t\t//here if hashcode exceeds 4 then, modules of 5 is done. \r\n\t\tHashtable<Temp1, String> h1 = new Hashtable<>(5);\r\n\t\th1.put(new Temp1(1), \"A\");\r\n\t\th1.put(new Temp1(25), \"B\");\r\n\t\th1.put(new Temp1(30), \"C\");\r\n\t\th1.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h1);\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using initial capacity and fill ratio.\r\n\t\tHashtable<Temp1, String> h2 = new Hashtable<>(5,0.4f);\r\n\t\th2.put(new Temp1(1), \"A\");\r\n\t\th2.put(new Temp1(25), \"B\");\r\n\t\th2.put(new Temp1(30), \"C\");\r\n\t\th2.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h2);\r\n\t\t//{30=C, 1=A, 10=D, 25=B}\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using Map\r\n\t\tHashtable<Temp1, String> h3 = new Hashtable<>(h2);\r\n\t\tSystem.out.println(h3);\r\n\t}",
"private int hash(E e) {\n return Math.abs(e.hashCode()) % table.length;\n }",
"private void createBitStremMap(){\n itemListMap = new HashMap<>();\n \n for (ArrayList<Integer> transactions_set1 : transactions_set) {\n ArrayList curr_tr = (ArrayList) transactions_set1;\n if(curr_tr.size() >= min_itemset_size_K) \n for (Object curr_tr1 : curr_tr) {\n int item = (int) curr_tr1;\n itemListMap.put(item, itemListMap.getOrDefault(item, 0)+1);\n }\n }\n \n // 3. Remove items without minimum support\n itemListMap.values().removeIf(val -> val<min_sup);\n \n // 4. Sort the map to a set of entries\n Set<Map.Entry<Integer, Integer>> set = itemListMap.entrySet();\n frequentItemListSetLenOne = new ArrayList<>(set);\n Collections.sort( frequentItemListSetLenOne, new Comparator<Map.Entry<Integer, Integer>>(){\n @Override\n public int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2 )\n {\n return (o2.getValue()).compareTo( o1.getValue() );\n }\n });\n\n // 5.\n itemIndex = new HashMap<>();\n for(Map.Entry<Integer, Integer> entry : frequentItemListSetLenOne){\n itemIndex.put(entry.getKey(), itemIndex.size());\n }\n\n // 6.\n bitsetLen = frequentItemListSetLenOne.size();\n }",
"public void makeHash(){\n\t\tString tmp = \"\";\n\t\t\n\t\tfor(int i=0;i<_rows;i++){\n\t\t\tfor(int j=0;j<_cols;j++){\n\t\t\t\ttmp+=String.valueOf(_puzzle[i][j])+\"#\";\n\t\t\t}\n\t\t}\n\t\t_hashCode = tmp;\n\t}",
"@Override\n public int hashCode() {\n return Objects.hash(this.name, this.collectionOfCurrentListings, this.commissionRate, this.totalEarnings);\n }",
"private int hash(T t) {\n int code = t.hashCode();\n return code % Table.size();\n }",
"public int hashCode()\n {\n// return this.getAdjustmentNumber();\n return this.getProductKey();\n }",
"@Override\r\n\tpublic int hashCode() {\n\t\tint result = QAOperation.SEED;\r\n\t\tresult = QAOperation.PRIME_NUMBER * result + operator.hashCode();\r\n\t\tresult = QAOperation.PRIME_NUMBER * result + operand.hashCode();\r\n\t\tresult = QAOperation.PRIME_NUMBER * result + constraint.hashCode();\r\n\t\treturn result;\r\n\t}",
"public HashTable(int s){\n\t\tthis.table = new Record[s];\n\t\tthis.contains = 0;\n\t}",
"public HashTable(int tableSize) {\n\t\ttable = new ArrayList<>(tableSize);\n\t\tcapacity = tableSize;\n\t\tfor (int i = 0; i < tableSize; i++) {\n\t\t\ttable.add(new SequentialSearchSymbolTable<K, V>());\n\t\t}\n\t}",
"@Override\n\tpublic int hashCode() {\n\t\treturn idx1.hashCode() * 811 + idx2.hashCode();\n\t}",
"public HashTable()\n\t{\n\t\tthis(NUM_BUCKETS);\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tprivate void rehash()\r\n\t{\r\n\t\tint M = table.length;\r\n\t\tMapEntry<K, V>[] origTable = table; // save original\r\n\t\t\r\n\t\t//new table\r\n\t\ttable = new MapEntry[2*M + 1];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\t\r\n\t\tfor (MapEntry<K, V> oe : origTable)\r\n\t\t{\r\n\t\t\tMapEntry<K, V> e = oe;\r\n\t\t\tif (e != null && e != DUMMY) // No need to rehash dummy\r\n\t\t\t{\r\n\t\t\t\tint slot = findSlot(e.getKey(), true);\r\n\t\t\t\ttable[slot] = e;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }",
"private void rehash( )\n {\n HashEntry<AnyType> [ ] oldArray = array;\n\n // Create a new double-sized, empty table\n allocateArray( 2 * oldArray.length );\n occupied = 0;\n theSize = 0;\n\n // Copy table over\n for( HashEntry<AnyType> entry : oldArray )\n if( entry != null) {\n \tput(entry.key, entry.value);\n }\n }",
"@Override\n public int hashCode() {\n int result;\n long temp;\n result = type.hashCode();\n result = 31 * result + (name != null ? name.hashCode() : 0);\n result = 31 * result + (mainColor != null ? mainColor.hashCode() : 0);\n result = 31 * result + (material != null ? material.hashCode() : 0);\n result = 31 * result + (origin != null ? origin.hashCode() : 0);\n temp = Double.doubleToLongBits(price);\n result = 31 * result + (int) (temp ^ (temp >>> 32));\n result = 31 * result + Arrays.hashCode(ageDelta);\n return result;\n }",
"@Override\n public int hashCode() {\n // name's hashCode is multiplied by an arbitrary prime number (13)\n // in order to make sure there is a difference in the hashCode between\n // these two parameters:\n // name: a value: aa\n // name: aa value: a\n return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());\n }",
"public Map<Student,Character> getGradeBook(){\n Map<Student,Character> map = new HashMap<>();\n Student[] array = getStudentsByScore();\n Character grade = ' ';\n\n int rankCounter = 1;\n double tempS = array[0].getAverageExamScore();\n map.put(array[0],giveGrade(0));\n\n for(int i=1; i<students.size(); i++){\n\n if(tempS == array[i].getAverageExamScore()) {\n grade = giveGrade(rankCounter-1);\n }else{\n grade = giveGrade(i);\n tempS = array[i].getAverageExamScore();\n rankCounter++;\n }\n map.put(array[i],grade);\n }\n\n return map;\n }",
"public String toString() {\n\tString HashTable=\"\";\n\tfor(int i=0;i<this.capacity;i++) {\n\t for(MyEntry k:table[i]) {\n\t\tHashTable=HashTable+k.value+\" \"+k.key+\"\\n\";\n\t }\n\t}\n\treturn HashTable;\n }",
"public HashTable(int size) {\n\t\tarraySize = size;\n\t\thashArray = new DataItem[arraySize];\n\t\tnonItem = new DataItem(-1);\n\t}",
"public HashTableChained() {\n sizeBucket = 101;\n defTable = new DList[sizeBucket];\n for(int i=0; i<sizeBucket; i++) {\n defTable[i] = new DList();\n }\n size = 0;\n }",
"@Override\n public int hashCode() {\n int hash = 7;\n hash = 71 * hash + this.id;\n hash = 71 * hash + Objects.hashCode(this.name);\n hash = 71 * hash + Objects.hashCode(this.cash);\n hash = 71 * hash + Objects.hashCode(this.skills);\n hash = 71 * hash + Objects.hashCode(this.potions);\n return hash;\n }",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\t\tprivate void rehash() {\r\n\t\t\t// double size of array\r\n\t\t\tTableElement<K, V>[] NewDictionary = (TableElement<K, V>[]) new TableElement[dictionary.length * 2];\r\n\r\n\t\t\tcurrentCapacity = dictionary.length * 2;\r\n\r\n\t\t\t// re-mod the keys to get new hash\r\n\t\t\tfor (int i = 0; i < dictionary.length; i++) {\r\n\t\t\t\tif (dictionary[i] != null) {\r\n\t\t\t\t\tint newHash = (Math.abs(dictionary[i].getKey().hashCode()) % currentCapacity);\r\n\r\n\t\t\t\t\t// put re-hashed keys into new array\r\n\t\t\t\t\twhile (NewDictionary[newHash] != null) {\r\n\t\t\t\t\t\tint probe = getProbed(newHash);\r\n\t\t\t\t\t\tnewHash = (newHash + probe) % currentCapacity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tTableElement element = dictionary[i];\r\n\t\t\t\t\tNewDictionary[newHash] = element;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// set old dictionary to new dictionary\r\n\t\t\tthis.dictionary = NewDictionary;\r\n\t\t}",
"void Rehash(){\n\t\tRehash++;\r\n\t\t//updates if the hash table changed size\r\n\t\tStockNode[] temp=new StockNode[(2*Table.length)+1];\r\n\t\t//creates a temporary table with the new size \r\n\t\tfor(int i=Table.length-1;i>=0;i--){\r\n\t\t\t//goes through each array linked list \r\n\t\t\tStockNode t=Table[i];\r\n\t\t\twhile(t!=null){\r\n\t\t\t\t//the change of node to its new proper place is done here \r\n\t\t\t\tint key = toInt(t.stockName);\r\n\t\t\t\tint index = key%temp.length;\r\n\t\t\t\tif(temp[index]!=null){\r\n\t\t\t\t\tStockNode next=temp[index].next;\r\n\t\t\t\t\twhile(next!=null){\r\n\t\t\t\t\t\ttemp[index]=next;\r\n\t\t\t\t\t\tnext=temp[index].next;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttemp[index].next=t;\r\n\t\t\t\t} else{\r\n\t\t\t\t\ttemp[index]=t;\r\n\t\t\t\t}\r\n\t\t\t\tStockNode next=t.next;\r\n\t\t\t\tt.next=null;\r\n\t\t\t\tt=next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tTable=temp;\r\n\t}",
"public HashTable(int size){\n\n arraySize = size;\n hashArray = new Elements[arraySize];\n nullement = new Elements(\" -1 \"); \n }",
"private int hash1(T key) {\n return (key.toString().charAt(0) + key.toString().length())%newTable.length;\r\n }",
"public Map<Integer, Integer> readCapacity() {\n int shelfId;\n int i;\n int amount;\n int countshelf = 0;\n\n for (shelfId = 1; shelfId < inventory.size(); shelfId++) {\n amount = 0;\n for (i = 0; i < inventory.size(); i++) {\n Map<String, Object> Item = new HashMap<>();\n Item = inventory.get(i);\n String x = Item.get(\"Shelf#\").toString();\n int y = Integer.parseInt(x);\n if (shelfId == y) {\n amount += Integer.parseInt(Item.get(\"Amount\").toString());\n }\n }\n if (amount != 0) {\n countshelf += 1;\n shelf.put(countshelf, ShelfCapacity - amount);\n }\n }\n\n //System.out.println(shelf);\n return shelf;\n }",
"@Override\n public int hashCode() {\n return new HashCodeBuilder(17, 37)\n .append(level)\n .append(bosses)\n .append(time)\n .toHashCode();\n }",
"private void rehash(int newCap) {\n System.out.println(\"ARGHHHH\");\n // make a new table of the new size, then iterate over the old\n // table and reinsert each entry.\n var oldTable = table;\n clear(newCap);\n for (var e : oldTable) {\n // skip nulls and tombstones.\n if (e != null) {\n this.bubbaPut(e.key, e.value);\n }\n }\n }",
"@Override\n public int hashCode() {\n return Objects.hash(getAverageRating(), getCount(), getMaxRating(), getMinRating());\n }",
"public HashTableLinearProbing() {\n size = 0;\n capacity = 1200;\n collisions = 0;\n table = new ArrayList<Pair<K, V>>();\n orderOfAdd = new ArrayList<Pair<K, V>>();\n for (int i = 0; i < 1200; i++) {\n table.add(null);\n }\n }",
"public GiftHashTable() {\r\n GiftList = new HashTableMap<>(20);\r\n names = new LinkedList<>();\r\n totalCost = 0;\r\n totalGifts = 0;\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((color == null) ? 0 : color.hashCode());\n\t\tresult = prime * result + (int) (id ^ (id >>> 32));\n\t\tresult = prime * result + ((largeImage == null) ? 0 : largeImage.hashCode());\n\t\tlong temp;\n\t\ttemp = Double.doubleToLongBits(listPrice);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + ((mediumImage == null) ? 0 : mediumImage.hashCode());\n\t\tresult = prime * result + ((parentProduct == null) ? 0 : parentProduct.hashCode());\n\t\tresult = prime * result + (int) (quantityOnHand ^ (quantityOnHand >>> 32));\n\t\ttemp = Double.doubleToLongBits(salePrice);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + ((size == null) ? 0 : size.hashCode());\n\t\tresult = prime * result + ((smallImage == null) ? 0 : smallImage.hashCode());\n\t\treturn result;\n\t}",
"private void rehash() {\n LinkedList<Entry<K,V>>[] oldTable = table;\n table = new LinkedList[oldTable.length * 2 + 1];\n numKeys = 0;\n for (LinkedList<Entry<K, V>> list : oldTable) {\n if (list != null) {\n for (Entry<K,V> entry : list) {\n put(entry.getKey(), entry.getValue());\n numKeys++;\n }\n }\n }\n }",
"public void doubleTable() \n\t{\n\t\tpowerOfListSize++;\n\t\tint newlength = (int)(Math.pow(2,powerOfListSize)); //Creates empty table twice the size of the current table\n\t\tint oldlength = length; //preserves old lengths value\n\t\tRecord[] TempTable = Table; //preserve table value\n\t\tTable = new Record[newlength]; //makes original table twice the size\n\t\tfor (int j = 0; j < newlength; j++){\n\t\t\tTable[j] = new Record(\" \"); //fill table with empty slots\n\t\t}\n\t\tlength = newlength; //sets length to the new length\n\t\tfor (int j = 0; j < oldlength; j++){\n\t\t\tif (TempTable[j].hash >0){\n\t\t\t\tTable = reinsert(Table, TempTable[j],newlength); //refills new table with all value from old table so they get hashed properly\n\t\t\t}\n\t\t}\n\t}",
"public HashTableChained() {\n size = 0;\n buckets = new SList[107];\n largePrime = findPrime(10000);\n for (int i = 0; i < 107; i++) {\n buckets[i] = new SList();\n }\n }",
"public TranspositionTable() {\n\t\tmap = new HashMap<Long, Transposition>(1000000);\n\t\t//purgatory = new HashSet<Long>();\n\t}",
"private MyHashMap<K,V> resize() {\n\t//resize hashmap\n\t\n\tint biggercapacity=(2*capacity)+1;\n\n\tMyHashMap<K,V> biggermap= new MyHashMap(biggercapacity,loadFactor);\n\t\n\t//rehash items\n\t\n\t\n\tfor(int i=0;i<this.capacity;i++) {\n\t for(MyEntry k:table[i]) {\n\t\tbiggermap.put(k.key, k.value);\n\t }\n\t}\n\tthis.capacity=biggercapacity;\n\tthis.table=biggermap.table;\n\treturn biggermap;\n }",
"Table(String t,int c){\r\n this.type=t;\r\n this.capacity=c;\r\n timeSlots=new HashMap<Integer,String>();\r\n slotAcquired=new HashMap<Integer,Boolean>();\r\n availability=true;\r\n \r\n // Setting Up the Time Slots\r\n timeSlots.put(0,\"10-11\");\r\n timeSlots.put(1,\"11-12\");\r\n timeSlots.put(2,\"12-13\");\r\n timeSlots.put(3,\"13-14\");\r\n timeSlots.put(4,\"14-15\");\r\n timeSlots.put(5,\"15-16\");\r\n timeSlots.put(6,\"16-17\");\r\n timeSlots.put(7,\"17-18\");\r\n timeSlots.put(8,\"18-19\");\r\n timeSlots.put(9,\"19-20\");\r\n timeSlots.put(10,\"21-22\");\r\n timeSlots.put(11,\"22-23\");\r\n // First, all the slots aren't acquired\r\n for(int k=0;k<slotAcquired.size();k++){\r\n slotAcquired.put(k, Boolean.FALSE);\r\n }\r\n \r\n slotTracker=0;\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\treturn new HashCodeBuilder(17, 37).append(id).append(code).append(nom).append(prix).toHashCode();\n\t}",
"private static int makeHash(int npcId, int level) {\n\t\treturn npcId << 8 | level;\n\t}",
"public static HashMap<Integer, Item> storeItems(){\n\t\tItem prod1 = new Item(\"Candy\",40);\n\t\tItem prod2 = new Item(\"Bread\",30);\n\t\tItem prod3 = new Item(\"Butter\",50);\n\t\tItem prod4 = new Item(\"Milk\",43);\n\t\tItem prod5 = new Item(\"Toast\",60);\n\t\tItem prod6 = new Item(\"Curd\",20);\n\t\tItem prod7 = new Item(\"Cream\",80);\n\t\tItem prod8 = new Item(\"Pastry\",45);\n\t\tItem prod9 = new Item(\"Cake\",300);\n\t\tItem prod10 = new Item(\"Panner\",200);\n\t\tItem prod11 = new Item(\"Egg\",8);\n\t\tproducts.put(1,prod1);\n\t\tproducts.put(2,prod2);\n\t\tproducts.put(3,prod3);\n\t\tproducts.put(4,prod4);\n\t\tproducts.put(5,prod5);\n\t\tproducts.put(6,prod6);\n\t\tproducts.put(7,prod7);\n\t\tproducts.put(8,prod8);\n\t\tproducts.put(9,prod9);\n\t\tproducts.put(10,prod10);\n\t\tproducts.put(11,prod11);\n\t\treturn products;\n\t}",
"@Override\n public int hashCode() {\n long longBits = Double.doubleToLongBits(this.size + this.unit.hashCode());\n return (int) (longBits ^ (longBits >>> 32));\n }",
"@Override\r\n public int hashCode() {\n int key=(Integer)(this.capsule.get(0)); // Get the key\r\n Integer bkey=Integer.parseInt(Integer.toBinaryString(key)); // Convert into binary \r\n int n=setcount(bkey); //counts the number of 1's in the binary\r\n key=key*n + Objects.hashCode(this.capsule.get(0)); //multiplies that with the hashcode of the pId\r\n return key;\r\n }",
"protected void createTable() {\n table = (MapEntry<K, V>[]) new MapEntry[capacity]; // safe cast\n }",
"@Override\n public int hashCode() {\n return Objects.hash(name, gender, age, phone, email, address, desiredJob, education, expectedSalary, tags);\n }",
"protected int myHashKey(KeyType key) {\n int hashValue;\n hashValue = key.hashCode() % mTableSize;\n if (hashValue < 0) {\n hashValue += mTableSize;\n }\n return hashValue;\n }",
"public static void main(String[] args) {\n Map<Integer, Integer> map = new HashMap<>();\r\n map.put(1, 1); // first pair\r\n map.put(2, 1); // second pair\r\n map.put(1, 3); // update the value of first pair\r\n\r\n // book - sales\r\n Book b1 = new Book(\"learn js\", 20);\r\n Book b2 = new Book(\"learn java\", 30);\r\n // we want to consider two books with same\r\n // name and same price to be matching\r\n Book b3 = new Book(\"learn css\", 10);\r\n Book b4 = new Book(\"learn css\", 10);\r\n Book b5 = new Book(\"learn csa\", 28);\r\n Map<Book, Integer> bookSales = new HashMap<>();\r\n bookSales.put(b1, 200);\r\n bookSales.put(b2, 400);\r\n bookSales.put(b3, 600);\r\n bookSales.put(b4, 300);\r\n bookSales.put(b5, 900);\r\n // 1. b3 and b4 are consider as different key\r\n // 2. HashMap does not reserve insertion order.(sorted)\r\n System.out.println(bookSales);\r\n\r\n System.out.println(b1.hashCode()); // 1836019240\r\n System.out.println(b2.hashCode()); // 325040804\r\n System.out.println(b3.hashCode() == b4.hashCode()); // false\r\n\r\n System.out.println(calc(b1.hashCode()));\r\n System.out.println(calc(b2.hashCode()));\r\n System.out.println(calc(b3.hashCode()));\r\n System.out.println(calc(b4.hashCode()));\r\n System.out.println(calc(b5.hashCode()));\r\n\r\n System.out.println(hash(b3.hashCode()));\r\n System.out.println(hash(b4.hashCode()));\r\n System.out.println(hash(b5.hashCode()));\r\n\r\n\r\n // keys' hashcode are different, indies may be different or same.\r\n // indies which are calculated are different, keys' hash must be different\r\n\r\n // TreeMap\r\n // sorted map by key\r\n // The key must be Comparable or create map with custom comparator\r\n Comparator<String> comparator = new Comparator<String>() {\r\n @Override\r\n public int compare(String o1, String o2) {\r\n return o2.compareTo(o1);\r\n }\r\n };\r\n Map<String, Integer> scores = new TreeMap<>(comparator);\r\n scores.put(\"bob\", 80);\r\n scores.put(\"alice\", 100);\r\n scores.put(\"zack\", 90);\r\n System.out.println(scores);\r\n\r\n // LinkedHashMap: sorted map by insertion order\r\n\r\n Map<String, Integer> scores1 = new HashMap<>();\r\n scores1.put(\"alice\", 90);\r\n scores1.put(\"bob\", 80);\r\n scores1.put(\"zack\", 100);\r\n // your codes start here\r\n\r\n System.out.println(scores1); // sorted by score1(value)\r\n }",
"@Override\n public int hashCode() {\n int i;\n int result = 17;\n i = getIdacquirente();\n result = 37*result + i;\n return result;\n }",
"@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 999;\n\t\tint result = 1;\n\t\tresult = prime * result + Table;\n\t\tresult = prime * result + id;\n\t\treturn result;\n\t}",
"private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }",
"public int hashCode() {\n/* 360 */ return Objects.hashCode(new Object[] { Long.valueOf(this.count), Double.valueOf(this.mean), Double.valueOf(this.sumOfSquaresOfDeltas), Double.valueOf(this.min), Double.valueOf(this.max) });\n/* */ }",
"public ProbingHashClass()\n {\n tableSize = DEFAULT_TABLE_SIZE;\n probeFlag = LINEAR_PROBING;\n tableArray = new StudentClass[tableSize];\n }",
"private void reHash(int a){\r\n int arrayNewSize = this.capacity();\r\n if(a == 1){\r\n arrayNewSize = arrayNewSize * 2;\r\n }\r\n else if(a == -1){\r\n arrayNewSize = arrayNewSize / 2;\r\n }\r\n String[] newHashTable = new String[arrayNewSize];\r\n String [] oldCopy = this.hashTable.clone();\r\n this.capacity = arrayNewSize;\r\n this.hashTable = newHashTable;\r\n for(String i: oldCopy){\r\n this.reHashAdd(i);\r\n }\r\n this.hashing = false;\r\n }",
"private void rehash() {\r\n Entry[] oldHashTable = this.hashTable;\r\n this.capacity = this.capacity * 2;\r\n this.hashTable = new Entry[this.capacity];\r\n this.size = 0;\r\n for (Entry eachEntry : oldHashTable) {\r\n if (eachEntry != null) {\r\n if (!eachEntry.isDeleted) {\r\n this.add((K)eachEntry.key,(V)eachEntry.value);\r\n }\r\n }\r\n }\r\n return;\r\n }",
"protected int myhash(T x)\r\n\t{\r\n\t\tint hashVal = x.hashCode( );\r\n\t\thashVal %= tableSize;\r\n\t\tif( hashVal < 0 )\r\n\t\t\thashVal += tableSize;\r\n\t\treturn hashVal;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tprivate void increaseCapacity()\r\n\t{\r\n\t\t// Store a reference to the old table\r\n\t\tHashEntry<K, V>[] oldTable = table;\r\n\r\n\t\t// Attempt to resize the table\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Make a new table full of empty entries\r\n\t\t\ttable = new HashEntry[SIZES[++sizeIdx]];\r\n\t\t}\r\n\t\t// We have too many entries in the hash table: no more sizes left\r\n\t\tcatch (ArrayIndexOutOfBoundsException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Too many entries in hash table. Exiting.\");\r\n\t\t\tSystem.exit(4);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < oldTable.length; ++i)\r\n\t\t{\r\n\t\t\t// If we are at an entry with a key and value\r\n\t\t\tif (oldTable[i] != null && !oldTable[i].isTombstone)\r\n\t\t\t{\r\n\t\t\t\t// Add every value at that key to the bigger table\r\n\t\t\t\tfor (V value : oldTable[i].value)\r\n\t\t\t\t{\r\n\t\t\t\t\tinsert(oldTable[i].key, value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public void addGrade(String firstName, String lastName, int pID, String grade) {\n Student s = new Student(firstName, lastName, pID);\n Grade g = new Grade(grade);\n\n for (Student key : map.keySet()) {\n if (key.compareTo(s) == 0) {\n map.replace(key, g);\n return;\n }\n }\n\n map.put(s, g);\n\n }",
"private Map<Good, Integer> initiateMarketplace() {\n Random noise = new Random();\n Map<Good, Integer> map = Collections.synchronizedMap(\n new EnumMap<Good, Integer>(Good.class));\n for (Good item : Good.values()) {\n if (item.getMinTech() <= techLevel) {\n Integer price = Math.max(item.getBasePrice()\n - (techLevel - item.getMinTech()) + alignment.getPriceChange()\n + noise.nextInt(5),\n 5);\n map.put(item, price);\n }\n }\n return map;\n }",
"private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}",
"@Override\n public int hashCode() {\n int result = table1.hashCode();\n result = 31 * result + table2.hashCode();\n return result;\n }",
"private void rehash()\n {\n int hTmp = 37;\n\n if ( isHR != null )\n {\n hTmp = hTmp * 17 + isHR.hashCode();\n }\n\n if ( id != null )\n {\n hTmp = hTmp * 17 + id.hashCode();\n }\n\n if ( attributeType != null )\n {\n hTmp = hTmp * 17 + attributeType.hashCode();\n }\n \n h = hTmp;\n }",
"@Override\n public int hashCode() {\n int result = 42;\n int prime = 37;\n for (char ch : key.toCharArray()) {\n result = prime * result + (int) ch;\n }\n result = prime * result + summary.length();\n result = prime * result + value;\n return result;\n }",
"@Override\r\n public int hashCode() {\r\n int hash = 7;\r\n hash = 19 * hash + (int) (this.grauDeEquilibrio ^ (this.grauDeEquilibrio >>> 32));\r\n return hash;\r\n }",
"@Override\n public int hashCode() {\n // Declare hash and assign value\n int hash = 7;\n // Generate hash integer\n hash = 31 * hash + (int) this.getCrossingTime();\n hash = 31 * hash + (this.getName() == null ? 0 : this.getName().hashCode());\n return hash;\n }",
"private int hashFunction(KeyType key) {\r\n // use hashCode() method to get the hashCode and take the absolute value % capacity\r\n return Math.abs(key.hashCode()) % capacity;\r\n }",
"public static void main(String[] args)\r\n\t{\n\t\t\r\n\t\tHashtable hashtableObj = new Hashtable();\r\n\t\thashtableObj.put(new CustomKey(5), \"A\");\r\n\t\thashtableObj.put(new CustomKey(2), \"B\");\r\n\t\thashtableObj.put(new CustomKey(6), \"C\");\r\n\t\thashtableObj.put(new CustomKey(15), \"D\");\r\n\t\thashtableObj.put(new CustomKey(23), \"E\");\r\n\t\thashtableObj.put(new CustomKey(16), \"F\");\r\n//\t\thashtableObj.put(\"Bas\", null); //java.lang.NullPointerException\r\n\t\tSystem.out.println(hashtableObj); // hashcode ret value is i =>{6=C, 16=F, 5=A, 15=D, 2=B, 23=E} based on size of Hashtable is 11 and (i %11)\r\n\t\t\t\t\t\t\t\t\t\t// if the return value of hashCode is (i %9) then outputs is => {16=F, 15=D, 6=C, 23=E, 5=A, 2=B}\r\n\t}",
"@Override\n public int hashCode() {\n int i;\n int result = 17;\n if (getRegItemUid() == null) {\n i = 0;\n } else {\n i = getRegItemUid().hashCode();\n }\n result = 37*result + i;\n return result;\n }",
"@Override\n\tpublic int hashCode() {\n\t\treturn labelTemplate.hashCode() ^ type.hashCode() ^ priority ^ valueTemplate.hashCode();\n\t}",
"private void extendTable() {\n\n FreqNode[] freqTable = frequencyTable;//create temp table\n numNodes = 0; //set nodes to 0 \n FreqNode tmpNode; //temp variable\n frequencyTable = new FreqNode[frequencyTable.length * 2];//doubles the size \n\n //for every element in the table \n for (FreqNode node : freqTable) {\n //set the node \n tmpNode = node;\n while (true) {\n //if the node currently has a value \n if (tmpNode == null) {\n break;\n }//else \n else {\n //place the key and value at the current position\n this.put(tmpNode.getKey(), tmpNode.getValue());\n tmpNode = tmpNode.getNext();\n }//end else\n }//end while \n }//end for \n }",
"public int hashCode() {\n\treturn name.hashCode() ^ style ^ size;\n }",
"private void rehash() {\r\n\t\tSystem.out.println( \"rehashing : buckets \" + numBuckets + \" size \" + size );\r\n\t\tArrayList<MapNode<K, V>> temp = buckets;\r\n\t\tbuckets = new ArrayList();\r\n\t\tfor( int i = 0; i < 2*numBuckets; i++ ) {\r\n\t\t\tbuckets.add( null );\r\n\t\t}\r\n\t\tsize = 0; //size 0 means abi ek b element nhi h\r\n\t\tnumBuckets *= 2; //ab number of buckets double ho gya h\r\n\t\t//now we will trvrs old arraylist and linkedlist and\r\n\t\t//copy is elemenet one by one\r\n\t\tfor( int i = 0; i < temp.size(); i++ ) {\r\n\t\t\tMapNode< K, V > head = temp.get(i);\r\n\t\t\twhile( head != null ) {\r\n\t\t\t\t\r\n\t\t\t\tK key = head.key;\r\n\t\t\t\tV value = head.value;\r\n\t\t\t\tinsert( key, value );\r\n\t\t\t\thead = head.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }",
"protected void rehash( )\r\n\t{\r\n\t\tint newSize = nextPrime(this.tableSize*2);\r\n\t\tMyHashTable<T> newHashTable = new MyHashTable<T>(newSize);\r\n\t\tIterator<T> thisTableIter = this.iterator();\r\n\t\twhile(thisTableIter.hasNext())\r\n\t\t{\r\n\t\t\tT e = thisTableIter.next();\r\n\t\t\tnewHashTable.insert(e);\r\n\t\t}\r\n\t\tthis.clear();\r\n\t\tthis.size = newHashTable.size;\r\n\t\tthis.tableSize = newHashTable.tableSize;\r\n\t\tthis.table = newHashTable.table;\r\n\t}",
"@Override\n\t\tpublic int hashCode() {\n\t\t\tSystem.out.println(\"hashCode for \" + roll_no);\n\t\t\treturn roll_no % 10;\n\t\t}",
"@Override\n public int hashCode() {\n return txHash.hashCode()^txIndex;\n }",
"@Override\n public int hashCode() {\n int result = super.hashCode();\n result = PRIME * result + type.hashCode();\n result = PRIME * result + volume;\n return result;\n }"
] | [
"0.6111314",
"0.60666",
"0.60206693",
"0.589993",
"0.5745234",
"0.57411695",
"0.56878287",
"0.5681511",
"0.5620992",
"0.55485946",
"0.5528253",
"0.5521527",
"0.55035776",
"0.54674387",
"0.546425",
"0.5457637",
"0.544496",
"0.54320335",
"0.54295707",
"0.54060614",
"0.539322",
"0.5390891",
"0.5390699",
"0.53906363",
"0.53898877",
"0.5379595",
"0.53766704",
"0.5373385",
"0.53688073",
"0.53563136",
"0.5341312",
"0.5326072",
"0.53178734",
"0.53026915",
"0.5289913",
"0.52841043",
"0.5280065",
"0.52794224",
"0.52747935",
"0.5265611",
"0.52569455",
"0.52362704",
"0.52223",
"0.52209216",
"0.5217145",
"0.52087474",
"0.5204596",
"0.5204049",
"0.5193048",
"0.51859",
"0.5182794",
"0.5178677",
"0.51780796",
"0.51734704",
"0.5168141",
"0.51672995",
"0.516533",
"0.5163517",
"0.51594305",
"0.5155064",
"0.5150849",
"0.51505613",
"0.51404864",
"0.51365966",
"0.5128792",
"0.51286584",
"0.51285434",
"0.51276827",
"0.5121063",
"0.5121017",
"0.51146805",
"0.51103395",
"0.5108397",
"0.51073766",
"0.50913453",
"0.5091037",
"0.50894976",
"0.5086139",
"0.5082031",
"0.50800884",
"0.5078454",
"0.50771856",
"0.5076988",
"0.5075145",
"0.50719565",
"0.50693417",
"0.5067892",
"0.5065385",
"0.5064613",
"0.5064285",
"0.5063572",
"0.5058621",
"0.50581616",
"0.5053088",
"0.50492465",
"0.50479114",
"0.5038549",
"0.50342894",
"0.50236875",
"0.5023564",
"0.50231576"
] | 0.0 | -1 |
Method to Generate the Page Header of the Report. | private void prnHEADER()
{
try
{
cl_dat.M_PAGENO +=1;
cl_dat.M_intLINNO_pbst=0;
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))
prnFMTCHR(dosREPORT,M_strBOLD);
if(M_rdbHTML.isSelected())
dosREPORT.writeBytes("<B>");
dosREPORT.writeBytes("\n");
dosREPORT.writeBytes(padSTRING('L'," ",100));
dosREPORT.writeBytes("------------------------------\n");
dosREPORT.writeBytes(padSTRING('L'," ",100));
dosREPORT.writeBytes(strISODC1+"\n");
dosREPORT.writeBytes(padSTRING('L'," ",100));
dosREPORT.writeBytes(strISODC2+"\n");
dosREPORT.writeBytes(padSTRING('L'," ",100));
dosREPORT.writeBytes(strISODC3+"\n");
dosREPORT.writeBytes(padSTRING('L'," ",100));
dosREPORT.writeBytes("------------------------------\n");
dosREPORT.writeBytes(padSTRING('R',cl_dat.M_strCMPNM_pbst ,100));
dosREPORT.writeBytes("Report Date:"+ cl_dat.M_strLOGDT_pbst + "\n");
dosREPORT.writeBytes(padSTRING('R',"Stock Statement as on "+(rdbDYOPN.isSelected() ? strREFDT+" at 07:00 Hrs" : cl_dat.M_txtCLKDT_pbst.getText()+" "+cl_dat.M_txtCLKTM_pbst.getText()+" Hrs"),100));
dosREPORT.writeBytes("Page No. :" + String.valueOf(cl_dat.M_PAGENO) + "\n");
dosREPORT.writeBytes("---------------------------------------------------------------------------------------------------------------------------------------\n");
dosREPORT.writeBytes(padSTRING('R'," ",12));
dosREPORT.writeBytes(padSTRING('R',"Product & Size",28));
//System.out.println("LM_COUNT = "+LM_COUNT);
for(i=0;i<LM_COUNT;i++)
dosREPORT.writeBytes(padSTRING('L',staMNLDS[i],12));
dosREPORT.writeBytes(padSTRING('L',"Tot.Sq.Mts",12));
dosREPORT.writeBytes(padSTRING('L',"S/Rtn",12));
dosREPORT.writeBytes(padSTRING('L',"Res.Qty",10));
dosREPORT.writeBytes(padSTRING('L',"Q/Hold",10));
dosREPORT.writeBytes(padSTRING('L',"Cub.Mtrs",10));
dosREPORT.writeBytes(padSTRING('L',"M.Tons",10));
dosREPORT.writeBytes(padSTRING('L',"Pcs",10));
dosREPORT.writeBytes("\n");
//crtLINE(136);
//dosREPORT.writeBytes("\n");
dosREPORT.writeBytes("---------------------------------------------------------------------------------------------------------------------------------------\n");
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))
prnFMTCHR(dosREPORT,M_strNOBOLD);
if(M_rdbHTML.isSelected())
dosREPORT.writeBytes("</B>");
cl_dat.M_intLINNO_pbst += 11;
}
catch(Exception L_EX)
{
setMSG(L_EX + " prnHEADER",'E');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String getPageHeader()\n {\n if (this.pageHeader == null) {\n String title = (this.privateLabel != null)? this.privateLabel.getPageTitle() : \"\";\n StringBuffer sb = new StringBuffer();\n sb.append(\"<center>\");\n sb.append(\"<span style='font-size:14pt;'><b>\" + title + \"</b></span>\");\n sb.append(\"<hr>\");\n sb.append(\"</center>\");\n this.pageHeader = sb.toString();\n }\n return this.pageHeader;\n }",
"public String getPageHeader(int pageNumber) {\n pageNumber++;\n String header = \"%%Page: \" + pageNumber + \" \" + pageNumber + \"\\n\" +\n \"%%BeginPageSetup\\n\" +\n \"/pagelevel save def\\n\";\n// \"90 rotate\\n\";\n header += \"%%EndPageSetup\\n\";\n return header;\n }",
"PageHeader getPageHeader();",
"PageHeader getPageHeader();",
"@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Cohorts Report\";\n\t\tiDartImage icoImage = iDartImage.PAVAS;\n\t\tbuildCompdHeader(headerTxt, icoImage);\n\t}",
"private static String header() {\r\n String output = \"\";\r\n output += \"\\\\documentclass[a4paper,10pt]{article}\\n\";\r\n output += \"\\\\title{Wilcoxon Signed Ranks test.}\\n\";\r\n output += \"\\\\date{\\\\today}\\n\\\\author{KEEL non-parametric statistical module}\\n\\\\begin{document}\\n\\n\\\\pagestyle{empty}\\n\\\\maketitle\\n\\\\thispagestyle{empty}\\n\\n\";\r\n\r\n return output;\r\n\r\n }",
"@Override\r\n\tpublic String getPageTitle() {\t\r\n\t\treturn getTranslation(Routes.getPageTitleKey(Routes.REPORT));\r\n\t}",
"public String getPageHeaderParagraph() {\r\n\t\treturn controls.getText(\"eVisit\", \"CSS_header_paragraph\");\r\n\t}",
"public void setPageHeader(String header)\n {\n // ignore\n }",
"private static String headerSummary() {\r\n\r\n String output = \"\";\r\n output += \"\\\\documentclass[a4paper,10pt]{article}\\n\";\r\n output += \"\\\\title{Wilcoxon Signed Ranks test.}\\n\";\r\n output += \"\\\\usepackage{rotating}\\n\";\r\n output += \"\\\\usepackage{textcomp}\\n\";\r\n output += \"\\\\date{\\\\today}\\n\\\\author{KEEL non-parametric statistical module}\\n\\\\begin{document}\\n\\n\\\\pagestyle{empty}\\n\\\\maketitle\\n\\\\thispagestyle{empty}\\n\\n\";\r\n\r\n return output;\r\n\r\n }",
"private void createHeader(int propertyCode) {\r\n switch (propertyCode) {\r\n case 0:\r\n _header = \"\";\r\n break;\r\n case 1:\r\n _header = \"#directed\";\r\n break;\r\n case 2:\r\n _header = \"#attributed\";\r\n break;\r\n case 3:\r\n _header = \"#weighted\";\r\n break;\r\n case 4:\r\n _header = \"#directed #attributed\";\r\n break;\r\n case 5:\r\n _header = \"#directed #weighted\";\r\n break;\r\n case 6:\r\n _header = \"#directed #attributed #weighted\";\r\n break;\r\n case 7:\r\n _header = \"#attributed #weighted\";\r\n break;\r\n }\r\n }",
"private org.gwtbootstrap3.client.ui.PageHeader get_f_PageHeader3() {\n return build_f_PageHeader3();\n }",
"public void generateGetHeader (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n BuildHtmlHeader(new PrintWriter (response.getOutputStream()), getTitle());\n }",
"private void createHeaders(WritableSheet sheet)\r\n\t\t\tthrows WriteException {\n\t\taddHeader(sheet, 0, 0, reportProperties.getProperty(\"header1\"));\r\n\t\taddHeader(sheet, 1, 0, reportProperties.getProperty(\"header2\"));\r\n\t\taddHeader(sheet, 2, 0, reportProperties.getProperty(\"header3\"));\r\n\t\taddHeader(sheet, 3, 0, reportProperties.getProperty(\"header4\"));\r\n\t\t\r\n\r\n\t}",
"void setPageHeader(PageHeader pageHeader);",
"void setPageHeader(PageHeader pageHeader);",
"private static void outputHeaderMainPage(SimpleWriter out) {\n out.print(\"<html>\\n\" + \"<head>\\n\" + \"\\t<title>\" + \"Index\" + \"</title>\\n\"\n + \"<font size = '10' >\" + \"Glossary Homepage\" + \"</font>\"\n + \"</head>\\n\" + \"<body>\\n\" + \"<head>\\n\" + \"\\t<h1>\\n\"\n + \"<font size = '6' >\" + \"Index\" + \"</font>\" + \"\\t</h1>\\n\"\n + \"</head>\\n\" + \"</body>\\n\" + \"</html>\");\n }",
"private PageId getHeaderPage(RelationInfo relInfo) {\n\t\treturn new PageId(0, relInfo.getFileIdx());\n\t}",
"public void createHeader() throws DocumentException\n {\n createHeader(100f, Element.ALIGN_LEFT);\n }",
"public void createDisplayHeader()\r\n\t{\r\n\t\tboolean isEType;\r\n\t\tint currentK, lowestJValue, highestJValue;\r\n\r\n\t\t// redundant now\r\n\t\tisEType = getIsEType();\r\n\t\tcurrentK = getCurrentK();\r\n\t\tlowestJValue = getLowestJValue();\r\n\t\thighestJValue = getHighestJValue();\r\n\r\n\t\tString symmetry;\r\n\t\tString kOutput;\r\n\r\n\t\tif (isEType) {\r\n\t\t\tif (currentK >= 0) {\r\n\t\t\t\tkOutput = currentK + \"\";\r\n\t\t\t\tsymmetry = \"E1\";\r\n\t\t\t} else {\r\n\t\t\t\tkOutput = Math.abs(currentK) + \"\";\r\n\t\t\t\tsymmetry = \"E2\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tkOutput = Math.abs(currentK) + \"\";\r\n\t\t\tsymmetry = \"A\";\r\n\r\n\t\t\tif (currentK >= 0) {\r\n\t\t\t\tkOutput += \"+\";\r\n\t\t\t} else {\r\n\t\t\t\tkOutput += \"-\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString ls = System.lineSeparator();\r\n\t\tmainHeader = \"================================================================\"\r\n\t\t\t\t+ ls + \"Symmetry type:\\t\\t\\t\\t\\t\" + symmetry + ls\r\n\t\t\t\t+ \"The K of the lower energy is:\\t\\t\\t\" + kOutput + ls + \"The input \"\r\n\t\t\t\t+ INPUT_BRANCH_TYPE + \" branch was flipped:\\t\\t\\t\" + inputIsFlipped + ls\r\n\t\t\t\t+ \"The input \" + INPUT_BRANCH_TYPE + \" branch used a J range of:\\t\\t\"\r\n\t\t\t\t+ lowestJValue + \" to \" + highestJValue\r\n\t\t\t\t+ ls + ls + \"Results for these selections are...\" + ls;\r\n\r\n\t\tsetHeaderDisplayState(true);\r\n\t}",
"public abstract String header();",
"public void displayHeader(AbstractAccount theAccount, LocalDate theDay) { \n mySB.delete(0, mySB.length());\n mySB.append(Main.LINE_BREAK);\n mySB.append(\"Urban Parks | \");\n mySB.append(theDay.getMonthValue());\n mySB.append(\"/\");\n mySB.append(theDay.getDayOfMonth());\n mySB.append(\"/\");\n mySB.append(theDay.getYear());\n mySB.append(Main.LINE_BREAK);\n mySB.append(\"Welcome \");\n mySB.append(theAccount.getRealName());\n mySB.append(\" (\");\n mySB.append(theAccount.AccountType());\n mySB.append(')');\n mySB.append(Main.LINE_BREAK);\n mySB.append(\"-----------------------------------------------------------------\");\n mySB.append(Main.LINE_BREAK);\n System.out.print(mySB.toString());\n }",
"@Override\n\tprotected String getHeaderTitle() {\n\t\treturn \"\";\n\t}",
"protected AccountingLineTableCell createHeaderCellForField(AccountingLineViewField field) {\n AccountingLineTableCell headerCell = new AccountingLineTableCell();\n headerCell.setRendersAsHeader(true);\n headerCell.addRenderableElement(field.createHeaderLabel());\n return headerCell;\n }",
"private HorizontalLayout getHeader() {\n HorizontalLayout header = new HorizontalLayout();\n header.setWidth(\"100%\");\n header.setHeight(\"100px\");\n // TODO move this into a separate HeaderView class\n header.addComponent(new Label(\"Patient Management System Team Green\"));\n return header;\n }",
"abstract public void header();",
"public static String PrintHeadings() \r\n\t{ \r\n\t\t// Shows the current date\r\n\t\tLocalDate now = LocalDate.now();\r\n\t\tDateTimeFormatter datetimeformat = DateTimeFormatter.ofPattern(\"yy/MM/dd\");\r\n\t\tSystem.out.print(\"-------------------------- REPORT -------------------------- \\n\");\r\n\t\tSystem.out.print(\"\\t\\t\\t\\t Date: \" + datetimeformat.format(now) + \" (YYMMDD)\\n\");\r\n\t\tSystem.out.print(\"\\nItem# | Type | Title | Loan | Date |\" );\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\treturn null;\r\n\t}",
"public void createHeader() {\n\t\tHBox box = new HBox();\n\t\tButton printBtn = new Button(\"Print\");\n\t\tprintBtn.getStyleClass().addAll(\"btn\", \"btn-primary\");\n\t\tButton printAllBtn = new Button(\"Print allemaal\");\n\t\tprintAllBtn.getStyleClass().addAll(\"btn\", \"btn-primary\");\n\t\tButton cancelBtn = new Button(\"Annuleer\");\n\t\tcancelBtn.getStyleClass().addAll(\"btn\", \"btn-danger\");\n\t\tbox.getChildren().addAll(createTitle(), printBtn, printAllBtn, cancelBtn);\n\t\t\n\t\tprintBtn.setOnAction(e -> {\n\t\t\ttry {\n\t\t\t\tprintController.printSelected(debiteuren);\n\t\t\t} catch (Exception e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t\tSystem.out.println(\"Nothing selected mate\");\n\t\t\t}\n\t\t});\n\t\t\n\t\tprintAllBtn.setOnAction(e -> {\n\t\t\ttry {\n\t\t\t\tprintController.printAll(debiteuren);\n\t\t\t} catch (Exception e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t\tSystem.out.println(\"Nothing selected mate\");\n\t\t\t}\n\t\t});\n\t\t\n\t\tcancelBtn.setOnAction(e -> {\n\t\t\tprintController.cancel();\n\t\t});\n\t\t\n\t\tsetTop(box);\n\t}",
"@Override\n\tprotected PortletRenderResult callInternal() throws Exception {\n\t final String characterEncoding = response.getCharacterEncoding();\n\t final RenderPortletOutputHandler renderPortletOutputHandler = new RenderPortletOutputHandler(characterEncoding);\n\t \n final PortletRenderResult result = portletRenderer.doRenderHeader(portletWindowId, request, response, renderPortletOutputHandler);\n \n this.output = renderPortletOutputHandler.getOutput();\n \n return result;\n\t}",
"protected void BuildHtmlHeader(PrintWriter out, String title) throws IOException\n {\n out.println(\"<HTML>\");\n out.println(\"<head>\");\n out.println(\"<link rel=\\\"stylesheet\\\" href=\\\"/css/nny.css\\\" type=\\\"text/css\\\">\");\n out.println(\"<TITLE>\");\n out.println(title);\n out.println(\"</TITLE>\");\n out.println(\"<SCRIPT LANGUAGE=\\\"JavaScript\\\" SRC=\\\"/javascript/data_validation.js\\\"></SCRIPT>\");\n out.println(\"</head>\");\n /*\n if (navbarTemplate != null)\n {\n if (header_tp == null)\n {\n header_tp = new TemplateProcessor(template_path_ + navbarTemplate);\n }\n out.println(header_tp.process().toString());\n }*/\n out.flush();\n }",
"public String getHeader() {\n\t\tString item_text = getQuantityString(getCount());\n\t\tString header = getActivity().getString(R.string.browse_items_text, item_text, getCount());\n\t\treturn header;\n\t}",
"private void printHeader () {\n System.out.println(\"COMPLETED HEADER PARSING\");\n System.out.println(\"________________________\");\n for(String header : parseTableHeader.keySet()) {\n System.out.print(header);\n System.out.println(parseTableHeader.get(header));\n }\n }",
"Header createHeader();",
"@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Add a New Pharmacy\";\n\t\tiDartImage icoImage = iDartImage.PHARMACYUSER;\n\t\tbuildCompHeader(headerTxt, icoImage);\n\t}",
"protected JTableHeader createDefaultTableHeader() {\r\n \treturn new JTableHeader(columnModel) {\r\n \t\t\r\n \t\tprivate static final long serialVersionUID = 1L;\r\n \t\t\r\n \t\tpublic String getToolTipText(MouseEvent e) {\r\n \t\t\tjava.awt.Point p = e.getPoint();\r\n \t\t\tint index = columnModel.getColumnIndexAtX(p.x);\r\n \t\t\tint realColumnIndex = convertColumnIndexToModel(index);\r\n \t\t\tif ((realColumnIndex >= 0) && (realColumnIndex < getModel().getColumnCount()))\r\n \t\t\t\treturn \"The column \" + getModel().getColumnName(realColumnIndex);\r\n \t\t\telse\r\n \t\t\t\treturn \"\";\r\n \t\t}\r\n \t};\r\n }",
"private static void printReportHeader(String name, String domain, String license, int fiscalYear) {\r\n\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\t\\tCompany name: \" + name);\r\n System.out.println(\"\\t\\t\\t\\t\\t\\tDomain: \" + domain);\r\n System.out.println(\"\\t\\t\\t\\t\\t\\tLicense: \" + license);\r\n System.out.println(\"\\t\\t\\t\\t\\t\\tFiscal Year: \" + fiscalYear);\r\n System.out.println(\"\\n\");\r\n System.out.println(\"\\t\\t\\t\\t\\t\\t\\tProfit Report\\n\\n\");\r\n String format = \"%-15s %-15s %15s %15s %15s %15s %20s\";\r\n System.out.format(format,\"Branch ID\", \"Location\", \"Quarter 1\", \"Quarter 2\",\r\n \"Quarter 3\", \"Quarter 4\", \"Annual Profit\");\r\n printSeparatorLine();\r\n }",
"public ContainerTag generateHeader(String title) {\n return TagCreator.main(attrs(\"#main.header\"), h1(title),\n h3(String.format(MESSAGE_TIME_GENERATED, formatter.format(Instant.now()))));\n }",
"public void buildClassHeader() {\n\t\tString key;\n\t\tif (isInterface) {\n\t\t\tkey = \"doclet.Interface\";\n\t\t} else if (isEnum) {\n\t\t\tkey = \"doclet.Enum\";\n\t\t} else {\n\t\t\tkey = \"doclet.Class\";\n\t\t}\n\n\t\twriter.writeHeader(configuration.getText(key) + \" \" + classDoc.name());\n\t}",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader39() {\n return build_f_PanelHeader39();\n }",
"private static void writeHtmlHeader(SimpleWriter out, String inputName,\n int n) {\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title> Top \" + n + \"words in \" + inputName);\n out.println(\"</title>\");\n out.println(\n \"<link href='http://cse.osu.edu/software/2231/web-sw2/assignments/projects/tag-cloud-generator/data/tagcloud.css' rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\");\n out.println(\"</head>\");\n }",
"private void generateHeader() throws IOException {\r\n\t\tcharset = Charset.forName(encoding);\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\r\n\t\t//first line\r\n\t\tsb.append(\"HTTP/1.1 \");\r\n\t\tsb.append(statusCode);\r\n\t\tsb.append(\" \");\r\n\t\tsb.append(statusText);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//second line\r\n\t\tsb.append(\"Content-type: \");\r\n\t\tsb.append(mimeType);\r\n\t\tif (mimeType.startsWith(\"text/\")) {\r\n\t\t\tsb.append(\" ;charset= \");\r\n\t\t\tsb.append(encoding);\r\n\t\t}\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//third line\r\n\t\tif (contentLength > 0) {\r\n\t\t\tsb.append(\"Content-Length: \");\r\n\t\t\tsb.append(contentLength);\r\n\t\t\tsb.append(\"\\r\\n\");\r\n\t\t}\r\n\t\t\r\n\t\t//fourth line\r\n\t\tgetOutputCookies(sb);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\toutputStream.write(sb.toString().getBytes(Charset.forName(\"ISO_8859_1\")));\r\n\t\t\r\n\t\theaderGenerated = true;\r\n\t}",
"public void setupHistoTableHeader() {\r\n\t\tif (this.histoTableTabItem != null && !this.histoTableTabItem.isDisposed()) this.histoTableTabItem.setHeader();\r\n\t}",
"private void generateRowHeaders() {\n JPanel pnl = new JPanel((LayoutManager) null);\n\n java.awt.Dimension dim;\n Object selection = null;\n if (paramTree.getSelectionCount() > 0) {\n selection = paramTree.getSelectionPath().getLastPathComponent();\n }\n\n int digitcount = 1;\n if (selection == ParamToolTreeModel.dimensionSizes) {\n digitcount = 12;\n } else {\n\n Iterator<Dimension> iterator = mms_params.getDimenIterator();\n while (iterator.hasNext()) {\n Dimension next = iterator.next();\n int size = next.getSize();\n if (size == 0) {\n digitcount = 1;\n } else {\n digitcount = (int) (Math.log10((double) size)) + 1;\n }\n }\n }\n\n // Add some padding to make sure that this will work\n digitcount = digitcount + 4;\n StringBuffer buf = new StringBuffer();\n for (int i = 0; i < digitcount; i++) {\n buf.append('9');\n }\n String foo = new String(buf);\n dim = new java.awt.Dimension(metrics.stringWidth(foo) + insets.right + insets.left, jTable1.getRowHeight() * jTable1.getRowCount());\n\n pnl.setPreferredSize(dim);\n\n // Adding the row header labels\n dim.height = jTable1.getRowHeight();\n\n for (int i = 0; i < jTable1.getRowCount(); i++) {\n int ii;\n if (sorter != null) {\n ii = sorter.modelIndex(i);\n } else {\n ii = i;\n }\n\n JButton lbl;\n if (selection == ParamToolTreeModel.dimensionSizes) {\n Dimension mms_dim = mms_params.getDimensionAt(i);\n lbl = new JButton(mms_dim.getName());\n } else {\n lbl = new JButton(Integer.toString(ii + 1));\n }\n\n lbl.setFont(aFont);\n lbl.setBackground(aBackground);\n lbl.setForeground(aForeground);\n lbl.setBorder(border);\n lbl.setBounds(0, i * dim.height, dim.width, dim.height);\n pnl.add(lbl);\n }\n\n JViewport vp = new JViewport();\n dim.height = jTable1.getRowHeight() * jTable1.getRowCount();\n vp.setViewSize(dim);\n vp.setView(pnl);\n tableScrollPane.setRowHeader(vp);\n }",
"private void writeColumnHeader() throws WriteException, IOException {\r\n WriteXLS.getInstance().writeColumnLabels();\r\n }",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader49() {\n return build_f_PanelHeader49();\n }",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader76() {\n return build_f_PanelHeader76();\n }",
"String makeHeader() {\n StringBuilder ans = new StringBuilder(\" \"); // README shows two spaces at\n String sep=\"\"; //start with nothing to separate, then switch to | to separate\n for (int i = 0; i < toDisplay.getWidth(); i++) {\n ans.append(sep);\n ans.append(i);\n sep = \"|\";\n }\n ans.append(\"\\n\");\n return ans.toString();\n }",
"@Override\n protected JTableHeader createDefaultTableHeader()\n {\n return new JTableHeader(columnModel)\n {\n /**\n * Serial version UID variable for the inner class.\n */\n public static final long serialVersionUID = 111222333444555601L;\n\n @Override\n public String getToolTipText(MouseEvent e)\n {\n int index = columnModel.getColumnIndexAtX( e.getPoint().x );\n int realIndex = columnModel.getColumn(index).getModelIndex();\n return columnNames[realIndex];\n }\n };\n }",
"public Pattern getPageHeader() {\r\n return pattern_headerAttribute;\r\n }",
"private static String getPeptideHeader() {\r\n return \"Spectrum\" + SEP\r\n + \"Peptide Sequence\" + SEP\r\n + \"No. Peptide Spectrum Matches\" + SEP\r\n + \"Protein Accession\" + SEP\r\n + \"Protein Description\" + SEP;\r\n }",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader17() {\n return build_f_PanelHeader17();\n }",
"private void addHeaderForSummary(Workbook p_workBook, Sheet p_sheet)\n {\n int col = 0;\n int row = SUMMARY_HEADER_ROW;\n Row summaryHeaderRow = getRow(p_sheet, row);\n\n Cell cell_A = getCell(summaryHeaderRow, col);\n cell_A.setCellValue(m_bundle.getString(\"lb_company\"));\n cell_A.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_B = getCell(summaryHeaderRow, col);\n cell_B.setCellValue(m_bundle.getString(\"lb_job_id\"));\n cell_B.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_C = getCell(summaryHeaderRow, col);\n cell_C.setCellValue(m_bundle.getString(\"lb_job_name\"));\n cell_C.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_D = getCell(summaryHeaderRow, col);\n cell_D.setCellValue(m_bundle.getString(\"lb_language\"));\n cell_D.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_E = getCell(summaryHeaderRow, col);\n cell_E.setCellValue(m_bundle.getString(\"lb_workflow_state\"));\n cell_E.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_F = getCell(summaryHeaderRow, col);\n cell_F.setCellValue(m_bundle.getString(\"lb_mt_word_count\"));\n cell_F.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n if (usePerplexity)\n {\n Cell cell = getCell(summaryHeaderRow, col);\n cell.setCellValue(m_bundle.getString(\"lb_perplexity_wordcount\"));\n cell.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }\n\n Cell cell_G = getCell(summaryHeaderRow, col);\n cell_G.setCellValue(m_bundle.getString(\"lb_total_word_count\"));\n cell_G.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_H = getCell(summaryHeaderRow, col);\n cell_H.setCellValue(m_bundle.getString(\"lb_average_edit_distance\"));\n cell_H.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_I = getCell(summaryHeaderRow, col);\n cell_I.setCellValue(m_bundle.getString(\"lb_translation_error_rate\"));\n cell_I.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_J = getCell(summaryHeaderRow, col);\n cell_J.setCellValue(m_bundle.getString(\"lb_engine_name\"));\n cell_J.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }",
"static public String generateHeaderAndBodyLineForPrinting(Imprimable imprimable)\r\n\t{\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\t\r\n\t\tbuf.append(\"<!DOCTYPE html>\");\r\n\t\tbuf.append(\"<html>\");\r\n\t\tbuf.append(\"<head>\");\r\n\t\tbuf.append(\"<meta charset=\\\"utf-8\\\">\");\r\n\t\tbuf.append(\"<title></title>\");\r\n\t\tbuf.append(\"</head>\");\r\n\t\tbuf.append(generateBodyLineForPrinting(imprimable));\r\n\t\t\r\n\t\treturn buf.toString();\r\n\t}",
"public String getWantedProductHeader()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n String listedItemHeader = getElementText(pageFactory.listedItemHeader);\r\n return listedItemHeader;\r\n }",
"private byte[] generateHeader() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(PROTOCOL_TAG);\n\t\tsb.append(' ');\n\t\tsb.append(statusCode);\n\t\tsb.append(' ');\n\t\tsb.append(statusText);\n\t\tsb.append(LINE_SEPARATOR);\n\t\tsb.append(CONTENT_TYPE_TAG);\n\t\tsb.append(' ');\n\t\t\n\t\tif (mimeType != null && mimeType.startsWith(MIME_TYPE_CHARSET_NEEDED)) {\n\t\t\tsb.append(mimeType);\n\t\t\tsb.append(MIME_TYPE_CHARSET_ADDON);\n\t\t\tsb.append(encoding);\n\t\t} else {\n\t\t\tsb.append(mimeType);\n\t\t}\n\t\tsb.append(LINE_SEPARATOR);\n\n\t\tif (contentLength != null) {\n\t\t\tsb.append(CONTENT_LENGTH_ADDON);\n\t\t\tsb.append(contentLength);\n\t\t\tsb.append(LINE_SEPARATOR);\n\t\t}\n\n\t\tfor (var cookie : outputCookies) {\n\t\t\tsb.append(cookieOutput(cookie));\n\t\t\tsb.append(LINE_SEPARATOR);\n\t\t}\n\t\tsb.append(LINE_SEPARATOR);\n\t\treturn sb.toString().getBytes(Charset.forName(DEFAULT_HEADER_CHARSET_NAME));\n\t}",
"private static Text createHeader() {\n StringBuilder stringBuilder = new StringBuilder();\n //noinspection HardCodedStringLiteral\n stringBuilder.append(\"Offset \");\n for (int i = 0; i < 16; i++) {\n stringBuilder.append(\" 0\");\n stringBuilder.append(Integer.toHexString(i));\n }\n stringBuilder.append(System.lineSeparator()).append(System.lineSeparator());\n Text result = new Text(stringBuilder.toString());\n //noinspection HardCodedStringLiteral\n result.getStyleClass().add(\"normal\");\n return result;\n }",
"private void outputHeader(){\n System.out.printf(\"\\n%9s%11s%7s%5s%7s%8s\\n\",\"Last Name\",\"First Name\",\"Gender\",\"Rate\",\"Tenure\",\"Salary\");\n pw.printf(\"\\n%9s%11s%7s%5s%7s%8s\\n\",\"Last Name\",\"First Name\",\"Gender\",\"Rate\",\"Tenure\",\"Salary\");\n }",
"private void addHeader(Section catPart) throws BadElementException, IOException{\r\n PdfPTable header = new PdfPTable(1);\r\n PdfPCell c = new PdfPCell(Image.getInstance(\"res/brandogredninglogo.png\"));\r\n c.setBackgroundColor(COLOR_BLUE);\r\n //c.setBorderColor(BaseColor.RED);\r\n header.setHeaderRows(0);\r\n header.addCell(c);\r\n header.setWidthPercentage(100.0f);\r\n \r\n catPart.add(header);\r\n }",
"protected void writeHeader(PrintStream wps, List listColumn, char cDelim)\n {\n String sData;\n int c = 0;\n for (Iterator iCol = listColumn.iterator(); iCol.hasNext(); )\n {\n ReportColumnView columnView = (ReportColumnView) iCol.next();\n if (columnView != null)\n {\n if (columnView.isVisible())\n {\n if (c != 0)\n {\n wps.print(cDelim);\n }\n c++;\n Object oResult = columnView.getHeader();\n sData = oResult == null ? \"\" : oResult.toString();\n wps.print(sData);\n }\n }\n }\n wps.println();\n // without this line sometimes the header is not printed correctly.\n wps.flush();\n }",
"public String printHeader() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"\\n***********************************\\n\");\n sb.append(\"\\tAbacus\\n\");\n try {\n sb.append(\"\\tVersion: \");\n //sb.append(abacus.class.getPackage().getImplementationVersion());\n sb.append(\"2.6\");\n } catch (Exception e) {\n // Don't print anything\n }\n sb.append(\"\\n***********************************\\n\")\n .append(\"Developed and written by: Damian Fermin and Alexey Nesvizhskii\\n\")\n .append(\"Modifications by Dmitry Avtonomov\\n\")\n .append(\"Copyright 2010 Damian Fermin\\n\\n\")\n .append(\"Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\")\n .append(\"you may not use this file except in compliance with the License.\\n\")\n .append(\"You may obtain a copy of the License at \\n\\n\")\n .append(\"http://www.apache.org/licenses/LICENSE-2.0\\n\\n\")\n .append(\"Unless required by applicable law or agreed to in writing, software\\n\")\n .append(\"distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\")\n .append(\"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\")\n .append(\"See the License for the specific language governing permissions and\\n\")\n .append(\"limitations under the License.\\n\\n\");\n return sb.toString();\n }",
"public void visit(Header n){\r\n\t\tif(tempNode.notifyNode().equals(\"Header\")){\r\n\t\t\ttempNode = nodeList.get(sequence);\r\n\t\t\tArrayList<Token> tokenList = tempNode.getTokenList();\r\n\t\t\tString tmp =\"\";\r\n\t\t\tfor(int i=0;i<tempNode.getTokenListSize();i++){\r\n\t\t\t\tvisit(tokenList.get(i));\r\n\t\t\t}\r\n\r\n\t\t\tif(tokenList.size()<1)\r\n\t\t\ttmp = \"<h\"+tempNode.htype+\">\"+\"</h\"+tempNode.htype+\">\";\r\n\t\t\telse\r\n\t\t\ttmp = \"<h\"+tempNode.htype+\">\"+line+\"</h\"+tempNode.htype+\">\";\r\n\t\t\tline = tmp;\r\n\t\t}\r\n\t }",
"protected JTableHeader createDefaultTableHeader() {\n return new JTableHeader(columnModel) {\n public String getToolTipText(MouseEvent e) {\n java.awt.Point p = e.getPoint();\n int index = columnModel.getColumnIndexAtX(p.x);\n int realIndex = columnModel.getColumn(index).getModelIndex();\n return columnToolTips[realIndex];\n }\n };\n }",
"protected void addXmlHeader()\n {\n addString(XmlUtil.formattedPaginatedResultSetXmlDtd());\n }",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader29() {\n return build_f_PanelHeader29();\n }",
"Group renderHeader(final List<GridColumn.HeaderMetaData> headerMetaData,\n final GridHeaderColumnRenderContext context,\n final BaseGridRendererHelper.RenderingInformation renderingInformation);",
"@Override\n\t//Start, end, headache count, average severity, duration\n\tpublic String buildReport() {\n\t\tsetHeadacheInfo(); \n\t\tStringBuilder hsReport = new StringBuilder(); \n\t\thsReport.append(\"\\nReport Start Date: \"); \n\t\thsReport.append(getStartDate().toString() + \"\\n\"); \n\t\thsReport.append(\"Report End Date: \"); \n\t\thsReport.append(getEndDate().toString() + \"\\n\"); \n\t\thsReport.append(\"Headache Count: \"); \n\t\thsReport.append(getHeadacheList().size() + \"\\n\"); \n\t\thsReport.append(\"Average Severty: \"); \n\t\thsReport.append(getAverageSeverity() + \"\\n\"); \n\t\thsReport.append(\"Average Duration (hours): \"); \n\t\thsReport.append(getAverageDuration() + \"\\n\"); \n\t\treturn hsReport.toString(); \n\t}",
"private void initHorPageTitle() {\n\t\tLabel pageTitle = new Label(\"Reports\");\n\t\tpageTitle.setSizeFull();\n\t\tpageTitle.setWidth(\"800px\");\n\t\tpageTitle.setHeight(\"45px\");\n\t\tpageTitle.addStyleName(\"posPageTitle\");\n\t\thorPageTitle.addComponent(pageTitle);\n\t\troot.addComponent(horPageTitle);\n\t\troot.setComponentAlignment(horPageTitle, Alignment.TOP_CENTER);\n\t}",
"private static void printHeading(){\n\t\tSystem.out.println(\"Your Name\");\n\t\tSystem.out.println(\"Course name and semester\");\n\t\tSystem.out.println(\"Programming Project 1\");\n\t\tSystem.out.println(\"Your Name in Code\");\n\t\tSystem.out.println();\n\n\t}",
"private void writeHEADER() throws IOException {\n\t\tmeta.compute_checksum();\n\t\tmeta.write();\n\t\t\n\t\t// We could also generate a non-aldus metafile :\n\t\t// writeClipboardHeader(meta);\n\t\t\n\t\t// Generate the standard header common to all metafiles.\n\t\thead.write();\n\t}",
"private void buildHeader(Layout parent) {\n\n }",
"public static String header(int homework, double project, String lastModified)\n {\n String temp = \"\";\n temp += getHorizontalLine(SYMBOL, LINE_LENGTH) + \"\\n\";\n temp += authorLine();\n temp += courseLine();\n temp += timeLine();\n temp += homeworkLine(homework);\n temp += projectLine(project);\n temp += lastModifiedLine(lastModified);\n temp += getHorizontalLine(SYMBOL, LINE_LENGTH);\n return temp;\n }",
"public void generatePostHeader (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n request.getParameter(\"Blabbo\"); // Dummy read to send continue back to the client.\n BuildHtmlHeader(new PrintWriter (response.getOutputStream()), getTitle());\n }",
"private ConfigurationHTMLPrinter doHeaderRow() {\n println(\"<tr>\").incrementIndent();\n doHeaderCell(\"Name\");\n doHeaderCell(\"Default value\");\n doHeaderCell(\"Aliases\");\n doHeaderCell(\"Value type\");\n doHeaderCell(\"Description\");\n return decrementIndent().println(\"</tr>\");\n }",
"static void homeworkHeader(){\n //homeworkHeader function which when called will produce the homework header\n putChars(30, '=');//displays 10 =\n System.out.println(\"Homework Header\");\n putChars(30, '=');//displays 10 =\n System.out.println(\"Ticket : 86713\");\n System.out.println( \"Course : CMPR 112 \");\n System.out.println( \"Student : Ben Halpern \");\n System.out.println( \"Instructor : Joel Kirscher\");\n System.out.println( \"Environment: Win 10 NetBeans \");\n System.out.println( \"Project Title : Assignment 05 - Java Methods \");\n System.out.println(\"\\n\\n\");\n //end homework header output\n }",
"Rule Header() {\n // Push 1 HeaderNode onto the value stack\n return Sequence(\n FirstOf(\n Include(),\n CppInclude(),\n Namespace()),\n actions.pushHeaderNode());\n }",
"public static void printHeader(int homework, double project, String lastModified)\n {\n System.out.println(header(homework, project, lastModified));\n }",
"private static void outputHeader(XMLTree channel, SimpleWriter out) {\n assert channel != null : \"Violation of: channel is not null\";\n assert out != null : \"Violation of: out is not null\";\n assert channel.isTag() && channel.label().equals(\"channel\") : \"\"\n + \"Violation of: the label root of channel is a <channel> tag\";\n assert out.isOpen() : \"Violation of: out.is_open\";\n\n int start = 0;\n int titleIndex = getChildElement(channel, \"title\");\n int descriptionIndex = getChildElement(channel, \"description\");\n int itemIndex = getChildElement(channel, \"item\");\n int linkIndex = getChildElement(channel, \"link\");\n \n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n // if there's no title print that\n\t\tif(channel.child(titleIndex).numberOfChildren() == 0)\n\t\t{\n\t\t\tout.println(\"<head>\");\n\t\t\tout.println(\"<title> Empty Title </title>\");\n\t\t\tout.println(\"<a href=\" + channel.child(linkIndex).child(0) + \"><h1>\" + channel.child(titleIndex).child(0) + \"</h1>\");\n\t\t\tout.println(\"</head>\");\n\t\t}\n\t\t// else print title\n\t\telse\n\t\t{\n\t\t\tout.println(\"<head>\");\n\t\t\tout.println(\"<title>\" + channel.child(titleIndex).child(0) + \"</title>\");\n \t\tout.println(\"<a href=\\\"\" + channel.child(linkIndex).child(0) +\"\\\"><h1> \" + channel.child(titleIndex).child(0) + \"</h1></a>\");\n \t\tout.println(\"</head>\");\n\t\t}\n\t\t\n\t\t// if no description\n\t\tif(channel.child(descriptionIndex).numberOfChildren() == 0)\n\t\t{\n\t\t\tout.println(\"<p>\");\n\t\t\tout.println(\"No description\");\n\t\t\tout.println(\"</p>\");\n\t\t}\n\t\t// else print description\n\t\telse\n\t\t{\n\t\t\tout.println(\"<p>\");\n\t\t\tout.println(channel.child(descriptionIndex).child(0));\n\t\t\tout.println(\"</p>\");\n\t\t} \n\t\t\n\t\t// print out basic setup for the table\n\t\tout.println(\"<table border=\\\"1\\\">\");\n\t\tout.println(\"<tr>\");\n \tout.println(\"<th>Date</th>\");\n \tout.println(\"<th>Source</th>\");\n \tout.println(\"<th>News</th>\");\n \tout.println(\"</tr>\");\n \t\n \tfor(int i = 0; i < channel.numberOfChildren() - itemIndex; i++)\n \t{\n \t\tprocessItem(channel.child(itemIndex + i), out);\n \t}\n }",
"private void printHeading()\n {\n System.out.println(\"==============================================\");\n System.out.println(\" Stock Management Application \");\n System.out.println(\" App05: by Haroon Sadiq \");\n System.out.println(\"==============================================\");\n }",
"public String getPageTitle() {\r\n\t\treturn this.pageTitle;\r\n\t}",
"public void yieldHead(PageContext pageContext) throws IOException\n {\n yield(\"head\", pageContext);\n }",
"public JLabel buildDefaultHeader(){\n JLabel returnHeader = new JLabel();\n returnHeader.setHorizontalAlignment(SwingConstants.LEFT);\n returnHeader.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 48)); // Great font, makes it pop\n returnHeader.setForeground(Color.WHITE);\n returnHeader.setBackground(Color.BLACK);\n \n return returnHeader;\n }",
"public void writeHeader(ReporterIonQuantification reporterIonQuantification) throws IOException {\r\n\r\n boolean needSecondLine = false;\r\n ArrayList<String> sampleIndexes = new ArrayList<>(reporterIonQuantification.getSampleIndexes());\r\n Collections.sort(sampleIndexes);\r\n\r\n boolean firstColumn = true;\r\n\r\n if (indexes) {\r\n writer.writeHeaderText(\"\");\r\n writer.addSeparator();\r\n }\r\n\r\n for (ExportFeature exportFeature : identificationFeatures) {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.addSeparator();\r\n }\r\n\r\n writer.writeHeaderText(exportFeature.getTitle());\r\n }\r\n\r\n for (ReporterExportFeature exportFeature : quantificationFeatures) {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.addSeparator();\r\n }\r\n\r\n writer.writeHeaderText(exportFeature.getTitle(), reporterStyle);\r\n\r\n if (exportFeature.hasChannels()) {\r\n\r\n for (int i = 1; i < sampleIndexes.size(); i++) {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.addSeparator();\r\n }\r\n\r\n writer.writeHeaderText(\" \", reporterStyle); // Space used for the excel style\r\n }\r\n\r\n needSecondLine = true;\r\n\r\n }\r\n\r\n }\r\n\r\n if (needSecondLine) {\r\n\r\n writer.newLine();\r\n firstColumn = true;\r\n\r\n if (indexes) {\r\n writer.addSeparator();\r\n }\r\n\r\n for (ExportFeature exportFeature : identificationFeatures) {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.writeHeaderText(\"\");\r\n writer.addSeparator();\r\n }\r\n\r\n }\r\n\r\n for (ReporterExportFeature exportFeature : quantificationFeatures) {\r\n\r\n if (exportFeature.hasChannels()) {\r\n\r\n for (String sampleIndex : sampleIndexes) {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.writeHeaderText(\"\", reporterStyle);\r\n writer.addSeparator();\r\n }\r\n\r\n writer.write(reporterIonQuantification.getSample(sampleIndex), reporterStyle);\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (firstColumn) {\r\n firstColumn = false;\r\n } else {\r\n writer.writeHeaderText(\"\", reporterStyle);\r\n writer.addSeparator();\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n writer.newLine();\r\n }",
"private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader5() {\n return build_f_PanelHeader5();\n }",
"private void initialiseHeader()\n\t{\n\t ListHead head = null;\n\n\t head = super.getListHead();\n\n\t //init only once\n\t if (head != null)\n\t {\n\t \treturn;\n\t }\n\n\t head = new ListHead();\n\n\t // render list head\n\t if (this.getItemRenderer() instanceof WListItemRenderer)\n\t {\n\t \t((WListItemRenderer)this.getItemRenderer()).renderListHead(head);\n\t }\n\t else\n\t {\n\t \tthrow new ApplicationException(\"Rendering of the ListHead is unsupported for \"\n\t \t\t\t+ this.getItemRenderer().getClass().getSimpleName());\n\t }\n\n\t //attach the listhead\n\t head.setParent(this);\n\n\t return;\n\t}",
"public String getPageTitle() {\n\t\treturn pageTitle;\n\t}",
"public void\nprintHir( String pHeader );",
"private static String getProteinHeader() {\r\n return \"Protein Family No.\" + SEP\r\n + \"Protein Family Name\" + SEP\r\n + \"Spectral Count\" + SEP\r\n + \"Protein No.\" + SEP\r\n + \"Accession\" + SEP\r\n + \"Description\" + SEP\r\n + \"Species\" + SEP\r\n + \"MW [kDa]\" + SEP;\r\n }",
"private static UINode _createGlobalHeaders()\n {\n MarlinBean globalHeaders = new MarlinBean(FLOW_LAYOUT_NAME);\n\n //\n // add the client header\n //\n globalHeaders.addIndexedChild(\n ContextPoppingUINode.getUINode(NAVIGATION2_CHILD));\n\n //\n // create and add the default header\n //\n MarlinBean defaultHeader = new MarlinBean(GLOBAL_HEADER_NAME);\n\n defaultHeader.setAttributeValue(\n RENDERED_ATTR,\n new NotBoundValue(\n PdaHtmlLafUtils.createIsRenderedBoundValue(NAVIGATION2_CHILD)));\n\n globalHeaders.addIndexedChild(defaultHeader);\n\n return globalHeaders;\n }",
"public final String getPageTitle() {\n\t\treturn pageTitle;\n\t}",
"public static void printHeader(int homework, String homeworkDescription, \n double project, String projectDescription, String lastModified)\n {\n System.out.println(header(homework, homeworkDescription, project, \n projectDescription, lastModified));\n }",
"public void writeHeader(PrintWriter out, RequestProperties reqState)\n throws IOException\n {\n out.write(this.getPageHeader());\n }",
"public static String header(int homework, String homeworkDescription, \n double project, String projectDescription, String lastModified)\n {\n String temp = \"\";\n temp += getHorizontalLine(SYMBOL, LINE_LENGTH) + \"\\n\";\n temp += authorLine();\n temp += courseLine();\n temp += timeLine();\n temp += homeworkLine(homework, homeworkDescription);\n temp += projectLine(project, projectDescription);\n temp += lastModifiedLine(lastModified);\n temp += getHorizontalLine(SYMBOL, LINE_LENGTH);\n return temp;\n }",
"@Override\n protected void setPageHeading(TextView headingField) {\n }",
"private void setupHeader(final String filePath) throws IOException{\n\t\tFile headerFile = new File(filePath);\n\t\tString dataString = new String();\n\t\tBufferedReader reader = new BufferedReader(new FileReader(headerFile));\n\t\twhile((dataString = reader.readLine()) != null){\n\t\t\theaderText.append(dataString);\n\t\t\theaderText.append(System.lineSeparator());\n\t\t}\n\t\treader.close();\n\t}",
"@Test \n\tpublic void homePageHeaderTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// Validate page header \n\t\tString header = homePage.getHeader();\n\t\tAssert.assertTrue(header.equals(\"\"));\n\n\t\t// Fetch latin quote: \n\t\tString latinQuote = homePage.getQuote(\"latin\");\n\t\tAssert.assertEquals(\"\\\"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...\\\"\", latinQuote);\n\n\t\t// Fetch english quote, which is: \n\t\tString englishQuote = homePage.getQuote(\"english\"); \n\t\tAssert.assertEquals(\"\\\"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain...\\\"\",englishQuote); \n\t}",
"private org.gwtbootstrap3.client.ui.Heading get_f_Heading40() {\n return build_f_Heading40();\n }",
"@Override\r\n\tpublic void loadHeader() {\n\r\n\t}",
"public static HeaderMyAccountPO getHeaderMyAccountPage(WebDriver driver) {\n\t\treturn null;\r\n\t}",
"private static String getPSMHeader() {\r\n return \"PSM No.\" + SEP\r\n + \"Spectrum title\" + SEP\r\n + \"Peptide Sequence\" + SEP\r\n + \"Protein Accession\" + SEP\r\n + \"Intensity Score\" + SEP\r\n + \"Matched Peaks\" + SEP;\r\n }",
"public String pagetitle() throws Exception{\r\n\t\t\ttry {\r\n\t\t\t\tStr_pagetitle = driver.getTitle();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"FAILED TO GET THE PAGE TITLE:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Str_pagetitle;\r\n\t\t}"
] | [
"0.76009935",
"0.7561853",
"0.7038672",
"0.7038672",
"0.6659461",
"0.664923",
"0.6353635",
"0.62986916",
"0.6287068",
"0.6214695",
"0.61683893",
"0.6127288",
"0.6114984",
"0.6081878",
"0.60683256",
"0.60683256",
"0.60501444",
"0.6025122",
"0.59871906",
"0.5968306",
"0.5956061",
"0.5939407",
"0.5927941",
"0.58685714",
"0.5856868",
"0.579545",
"0.5793778",
"0.57642883",
"0.57587224",
"0.5750846",
"0.57496566",
"0.57409835",
"0.57372934",
"0.5735648",
"0.57125634",
"0.5700699",
"0.56803244",
"0.56620914",
"0.56596154",
"0.56516016",
"0.5616826",
"0.5616361",
"0.56022894",
"0.55966824",
"0.5593352",
"0.55822915",
"0.5580588",
"0.55788267",
"0.55714226",
"0.55538243",
"0.554408",
"0.5541204",
"0.5535766",
"0.55333155",
"0.5517446",
"0.5514109",
"0.5504691",
"0.54856825",
"0.5480768",
"0.54590106",
"0.545664",
"0.5453117",
"0.5449137",
"0.54370475",
"0.54358095",
"0.54264396",
"0.5422461",
"0.541771",
"0.5411362",
"0.5404172",
"0.5397457",
"0.5380559",
"0.537876",
"0.5365812",
"0.5356524",
"0.5347865",
"0.53450114",
"0.5325101",
"0.5323344",
"0.5322118",
"0.53185403",
"0.53123873",
"0.5285798",
"0.52846396",
"0.5283183",
"0.5278948",
"0.5274417",
"0.5262412",
"0.5260173",
"0.52517474",
"0.52436674",
"0.5229626",
"0.5228623",
"0.52176523",
"0.52087694",
"0.5204851",
"0.52047276",
"0.5204715",
"0.5195209",
"0.5189557"
] | 0.6236438 | 9 |
Method to Generate the Page Footer of the Report. | private void prnFOOTR()
{
try
{
if(cl_dat.M_intLINNO_pbst >= 64)
{
dosREPORT.writeBytes("-------------------------------------------------------------------------------------------------------------------------------------");
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))
prnFMTCHR(dosREPORT,M_strEJT);
if(M_rdbHTML.isSelected())
dosREPORT.writeBytes("<P CLASS = \"breakhere\">");
prnHEADER();
}
dosREPORT.writeBytes("-------------------------------------------------------------------------------------------------------------------------------------\n");
dosREPORT.writeBytes ("\n\n\n\n\n");
dosREPORT.writeBytes(padSTRING('L'," ",10));//margin
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))
prnFMTCHR(dosREPORT,M_strBOLD);
if(M_rdbHTML.isSelected())
dosREPORT.writeBytes("<B>");
dosREPORT.writeBytes(padSTRING('R',"PREPARED BY",40));
dosREPORT.writeBytes(padSTRING('R',"CHECKED BY ",40));
dosREPORT.writeBytes(padSTRING('R',"H.O.D (MHD) ",40));
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))
prnFMTCHR(dosREPORT,M_strNOBOLD);
if(M_rdbHTML.isSelected())
dosREPORT.writeBytes("</B>");
dosREPORT.writeBytes("\n");
dosREPORT.writeBytes("-------------------------------------------------------------------------------------------------------------------------------------\n");
dosREPORT.writeBytes(" System generated report, hence signature not required \n");
cl_dat.M_intLINNO_pbst += 8;
if(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst))
{
prnFMTCHR(dosREPORT,M_strEJT);
prnFMTCHR(dosREPORT,M_strNOCPI17);
prnFMTCHR(dosREPORT,M_strCPI10);
}
}
catch(Exception L_EX)
{
setMSG(L_EX + " prnFOOTR",'E');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String getPageFooter()\n {\n if (this.pageFooter == null) {\n String copyright = (this.privateLabel != null)? this.privateLabel.getCopyright() : \"\";\n StringBuffer sb = new StringBuffer();\n sb.append(\"<center>\");\n sb.append(\"<hr><span style='font-size:7pt;'>\" + copyright + \"</span>\");\n sb.append(\"</center>\");\n this.pageFooter = sb.toString();\n }\n return this.pageFooter;\n }",
"public void yieldFooter(PageContext pageContext) throws IOException\n {\n yield(\"footer\", pageContext);\n }",
"private static String footer() {\r\n String output = \"\";\r\n\r\n output += \"\\n\\\\end{document}\";\r\n\r\n return output;\r\n }",
"@Override\n\tprotected void writeFooter() throws IOException {\n\t}",
"public static String printFooter()\r\n\t{\r\n\t\treturn \"</html></body>\";\r\n\t}",
"public void generateGetFooter (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n BuildHtmlFooter(new PrintWriter (response.getOutputStream()));\n }",
"public void generatePostFooter (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n BuildHtmlFooter(new PrintWriter (response.getOutputStream()));\n }",
"public void setPageFooter(String footer)\n {\n // ignore\n }",
"@Override\n\tpublic String formatFooter() {\n\t\treturn \"\\n\";\n\t}",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter14() {\n return build_f_PanelFooter14();\n }",
"protected String elaboraFooter() {\n String testo = A_CAPO;\n boolean nascosta = pref.isBool(FlowCost.USA_DEBUG);\n String cat;\n\n if (usaNote) {\n testo += usaNote();\n }// end of if cycle\n\n if (usaVociCorrelate) {\n testo += usaVociCorrelate();\n }// end of if cycle\n\n testo += LibWiki.setPortale(tagHeadTemplateProgetto);\n cat = tagCategoria;\n cat = nascosta ? LibWiki.setNowiki(cat) : cat;\n testo += cat;\n\n return testo;\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter36() {\n return build_f_PanelFooter36();\n }",
"public Class<?> footer() {\n return footer;\n }",
"public void buildClassFooter() {\n\t\twriter.writeFooter();\n\t}",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter26() {\n return build_f_PanelFooter26();\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter46() {\n return build_f_PanelFooter46();\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter83() {\n return build_f_PanelFooter83();\n }",
"private void createFooterPanel()\n\t{\n\t\tGridLayout footerGrid = new GridLayout(4,5);\n\t\tfooterGrid.setHgap (5);\n\t\tfooterGrid.setVgap (5);\n\t\tfooterPanel.setLayout(footerGrid);\n\t\tfooterPanel.add (seven);\n\t\tfooterPanel.add (eight);\n\t\tfooterPanel.add (nine);\n\t\tfooterPanel.add (divide);\n\t\tfooterPanel.add (percent);\n\t\tfooterPanel.add (four);\n\t\tfooterPanel.add (five);\n\t\tfooterPanel.add (six);\n\t\tfooterPanel.add (multiply);\n\t\tfooterPanel.add (reciprocal);\n\t\tfooterPanel.add (one);\n\t\tfooterPanel.add (two);\n\t\tfooterPanel.add (three);\n\t\tfooterPanel.add (subtract);\n\t\tfooterPanel.add(PI);\n\t\tfooterPanel.add (zero);\n\t\tfooterPanel.add (decimalPoint);\n\t\tfooterPanel.add (equals);\n\t\tfooterPanel.add (add);\n\t\tfooterPanel.add(e);\n\t}",
"public void writeFooter(PrintWriter out, RequestProperties reqState) \n throws IOException\n {\n out.write(this.getPageFooter());\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter73() {\n return build_f_PanelFooter73();\n }",
"public static FooterMyAccountPage getFooterMyAccountPage(WebDriver driver) {\n\t\treturn null;\r\n\t}",
"public void getFooterPageByName(WebDriver driver, String pageName) {\r\n\t\twaitForElementClickable(driver, BasePageLiveGuruUIs.DYNAMIC_PAGE_FOOTER, pageName);\r\n\t\tclick(driver, BasePageLiveGuruUIs.DYNAMIC_PAGE_FOOTER, pageName);\r\n\t}",
"public void onEndPage(PdfWriter writer, Document document) {\r\n\r\n\t\tImage image;\r\n\t\tFont fontStyle = new Font();\r\n\t\tfontStyle.setColor(255, 255, 255);\r\n\t\tfontStyle.setSize(10);\r\n\t\ttry {\r\n\t\t\timage = Image.getInstance(ResourceUtils.getFile(\"classpath:images\"+File.separator+\"cpmis-submission-pdf-footer.png\").getAbsolutePath());\r\n\t\t\tint indentation = 0;\r\n\t\t\tfloat scaler = ((document.getPageSize().getWidth() - indentation) / image.getWidth()) * 100;\r\n\t\t\timage.scalePercent(scaler);\r\n\t\t\timage.setAbsolutePosition(0, 0);\r\n\t\t\tdocument.add(image);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tString date = new SimpleDateFormat(\"dd-MM-yyyy\").format(new Date());\r\n\t\tColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER,\r\n\t\t\t\tnew Phrase(String.format(\"Page - %d, Printed on : %s %s\", pagenumber, date, domainName), fontStyle),\r\n\t\t\t\t(document.getPageSize().getWidth()) / 2, document.bottomMargin() - 25, 0);\r\n\t}",
"FooterType createFooterType();",
"public void onEndPage(PdfWriter writer, Document document) {\n\t\tRectangle page = document.getPageSize();\n\n\n\t\tFont HeaderStyle = new Font(); \n\t\tHeaderStyle.setSize(18);\n\t\tHeaderStyle.setStyle(Font.BOLD); \n\t\tPdfPTable headertable = new PdfPTable(1);\n\t\tPdfPCell pageNo = new PdfPCell(new Phrase(String.format(\"Page %d \", writer.getPageNumber())));\n\t\t//pageNo.setHorizontalAlignment(Element.ALIGN_RIGHT);\n\t\tpageNo.setPaddingBottom(30);\n\t\tpageNo.setBorder(Rectangle.NO_BORDER);\n\t\theadertable.addCell(pageNo);\n//\t\theadertable.setTotalWidth(page.getWidth() - document.leftMargin() \n//\t\t\t\t- document.rightMargin()); \n\n//\t\theadertable.writeSelectedRows(0, -1, document.leftMargin(), page.getHeight() - document.topMargin() + headertable.getTotalHeight(), writer \n//\t\t\t\t.getDirectContent());\n\t\tFont myContentStyledata = new Font(); \n\t\tmyContentStyledata.setSize(7);\n\t\tmyContentStyledata.setStyle(Font.NORMAL);\n\n\t\tPdfPTable foot = new PdfPTable(1);\n\t\tPdfPCell footercell = new PdfPCell(new Phrase(footer,myContentStyledata));\n\t\tfootercell.setBorder(Rectangle.TOP);\n\t\tfoot.addCell(footercell);\n\t\tfoot.setTotalWidth(page.getWidth() - document.leftMargin() - document.rightMargin());\n\t\tfoot.writeSelectedRows(0, -1, document.leftMargin(), document.bottomMargin(),\n\t\t\t\twriter.getDirectContent());\n\t}",
"protected abstract Widget instantiateFooterPanel () ;",
"protected void BuildHtmlFooter(PrintWriter out) throws IOException\n {\n out.println(\"</BODY></HTML>\");\n out.flush();\n }",
"@Override\n public void onEndPage(PdfWriter writer, Document document) {\n if (body) {\n page++;\n ColumnText.showTextAligned(writer.getDirectContent(),\n Element.ALIGN_CENTER, new Phrase(page + \"\"),\n (document.right() + document.left()) / 2, document.bottom() - 18, 0);\n }\n }",
"private static void outputFooter(SimpleWriter out) {\n assert out != null : \"Violation of: out is not null\";\n assert out.isOpen() : \"Violation of: out.is_open\";\n\n out.println(\"</table>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n }",
"public JQMFooter(String text) {\r\n\t\tsuper(\"footer\", \"jpm4gwt-footer\", text);\r\n\t}",
"private static void writeHtmlFooter(SimpleWriter out) {\n out.println(\"</body>\");\n out.println(\"</html>\");\n }",
"public JQMFooter(String text) {\n\t\tsuper(\"footer\", \"jpm4gwt-footer\", text);\n\t}",
"private void addColumnFooter()\n {\n addIndent();\n openEndTag(COLUMN);\n closeTag();\n }",
"private void addRecordFooter()\n {\n addIndent();\n openEndTag(RECORD);\n closeTag();\n }",
"@Override\n public FooterAbstractClass getFooter(String FooterType) {\n if(FooterType == null){\n return null;\n }\n if(FooterType.equalsIgnoreCase(\"VipFooter\")){\n return new VipCustFooter();\n } else return null;\n\n }",
"private void Html_footer_Summary(int total, int pass, int fail, int skipp, long timetoexecute) {\n\n\t\thtmlWriter.println(\"<br/><a href='../test-output/index.html'>TestNG default Report</a>\");\n\t\thtmlWriter.flush();\n\t}",
"@Override\n\t\t\tpublic void onAnimationEnd(Animation animation) {\n\t\t\t\tfooter.layout(footer.getLeft(), footer.getTop() - (footer.getHeight() / 2), footer.getRight(), footer.getBottom() - (footer.getHeight() / 2));\n\t\t\t}",
"public boolean isFooter() {\n return isFooter;\n }",
"public boolean hasFooter() {\n return hasFooter;\n }",
"protected String printEnd() \r\n\t{\r\n\t\tSystem.out.println(\"End of Weather Weather Details!\\n\\n\");\r\n\t\treturn null;\r\n\t}",
"void Footer() {\n\t\tJPanel panel = new JPanel(new FlowLayout());\r\n\t\tpanel.add(btnLogin);\r\n\t\tpanel.add(btnReset);\r\n\t\t\r\n\t\tadd(panel, BorderLayout.SOUTH);\r\n\t\t\r\n\t\t//Action Listener untuk melakukan action pindah halaman\r\n\t\tbtnLogin.addActionListener(this);\r\n\t\tbtnReset.addActionListener(this);\r\n\t}",
"float getSectionFooterHeight(int section);",
"private void createMainMenuFooterComposite() {\n\n\t\tGridData gridData22 = new GridData();\n\t\tgridData22.horizontalAlignment = GridData.BEGINNING;\n\t\tgridData22.verticalAlignment = GridData.END;\n\t\tGridData gridData2 = new GridData();\n\t\tgridData2.grabExcessHorizontalSpace = true;\n\t\tgridData2.grabExcessVerticalSpace = true;\n\t\tgridData2.verticalAlignment = GridData.END;\n\t\tgridData2.heightHint = 75;\n\t\tgridData2.widthHint = 75;\n\t\tgridData2.horizontalAlignment = GridData.END;\n\n\t\tGridLayout gridLayout2 = new GridLayout();\n\t\tgridLayout2.horizontalSpacing = 30;\n\t\tgridLayout2.marginHeight = 20;\n\t\tgridLayout2.numColumns = 2;\n\t\tgridLayout2.marginWidth = 20;\n\n\t\tGridData gridData = new GridData();\n\t\tgridData.grabExcessHorizontalSpace = true;\n\t\tgridData.verticalAlignment = GridData.END;\n\t\tgridData.heightHint = 150;\n\t\tgridData.horizontalAlignment = GridData.FILL;\n\t\tmainMenuFooterComposite = new Composite(this, SWT.NONE);\n\t\tmainMenuFooterComposite.setBackground(new Color(Display.getCurrent(),\n\t\t\t\t255, 255, 255));\n\t\tmainMenuFooterComposite.setLayout(gridLayout2);\n\t\tmainMenuFooterComposite.setLayoutData(gridData);\n\n\t\tlblBallyCopyright = new CbctlLabel(mainMenuFooterComposite, SWT.NONE);\n\t\tlblBallyCopyright.setText(LabelLoader.getLabelValue(LabelKeyConstants.BALLY_COPYRIGHT_LABEL));\n\t\tlblBallyCopyright.setLayoutData(gridData22);\n\t\tlblBallyCopyright.setFont(new Font(Display.getDefault(), \"Arial\", 8, SWT.NORMAL));\n\t\tbtnExit = new CbctlButton(mainMenuFooterComposite, SWT.NONE, \"\",\n\t\t\t\tLabelKeyConstants.EXIT_BUTTON);\n\t\tbtnExit.setImage(new Image(Display.getCurrent(), getClass()\n\t\t\t\t.getResourceAsStream(imgExitBtn)));\n\t\tbtnExit.setLayoutData(gridData2);\n\t}",
"public int getEndPage() {\n return endPage;\n }",
"private int getPageEnd() {\n if(itemrow==0)\n return 1;\n if(itemrow%displaylimit!=0)\n return itemrow / displaylimit + 1;\n else\n return itemrow / displaylimit;\n }",
"public void onFooterRefresing();",
"@Override\n public void addFooter(HeaderText footerDivString)\n {\n Div headerDiv = new Div();\n headerDiv.add(footerDivString);\n headerDiv.addClass(\"ui-layout-footer\");\n getFooters().add(headerDiv);\n //getChildren().add(headerDiv);\n }",
"public void onEndPage(PdfWriter writer, Document document)\n\t{\n\t\tint pageN = writer.getPageNumber();\n\t\tString text = \"\"+pageN;\n\t\tString separator = \" / \";\n\t\tfloat text_len = bf.getWidthPoint(text, 8);\n\t\tfloat sep_len = bf.getWidthPoint(separator, 8);\n\t\tcb.beginText();\n\t\tcb.setFontAndSize(bf, 8);\n\t\tfloat absMiddle = (document.right()-document.left())/2+document.left();\n\t\tcb.setTextMatrix(absMiddle-text_len-(sep_len/2), 30);\n\t\tcb.showText(text);\n\t\tcb.setTextMatrix( absMiddle-(sep_len/2), 30 );\n\t\tcb.showText(separator);\n\t\tcb.endText();\n\t\tcb.addTemplate(template, absMiddle+(sep_len/2), 30);\n\n\n\t\t// write the headertable\n\t\ttHeader.setTotalWidth(document.right() - document.left());\n\t\ttHeader.writeSelectedRows(0, -1, document.left(), document.getPageSize().height() - 20, cb);\n\t}",
"public String getPlayerListFooter ( ) {\n\t\treturn extract ( handle -> handle.getPlayerListFooter ( ) );\n\t}",
"public void setEndPage(int value) {\n this.endPage = value;\n }",
"@InnerAccess void visitEnd ()\n\t{\n\t\tclassWriter.visitEnd();\n\t}",
"public void endPage() {\n\n\t\tif (super.getRequestWrapper().getSession(false) != null) {\n\t\t\tthis.dataComposer.endPage();\n\t\t}\n\t}",
"public StyleFooterElement(OdfFileDom ownerDoc) {\n super(ownerDoc, ELEMENT_NAME);\n }",
"private void writeFinalReports() {\n\t\tSystem.out.println(\"Printing data to output files ...\");\n\t\twritePropertyData();\n\t\twriteClassData();\n\t\tSystem.out.println(\"Finished printing data.\");\n\t}",
"private void generateOutgoingReport() {\r\n\r\n\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\tstringBuilder.append(\"\\n----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Outgoing Daily Amount \\n\")\r\n\t\t\t\t.append(\"----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Date | Trade Amount \\n\")\r\n\t\t\t\t.append(\"-----------------+----------------------\\n\");\r\n\t\tallOutgoings.entrySet().forEach(\r\n\t\t\t\tkey -> stringBuilder.append(key.getKey() + \" | \" + key.getValue().get() + \"\\n\"));\r\n\t\tdataWriter.write(stringBuilder.toString());\r\n\t}",
"public static void main(String[] args)\n {\n String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout();\n\n // Load Presentation\n Presentation pres = new Presentation(dataDir + \"headerTest.pptx\");\n\n // Setting Footer\n pres.getHeaderFooterManager().setAllFootersText(\"My Footer text\");\n pres.getHeaderFooterManager().setAllFootersVisibility(true);\n\n // Access and Update Header\n IMasterNotesSlide masterNotesSlide = pres.getMasterNotesSlideManager().getMasterNotesSlide();\n if (null != masterNotesSlide)\n {\n updateHeaderFooterText(masterNotesSlide);\n }\n\n // Save presentation\n pres.save(dataDir + \"HeaderFooterJava.pptx\", SaveFormat.Pptx);\n\n //ExEnd:ManageHeaderFooterText\n\n }",
"@Override\n public void pageBreak()\n {\n }",
"double getFooterMargin();",
"@AfterMethod\n\tpublic void end()\n\t{\n\n\t}",
"private void onFinish() {\r\n\t\t//used for create end html tags\r\n\t\tendHtmlPage(fout);\r\n\r\n\t\t//used for write every thing in html file\r\n\t\tfout.flush();\r\n\t\tfout.close();\r\n\t\t\r\n\t}",
"public void onFooterRefreshComplete() {\n onFooterRefreshComplete(true);\n }",
"public static void printFooter(String anyValidName){\n System.out.println(\"\\n*** \" + anyValidName+ \" ***\");\n }",
"public int getEndingPage() {\n return endingPage;\n }",
"protected void injectEntryFooterXContent(final XContentBuilder builder) throws IOException {}",
"@AfterMethod\n public void endTest(){\n reports.endTest(logger);\n }",
"void doAfterEndTag() {\r\n }",
"@AfterTest\n\tpublic void endReport() {\n\t\textent.flush();\n\t\t// Call close() at the very end of your session to clear all resources.\n\t\t// If any of your test ended abruptly causing any side-affects (not all logs\n\t\t// sent to ExtentReports, information missing), this method will ensure that the\n\t\t// test is still appended to the report with a warning message.\n\t\t// You should call close() only once, at the very end (in @AfterSuite for\n\t\t// example) as it closes the underlying stream.\n\t\t// Once this method is called, calling any Extent method will throw an error.\n\t\t// close() - To close all the operation\n\t\textent.close();\n\t\t\n\t}",
"void endPage(RequestContextHolder request);",
"private ConfigurationHTMLPrinter epilogue() {\n return endTable().decrementIndent().println(\"</body\").decrementIndent().println(\"</html>\");\n }",
"@AfterTest\n\t\tpublic void logout(){\n//Calling method to logout from the account and verify logout message.\n//'**********************************************************\n\t\t\tLogOutPage accountLogoutPage =myWishlistPage.logout();\n\t\t\tAssert.assertTrue(accountLogoutPage.getlogoutMsg().equals(\"Account Logout\"), \"Account Logout message is not displayed\");\n\t\t\textentTest.log(LogStatus.PASS,\"Account Logout message is displayed and the user is signed out from the account\");\n//'**********************************************************\n//Close the report\n//'**********************************************************\n\t\t\textentReports.endTest(extentTest);\n\t\t\textentReports.flush();\n\t\t\textentReports.close();\n\t\t}",
"@Override\r\n\tpublic void printEndBean() {\n\t\t\r\n\t}",
"public boolean skipFooter() {\n return skipFooter;\n }",
"@Override\n public void addFooter(Component footerDiv)\n {\n if (footerDiv != null)\n {\n getFooters().add(footerDiv);\n footerDiv.addClass(\"ui-layout-footer\");\n }\n }",
"public static ParquetMetadata readFooter(InputFile input) throws IOException {\n return readFooter(input, ParquetMetadataConverter.NO_FILTER);\n }",
"public void writeReport() {\n\t\tint gridSize = 55; // Total character spaces between the borders\n\t\tprint(\"+-------------------------------------------------------+\");\n\t\tprint(String.format(\"|%s|\", centerName(gridSize)));\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t/*\n\t\t * Loops through each room in the hotel and prints out the relevant\n\t\t * information on a new line And draws southern, eastern and western\n\t\t * borders to allow it to connect up to the main table.\n\t\t */\n\t\tfor (int i = 0; i < myHotel.getSize(); i++) {\n\t\t\tprint(formatRooms(i).toUpperCase());\n\t\t\tprint(formatAmount(i).toUpperCase());\n\t\t\tprint(formatSleepAmount(i).toUpperCase());\n\t\t\tprint(formatOccupied(i).toUpperCase());\n\t\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t}\n\t\t/*\n\t\t * After every hotel room's information has been displayed The overall\n\t\t * hotel information is displayed such as total occupancy, if there is a\n\t\t * vacancy. And if there is a vacancy, the total amount of free rooms\n\t\t * and beds.\n\t\t */\n\t\tprint(String.format(\"| Hotel\\t\\t|\\tTotal Occupancy:\\t%s\\t|\", getHotel().getTotalOccupancy()).toUpperCase());\n\t\tprint(String.format(\"| information:\\t|\\tHas Vacancies:\\t\\t%s\\t|\", convertBoolean(getHotel().getVacancies()))\n\t\t\t\t.toUpperCase());\n\t\tif (getHotel().getVacancies()) {\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Rooms:\\t\\t%s\\t|\", getHotel().getEmptyRooms()).toUpperCase());\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Beds:\\t\\t%s\\t|\", getHotel().getTotalVacancy()).toUpperCase());\n\t\t}\n\t\t/*\n\t\t * Draws a final southern border to close the table\n\t\t */\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t}",
"private static void endDiagram(PrintWriter printFile) {\n\t\tprintFile.print(\"}\\n\");\n\t}",
"private String E19MapPage() {\n StringBuilder buffer = new StringBuilder();\n\n TextReportData data = TextReportDataManager.getInstance()\n .getDataForReports(lid, 0);\n buffer.append(\"\\f\");\n buffer.append(TextReportConstants.E19_HDR_MAPPAGE);\n buffer.append(\"\\n\\n\");\n\n buffer.append(\n String.format(\"%20s: %-10s\t\tSOURCE: %s\\n\", \"LATITUDE\",\n GeoUtil.getInstance().cvt_latlon_from_double(\n data.getRiverstat().getLat()),\n data.getRiverstat().getRsource()));\n buffer.append(\n String.format(\"%20s: %-10s\", \"LONGITUDE\", GeoUtil.getInstance()\n .cvt_latlon_from_double(data.getRiverstat().getLon())));\n\n // try to place FOOTER at the bottom\n buffer.append(advanceToFooter(0, buffer.toString()));\n\n buffer.append(createFooter(data, E19_RREVISE_TYPE, getDate(),\n \"NWS FORM E-19\", E19_MAPPAGE, \"GAGE MAP\", null,\n E19_STANDARD_LEFT_MARGIN));// , reason));\n\n return buffer.toString();\n }",
"@Override\r\n\tpublic void afterInvocation(IInvokedMethod arg0, ITestResult arg1) {\n\t\tGenerateReports.flushReport();\r\n\t}",
"public int getPageEnd() {\n int val = (_pageIndex + 1) * _pageSize;\n return (val > _totalRecords) ? _totalRecords : val;\n }",
"@Override\n public void testConsumeFooterLine() {\n }",
"private int getFooterViewPosition() {\n if (getEmptyViewCount() == 1) {\n int position = 1;\n if (mHeadAndEmptyEnable && getHeaderLayoutCount() != 0) {\n position++;\n }\n if (mFootAndEmptyEnable) {\n return position;\n }\n } else {\n return getHeaderLayoutCount() + mData.size();\n }\n return -1;\n }",
"public StrColumn getPageLast() {\n return delegate.getColumn(\"page_last\", DelegatingStrColumn::new);\n }",
"private void reportType() {\n\t\tVerticalLayout vReportLayout = new VerticalLayout();\n\t\tvReportLayout.addStyleName(Reindeer.PANEL_LIGHT);\n\t\tvReportLayout.setWidth(\"150px\");\n\t\tVerticalLayout bSpace = new VerticalLayout();\n\t\tbSpace.setHeight(\"25px\");\n\t\troot.addComponent(bSpace);\n\t\t\n\t\tButton todayButton = new Button(\"TODAY\");\n\t\ttodayButton.setWidth(\"100%\");\n\t\ttodayButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t //Notification.show(event.getButton().getCaption());\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(todayButton);\n\t\t\n\t\tButton last30DaysButton = new Button(\"LAST 30 DAYS\");\n\t\tlast30DaysButton.setWidth(\"100%\");\n\t\tlast30DaysButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(last30DaysButton);\n\t\t\n\t\ttReportPanel.setContent(vReportLayout);\n\t\ttReportPanel.addStyleName(Reindeer.PANEL_LIGHT);\n\t\thorLayout.addComponent(tReportPanel);\n\t\troot.addComponent(horLayout);\n\t}",
"@Override // com.android.settings.wifi.dpp.WifiDppQrCodeBaseFragment\n public boolean isFooterAvailable() {\n return false;\n }",
"public int getFooterLayoutCount() {\n if (mFooterLayout == null || mFooterLayout.getChildCount() == 0) {\n return 0;\n }\n return 1;\n }",
"public void closeEndTag() throws XMLStreamException {\n write(HtmlObject.HtmlMarkUp.CLOSE_BRACKER);\n }",
"public void endDocument()\r\n\t{\r\n\t /* marc_out.add(\"=008 \" + running_date + \"s\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\dcu\\\\\\\\\\\\\\\\\\\\sbm\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" + language + \"\\\\d\"); */ /** 008/24-27: biblio+thesis codes **/\r\n\t marc_out.add(\"=008 \" + running_date + \"s\" + comp_date + \"\\\\\\\\\\\\\\\\dcu\\\\\\\\\\\\\\\\\\\\obm\\\\\\\\\\\\000\\\\0\\\\\" + language + \"\\\\d\"); /** 008/24-27: biblio+thesis codes **/\r\n\t marc_out.add(\"=264 30$a[Washington, D. C.] :$bGeorge Washington University,$c\" + comp_date + \".\"); /** 20130430: rev 260*/\r\n\t}",
"SiteWriterTemplate finishSites() throws Exception;",
"SiteWriterTemplate finishBunch() throws Exception;",
"public static String endMethod() {\n\t\treturn \"\\t\\t\\t</mth>\" + \"\\n\";\n\t}",
"@AfterSuite\n public void close(){\n //flush the report\n reports.flush();\n //close the report\n reports.close();\n //quit the driver\n driver.quit();\n }",
"@Override\n public boolean isFooterDisplayed() {\n\n setLogString(\"Check footer is not displayed\", true, CustomLogLevel.HIGH);\n return isNotDisplayed(getDriver(), By.className(FOOTER_CONTAINER), TINY_TIMEOUT);\n }",
"private static int lastPage(PdfReader pdfFile){\n int pages;\n\n pages = pdfFile.getNumberOfPages();\n\n return(pages);\n }",
"@Override\n\tprotected void foot() throws ScriptException {\n\n\t}",
"public void visitEnd()\n {\n visitMethodHandleFields(_methods.size(), (ClassWriter) cv);\n final int access = Opcodes.ACC_PROTECTED | Opcodes.ACC_FINAL;\n visitField(access, FIELD_SIGNATURE, referenceName(STRING), null, null).visitEnd();\n visitField(access, FIELD_HASHCODE, TYPE_INT, null, null).visitEnd();\n visitStaticInitializer(_methods, INTERNAL_CLASS_NAME, CLASS_NAME, (ClassWriter) cv);\n }",
"@External\r\n\t@ClientFunc\r\n\tpublic MetaVar Finish();",
"public void endBlockOut () {\n addLine (getBlockEnd());\n // writer.close();\n }",
"public void finalize()\n\t{\n\t\tif (!isClosed) {\n\t\t\t// System.out.println(\"SimWriter: finalize() - writing closing bracket to file...\");\n\t\t\twList.writeToFile(\"\\n ]\", 0);\n\t\t\tisClosed = true;\n\t\t}\n\t\t//System.out.println(\"SimWriter: finalize() done\");\n\t}",
"public int getPageEndEntry() {\n\t\tint end = this.skipEntries + NUM_PER_PAGE - 1;\n\t\tif (end > this.totalEntries) {\n\t\t\tend = this.totalEntries;\n\t\t}\n\t\treturn end;\n\t}",
"@Override\n protected String elaboraFooterCategorie() {\n String text = CostBio.VUOTO;\n\n text += A_CAPO;\n text += LibWiki.setRigaCat(\"Liste di persone per cognome| \");\n text += LibWiki.setRigaCat(\"Progetto Antroponimi|Cognomi\");\n\n return text;\n }",
"public void generateReport(){\n String fileOutput = \"\";\n fileOutput += allCustomers()+\"\\n\";\n fileOutput += getNoAccounts()+\"\\n\";\n fileOutput += getTotalDeposits()+\"\\n\";\n fileOutput += accountsOfferingLoans()+\"\\n\";\n fileOutput += accountsReceivingLoans()+\"\\n\";\n fileOutput += customersOfferingLoans()+\"\\n\";\n fileOutput += customersReceivingLoans()+\"\\n\";\n System.out.println(fileOutput);\n writeToFile(fileOutput);\n }"
] | [
"0.74197453",
"0.72761446",
"0.6909262",
"0.6752651",
"0.6697752",
"0.64060986",
"0.63997346",
"0.6384651",
"0.62689227",
"0.6203079",
"0.6135515",
"0.60682863",
"0.60539275",
"0.60386896",
"0.59581673",
"0.59451777",
"0.5883745",
"0.588032",
"0.58684987",
"0.58546656",
"0.58436877",
"0.5826506",
"0.5789203",
"0.578074",
"0.57771873",
"0.57749367",
"0.57543457",
"0.5613959",
"0.56071615",
"0.5516466",
"0.55090654",
"0.54430383",
"0.542002",
"0.5400545",
"0.5366251",
"0.53057873",
"0.5274981",
"0.5273701",
"0.5248352",
"0.5233622",
"0.5210437",
"0.52084136",
"0.5186379",
"0.51833427",
"0.517943",
"0.51733434",
"0.5153508",
"0.5140507",
"0.5114893",
"0.5078252",
"0.5068137",
"0.50267357",
"0.4965675",
"0.49459225",
"0.49416766",
"0.49326473",
"0.4929991",
"0.48942295",
"0.4831887",
"0.4820367",
"0.48151842",
"0.48109126",
"0.48023513",
"0.4796071",
"0.47959694",
"0.47932476",
"0.47824836",
"0.47789505",
"0.47723117",
"0.47702816",
"0.47177413",
"0.47126558",
"0.47119144",
"0.47074345",
"0.4697448",
"0.46912628",
"0.46841535",
"0.46826422",
"0.46818668",
"0.46757868",
"0.4669459",
"0.4656313",
"0.46387878",
"0.46377328",
"0.46298197",
"0.46154293",
"0.46142495",
"0.4610253",
"0.46097708",
"0.4601405",
"0.45944986",
"0.45888913",
"0.45888454",
"0.45879087",
"0.45837253",
"0.45820993",
"0.45673478",
"0.45615456",
"0.45612845",
"0.4554243",
"0.45531985"
] | 0.0 | -1 |
Function for getting Reference Date | public void getREFDT()//get reference date
{
try
{
Date L_strTEMP=null;
M_strSQLQRY = "Select CMT_CCSVL,CMT_CHP01,CMT_CHP02 from CO_CDTRN where CMT_CGMTP='S"+cl_dat.M_strCMPCD_pbst+"' and CMT_CGSTP = 'FGXXREF' and CMT_CODCD='DOCDT'";
ResultSet L_rstRSSET = cl_dat.exeSQLQRY2(M_strSQLQRY);
if(L_rstRSSET != null && L_rstRSSET.next())
{
strREFDT = L_rstRSSET.getString("CMT_CCSVL").trim();
L_rstRSSET.close();
M_calLOCAL.setTime(M_fmtLCDAT.parse(strREFDT)); // Convert Into Local Date Format
M_calLOCAL.add(Calendar.DATE,+1); // Increase Date from +1 with Locked Date
strREFDT = M_fmtLCDAT.format(M_calLOCAL.getTime()); // Assign Date to Veriable
//System.out.println("REFDT = "+strREFDT);
}
}
catch(Exception L_EX)
{
setMSG(L_EX,"getREFDT");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"com.google.type.Date getAcquireDate();",
"java.lang.String getFoundingDate();",
"Date getForDate();",
"Date getDate();",
"Date getDate();",
"Date getDate();",
"java.lang.String getDate();",
"java.lang.String getFromDate();",
"public String Get_date() \n {\n \n return date;\n }",
"String getDate();",
"String getDate();",
"org.apache.xmlbeans.XmlString xgetFoundingDate();",
"public String getReturnDate();",
"long getDate();",
"public java.util.Date getRevocationDate() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.getRevocationDate():java.util.Date, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getRevocationDate():java.util.Date\");\n }",
"String getStartDate();",
"public Date GetDate();",
"Date getEDate();",
"public Date getGioBatDau();",
"long getStartDate();",
"LocalDate getDate();",
"public long getDate()\r\n/* 204: */ {\r\n/* 205:309 */ return getFirstDate(\"Date\");\r\n/* 206: */ }",
"Date getDueDate();",
"Date getDueDate();",
"public java.util.Date getDateInst(){\r\n return this.dateInst;\r\n }",
"java.lang.String getStartDateYYYYMMDD();",
"Date getStartDate();",
"Date getStartDate();",
"Date getStartDate();",
"LocalDate getCheckInDate();",
"public GregorianCalendar getReturnDate(){\n\n\t\treturn ReturnDate;\n\t}",
"public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}",
"public Date getUseDate() {\n return DateUtils.clone(this.useDate);\n }",
"public GregorianCalendar getDate() { return date; }",
"ValuationDate getValuationDate();",
"@Override\n\tpublic java.util.Date getCreateDate() {\n\t\treturn _candidate.getCreateDate();\n\t}",
"long getBeginDate();",
"java.lang.String getToDate();",
"Date getCreateDate();",
"Date getCreateDate();",
"public java.util.Date getDateOfExamination(){\n return localDateOfExamination;\n }",
"public static String getBaseDate() {\n\t\tif (xml == null) return null;\n\t\treturn basedate;\n\t}",
"DateFormat getSourceDateFormat();",
"java.lang.String getStartDate();",
"public String getStartDate();",
"public LocalDate getDate() {\r\n\t\treturn loanDate;\r\n\t}",
"long getContactRegistrationDate();",
"public String getCurrentDate() {\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yy\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}",
"public static String currentdate() {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tDate date = new Date();\n\t\treturn dateFormat.format(date);\n\n\t}",
"String getCoverageExpirationDate(Record inputRecord);",
"Date getInvoicedDate();",
"public Calendar getReturnDate()\n {\n /*New Calendar for Return Date*/\n Calendar dueDate = Calendar.getInstance();\n\n /*Month is Current Month*/\n dueDate.set(today.MONTH, today.get(today.MONTH));\n /*Year is Current Year*/\n dueDate.set(today.YEAR, today.get(today.YEAR));\n /*Due Date is 21 Days Later*/\n dueDate.set(today.DATE, today.get(today.DATE + 21));\n\n return dueDate;\n }",
"@Override\n public LocalDate getReturnDate() {\n return returnDate;\n }",
"public String getRebillCreationDate()\n\t{\n\t\tif(response.containsKey(\"creation_date\")) {\n\t\t\treturn response.get(\"creation_date\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public Date getFechaInclusion()\r\n/* 150: */ {\r\n/* 151:170 */ return this.fechaInclusion;\r\n/* 152: */ }",
"@Override\n public final Date getDocumentDate() {\n return this.manufacture.getItsDate();\n }",
"public static String getCurrentDate() {\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tDate dateobj = new Date();\n\t\treturn df.format(dateobj);\n\t}",
"public static String currentDate1() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}",
"public LocalDate getGenDate() {\n\t\treturn genDate;\n\t}",
"public Date getAccessionDateDate() {\n\t\tString t = doc.get(\"collaccessiondate\");\n\n\t\tif (t == null)\n\t\t\treturn null;\n\n\t\ttry {\n\t\t\t// Stored in the form 20090207080305\n\t\t\treturn new Date(DateFieldTools.stringToTime(t));\n\t\t} catch (Throwable e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"Date getPriorDate();",
"public String getDateAsString(){\n\t\t//\tGet Date\n Date date = getDate();\n if(date != null)\n \treturn backFormat.format(date);\n\t\treturn null;\n\t}",
"private void getDate() {\n //reference to firebase function and request\n FirebaseFunctions.getInstance()\n .getHttpsCallable(\"getDateTime\")\n .call()\n .continueWith(new Continuation<HttpsCallableResult, String>() {\n @Override\n public String then(@NonNull Task<HttpsCallableResult> task) throws Exception {\n String result = task.getResult().getData().toString();\n date=result;\n return result;\n }\n })\n .addOnCompleteListener(new OnCompleteListener<String>() {\n @Override\n public void onComplete(@NonNull Task<String> task) {\n if (!task.isSuccessful()) {\n Exception e = task.getException();\n if (e instanceof FirebaseFunctionsException) {\n FirebaseFunctionsException ffe = (FirebaseFunctionsException) e;\n FirebaseFunctionsException.Code code = ffe.getCode();\n Object details = ffe.getDetails();\n }\n }\n }\n });\n }",
"public java.util.Date getDate(){\n return localDate;\n }",
"public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}",
"public Date getDate() {\n if ( expiryDate.isSIPDate() ) {\n Calendar c=( (SIPDate)expiryDate ).getJavaCal();\n return c.getTime();\n }\n else return null; \n }",
"protected Date findFirstGenDate(GenCtx ctx)\n\t{\n\t\treturn EX.assertn(ctx.get(Date.class));\n\t}",
"public Date getdate() {\n\t\treturn new Date(date.getTime());\n\t}",
"XMLGregorianCalendar getSystemEntryDate();",
"public String getLeavingDate();",
"public Timestamp getHC_WorkStartDate2();",
"protected String getDateString() {\n String result = null;\n if (!suppressDate) {\n result = currentDateStr;\n }\n return result;\n }",
"public LocalDate getDate () {\n\t\treturn DateUtils.toLocalDate(this.start);\n\t}",
"private String ObtenerFechaActual() {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/mm/yyyy\");\n Calendar calendar = GregorianCalendar.getInstance();\n return String.valueOf(simpleDateFormat.format(calendar.getTime()));\n }",
"Date getFechaNacimiento();",
"Date getBirthDate();",
"public Date getRecdate() {\n return recdate;\n }",
"public Date getVersionDate ();",
"public Date getStartDate();",
"public Date getStartDate();",
"public ResourceReferenceDt getReferrer() { \n\t\tif (myReferrer == null) {\n\t\t\tmyReferrer = new ResourceReferenceDt();\n\t\t}\n\t\treturn myReferrer;\n\t}",
"public String getJP_AcctDate();",
"XMLGregorianCalendar getMovementDate();",
"public void getCurrentDate(){\n Date now = new Date(); //get todays date \n \n SimpleDateFormat formatter = new SimpleDateFormat( \"MM/dd/yyyy\" ); \n System.out.println ( \"The current date is: \" + formatter.format( now ) ); \n \n month = (String) formatter.format( now ).subSequence(0, 2);\n day = (String) formatter.format( now ).subSequence(3, 5);\n year = (String) formatter.format( now ).subSequence(6, 10);\n \n System.out.println(\"month: \" + month);\n System.out.println(\"day: \" + day);\n System.out.println(\"year: \" + year);\n \n }",
"public Date getPubDate();",
"protected Date getReturnDate() \t{ return this.returnDate; }",
"public static String getDate() {\n return getDate(System.currentTimeMillis());\n }",
"long getTradeDate();",
"@Override\n\tpublic Date getCreateDate() {\n\t\treturn _second.getCreateDate();\n\t}",
"String getSourceUsageDateTime();",
"public String getDate()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"EE d MMM yyyy\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }",
"public java.lang.String getDateOpen()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DATEOPEN$2, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }",
"private LocalDate nowLocalDate() {\n\t\tInstant instantNow = Instant.ofEpochMilli( System.currentTimeMillis() );\n\t\tLocalDate nowLocalDate = instantNow.atOffset(ZoneOffset.UTC).toLocalDate();\n\t\treturn nowLocalDate;\n\t}",
"@Test\n\tpublic void systemDate_Get()\n\t{\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\t\n\t\t// Created object of Date, to get system current date\n\t\tDate date = new Date();\n\t\t\n\t\tString currDate = dateFormat.format(date);\n\t\t\n\t\tSystem.out.println(\"Today's date is : \"+currDate);\n\n\t}",
"public void getOriginalDate(\n\t\t\t\t\tint seqid, String siteid, String ptid,\n\t\t\t\t\tString tag, String date, String base);",
"public static Date date() {\n GregorianCalendar cal = new GregorianCalendar();\n return cal.getTime();\n }",
"private Date getDeadlineDate() {\n String dateString = jtf_DeadLine.getText();\n Date date = Utils.parseDateFromString(dateString);\n System.out.println(\"Date:\" + date.toString());\n return date;\n }",
"public String getDate(){\n\t\treturn toString();\n\t}",
"public Date getCreateDate();",
"public Date getCreateDate();"
] | [
"0.70766366",
"0.68009084",
"0.6412134",
"0.6403017",
"0.6403017",
"0.6403017",
"0.63610935",
"0.63493913",
"0.62993616",
"0.6288366",
"0.6288366",
"0.625561",
"0.6231234",
"0.6209997",
"0.61942923",
"0.61454403",
"0.61102",
"0.61014986",
"0.60884845",
"0.60865504",
"0.6080848",
"0.60714495",
"0.6052055",
"0.6052055",
"0.6051102",
"0.6034679",
"0.6019496",
"0.6019496",
"0.6019496",
"0.5998012",
"0.59928715",
"0.5982089",
"0.59722096",
"0.5970893",
"0.59606445",
"0.59592235",
"0.5957422",
"0.59410304",
"0.5935267",
"0.5935267",
"0.5929415",
"0.5928133",
"0.5922217",
"0.5918302",
"0.5909915",
"0.5909207",
"0.5894267",
"0.5889994",
"0.58865213",
"0.5865871",
"0.5849197",
"0.5847579",
"0.58393246",
"0.5833771",
"0.58315283",
"0.5828395",
"0.58277047",
"0.5826792",
"0.5818316",
"0.5817988",
"0.5814237",
"0.5794877",
"0.5789934",
"0.5785211",
"0.57751006",
"0.57619685",
"0.576016",
"0.57528144",
"0.5752024",
"0.5741306",
"0.57377684",
"0.5737091",
"0.57339174",
"0.5728137",
"0.57250255",
"0.5722806",
"0.5722351",
"0.5718092",
"0.57173187",
"0.57173187",
"0.57144827",
"0.5712119",
"0.5702101",
"0.56983125",
"0.56958073",
"0.5693833",
"0.569335",
"0.5690818",
"0.56901544",
"0.56869406",
"0.5682912",
"0.5682362",
"0.56807494",
"0.5677603",
"0.56775546",
"0.5674104",
"0.56699145",
"0.56629205",
"0.5658177",
"0.5658177"
] | 0.7988641 | 0 |
Called when the database is created for the first time. This is where the creation of tables and the initial population of the tables should happen. | @Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(COUNTRY_TABLE);
db.execSQL(CURRENT_POLL_TABLE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}",
"public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }",
"void go() {\n\t\tthis.conn = super.getConnection();\n\t\tcreateCustomersTable();\n\t\tcreateBankersTable();\n\t\tcreateCheckingAccountsTable();\n\t\tcreateSavingsAccountsTable();\n\t\tcreateCDAccountsTable();\n\t\tcreateTransactionsTable();\n\t\tcreateStocksTable();\n\t\tif(createAdminBanker) addAdminBanker();\n\t\tSystem.out.println(\"Database Created\");\n\n\t}",
"@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}",
"private void setupDatabase() {\r\n\t\tDatabaseHelperFactory.init(this);\r\n\t\tdatabase = DatabaseHelperFactory.getInstance();\r\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tAppDBTableCreation.onCreate(database);\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tcreateTables(database);\n\t}",
"protected void createInitialTables() throws SQLException {\n\t\n\t\t// create one table per type with the corresponding attributes\n\t\tfor (String type: entityType2attributes.keySet()) {\n\t\t\tcreateTableForEntityType(type);\n\t\t}\n\t\t\n\t\t// TODO indexes !\n\t\t\n\t}",
"public void init() {\n\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\n\t\ttry {\n\n\t\t\tconnection = DatabaseInteractor.getConnection();\n\t\t\tstatement = connection.createStatement();\n\n\t\t} catch (SQLException exception) {\n\t\t\texception.printStackTrace();\n\t\t\treturn;\n\t\t} catch (ClassNotFoundException exception) {\n\t\t\texception.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\tDatabaseInteractor.createTable(StringConstants.USERS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.QUESTIONS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.ANSWERS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.TOPICS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_QUESTION_VOTES_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_ANSWER_VOTES_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_TOPIC_RANKS_TABLE, statement);\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private void creates() {\n \tDBPeer.fetchTableColumns();\n \tDBPeer.fetchTableRows();\n \tDBPeer.fetchTableIndexes();\n \t\n for (int i = 0; i < creates.size(); i++) {\n creates.get(i).init();\n }\n \n DBPeer.updateTableColumns();\n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n }",
"protected void setupDB() {\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database started\");\n\t\tlog.info(\"ddl: db-config.xml\");\n\t\tlog.info(\"------------------------------------------\");\n\t\ttry {\n\t\t\tfinal List<String> lines = Files.readAllLines(Paths.get(this.getClass()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getClassLoader()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getResource(\"create-campina-schema.sql\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toURI()), Charset.forName(\"UTF-8\"));\n\n\t\t\tfinal List<String> statements = new ArrayList<>(lines.size());\n\t\t\tString statement = \"\";\n\t\t\tfor (String string : lines) {\n\t\t\t\tstatement += \" \" + string;\n\t\t\t\tif (string.endsWith(\";\")) {\n\t\t\t\t\tstatements.add(statement);\n\t\t\t\t\tstatement = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry (final Connection con = conManager.getConnection(Boolean.FALSE)) {\n\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(\"DROP SCHEMA IF EXISTS campina\")) {\n\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t}\n\t\t\t\tfor (String string : statements) {\n\t\t\t\t\tlog.info(\"Executing ddl: \" + string);\n\t\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(string)) {\n\t\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tthrow new IllegalStateException(\"Could not setup db\", e);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tlog.error(\"Could not setup database\", e);\n\t\t\tthrow new IllegalStateException(\"ddl file load failed\", e);\n\t\t}\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database finished\");\n\t\tlog.info(\"------------------------------------------\");\n\t}",
"private void initTables() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement()) {\n statement.execute(INIT.CREATE_CITIES.toString());\n statement.execute(INIT.CREATE_ROLES.toString());\n statement.execute(INIT.CREATE_MUSIC.toString());\n statement.execute(INIT.CREATE_ADDRESS.toString());\n statement.execute(INIT.CREATE_USERS.toString());\n statement.execute(INIT.CREATE_USERS_TO_MUSIC.toString());\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }",
"public static void SetupDB() {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS User(email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS FriendList(ID INTEGER PRIMARY KEY, email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS Category(ID INTEGER PRIMARY KEY,name TEXT);\");\n\t}",
"private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}",
"public void onCreate() {\r\n\t\tcreatorClass.onCreate(table);\r\n\t}",
"@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n String sql = \"drop table \" + MelodyData.CreateDB._TABLENAME;\n sqLiteDatabase.execSQL(AccompanimentData.CreateDB._CREATE);\n sqLiteDatabase.execSQL(MelodyData.CreateDB._CREATE);\n }",
"private void initDatabase() {\n\n String sql = \"CREATE TABLE IF NOT EXISTS books (\\n\"\n + \"\tISBN integer PRIMARY KEY,\\n\"\n + \"\tBookName text NOT NULL,\\n\"\n + \" AuthorName text NOT NULL, \\n\"\n + \"\tPrice integer\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(urlPath);\n Statement stmt = conn.createStatement()) {\n System.out.println(\"Database connected\");\n stmt.execute(sql);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\tthis.connectionSource = connectionSource;\n\t\tcreateTable();\n\t}",
"private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\ttry {\n\t\t\tLog.i(DatabaseHelper.class.getName(), \"onCreate\");\n\t\t\tTableUtils.createTable(connectionSource, Place.class);\n\t\t\tTableUtils.createTable(connectionSource, Lock.class);\n\t\t\tTableUtils.createTable(connectionSource, User.class);\n\t\t\tTableUtils.createTable(connectionSource, Locator.class);\n\t\t} catch (SQLException e) {\n\t\t\tLog.e(DatabaseHelper.class.getName(), \"Can't create database\", e);\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"private void onCreate() {\n\n\n if (!db.hasTable(DbTables.PLAYER)) {\n db.execSQL(CREATE_PLAYER_TABLE);\n }\n\n if (!db.hasTable(DbTables.SHIP)) {\n db.execSQL(CREATE_SHIP_TABLE);\n }\n\n if (!db.hasTable(DbTables.CARGO)) {\n db.execSQL(CREATE_CARGO_TABLE);\n }\n }",
"@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tcreateDataTable(db);\r\n\t\tcreateTableNote(db);\r\n\t}",
"public void initialize()\r\n\t{\r\n\t\tdatabaseHandler = DatabaseHandler.getInstance();\r\n\t\tfillPatientsTable();\r\n\t}",
"@Override\n\t\tpublic void onCreate(SQLiteDatabase db) {\n\t\t\ttry {\n\t\t\t\tdb.execSQL(TABLE_CREATE);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}",
"@Override\n public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {\n\n try {\n TableUtils.createTableIfNotExists(connectionSource, MessageBoard.class);\n TableUtils.createTableIfNotExists(connectionSource, User.class);\n TableUtils.createTableIfNotExists(connectionSource, ChatServerBean.class);\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tLog.v(\"open onCreate\", \"Creating all the tables\");\n\n\t\ttry {\n\t\t\n\t\t\tdb.execSQL(CREATE_TABLE1);\n\t\t} catch (SQLiteException ex) {\n\t\t\tLog.v(\"open exception caught\", ex.getMessage());\n\n\t\t}\n\t}",
"@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tFormDAO.createTable(db);\r\n//\t\tCreate table ENumber\r\n\t\tENumberDAO.createTable(db);\r\n\t\t\r\n\r\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"Database operations\", \"table created\");\n\t}",
"public void dbCreate() {\n Logger.write(\"INFO\", \"DB\", \"Creating database\");\n try {\n if (!Database.DBDirExists())\n Database.createDBDir();\n dbConnect(false);\n for (int i = 0; i < DBStrings.createDB.length; i++)\n execute(DBStrings.createDB[i]);\n } catch (Exception e) {\n Logger.write(\"FATAL\", \"DB\", \"Failed to create databse: \" + e);\n }\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"DB ops: \", \"Table Created \");\n\t}",
"public void initialize() {\n for (TableInSchema tableInSchema : initialTables()) {\n addTable(tableInSchema);\n }\n }",
"private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }",
"public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}",
"public void createTable() {\r\n\t\tclient.createTable();\r\n\t}",
"@Override\n public void onCreate(SQLiteDatabase db){\n //execute the SQL statements to actually create the specified tables\n db.execSQL(SQL_CREATE_PRODUCTS_TABLE);\n db.execSQL(SQL_CREATE_SUPPLIERS_TABLE);\n db.execSQL(SQL_CREATE_CATEGORIES_TABLE);\n }",
"@Before\n public void createDatabase() {\n dbService.getDdlInitializer()\n .initDB();\n kicCrud = new KicCrud();\n }",
"@Override\n //\n public void onCreate(SQLiteDatabase db)\n {\n db.execSQL(DATABASE_CREATE);\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n new Tables(db).makeContactTable();\n new Tables(db).makeTalkTable();\n new Tables(db).makeConferenceTable();\n new Tables(db).makeNotificationTable();\n }",
"@Before\n public void createAndFillTable() {\n try {\n DBhandler dBhandler = new DBhandler(h2DbConnection);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n\n db.execSQL(CategoryTable.getCreateTableSqlString());\n db.execSQL(ReminderTable.getCreateTableSqlString());\n }",
"@Override\n public void onCreate(SQLiteDatabase _db) {\n _db.execSQL(DATABASE_CREATE);\n }",
"@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource source) {\n\n\t\ttry {\n\t\t\tTableUtils.createTable(source, Priority.class);\n\t\t\tTableUtils.createTable(source, Category.class);\n\t\t\tTableUtils.createTable(source, Task.class);\n\t\t} catch (SQLException ex) {\n\t\t\tLog.e(LOG, \"error creating tables\", ex);\n\t\t}\n\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString[] tables = CREATE_TABLES.split(\";\");\n\t\tfor(String SQL : tables){\n\t\t db.execSQL(SQL);\n\t\t}\n\t}",
"public void onCreate(SQLiteDatabase sqliteDB) \n \t\t{\n \t\t\tsqliteDB.execSQL(sqlStatement_CreateTable); // creates a table\n \t\t\tLog.e(\"pigtail\",\"CREATING TABLE\");\n \t\t}",
"@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(DATABASE_CREATE);\n }",
"private void initTables() {\n insert(\"CREATE TABLE IF NOT EXISTS `player_info` (`player` VARCHAR(64) PRIMARY KEY NOT NULL, `json` LONGTEXT)\");\n }",
"public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n public void onCreate(SQLiteDatabase database) {\n ShoulderWatchTable.onCreate(database);\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(CREATE_TABLE);\n }",
"Database createDatabase();",
"@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(DATABASE_CREATE);\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n // Create the table.\n db.execSQL(SQL_CREATE);\n }",
"public FakeDatabase() {\n\t\t\n\t\t// Add initial data\n\t\t\n//\t\tSystem.out.println(authorList.size() + \" authors\");\n//\t\tSystem.out.println(bookList.size() + \" books\");\n\t}",
"public void init() throws SQLException {\n EventBusInstance.getInstance().register(new BestEffortsDeliveryListener());\n if (TransactionLogDataSourceType.RDB == transactionConfig.getStorageType()) {\n Preconditions.checkNotNull(transactionConfig.getTransactionLogDataSource());\n createTable();\n }\n }",
"@Before\n public void initDb() {\n mDatabase = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getContext(),\n ToDoDatabase.class).build();\n }",
"DatabaseTable_DataSource(SQLiteDatabase db) {\n createIfNotExists(db);\n }",
"private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbFile = mContext.getDatabasePath(DBNAME);\n if (!dbFile.delete()) {\n Log.w(TAG, \"Unable to update database\");\n }\n }\n }\n if (!databaseExists()) {\n createDatabase();\n }\n }",
"public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void initDb() throws SQLException {\n statement = conn.createStatement();\n for (String sql : TABLES_SQL) {\n statement.executeUpdate(sql);\n }\n }",
"public void onCreate(SQLiteDatabase db) {\n Cursor cursor = db.rawQuery(\n \"SELECT name FROM sqlite_master \" +\n \"WHERE type='table' AND name='\" +\n SymptomCheckinTable.TABLE_NAME + \"' \", null);\n try {\n if (cursor.getCount()==0) {\n db.execSQL(SymptomCheckinTable.DATABASE_CREATE);\n db.execSQL(MedicationIntakeTable.DATABASE_CREATE);\n }\n }\n finally {\n cursor.close();\n }\n }",
"public void createTable()\n throws DBException\n {\n try {\n DBProvider.createTable(this);\n } catch (SQLException sqe) {\n throw new DBException(\"Table creation\", sqe);\n }\n }",
"public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n uniqueID++;\n databaseStatement.executeQuery(\"CREATE DATABASE OSM\"+uniqueID+\";\");\n }\n }",
"@Override\n\t\tpublic void onCreate(SQLiteDatabase db) {\n\t\t\tEventData.create(db);\n\t\t\tTriggerData.create(db);\n\t\t\tHostData.create(db);\n\t\t\tHostGroupData.create(db);\n\t\t\tItemData.create(db);\n\t\t\tApplicationData.create(db);\n\t\t\tCacheData.create(db);\n\t\t\tApplicationItemRelationData.create(db);\n\t\t\tHistoryDetailData.create(db);\n\t\t\tScreenData.create(db);\n\t\t\tScreenItemData.create(db);\n\t\t\tGraphData.create(db);\n\t\t\tGraphItemData.create(db);\n\t\t}",
"private static void initializeDatabase()\n\t{\n\t\tResultSet resultSet = dbConnect.getMetaData().getCatalogs();\n\t\tStatment statement = dbConnect.createStatement();\n\t\t\n\t\tif (resultSet.next())\n\t\t{\n\t\t\tstatement.execute(\"USE \" + resultSet.getString(1));\n\t\t\tstatement.close();\n\t\t\tresultSet.close();\n\t\t\treturn; //A database exists already\n\t\t}\n\t\tresultSet.close();\n\t\t//No database exists yet, create it.\n\t\t\n\t\tstatement.execute(\"CREATE DATABASE \" + dbName);\n\t\tstatement.execute(\"USE \" + dbName);\n\t\tstatement.execute(createTableStatement);\n\t\tstatement.close();\n\t\treturn;\n\t}",
"@Override\r\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(CREATE_TABLE);\r\n db.execSQL(CREATE_TABLE1);\r\n\r\n }",
"protected void createTable() throws Exception {\n startService();\n assertEquals(true, sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n sqlDbManager.logTableSchema(conn, \"testtable\");\n assertFalse(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n }",
"@Override\n\tpublic void createTable() {\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\ttry {\n\t\t\tTableUtils.createTable(connectionSource, UserEntity.class);\n\t\t\tTableUtils.createTable(connectionSource, Downloads.class);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");\n\t\t}\n\t}",
"@BeforeAll\n public void init() throws SQLException, IOException {\n dataSource = DBCPDataSource.getDataSource();\n\n DatabaseUtil databaseUtil = new DatabaseUtil(dataSource);\n databaseUtil.dropTables();\n\n String initUsersTable = \"create table users (id serial primary key, email varchar not null, password varchar not null, birthday date);\";\n String initPostsTable = \"create table posts (id serial primary key, image varchar not null, caption varchar, likes integer not null default 0, userId integer not null references users(id));\";\n\n try (Connection connection = dataSource.getConnection()) {\n Statement statement = connection.createStatement();\n\n statement.execute(initUsersTable);\n statement.execute(initPostsTable);\n\n addUser(\"nikita@gmail.com\", \"HASHED_PASSWORD\", new Date(2001, 07, 24));\n addUser(\"paul200@mail.ru\", \"HASHED_PASSWORD\", new Date(2000, 01, 01));\n addUser(\"alexfilatov@mail.ru\", \"HASHED_PASSWORD\", new Date(2001, 02, 01));\n addUser(\"yaroslavobruch@gmail.com\", \"HASHED_PASSWORD\", new Date(2000, 05, 06));\n addUser(\"nikita@yandex.ru\", \"HASHED_PASSWORD\", new Date(2001, 07, 24));\n }\n\n loggerUtil = new LoggerUtil();\n logFilePath = Paths.get(logDirectory, name + \".log\");\n logger = loggerUtil.initFileLogger(logFilePath.toAbsolutePath().toString(), name);\n\n Migrate migrate = new Migrate(dataSource);\n migrate.up(name);\n }",
"private void initDB() {\n dataBaseHelper = new DataBaseHelper(this);\n }",
"public void initialProductTable() {\r\n\t\tString sqlCommand = \"CREATE TABLE IF NOT EXISTS ProductTable (\\n\" + \"Barcode integer PRIMARY KEY,\\n\"\r\n\t\t\t\t+ \"Product_Name VARCHAR(30) NOT Null,\\n\" + \"Delivery_Time integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"Quantity_In_Store integer NOT NULL,\\n\" + \"Quantity_In_storeroom integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"Supplier_Name VARCHAR(30) NOT NUll,\\n\" + \"Average_Sales_Per_Day integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \"Location_In_Store VARCHAR(30) NOT NULL,\\n\" + \"Location_In_Storeroom VARCHAR(30) NOT NULL,\\n\"\r\n\t\t\t\t+ \"Faulty_Product_In_Store integer DEFAULT 0,\\n\" + \"Faulty_Product_In_Storeroom integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \"Category integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \" FOREIGN KEY (Category) REFERENCES CategoryTable(CategoryID) ON UPDATE CASCADE ON DELETE CASCADE\"\r\n\t\t\t\t+ \");\";// create the fields of the table\r\n\t\ttry (Connection conn = DriverManager.getConnection(dataBase); Statement stmt = conn.createStatement()) {\r\n\t\t\tstmt.execute(sqlCommand);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"initialProductTable: \"+ e.getMessage());\r\n\t\t}\r\n\t}",
"@Override\n public void onCreate(SQLiteDatabase db) {\n setCreateCourseTable(db);\n setCreateAssignmentTable(db);\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n Log.d(TAG, \"onCreate: Creating Database\");\n db.execSQL(SQL_CREATE_TABLE); //This statement will execute anything in SQL.\n }",
"protected abstract void initialiseTable();",
"private void initializeDatabase() {\n fbProfile = Profile.getCurrentProfile();\n String userId = fbProfile.getId();\n user = new User();\n user.name = fbProfile.getName();\n database.getReference(\"Users\").child(userId).setValue(user);\n userRef = database.getReference(\"Users\").child(userId);\n populateDatabase(database, userRef);\n listenForUpdates(database, userRef);\n }",
"@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tdb.execSQL(CREATETAB);\r\n\t}",
"public void start(){\n dbConnector = new DBConnector();\n tables = new HashSet<String>();\n tables.add(ALGORITHMS_TABLE);\n tables.add(DATA_STRUCTURES_TABLE);\n tables.add(SOFTWARE_DESIGN_TABLE);\n tables.add(USER_TABLE);\n }",
"public void setUp() {\n deleteTheDatabase();\n }",
"public void setUp() {\n deleteTheDatabase();\n }",
"@Override\n public void onCreate(SQLiteDatabase db) {\n\n db.execSQL(CREATE_TABLE);\n Log.d(\"TAG\",\"DATABASE TABLE1 CREATED\");\n\n }",
"public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"public static void initDB() {\r\n\t\tboolean ok = false;\r\n\t\ttry(Connection c = DriverManager.getConnection(\"jdbc:hsqldb:file:burst_db\", \"SA\", \"\")) {\r\n\t\t\tString testSQL = \"select count(*) from TB_USERS;\";\r\n\t\t\ttry(PreparedStatement s = c.prepareStatement(testSQL)) {\r\n\t\t\t\ttry(ResultSet rs = s.executeQuery()) {\r\n\t\t\t\t\trs.next();\r\n\t\t\t\t\tSystem.out.println(\"There are \"+rs.getInt(1)+\" known users.\");\r\n\t\t\t\t\tok = true;\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t//Don't panic, table doesn't exist\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//Panic! Cannot connect to DB\r\n\t\t}\r\n\t\t\r\n\t\tif(!ok) {\r\n\t\t\tSystem.out.println(\"Creating Database\");\r\n\t\t\t\r\n\t\t\ttry(Connection c = DriverManager.getConnection(\"jdbc:hsqldb:file:burst_db\", \"SA\", \"\")) {\r\n\t\t\t\tString createSQL = \"create table TB_USERS (USERID varchar(255),BURSTADDRESS varchar(255), BURSTNUMERIC varchar(255));\";\r\n\t\t\t\ttry(Statement s = c.createStatement()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\ts.execute(createSQL);\r\n\t\t\t\t\t\tok = true;\r\n\t\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(Race.createTableSql());\n Log.d(TAG, \"Created race data table\");\n }",
"@Override\n public void onCreate(SQLiteDatabase database) {\n database.execSQL(DATABASE_CREATE);\n }",
"@Override\n public void onCreate(SQLiteDatabase database) {\n database.execSQL(DATABASE_CREATE);\n }",
"@Override\n\tpublic void initDemoDB() {\n\t}",
"public void initializeCategory() {\n try {\n Connection connection = connect();\n PreparedStatement createCategoryTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS category (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"categoryUser varchar,\"\n + \"name varchar(100),\"\n + \"FOREIGN KEY (categoryUser) REFERENCES user(username));\"\n );\n createCategoryTable.execute();\n createCategoryTable.close();\n\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase)\n {\n sqLiteDatabase.execSQL(CREATE_TABLE_Address);\n sqLiteDatabase.execSQL(CREATE_TABLE_USERS);\n }",
"public static void createDataBase() {\n final Configuration conf = new Configuration();\n\n addAnnotatedClass(conf);\n\n conf.configure();\n new SchemaExport(conf).create(true, true);\n }",
"@Override\n public void onDbStarted() {\n }",
"private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }",
"public void dbCreate() throws IOException\n {\n boolean dbExist = dbCheck();\n\n if(!dbExist)\n {\n //By calling this method an empty database will be created into the default system patt\n //of the application so we can overwrite that db with our db.\n this.getReadableDatabase(); // create a new empty database in the correct path\n try\n {\n //copy the data from the database in the Assets folder to the new empty database\n copyDBFromAssets();\n }\n catch(IOException e)\n {\n throw new Error(\"Error copying database\");\n }\n }\n }",
"public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }",
"public void createTable() throws LRException\n\t{\n\t\tgetBackground();\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\t// Create a new (empty) record\n\t\tcreate(new Hashtable(),myData);\n\t\tif (myData.record==null) throw new LRException(DataRMessages.nullRecord(getName()));\n\t\ttry\n\t\t{\n\t\t\tbackground.newTransaction();\n\t\t\tmyData.record.createNewTable(background.getClient(),true);\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}",
"@Override\n public void onCreate(SQLiteDatabase db) {\n\n try {\n db.execSQL(CREATE_TABLE);\n Toast.makeText(context,\"onCreate was called \", Toast.LENGTH_SHORT).show();\n }\n catch (SQLException e){\n\n Toast.makeText(context,\" \"+e, Toast.LENGTH_SHORT).show();\n }\n\n }",
"@Override\n public void onCreate(SQLiteDatabase db) throws SQLException {\n db.execSQL(DATABASE_CREATE);\n //Log.d(\"OnCreate\",\"Database on create method\");\n }",
"public void initDatabase() {\n Datastore mongoDataStore = DatabaseHandler.getInstance().getMongoDataStore();\n initUsers();\n initAccounts();\n mongoDataStore.save(users);\n }",
"public void initializeUser() {\n try {\n Connection connection = connect();\n\n PreparedStatement createCategoryTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS user (\"\n + \"id INTEGER PRIMARY KEY, \"\n + \"username VARCHAR(100),\"\n + \"password VARCHAR(100),\"\n + \"UNIQUE(username, password)\"\n + \");\"\n );\n createCategoryTable.execute();\n createCategoryTable.close();\n\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public static void init_traffic_table() throws SQLException{\n\t\treal_traffic_updater.create_traffic_table(Date_Suffix);\n\t\t\n\t}"
] | [
"0.7688071",
"0.7477985",
"0.74164534",
"0.73175174",
"0.72791606",
"0.7277901",
"0.72583133",
"0.72423863",
"0.7239271",
"0.7219045",
"0.7187437",
"0.71718436",
"0.7157096",
"0.7082296",
"0.70792896",
"0.7060498",
"0.70218533",
"0.70138425",
"0.6993406",
"0.6974227",
"0.69713503",
"0.69707406",
"0.6960434",
"0.6958976",
"0.6955666",
"0.6945382",
"0.69416344",
"0.69397366",
"0.6939414",
"0.6937345",
"0.6925861",
"0.69247675",
"0.6915706",
"0.6889258",
"0.6887329",
"0.6874112",
"0.6856588",
"0.6855892",
"0.6847738",
"0.6843245",
"0.68402743",
"0.6810643",
"0.68073654",
"0.6795844",
"0.6793895",
"0.6776184",
"0.6774162",
"0.67672026",
"0.6761405",
"0.6760365",
"0.67480016",
"0.6738492",
"0.6734186",
"0.67324793",
"0.67255145",
"0.6721938",
"0.6711176",
"0.6709366",
"0.6706131",
"0.6705294",
"0.6703689",
"0.6691746",
"0.6679813",
"0.6665771",
"0.66652364",
"0.6664425",
"0.6654014",
"0.6651137",
"0.66505516",
"0.66414446",
"0.66408396",
"0.6639969",
"0.6618317",
"0.66166073",
"0.6607029",
"0.66066533",
"0.6604125",
"0.6602481",
"0.65915346",
"0.65915346",
"0.6567283",
"0.656506",
"0.6561221",
"0.65590274",
"0.65582395",
"0.65477026",
"0.65477026",
"0.6540472",
"0.65384066",
"0.65363324",
"0.6530297",
"0.6529392",
"0.6528241",
"0.65191495",
"0.6517975",
"0.65165764",
"0.65097815",
"0.6507288",
"0.64923096",
"0.6489475",
"0.64798445"
] | 0.0 | -1 |
Called when the database needs to be upgraded. The implementation should use this method to drop tables, add tables, or do anything else it needs to upgrade to the new schema version. The SQLite ALTER TABLE documentation can be found This method executes within a transaction. If an exception is thrown, all changes will automatically be rolled back. | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("drop table if exists " + COUNTRY_TABLE);
db.execSQL("drop table if exists " + CURRENT_POLL_TABLE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void doUpgrade() {\n // implement the database upgrade here.\n }",
"public void upgrade() {\n\t\t\tLog.w(\"\" + this, \"Upgrading database \"+ db.getPath() + \" from version \" + db.getVersion() + \" to \"\n\t + DATABASE_VERSION + \", which will destroy all old data\");\n\t db.execSQL(\"DROP TABLE IF EXISTS agencies\");\n\t db.execSQL(\"DROP TABLE IF EXISTS stops\");\n\t create();\n\t\t}",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\ttry {\n\t\t\t\tdb.execSQL(TABLE_DROP);\n\t\t\t\tonCreate(db);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t// TODO: upgrade is not supported yet\n\t\t\t//\n\t\t\tLogger.i(\"Upgrade not yet supported\");\n\n\t\t\tfor (SQLTableLayout layout : m_db_tables) {\n\t\t\t\t//\n\t\t\t\t// construct drop table statement\n\t\t\t\t//\n\t\t\t\tString sql_stmt = \"DROP TABLE IF EXISTS \" + layout.m_table_name;\n\t\t\t\tLogger.i(\"STMT: \" + sql_stmt);\n\t\t\t\t//\n\t\t\t\t// execute statement\n\t\t\t\t//\n\t\t\t\tdb.execSQL(sql_stmt);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// construct tables\n\t\t\t//\n\t\t\tonCreate(db);\n\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n try {\n db.execSQL(DROP_TABLE); //drop/remove old table\n onCreate(db); //create new table using updated parameters\n ToastMessage.message(context, \"Change to database has been made!\");\n } catch (SQLException e) {\n //add toast message\n }\n }",
"public void onUpgrade() {\r\n\t\t// Create New table\r\n\t\tDataBaseCreatorTable newt = new DataBaseCreatorTable();\r\n\t\t// Update Table Items\r\n\t\tcreatorClass.onCreate(newt);\r\n\t\t// Update Data Base\r\n\t\t//...\r\n\t\ttable = newt;\r\n\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdrop();\n\t\tonCreate(db);\n\t}",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TB_NAME);\r\n\t\tonCreate(db);\r\n\t\r\n\t\tLog.e(\"Database\", \"onUpgrade\");\r\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {\n try {\n Message.logMessages(\"onUpgrade :\",\"onUpgrade() called\");\n sqLiteDatabase.execSQL(DROP_TABLE);\n onCreate(sqLiteDatabase);\n } catch (SQLException e) {\n Message.logMessages(\"Error in onUpgrade :\",\"\"+e);\n }\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tString[] queries = DROP_TABLES.split(\";\");\n\t\tfor(String query : queries){\n\t\t db.execSQL(query);\n\t\t}\n\t\t\n\t\tString[] drops = CREATE_TABLES.split(\";\");\n\t\tfor(String drop : drops){\n\t\t db.execSQL(drop);\n\t\t}\n\t}",
"@Override\n public void upgrade() throws Exception {\n // all old CDAP tables used to be in the default database\n LOG.info(\"Checking for tables that need upgrade...\");\n List<TableNameInfo> tables = getTables(\"default\");\n\n for (TableNameInfo tableNameInfo : tables) {\n String tableName = tableNameInfo.getTableName();\n TableInfo tableInfo = getTableInfo(tableNameInfo.getDatabaseName(), tableName);\n if (!requiresUpgrade(tableInfo)) {\n continue;\n }\n\n // wait for dataset service to come up. it will be needed when creating tables\n waitForDatasetService(600);\n\n String storageHandler = tableInfo.getParameters().get(\"storage_handler\");\n if (StreamStorageHandler.class.getName().equals(storageHandler) && tableName.startsWith(\"cdap_\")) {\n LOG.info(\"Upgrading stream table {}\", tableName);\n upgradeStreamTable(tableInfo);\n } else if (DatasetStorageHandler.class.getName().equals(storageHandler) && tableName.startsWith(\"cdap_\")) {\n LOG.info(\"Upgrading record scannable dataset table {}.\", tableName);\n upgradeRecordScannableTable(tableInfo);\n } else if (tableName.startsWith(\"cdap_\")) {\n LOG.info(\"Upgrading file set table {}.\", tableName);\n // handle filesets differently since they can have partitions,\n // and dropping the table will remove all partitions\n upgradeFilesetTable(tableInfo);\n }\n }\n }",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\tLog.w(\"DatabaseAdapter\", \"Upgrading database from version \"\n\t\t\t\t\t+ oldVersion + \" to version \" + newVersion);\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MESSAGES);\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_CHATS);\n\t\t\tcreateTable(db);\n\n\t\t}",
"@Override\r\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\tdb.execSQL(\"DROP TABLE IF EXITS \" + TABLE_NAME);\r\n\t\t\tonCreate(db);\r\n\t\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_FILE);\n\t\t// Create tables again\n\t\tonCreate(db);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource,\n int oldVersion, int newVersion) {\n try {\n TableUtils.dropTable(connectionSource, DiaryEntry.class, true);\n onCreate(database, connectionSource);\n } catch (SQLException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"drop table if exist \" + mDbTableName);\n\t\tonCreate(db);\n\t}",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + DATABASE_TABLE);\n\t\t\tonCreate(db);\n\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_JOURNAL);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_TASKS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_LIST);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_WISH);\n\n // create new tables\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n if (oldVersion > 3) {\n switch (oldVersion) {\n case 4:\n new Tables(db).makeConferenceTable();\n case 5:\n new Tables(db).makeTalkTable();\n new Tables(db).makeNotificationTable();\n db.execSQL(\"DROP TABLE IF EXISTS 'table_log'\"); //Removing log table from this version\n db.execSQL(\"DROP TABLE IF EXISTS 'table_database'\"); //Removing JC database table from this version\n db.execSQL(\"DROP TABLE IF EXISTS 'table_external'\"); //Removing External database table from this version\n }\n }\n //Remove support from previous databases\n else {\n new Tables(db).dropAllTables();\n onCreate(db);\n }\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_USER_TABLE);\n db.execSQL(DROP_MONTH_TABLE);\n db.execSQL(DROP_EXPECTED_TABLE);\n db.execSQL(DROP_PERIOD_TABLE);\n db.execSQL(DROP_TRANSACT_TABLE);\n db.execSQL(DROP_TYPE_TABLE);\n db.execSQL(DROP_CATEGORY_TABLE);\n // Create tables again\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n //Drop the old table if exists\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n // Create tables again\n onCreate(db);\n }",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + DATABASE_TABLE + \";\");\n\t\t\tonCreate(db);\n\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {\n try {\n\n TableUtils.dropTable(connectionSource, Comanda_Item.class, true);\n TableUtils.dropTable(connectionSource, Comanda.class, true);\n\n TableUtils.dropTable(connectionSource, Produto.class, true);\n TableUtils.dropTable(connectionSource, Mesa.class, true);\n\n\n onCreate(database, connectionSource);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLENAME);\n\t\tonCreate(db);\n\t}",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tString dropquery;\r\n\t\tdropquery = \"DROP TABLE IF EXISTS EMPLOYEE\";\r\n db.execSQL(dropquery);\r\n onCreate(db);\r\n\t}",
"@Override\n\t\t\tpublic void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {\n\t\t\t\targ0.execSQL(\"drop table if exists \"+TB_NAME);\n\t\t\t\tonCreate(arg0);\n\t\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {\n sqLiteDatabase.execSQL(\"drop table if exists \" + TABLE_NAME + \"\");\n onCreate(sqLiteDatabase);\n }",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\r\n\t\tonCreate(db);\r\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\n\t// Create tables again\n\tonCreate(db);\n\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\t\tonCreate(db);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\n // Create tables again\n onCreate(db);\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\t\tonCreate(db);\n\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n // Create tables again\n onCreate(db);\n }",
"public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\r\n {\r\n // This database is only a cache for online data, so its upgrade policy is\r\n // to simply to discard the data and start over\r\n\r\n Log.i(\"oncreatecall\",\"onupgradecalled\");\r\n db.execSQL(\"DROP TABLE IF EXISTS \" + DatabaseContract.tableDefinition.TABLE_NAME);\r\n onCreate(db);\r\n\r\n Toast.makeText(null,\"upgrade is called\",Toast.LENGTH_SHORT).show();\r\n //basically delete and start over.\r\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, \n int newVersion) {\n // Log the version upgrade.\n Log.w(\"TaskDBAdapter\", \"Upgrading from version \" +\n oldVersion + \" to \" +\n newVersion + \", which will destroy all old data\");\n\n // Upgrade the existing database to conform to the new \n // version. Multiple previous versions can be handled by \n // comparing oldVersion and newVersion values.\n\n // The simplest case is to drop the old table and create a new one.\n db.execSQL(\"DROP TABLE IF IT EXISTS \" + DATABASE_TABLE);\n // Create a new one.\n onCreate(db);\n }",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t// Log the version upgrade.\n\t\t\tLog.w(TAG, \"Upgrading from version \" + oldVersion + \" to \"\n\t\t\t\t\t+ newVersion + \", which will destroy all old data\");\n\n\t\t\t// Upgrade the existing database to conform to the new version.\n\t\t\t// Multiple\n\t\t\t// previous versions can be handled by comparing _oldVersion and\n\t\t\t// _newVersion\n\t\t\t// values.\n\n\t\t\t// The simplest case is to drop the old table and create a new one.\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + CHECKLISTITEM_TABLE + \";\");\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + MEDIAITEM_TABLE + \";\");\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + POLLINGPLACE_TABLE + \";\");\n\t\t\t// Create a new one.\n\t\t\tonCreate(db);\n\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE);\n // Creating tables again\n onCreate(db);\n }",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t// Log the version upgrade.\n\t\t\tLog.w(TAG, \"Upgrading from version \" +\n\t\t\t\toldVersion + \" to \" +\n\t\t\t\tnewVersion + \", which will destroy all old data\");\n\n\t\t\t// Upgrade the existing database to conform to the new version. Multiple\n\t\t\t// previous versions can be handled by comparing _oldVersion and _newVersion\n\t\t\t// values.\n\n\t\t\t// The simplest case is to drop the old table and create a new one.\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE + \";\");\n\n\t\t\t// Create a new one.\n\t\t\tonCreate(db);\n\t\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion,\n int newVersion) {\n // Log the version upgrade.\n Log.w(\"TaskDBAdapter\", \"Upgrading from version \" +\n oldVersion + \" to \" +\n newVersion + \", which will destroy all old data\");\n\n // Upgrade the existing database to conform to the new\n // version. Multiple previous versions can be handled by\n // comparing oldVersion and newVersion values.\n\n // The simplest case is to drop the old table and create a new one.\n // db.execSQL(\"DROP TABLE IF IT EXISTS \" + DATABASE_TABLE);\n // Create a new one.\n onCreate(db);\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource,\n\t\t\tint arg2, int arg3) {\n\t\tthis.connectionSource = connectionSource;\n\t\tdropTable();\n\t\tonCreate(db, connectionSource);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"drop table if exists \" + TABLE_NAME + \";\") ;\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_PUSH);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_PULL);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_LEGS);\n\n // create new tables\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_DEBITOS);\n\n // create new tables\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_USER_TABLE);\n db.execSQL(SQL_DELETE_ENTRIES);\n\n // Create tables again\n onCreate(db);\n\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_PROFILE_TABLE);\n //db.execSQL(DROP_CUSTOMER_TABLE);\n db.execSQL(DROP_REQUEST_TABLE);\n db.execSQL(DROP_SOUVENIR_TABLE);\n\n // Create tables again\n onCreate(db);\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVer, int newVer) {\n\t\tLog.w(SQLiteHelperAbilityScores.class.getName(),\n\t\t\t\t\"Upgrading database from version \" + oldVer + \" to \"\n\t\t\t\t\t\t+ newVer + \", which will destroy all old data\");\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\t\tonCreate(db);\n\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \"+TABLE);\n\t\tonCreate(db);\n\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {\n\t\tAppDBTableCreation.onUpgrade(database, oldVersion, newVersion);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_USERS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_CONF);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_CONF_USERS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_TOPICS);\n\n // create new tables\n onCreate(db);\n }",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\r\n\t\t\r\n\t\tonCreate(db);\r\n\t\t\r\n\r\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase _db, int _oldVersion, int _newVersion) {\n // Log the version upgrade.\n Log.w(\"TaskDBAdapter\", \"Upgrading from version \" +\n _oldVersion + \" to \" +\n _newVersion + \", which will destroy all old data\");\n\n // Upgrade the existing database to conform to the new version. Multiple\n // previous versions can be handled by comparing _oldVersion and _newVersion\n // values.\n\n // The simplest case is to drop the old table and create a new one.\n _db.execSQL(\"DROP TABLE IF IT EXISTS \" + DATABASE_TABLE);\n // Create a new one.\n onCreate(_db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NODE);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_SECTION);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_GPS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MARKER);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_STATS);\n // create new tables\n onCreate(db);\n }",
"private void doUpgrade() {\n // implement the database upgrade here.\n Log.w(\"ACTUALIZANDO\",\"se actualizara la base de datos\");\n updateDatabase();\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_USERS_TABLE_QUERY);\n db.execSQL(DROP_ACCOUNTS_TABLE_QUERY);\n // Create tables again\n onCreate(db);\n }",
"public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n try {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TableDefinition.TABLE_NAME);\n onCreate(db);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.beginTransaction();\n\t\ttry {\n\t\t\tdb.execSQL(ConverterEntry.SQL_DELETE_ENTRIES);\n\t\t\tonCreate(db);\n\t\t}finally {\n\t\t\tdb.endTransaction();\n\t\t}\n\t}",
"@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\tif(oldVersion >= 4 && newVersion <= 10) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tLog.w(TAG, \"Upgrading database from version \" + oldVersion + \" to \"\n\t\t\t\t\t+ newVersion + \", which will destroy all old data\");\n\t\t\tdb.execSQL(\"DROP TABLE IF EXISTS \"+DATABASE_TABLE);\n\t\t\tonCreate(db);\n\t\t}",
"public void onUpgrade(Context ctx,SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + this.TABLE_NAME);\n\n // Create tables again\n onCreate(ctx,db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n db.execSQL(SQL_DELETE_ENTRIES);\n\n // create fresh books table\n this.onCreate(db);\n // This database is only a cache for online data, so its upgrade policy is\n // to simply to discard the data and start over db.execSQL(SQL_DELETE_ENTRIES); onCreate(db);\n }",
"@Override\n public void onDowngrade(SQLiteDatabase db, int oldV, int newV ){\n db.execSQL(\"DROP TABLE IF EXISTS \" + DAILY_ACCOUNT_TABLE);\n db.execSQL(\"DROP TABLE IF EXISTS \" + JOURNEY_ACCOUNT_TABLE);\n db.execSQL(\"DROP TABLE IF EXISTS \" + JOURNEY_TABLE);\n // Drop older table if existed\n db.execSQL(\"DROP TABLE IF EXISTS data\");\n // Create tables again\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLENAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n\n //create new table\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_VEHICLE_TABLE);\n\n // Create tables again\n onCreate(db);\n\n }",
"@Override\n public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion)\n {\n database.execSQL(DropExerciseCacheTableSqlStatement);\n onCreate(database);\n }",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tupgradeDatabase = true;\r\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n // The database is still at version 1, so there's nothing to do be done here.\n Log.e(LOG_TAG, \"Updating table from \" + oldVersion + \" to \" + newVersion);\n\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(CoffeeShopDatabase.CoffeeShopTable.SQL_DELETE_ENTRIES);\n\n //drop coffee shop image table\n db.execSQL(CoffeeShopDatabase.CoffeeShopImageTable.SQL_DELETE_ENTRIES);\n\n //drop drinks table\n db.execSQL(CoffeeShopDatabase.DrinksTable.SQL_DELETE_ENTRIES);\n\n //drop drink image table\n db.execSQL(CoffeeShopDatabase.DrinkImageTable.SQL_DELETE_ENTRIES);\n\n //drop drink order table\n db.execSQL(CoffeeShopDatabase.DrinkOrderTable.SQL_DELETE_ENTRIES);\n\n //drop order detail table\n db.execSQL(CoffeeShopDatabase.OrderDetailTable.SQL_DELETE_ENTRIES);\n\n //recreate coffee shop database\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\n // drop original table and create new ones\n final String DROP_TABLE_FAVOURITES_COMMAND = \"DROP TABLE IF EXISTS \" + FavouritesDatabaseContract.FavouriteEntry.TABLE_NAME + \";\";\n\n db.execSQL(DROP_TABLE_FAVOURITES_COMMAND);\n\n // recreate new table with updated schemas\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ACTIVITY);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_VITAL);\n // create new tables\n onCreate(db);\n }",
"@Override\r\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MACHINE);\r\n\r\n // Create tables again\r\n onCreate(db);\r\n }",
"@Override\n public void onUpgrade(SQLiteDatabase database, int old, int updated) {\n database.execSQL(\"DROP TABLE IF EXISTS \" + PRODUCT_TABLE);\n onCreate(database);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {\n String sql = \"DROP TABLE IF EXISTS \" + TABLE_NAME + \";\";\n sqLiteDatabase.execSQL(sql);\n onCreate(sqLiteDatabase);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ESTABLISHMENT);\n\n // Create Tables again\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ACCELEROMETER);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_GYROSCOPE);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MAGNETIC);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ORIENTATION);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_GPS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_EVENT);\n // create new tables\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n // Delete the existing tables.\n db.execSQL(\"DROP TABLE IF EXISTS \" + SelfieContract.SelfieTable.TABLE_NAME);\n // Create the new tables.\n onCreate(db);\n }",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(DROP_SCHEDULE_TABLE);\r\n\t\tonCreate(db);\r\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n //do this on upgrade - drop the old tables\n db.execSQL(\"DROP TABLE IF EXISTS \" + ProductEntry.TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + SupplierEntry.TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + CategoryEntry.TABLE_NAME);\n\n //create the new tables\n onCreate(db);\n }",
"@Override\n\t\t\t\t\tpublic void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n\t\t\t\t\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t db.execSQL(\"DROP TABLE IF EXISTS \" + DATABASE_TABLE1);\n\t\t onCreate(db);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_KAFSH_TABLE);\n db.execSQL(DROP_DARMANI1_TABLE);\n db.execSQL(DROP_DARMANI2_TABLE);\n // Create tables again\n onCreate(db);\n\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n if (oldVersion != newVersion) {\n // Simplest implementation is to drop all old tables and recreate them\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_TODOS);\n onCreate(db);\n }\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {\n\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_USER_TABLE);\n // db.execSQL(DR);\n\n // Create tables again\n onCreate(db);\n\n }",
"@Override\r\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t}",
"@Override\n public void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TODO_TABLE);\n //Create tables again\n onCreate(db);\n }",
"@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\" DROP TABLE IF EXISTS \" + NOTE_NAME);\r\n\t\tonCreate(db);\r\n\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tLog.d(\"TEST\", \"Upgrading from version \" +\n oldVersion + \" to \" +\n newVersion);\n\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + Constants.SPOT_TABLE_NAME);\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + Constants.USER_RATING_TABLE_NAME);\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + Constants.SPOT_IMAGE_URI_TABLE_NAME);\n\t\tdb.execSQL(\"DROP TABLE IF EXISTS \" + Constants.IMAGE_COMMENTS_TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + Constants.NEWS_ITEM_TABLE_NAME);\n\t\tonCreate(db);\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \"+TABLE_NAME);\n\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS '\" + TABLE_NAME + \"'\");\n onCreate(db);\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_LINEAS_OFERTA);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_CABECERAS_OFERTA);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_TARIFAS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_PUNTOS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_EXTRACOMISION);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_CLIENTES);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_TERMINALES_SMART);\n\n // create new tables\n onCreate(db);\n }",
"@Override\r\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\r\n Log.w(TAG, \"Upgrading database from version \" + oldVersion + \" to \"\r\n + newVersion + \", which will destroy all old data\");\r\n db.execSQL(\"DROP TABLE IF EXISTS \"+DATABASE_TABLE);\r\n onCreate(db);\r\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS tasks\");\n\n // create fresh tasks table\n this.onCreate(db);\n }",
"abstract public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion);",
"@Override\r\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t\r\n\t\t}"
] | [
"0.74998343",
"0.7456348",
"0.74302125",
"0.73856956",
"0.73220694",
"0.72158444",
"0.720385",
"0.71560043",
"0.71468294",
"0.7140286",
"0.70913994",
"0.70864177",
"0.7086241",
"0.7076687",
"0.7068419",
"0.70574963",
"0.7046517",
"0.7031979",
"0.7030294",
"0.70139915",
"0.70002085",
"0.6987816",
"0.6981055",
"0.6975647",
"0.6959332",
"0.6956918",
"0.69432765",
"0.6942329",
"0.6942196",
"0.693977",
"0.6938523",
"0.69381064",
"0.693804",
"0.6918844",
"0.69094723",
"0.6907353",
"0.6907098",
"0.6906322",
"0.69039893",
"0.68956894",
"0.68886787",
"0.68750775",
"0.687277",
"0.6871952",
"0.6868739",
"0.6866814",
"0.68611354",
"0.68547934",
"0.6844154",
"0.68437064",
"0.68397075",
"0.683967",
"0.6839326",
"0.68302894",
"0.6822934",
"0.68162704",
"0.6810354",
"0.6810119",
"0.6802542",
"0.6798201",
"0.67972726",
"0.6794893",
"0.6791962",
"0.6790627",
"0.67879885",
"0.67864513",
"0.67780447",
"0.6776614",
"0.67748225",
"0.67748225",
"0.67748225",
"0.67748225",
"0.67748225",
"0.6773207",
"0.6770778",
"0.6768049",
"0.67675185",
"0.6765838",
"0.67639077",
"0.6761873",
"0.67536604",
"0.6753464",
"0.674347",
"0.67387474",
"0.67382896",
"0.67304003",
"0.6727619",
"0.67266643",
"0.6725446",
"0.6724601",
"0.67236596",
"0.67235214",
"0.67177975",
"0.67142206",
"0.67129356",
"0.67119867",
"0.67106944",
"0.67095846",
"0.6705992",
"0.67048705",
"0.67014366"
] | 0.0 | -1 |
This method sorts the array using insertion sort algorithm | public int[] sort(int[] a) {
// Outer loop that will progress the marker one step ahead
for (int i = 1; i < a.length; i++) {
// Get the current element which we need to compare with the remaining i-1
// elements of the array
int key = a[i];
// Select the j index which checks the 1-1 elements
int j = i - 1;
// Loop for these i-1 elements and compare each element with the key in the
// reverse order
while (j >= 0 && a[j] > key) {
// Move the element to the left
a[j + 1] = a[j];
// Decrement counter by 1
j--;
}
// Now put the key in its appropriate position
a[j + 1] = key;
}
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insertionSort() {\n Comparable p = (Comparable) array[0];\n Comparable[] sorted = new Comparable[array.length];\n sorted[0] = p;\n for (int i = 0; i < array.length - 1; i++) {\n if (p.compareTo(array[i + 1]) < 0) {\n p = (Comparable) array[i + 1];\n sorted[i + 1] = p;\n } else {\n Comparable temp = (Comparable) array[i + 1];\n int j = i;\n while (j >= 0 && sorted[j].compareTo(array[i + 1]) > 0) {\n j--;\n }\n for (int q = i; q > j; q--) {\n sorted[q + 1] = sorted[q];\n }\n sorted[j + 1] = temp;\n }\n }\n this.array = (T[]) sorted;\n }",
"public void insertionSort() {\n\t\tfor (int i = 1; i < numberOfElements; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\twhile (j > 0) {\n\t\t\t\tif (arr[j - 1] <= temp) {\n\t\t\t\t\tnumberOfComparisons++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnumberOfComparisons++;\n\t\t\t\tarr[j] = arr[j - 1];\n\t\t\t\tnumberOfCopies++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j] = temp;\n\t\t}\n\t}",
"private static void insertionSortArray2(int[] arr) {\n\n int key,j;\n\n for(int index=1;index<arr.length;index++){\n\n key=arr[index];\n\n j=index-1;\n\n while(j>=0 && arr[j]>key){\n arr[j+1]=arr[j];\n j--;\n }\n arr[j+1]=key;\n }\n\n\n }",
"private void insertionSort(T[] arr) {\n for (int i = 1; i < n; i++)\n for (int j = i; j > 0 && arr[j].compareTo(arr[j - 1]) < 0; j--) // we create the variable j to shift the element\n swap(arr, j, j - 1);\n }",
"static void InsertionSort(int[] arr){\n int inner, temp;\n for(int outer = 1; outer<arr.length;outer++){\n temp = arr[outer];\n inner = outer;\n while (inner>0 && arr[inner-1]>temp){\n arr[inner] = arr[inner-1];\n inner--;\n }\n arr[inner]=temp;\n }\n }",
"private static void insertionSortArray(int[] arr) {\n\n int key,index;\n for( index=1;index<arr.length;index++){\n key=arr[index];\n for(int j=index-1; j>=0;j--){\n if(key<arr[j]){\n arr[index]=arr[j]; //swap\n arr[j]=key;\n index--; //since a[i] & a[j] are swapped, index of key(i) has to changed\n }else {\n break;\n }\n }\n }\n\n }",
"public static void insertionSort(int[] array) {\n for (int i = 1; i < array.length; i++) {\n int temp = array[i];\n int j = i;\n /**\n * Compare the variable temp with each element on the right until a larger element than it is found.\n */\n while (j > 0 && temp > array[j - 1]) {\n array[j] = array[j - 1];\n j--;\n }\n /**\n * Places temp before the element smaller than it\n */\n array[j] = temp;\n }\n }",
"public static void insertSort (int array[])\n {\n for (int i = 1; i < array.length; ++i)\n {\n int key = array[i];\n int j = i -1;\n\n while(j >= 0 && array[j] > key)\n {\n array[j + 1] = array[j];\n j = j - 1;\n }\n array[j+1] = key;\n }\n }",
"public static void insertionSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tfor(int i=1;i<len;i++){\n\t\t\tfor(int j=i;j>0&&arr[j]<arr[j-1];j--)\n\t\t\t{\n\t\t\t\tint temp=arr[j-1];\n\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\tarr[j]=temp;\n\t\t\t}\n\t\t}\n\t}",
"private static int[] insertionSort(int[] arr) {\n\t\tif(null == arr || arr.length == 0 || arr.length == 1) {\n\t\t\treturn arr;\n\t\t}\n\t\tint i, j;\n\t\tint key = 0;\n\t\tfor(i =1; i<arr.length; i++) {\n\t\t\tkey = arr[i];\n\t\t\tj = i-1;\n\t\t\twhile(j>=0 && arr[j]>key) {\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\tj = j-1;\n\t\t\t\t\n\t\t\t}\n\t\t\tarr[j+1] = key;\n\t\t}\n\t\treturn arr;\n\t}",
"public static void insertionSort(int[] arr) {\r\n\t\tfor (int scan = 1; scan < arr.length; scan++) {\r\n\t\t\tint temp = arr[scan];\r\n\t\t\t\r\n\t\t\tint pos = scan;\r\n\t\t\twhile (pos > 0 && arr[pos - 1] > temp) {\r\n\t\t\t\tarr[pos] = arr[pos - 1];\r\n\t\t\t\tpos--;\r\n\t\t\t}\r\n\t\t\tarr[pos] = temp;\r\n\t\t}\r\n\t}",
"public static void insertionSort(int[] data) {\n for(int i = 1; i < data.length; i++) {\n int j = i;\n while(j > 0 && data[j] < data[j - 1]) { //can get all the way to the front if need be\n int temp = data[j - 1];\n data[j - 1] = data[j];\n data[j] = temp;\n j--;\n }\n }\n }",
"private static int[] insertionSort(int[] inputArr) {\n\t\tint temp;\n\t\tfor(int i=1;i<inputArr.length;i++)\n\t\t{\n\t\t\tfor(int j=i;j>0;j--)\n\t\t\t{\n\t\t\t\tif(inputArr[j-1]>inputArr[j])\n\t\t\t\t{\n\t\t\t\t\ttemp=inputArr[j-1];\n\t\t\t\t\tinputArr[j-1]=inputArr[j];\n\t\t\t\t\tinputArr[j]=temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inputArr;\n\t}",
"private static void sortUsingInsertionSort(int[] array, int k) {\n \n for(int i = 1; i < array.length; ++i) {\n int j = 0;\n while (array[j] < array[i]) {\n j++;\n }\n \n int temp = array[j];\n array[j] = array[i];\n array[i] = temp;\n }\n \n PrintUtil.printArray(array, \"Sorted Array\");\n }",
"public static void insertionSort(int[] array) {\n for (int i = 1; i < array.length; i++) {\n for (int j = i; j > 0 && array[j] < array[j - 1]; j--) {\n swap(array, j, j - 1);\n }\n }\n }",
"public static void insertionSort(int[] array) {\n\n int saveElement;\n int i;\n\n for (int iNextEl = 1; iNextEl < array.length; iNextEl++) {\n saveElement = array[iNextEl]; // 1 - SAVE NEXT ELEMENT\n\n i = iNextEl;\n while ((i > 0) && (array[i - 1] > saveElement)) { // 2 - SHIFT LOOP\n array[i] = array[i - 1];\n i--;\n }\n array[i] = saveElement; // 3 - PUT SAVED ELEMENT BACK\n }\n }",
"public static void insertionSortPart2(int[] ar)\n {\n for(int i = 1; i < ar.length; i++){\n for(int j = 0; j < i; j++){\n if(ar[i] <= ar[j]){\n int tmp = ar[i];\n ar[i] = ar[j];\n ar[j] = tmp;\n }\n }\n printArray(ar);\n }\n }",
"public void InsertionSort(T[] arr)\n {\n for(int i = 1; i < arr.length; i++)\n {\n int j = i -1;\n T value = arr[i];\n\n while(j >= 0 && arr[j].compareTo(value) > 0)\n {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j+1] = value;\n }\n }",
"static void insertionSort(int array[]) {\n int n = array.length;\n //for key selection\n for (int i = 1; i < n; ++i) {\n int key = array[i];\n int j = i - 1;\n\n //Compare the key and elements of array, move greater elements to one position further \n while (j >= 0 && array[j] > key) {\n array[j + 1] = array[j];\n j = j - 1;\n\n }\n array[j + 1] = key;\n }\n\n }",
"public static void InsertionSort(int[] array) {\n for (int i=0; i<array.length; i++) {\n int cur_element = array[i];\n int j = i - 1;\n while (j >= 0 && array[j] > cur_element) {\n array[j+1] = array[j];\n j--;\n }\n array[j+1] = cur_element;\n }\n }",
"static double [] insertionSort (double a[]){\r\n //todo: implement the sort\r\n \tif(a==null){ //could be length\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tfor(int i = 1; i <a.length; i++) {\r\n \t\tdouble current = a[i];\r\n \t\tint j = i;\r\n \t\twhile(j>0 && a[j-1]> current) {\r\n \t\t\ta[j] =a[j-1];\r\n \t\t\tj--;\r\n \t\t} \r\n \t\ta[j]=current;\r\n \t}\r\n \treturn a;\r\n }",
"public void insertionSort(int[]array) {\n\t\t\n\t\tfor(int i=1; i<array.length; i++) {\n\t\t\t\n\t\t\tint key = array[i];\n\t\t\tint j = i - 1;\n\t\t\t\n\t\t\twhile(j >=0 && array[j] > key) {\n\t\t\t\t\n\t\t\t\tarray[j+1] = array[j];\n\t\t\t\tj = j - 1;\n\t\t\t}\n\t\t\tarray[j+1] = key;\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}",
"public static int[] insertionSort(int[] inputArray){\n for (int i = 1; i < inputArray.length; i++){\n int check = inputArray[i];\n int j = i -1;\n\n while (j >= 0 && inputArray[j] > check){\n inputArray[j + 1] = inputArray[j];\n j = j -1; \n }\n inputArray[j + 1] = check;\n }\n return inputArray;\n }",
"public static void insertionSort(Comparable[] a) {\n\n for (int i = 1; i < a.length; i++) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n }",
"public static void Insertionsort(int a[]) \n\t { \n\t int n = a.length; \n\t for (int i=1; i<n; ++i) \n\t { \n\t int key = a[i]; \n\t int j = i-1;\n\t while (j>=0 && a[j] > key) \n\t { \n\t a[j+1] = a[j]; \n\t j = j-1; \n\t } \n\t a[j+1] = key; \n\t } \n\t }",
"public static int[] doInsertionSort(int[] input){\n int temp;\n for (int i = 1; i < input.length; i++) {\n for(int j = i ; j > 0 ; j--){\n if(input[j] < input[j-1]){\n temp = input[j];\n input[j] = input[j-1];\n input[j-1] = temp;\n }\n }\n }\n return input;\n }",
"public static int[] insertionSort(int[] array)\r\n {\n for (int i = 1; i < array.length; i++)\r\n {\r\n // during each iteration as we travel to the right of the array, we\r\n // first need to set our iterator that will move back to the left\r\n // as we find the correct place to put the item we are inserting\r\n // into the left side of the array. Since we know that at this point\r\n // everything to the left of index i is already sorted, we want our\r\n // new item to be inserted to be the first element to the right of \r\n // the sorted section, which is at array[i].\r\n int j = i;\r\n \r\n // now we start moving our backwards iterator, j, to the left one\r\n // array slot at a time. During each iteration we'll check to see\r\n // if the item at array[j] is less than array[j-1], or the item to\r\n // the left. If it is then we swap them and compare again with the\r\n // next item to the left. We repeat this process until we either\r\n // find that array[j] is greater than or equal to the item to the\r\n // left, or that we reach the far left side of the array.\r\n while (j > 0 && array[j] < array[j-1])\r\n {\r\n // create a temp variable to allow us to swap array[j] with\r\n // array[j-1] and then swap the two.\r\n int temp = array[j];\r\n array[j] = array[j-1];\r\n array[j-1] = temp;\r\n \r\n j--;\r\n }\r\n }\r\n \r\n return array;\r\n }",
"void InsertionSort(int a[])\n {\n int i,j;\n\n for( j=1;j<a.length;j++)\n {\n int key =a[j];\n i=j-1;\n\n\n while(i>=0 && a[i]>key)\n {\n a[i+1]=a[i];\n i=i-1;\n }\n a[i+1]=key;\n\n }\n\n }",
"public static void insertionSort(int[] arr) {\n //write your code here\n for(int i=1;i<arr.length;i++) {\n for(int j=i-1;j>=0;j--) {\n if(isGreater(arr, j, j+1))\n swap(arr, j, j+1);\n else\n break;\n }\n }\n}",
"public void insertionSort(int[] nums) {\n for (int i = 1; i < nums.length; i++) {\n // Hold the current element which is processed\n int current = nums[i];\n int j = i;\n\n // Trace backwards and find a place to insert current by shifting elements\n // towards the right\n while (j - 1 >= 0 && nums[j - 1] > current) {\n nums[j] = nums[j - 1];\n j--;\n }\n\n // j is the right place to insert current\n nums[j] = current;\n }\n\n }",
"public static <T extends Comparable<T>> void insertionSort(T[] arrayToSort) {\n for(int i = 1; i < arrayToSort.length; i++) {\n T currentValue = arrayToSort[i];\n int sortedIterator = i - 1;\n // iterate through sorted portion of array\n while((sortedIterator >= 0) && (currentValue.compareTo(arrayToSort[sortedIterator]) < 0))\n arrayToSort[sortedIterator + 1] = arrayToSort[sortedIterator--];\n arrayToSort[sortedIterator + 1] = currentValue;\n }\n }",
"public void insertionSortAsc(){\r\n for(int x=1 ; x<numItems ; x++){ //get the starting point\r\n int temp = mArray[x]; //take the item out\r\n int pos = x -1;\r\n while(pos >= 0 && mArray[pos]>temp){\r\n mArray[pos+1] = mArray[pos]; //shift item up\r\n pos--; //move position left\r\n }\r\n mArray[pos+1] = temp; //insert item in the empty spot\r\n }\r\n }",
"public static void InsertationSort(int[] data)\n {\n int key;\n // loop for select values from the array\n for(int i = 1; i <data.length;i++)\n {\n // key= select the value of index [i]\n key = data[i];\n // select the value that is Previous of the key to compare with.\n int j = i -1 ;\n // loop for comparing and sort, change the order of the values.\n while(j >= 0 && key < data[j])\n {\n data[j+1]=data[j];\n j--;\n }\n data[j+1]=key;\n }\n }",
"public static int[] insertionSort(int[] array) {\n if (array == null || array.length == 0) return new int[]{};\n for (int i = 1; i < array.length; i++) {\n int j = i;\n while (j > 0 && array[j] < array[j - 1]) {\n int temp = array[j];\n array[j] = array[j - 1];\n array[j - 1] = temp;\n j--;\n }\n }\n\n return array;\n }",
"public static void insertionSort(int[] a) {\r\n\r\n int i; //pointer to item in unsorted list\r\n int j; //pointer to an item in sorted list\r\n int value; //the next value to be inserted into sorted list\r\n\r\n for (i = 1; i < a.length; i++) { // iterate for each item in unsorted list\r\n\r\n value = a[i]; //assigns value of element in list to be sorted\r\n j = i - 1; //assign j to be the last element in sorted list\r\n\r\n while (j >= 0 && (a[j] >= value)) {\r\n //if there are still elements in unsorted list \r\n //and if the value to be inserted is less than the the value at index\r\n a[j + 1] = a[j]; //copy element to the right\r\n j--; //increment to check value to the left\r\n }//end while --the array continues moving each element right\r\n a[j + 1] = value; //assign value to it's place \r\n }//end for loop\r\n }",
"public void insertionSort(int[] nums) {\n\t\tif(nums.length<=1) return ;\n\t\tfor(int i=1;i<nums.length;i++) {\n\t\t\tint j=i;\n\t\t\twhile( j>=1 && less(nums[j],nums[j-1])) {\n\t\t\t\tswap(nums,j,j-1);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t}",
"public static <E extends Comparable<E>> E[] insertionsort(E[] arr){\n\t\tfor(int i=0;i<arr.length;i++){\n\t\t\tE key = arr[i];\n\t\t\tboolean flag = false;\n\t\t\tE temp = arr[i];\n\t\t\tfor(int j=0;j<=i;j++){\n\t\t\t\tif(!flag && key.compareTo(arr[j]) <=0){\n\t\t\t\t\tflag = true;\n\t\t\t\t\ttemp = key;\n\t\t\t\t}\n\t\t\t\tif(flag){\n\t\t\t\t\tE t = arr[j];\n\t\t\t\t\tarr[j] = temp;\n\t\t\t\t\ttemp = t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t}",
"public static void insertionSort(int[] array, int lo, int hi){\n for (int i = lo; i <= hi;i++){//loops through the subarray from left to right\n for (int j = i; j > 0;j--){//copy the current array pointer and start to move backwards from there\n if(array[j] < array[j-1]){//check if the current value is misplaced in relation to teh previous one\n int copy = array[j];//the next 3 lines of code are to swap\n array[j] = array[j-1];\n array[j-1] = copy;\n } else{break;}//if the position is correct than we break the loop\n }\n }\n }",
"public void insertionSort(int[] arr) \n {\n int i, j, newValue;\n try\n { \n //looping over the array to sort the elements\n for (i = 1; i < arr.length; i++) \n {\n thread.sleep(100);\n newValue = arr[i];\n j = i;\n if(!orderPanel) //condition for Descending order\n {\n while (j > 0 && arr[j - 1] > newValue) \n {\n arr[j] = arr[j - 1]; // swapping the elements \n repaint(); // painting the GUI\n this.setThreadState();\n j--;\n }\n }\n else // condition for Ascending order\n {\n while (j > 0 && arr[j - 1] < newValue) \n {\n arr[j] = arr[j - 1];\n repaint(); // painting the GUI\n this.setThreadState();\n j--;\n }\n }\n arr[j] = newValue;\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e); \n }\n \n \n }",
"public static void insertionSort(int data[], int order) {\n for (int i = 1; i < data.length; i++) {\n int j = i;\n int k = i - 1;\n while (k >= 0) {\n if (data[j] < data[k]) {\n int temp = data[j];\n data[j] = data[k];\n data[k] = temp;\n j = k;\n k--;\n }\n else\n break;\n }\n }\n }",
"@Test\r\n public void testSort() {\r\n System.out.println(\"sort\");\r\n int[] array = {6, 3, 7, 9, 4, 1, 3, 7, 0};\r\n int[] expResult = {0, 1, 3, 3, 4, 6, 7, 7, 9};\r\n\r\n int[] result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n \r\n array = new int[10000];\r\n for (int i = 0; i < array.length; i++) {\r\n array[i] = new Random().nextInt(Integer.MAX_VALUE);\r\n }\r\n expResult = Arrays.copyOf(array, array.length);\r\n Arrays.sort(expResult);\r\n \r\n result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n }",
"private static void insertionSort(int[] array, int n) {\n \t\n \tfor (int index = 1; index < n; index++) {\n \t\tint temp = array[index];\n \t\tint j = index;\n\n\t\t\tint finalPosition = binarySearch(array, temp, 0, j - 1);\n\n \t\twhile (j > finalPosition) {\n \t\t\tarray[j] = array[j - 1];\n \t\t\tj -= 1;\n \t\t}\n \t\tarray[j] = temp;\n \t}\n }",
"public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }",
"public int[] insertionSort(int[] in) {\n\t\t\n\t\tint[] out = new int[in.length]; \t\t\t// make a copy of the array so it can be reused for all methods\n\t\tSystem.arraycopy(in, 0, out, 0, in.length);\n\t\t\n\t\tfor(int i = 1; i < out.length; i += 1) {\n\t\t\tint temp = out[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\t// Swap the integers as long the left is bigger then right, as long there is a left from scratch\n\t\t\twhile(j > 0 && out[j - 1] > temp) {\n\t\t\t\tout[j] = out[j - 1];\n\t\t\t\tj = j - 1;\n\t\t\t}\n\t\t\tout[j] = temp;\n\t\t}\n\t\treturn out;\n\t}",
"static void insertionSort(int[] A) {\n\t // Sort the array A into increasing order.\n\t \n\t int itemsSorted; // Number of items that have been sorted so far.\n\n\t for (itemsSorted = 1; itemsSorted < A.length; itemsSorted++) {\n\t // Assume that items A[0], A[1], ... A[itemsSorted-1] \n\t // have already been sorted. Insert A[itemsSorted]\n\t // into the sorted part of the list.\n\t \n\t int temp = A[itemsSorted]; // The item to be inserted.\n\t int loc = itemsSorted - 1; // Start at end of list.\n\t \n\t while (loc >= 0 && A[loc] > temp) {\n\t A[loc + 1] = A[loc]; // Bump item from A[loc] up to loc+1.\n\t loc = loc - 1; // Go on to next location.\n\t }\n\t \n\t A[loc + 1] = temp; // Put temp in last vacated space.\n\t }\n\t}",
"public void insertionSort(int[] sortList) {\r\n\t\tint n = sortList.length;\r\n\t\tfor (int j = 1; j < n && sortList[j] != -1; j++) {\r\n\t\t\tint key = sortList[j];\r\n\t\t\tint i = j - 1;\r\n\t\t\twhile ((i > -1) && (sortList[i] > key)) {\r\n\t\t\t\tsortList[i + 1] = sortList[i];\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t\tsortList[i + 1] = key;\r\n\t\t}\r\n\t}",
"public int[] insertionSortInt(int[] input){\r\n\t for(int i=1;i<input.length;i++){\r\n\t\t for(int j=i;j>0;j--){\r\n\t\t\t if(input[j-1]>input[j]){\r\n\t\t\t\t\tinput[j-1]=input[j-1]+input[j];\r\n\t\t\t\t\tinput[j]=input[j-1]-input[j];\r\n\t\t\t\t\tinput[j-1]=input[j-1]-input[j];\r\n\t\t\t\t}\r\n\t\t }\r\n\t }return input;\r\n }",
"public void insertionSort (Integer [] inNums)\n\t{\n\t\tnums = inNums.clone();\n\t\tfor (int i=0; i<nums.length; i++)\n\t\t{\n\t\t\tfor (int j=i; j>0; j--)\n\t\t\t{\n\t\t\t\t//System.out.println (\"i=\"+i+\"; j=\"+j);\n\t\t\t\tprint ();\n\t\t\t\t//if (nums[j] < nums[j-1])\n\t\t\t\tif (nums[j].compareTo (nums[j-1]) < 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = nums[j-1];\n\t\t\t\t\tnums [j-1] = nums[j];\n\t\t\t\t\tnums[j]=temp;\n\t\t\t\t}\n\t\t\t\telse break;\n\t\t\t}\n\t\t}\n\t}",
"public static void insertionSort(int[] list1)\r\n\t{\r\n\t\tint temp=0;\r\n\t\tfor(int outside=1; outside<list1.length; outside++)\r\n\t\t{\r\n\t\t\tfor(int inside=outside; inside>0; inside--)\r\n\t\t\t{\r\n\t\t\t\tif(list1[inside]<list1[inside-1])\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp=list1[inside-1];\r\n\t\t\t\t\tlist1[inside-1]=list1[inside];\r\n\t\t\t\t\tlist1[inside]=temp;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static int[] insertionSort(int[] elements) {\n\t\tif (elements.length == 0 || elements.length == 1)\n\t\t\treturn elements;\n\t\t\n\t\tfor (int i=1;i < elements.length;i++) {\n\t\t\tint temp = elements[i];\n\t\t\tfor (int j=i-1;j >= 0;j--) {\n\t\t\t\tif (temp < elements[j]) {\n\t\t\t\t\telements[j+1] = elements[j];\n\t\t\t\t\telements[j] = temp;\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn elements;\n\t}",
"public void insertionNumberSort()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && Integer.parseInt(AL.get(possibleIndex - 1).toString()) < Integer.parseInt(temp.toString()))\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }",
"private void sorter(int[] array){\r\n\r\n for (int i = 0; i < array.length-1; i++)\r\n for (int j = 0; j < array.length-i-1; j++)\r\n if (array[j] > array[j+1])\r\n {\r\n int temp = array[j];\r\n array[j] = array[j+1];\r\n array[j+1] = temp;\r\n }\r\n }",
"public static int[] insertionSort(int[] arr, int n){\n for(int i=1; i<n; i++){\n int value = arr[i];\n int hole = i;\n while(hole > 0 && arr[hole -1] > value){\n arr[hole] = arr[hole-1];\n hole = hole - 1;\n }\n arr[hole] = value;\n }\n return arr;\n }",
"public static void insertionSort(int[] arr, int left, int right) {\n\t\t int i, j, newValue;\n\t\t for (i = left; i <= right; i++) {\n\t\t\t\tnewValue = arr[i];\n\t\t\t\tj = i;\n\t\t\t\twhile (j > 0 && arr[j - 1] > newValue) {\n\t\t\t\t\t arr[j] = arr[j - 1];\n\t\t\t\t\t j--;\n\t\t\t\t}\n\t\t\t\tarr[j] = newValue;\n\t\t }\n\t}",
"public static String[] insertionSort(String[] list){\n for (int i=1; i<list.length; i++){\r\n //use a variable a to temporarily store the index of the current item\r\n int a = i;\r\n //loop through comparisons with items before it until it reaches an item that is smaller than it\r\n while(list[a].compareTo(list[a-1])<0){\r\n //when item before it is larger, use a temporary string variable to store the current item's value\r\n String temp = list[a];\r\n list[a]=list[a-1];//give list[a] the value of the list[a-1]\r\n list[a-1]=temp;//give list[a-1] the value that is stored in the temporary\r\n a-=1;\r\n if(a==0)\r\n break;\r\n }\r\n }\r\n return list;\r\n }",
"private static void insertion(int[] a){\n int size = a.length;\n int key = 0;\n \n for(int i = 1; i < size; i++){\n key = a[i];\n for(int j = i-1; j >= 0 && key < a[j]; j--){\n a[j+1] = a[j];\n a[j] = key;\n }\n }\n }",
"public String[] insertionSort(String[] in) {\n\t\tString[] out = new String[in.length]; // create a copy so I can reuse the array, not sure that's necessary with the junit test but I'll keep it\n\t\tSystem.arraycopy(in, 0, out, 0, in.length);\n\t\t\n\t\tfor (int i = 1; i < out.length; i += 1){\n\t\t\tString temp = out[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\t//swap strings like the int insertionSort\n\t\t\twhile(j > 0 && out[j - 1].compareTo(temp) > 0) {\n\t\t\t\tout[j] = out[j - 1];\n\t\t\t\tj = j - 1;\n\t\t\t}\n\t\t\tout[j] = temp;\n\t\t}\n\t\treturn out;\n\t}",
"public int[] InsertionSort(int[] A) {\n int n = A.length;\n for(int k = 0; k < n; k++) {\n if(k == minimum) {\n int temp = A[k];\n A[k] = A[0];\n A[0] = temp;\n }\n }\n for(int i = 1; i < n; ++i) {\n int key = A[i];\n int j = i - 1;\n while(j >= minimum && A[j] > key) {\n A[j + 1] = A[j];\n j = j - 1;\n } \n A[j + 1] = key; \n }\n return A;\n }",
"public static void insertionSort(double a[], int low, int high)\n {\n double value;\n int i, j;\n int size = high - low;\n\n for(i = low + 1; i < size; i++) {\n value = a[i];\n j = i;\n\n while(j > 0 && a[j-1] < value) {\n a[j] = a[j-1];\n j = j - 1;\n }\n a[j] = value;\n }\n }",
"public static void sort(Comparable[] a){\n for(int i=1;i<a.length;i++){\n // Insert a[i] among a[i-1],a[i-2],a[i-3]...\n for (int j=i;j>0&&less(a[j],a[j-1]);j--){\n exch(a,j,j-1);\n }\n }\n }",
"public void insertionSort(Long[] keys) {\n int n = keys.length;\n for(int i = 1; i< n; ++i) {\n long current = keys[i];\n int j = i-1;\n\n while(j >= 0 && current < keys[j]) {\n keys[j+1] = keys[j];\n j--;\n\n }\n keys[j+1] = current;\n }\n }",
"public static void inserctionSort(int[] array, int low, int high) {\n for (int i = low; i < high; i++) {\n int x = i;\n int j = i - 1;\n for (; j >= low; j--) {\n if (array[j] > array[x]) {\n int k = array[x];\n array[x] = array[j];\n array[j] = k;\n x = j;\n } else break;\n }\n }\n }",
"public static void insertIntoSorted(int[] ar) {\n int index = ar.length-1;\n int val = ar[index];\n while(index > 0){\n for(int i = ar.length-2; i >=0; i--) {\n if(ar[i] >= val) {\n ar[i+1] = ar[i];\n printArray(ar);\n\n }else if(ar[i] < val && ar[i+1] > val){\n ar[i+1] = val;\n printArray(ar);\n }\n }\n if(ar[0] >= val){\n ar[0] = val;\n printArray(ar);\n }\n index--;\n val = ar[ar.length-1];\n }\n }",
"public static void main(String[] args) {\n\n int arr[]= {3, 4, 5, 7, 9, 1, 2};\n int arr2[]= {7,72,90, 21 ,60};\n\n insertionSortArray2(arr2);\n\n System.out.println(Arrays.toString(arr2));\n }",
"void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }",
"public void insertionSort(ArrayList<T> arr, int p, int r) {\n\t}",
"public static int insertionSort(int[] array)\n {\n int totalShifts = 0;\n int nSorted = 1; // the first n items are sorted\n int n = array.length; // total number of items in the array\n while (nSorted < n)\n {\n // get the next item\n int newInt = array[nSorted];\n int i = 0;\n // locate its position in smaller array\n // equivalent to for (int i)\n // thus can't use i for a different loop\n for (i = 0; i < nSorted; i++){\n\n // if you find a smaller item in there, exchange the two\n if (array[i] > newInt){\n array[nSorted] = array[i];\n array[i] = newInt; \n // make sure exchanging the two didnt make a new imbalance, continue searching through\n newInt = array[nSorted];\n totalShifts++;\n }\n \tnSorted++;\n \t}\n }\n // print total number of shifts\n System.out.print(totalShifts);\n return totalShifts;\n }",
"public static void main(String[] args)\n {\n int[] array=new int[5];\n Random ran=new Random();\n for(int i=0;i<array.length;i++)\n {\n //assign each item a value range from 0~99\n array[i]=ran.nextInt(100);\n }\n\n System.out.println(\"Before Insertion Sort: \"+Arrays.toString(array));\n insertionSort(array,array.length);\n System.out.println(\"After Insertion Sort : \"+Arrays.toString(array));\n\n }",
"public String[] insertionSortString(String[] input){\r\n\t\tString temp=\"\";\r\n\t\tfor(int i=1;i<input.length;i++){\r\n\t\t\tfor(int j=i;j>0;j--){\r\n\t if(input[j-1].compareTo(input[j])>0){\r\n\t \t temp=input[j-1];\r\n\t \t input[j-1]=input[j];\r\n\t \t input[j]=temp;\r\n\t }\r\n\t\t\t}\r\n\t\t}return input;\r\n\t}",
"public static void insertSort(int[] a, int n){\n // 插入排序,把数组分为已排序区和未排序区,依次把未排序中的元素插入的已排序中\n\n for (int i = 1; i < n ; ++i){\n // 遍历已排序区,找到已排序中符合要求的位置\n // value 待插入的数据\n int value = a[i];\n // j = 已排序的区间索引前一位\n int j = i-1;\n for (;j>=0;--j){\n\n // System.out.printf(\"\\n[%s : %s]\", Arrays.stream(a).boxed().collect(Collectors.toList()).subList(0,i).toString(),Arrays.stream(a).boxed().collect(Collectors.toList()).subList(i,n).toString());\n if (a[j] > value){\n // 大于待插入的数据的都自觉往后移动一位\n a[j+1] = a[j];\n move++;\n }else {\n // 中止 当前j为目标位置\n break;\n }\n }\n a[j+1] = value;\n }\n }",
"@Test\n public void testSort(){\n InsertionSort sort = new InsertionSort();\n int arr[] = sort.shellInsertionSort(initArr());\n scan(arr);\n }",
"public void insertionSort(String[] s1) {\r\n for(int i=0;i<s1.length;i++){\r\n \tArrays.sort(s1);\r\n \tSystem.out.println(s1[i]);\r\n\t\t}\r\n\t\r\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"public abstract void sort(int[] array);",
"static void insertIntoSorted(int ar[]) {\n\n\t\tint valueToInsert, holePosition;\n\n\t\tfor (int i = ar.length - 1; i > 0; i--) {\n\n\t\t\tvalueToInsert = ar[i];\n\t\t\tholePosition = i;\n\n\t\t\twhile (holePosition < ar.length\n\t\t\t\t\t&& ar[holePosition - 1] > valueToInsert) {\n\t\t\t\tar[holePosition] = ar[holePosition - 1];\n\t\t\t\tholePosition -= 1;\n\n\t\t\t\tdisplaySteps(ar);\n\t\t\t\tSystem.out.println();\n\t\t\t\tif (holePosition == 0) {\n\t\t\t\t\tif (ar[holePosition] > valueToInsert) {\n\t\t\t\t\t\tar[holePosition] = valueToInsert;\n\t\t\t\t\t\tdisplaySteps(ar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tar[holePosition] = valueToInsert;\n\t\t\tif (i == 1 && holePosition != 0) {\n\t\t\t\tdisplaySteps(ar);\n\t\t\t}\n\n\t\t}\n\t}",
"public static double [] insertionSort(double a[]) {\n insertionSort(a, 0, a.length-1);\n return a;\n }",
"public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }",
"public void sort(int array[]){\n for(int i=1;i < array.length;i++){\n int j=i-1;\n int cur=i;\n while(array[cur] < array[j] && j >=0 ){\n swap(array,cur,j);\n cur--;\n j--;\n }\n\n }\n }",
"@Override\r\n\tpublic void sortASC(int[] array) {\n\t\t\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\r\n\t\t\t\t\r\n\t\t\t\tif (array[i] > array[j]) {\r\n\t\t\t\t\tint temp = array[i];\r\n\t\t\t\t\tarray[i] = array[j];\r\n\t\t\t\t\tarray[j] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public static int[] insert(int x, int[] a) {\n Arrays.sort(a);\n a = Arrays.copyOf(a, a.length + 1);\n if (a[a.length - 2] <= x) {\n a[a.length - 1] = x;\n } else {\n int i = a.length - 2;\n while ((i + 1 > 0) && (x < a[i])) {\n a[i+1] = a[i];\n i--;\n }\n a[i+1] = x;\n }\n return a;\n}",
"public static void main(String[] args)\n {\n Integer[] array = new Integer[50];\n Random rnd = new Random();\n for (int i = 0; i < array.length; i++)\n array[i] = rnd.nextInt(100);\n\n System.out.println(\"array before sorted: \" + Arrays.toString(array));\n\n insertionSort(array);\n\n // check if it is really sorted now\n for (int i = 0; i < array.length - 1; i++ )\n {\n if (array[i] > array[i + 1])\n {\n System.out.println(\"something wrong\");\n return;\n }\n }\n\n System.out.println(\"array sorted: \" + Arrays.toString(array));\n }",
"public void sort() {\n\t\tfor (int i = 1; i < this.dataModel.getLength(); i++) {\n\t\t\tfinal int x = this.dataModel.get(i);\n\n\t\t\t// Find location to insert using binary search\n\t\t\tfinal int j = Math.abs(this.dataModel.binarySearch(0, i, x) + 1);\n\n\t\t\t// Shifting array to one location right\n\t\t\tthis.dataModel.arrayCopy(j, j + 1, i - j);\n\n\t\t\t// Placing element at its correct location\n\t\t\tthis.dataModel.set(j, x);\n\t\t\tthis.repaint(this.count++);\n\t\t}\n\t}",
"public static void sort(int[] arr){\n\n for(int i=1;i<arr.length;i++){\n int current=arr[i];\n int j=i-1;\n\n while(j>=0 && arr[j]>current){\n arr[j+1]=arr[j];\n j--;\n }\n\n arr[j+1]=current;\n }\n\n\n\n }",
"public <T extends Comparable<? super T>> void sort (T[] a) {\n int n = a.length;\n for (int i = 0; i< n - 1; i++) {\n for (int j = 0; j < n -1 - i; j++) {\n if (a[j+1].compareTo(a[j]) < 0) \n {\n T tmp = a[j]; \n a[j] = a[j+1];\n a[j+1] = tmp;\n }\n }\n }\n }",
"@Test(timeout = SHORT_TIMEOUT)\n public void testTinyInsertionSort() {\n //size-0 arr\n toSort = new IntPlus[0];\n sortedInts = cloneArr(toSort);\n Sorting.insertionSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n\n //size-1 arr\n toSort = new IntPlus[1];\n toSort[0] = new IntPlus(42);\n sortedInts = cloneArr(toSort);\n Sorting.insertionSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n }",
"Vector<NewsArticle> insertionSort(Vector<NewsArticle> articles) {\n int i, j;\n int size = articles.size();\n NewsArticle sortedList[] = new NewsArticle[articles.size()];\n\n articles.copyInto(sortedList);\n NewsArticle temp;\n\n for (i = 1; i < size; i++) {\n temp = sortedList[i];\n\n j = i;\n while ((j > 0) && (sortedList[j - 1].getScore(filterType) < temp.getScore(filterType))) {\n sortedList[j] = sortedList[j - 1];\n j = j - 1;\n }\n sortedList[j] = temp;\n }\n Vector<NewsArticle> outList = new Vector<NewsArticle>();\n\n for (i = 0; i < size; i++) {\n temp = sortedList[i];\n outList.addElement(temp);\n }\n return outList;\n }",
"@Override\n\tpublic void sort(int[] array) {\n\n\t}",
"public static void sort(int [] a) {\n for(int i=0; i<a.length;i++){\n for (int j = i+1; j < a.length; j++) {\n int temp=0;\n if(a[i]>a[j]){\n temp=a[j];\n a[j]=a[i];\n a[i]=temp;\n }\n }\n }\n }",
"public static <T> void insertionSort(T[] arrayType, Comparator<? super T> comparator) {\n for (int count = 1; count < arrayType.length; count++) {\n T temp = arrayType[count];\n for (int position = count - 1; position >= 0; position--) {\n if (comparator.compare(arrayType[position], temp) > 0) {\n arrayType[position + 1] = arrayType[position];\n if (position == 0) {\n arrayType[position] = temp;\n }\n } else {\n arrayType[position + 1] = temp;\n break;\n }\n }\n }\n\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public int insertionSort()\n {\n // initialize the number of sort checks to 0\n int numSortChecks = 0;\n\n /** FOR INSERTION SORT, EPUT YOUR CODE HERE **/\n\n // Loop through the array of cards ... put each one in the heap\n // add to the heap ... increase the number of sort checks based\n // on the number returned from myCardHeap.add( )\n\n // Loop over all the card in the heap, keep a counter as to which card \n // number we are on\n // use extractMin() to remove a card from the heap\n // place this card into the array at the appropriate position.\n // iuncrement the numChecks variable\n\n return numSortChecks;\n }",
"@Override\n public void sort(int[] array) {\n for (int i = 0; i < array.length - 1; ++i) {\n for (int j = i + 1; j < array.length; ++j) {\n if (array[i] > array[j]) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }\n }\n }",
"public void insertionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = 1 ; i < list.size(); i++){\r\n\t\t\tsteps ++; //=\r\n\t\t\tint j = i;\r\n\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\twhile ((j - 1 > 0) && (list.get(j).compareTo(list.get(j - 1)) > 0)){\r\n\t\t\t\tsteps += 3; // swap(), -, --\r\n\t\t\t\tswap(list, j, j - 1);\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tj--;\r\n\t\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\t}\r\n\t\t\tsteps += 2; //increment, check condition\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Insertion Sort\");\r\n\t\tSystem.out.println();\r\n\t}",
"public static <E extends Comparable<E>> void insertionSort(\r\n\t\t\tComparable<E>[] data) {\r\n\t\tinsertionSort(data, 0, data.length - 1);\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tint[] a = { 1, 8, 20, 5, 4, 9 };\r\n\t\tinsertSort(a);\r\n\t\tSystem.out.println(Arrays.toString(a));\r\n\t}",
"@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }",
"public static void main(String[] args) {\n\t\t\n int array[] = {20,50,10,43,543,-43,-42,-245,5,21,5,1010};\n \n for(int firstUnsortedIndex = 1; firstUnsortedIndex < array.length; firstUnsortedIndex++) {\n \t\n \tint newElement = array[firstUnsortedIndex]; //storing the element of the unsorted array temporary to newElement\tin case we need to overwrite\n \n \tint i;\n \t//we want to keep looking for the insertion position as long as we havent hit the front of the array\n \tfor(i = firstUnsortedIndex; (i > 0 && array[i-1] > newElement); i--) {\n \t\tarray[i] = array[i-1];\n \t}\n \t\n \tarray[i] = newElement;\n }\n \n printer(array);\n \n\t}",
"public static void sort(int[] arr){\n\t\tint temp;\n\t\tfor(int i=0; i<arr.length; i++){\n\t\t\tfor(int j=1; j<arr.length-i; j++)\n\t\t\tif(arr[j-1] > arr[j]){\n\t\t\t\ttemp = arr[j-1];\n\t\t\t\tarr[j-1] = arr[j];\n\t\t\t\tarr[j] = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}"
] | [
"0.86171216",
"0.84575176",
"0.8406201",
"0.8334283",
"0.8328272",
"0.83019674",
"0.82512474",
"0.824976",
"0.8248559",
"0.82383186",
"0.8230618",
"0.81706536",
"0.8160035",
"0.8121938",
"0.8100804",
"0.80904263",
"0.8080974",
"0.8079458",
"0.80515873",
"0.804096",
"0.80175805",
"0.79918635",
"0.79916817",
"0.7979891",
"0.79653656",
"0.79640263",
"0.7930059",
"0.79284704",
"0.7914324",
"0.78791684",
"0.7858125",
"0.784863",
"0.7825738",
"0.77911335",
"0.7760778",
"0.77482396",
"0.7734061",
"0.75812423",
"0.75659335",
"0.7549387",
"0.7542312",
"0.75283355",
"0.7488008",
"0.74769413",
"0.7471161",
"0.745467",
"0.74414337",
"0.74345315",
"0.7425524",
"0.739072",
"0.7371916",
"0.73369694",
"0.7325374",
"0.731772",
"0.7299792",
"0.7275537",
"0.7254285",
"0.7253035",
"0.72450835",
"0.7243121",
"0.72284526",
"0.71722233",
"0.716911",
"0.7167987",
"0.7164389",
"0.71068275",
"0.7095166",
"0.7088743",
"0.7085533",
"0.70778155",
"0.7060035",
"0.70293427",
"0.7006878",
"0.7003457",
"0.6998713",
"0.69711536",
"0.6959107",
"0.695865",
"0.69373775",
"0.68950754",
"0.68926895",
"0.6891666",
"0.68913484",
"0.689063",
"0.68895495",
"0.6887944",
"0.686906",
"0.68543655",
"0.68434983",
"0.68316257",
"0.6822179",
"0.68046415",
"0.6801076",
"0.6781392",
"0.6773257",
"0.6763425",
"0.673871",
"0.67363805",
"0.673605",
"0.67333174",
"0.6733062"
] | 0.0 | -1 |
Choose the value provided during the permission request phase, or a value from the proposal queue if nothing comes back from the cluster. | private Value chooseSuggestion(PermissionOutcome outcome) {
Value suggestedValue;
if (outcome.highestAcceptedValue != null) {
suggestedValue = outcome.highestAcceptedValue;
} else {
try {
suggestedValue = queue.peek();
} catch (NoSuchElementException e) {
suggestedValue = new Value();
}
}
return suggestedValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@NonNull\n public T getRequestedValue() {\n return mRequestedValue;\n }",
"Object getPerm(String name, Object def);",
"public void setRequested(User requested) {\n this.requested = requested;\n }",
"Object getPerm(String name);",
"public String getRequested() {\n return this.requested;\n }",
"public User getRequested() {\n return requested;\n }",
"protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }",
"public static synchronized permanentRequestQueue getPermRequestQueue() throws InvalidObjectException{\n if(myPermanentRequestQueue == null){\n if(appContext != null) {\n myPermanentRequestQueue = newPermRequestQueue(appContext);\n } else {\n throw new InvalidObjectException(new String(\"No context\"));\n }\n }\n return myPermanentRequestQueue; //no error checking included\n }",
"pb4server.ResurgenceAskReq getResurgenceAskReq();",
"void setPerm(String name,\n Object value);",
"int provideValue();",
"public Object getProvidedValue() {\n return providedValue;\n }",
"public E poll() {\n\t\tif (apq.isEmpty())\n\t\t\treturn null;\n\t\tE retValue = apq.get(1);\n\t\tswap(1, apq.size() - 1); // -1 changed, change back if it doesnt work\n\t\tapq.remove(apq.size() - 1); // -1 changed, change back if it doesnt work\n\t\tdownheap(1);\n\t\treturn retValue; // implement this method\n\t}",
"protected abstract Optional<T> getSingleSelection();",
"public synchronized void acceptRequest(ProposalNum proposalNum, Object value) {\n if (highestPrepare == null || proposalNum.greaterThanOrEqual(highestPrepare)) {\n this.value = value;\n System.out.println(\"Value accepted: \" + this.value);\n }\n }",
"public abstract int getPreferredValue();",
"public void setRequested(String requested) {\n this.requested = requested;\n }",
"protected Object getRequiredValue(Node node, int idx, String argumentName,\n InternalContextAdapter context)\n throws MethodInvocationException\n {\n if (!requireArgument(node, idx, argumentName)) {\n return null;\n }\n Object obj = node.jjtGetChild(idx).value(context);\n if (obj == null) {\n rsvc.error(\"#\" + getName() + \"() error : value of \" + argumentName + \" is null\");\n return null;\n }\n return obj;\n }",
"public Permission getPermission(String objectId, User user, Boolean pending) throws UserManagementException;",
"private ClaimOrConcession(int proposal) {\n this.proposal = proposal;\n }",
"public int askPrimary();",
"int getQuotaModeValue();",
"String getValue() throws AccessDeniedException {\n\t performSecurityManagerCheck();\n\t return town;\n\t }",
"public LoginMessageRequest getValue() {\n return localValue;\n }",
"public LoginMessageRequest getValue() {\n return localValue;\n }",
"void permissionGranted(int requestCode);",
"public Optional<PickingRequest> getTask() {\n return Optional.ofNullable(task);\n }",
"private Proposal getSelectedProposal() {\n\t\tif (isValid()) {\n\t\t\tint index = proposalTable.getSelectionIndex();\n\t\t\tif (proposalList == null || index < 0 || index >= getTableLength()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tint proposalIndex = 0;\n\t\t\tfor (Proposal proposal : proposalList.getTopProposalList()) {\n\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\treturn proposal;\n\t\t\t\t}\n\t\t\t\tproposalIndex++;\n\t\t\t}\n\t\t\tfor (String provider : proposalList.getProviderList()) {\n\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tproposalIndex++;\n\t\t\t\tfor (Proposal proposal : proposalList.getProposals(provider)) {\n\t\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\t\treturn proposal;\n\t\t\t\t\t}\n\t\t\t\t\tproposalIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public String getRequestedBy() {\n return this.requestedBy;\n }",
"pb4server.GiveRansomAskReq getGiveRansomAskReq();",
"Question getQuest(String topic){\r\n\t\thasQ = false;\r\n\t\twhile(!hasQ){\r\n\t\t\trandNo = rand.nextInt(bank.get(topic).size());\r\n\t\t\tif(!bank.get(topic).get(randNo).getAsked()){\r\n\t\t\t\tbank.get(topic).get(randNo).setAsked(true);\r\n\t\t\t\treturn bank.get(topic).get(randNo);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public GroupPendingPermissionResults invoke()\n\t\t{\n\t\t\tfor (final Iterator<B2BCustomerModel> outerInter = pendingPermissions.keySet().iterator(); outerInter.hasNext();)\n\t\t\t{\n\t\t\t\tfinal B2BCustomerModel empl = outerInter.next();\n\t\t\t\tapproverPermissions = new HashSet<B2BPermissionResultModel>(pendingPermissions.get(empl));\n\t\t\t\tfor (final Iterator<B2BCustomerModel> innerInter = pendingPermissions.keySet().iterator(); innerInter.hasNext();)\n\t\t\t\t{\n\t\t\t\t\tfinal B2BCustomerModel innerEmpl = innerInter.next();\n\t\t\t\t\tif (empl.equals(innerEmpl))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tapproverPermissions.addAll(pendingPermissions.get(innerEmpl));\n\t\t\t\t\t\tif (getPermissionResultHelper().extractPermissionTypes(approverPermissions)\n\t\t\t\t\t\t\t\t.containsAll(permissionsThatNeedApproval)) // NOSONAR\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmyResult = true;\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyResult = false;\n\t\t\treturn this;\n\t\t}",
"public void setRequested(){\n this.status = \"Requested\";\n }",
"public Man getPreference(int rank) {\r\n\t\treturn preference[rank - 1]; // rank = 1 => preference[0]\r\n\t}",
"@Override\n\t\t\tpublic IAMQPPublishAction replyTo(IAMQPQueue queue) {\n\t\t\t\treturn null;\n\t\t\t}",
"@Override\n\t\t\tpublic IAMQPPublishAction replyTo(IAMQPQueue queue) {\n\t\t\t\treturn null;\n\t\t\t}",
"private static MenuOption getRequest() \n\t{\n\t\tint request = 5;\n\t\tSystem.out.printf(\n\t\t\t\t\"%n--[ Manage My Contacts ]--%n%n%s%n%s%n%s%n%s%n%s%n\",\n\t\t\t\t\"1. Add new contact\", \"2. Delete a contact\",\n\t\t\t\t\"3. View a contact\", \"4. Display all contacts\",\n\t\t\t\t\"5. Exit program\");\n\t\ttry \n\t\t{\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\tdo \n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%nSelection: \");\n\t\t\t\trequest = input.nextInt();\n\t\t\t} while ((request < 1) || (request > 5));\n\t\t} catch (NoSuchElementException e) \n\t\t{\n\t\t\tSystem.err.println(\"Invalid input. Closing\");\n\t\t}\n\t\treturn choices[request - 1];\n\t}",
"void requestNeededPermissions(int requestCode);",
"@SuppressWarnings(\"unchecked\")\n\tpublic V getValue() {\n\t\t\n\t\tif (!valueSet) {\n\t\t\t// If the value has not been set this instance has recently been de-serialized\n\t\t\t\n\t\t\tif (valueIsSerializable) {\n\t\t\t\t// The original value was serializable and will thus have been been de-serialized too\n\t\t\t\tvalue = serializableValue;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// The original value was NOT serializable so we need to generate it from the raw \n\t\t\t\t// submitted value again.\n\t\t\t\t\n\t\t\t\t// A converter may not be serializable either, so we obtain a new instance as well.\n\t\t\t\t// TODO: Maybe test if converter is serializable and if so keep a reference\n\t\t\t\tConverter converter = RequestParameterProducer.getConverter(requestParameter, targetType);\n\t\t\t\t\n\t\t\t\tObject convertedValue;\n\t\t\t\tif (converter != null) {\n\t\t\t\t\tconvertedValue = converter.getAsObject(getContext(), getViewRoot(), submittedValue);\n\t\t\t\t} else {\n\t\t\t\t\tconvertedValue = submittedValue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvalue = (V) convertedValue;\n\t\t\t}\n\t\t\t\n\t\t\tvalueSet = true;\n\t\t}\n\t\t\n\t\treturn value;\n\t}",
"@Override\n\t\t\tpublic String pickItem(Map<String, Integer> distribution) {\n\t\t\t\treturn null;\n\t\t\t}",
"@Override\n\t\t\tpublic String pickItem(Map<String, Integer> distribution) {\n\t\t\t\treturn null;\n\t\t\t}",
"@Override\n\tpublic Object setPossibleValue() {\n\t\treturn null;\n\t}",
"abstract public void getPermission();",
"public T getValue(UUID player) {\n\t\tT value = values.get(player);\n\t\tif (value == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}",
"@Override\n public int guessCardValue(Player p) {\n return Card.PRINCESS;\n }",
"@Override\r\n\tpublic E poll() {\n\t\treturn null;\r\n\t}",
"private ExpSem choose(AST.Expression exp, QvarSem qvar, ExpSem none, FunExpSem some)\n {\n if (qvar instanceof QvarSem.Single &&\n (none == null || none instanceof ExpSem.Single) &&\n some instanceof FunExpSem.Single)\n {\n QvarSem.Single qvar0 = (QvarSem.Single)qvar;\n ExpSem.Single none0 = (ExpSem.Single)none;\n FunExpSem.Single some0 = (FunExpSem.Single)some;\n if (translator.nondeterministic)\n return (ExpSem.Multiple)(Context c)-> \n {\n Seq<Value[]> v = qvar0.apply(c);\n // if (v.get() == null)\n // {\n // if (none0 == null)\n // return Seq.empty();\n // else\n // return Seq.cons(none0.apply(c), Seq.empty());\n // }\n // return v.apply((Value[] v1)->some0.apply(v1).apply(c));\n if (none0 == null)\n return v.apply((Value[] v1)->some0.apply(v1).apply(c));\n else\n return Seq.append(v.apply((Value[] v1)->some0.apply(v1).apply(c)),\n Seq.supplier(()->new Seq.Next<Value>(none0.apply(c), Seq.empty())));\n };\n else\n return (ExpSem.Single)(Context c)-> \n {\n Main.performChoice();\n Seq<Value[]> v = qvar0.apply(c);\n Seq.Next<Value[]> next = v.get();\n if (next == null) \n {\n if (none0 == null)\n {\n translator.runtimeError(exp, \"no choice possible\");\n return null;\n }\n else\n return none0.apply(c);\n }\n else\n return some0.apply(next.head).apply(c);\n };\n }\n else\n {\n QvarSem.Multiple qvar0 = qvar.toMultiple();\n FunExpSem.Multiple some0 = some.toMultiple();\n ExpSem.Multiple none0 = none == null ? null : none.toMultiple();\n return (ExpSem.Multiple)(Context c)->\n {\n Seq<Seq<Value[]>> result = qvar0.apply(c);\n return result.applyJoin((Seq<Value[]> v)->\n {\n if (v.get() == null) \n {\n if (none0 == null)\n return Seq.empty();\n else\n return none0.apply(c);\n }\n return v.applyJoin((Value[] v1)->some0.apply(v1).apply(c));\n });\n };\n }\n }",
"public void requestResult(String value){\n if (mCurrentlyExecuting != null) return;\n AsyncRandom rand = new AsyncRandom();\n mCurrentlyExecuting = rand;\n mCurrentlyExecuting.execute(value);\n }",
"public int getEffectivePriority() \n {\n if(waitQueue == null)\n\t\t\t{\n return priority;\n }\n \n if(lastEffectivePriority < 0) //If there is a need to update the last effective priority\n\t\t\t{\n if(waitQueue != null) \n\t\t\t\t{\n if(waitQueue.transferPriority) //If the queue concerned is a join or a lock waitQueue and not the readyQueue\n\t\t\t\t\t{\n\t\t\t\t\t\tlastEffectivePriority=Math.max(waitQueue.getMaxPriority(),priority+donation); //Maximum of the priority of the head of the queue and priority+proposed donation\n }\n else\n\t\t\t\t\t{\n return priority;\n }\n }\n \n else\n\t\t\t\t{\n lastEffectivePriority = priority; //Set effective priority for the first time\n }\n }\n return lastEffectivePriority;\n }",
"protected Object getOptionalValue(Node node, int idx,\n InternalContextAdapter context)\n throws MethodInvocationException\n {\n Node target = getOptionalNode(node, idx);\n if (target == null) {\n return null;\n }\n return target.value(context);\n }",
"public BagSubject getDecision(PBFTBag bag){\n /* If the preprepare is null then do nothing.*/\n boolean completed = false;\n if(bag == null) return null;\n\n /* Get composite key of the prepare. */\n Long entryKey = bag.getSequenceNumber();\n Object lServerID = getLocalServerID();\n\n /* If the entry key is not null then it'll update state. */\n if(entryKey != null) {\n SoftQuorum q = (SoftQuorum)getStateLog().getQuorum(BAGQUORUMSTORE, entryKey.toString());\n if(q == null){\n int f = getServiceBFTResilience();\n q = new SoftQuorum(2 * f + 1);\n getStateLog().getQuorumTable(BAGQUORUMSTORE).put(entryKey.toString(), q);\n }\n\n /*TODO: evaluate if \"q.getCurrentDecision()\" is a better implementation */\n BagSubject decision = (BagSubject) q.decide();\n\n if(decision != null){\n completed = true;\n }\n\n q.add(new Vote(bag.getReplicaID(), new BagSubject(bag)));\n\n if(decision == null){\n decision = (BagSubject) q.decide();\n }\n\n JDSUtility.debug(\"[PBFTServer:getDecision(bag)] s\" + lServerID +\", at time \" + getClockValue() + \", updated a entry in its log for \" + bag);\n\n if(!completed && decision != null){\n long seqn = (Long) decision.getInfo(BagSubject.SEQUENCENUMBER);\n JDSUtility.debug(\"[PBFTServer:getDecision(bag] s\" + lServerID + \", at time \" + getClockValue() + \", completed quorum for bag with EXEC-SEQ (\" + seqn + \")\");\n return decision;\n }\n }\n return null;\n }",
"pb4server.TransportResAskReq getTransportResAskReq();",
"public Coordinate getChoice () throws Exception{\n\n\t\treturn queue.dequeue();\n\t}",
"private void requestStoragePermission(){\n requestPermissions(storagePermissions, STORAGE_REQUESTED_CODE);\n }",
"IAccessPackageCatalogReferenceRequest select(final String value);",
"String getPreference(String user, String preferenceName) throws OntimizeJEERuntimeException;",
"public ProtocolResult getRequest() {\n\t\t\n\t\tif( hasReachedTimeout() ){\n\t\t\taddError(Locale.getString(\"FipaRequestProtocol.2\")); //$NON-NLS-1$\n\t\t}\n\t\telse{\n\t\t\tif (isParticipant() && (getState() == RequestProtocolState.NOT_STARTED)) {\n\t\t\t\t\n\t\t\t\tACLMessage message = getRefAclAgent().getACLMessage(EnumFipaProtocol.FIPA_REQUEST, Performative.REQUEST);\n\t\t\t\t\n\t\t\t\tif (message != null) {\n\t\t\t\t\tinitiate(message.getSender(), getRefAclAgent().getAddress());\n\t\t\t\t\t\n\t\t\t\t\tsetConversationId(message.getConversationId());\n\t\t\t\t\tsetState(RequestProtocolState.WAITING_REQUEST);\n\t\t\t\t\t\n\t\t\t\t\tresetStartedTime();\n\t\t\t\t\t\n\t\t\t\t\treturn new ProtocolResult(message.getSender(), Performative.REQUEST, message.getContent().getContent().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (isInitiator()) {\n\t\t\t\taddError(Locale.getString(\"FipaRequestProtocol.3\")); //$NON-NLS-1$\n\t\t\t}\n\t\t\telse {\n\t\t\t\taddError(Locale.getString(\"FipaRequestProtocol.4\")); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private void claim(int proposal) {\n this.claimStatus = new ClaimOrConcession(proposal);\n }",
"public long getAmountRequested();",
"@SystemAPI\n\tboolean needsApproval();",
"public static DistributionState get(int value) {\r\n switch(value) {\r\n case CALCULATING_VALUE:\r\n return CALCULATING;\r\n case DONE_VALUE:\r\n return DONE;\r\n }\r\n return null;\r\n }",
"pb4server.CureSoliderAskReq getCureSoliderAskReq();",
"@Override\n protected V doAccept(Token token, int flags) throws CommandSyntaxException {\n String t = caseInsensitive ? token.text.toLowerCase() : token.text;\n V value = valueMap.get(t);\n if (value == null) {\n throw new CommandSyntaxException(\"not an acceptable <\" + argumentKind() + \">\");\n } else {\n return value;\n }\n }",
"pb4server.CheckAllianceCompetitionAskReq getCheckAllianceCompetitionAskReq();",
"public ProtocolResult getAnswer(){\n\t\t\n\t\tif( hasReachedTimeout() ){\n\t\t\taddError(Locale.getString(\"FipaRequestProtocol.9\")); //$NON-NLS-1$\n\t\t}\n\t\telse{\n\t\t\tif (isInitiator() && (getState() == RequestProtocolState.WAITING_ANSWER)) {\n\t\t\t\t\n\t\t\t\tProtocolResult result = null;\n\t\t\t\tACLMessage aMsg = getRefAclAgent().getACLMessageForConversationId( getConversationId() );\n\t\t\t\t\n\t\t\t\tif( aMsg != null )\n\t\t\t\t{\n\t\t\t\t\tresult = new ProtocolResult();\n\t\t\t\t\tresult.setPerformative( aMsg.getPerformative() );\n\t\t\t\t\tresult.setContent( aMsg.getContent().getContent() );\n\t\t\t\t\t\n\t\t\t\t\tif( result.getPerformative().compareTo(Performative.NOT_UNDERSTOOD) == 0 )\n\t\t\t\t\t\tsetFinalStep();\n\t\t\t\t\telse if( result.getPerformative().compareTo(Performative.REFUSE) == 0 )\n\t\t\t\t\t\tsetFinalStep();\n\t\t\t\t\telse if( result.getPerformative().compareTo(Performative.AGREE) == 0 )\n\t\t\t\t\t\tsetState(RequestProtocolState.WAITING_RESULT);\n\t\t\t\t\t\n\t\t\t\t\tresetStartedTime();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\telse if( isParticipant() ){\n\t\t\t\taddError(Locale.getString(\"FipaRequestProtocol.10\")); //$NON-NLS-1$\n\t\t\t}\n\t\t\telse{\n\t\t\t\taddError(Locale.getString(\"FipaRequestProtocol.11\")); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private void checkSelectedValue(Value value) {\n\t\tconflictingAssignmentId = -1;\r\n\t\tconflictingValue = null;\r\n\t\tDimension rootDimension = value.getRootDimension();\r\n\t\tfor (int i = 0; i < query.getAssignments().size(); i++) {\r\n\t\t\tAssignmentProxy assignment = query.getAssignments().get(i);\r\n\t\t\tValue assignmentValue = ContextProxyManager.getInstance()\r\n\t\t\t\t\t.getProxy().findValue(assignment.getValueURI());\r\n\t\t\tif (assignmentValue.getRootDimension().equals(rootDimension)) {\r\n\t\t\t\tconflictingAssignmentId = i;\r\n\t\t\t\tconflictingValue = assignmentValue;\r\n\t\t\t\tpendingValue = value;\r\n\t\t\t\tconflictingRootDimension = rootDimension;\r\n\t\t\t\tshowDialog(DIALOG_REPLACE_ASSIGNMENT);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAssignmentProxy assignment = new AssignmentProxy(value.getURI());\r\n\t\tassignmentAdded(assignment);\r\n\t}",
"@Override\n public void onRequestNoAsk(String permissionName) {\n }",
"String getPermission();",
"@Override\n\t\t\tpublic Optional<IAMQPQueue> replyTo() {\n\t\t\t\treturn null;\n\t\t\t}",
"@Override\n\t\t\tpublic Optional<IAMQPQueue> replyTo() {\n\t\t\t\treturn null;\n\t\t\t}",
"@TargetApi(23)\r\n public void requestPermission() {\r\n ArrayList<String> arrayList;\r\n String[] strArr = this.mPermissions;\r\n for (String str : strArr) {\r\n if (this.mActivity.checkCallingOrSelfPermission(str) != 0) {\r\n if (shouldShowRequestPermissionRationale(str) || !PermissionUtils.isNeverShowEnabled(PermissionUtils.getRequestCode(str))) {\r\n if (this.normalPermissions == null) {\r\n this.normalPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.normalPermissions;\r\n } else {\r\n if (this.settingsPermissions == null) {\r\n this.settingsPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.settingsPermissions;\r\n }\r\n arrayList.add(str);\r\n }\r\n }\r\n Log.d(TAG, \"requestPermission() settingsPermissions:\" + this.settingsPermissions);\r\n Log.d(TAG, \"requestPermission() normalPermissions:\" + this.normalPermissions);\r\n ArrayList<String> arrayList2 = this.normalPermissions;\r\n if (arrayList2 == null || arrayList2.size() <= 0) {\r\n ArrayList<String> arrayList3 = this.settingsPermissions;\r\n if (arrayList3 == null || arrayList3.size() <= 0) {\r\n IGrantedTask iGrantedTask = this.mTask;\r\n if (iGrantedTask != null) {\r\n iGrantedTask.doTask();\r\n }\r\n } else {\r\n Activity activity = this.mActivity;\r\n PermissionUtils.showPermissionSettingsDialog(activity, activity.getResources().getString(R.string.app_name), this.settingsPermissions, true);\r\n this.settingsPermissions = null;\r\n }\r\n finishFragment();\r\n return;\r\n }\r\n requestPermissions((String[]) this.normalPermissions.toArray(new String[this.normalPermissions.size()]), 5003);\r\n this.normalPermissions = null;\r\n }",
"Object getPreference(String prefKey, Object defaultValue);",
"public String getValue(String name){\n if(!kchain.containsKey(name))return akargs.get(name);\n else return kchain.get(name).toString();\n }",
"public PolicyPermission getPolicyPermission()\n {\n return this.perm;\n }",
"public String getPermission()\r\n {\r\n return permission;\r\n }",
"public void setSuggestedPrincipalPointValue(\n InhomogeneousPoint2D suggestedPrincipalPointValue) \n throws LockedException {\n if (isLocked()) {\n throw new LockedException();\n }\n mSuggestedPrincipalPointValue = suggestedPrincipalPointValue;\n }",
"public abstract Object getDecisionValue();",
"private static int getUserChoice() {\n System.out.println(\"Please choose your operation: \");\n return intScanner.nextInt();\n }",
"public void setRequester(User requester) {\n this.requester = requester;\n }",
"java.lang.String getBrokerCommission();",
"public String choosenMenu() {\n String value = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"menu_id\");\n menu_id = Integer.parseInt(value);\n String user = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();\n if (user == null) {\n return \"choosenMenu\";\n } else {\n return \"chooseMenuUser\";\n }\n }",
"@Override\n public void onRequestRefuse(String permissionName) {\n }",
"public static TypeDictionaryDicoActionQualificatifActivite get(int value) {\n\t\tswitch (value) {\n\t\t\tcase UNIQUE_VALUE: return UNIQUE;\n\t\t\tcase MINIMAL_VALUE: return MINIMAL;\n\t\t\tcase MAXIMAL_VALUE: return MAXIMAL;\n\t\t\tcase POSSIBLE_VALUE: return POSSIBLE;\n\t\t}\n\t\treturn null;\n\t}",
"pb4server.EatPoisonNumAskReq getEatPoisonNumAskReq();",
"public String getProposedTransactionValue() {\n return proposedTransactionValue;\n }",
"com.google.protobuf.Value getDefaultValue();",
"@Test\n public void createRequested() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n\n /*\n * When\n */\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n /*\n * Then\n */\n assertThat(grant.getRequestResponse())\n .as(\"There shouldn't be a response for the grant.\")\n .isNotPresent();\n\n assertThat(grant.getRequest())\n .as(\"The request should be available in the grant.\")\n .isPresent()\n .satisfies(ro -> ro.ifPresent(r -> {\n assertThat(r).isEqualTo(request);\n }));\n\n assertThat(grant)\n .as(\"Since the request is not approved, the grant is not active\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isTrue();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isFalse();\n });\n }",
"Policy _get_policy(int policy_type);",
"public String get(Object requestor, String field, String defaultString);",
"public interface RuntimePermissionRequester {\n /**\n * Asks user for specific permissions needed to proceed\n *\n * @param requestCode Request permission using this code, allowing for\n * callback distinguishing\n */\n void requestNeededPermissions(int requestCode);\n}",
"public void testTemporaryQueueFirstConsume()\n {\n ObjectProperties temporary = new ObjectProperties(_queueName);\n temporary.put(ObjectProperties.Property.AUTO_DELETE, Boolean.TRUE);\n \n ObjectProperties normal = new ObjectProperties(_queueName);\n normal.put(ObjectProperties.Property.AUTO_DELETE, Boolean.FALSE);\n \n assertEquals(Result.DENIED, _ruleSet.check(_testSubject, Operation.CONSUME, ObjectType.QUEUE, temporary));\n\n // should not matter if the temporary permission is processed first or last\n _ruleSet.grant(1, TEST_USER, Permission.ALLOW, Operation.CONSUME, ObjectType.QUEUE, normal);\n _ruleSet.grant(2, TEST_USER, Permission.ALLOW, Operation.CONSUME, ObjectType.QUEUE, temporary);\n assertEquals(2, _ruleSet.getRuleCount());\n \n assertEquals(Result.ALLOWED, _ruleSet.check(_testSubject, Operation.CONSUME, ObjectType.QUEUE, normal));\n assertEquals(Result.ALLOWED, _ruleSet.check(_testSubject, Operation.CONSUME, ObjectType.QUEUE, temporary));\n }",
"public void setRequestedBy(String requestedBy) {\n this.requestedBy = requestedBy;\n }",
"@Override\n\tpublic ResponseEntity<?> update(Permission e) {\n\t\treturn null;\n\t}",
"default <K,V> Optional<Adapter<V>> enqueue(K key,V value){\n\t\tOptional<Adapter<V>> queue = Pipes.get(key);\n\t\tqueue.map(adapter -> adapter.offer(value));\n\t\n\t\treturn queue;\n\t\t\n\t\t\n\t}",
"default String replyQueue() {\n return (String) metadata().get(\"x-reply-queue\");\n }",
"public void setRequestedUid(final String val) {\n requestedUid = val;\n }",
"@Override\n public CardAccessNumber call() throws Exception {\n return queue.take();\n }",
"public String get(Object requestor, String field, int type,\n String defaultString);",
"@Override\n T getCandidate();",
"public Object dequeue(String pref) {\r\n if (pref.equals(\"cat\")) {\r\n return cat.dequeue();\r\n } else if (pref.equals(\"dog\")) {\r\n return dog.dequeue();\r\n }\r\n return null;\r\n }"
] | [
"0.56970423",
"0.53418624",
"0.50779843",
"0.50253916",
"0.49912038",
"0.49787107",
"0.49313343",
"0.48411548",
"0.4839746",
"0.48275912",
"0.47947693",
"0.47907242",
"0.47860882",
"0.4773844",
"0.47708374",
"0.47171882",
"0.4713527",
"0.46770442",
"0.466969",
"0.46469283",
"0.4634408",
"0.4629922",
"0.46191242",
"0.4617867",
"0.4617867",
"0.45902395",
"0.45788112",
"0.4549971",
"0.4541944",
"0.4534038",
"0.4520523",
"0.4498577",
"0.44951248",
"0.44884515",
"0.4485628",
"0.4485628",
"0.4484998",
"0.44810405",
"0.44725326",
"0.44651046",
"0.44651046",
"0.44648734",
"0.44613078",
"0.4459384",
"0.44541958",
"0.4444326",
"0.44437546",
"0.4443367",
"0.44152984",
"0.4395904",
"0.4395571",
"0.43925318",
"0.43849313",
"0.4384874",
"0.43847096",
"0.43781808",
"0.4375751",
"0.43741065",
"0.43736807",
"0.43735442",
"0.4373139",
"0.43726832",
"0.4362203",
"0.436073",
"0.43581045",
"0.4355831",
"0.434447",
"0.4339929",
"0.43284446",
"0.43284446",
"0.43269774",
"0.43234172",
"0.43220115",
"0.43194428",
"0.43169183",
"0.43154025",
"0.43043575",
"0.4304328",
"0.4297431",
"0.42967585",
"0.42964405",
"0.4295219",
"0.42944017",
"0.42921683",
"0.4288451",
"0.42881757",
"0.42833874",
"0.4281286",
"0.4280752",
"0.4279152",
"0.42769587",
"0.4274216",
"0.4273009",
"0.42684415",
"0.4268414",
"0.42653266",
"0.4263692",
"0.42633387",
"0.42556718",
"0.42533258"
] | 0.6446975 | 0 |
SETTER Set ID Function this function Just Set or update the value of the ID | public void set_id(int ID)
{
id =ID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"public void setId(int value) {\r\n this.id = value;\r\n }",
"public void setID(int value) {\n this.id = value;\n }",
"public void setID(long id);",
"void setId(int val);",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setId(int value) {\n this.id = value;\n }",
"public void setID(int id);",
"public void setID(java.lang.Integer value);",
"public void setID(int id){\n this.id=id;\n }",
"public void setId(ID id){\r\n\t\tthis.id = id;\r\n\t}",
"public void setId(long value) {\r\n this.id = value;\r\n }",
"public void setId(long value) {\r\n this.id = value;\r\n }",
"public void setID(String newID)\r\n {\r\n id=newID;\r\n }",
"void setID(int val)\n throws RemoteException;",
"public void setID(int id){\n this.ID = id;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setId(long value) {\n this.id = value;\n }",
"public void setID(int value) {\r\n\t\tid = value;\r\n\t}",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(int id){\r\n this.id = id;\r\n }",
"public void setID(String value) {\r\n \t\t_id = value;\r\n \r\n \t}",
"public void setId (long id)\r\n {\r\n _id = id;\r\n }",
"public void setId(Integer value) {\n this.id = value;\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"public void setId(ID id)\n {\n this.id = id;\n }",
"public void setId(Object id) {\n this.id = id;\n }",
"public void setId(Object id) {\n this.id = id;\n }",
"public void setId(Integer value) {\n this.id = value;\n }",
"public void setId(Integer value) {\n this.id = value;\n }",
"public void setId(String value) {\n \tif (value==null)\n \t\tthis.id = \"\";\n \telse\n \t\tthis.id = value;\n }",
"public void setId (int id) {\r\n\t\tthis.id=id;\r\n\t}",
"public void setId(long id){\n\t\tthis.id = id;\n\t}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setID(int id)\r\n {\r\n\tthis.id = id;\r\n }",
"public void setId(long id) {\r\n this.id = id;\r\n }",
"public void setId(Long value) {\r\n this.id = value;\r\n }",
"public void setId(String id)\n\t{\n\t\tm_sID=id;\t\n\t}",
"public void setId(int id){\n\t\tthis.id = id;\n\t}",
"public void setID(long value) {\n this.id = value;\n }",
"public void setId(long id) {\n id_ = id;\n }",
"public void setId(java.lang.String value) {\n this.id = value;\n }",
"public void setId(java.lang.String value) {\n this.id = value;\n }",
"public void setId(java.lang.String value) {\n this.id = value;\n }",
"public void setId(int id)\n {\n this.id=id;\n }",
"private void setId(Integer id) { this.id = id; }",
"public void setId(long id);",
"public void setId(long id);",
"public void setId(long id);",
"public void setId(long id);",
"public void setId(int id) {\r\n\t\tthis.id = id;\r\n\t}",
"@Override\n\tpublic void setId(int id) {\n\t\tthis.ID = id;\n\t}",
"public void setId(long id) { this.id = id; }",
"public void setId(long id) { this.id = id; }",
"public void setId(long id) {\n this.id = id;\n }",
"public void setId(long id) {\n this.id = id;\n }",
"void setId(ID id);",
"public void setId(long id) {\n\tthis.id = id;\n }",
"public void setId(int id) {\r\n this.id = id;\r\n }",
"public void setId(int id) {\r\n this.id = id;\r\n }",
"public void setId(int id) {\r\n this.id = id;\r\n }",
"public void setId(int id) {\r\n this.id = id;\r\n }",
"public void setId(Long id) {\n\t\t\n\t}",
"public void setId(int id) {\n \t\tthis.id = id;\n \t}",
"public void setId(Long value) {\n this.id = value;\n }",
"public void setId(int id)\n {\n\tthis.id = id;\n }",
"public void setId(int id_)\n\t{\n\t\tthis.id=id_;\n\t}",
"public void setId(int id){ this.id = id; }",
"public void setId(int id) {\n this.id = id;\n\t}",
"public void setId(int id)\n {\n this.id = id;\n }",
"public void setId(int id)\n {\n this.id = id;\n }",
"public void setId(Integer id){\n\t\tthis.id = id;\n\t}",
"public void setId(long id) {\n this.id = id;\n }",
"public void setId(long id) {\n this.id = id;\n }",
"public void setId(long id) {\n this.id = id;\n }",
"public void setId(long id) {\n this.id = id;\n }"
] | [
"0.8271907",
"0.818239",
"0.79992795",
"0.79992795",
"0.79992795",
"0.79992795",
"0.79992795",
"0.79992795",
"0.79992795",
"0.7953939",
"0.79526556",
"0.7929988",
"0.7888199",
"0.78847045",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7864962",
"0.7857432",
"0.7838643",
"0.7793279",
"0.7789902",
"0.77844363",
"0.77844363",
"0.77644587",
"0.772158",
"0.7716358",
"0.77124757",
"0.77124757",
"0.77124757",
"0.77124757",
"0.77124757",
"0.77124757",
"0.77124757",
"0.7704017",
"0.76768625",
"0.76768625",
"0.76755464",
"0.7669643",
"0.76542115",
"0.76535064",
"0.76474166",
"0.76474166",
"0.76474166",
"0.76382893",
"0.76302046",
"0.76302046",
"0.76068395",
"0.76068395",
"0.7600882",
"0.7599347",
"0.75992763",
"0.75885195",
"0.7582895",
"0.75629896",
"0.75604963",
"0.7559304",
"0.75564086",
"0.75472134",
"0.75434893",
"0.7543047",
"0.7543047",
"0.7543047",
"0.7533307",
"0.753254",
"0.75305325",
"0.75305325",
"0.75305325",
"0.75305325",
"0.75301284",
"0.75143003",
"0.751306",
"0.751306",
"0.75122327",
"0.75122327",
"0.7501239",
"0.74941653",
"0.7493342",
"0.7493342",
"0.7493342",
"0.7493342",
"0.7487278",
"0.7484875",
"0.74844617",
"0.74719554",
"0.7470723",
"0.74678504",
"0.74579394",
"0.7457242",
"0.7457242",
"0.74563426",
"0.74527323",
"0.74527323",
"0.74527323",
"0.74527323"
] | 0.7692528 | 40 |
Set_Name Function this function Just Set or update the value of the Name | public void set_name(String Name)
{
name =Name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setName(String Name){\r\n name = Name;\r\n }",
"public void setName(String Name) {\r\n\t\t\tthis.Name=Name;\r\n\t\t}",
"public void setName( String pName )\n {\n name = pName;\n }",
"public void setName(String Name) {\n this.Name = Name;\n }",
"public void setName(String Name) {\n this.Name = Name;\n }",
"public void setName(String inName)\n {\n\tname = inName;\n }",
"public void setName(String name) {\n fName= name;\n }",
"public void setName(String inName)\n {\n name = inName;\n }",
"void setName(String name_);",
"public void setName(String theName)\n\t{\n\t\tthis.theName=theName;\n\t\tif(theName.length()==0)\n\t\t{\n\t\t\tthis.theName=\"**No Name**\";\n\t\t}\n\t}",
"public void setName(String new_name){\n this.name=new_name;\n }",
"public void setName(String aName) {\n name = aName;\n }",
"public void setName (String Name);",
"public void setName (String Name);",
"public void setName (String Name);",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public void setName(String newname){\n name = newname; \n }",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public void setName(final String nameValue) {\n this.name = nameValue;\n }",
"public static void setName(String n){\n\t\tname = n;\n\t}",
"public void setName (String n){\n\t\tname = n;\n\t}",
"public void setName(String name) {\n\t\tName = name;\n\t}",
"public void setName(String newname)\n {\n name = newname;\n \n }",
"public void setName(String value) {\n this.name = value;\n }",
"public void setName(String name) {\n m_Name = name;\n }",
"private void setName(java.lang.String name) {\n System.out.println(\"setting name \"+name);\n this.name = name;\n }",
"public void setName(String name){\n \t\tthis.name = name;\n \t}",
"public void setName(String name)\n {\n fName = name;\n }",
"public void setName(String n) {\r\n name = n;\r\n }",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public final void setName(final String inName) {\n mName = inName;\n }",
"public void setName(final String aName)\n\t{\n\n\t\tthis.name = aName;\n\t}",
"protected void setName(final String theName)\r\n {\r\n _theName = theName;\r\n }",
"public final void setName(String name) {_name = name;}",
"protected void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String nameIn) {\n name = nameIn;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\r\n this.name = name;\r\n }",
"public void setName(String name){\r\n this.name = name;\r\n }",
"public void setName(String name){\r\n this.name = name;\r\n }",
"public void setName (String n) {\n name = n;\n }",
"void setName(String strName);",
"public void setName(String name) {\t\t\r\n\t\tthis.name = name;\t\t\r\n\t}",
"public void setName(String name)\r\n\t{\t\t\r\n\t\tthis.name = name;\r\n\t}",
"void setName(java.lang.String name);",
"void setName(java.lang.String name);",
"void setName(java.lang.String name);",
"public void setName(String name) \n {\n this.name = name;\n }",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(final String name);",
"public void setName(String name) {\n \tthis.name = name;\n }",
"public void setName(String name) {\n \tthis.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name)\n \t{\n \t\tthis.name = name;\n \t}",
"public void setName(String name) {\r\n \t\tthis.name = name;\r\n \t}",
"public void setName(String name)\r\n {\r\n\tthis.name = name;\r\n }",
"public void setName(String newName){\n\n //assigns the value newName to the name field\n this.name = newName;\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n\t\tthis.name=name;\r\n\t}",
"void setName(String name);",
"void setName(String name);",
"void setName(String name);",
"void setName(String name);",
"void setName(String name);",
"void setName(String name);",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName(String n) {\n this.name = n;\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\n\t this.name = name;\n\t }",
"public void setName(String n){ name=n; }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName(String name){\n this.name = name;\n }",
"public void setName( final String name )\r\n {\r\n this.name = name;\r\n }",
"public void setName(String s) {\n this.name = s;\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }"
] | [
"0.8692135",
"0.8511409",
"0.84405106",
"0.8425363",
"0.8425363",
"0.84220827",
"0.8380995",
"0.83543664",
"0.8329459",
"0.8290774",
"0.8283187",
"0.8281357",
"0.8273631",
"0.8273631",
"0.8273631",
"0.8258878",
"0.8258878",
"0.8258878",
"0.8229481",
"0.82204556",
"0.82204556",
"0.82204556",
"0.82197326",
"0.82109016",
"0.81992054",
"0.81953466",
"0.81886387",
"0.81834215",
"0.8174378",
"0.8168567",
"0.81619614",
"0.81585735",
"0.81564635",
"0.81564635",
"0.81564635",
"0.81506974",
"0.81389356",
"0.81360066",
"0.8132665",
"0.8129325",
"0.812178",
"0.8119578",
"0.8118397",
"0.8118397",
"0.8118397",
"0.81130344",
"0.81114155",
"0.81089",
"0.8100841",
"0.80957866",
"0.80957866",
"0.80957866",
"0.80916333",
"0.80862486",
"0.80862486",
"0.80862486",
"0.80857575",
"0.80851406",
"0.80851406",
"0.80731696",
"0.8071882",
"0.8067601",
"0.80656576",
"0.8064067",
"0.8058035",
"0.8053957",
"0.80504394",
"0.80504394",
"0.80504394",
"0.80504394",
"0.80504394",
"0.80504394",
"0.8049437",
"0.8049437",
"0.8049437",
"0.8048841",
"0.80469155",
"0.80469155",
"0.80469155",
"0.80412906",
"0.80402076",
"0.803922",
"0.803922",
"0.803922",
"0.803922",
"0.803922",
"0.803922",
"0.803922",
"0.8036238",
"0.8034676",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876",
"0.80315876"
] | 0.8039432 | 81 |
Set_Password Function this function Just Set or update the value of the password | public void set_pass(String password)
{
pass=password;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPassword(java.lang.String newPassword);",
"void setPassword(String password);",
"void setPassword(String password);",
"void setPassword(String password);",
"public void setPassword(String pass);",
"public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }",
"public void setPassword(String strPassword){\n \t \n \tdriver.findElement(By.cssSelector(inputPassword)).sendKeys(strPassword);\n \n \n }",
"public void setPassword(String strPassword){\n\t\t driver.findElement(password99Guru).sendKeys(strPassword);\n\t}",
"void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;",
"public void setPassword(String strPassword){\n\t\tdriver.findElement(password99Guru).sendKeys(strPassword);\n\t}",
"@Override\n\tpublic boolean setNewPassword(BigInteger tUserFId,String password) {\n\t\tint res = accountManageDao.updateApplyPwdWithMainUser(tUserFId,password);\n\t\treturn res>0?true:false;\n\t}",
"private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }",
"private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }",
"void setErrorPassword();",
"private void setNewPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n newPassword_ = value;\n }",
"public void setPassword(String password)\n {\n _password = password;\n }",
"public void setSpPassword(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localSpPasswordTracker = true;\r\n } else {\r\n localSpPasswordTracker = false;\r\n \r\n }\r\n \r\n this.localSpPassword=param;\r\n \r\n\r\n }",
"void setPassword(String ps) {\n this.password = ps;\n }",
"public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }",
"public void setPassword(String text) {\n txtPassword().setText(text);\n }",
"public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}",
"public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }",
"public void setPassword(String strPassword) {\r\n\t\t//driver.findElement(passWord).sendKeys(strPassword);\r\n\t\tdriver.findElement(passWord).sendKeys(strPassword);\r\n\t\t//return new LoginPage();\r\n\t}",
"public void setPasswordValue(String value) {\r\n\t\ttxtPassword.setValue(value);\r\n\t}",
"public void setPassword(java.lang.String param) {\r\n localPasswordTracker = param != null;\r\n\r\n this.localPassword = param;\r\n }",
"public void setPassword(String pw)\n {\n this.password = pw;\n }",
"public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }",
"public void setPassword2(String password2);",
"@Override\n\tpublic void setPassword(String password) {\n\n\t}",
"public void setPassword(final String password){\n mPassword = password;\n }",
"public void setPassword(String p) {\n\t\tpassword = p;\n\t}",
"public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }",
"public void updatePassword(String account, String password);",
"public void setPassword(String password)\n {\n _password = password;\n }",
"@Test\r\n public void testSetPassword() {\r\n\r\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }",
"public void setPassword(String password){\r\n this.password = password;\r\n }",
"public void setPasswordField(final JPasswordField pwPasswordParam) {\n this.pwPassword = pwPasswordParam;\n }",
"public void setPassword(String password)\n {\n String passwordRegex = \"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$\";\n Pattern passwordPattern = Pattern.compile(passwordRegex);\n Matcher passwordMatcher = passwordPattern.matcher(password);\n if(passwordMatcher.matches())\n {\n this.password=password;\n }\n else\n {\n this.password=\"\";\n }\n }",
"public void setPassword(String password) {\n String oPassword = getPassword();\n this.password = password;\n\n \n try {\n MessageDigest md = MessageDigest.getInstance( \"MD5\" );\n md.update(this.password.getBytes());\n \n BigInteger hash = new BigInteger( 1, md.digest() );\n this.hashPassword = hash.toString(16);\n } catch (NoSuchAlgorithmException ns) {\n ns.printStackTrace();\n }\n\n firePropertyChange(PROPNAME_PASSWORD, oPassword, this.password);\n }",
"public void changePassword(String passwordChange){\n\t this.password = passwordChange;\n\t}",
"@Test\n public void testSetPassword() {\n System.out.println(\"setPassword\");\n user.setPassword(\"123m\");\n assertEquals(\"123m\", user.getPassword());\n }",
"public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }",
"public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }",
"public void setPw(char[] password) {\n\t\t\r\n\t}",
"public void setPassword(String password)\n \t{\n \t\tthis.password = password;\n \t}",
"public void setPassword(int password) {\n this.password = password;\n }",
"@Override\r\n\tpublic void updatePassword(Integer id, String password) {\n\t\t\r\n\t}",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }",
"public void setPassword(String password) {\n this.password = password;\n saveProperties();\n }",
"public void setPassword(String password) throws Exception {\n DriverUtils.waitUntilLocatorAppears(getDriver(), By.id(PASSWORD_ID));\n DriverUtils.waitUntilElementClickable(getDriver(), emailField);\n passwordField.clear();\n passwordField.sendKeys(password);\n }",
"public void setPassword( String password )\r\n {\r\n this.password = password;\r\n }",
"public void setDevicePassword(String argPassword) {\n\tdevicePassword = argPassword;\n }",
"public void setPassWord(String password) {\n\t\tsharedPreferences = context.getSharedPreferences(\"Login\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\tSharedPreferences.Editor editor = sharedPreferences.edit();\n\t\teditor.putString(\"PASSWORD\", password);\n\t\teditor.commit();\n\t}",
"void setUserPasswordHash(String passwordHash);",
"public void setPassword(String password) {\n this.password = password;\r\n }",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"@Test\n\tpublic void testSetPassword() {\n\t\tUser user = new User();\n\t\tuser.setPassword(\"TuEsOuPassword\");\n\t\tassertEquals(\"TuEsOuPassword\", user.getPassword());\n\t}",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setInputPasswordValue(String value){\n WebElement passwordField = driver.findElement(inputPasswordLocator); \n // setValue(passwordField, value);\n // System.out.println(\"Value after set: \" + passwordField.getAttribute(\"value\"));\n passwordField.sendKeys(value);\n //shift + tab\n // actions.sendKeys(Keys.TAB).perform();\n WebElement deptidField = driver.findElement(inputTextDeptidLocator);\n actions.click(deptidField).perform();\n }",
"public void setRegistrationPassword(String password){\r\n\t\tString Password = getValue(password);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- check out registration password should be entered\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"txtRegistrationPassword\"));\r\n\t\t\tsendKeys(locator_split(\"txtRegistrationPassword\"), Password); \r\n\t\t\tSystem.out.println(\"Check out registration password is entered\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- check out registration password is entered\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- check out registration password is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRegistrationPassword\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t\tReporter.log(\"Entered Confirm Password in Registration Confirm Password field\");\r\n\t}",
"public void settxtPassword(String pwd) {\n\t\tWebDriverWait wait = new WebDriverWait(ldriver, 25);\n\t\twait.until(ExpectedConditions.visibilityOf(txtPassword));\n\t\ttxtPassword.sendKeys(pwd);\n\t}",
"@Override\r\n\tpublic void modifyPassword(String username, String password, String confirmPassword, String oldPassword) {\n\t}",
"public void setPassword(String password) throws SQLException\r\n\t{\r\n\t\tif (password == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString SQL_USER = \"UPDATE user SET password =? WHERE id=?;\";\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Prepare the statement\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\r\n\t\t\t//Bind the variables\r\n\t\t\tstatement.setString(1, password);\r\n\t\t\tstatement.setInt(2, userId);\r\n\r\n\t\t\t//Execute the update\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in SQL: Student->setPassword(String \"+ password+ \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\r\n\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}",
"public void setPassword(String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n this.password = password;\r\n// this.password = hashPassword(password);\r\n// System.out.println(\"haslo po hash w account: \" + this.password);\r\n }",
"public void setPassword(String password) {\n setObject(\"password\", (password != null) ? password : \"\");\n }",
"void updateUserPassword(User user);",
"void onChangePasswordSuccess(ConformationRes data);",
"public void setPassword(String password) {\n this.password.set(password);\n }",
"public void set_password(String password)\r\n\t{\r\n\t\tthis.password = password;\r\n\t}",
"public void setPassword(String password) {\n \n// if(password.length() >= MINIMUM_PASSWORD_LENGTH && password.length() <= \n// MAXIMUM_PASSWORD_LENGTH) {\n this.password = password;\n// } else {\n// throw new InvalidPasswordException(\"Password must be between \" + \n// MINIMUM_PASSWORD_LENGTH + \" and \" + \n// MAXIMUM_PASSWORD_LENGTH);\n// }\n \n }",
"public void setPassword(String password) {\n\tthis.password = password;\n}",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String password) {\r\n this.password = password;\r\n }",
"private void setPasswordBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n password_ = value.toStringUtf8();\n }",
"private void setPasswordBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n password_ = value.toStringUtf8();\n }",
"public boolean changePassword(HttpServletRequest request, HttpServletResponse response);",
"@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}",
"@Test\n public void testSetPassword() {\n System.out.println(\"setPassword Test (Passing value)\");\n String password = \"$2a$10$EblZqNptyYvcLm/VwDCVAuBjzZOI7khzdyGPBr08PpIi0na624b8.\";\n user.setPassword(password);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertTrue(violations.isEmpty());\n }",
"public void setPassword(String password) {\n this.password = password;\n }",
"public void setPassword(String password) {\n this.password = password;\n }",
"public void setpassword(String passswordExcel) throws InterruptedException {\n actions.moveToElement(password);\n actions.click();\n actions.sendKeys(passswordExcel);\n pwdMatch=passswordExcel;\n actions.build().perform();\n\n // password.sendKeys(passswordExcel);\n\n Thread.sleep(1000);\n }",
"public void setPassword(String new_password) throws DataFault {\n\t\t\t\t setPassword(Hash.getDefault(getContext()), new_password);\n\t\t\t }",
"private void setNewPasswordBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n newPassword_ = value.toStringUtf8();\n }",
"public void setPassword(java.lang.String password) {\r\n this.password = password;\r\n }",
"public void setPassword(java.lang.String password) {\r\n this.password = password;\r\n }",
"public void setPassword(String newPassword) {\n this.password = newPassword;\n \n //make the changes in the database\n db.updateUserProperty(username, Property.PASSWORD, newPassword);\n }",
"@Test\n public void testSetPassword() {\n System.out.println(\"setPassword\");\n String password = \"\";\n Funcionario instance = new Funcionario();\n instance.setPassword(password);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }"
] | [
"0.8351652",
"0.8310205",
"0.8310205",
"0.8310205",
"0.81040776",
"0.8088561",
"0.7968014",
"0.7933388",
"0.7907534",
"0.78721803",
"0.78415924",
"0.782929",
"0.782929",
"0.7802228",
"0.7756703",
"0.7728834",
"0.77191496",
"0.7688812",
"0.76802635",
"0.76309985",
"0.7613398",
"0.7596926",
"0.75722706",
"0.757155",
"0.75633824",
"0.7552581",
"0.7508932",
"0.7492811",
"0.74796015",
"0.74548936",
"0.7452471",
"0.7437537",
"0.74207705",
"0.739288",
"0.73888314",
"0.7384615",
"0.7384615",
"0.73481315",
"0.73481315",
"0.73481315",
"0.7314087",
"0.7301768",
"0.729988",
"0.72899204",
"0.7247342",
"0.72349024",
"0.72348326",
"0.7222616",
"0.7222616",
"0.7214191",
"0.7196753",
"0.7195145",
"0.7177532",
"0.7164061",
"0.7157174",
"0.71569145",
"0.7156132",
"0.71368355",
"0.71281916",
"0.7081615",
"0.708036",
"0.70767516",
"0.7075513",
"0.70708966",
"0.70708966",
"0.70654744",
"0.70654744",
"0.7064029",
"0.70571643",
"0.7050466",
"0.70457906",
"0.7038409",
"0.70319736",
"0.702374",
"0.70177865",
"0.7016645",
"0.7015826",
"0.70157564",
"0.7010358",
"0.700603",
"0.69983864",
"0.69983864",
"0.69983864",
"0.69983864",
"0.69983864",
"0.69983864",
"0.6992502",
"0.6992502",
"0.69872797",
"0.6984159",
"0.6983145",
"0.6975815",
"0.6975815",
"0.6971889",
"0.6953733",
"0.69500136",
"0.6937327",
"0.6937327",
"0.69311625",
"0.6929804"
] | 0.76558906 | 19 |
Set_Email function this function Just Set or update the value of the Email | public void set_email(String Email)
{
email =Email;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEmail(String email)\r\n/* 36: */ {\r\n/* 37:50 */ this.email = email;\r\n/* 38: */ }",
"void setEmail(String email);",
"void setEmail(String email);",
"@Override\n public void setEmail(String email) {\n\n }",
"public void setEmail(final String value)\n\t{\n\t\tsetEmail( getSession().getSessionContext(), value );\n\t}",
"public void setEmail(final String value)\n\t{\n\t\tsetEmail( getSession().getSessionContext(), value );\n\t}",
"public void setEmail(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(EMAIL_PROP.get(), value);\n }",
"public void setEmail(String aEmail) {\n email = aEmail;\n }",
"public void setEmail(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(EMAIL_PROP.get(), value);\n }",
"public void setEmail(final String e)\n {\n this.email = e;\n }",
"public final void setEmail(final String emailNew) {\n this.email = emailNew;\n }",
"public void setEmail(String email);",
"public void setEmail(Email email) { this.email = email; }",
"public void setEmail(java.lang.String value) {\n\t\tsetValue(org.jooq.example.jaxrs.db.routines.GenerateKey.EMAIL, value);\n\t}",
"public void setEmail(String email)\n {\n String regex = \"^[\\\\w!#$%&'*+/=?`{|}~^-]+(?:\\\\.[\\\\w!#$%&'*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\\\.)+[a-zA-Z]{2,6}$\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(email);\n if(matcher.matches())\n {\n this.email=email;\n }\n else \n {\n this.email=\"\";\n }\n }",
"public void setEmail_address(String email_address);",
"private void setEmail(String email) {\n this.email = StringExtension.nullFilter(email);\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n email_ = value;\n onChanged();\n return this;\n }",
"public boolean setEmail(String email) {\n email = email.trim().replaceAll(\"\\\"\", \"\");\n\n if(EmailValidator.getInstance().isValid(email)) {\n if(this.email != null && this.email.equalsIgnoreCase(email)){\n return false;\n }\n this.email = email;\n return true;\n } else if (this.email == null) {\n this.email = \"INVALID\";\n } else {\n System.out.println(\"Person \" + name + \"'s email address will not be modified as the given email is invalid\");\n }\n return false;\n }",
"public void setEmailAddress(java.lang.String newEmailAddress);",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n email_ = value;\n onChanged();\n return this;\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n email_ = value;\n onChanged();\n return this;\n }",
"public void updateEmail(String newEmailAddress)\r\n {\r\n emailAddress = newEmailAddress;\r\n }",
"public void setEmail(final SessionContext ctx, final String value)\n\t{\n\t\tsetProperty(ctx, EMAIL,value);\n\t}",
"public void setEmail(final SessionContext ctx, final String value)\n\t{\n\t\tsetProperty(ctx, EMAIL,value);\n\t}",
"public void setEmail(String string) {\n\t\tthis.email = string;\n\t}",
"public void setEmailAddress(String emailAddress);",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n email_ = value;\n onChanged();\n return this;\n }",
"public void setUserEmail(String userEmail) {\r\n this.userEmail = userEmail;\r\n }",
"public void setEmailAddress(String email_address){\n this.email_address = email_address;\n }",
"public void setEmail(String email) {\n mEmailTv.setText(email);\n }",
"public void seteMail(String eMail) {\n this.eMail = eMail;\n }",
"public void setEmail(gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Email email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email)\n\t{\n\t\tthis._email=email;\n\t}",
"public Builder setUserEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n userEmail_ = value;\n onChanged();\n return this;\n }",
"public void setEmail(String email){\r\n this.email = email;\r\n }",
"public void setEmailAddress(EmailType newEmailAddress) {\n _emailAddress = newEmailAddress;\n }",
"public void setEmail( String email )\r\n {\r\n this.email = email;\r\n }",
"@Override\n public void setEmail(java.lang.String email) {\n _entityCustomer.setEmail(email);\n }",
"public Builder setEmail(java.lang.String value) {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t}\n\n\t\t\t\temail_ = value;\n\t\t\t\tonChanged();\n\t\t\t\treturn this;\n\t\t\t}",
"@Override\r\n\tpublic void setEmail(String email) {\n\t\tif (email == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Null argument is not allowed\");\r\n\t\t}\r\n\t\tif (email.equals(\"\")) {\r\n\t\t\tthrow new IllegalArgumentException(\"Empty argument is not allowed\");\r\n\t\t}\r\n\t\tthis.email = email;\r\n\t}",
"public void setEmail(java.lang.String param) {\n localEmailTracker = true;\n\n this.localEmail = param;\n }",
"public void setEmail( final String email )\n\t{\n\t\tthis.email = email;\n\t}",
"@Test\n public void test_setEmail() {\n String value = \"new_value\";\n instance.setEmail(value);\n\n assertEquals(\"'setEmail' should be correct.\",\n value, TestsHelper.getField(instance, \"email\"));\n }",
"public void setEmailCom(String emailCom);",
"public void setEmail(String email) { this.email = email; }",
"public void setEmail(java.lang.String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email)\n {\n this.email = email;\n }",
"public final void setEmail(String email) {\n\t\tthis.email = email;\n\t}",
"public void setEmail(String email) {\n Consistencia.consisteNaoNuloNaoVazio(email, \"email\");\n\n this.email = email;\n }",
"public void setContact(String email){ contact = email; }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setEmail(String email) {\r\n this.email = email;\r\n }",
"public void setUserEmail(java.lang.String userEmail) {\r\n this.userEmail = userEmail;\r\n }",
"@Test\r\n public void testSetEmail() {\r\n\r\n }",
"@Override\n\tpublic void setEmail(String email) {\n\t\tsuper.setEmail(email);\n\t}",
"public void setEmail(String email0){\n\t\temail = email0;\n\t}",
"@Override\r\n\tpublic void updateEmail(Integer id, String email) {\n\t\t\r\n\t}",
"public void setUserEmail(String newEmail) {\n profile.setEmail(currentUser, newEmail);\n }",
"public void setEMail (java.lang.String eMail) {\r\n\t\tthis.eMail = eMail;\r\n\t}",
"public void setEmail(java.lang.String email) {\n this.email = email;\n }",
"public void setEmail(java.lang.String email) {\n this.email = email;\n }",
"public void setEmail(java.lang.String email) {\n this.email = email;\n }",
"public void setEmail(java.lang.String email) {\n this.email = email;\n }",
"public void seteMailString(String eMailString) {\n\t\t\n\t}",
"public void setEmail(String account, String email) throws SQLException, MessagingException {\n\t\tthis.userDao.setEmail(account,email);\r\n\t}",
"public void setEmailAddress(String email) {\n this.email = email;\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n deliveryMethodCase_ = 1;\n deliveryMethod_ = value;\n onChanged();\n return this;\n }",
"public void setEmail (java.lang.String email) {\n\t\tthis.email = email;\n\t}",
"public void setEmail(String email) {\r\n\t\tthis.email = email;\r\n\t}",
"public void setEmail(String email) {\r\n\t\tthis.email = email;\r\n\t}",
"public void setEmailFieldName(final String value) {\n setProperty(EMAIL_FIELD_NAME_KEY, value);\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }",
"public void setEmail(String email) {\n this.email = email;\n }"
] | [
"0.8015325",
"0.8004963",
"0.8004963",
"0.7811964",
"0.7790129",
"0.7790129",
"0.77457255",
"0.77325976",
"0.76951885",
"0.7666721",
"0.7629146",
"0.7605453",
"0.75583136",
"0.7528282",
"0.7522578",
"0.7521455",
"0.7477672",
"0.7464137",
"0.7461079",
"0.742276",
"0.74218494",
"0.74218494",
"0.74164385",
"0.7405891",
"0.7405891",
"0.7404721",
"0.738121",
"0.73811084",
"0.7349239",
"0.73183286",
"0.72900534",
"0.72852373",
"0.7281382",
"0.7280344",
"0.7272144",
"0.72707856",
"0.7263241",
"0.7262027",
"0.72492754",
"0.7233916",
"0.72306836",
"0.7227615",
"0.72239006",
"0.7200469",
"0.71906346",
"0.7137644",
"0.71354926",
"0.71259516",
"0.7124583",
"0.71027285",
"0.71013117",
"0.707707",
"0.707707",
"0.707707",
"0.707707",
"0.707707",
"0.707707",
"0.7067951",
"0.70639",
"0.70614815",
"0.70517737",
"0.70446086",
"0.7025851",
"0.7019057",
"0.7007519",
"0.7007519",
"0.7007519",
"0.7007519",
"0.69732356",
"0.69659686",
"0.6952894",
"0.6939182",
"0.6935631",
"0.69349575",
"0.69349575",
"0.6928674",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107",
"0.69193107"
] | 0.8017153 | 0 |
Set_Phone Function this function Just Set or update the value of the Phone | public void set_phone(String Phone)
{
phone =Phone;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setPhone(int phone);",
"public void setPhone(String phone);",
"public void setPhone(String phone)\r\n/* 46: */ {\r\n/* 47:58 */ this.phone = phone;\r\n/* 48: */ }",
"public abstract void setPhone1(String sValue);",
"public void setPhone(String mPhone) {\n this.mPhone = mPhone;\n }",
"public void setPhone(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(PHONE_PROP.get(), value);\n }",
"public void setPhone(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(PHONE_PROP.get(), value);\n }",
"public void setPhone(String phone) {\n this.mPhone = phone;\n }",
"public abstract void setPhone2(String sValue);",
"void setPhone(String ph){ // SETTER METHOD\n\t\tif(ph.length()>10 && ph.length()<=13){\n\t\t\tphone = ph; // writing the data based on some rules\n\t\t}else{\n\t\t\tphone = \"NA\";\n\t\t\tSystem.out.println(\"Please Enter Correct Phone Number\");\n\t\t}\n\t}",
"public void setPhone(final String value)\n\t{\n\t\tsetPhone( getSession().getSessionContext(), value );\n\t}",
"public void setPhone(final String value)\n\t{\n\t\tsetPhone( getSession().getSessionContext(), value );\n\t}",
"public abstract void setPhone3(String sValue);",
"public void setPhone(String phone) {\r\n this.phone = phone;\r\n }",
"public void setPhone(String phone){\n\t\tthis.phone = phone;\n\t}",
"public void setPhone(String phone)\n {\n this.phone = phone;\n }",
"public void setPhone( String phone ) {\n this.phone = phone;\n }",
"public void setPhone(String newPhone) {\r\n\t\tthis.phone = newPhone;\r\n\t}",
"void setPhone(String phone) throws IllegalArgumentException;",
"public void setPhone(long phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setPhone(String phone) {\n this.phone = phone;\n }",
"public void setUserPhone( String userPhone )\n {\n this.userPhone = userPhone;\n }",
"public void setPhone(final SessionContext ctx, final String value)\n\t{\n\t\tsetProperty(ctx, PHONE,value);\n\t}",
"public void setPhone(final SessionContext ctx, final String value)\n\t{\n\t\tsetProperty(ctx, PHONE,value);\n\t}",
"public void setPhone(String phone) {\r\n // Bouml preserved body begin 00041002\r\n\t this.phoneNumber = phone;\r\n // Bouml preserved body end 00041002\r\n }",
"public Builder setPhone(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n phone_ = value;\n onChanged();\n return this;\n }",
"public void setPhone(final String phone) {\n this.phone = phone;\n }",
"public com.politrons.avro.AvroPerson.Builder setPhoneNumber(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.phone_number = value;\n fieldSetFlags()[3] = true;\n return this; \n }",
"public void setPhoneNumber(String phone_number){\n this.phone_number = phone_number;\n }",
"public final void setPhone(final String phoneNew) {\n this.phone = phoneNew;\n }",
"public void setPhone(java.lang.String phone) {\n this.phone = phone;\n }",
"@Override\r\n\tpublic void setPhone(String phone) {\n\t\tif (phone == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Null argument is not allowed\");\r\n\t\t}\r\n\t\tif (phone.equals(\"\")) {\r\n\t\t\tthrow new IllegalArgumentException(\"Empty argument is not allowed\");\r\n\t\t}\r\n\t\tthis.phone = phone;\r\n\t}",
"public void setPhone (java.lang.String phone) {\n\t\tthis.phone = phone;\n\t}",
"public void setPhone(String phone) {\n\t\tthis.phone = StringUtils.trimString( phone );\n\t}",
"public void updatePhoneNumber(String newPhoneNum)\r\n {\r\n phoneNum = newPhoneNum;\r\n }",
"@Generated(hash = 1187165439)\n public void setPhone(Phone phone) {\n synchronized (this) {\n this.phone = phone;\n phoneId = phone == null ? null : phone.getId();\n phone__resolvedKey = phoneId;\n }\n }",
"public void setMobile_phone(Long mobile_phone);",
"public void setphoneNum(String phoneNum) {\n\t\t_phoneNum = phoneNum;\n\t}",
"public void setPhoneNum(String phoneNum) {\n this.phoneNum = phoneNum;\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public Builder setPhoneNumber(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n phoneNumber_ = value;\n onChanged();\n return this;\n }",
"public void setHome_phone(Long home_phone);",
"public void setPhoneNumber(java.lang.CharSequence value) {\n this.phone_number = value;\n }",
"public void setPhone(String phone) {\n\t\tthis.phone = phone == null ? null : phone.trim();\n\t}",
"public void setPhone(String phonenum) {\n\t\tPHONE = phonenum;\n\t}",
"public void setPhoneNumber(String phoneNumber) {\n\t\tthis.phoneNumber=phoneNumber;\r\n\t}",
"public Builder setUserPhone(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n userPhone_ = value;\n onChanged();\n return this;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNo(String value) {\n setAttributeInternal(PHONENO, value);\n }",
"public void setPhoneNumber() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setter method initialized\r\n System.out.println(\"Phone Number : \"+phoneNumber);}",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\n this.phone = phone == null ? null : phone.trim();\n }",
"public void setPhone(String phone) {\r\n this.phone = phone == null ? null : phone.trim();\r\n }",
"public void setPhone(String phone) {\r\n this.phone = phone == null ? null : phone.trim();\r\n }",
"public void setPhone(String phone) {\r\n this.phone = phone == null ? null : phone.trim();\r\n }",
"public void setPhone(String phone) {\r\n this.phone = phone == null ? null : phone.trim();\r\n }",
"public void setPhoneNumber(String phoneNumber)\n\t{\n\t\tthis._phoneNumber=phoneNumber;\n\t}",
"@Override\n public void setPhone(java.lang.String phone) {\n _entityCustomer.setPhone(phone);\n }",
"public boolean setPhoneNumber(String phoneNumber) {\n phoneNumber = phoneNumber.trim().replaceAll(\"\\\"\", \"\");\n\n if (PhoneNumberValidator.isPhoneNumberValid(phoneNumber)) {\n phoneNumber = PhoneNumberValidator.formatPhoneNumber(phoneNumber);\n\n if(this.phoneNumber != null && this.phoneNumber.equalsIgnoreCase(phoneNumber)){\n return false;\n }\n this.phoneNumber = phoneNumber;\n return true;\n } else if (this.phoneNumber == null) {\n this.phoneNumber = \"INVALID\";\n } else {\n System.out.println(\"Person \" + name + \"'s phone number will not be modified as the given number is invalid\");\n }\n\n return false;\n }",
"public void setPhoneNumber(int phoneNumber) {\n\t\tthis.phoneNumber = phoneNumber;\n\t}",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setMobilePhone(String mobilePhone) {\n this.mobilePhone = mobilePhone;\n }",
"public void update_phone_settings(JSONObject json) throws JSONException {\n\t\tmyPhone.phone = json.getInt(\"phone\");\n\t}",
"public GoldenContactBuilder phone(String value) {\n phone = value;\n return this;\n }",
"public Builder setPhoneNumber(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n phoneNumber_ = value;\n onChanged();\n return this;\n }",
"@Override\n public void updateHasPhone(boolean hasPhone) {\n }",
"public void setContactPhone(String contactPhone) {\n this.contactPhone = contactPhone;\n }",
"public void setTelePhone(java.lang.String telePhone) {\r\n this.telePhone = telePhone;\r\n }",
"public void setTelphone (java.lang.String telphone) {\r\n\t\tthis.telphone = telphone;\r\n\t}",
"public void setTelephone(String telephone) {\n\t\tthis.telephone = telephone;\n\t}",
"public void setPhoneNumber(String phoneNumber) {\n if (this.phoneNumber != null) {\n return;\n }\n this.phoneNumber = phoneNumber;\n }",
"public void setMobilePhone(java.lang.String mobilePhone) {\r\n this.mobilePhone = mobilePhone;\r\n }",
"public void setPhoneNumber(String phoneNumber) {\r\n this.phoneNumber = doTrim(phoneNumber);\r\n }",
"public Builder setPhone(int index, com.demo.springprotobuff.Demoproto.Student.PhoneNumber value) {\n\t\t\t\tif (phoneBuilder_ == null) {\n\t\t\t\t\tif (value == null) {\n\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t}\n\t\t\t\t\tensurePhoneIsMutable();\n\t\t\t\t\tphone_.set(index, value);\n\t\t\t\t\tonChanged();\n\t\t\t\t} else {\n\t\t\t\t\tphoneBuilder_.setMessage(index, value);\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}",
"public void setPhone_number(String phone_number) {\n this.phone_number = phone_number;\n }",
"public Builder setPhone(\n int index, cb.Careerbuilder.Company.PhoneNumber value) {\n if (phoneBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePhoneIsMutable();\n phone_.set(index, value);\n onChanged();\n } else {\n phoneBuilder_.setMessage(index, value);\n }\n return this;\n }",
"public void getPhone(Phone newPhone)\n {\n currentPhone = newPhone;\n }",
"public void setaPhone(String aPhone) {\n this.aPhone = aPhone == null ? null : aPhone.trim();\n }",
"@Test\n public void test_setTelephone() {\n String value = \"new_value\";\n instance.setTelephone(value);\n\n assertEquals(\"'setTelephone' should be correct.\",\n value, TestsHelper.getField(instance, \"telephone\"));\n }",
"@Test\n public void testSetPhone() {\n System.out.println(\"setPhone\");\n user.setPhone(\"110\");\n assertEquals(\"110\", user.getPhone());\n }"
] | [
"0.8255686",
"0.79772335",
"0.795427",
"0.7784191",
"0.77725565",
"0.7754719",
"0.77285606",
"0.7715072",
"0.7689442",
"0.7674655",
"0.76661366",
"0.76661366",
"0.76586115",
"0.75966567",
"0.7589437",
"0.7575338",
"0.7553428",
"0.75410086",
"0.7496759",
"0.7489991",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74850357",
"0.74712837",
"0.7463988",
"0.7463988",
"0.74477476",
"0.74342495",
"0.74102616",
"0.7389048",
"0.7362852",
"0.7337867",
"0.7334684",
"0.72526324",
"0.7241971",
"0.72346354",
"0.72197676",
"0.72133213",
"0.7213081",
"0.7167498",
"0.71568",
"0.7149204",
"0.7149204",
"0.71240044",
"0.7123824",
"0.7121061",
"0.7120044",
"0.7109157",
"0.7107768",
"0.7087847",
"0.7046404",
"0.7040929",
"0.7036053",
"0.70315266",
"0.70315266",
"0.70315266",
"0.70315266",
"0.70315266",
"0.70315266",
"0.70315266",
"0.7028308",
"0.7028308",
"0.7028308",
"0.7028308",
"0.7019355",
"0.70154",
"0.6966206",
"0.69540554",
"0.69504654",
"0.69504654",
"0.69504654",
"0.69504654",
"0.69504654",
"0.6950357",
"0.692814",
"0.6922384",
"0.6861317",
"0.68283",
"0.682371",
"0.6819293",
"0.67875534",
"0.6776141",
"0.6766066",
"0.676138",
"0.6754187",
"0.67509997",
"0.6736687",
"0.673233",
"0.6715587",
"0.66979843",
"0.66581225",
"0.6649572"
] | 0.8033799 | 1 |
set_loc function this function Just Set or update the value of the Location | public void set_loc(String locaton)
{
d_loc =locaton;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLocation(Location loc) {\n this.location = loc;\n }",
"public void setLocation(Point loc){\n\t\tthis.location = loc;\n\t}",
"public void setLocation(String location);",
"public void setLocation(Location loc) {\n if (loc.getLatitude() != 0.0 && loc.getLongitude() != 0.0) {\n try {\n Geocoder geocoder = new Geocoder(this, Locale.getDefault());\n List<Address> list = geocoder.getFromLocation(\n loc.getLatitude(), loc.getLongitude(), 1);\n if (!list.isEmpty()) {\n Address DirCalle = list.get(0);\n mensaje2.setText(\n DirCalle.getAddressLine(0));\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"public void setLocation(String location){\n mLocation = location;\n loadData();\n }",
"public void setXYZ(Location loc)\n\t{\n\t\tsetXYZ(loc.getX(), loc.getY(), loc.getZ());\n\t}",
"public void setLocation(Coordinate coordinate);",
"void setLocation(int x, int y);",
"@Override\n public void setLocation(geo_location p) {\n this.location.setX(p.x());\n this.location.setY(p.y());\n this.location.setZ(p.z());\n }",
"public final void setLocation(Coord location) {\n this.location = location;\n }",
"public void setLocation(String name, Location loc) {\n cfg.set(name.replace(\".\", \"\") + \".name\", name);\n if (loc.getWorld() != null) cfg.set(name.replace(\".\", \"\") + \".World\", loc.getWorld().getName());\n cfg.set(name.replace(\".\", \"\") + \".X\", loc.getX());\n cfg.set(name.replace(\".\", \"\") + \".Y\", loc.getY());\n cfg.set(name.replace(\".\", \"\") + \".Z\", loc.getZ());\n cfg.set(name.replace(\".\", \"\") + \".Yaw\", loc.getYaw());\n cfg.set(name.replace(\".\", \"\") + \".Pitch\", loc.getPitch());\n this.save();\n }",
"public static void setCurrentLocation(Double lat, Double lng ){\n //SharedPreferences sharedPreferences1=appCompatActivity. getSharedPreferences(\"longitude\", MODE_PRIVATE) ;\n SharedPreferences.Editor editor=sharedPreferences.edit();\n editor.putString(USER_LTD, String.valueOf(lat));\n editor.putString(USER_LNG, String.valueOf(lng));\n editor.apply();\n }",
"public void setLocation(Location location) \n\t{\n\t\tthis.location = location;\n\t}",
"protected void setLocation(String location){\r\n this.location = location;\r\n }",
"public void setLocation(URI location)\r\n/* 288: */ {\r\n/* 289:432 */ set(\"Location\", location.toASCIIString());\r\n/* 290: */ }",
"public void setLocation(Location location) {\n this.location = location;\n }",
"public void setLocation(Location location) {\n this.location = location;\n }",
"public void setLocation(Location location) {\n this.location = location;\n }",
"public void updateLocation();",
"public final void setLocation(String value) {\n location = value;\n }",
"@Override\n\tpublic void setLocation(String l) {\n\t\tlocation = l;\n\t\t\n\t}",
"@Override\n public void setDisplayedLocation(Location loc) {\n pane.setVvalue(loc.getyCoord());\n pane.setHvalue(loc.getxCoord());\n setCurrentFloor(loc.getLevel());\n displayedLocation = getDisplayedLocation();\n }",
"public void setLocation(Location location) {\r\n\t\tthis.location = location;\r\n\t}",
"public void setLatLongLoc(String loc_lat, String loca_long) {\n editor.putString(LOC_LAT, loc_lat);\n editor.putString(LOC_LONG, loca_long);\n editor.commit();\n }",
"public void setLocation(double lon, double lat) {\n\t\tthis.lon = lon;\n\t\tthis.lat = lat;\n\t}",
"@Override\n public void setLocation(Point location) {\n pos = location;\n try {\n if (TerraGen.window != null && TerraGen.window.getClient() != null)\n TerraGen.window.getClient().pushGameChange(TerraGen.window.game.getMap().getTokens().indexOf(this), NetworkType.TOKEN, this);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void setLocation(String location) {\n inputParameters.Location = location;\n\n }",
"public void setLocation(Vec2f loc) {\n\t\tsuper.setLocation(loc);\n\t\tif (_shape != null) _shape.setLocation(loc);\n\t}",
"private void setLocation(Location newLocation) {\n\t\tif (location != null) {\n\t\t\tfield.clear(location);\n\t\t}\n\t\tlocation = newLocation;\n\t\tfield.place(this, newLocation);\n\t}",
"public void setLocation(LatLng _location) {\n location = _location;\n }",
"public void setWarp(Location loc) {\n if (loc != null) {\n warp = new ImmutableSimpleLocation(loc);\n }\n }",
"public void setLocation(Vector location);",
"protected void updateLocation (BodyObject source, Location loc)\n {\n SceneLocation sloc = new SceneLocation(loc, source.getOid());\n if (!_ssobj.occupantLocs.contains(sloc)) {\n // complain if they don't already have a location configured\n Log.warning(\"Changing loc for occupant without previous loc \" +\n \"[where=\" + where() + \", who=\" + source.who() +\n \", nloc=\" + loc + \"].\");\n _ssobj.addToOccupantLocs(sloc);\n } else {\n _ssobj.updateOccupantLocs(sloc);\n }\n }",
"public void setLoc(int x, int y) {\n locX = x;\n locY = y;\n }",
"public abstract void setLocations(java.util.Set locations);",
"@Override\n public void setLocation(String latitude, String longitude) {\n lat = latitude;\n lon = longitude;\n }",
"public void setLocation(Point newLocation) {\r\n this.p = newLocation;\r\n }",
"public void setLocation(int X, int Y){\n \tlocation = new Point(X,Y);\n }",
"public void setLocation(float x, float y);",
"void changeLocation(@NonNull String location);",
"private void setLocation(){\r\n\t\t//make the sql command\r\n\t\tString sqlCmd = \"INSERT INTO location VALUES ('\" + commandList.get(1) + \"', '\"\r\n\t\t\t\t+ commandList.get(2) + \"', '\" + commandList.get(3) + \"');\";\r\n\r\n\t\ttry {//start SQL statement\r\n\t\t\tstmt.executeUpdate(sqlCmd);\r\n\t\t} catch (SQLException e) {\r\n\t\t\terror = true;\r\n\t\t\tout.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif(error == false)\r\n\t\t\tout.println(\"true\");\r\n\t}",
"public void setLocation(String location){\n this.location = location;\n }",
"public void setLocation(String location){\n this.location = location;\n }",
"public void setLocation(Point location) {\n\t\tthis.location = location;\n\t}",
"void setLoc(gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc loc);",
"void setPosition(Unit unit, MapLocation position);",
"public Builder setLocation(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n location_ = value;\n onChanged();\n return this;\n }",
"public void setAtLoc(Location atLoc) {\n\t\tthis.atLoc = atLoc;\n\t}",
"private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }",
"public void setLocation(LatLng location) {\r\n \t\tthis.mapLocation = location;\r\n \t}",
"@Test\n public void testSetLocation() {\n try {\n Location location = new Location(45, 50);\n WaterReport wr = new WaterReport(Model.getCurrentAccount(),\n \"Bottled\", \"Waste\", \"12:04\", location);\n wr.setLocation(new Location(40, 35));\n Location check = new Location(40, 35);\n Assert.assertEquals(\"Incorrect location after setting new location\", check,\n wr.getLocation());\n } catch (Exception e) {\n Assert.fail(\"Set Location should not have thrown exception here\");\n e.printStackTrace();\n }\n }",
"public void setLocation(entity.PolicyLocation value);",
"public com.babbler.ws.io.avro.model.BabbleValue.Builder setLocation(java.lang.String value) {\n validate(fields()[3], value);\n this.location = value;\n fieldSetFlags()[3] = true;\n return this;\n }",
"public void setSpawn(Location loc) {\n if (loc != null) {\n spawn = new ImmutableSimpleLocation(loc);\n }\n }",
"@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }",
"@Override\n public void setLocation(String location) {\n this.location = location;\n }",
"public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationResponse setServiceLocation\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationRequest setServiceLocationRequest\n )\n ;",
"public void setLocation(LatLng location) {\n\t\tthis.location = location;\n\t}",
"@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}",
"protected void setLocation(Location newLocation)\n {\n if(location != null) {\n field.clear(location);\n }\n location = newLocation;\n field.place(this, newLocation);\n }",
"public void setLocation(WotlasLocation myLocation) {\n getBasicChar().setLocation(myLocation);\n\n if (myLocation.isRoom()) {\n this.myRoom = ClientDirector.getDataManager().getWorldManager().getRoom(myLocation);\n } else {\n this.myRoom = null;\n }\n if (myLocation.isTileMap()) {\n this.myTileMap = ClientDirector.getDataManager().getWorldManager().getTileMap(myLocation);\n } else {\n this.myTileMap = null;\n }\n }",
"public void setLocation(String location)\n {\n this.location = location;\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"public void setLocation(String location) {\r\n this.location = location;\r\n }",
"@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}",
"public void setRobotLocation(Point p);",
"public void setLocation(Point2D p);",
"Label setLocation();",
"public void setUserLocation(double lat, double lon) {\n\tuserLocation = new Point2D.Double(lon,lat);\n }",
"static public void set_location_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"location name:\", \"rating:\", \"population:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\n\t\t\t\t\" select distinct c.`id`, c.`name`, c.`area (1000 km^2)`, c.`GDP per capita (1000 $)`, \" +\n\t\t\t\t\t\t\t\t\"c.`population (million)`, c.`capital`, c.`GDP (billion $)` \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_countries c, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.country_id=c.id and lc.location_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by c.`GDP (billion $)` desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct c.`id`, c.`name`, c.`area (1000 km^2)`, c.`GDP per capita (1000 $)`, \" +\n\t\t\t\t\" c.`population (million)`, c.`capital`, c.`GDP (billion $)` \" +\n\t\t\t\t\" from curr_places_countries c \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id:\", \"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"COUNTRIES\";\n\t}",
"public void setLocation(String location) {\r\n this.location = location;\r\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"@Override\n\tpublic void setLocation(long location) {\n\t\t_buySellProducts.setLocation(location);\n\t}",
"public LocationData(Location loc)\n {\n update(loc);\n }",
"public void setLocation( final double[] location )\n\t{\n\t\tthis.location = location;\n\t}",
"private void setMyLatLong() {\n }",
"public void setLocXY(int x, int y) {\n locX = x;\n locY = y;\n }",
"public void setLocationInfo(Location locationInfo) {\n\tthis.locationInfo = locationInfo;\n}",
"public void setLocs(String newValue);",
"@VTID(16)\n void setLocation(\n excel.Range rhs);",
"void setOrigination(Locations origination);",
"public void setLobbyLocation(Location loc) {\n gameLocations.put(GameLocation.LOBBY, loc);\n }",
"private void setCurrentLocation() {\n foundLocation = false;\n //Ignore the red line - we check for permissions before this function is called\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n googleMap.setMyLocationEnabled(true);\n FusedLocationProviderClient mFusedLocationProviderClient = LocationServices\n .getFusedLocationProviderClient(getActivity());\n //Ignore the red line - we check for permissions before this function is called\n Task<Location> lastLocation = mFusedLocationProviderClient.getLastLocation();\n lastLocation.addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n Location location = task.getResult();\n if (location == null) {\n locationControlTask = new LocationControl();\n locationControlTask.execute(getActivity());\n } else {\n LatLng currentLatLng = new LatLng(location.getLatitude(),\n location.getLongitude());\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(currentLatLng,\n DEFAULT_ZOOM);\n googleMap.moveCamera(update);\n foundLocation = true;\n }\n }\n });\n }",
"public void testSetGoalLocation() {\n test = new Location(9, 9);\n assertEquals(test, maze1.getGoalLocation());\n \n test = new Location(1, 1);\n maze1.setGoalLocation(test);\n assertEquals(test, maze1.getGoalLocation());\n \n test = new Location(2, 2);\n maze1.setCell(test, MazeCell.WALL);\n maze1.setGoalLocation(test);\n assertEquals(test, maze1.getGoalLocation());\n \n \n }",
"@Override\n public void setLocation(Point3D loc) throws InvalidDataException {\n myMovable.setLocation(loc);\n }",
"public void setCurrentLocation(Location newLocation)\n\t{\n\t\tcurrentLocation = newLocation;\n\t}",
"@Override\n protected void set(org.tair.db.locusdetail.ILocusDetail dto) {\n locusLocus = dto;\n }",
"public void setLocation(){\n //Check if user come from notification\n if (getIntent().hasExtra(EXTRA_PARAM_LAT) && getIntent().hasExtra(EXTRA_PARAM_LON)){\n Log.d(TAG, \"Proviene del servicio, lat: \" + getIntent().getExtras().getDouble(EXTRA_PARAM_LAT) + \" - lon: \" + getIntent().getExtras().getDouble(EXTRA_PARAM_LON));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(getIntent().getExtras().getDouble(EXTRA_PARAM_LAT), getIntent().getExtras().getDouble(EXTRA_PARAM_LON)), 18));\n NotificationManager mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n mNM.cancel(1);\n } else{\n if (bestLocation!=null){\n Log.d(TAG, \"Posicion actual -> LAT: \"+ bestLocation.getLatitude() + \" LON: \" + bestLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(bestLocation.getLatitude(), bestLocation.getLongitude()), 16));\n } else{\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(41.651981, -4.728561), 16));\n }\n }\n }",
"public abstract void updateLocations();",
"public void onLocationChanged(Location loc) {\n\n\n loc.getLatitude();\n loc.getLongitude();\n latitude=loc.getLatitude()+\", \"+loc.getLongitude();\n String Text = \"\\n Lat = \" + loc.getLatitude() + \"\\n Long = \" + loc.getLongitude();\n mensaje1.setText(Text);\n this.mainActivity.setLocation(loc);\n }",
"public void setLocation(final String location) {\n this.location = location;\n }",
"public final void setLocation(Tile location) {\n this.location = location;\n }",
"public boolean setGPS(String longitude, String latitude);",
"public void setLocation(double x, double y) {\n currentLocation.x = (int) x;\n currentLocation.y = (int) y;\n refreshLocation();\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"public void setLocation(String location) {\n this.location = location;\n }",
"public void onLocationChanged(Location loc) {\n\tif (loc != null && !loc.equals(m_oldLoc)) {\n\t m_oldLoc = loc;\n\t if (m_mode == LOCK) {\n\t\tm_location = new GeoPoint((int)(loc.getLatitude() * 1E6),\n\t\t\t\t\t (int)(loc.getLongitude() * 1E6));\n\t\tm_controller.animateTo(m_location);\n\t }\n\t}\n }",
"public void setLocation(String location) {\r\n\t\tthis.location = location;\r\n\t}"
] | [
"0.811391",
"0.7996755",
"0.761929",
"0.7560534",
"0.73004323",
"0.72619057",
"0.72096974",
"0.72022444",
"0.7192077",
"0.7149487",
"0.71485174",
"0.7121823",
"0.7097406",
"0.70972866",
"0.70827085",
"0.7079313",
"0.7079313",
"0.7079313",
"0.70740706",
"0.7040514",
"0.702605",
"0.70167404",
"0.6990068",
"0.6985191",
"0.69267416",
"0.6902702",
"0.69001913",
"0.6891955",
"0.68859816",
"0.6885467",
"0.6881111",
"0.68769467",
"0.6867895",
"0.6857438",
"0.6842173",
"0.68358713",
"0.68336546",
"0.68032676",
"0.67927337",
"0.67873865",
"0.67796034",
"0.6773195",
"0.6773195",
"0.67729926",
"0.6772765",
"0.6771506",
"0.67702216",
"0.6764139",
"0.67511994",
"0.6739468",
"0.67378587",
"0.67267656",
"0.6715771",
"0.67071176",
"0.6704379",
"0.67009026",
"0.6683436",
"0.6677029",
"0.66672355",
"0.6656765",
"0.66439426",
"0.6639818",
"0.6611544",
"0.6610652",
"0.660935",
"0.66076493",
"0.65714884",
"0.6558625",
"0.65543866",
"0.654516",
"0.653193",
"0.6530392",
"0.65136576",
"0.65051895",
"0.64999706",
"0.6496471",
"0.649621",
"0.649243",
"0.6487364",
"0.6480497",
"0.6475611",
"0.6474688",
"0.6471728",
"0.6469355",
"0.64593446",
"0.64567393",
"0.64434034",
"0.6428066",
"0.6404037",
"0.63962406",
"0.63881224",
"0.63879013",
"0.6386229",
"0.6380896",
"0.6379658",
"0.6379658",
"0.6379658",
"0.6379658",
"0.63767636",
"0.63725865"
] | 0.7113636 | 12 |
Set_Type function this function Just Set or update the value of the Type | public void set_type(String t)
{
type =t;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setType(Type t) {\n type = t;\n }",
"void setType(Type type)\n {\n this.type = type;\n }",
"public void setType(type type) {\r\n\t\tthis.Type = type;\r\n\t}",
"public void setType(Type t) {\n\t\ttype = t;\n\t}",
"public void setType(Object type)\r\n {\r\n\tthis.type = type;\r\n }",
"private void setType(String type) {\n mType = type;\n }",
"public void setType(String type);",
"public void setType(String type);",
"public void setType(String type);",
"public void setType(Type type){\n\t\tthis.type = type;\n\t}",
"void setType(java.lang.String type);",
"public void setType(Type type) {\n this.type = type;\n }",
"public void setType(Type type) {\n this.type = type;\n }",
"public void setType(Type type) {\n this.type = type;\n }",
"public void setType(int type) {\n type_ = type;\n }",
"public void setType(String type) {\n m_Type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type){\n \tthis.type = type;\n }",
"void setType(String type) {\n this.type = type;\n }",
"public void setType(String type)\r\n {\r\n this.mType = type;\r\n }",
"public void setType(String type) \n {\n this.type = type;\n }",
"public void setType (String typ) {\n type = typ;\n }",
"public void setType(String inType)\n {\n\ttype = inType;\n }",
"public void setType(String type){\n this.type = type;\n }",
"public void setType(int t){\n this.type = t;\n }",
"public final void setType(String type){\n\t\tthis.type = type;\t\n\t}",
"@Override\n\tpublic void setType(Type t) {\n\t\theldObj.setType(t);\n\t}",
"public void setType( Type type ) {\n assert type != null;\n this.type = type;\n }",
"public void setType (String type) {\n this.type = type;\n }",
"public void setType (String type) {\n this.type = type;\n }",
"public void setType (String type) {\n this.type = type;\n }",
"public void setType(String value) {\n this.type = value;\n }",
"protected void setType(String newType) {\n\t\ttype = newType;\n\t}",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String t) {\n\ttype = t;\n }",
"public void setType(int pType) {\n mType = pType;\n }",
"public static void setType(String type) {\n Globals.type = type;\n setProperty(\"type\", type);\n }",
"public void setType(String type) {\n\t this.mType = type;\n\t}",
"public void setType(Class type) {\n\t this.type = type;\n\t }",
"public void setType( int type ) {\r\n typ = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType( String type )\n {\n this.type = type;\n }",
"public void setType (int type) {\n this.type = type;\n }",
"public void setType (int type) {\n this.type = type;\n }",
"public void setType(java.lang.String newType) {\n\ttype = newType;\n}",
"public void setType(String aType) {\n iType = aType;\n }",
"public void setType(String type) {\r\n\t\tthis.type=type;\r\n\t}",
"public void setType(int type) {\r\n this.type = type;\r\n }",
"public void setType(int type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(int t) {\r\n\t\ttype = t;\r\n\t}",
"public abstract void setType();",
"@JSProperty(\"type\")\n void setType(Type value);",
"public void setType(String newVal) {\n if ((newVal != null && this.type != null && (newVal.compareTo(this.type) == 0)) || \n (newVal == null && this.type == null && type_is_initialized)) {\n return; \n } \n this.type = newVal; \n\n type_is_modified = true; \n type_is_initialized = true; \n }",
"final public void setType(String type)\n {\n setProperty(TYPE_KEY, (type));\n }",
"@Override\n\tpublic void setType(String type) {\n\t}",
"void setDataType(int type );",
"public void setType(String type){\n\t\tthis.type = type;\n\t}",
"public void setType( String type ) {\n this.type = type;\n }",
"public void setType(String t) {\n\t\tthis.type = t;\n\t}",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\r\r\n\t\tthis.type = type;\r\r\n\t}",
"public void setType(final Type type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public final native void setType(String type) /*-{\n this.setType(type);\n }-*/;",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(int type) {\n this.type = type;\n }",
"public void setType(int nType) { m_nType = nType; }",
"public void setType(String type) {\r\n\t\tthis.type = type;\r\n\t}",
"public void setType(String type) {\r\n\t\tthis.type = type;\r\n\t}",
"public void setType(String type) {\r\n\t\tthis.type = type;\r\n\t}",
"public void setType(long type) {\r\n this.type = type;\r\n }",
"public void change_type(int type_){\n\t\ttype = type_;\n\t\tif(type != 0)\n\t\t\toccupe = 1;\n\t}"
] | [
"0.81020874",
"0.80988955",
"0.7993283",
"0.7963049",
"0.794745",
"0.79365003",
"0.792145",
"0.792145",
"0.792145",
"0.788779",
"0.7855588",
"0.7775028",
"0.7775028",
"0.7775028",
"0.77613187",
"0.77610654",
"0.77466094",
"0.7735298",
"0.7724666",
"0.7718053",
"0.768186",
"0.76774305",
"0.7671035",
"0.7640999",
"0.76273483",
"0.7625938",
"0.76187664",
"0.7590911",
"0.75841826",
"0.75841826",
"0.75841826",
"0.75811654",
"0.7578662",
"0.757427",
"0.75706095",
"0.7557322",
"0.7550758",
"0.75486803",
"0.7543763",
"0.7537053",
"0.75309503",
"0.75309503",
"0.75309503",
"0.75309503",
"0.75211716",
"0.7512342",
"0.7509434",
"0.7509434",
"0.750837",
"0.75054896",
"0.75048333",
"0.7495162",
"0.7495162",
"0.7468049",
"0.7468049",
"0.74662954",
"0.7461321",
"0.7461164",
"0.74588996",
"0.74583155",
"0.74525",
"0.7443805",
"0.7442776",
"0.7437611",
"0.7437201",
"0.7436371",
"0.7436371",
"0.742473",
"0.74197704",
"0.7412201",
"0.74046844",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.73968184",
"0.7377626",
"0.73671156",
"0.7357554",
"0.7357554",
"0.7357554",
"0.73527616",
"0.7344325"
] | 0.7837611 | 11 |
Default constructor for scene | public Scene(long seedVal, boolean niceVal, double clockSpeedVal,
String dumpPrefixVal)
{
seed = seedVal;
nice = niceVal;
clockSpeed = clockSpeedVal;
dumpPrefix = dumpPrefixVal;
// Allocate parameters
params = new Vector<DoubleParameter>();
options = new Vector<BooleanParameter>();
tH = addParameter(new DoubleParameter("Left/Right", 0, -10, 10, 1));
tV = addParameter(new DoubleParameter("Down/Up", -2, -10, 10, 1));
tZ = addParameter(new DoubleParameter("Out/In", 0, -30, 20, 1));
rAlt = addParameter(new DoubleParameter("Altitude", 15, -15, 80, 1));
rAzim = addParameter(new DoubleParameter("Azimuth", 0, -180, 180, 1));
drawAnimation = addOption(new BooleanParameter("Animation",
false, 2));
drawTime = addOption(new BooleanParameter("Show time",
dumpPrefix == null,
1));
drawBugView = addOption(new BooleanParameter("Bug camera view",
false, 1));
//goal = new Point3d(rgen.nextDouble() * 5, rgen.nextDouble() * 5, 0);
build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Scene() {}",
"public Odi11SceneCatImpl() {\n }",
"@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }",
"public Scene(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void createScene();",
"public Render(Scene scene1) {\n scene = scene1;\n }",
"public RayTracerBasic(Scene scene)\r\n\t{\r\n\t\tsuper(scene);\r\n\t}",
"public Menu() {\n mainMenuScene = createMainMenuScene();\n mainMenu();\n }",
"public RayTracerBase(Scene scene) {\n _scene = scene;\n }",
"public RayTracerBase(Scene scene) {\n _scene = scene;\n }",
"public SceneFurniRecord ()\n {\n }",
"protected Scene createView() {\n\t\treturn null;\n\t}",
"protected void buildScene() {\n Geometry cube1 = buildCube(ColorRGBA.Red);\n cube1.setLocalTranslation(-1f, 0f, 0f);\n Geometry cube2 = buildCube(ColorRGBA.Green);\n cube2.setLocalTranslation(0f, 0f, 0f);\n Geometry cube3 = buildCube(ColorRGBA.Blue);\n cube3.setLocalTranslation(1f, 0f, 0f);\n\n Geometry cube4 = buildCube(ColorRGBA.randomColor());\n cube4.setLocalTranslation(-0.5f, 1f, 0f);\n Geometry cube5 = buildCube(ColorRGBA.randomColor());\n cube5.setLocalTranslation(0.5f, 1f, 0f);\n\n rootNode.attachChild(cube1);\n rootNode.attachChild(cube2);\n rootNode.attachChild(cube3);\n rootNode.attachChild(cube4);\n rootNode.attachChild(cube5);\n }",
"@Override\r\n\tpublic SceneBase getInitialScene() {\n\t\treturn new SceneTest();\r\n\t}",
"public Game() {\n\t\tsuper();\n\t\tgameModel = new GameModel();\n\t\tview = new GamePane(gameModel);\n\t\t\n\t\tadd(view);\n\t\tpack();\n\t\tsetLocationRelativeTo(null);\n\t}",
"public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }",
"public VolcanoWorld() {\n this(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n }",
"public Lane() {\n\t}",
"public Life() {\n super();\n\n initialiseStyle();\n initialiseEvents();\n }",
"public OrchardGame() {\n\t\t\n\t}",
"public SceneManager(GameScreen screen, Camera2D camera)\r\n\t{\r\n\t\tinitialize(screen, camera);\r\n\t}",
"@Override\n\tpublic void createScene()\n\t\n\t{\n\t loading = new Sprite (0,0,resourceManager.loadingRegion,vbo); // тупо ставим спрайт с картинкой\n\t\tattachChild(loading);\n\t}",
"public Game() {\n\n\t}",
"public MyWorld()\n {\n super(600, 400, 1);\n }",
"public LarvaSkeleton() {\n\n }",
"public CSGTestSceneLoader(\r\n\t\tString[]\tpArgs\r\n\t) {\r\n\t\t//this( new StatsAppState(), new FlyCamAppState(), new DebugKeysAppState() );\r\n\t\tthis( pArgs, new FlyCamAppState() );\t\t\r\n\t}",
"public ClassTester()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1);\n addObject(new NonScrollingBackground(\"Stage - 0.jpg\"),300,131);\n addObject(playerMage,35,170);\n addObject(new AbilityDisplayer(playerMage),125,268);\n }",
"public Game(){\n\n }",
"public Game() {}",
"public HowToPlay()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(763, 578, 1); \n //HowToPlay play = new HowToPlay();\n }",
"public MiniGame() {\n\n\t}",
"void createScene(){\n\t\tmainScene = new Scene(mainPane);\r\n\t\t\r\n\t\t//If keyEvent is not focussed on a node on the scene, you can attach\r\n\t\t//a keyEvent to a scene to be consumed by the screen itself.\r\n\t\tCloser closer = new Closer();\r\n\t\tmainScene.setOnKeyPressed(closer);\r\n\t}",
"protected Scene(Kroy game)\n {\n table = new Table();\n background = new NinePatchDrawable(new NinePatch(new Texture(\"Grey.png\"), 3, 3, 3, 3));\n skin = new Skin(Gdx.files.internal(\"uiskin.json\"));\n stageBatch = game.batch;\n Viewport viewport = new ScreenViewport(new OrthographicCamera());\n stage = new Stage(viewport, stageBatch);\n table.setBackground(background);\n }",
"public gameScene_Model(Stage primaryStage){\n this.primaryStage = primaryStage;\n background = new MyStage();\n this.scene = new Scene(background,600,800);\n animal = new Animal(\"file:src/FroggerApp/Images_File/froggerUp.png\");\n }",
"public LaserCanvas()\r\n\t{\r\n\t\tsuper();\r\n\t\t\r\n\t\tgame = new LaserTutor();\r\n\t\t\r\n\t\tgame.initialize( );\r\n\t}",
"private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }",
"public GameWorld(){\r\n\t\t\r\n\t}",
"@Override\n\tpublic Scene onLoadScene() {\n\t\tmEngine.registerUpdateHandler(new FPSLogger());\n\t\tScene scene=new Scene();\n\t\tAutoParallaxBackground autoParallaxBackground=new AutoParallaxBackground(0, 0, 0, 5);\n\t\tautoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 0, mTextureRegion)));\n\t\tscene.setBackground(autoParallaxBackground);\n\t\t//Position of the Sprite in the region\n\t\tAnimatedSprite banana=new AnimatedSprite(200,200,bananaRegion);\n\t\tbanana.animate(100);\n\t\tscene.attachChild(banana);\n\t\treturn scene;\n\t}",
"public lv3()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n //super(950, 600, 1); \n //prepare();\n prepare();\n stopped();\n started();\n }",
"public Camera() {\r\n this(1, 1);\r\n }",
"public Zug_V2() {\n\t\tsetLayout();\n\t\tthis.initStyle(StageStyle.UNDECORATED);\n\t\tthis.scene = new Scene(fenster, 500, 300);\n\t\tthis.setScene(scene);\n\t}",
"public Game() {\n String configPath= String.valueOf(getClass().getResource(\"/config/conf.xml\"));\n\n listeners= new ArrayList<>();\n assembler= new Assembler(configPath);\n levelApple= (ILevel) assembler.newInstance(\"levelApple\");\n levelRarity= (ILevel) assembler.newInstance(\"levelRarity\");\n levelRainbow= (ILevel) assembler.newInstance(\"levelRainbow\");\n levelRunning= levelApple;\n levelApple.selected();\n levelFlutter= null;\n levelPinky= null;\n jukebox = (Jukebox) assembler.newInstance(\"jukebox\");\n jukebox.switchTo(\"apple\");\n event = new LevelChangeEvent();\n event.setNumberOfLevel(6);\n setEventSelected(true, false, false);\n setEventRunning(true, true, true);\n }",
"public AStationPane() {\n }",
"public void buildInitialScene() {\n\t\t\n\t\t//Creation image background\n\t\tfinal String BACKGROUND_PATH = \"src/assets/img/temp_background.png\";\n\t\tthis.background = new GameImage(BACKGROUND_PATH);\n\n\t\t//Creation image Game Over\n\t\tfinal String GAME_OVER_PATH = \"src/assets/img/erro.png\";\n\t\tthis.errorScene = new Sprite(GAME_OVER_PATH);\n\n\t\t//Game over sprite center position\n\t\tthis.errorScene.x = spos.calculatePosition(WindowConstants.WIDTH, 2, this.errorScene, 2);\n\t\tthis.errorScene.y = spos.calculatePosition(WindowConstants.HEIGHT, 2, this.errorScene, 2);\n\t}",
"private void construct(){\n TriangleMesh mesh;\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/bunny.obj\");\n mesh.setMaterial(new MaterialNode(0.1f, 0.1f, .5f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/cube.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 0, 0));\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/teddy.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 0, 1, 0));\n mesh.setMaterial(new MaterialNode(0.1f, .5f, 0.1f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/sphere.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 1, 0));\n mesh.setMaterial(new MaterialNode(1, 0, 0, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n scene.calculateNormals();\n scene.setupRendering();\n }",
"public Preview (GameStarter game) {\n //\n super(game);\n //\n }",
"public AnimationFX(Node node) {\n super();\n setNode(node);\n\n }",
"public Stage1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1200, 900, 1);\n \n GreenfootImage image = getBackground();\n image.setColor(Color.BLACK);\n image.fill();\n star();\n \n \n \n //TurretBase turretBase = new TurretBase();\n playerShip = new PlayerShip();\n scoreDisplay = new ScoreDisplay();\n addObject(scoreDisplay, 100, 50);\n addObject(playerShip, 100, 450);\n \n }",
"public Mesh() {\n this(DEFAULT_COORDS);\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public static Scene getScene(){\n return scene;\n }",
"public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}",
"public void setScene(Scene scene){\n this.scene = scene;\n }",
"public Game() {\n }",
"public Game() {\n\n GameBoard gameBoard = new GameBoard();\n Renderer renderer = new Renderer(gameBoard);\n }",
"public Game(){\n\t\tDimension dimension = new Dimension(Game.WIDTH, Game.HEIGHT); //Create dimensions for window size\n\t\tsetPreferredSize(dimension); //Set the start size\n\t\tsetMinimumSize(dimension); //Set the min size\n\t\tsetMaximumSize(dimension); //Set the max size, this locks the window size.\n\t\taddKeyListener(this); //Add the key listener to the game object\n\t\tlevel1(); //Load level 1\n\t\twinScreen = new WinScreen(); //Create win object\n\t\tdeadScreen = new DeadScreen(); //Create dead object\n\t\tstartScreen = new StartScreen(); //Create startScreen object\n\t\tpauseScreen = new PauseScreen(); //Create pauseScreen object\n\t\tspriteSheet = new SpriteSheet(\"img/sprites.png\"); //Create SpriteSheet object\n\t\tnew Texture(); //Initialize texture object\n\t}",
"public Curso() {\r\n }",
"public MusicSheet() {\n Log.w(TAG,\"empty constructor\");\n // vertexArray = new VertexArray(VERTEX_DATA);\n }",
"public playGame()\n {\n // initialise instance variables\n //no constructor\n }",
"@Override\npublic void populateScene() {\n\t\n}",
"public static Scene getScene() {\n\t\treturn null;\r\n\t}",
"public Scene scene() {\n AnchorPane anchorPane = new AnchorPane();\n\n Pane track = raceTrack.trackpainting();\n\n AnchorPane.setTopAnchor(track, 40.0);\n AnchorPane.setLeftAnchor(track, 40.0);\n\n determineStartingLocation(carOne, carTwo, carThree);\n\n carPosition(carOne);\n carPosition(carTwo);\n carPosition(carThree);\n\n AnchorPane.setTopAnchor(btnStartRace, 480.0);\n AnchorPane.setLeftAnchor(btnStartRace, 740.0);\n\n AnchorPane.setTopAnchor(btnEndRace, 480.0);\n AnchorPane.setLeftAnchor(btnEndRace, 730.0);\n\n AnchorPane.setTopAnchor(txtWarning, 600.0);\n AnchorPane.setLeftAnchor(txtWarning, 610.0);\n\n anchorPane.setBackground(\n new Background(new BackgroundFill(Color.rgb(0, 132, 0),\n CornerRadii.EMPTY, Insets.EMPTY)));\n\n anchorPane.getChildren().addAll(track, carOne, carTwo, carThree, btnStartRace, btnEndRace, txtWarning);\n\n Scene scene = new Scene(anchorPane, 1580, 1030);\n return scene;\n }",
"public Scene createScene() {\n root = new Group();\n key = new Group();\n Scene scene = new Scene(root, 500, 500, Color.WHITE);\n addRootNode();\n setupKey();\n getAlreadyConnectedPeers();\n return scene;\n }",
"public Livre() {\r\n super();\r\n }",
"public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1078, 672, 1); \n preparePlayer1();\n preparePlayer2();\n prepareTitle();\n //playmusic();\n }",
"public ViewerPosition3D()\n {\n }",
"public World()\n\t{\n\t\tinitWorld();\t\n\t}",
"public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public MainMenu(Game game) {\r\n\t\tsuper(game);\r\n\t}",
"public Movie()\n\t{\n\t\tsuper();\n\t}",
"public ArbolSplay() {\n super();\n }",
"public GameStart() {\n\t\tsuper(\"First 2D Game\");\n\t}",
"public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1000, 600, 1);\n planets();\n stars();\n }",
"public Scene getScene() {\n return null;\n }",
"public Scoreboard() {\n\t}",
"public Game() {\n parser = new Parser();\n }",
"private Game() {}",
"public MainMenu() {\n super();\n }",
"public Player(){\n default_init();\n }",
"public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }",
"public RenderEngine() {\n\t\twindow = Window.getInstance();\n\t\t\n\t\ttestEntity = new Entity(\"skull/skull.obj\", \"./res/models/skull/skull.png\", new Vector3f(0,0,0), new Vector3f(0,0,0));\n\t\ttestEntity.getWorldTransform().setScaling(new Vector3f(0.01f,0.01f,0.01f));\n\t\t\n\t\ttestEntity2 = new Entity(\"dummy/dummy.obj\", \"./res/models/dummy/dummy.jpg\", new Vector3f(0,8,0), new Vector3f(0,0,0));\n\t\ttestEntity2.getWorldTransform().setScaling(new Vector3f(0.05f,0.05f,0.05f));\n\t\t\n\t\ttestLight = new Light(new Vector3f(-5,5,-5), new Vector3f(1,1,1));\n\t\ttestLight.getWorldTransform().setScaling(new Vector3f(0.1f,0.1f,0.1f));\n\t\t\n\t\tsky = new SkyDome();\n\t\t\n\t}",
"public Game() \n {\n Logger.setLogger(null);\n createInstances();\n parser = new Parser();\n player = new Player();\n userInputs = new ArrayList<String>();\n }",
"public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}",
"public void Scene() {\n Scene scene = new Scene(this.root);\n this.stage.setScene(scene);\n this.stage.show();\n }",
"protected WorldController() {\n\t\tthis(new Rectangle(0,0,DEFAULT_WIDTH,DEFAULT_HEIGHT), \n\t\t\t\tnew Vector2(0,DEFAULT_GRAVITY));\n\t}",
"public void create() {\n connect();\n batch = new SpriteBatch();\n font = new BitmapFont();\n\n audioManager.preloadTracks(\"midlevelmusic.wav\", \"firstlevelmusic.wav\", \"finallevelmusic.wav\", \"mainmenumusic.wav\");\n\n mainMenuScreen = new MainMenuScreen(this);\n pauseMenuScreen = new PauseMenuScreen(this);\n settingsScreen = new SettingsScreen(this);\n completeLevelScreen = new CompleteLevelScreen(this);\n completeGameScreen = new CompleteGameScreen(this);\n\n setScreen(mainMenuScreen);\n }",
"public Game() {\n initComponents();\n }",
"public MyWorld()\n { \n super(1200, 600, 1); \n prepare();\n bienvenida();\n instrucciones();\n sonido();\n }",
"public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }",
"public static Scene scene2() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene2\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initAmbient(new Vec(0.4))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game).\r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// Add lighting condition:\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.7));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public OpenGLModel() {\n\n\n\t}",
"public Game() { \n super(1000, 640, 1);\n updateScore(0);\n }",
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}",
"public Viewer() {\r\n\t\tzoom = DEFAULT_ZOOM;\r\n\t\tisWireframe = false;\r\n\t\tisAxes = true;\r\n\t\tnextRotationAngle = 0;\r\n\t\tnextRotationAxis = null;\r\n\t\trotationMatrix = null;\r\n\t\tscreenWidth = 0;\r\n\t\tscreenHeight = 0;\r\n\t}",
"public void init() {\n try {\n java.net.URL codeBase = getCodeBase();\n codeBaseString = codeBase.toString();\n } catch (Exception e) {\n // probably running as an application, try the application\n // code base\n codeBaseString = \"file:./\";\n }\n\n if (colorMode == USE_COLOR) {\n objColor = red;\n } else {\n objColor = white;\n }\n\n Container contentPane = getContentPane();\n\n contentPane.setLayout(new BorderLayout());\n\n GraphicsConfiguration config = SimpleUniverse\n .getPreferredConfiguration();\n\n canvas = new Canvas3D(config);\n\n u = new SimpleUniverse(canvas);\n\n if (isApplication) {\n offScreenCanvas = new OffScreenCanvas3D(config, true);\n // set the size of the off-screen canvas based on a scale\n // of the on-screen size\n Screen3D sOn = canvas.getScreen3D();\n Screen3D sOff = offScreenCanvas.getScreen3D();\n Dimension dim = sOn.getSize();\n dim.width *= OFF_SCREEN_SCALE;\n dim.height *= OFF_SCREEN_SCALE;\n sOff.setSize(dim);\n sOff.setPhysicalScreenWidth(sOn.getPhysicalScreenWidth()\n * OFF_SCREEN_SCALE);\n sOff.setPhysicalScreenHeight(sOn.getPhysicalScreenHeight()\n * OFF_SCREEN_SCALE);\n\n // attach the offscreen canvas to the view\n u.getViewer().getView().addCanvas3D(offScreenCanvas);\n\n }\n contentPane.add(\"Center\", canvas);\n\n // setup the env nodes and their GUI elements\n setupLights();\n setupBackgrounds();\n setupFogs();\n setupSounds();\n\n // Create a simple scene and attach it to the virtual universe\n BranchGroup scene = createSceneGraph();\n\n // set up sound\n u.getViewer().createAudioDevice();\n\n // get the view\n view = u.getViewer().getView();\n\n // Get the viewing platform\n ViewingPlatform viewingPlatform = u.getViewingPlatform();\n\n // Move the viewing platform back to enclose the -4 -> 4 range\n double viewRadius = 4.0; // want to be able to see circle\n // of viewRadius size around origin\n // get the field of view\n double fov = u.getViewer().getView().getFieldOfView();\n\n // calc view distance to make circle view in fov\n float viewDistance = (float) (viewRadius / Math.tan(fov / 2.0));\n tmpVector.set(0.0f, 0.0f, viewDistance);// setup offset\n tmpTrans.set(tmpVector); // set trans to translate\n // move the view platform\n viewingPlatform.getViewPlatformTransform().setTransform(tmpTrans);\n\n // add an orbit behavior to move the viewing platform\n OrbitBehavior orbit = new OrbitBehavior(canvas, OrbitBehavior.STOP_ZOOM);\n orbit.setSchedulingBounds(infiniteBounds);\n viewingPlatform.setViewPlatformBehavior(orbit);\n\n u.addBranchGraph(scene);\n\n contentPane.add(\"East\", guiPanel());\n }",
"public WorldModel(){\t\n\t}",
"public Title()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(PlatformWorld.sWidth, PlatformWorld.sHeight, 1); \n \n addObject(new TitleController(), 0, 0);\n }",
"public Menu() {\n\n\t}",
"public Magazzino() {\r\n }",
"public GUI() {\n }"
] | [
"0.8744955",
"0.7403711",
"0.73830223",
"0.7277493",
"0.7206582",
"0.70307875",
"0.6956487",
"0.6927382",
"0.68551487",
"0.68551487",
"0.6788094",
"0.6737578",
"0.6650923",
"0.6612476",
"0.6607964",
"0.6607015",
"0.65985125",
"0.659602",
"0.6588733",
"0.6577838",
"0.6560686",
"0.6553721",
"0.65508896",
"0.65422827",
"0.65389365",
"0.6495779",
"0.649123",
"0.64861256",
"0.6462001",
"0.6461591",
"0.64568853",
"0.6456609",
"0.6452605",
"0.64485914",
"0.64473885",
"0.6424612",
"0.6418106",
"0.6417505",
"0.6410755",
"0.6403566",
"0.63896906",
"0.63793683",
"0.6369535",
"0.63694507",
"0.63683575",
"0.6368071",
"0.6355435",
"0.6355298",
"0.6352443",
"0.6343945",
"0.63381374",
"0.6336191",
"0.6325464",
"0.6322561",
"0.6318964",
"0.63164043",
"0.63124585",
"0.63093925",
"0.63029987",
"0.6301163",
"0.6299463",
"0.6291411",
"0.6290506",
"0.62904227",
"0.6285387",
"0.6284254",
"0.6283719",
"0.62667817",
"0.62666327",
"0.62619334",
"0.6249062",
"0.62461734",
"0.6237122",
"0.6235925",
"0.6234468",
"0.6232328",
"0.6231686",
"0.62295955",
"0.6225902",
"0.62216467",
"0.6210868",
"0.6204473",
"0.61913925",
"0.6186238",
"0.61834246",
"0.61832404",
"0.6183086",
"0.61774236",
"0.6175838",
"0.6171882",
"0.61698097",
"0.6165454",
"0.61650604",
"0.61631465",
"0.61629564",
"0.61603415",
"0.61597043",
"0.61584896",
"0.6158064",
"0.6155508"
] | 0.648914 | 27 |
Keep track of list of all scene parameters/drawing options | public DoubleParameter addParameter(DoubleParameter p)
{
params.add(p);
return p;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void storeGraphicOptions() {\n\t\ttheGraphicOptions.store(theConfiguration);\n\t}",
"@Override\n\tpublic Object[] getGUIParameters() {\n\t\treturn null;\n\t}",
"public Object[] getOptions(JavaFXGui gui) {\r\n\t\t// Create new object for setup variables\r\n\t\tObject[] setup = new Object[9];\r\n\t\t\r\n\t\t// Add setup variables\r\n\t\tsetup[0] = gui;\r\n\t\tsetup[1] = lengthInput.getText();\r\n\t\tsetup[2] = widthInput.getText();\r\n\t\tsetup[3] = minDurationInput.getText();\r\n\t\tsetup[4] = maxDurationInput.getText();\r\n\t\tsetup[5] = evPercentInput.getText();\r\n\t\tsetup[6] = disabilityPercentInput.getText();\r\n\t\tsetup[7] = getModelSpeed();\r\n\t\tsetup[8] = algorithmChoiceInput.getValue();\r\n\t\t\r\n\t\treturn setup;\r\n\t}",
"private void saveValues() {\r\n this.pl_expert.setParam(\"displayNodeDegree\", (String) this.nodeDegreeSpinner.getValue());\r\n this.pl_expert.setParam(\"displayEdges\", (String) this.displayEdgesSpinner.getValue());\r\n this.pl_expert.setParam(\"scale\", (String) this.scaleSpinner.getValue());\r\n this.pl_expert.setParam(\"minWeight\", (String) this.minweightSpinner.getValue());\r\n this.pl_expert.setParam(\"iterations\", (String) this.iterationsSpinner.getValue());\r\n this.pl_expert.setParam(\"mutationParameter\", this.mutationParameter.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"Update_param\", this.Update_param.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"vote_value\", (String) this.vote_value.getValue());\r\n this.pl_expert.setParam(\"keep_value\", (String) this.keep_value.getValue());\r\n this.pl_expert.setParam(\"mut_value\", (String) this.mut_value.getValue());\r\n this.pl_expert.setParam(\"only_sub\", new Boolean(this.only_sub.isSelected()).toString());\r\n\r\n this.is_alg_started = false;\r\n }",
"public List getValues() {\n/* 103 */ List<ConfigurableEffect.Value> values = super.getValues();\n/* 104 */ values.add(EffectUtil.floatValue(\"Wavelength\", this.wavelength, 1.0F, 100.0F, \"This setting controls the wavelength of the outline. The smaller the value, the more segments will be used to draw the outline.\"));\n/* */ \n/* 106 */ values.add(EffectUtil.floatValue(\"Amplitude\", this.amplitude, 0.5F, 50.0F, \"This setting controls the amplitude of the outline. The bigger the value, the more the zigzags will vary.\"));\n/* */ \n/* 108 */ return values;\n/* */ }",
"public JsonObject getPlotOptions() {\r\n JsonObject plotOptionsObject = Json.createObject(); // create a new object each time\r\n for (ShowOption showOption : ShowOption.values()) {\r\n plotOptionsObject.put(showOption.getShortName(), showOptions.get(showOption));\r\n }\r\n for (String optionKey : booleanOptions.keySet()) {\r\n Option <Boolean> option = booleanOptions.get(optionKey);\r\n plotOptionsObject.put(option.getName(), option.getValue());\r\n }\r\n for (String optionKey : stringOptions.keySet()) {\r\n Option <String> option = stringOptions.get(optionKey);\r\n plotOptionsObject.put(option.getName(), option.getValue());\r\n }\r\n return plotOptionsObject;\r\n }",
"@LabeledParameterized.Parameters\n public static List<Object[]> parameters() {\n List<Object[]> modes = Lists.newArrayList();\n for (TypeOfEventStore typeOfEventStore : TypeOfEventStore.values()) {\n modes.add(Objects.o(typeOfEventStore));\n }\n return modes;\n }",
"public void updateParametersSceneMode() {\n Stringifier stringifier = this.mCameraCapabilities.getStringifier();\n SettingsManager settingsManager = this.mActivity.getSettingsManager();\n this.mSceneMode = stringifier.sceneModeFromString(settingsManager.getString(this.mAppController.getCameraScope(), Keys.KEY_SCENE_MODE));\n if (Keys.isHdrOn(settingsManager) && !isCameraFrontFacing() && isHdrShow()) {\n if (this.mSceneMode != SceneMode.HDR) {\n this.mSceneMode = SceneMode.HDR;\n settingsManager.set(this.mAppController.getCameraScope(), Keys.KEY_SCENE_MODE, this.mCameraCapabilities.getStringifier().stringify(this.mSceneMode));\n }\n } else if (this.mSceneMode == SceneMode.HDR) {\n this.mSceneMode = SceneMode.AUTO;\n settingsManager.set(this.mAppController.getCameraScope(), Keys.KEY_SCENE_MODE, this.mCameraCapabilities.getStringifier().stringify(this.mSceneMode));\n }\n if (!this.mCameraCapabilities.supports(this.mSceneMode)) {\n this.mSceneMode = this.mCameraSettings.getCurrentSceneMode();\n if (this.mSceneMode == null) {\n this.mSceneMode = SceneMode.AUTO;\n }\n } else if (this.mCameraSettings.getCurrentSceneMode() != this.mSceneMode) {\n this.mCameraSettings.setSceneMode(this.mSceneMode);\n if (this.mCameraDevice != null) {\n this.mCameraDevice.applySettings(this.mCameraSettings);\n this.mCameraSettings = this.mCameraDevice.getSettings();\n }\n }\n this.mCameraSettings.setSceneMode(this.mSceneMode);\n updateParametersFlashMode();\n if (SceneMode.AUTO == this.mSceneMode) {\n updateParametersFocusMode();\n } else {\n this.mFocusManager.overrideFocusMode(this.mCameraSettings.getCurrentFocusMode());\n }\n }",
"public void storeCompositionOptions() {\n\t\ttheCompositionOptions.store(theConfiguration);\n\t}",
"public void logParameters() {\n logWriter.add(\"Particle Swarm Optimization Algorithm\");\n logWriter.add(\"Parameters\");\n logWriter.add((String)(\"MAX_LENGTH/N: \"+MAX_LENGTH));\n logWriter.add((String)(\"STARTING_POPULATION: \"+pso.getParticleCount()));\n logWriter.add((String)(\"MAX_EPOCHS: \"+pso.getMaxEpoch()));\n logWriter.add((String)(\"MAX_VELOCITY: \"+pso.getVmax()));\n logWriter.add((String)(\"MINIMUM_SHUFFLES: \"+pso.getShuffleMin()));\n logWriter.add((String)(\"MAXIMUM_SHUFFLES: \"+pso.getShuffleMax()));\n logWriter.add(\"\");\n\t}",
"public Map getParameters();",
"private void getSavedValues() {\r\n\r\n if (this.pl_expert.getParam(\"displayNodeDegree\") != null) {\r\n this.display_node_degree_current = this.pl_expert.getParam(\"displayNodeDegree\");\r\n } else {\r\n this.display_node_degree_current = display_node_degree_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"displayEdges\") != null) {\r\n this.display_edges_current = this.pl_expert.getParam(\"displayEdges\");\r\n } else {\r\n this.display_edges_current = display_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"scale\") != null) {\r\n this.scale_current = this.pl_expert.getParam(\"scale\");\r\n } else {\r\n this.scale_current = scale_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"minWeight\") != null) {\r\n this.minweight_edges_current = this.pl_expert.getParam(\"minWeight\");\r\n } else {\r\n this.minweight_edges_current = minweight_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"iterations\") != null) {\r\n this.iterations_current = this.pl_expert.getParam(\"iterations\");\r\n } else {\r\n this.iterations_current = iterations_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"vote_value\") != null) {\r\n this.vote_value_current = this.pl_expert.getParam(\"vote_value\");\r\n } else {\r\n this.vote_value_current = vote_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"keep_value\") != null) {\r\n this.keepclass_value_current = this.pl_expert.getParam(\"keep_value\");\r\n } else {\r\n this.keepclass_value_current = keepclass_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mut_value\") != null) {\r\n this.mut_value_current = this.pl_expert.getParam(\"mut_value\");\r\n } else {\r\n this.mut_value_current = mut_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mutationParameter\") != null) {\r\n this.mut_option_current = this.pl_expert.getParam(\"mutationParameter\");\r\n } else {\r\n this.mut_option_current = mut_option_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Update_param\") != null) {\r\n this.update_param_current = this.pl_expert.getParam(\"Update_param\");\r\n } else {\r\n this.update_param_current = update_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Alg_param\") != null) {\r\n this.alg_param_current = this.pl_expert.getParam(\"Alg_param\");\r\n } else {\r\n this.alg_param_current = alg_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"only_sub\") != null) {\r\n this.display_sub_current = new Boolean(this.pl_expert.getParam(\"only_sub\")).booleanValue();\r\n } else {\r\n this.display_sub_current = display_sub_default;\r\n }\r\n\r\n this.is_alg_started = false;\r\n }",
"public void properties(){\n setChanged();\n notifyObservers(name);\n System.out.println(\"Name: \" + name);\n System.out.println(\"Formula: \" + FORMULA);\n System.out.println(\"Colour: \" + COLOUR);\n System.out.println(\"Streak: \" + STREAK);\n System.out.println(\"Luster: \" + LUSTER);\n System.out.println(\"Diaphaneity: \" + DIAPHANEITY);\n System.out.println(\"Cleavage: \" + CLEAVAGE);\n System.out.println(\"Crystal system: \" + CRYSTAL_SYSTEM);\n System.out.println(\"Hardness: \" + HARDNESS);\n System.out.println(\"Specific Gravity: \" + SPECIFIC_GRAVITY);\n }",
"private void initSelectedAlgoVisuals()\r\n\t{\r\n\t String searchText = useKDTreeToSearch ? \"Using KDTree for Nearest Neighbour Search\" : \"Using Linear Search for Nearest Neighbour Search\";\r\n\t String hullText = useConcaveHull ? \"Using Concave Hull with digDecider=\"+ConcaveHull.decision : \"Using Convex Hull\";\r\n\t \r\n\t usedAlgorithms.addCodeLine(searchText, null, 0, null);\r\n\t usedAlgorithms.addCodeLine(hullText, null, 0, null);\r\n\t \r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, new Color(100, 200, 100));\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t\tusingRect = lang.newRect(new Offset(-5, -5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_NW), new Offset(10, 5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_SE), \"usingInfoBackground\", null, rectProps);\r\n\t}",
"public void draw(){\n\t\tif(!visible) return;\n\n\t\twinApp.pushStyle();\n\t\twinApp.style(G4P.g4pStyle);\n\t\tPoint pos = new Point(0,0);\n\t\tcalcAbsPosition(pos);\n\n\t\t// Draw selected option area\n\t\tif(border == 0)\n\t\t\twinApp.noStroke();\n\t\telse {\n\t\t\twinApp.strokeWeight(border);\n\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t}\n\t\tif(opaque)\n\t\t\twinApp.fill(localColor.txfBack);\n\t\telse\n\t\t\twinApp.noFill();\n\t\twinApp.rect(pos.x, pos.y, width, height);\n\t\t\n\t\t// Draw selected text\n\t\twinApp.noStroke();\n\t\twinApp.fill(localColor.txfFont);\n\t\twinApp.textFont(localFont, localFont.getSize());\n\t\twinApp.text(text, pos.x + PADH, pos.y -PADV +(height - localFont.getSize())/2, width - 16, height);\n\n\t\t// draw drop down list\n\t\twinApp.fill(winApp.color(255,255));\n\t\tif(imgArrow != null)\n\t\t\twinApp.image(imgArrow, pos.x + width - imgArrow.width - 1, pos.y + (height - imgArrow.height)/2);\n\t\tif(expanded == true){\n\t\t\tGOption opt;\n\t\t\twinApp.noStroke();\n\t\t\twinApp.fill(localColor.txfBack);\n\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\n\t\t\tfor(int i = 0; i < optGroup.size(); i++){\n\t\t\t\topt = optGroup.get(i);\n\t\t\t\tif(i >= startRow && i < startRow + nbrRowsToShow){\n\t\t\t\t\topt.visible = true;\n\t\t\t\t\topt.y = height * (i - startRow + 1);\n\t\t\t\t\topt.draw();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\topt.visible = false;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Draw box round list\n\t\t\tif(border != 0){\n\t\t\t\twinApp.strokeWeight(border);\n\t\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t\t\twinApp.noFill();\n\t\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\t\t\t}\n\t\t\tif(optGroup.size() > maxRows){\n\t\t\t\tslider.setVisible(true);\n\t\t\t\tslider.draw();\n\t\t\t}\n\t\t}\n\t\twinApp.popStyle();\n\t}",
"public void getGUIVALS() {\n MinX = (double) MinXSpin.getValue();\n MaxX = (double) MaxXSpin.getValue();\n MinY = (double) MinYSpin.getValue();\n MaxY = (double) MaxYSpin.getValue();\n Step = (double) StepSpin.getValue();\n ForceRange = ForceRangeBox.isSelected();\n LineColor = LineCC.getColor();\n BackColor = BackGCC.getColor();\n Increments = (int) IncSpin.getValue();\n DrawArea = DrawAreaBox.isSelected();\n DrawScale = DrawScaleBox.isSelected();\n CurveThickness = (float) (double) CurveThicknessSpin.getValue();\n }",
"public void renderScene() {\n\t\tscene.ready=false;\n\t\tscene.num_points=0;\n\t\tscene.num_triangles=0;\n\t\tscene.num_tri_vertices=0;\n\t\tscene.list_of_triangles.clear(); // reset the List of Triangles (for z-sorting purposes)\n\t\tscene.num_objects_visible=0;\n\t\ttotal_cost=0;\n\t\tupdateLighting();\n\t\tfor (int i=0; i<num_vobjects;i++) {\n\t\t\tif (vobject[i].potentially_visible) {\n\t\t\t\tif (checkVisible(i)) {\n\t\t\t\t\tscene.num_objects_visible++;\n\t\t\t\t\tcalculateRelativePoints(i);\n\t\t\t\t\tif (scene.dot_field) {defineDots(i);} \n\t\t\t\t\tif (scene.wireframe) {defineTriangles(i);}\n\t\t\t\t\tif (scene.solid_poly) {defineTriangles(i);}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tif (scene.z_sorted) {Collections.sort(scene.list_of_triangles);}\n\t\tscene.ready=true;\n\t}",
"public void getAllFormFields() {\n// TODOne: Get a single scene as a Models.Scene object\n Models.Scene selectedScene = GameHelper.getInstance(this).getScene(sceneId);\n// Models.Scene selectedScene = allScenesArray[???];\n sceneTitle = selectedScene.title;\n journalText = selectedScene.journalText;\n modifiers = selectedScene.flagModifiers;\n bodyText = selectedScene.body;\n\n\n //TODO: check associated transitions, set Radio button checked based on result, update view\n setRadioButtons(sceneId);\n Models.Transition[] allTransitionsArray = GameHelper.getInstance(this).getTransitionsForScenes(sceneId);\n selectedRadioButtonId = nodeTypeRadioGroup.getCheckedRadioButtonId();\n selectedRadioButton = (RadioButton) findViewById(selectedRadioButtonId);\n if (selectedRadioButton == actionNodeRadioButton) {\n actionOneVerbs = allTransitionsArray[0].verb;\n actionOneFlags = allTransitionsArray[0].flag;\n actionOneToSceneId = allTransitionsArray[0].toSceneID;\n actionTwoVerbs = allTransitionsArray[1].verb;\n actionTwoFlags = allTransitionsArray[1].flag;\n actionTwoToSceneId = allTransitionsArray[1].toSceneID;\n actionThreeVerbs = allTransitionsArray[2].verb;\n actionThreeFlags = allTransitionsArray[2].flag;\n actionThreeToSceneId = allTransitionsArray[2].toSceneID;\n actionFourVerbs = allTransitionsArray[3].verb;\n actionFourFlags = allTransitionsArray[3].flag;\n actionFourToSceneId = allTransitionsArray[3].toSceneID;\n actionFiveVerbs = allTransitionsArray[4].verb;\n actionFiveFlags = allTransitionsArray[4].flag;\n actionFiveToSceneId = allTransitionsArray[4].toSceneID;\n }\n if (selectedRadioButton == autoNodeRadioButton) {\n autoToSceneId = allTransitionsArray[0].toSceneID;\n }\n if (selectedRadioButton == modifierNodeRadioButton) {\n modifierFlags = allTransitionsArray[0].flag;\n modifierPassToSceneId = allTransitionsArray[0].toSceneID;\n modifierFailToSceneId = allTransitionsArray[1].toSceneID;\n }\n //TODO: Check for better space for this?\n setTransitionFormFields();\n }",
"private void settingsScreenRender() {\n overlay.draw(batch, 0.5f);\n uiFont.draw(batch, scoreTxt, 0, HEIGHT - (scoreLayout.height));\n uiFont.draw(batch, healthTxt, WIDTH / 2, HEIGHT - (healthLayout.height));\n musicOn.draw(batch, 1);\n musicOff.draw(batch, 1);\n resume.draw(batch, 1);\n settingStage.draw();\n }",
"public static void saveOptions() {\r\n\t\tMain.bagValue = GameOptions.bagValue.getSelectedItem();\r\n\t\tMain.nilValue = GameOptions.nilValueTextField.getText();\r\n\t\tMain.doubleNilValue = GameOptions.doubleNilValueTextField.getText();\r\n\t\tMain.winScore = GameOptions.winScoreTextField.getText();\r\n\t\tMain.loseScore = GameOptions.loseScoreTextField.getText();\r\n\t}",
"public List<ParameterDefinition> getParameterList() {\n if (this.telemetryName != null) {\n TelemetryChartDefinition teleDef = \n this.getTelemetrys().get(telemetryName);\n if (teleDef == null) {\n TelemetryClient client = ProjectBrowserSession.get().getTelemetryClient();\n try {\n teleDef = client.getChartDefinition(this.telemetryName);\n this.getTelemetrys().put(telemetryName, teleDef);\n return teleDef.getParameterDefinition();\n }\n catch (TelemetryClientException e) {\n this.feedback = \"Exception when retrieving Telemetry chart definition: \" + e.getMessage();\n }\n }\n else {\n return teleDef.getParameterDefinition();\n }\n }\n return new ArrayList<ParameterDefinition>();\n }",
"public Set<Scene> getAllValuesOfscene() {\n return rawStreamAllValuesOfscene(emptyArray()).collect(Collectors.toSet());\n }",
"private void setParameters(ConstMetaData metaData) {\n if (dialog == null) {\n return;\n }\n // Use GPU\n dialog.setUseGpuEnabled(Network.isLocalHostGpuProcessingEnabled(manager, axisID,\n manager.getPropertyUserDir()));\n dialog.setUseGpuSelected(metaData.isDefaultGpuProcessing());\n dialog.setBinning(metaData.getPosBinning(axisID));\n dialog.setSampleThickness(metaData.getSampleThickness(axisID));\n }",
"@Override\n public List<Param<?>> params() {\n return this.settings;\n }",
"public void settings() {\n int widthOfWindow = 900;\n int heightOfWindow = 900;\n\n //Size of the program window\n size(widthOfWindow, heightOfWindow);\n //making the movement smooth, i think, comes from processing\n smooth();\n }",
"public void draw() {\n easyFade();\n\n if(showSettings) \n { \n // updates the kinect raw depth + pixels\n kinecter.updateKinectDepth(true);\n \n // display instructions for adjusting kinect depth image\n instructionScreen();\n\n // want to see the optical flow after depth image drawn.\n flowfield.update();\n }\n else\n {\n // updates the kinect raw depth\n kinecter.updateKinectDepth(false);\n \n // updates the optical flow vectors from the kinecter depth image (want to update optical flow before particles)\n flowfield.update();\n particleManager.updateAndRenderGL();\n }\n}",
"public void updateParameters(){\n\t\tp = RunEnvironment.getInstance().getParameters();\n\t\tmaxFlowerNectar = (double)p.getValue(\"maxFlowerNectar\");\n\t\tlowMetabolicRate = (double)p.getValue(\"lowMetabolicRate\");\n\t\thighMetabolicRate = (double)p.getValue(\"highMetabolicRate\");\n\t\tcolonySize = (int)p.getValue(\"colonySize\");\n\t}",
"public final List<SceneData> allSceneData() {\n ArrayList<SceneData> result = new ArrayList<SceneData>();\n\n for (int i = 0; i < scenes.size(); i++) {\n Scene scene = scenes.get(i);\n if (scene.getDisplayName() == null) {\n scene.setDisplayName(i + 1 + \"\");\n }\n if (scene.getNumber() == null) {\n scene.setNumber(new Integer(i + 1));\n }\n result.add(new SceneData(i + 1, scene, scene == activeScene));\n }\n\n return result;\n }",
"public static void display() { System.err.println(\"Train parameters: smooth=\" + smoothing + \" PA=\" + PA + \" GPA=\" + gPA + \" selSplit=\" + selectiveSplit + \" (\" + selectiveSplitCutOff + (deleteSplitters != null ? \"; deleting \" + deleteSplitters : \"\") + \")\" + \" mUnary=\" + markUnary + \" mUnaryTags=\" + markUnaryTags + \" sPPT=\" + splitPrePreT + \" tagPA=\" + tagPA + \" tagSelSplit=\" + tagSelectiveSplit + \" (\" + tagSelectiveSplitCutOff + \")\" + \" rightRec=\" + rightRec + \" leftRec=\" + leftRec + \" xOverX=\" + xOverX + \" collinsPunc=\" + collinsPunc + \" markov=\" + markovFactor + \" mOrd=\" + markovOrder + \" hSelSplit=\" + hSelSplit + \" (\" + HSEL_CUT + \")\" + \" compactGrammar=\" + compactGrammar() + \" leaveItAll=\" + leaveItAll + \" postPA=\" + postPA + \" postGPA=\" + postGPA + \" selPSplit=\" + selectivePostSplit + \" (\" + selectivePostSplitCutOff + \")\" + \" tagSelPSplit=\" + tagSelectivePostSplit + \" (\" + tagSelectivePostSplitCutOff + \")\" + \" postSplitWithBase=\" + postSplitWithBaseCategory + \" fractionBeforeUnseenCounting=\" + fractionBeforeUnseenCounting + \" openClassTypesThreshold=\" + openClassTypesThreshold); }",
"String getSceneModePref();",
"@Override\n public List<List<Integer>> getStateInfo() {\n List<List<Integer>> currStateConfig = getVisualInfoFromPieces(STATE_INFO_IDENTIFIER);\n return Collections.unmodifiableList(currStateConfig);\n }",
"public void printOptions() {\n\t\t\n\t}",
"public static void saveSoundSelections() {\r\n\t\tMain.soundGameStart = IniSetup.locStart.getSelectedItem();\r\n\t\tMain.soundBags = IniSetup.locBags.getSelectedItem();\r\n\t\tMain.soundSet = IniSetup.locSet.getSelectedItem();\r\n\t\tMain.soundWin = IniSetup.locWin.getSelectedItem();\r\n\t\tMain.soundLose = IniSetup.locLose.getSelectedItem();\r\n\t}",
"private void saveAttributes() {\n o_width = width;\n o_height = height;\n o_fps = fps;\n o_bps = bps;\n o_totalFrames = totalFrames;\n }",
"public void settings() {\n size(640, 384);\n }",
"private void settingsParameters(){\n String settings = Settings.System.getString(context.getContentResolver(), this.watchface+\"Settings\");\n if (settings == null || settings.equals(\"\")) {settings = \"{}\";}\n\n // Extract data from JSON\n JSONObject json_settings;\n try {\n json_settings = new JSONObject(settings);\n\n // Circles Widget\n if (json_settings.has(\"battery\")) {this.batteryBool = json_settings.getBoolean(\"battery\");}\n if (json_settings.has(\"steps\")) {this.stepsBool = json_settings.getBoolean(\"steps\");}\n if (json_settings.has(\"todayDistance\")) {this.todayDistanceBool = json_settings.getBoolean(\"todayDistance\");}\n if (json_settings.has(\"totalDistance\")) {this.totalDistanceBool = json_settings.getBoolean(\"totalDistance\");}\n if (json_settings.has(\"batteryCircle\")) {this.batteryCircleBool = json_settings.getBoolean(\"batteryCircle\");}\n if (json_settings.has(\"stepsCircle\")) {this.stepCircleBool = json_settings.getBoolean(\"stepsCircle\");}\n if (json_settings.has(\"todayDistanceCircle\")) {this.todayDistanceCircleBool = json_settings.getBoolean(\"todayDistanceCircle\");}\n if(isCircles()){\n if(batteryBool){\n\n\n }\n\n }\n\n } catch (JSONException e) {\n //Settings.System.putString(getContentResolver(), this.watchface+\"Settings\", \"{}\");//reset wrong settings data\n }\n }",
"static private void defineSettings()\n {\n //\n // Define the AK settings (parameters) that will be allowed for setting by the Ds effect.\n // Default values are also set here which will be used to initialize new DsAkSettings objects.\n // Settings other than those defined here will not be able to be set in the Ds effect.\n //\n int paramIndex = 0, elemIndex = 0, nElemPerParam = 0, elemLen = 0;\n\n //\n // Get the AK parameter array's total length.\n //\n for (paramIndex = 0; paramIndex < akParams_.length; ++paramIndex)\n {\n if (isParamSettable(akParams_[paramIndex].paramName))\n elemLen += akParams_[paramIndex].len;\n }\n settingsDefaults_ = new int[elemLen];\n\n //\n // Initialise internal collections.\n //\n for (paramIndex = 0; paramIndex < akParams_.length; ++paramIndex)\n {\n if (isParamSettable(akParams_[paramIndex].paramName))\n {\n nElemPerParam = akParams_[paramIndex].len;\n if (nElemPerParam == 1)\n {\n settingsDefinitions_.put(new SettingDefn(paramIndex, 0), elemIndex);\n settingsDefaults_[elemIndex] = 0;\n ++elemIndex;\n }\n else\n {\n for (int i = 0; i < nElemPerParam; ++i)\n {\n settingsDefinitions_.put(new SettingDefn(paramIndex, i), elemIndex);\n settingsDefaults_[elemIndex] = 0;\n ++elemIndex;\n }\n }\n }\n }\n }",
"public Set<Scene> getSceneList(){\n\t\treturn this.sceneList;\n\t}",
"public void viewOptions()\r\n {\r\n SetupScreen setupScreen = new SetupScreen();\r\n pushScreen(setupScreen);\r\n }",
"Map getOptions();",
"final void getParameters()\r\n {\r\n hostName=getParameter(\"hostname\");\r\n\tIPAddress=getParameter(\"IPAddress\");\r\n\tString num=getParameter(\"maxSearch\");\r\n\tString arg=getParameter(\"debug\");\r\n\tserver=getParameter(\"server\");\r\n\tindexName=getParameter(\"indexName\");\r\n\tString colour=getParameter(\"bgColour\");\r\n\r\n\tif(colour==null)\r\n\t{\r\n\t bgColour=Color.lightGray;\r\n }\r\n else\r\n\t{\r\n\t try\r\n\t {\r\n\t bgColour=new Color(Integer.parseInt(colour,16));\r\n\t }\r\n\t catch(NumberFormatException nfe)\r\n\t {\r\n\t bgColour=Color.lightGray;\r\n\t }\r\n\t}\r\n\t\r\n\tcolour=getParameter(\"fgColour\");\r\n\tif(colour==null)\r\n\t{\r\n\t fgColour=Color.black;\r\n\t}\r\n\telse\r\n\t{\r\n\t try\r\n\t {\r\n\t fgColour=new Color(Integer.parseInt(colour,16));\r\n\t }\r\n\t catch(NumberFormatException nfe)\r\n\t {\r\n\t fgColour=Color.black;\r\n\t }\r\n\t}\r\n\r\n\t//Check for missing parameters.\r\n\tif(hostName==null && server==null)\r\n\t{\r\n\t statusArea.setText(\"Error-no host/server\");\r\n\t hostName=\"none\";\r\n\t}\r\n\r\n\tmaxSearch=(num == null) ? MAX_NUMBER_PAGES : Integer.parseInt(num);\r\n }",
"public void getSceneDetails() {\n Intent sceneIntent = getIntent();\n //TODO: set member strings = intent extras\n storyId = sceneIntent.getStringExtra(\"storyId\");\n chapterId = sceneIntent.getStringExtra(\"chapterId\");\n sceneId = sceneIntent.getStringExtra(\"selectedSceneId\");\n\n getAllFormFields();\n\n setSceneFormFields();\n }",
"public GraphicOptions getGraphicOptions() {\n\t\treturn theGraphicOptions;\n\t}",
"public String[] getTrainingSettings();",
"@Override\n public List<cScene> collectScenes() {\n List<Element> eScenes = root.getChild(\"library_visual_scenes\", ns).getChildren(\"visual_scene\", ns);\n List<cScene> scenes = new ArrayList<>();\n\n List<cCamera> cameras = collectCameras();\n List<cLight> lights = collectLights();\n List<cGeometry> geometries = collectGeometry();\n List<cMaterial> materials = collectMaterials();\n\n for (Element eScene : eScenes) {\n\n cScene scene = new cScene(); //<visual_scene>..\n scene.collect(eScene, ns);\n\n for (Element eNode : eScene.getChildren(\"node\", ns)) {\n\n cNode node = new cNode(); //<node>..\n node.collect(eNode, ns);\n\n Element eInstance_Nodes;\n cInstance_Node instance_node = null;\n if ((eInstance_Nodes = eNode.getChild(\"instance_light\", ns)) != null) { //<instance_..>..\n instance_node = new cInstance_Light();\n instance_node.collect(eInstance_Nodes, ns, lights);\n } else if ((eInstance_Nodes = eNode.getChild(\"instance_geometry\", ns)) != null) {\n instance_node = new cInstance_Geometry();\n\n Element eBind_Material;\n if ((eBind_Material = eInstance_Nodes.getChild(\"bind_material\", ns)) != null) {\n List<Element> instance_materials = eBind_Material.getChild(\"technique_common\",ns).getChildren(\"instance_material\",ns);\n\n for (Element eInstMaterial : instance_materials) {\n cInstance_Geometry.Instance_Material instance_material = ((cInstance_Geometry)instance_node).getInstanceMaterial();\n instance_material.collect(eInstMaterial, ns, materials);\n ((cInstance_Geometry)instance_node).boundedMaterials.add(instance_material);\n }\n }\n instance_node.collect(eInstance_Nodes, ns, geometries);\n }\n else if ((eInstance_Nodes = eNode.getChild(\"instance_camera\", ns)) != null) {\n instance_node = new cInstance_Camera();\n instance_node.collect(eInstance_Nodes, ns, cameras);\n }\n node.instanceNode = instance_node;\n scene.nodes.add(node);\n }\n scenes.add(scene);\n }\n\n cameras = null;\n lights = null;\n geometries = null;\n materials = null;\n\n return scenes;\n }",
"private void builder(){\r\n //Objects\r\n //Left\r\n canvasStackPane.setAlignment(Pos.TOP_LEFT);\r\n left1HintButton = new Button(\"Hint\");\r\n left2Button = new Button(\"New Graph\");\r\n left3Button = new Button(\"New GameMode\");\r\n left4Button = new Button(\"New GraphMode\");\r\n left5Button = new Button(\"Finished\");\r\n leftRestLabel = new Label();\r\n //Up\r\n upperLeftButton = new Label(\"Menu\");\r\n upperLeftButton.setAlignment(Pos.CENTER);\r\n upper1Label = new Label();\r\n upper2Label = new Label();\r\n upper3Label = new Label();\r\n upperRestLabel = new Label();\r\n //calculateVectors\r\n backPane.setPickOnBounds(false);\r\n textFieldVertices.setPromptText(\"Vertices\");\r\n textFieldEdges.setPromptText(\"Edges\");\r\n gameEnd.setSpacing(30);\r\n gameEnd.setAlignment(Pos.CENTER);\r\n gameWinStackPane.setAlignment(Pos.CENTER);\r\n hBoxWin.setAlignment(Pos.CENTER);\r\n hBoxWin.setSpacing(30);\r\n canvasStackPane.setPickOnBounds(true);\r\n canvas.setPickOnBounds(true);\r\n canvas.getGraphicsContext2D().setLineWidth(2.5);\r\n }",
"public void settings() {\r\n\t\tthis.size(PlayGame.WIDTH,PlayGame.HEIGHT);\r\n\t}",
"public void printAllScenes() {\r\n\t\tList <Scene> allScenes = handlerBridge.loadScenes();\r\n\t\tfor (Scene scene : allScenes) {\r\n\t\t\tSystem.out.print(\"Name: \" + scene.getName());\r\n\t\t\tSystem.out.println(\" - Ident: \" + scene.getIdentifier());\r\n\t\t}\r\n\t}",
"protected void serializeState() {\n\t\tint ii = 0;\n\t\t\n\t\tfor(GEditorPanel gep : editorPanels) {\n\t\t\tif(gep.getFilePath() != null && gep.getFilePath().length() > 0) {\n\t\t\t\tPreference.PREFERENCES_NODE.put(\"editSession\" + ++ii, gep.getFilePath());\n\t\t\t}\n\t\t}\n\t\t\n\t\tAccessors.INT_ACCESSOR.put(\"numberOfFiles\", ii);\n\t}",
"public Collection<SPParameter> getParameters(){\n return mapOfParameters.values();\n }",
"static synchronized List<Drawing> getAllDrawings() {\r\n return new ArrayList(drawings.values());\r\n }",
"@Override\n\tpublic ParameterSet requiredParameters()\n\t{\n\t\t// Parameter p0 = new\n\t\t// Parameter(\"Dummy Parameter\",\"Lets user know that the function has been selected.\",FormLine.DROPDOWN,new\n\t\t// String[] {\"true\"},0);\n\t\tParameter p0 = getNumThreadsParameter(10, 4);\n\t\tParameter p1 = new Parameter(\"Old Min\", \"Image Intensity Value\", \"0.0\");\n\t\tParameter p2 = new Parameter(\"Old Max\", \"Image Intensity Value\", \"4095.0\");\n\t\tParameter p3 = new Parameter(\"New Min\", \"Image Intensity Value\", \"0.0\");\n\t\tParameter p4 = new Parameter(\"New Max\", \"Image Intensity Value\", \"65535.0\");\n\t\tParameter p5 = new Parameter(\"Gamma\", \"0.1-5.0, value of 1 results in no change\", \"1.0\");\n\t\tParameter p6 = new Parameter(\"Output Bit Depth\", \"Depth of the outputted image\", Parameter.DROPDOWN, new String[] { \"8\", \"16\", \"32\" }, 1);\n\t\t\n\t\t// Make an array of the parameters and return it\n\t\tParameterSet parameterArray = new ParameterSet();\n\t\tparameterArray.addParameter(p0);\n\t\tparameterArray.addParameter(p1);\n\t\tparameterArray.addParameter(p2);\n\t\tparameterArray.addParameter(p3);\n\t\tparameterArray.addParameter(p4);\n\t\tparameterArray.addParameter(p5);\n\t\tparameterArray.addParameter(p6);\n\t\treturn parameterArray;\n\t}",
"private void refreshSettingsFields() {\r\n\t\tif(mediaSrc.getActiveCamera() != null) {\r\n\t\t\txPos.setText(Float.toString(mediaSrc.getActiveCamera().getxPos()));\r\n\t\t\tyPos.setText(Float.toString(mediaSrc.getActiveCamera().getyPos()));\r\n\t\t\tzPos.setText(Float.toString(mediaSrc.getActiveCamera().getzPos()));\r\n\t\t\thOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getHorOrientation()));\r\n\t\t\tvOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getVerOrientation()));\r\n\t\t\tfov.setText(Float.toString(mediaSrc.getActiveCamera().getFov()));\r\n\t\t}\r\n\t\t\r\n\t\txPos.setBackground(Color.WHITE);\r\n\t\tyPos.setBackground(Color.WHITE);\r\n\t\tzPos.setBackground(Color.WHITE);\r\n\t\thOrientation.setBackground(Color.WHITE);\r\n\t\tvOrientation.setBackground(Color.WHITE);\r\n\t\tfov.setBackground(Color.WHITE);\r\n\t}",
"@Override\n public String toString()\n {\n return getClass().getSimpleName() + \": \"\n + \"bounds=\" + bounds + \", isVisible=\" + visible\n + \", color=\" + color;\n }",
"private void saveGraphFilters() {\n hideAllGraphs();\n\n boolean[] graphArr = new boolean[6];\n Arrays.fill(graphArr, Boolean.FALSE);\n\n // Show graphs based on selections\n for (int i = 0; i < mSeletedGraphDialogItems.size(); ++i) {\n\n int index = mSeletedGraphDialogItems.get(i);\n\n graphArr[index] = true;\n\n if (index == 0 && mHeartRateSeries != null && mHeartRateSeries.size() != 0) {\n\n mHeartRateLayout.setVisibility(View.VISIBLE);\n }\n else if (index == 1) {\n\n if ((mREMSeries == null || mREMSeries.size() == 0) && (mLightSeries == null || mLightSeries.size() == 0) &&\n (mDeepSeries == null || mDeepSeries.size() == 0) && (mStillSeries == null || mStillSeries.size() == 0) &&\n (mWalkSeries == null || mWalkSeries.size() == 0) && (mRunSeries == null || mRunSeries.size() == 0) &&\n (mBikeSeries == null || mBikeSeries.size() == 0)) {}\n else {\n\n mActivityTypeLayout.setVisibility(View.VISIBLE);\n }\n }\n else if (index == 2 && mPerspirationSeries != null && mPerspirationSeries.size() != 0) {\n\n mPerspirationLayout.setVisibility(View.VISIBLE);\n }\n else if (index == 3 && mSkinTempSeries != null && mSkinTempSeries.size() != 0) {\n\n mSkinTempLayout.setVisibility(View.VISIBLE);\n }\n else if (index == 4 && mBodyTempSeries != null && mBodyTempSeries.size() != 0) {\n\n mBodyTempLayout.setVisibility(View.VISIBLE);\n }\n else if (index == 5 && mBloodPressureSeriesUpper != null && mBloodPressureSeriesUpper.size() != 0 &&\n mBloodPressureSeriesLower != null && mBloodPressureSeriesLower.size() != 0) {\n\n mBloodPressureLayout.setVisibility(View.VISIBLE);\n }\n }\n\n String saveVal = \"\";\n for (int i = 0; i < 6; ++i) {\n\n if (graphArr[i]) {\n\n saveVal += String.valueOf(i);\n if (i < 5) {\n\n saveVal += \"@\";\n }\n }\n }\n\n // Save the selections into SharedPrefs\n sharedPrefsUtilInst.setDoctorGraphFilter(saveVal);\n }",
"static public void verificaParametros()\r\n \r\n {\r\n SynthesizerModeDesc synthesizerModeDescTemp = (SynthesizerModeDesc)synthesizer.getEngineModeDesc();\r\n System.out.println(\"Nome do engine utilizado: \"+synthesizerModeDescTemp.getEngineName());\r\n System.out.println(\"Nome do modo de funcionamento utilizado: \"+synthesizerModeDescTemp.getModeName());\r\n \tSystem.out.println(\"Nome da localidade utilizada: \"+synthesizerModeDescTemp.getLocale().toString());\r\n \t\t//verifica a flag de controle\r\n if(synthesizerModeDescTemp.getRunning()!=null)\r\n if(synthesizerModeDescTemp.getRunning().booleanValue())\r\n System.out.println(\"Engine rodando.\");\r\n else\r\n System.out.println(\"Engine parado.\");\r\n else\r\n System.out.println(\"A flag de controle não foi setada e tem valor nulo.\");\r\n \t\t//mostra as vozes suportadas\r\n Voice[] VoiceTemp = synthesizerModeDescTemp.getVoices();\r\n for(int i=0;i<VoiceTemp.length;i++)\r\n {\r\n System.out.println(\"Voz numero \"+(i+1)+\" : \"+VoiceTemp[i].getName());\r\n }\r\n }",
"public List getRelevantStateVariables () {\n return relevantStateVariables;\n }",
"public ArrayList getParameters() {\n return parameters;\n }",
"void setParameters() {\n\t\t\n\t}",
"@Override\n\tpublic void settings() {\n\t\tSystem.out.println(\"settings\");\n\t\tsize(800, 800);\n\t}",
"public ArrayList getStages();",
"protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}",
"public Set<VisualizationStyleParameter> getChangedParameterSet()\r\n {\r\n return myChangedParameterSet;\r\n }",
"public interface GameParameters {\n\n\t// Window Settings\n\tpublic static final int WINDOW_WIDTH = 800;\n\tpublic static final int WINDOW_HEIGHT = 600;\n\tpublic static final int FRAME_RATE = 60;\n\n\t// Game States\n\tpublic static final int MAINMENU_STATE = 0;\n\tpublic static final int GAMEPLAY_STATE = 1;\n\tpublic static final int HIGHSCORE_STATE = 2;\n\n\t// Background\n\tpublic static final String BACKGROUND_ID = \"background\";\n\tpublic static final String BACKGROUND_IMAGE = \"/images/background.png\";\n\n\t// Borders\n\tpublic enum BorderType {\n\t\tTOP, LEFT, RIGHT\n\t};\n\n\tpublic static final int BORDER_WIDTH = 6;\n\tpublic static final String TOP_BORDER_ID = \"topBorder\";\n\tpublic static final String LEFT_BORDER_ID = \"leftBorder\";\n\tpublic static final String RIGHT_BORDER_ID = \"rightBorder\";\n\n\t// Blocks\n\tpublic static final String MAP_FILE = \"maps/level1.map\";\n\tpublic static final String BLOCK_1_IMAGE = \"/images/block_1.png\";\n\tpublic static final String BLOCK_2_IMAGE = \"/images/block_2.png\";\n\tpublic static final String BLOCK_3_IMAGE = \"/images/block_3.png\";\n\n\t// Timer\n\tpublic static final String STOP_WATCH_ID = \"stopWatch\";\n\n\t// Ball\n\tpublic static final String BALL_ID = \"ball\";\n\tpublic static final float INITIAL_BALL_SPEED = 0.3f;\n\tpublic static final float SPEEDUP_VALUE = 0.0001f;\n\tpublic static final String BALL_IMAGE = \"/images/ball.png\";\n\n\t// Stick\n\tpublic static final String STICK_ID = \"stick\";\n\tpublic static final float STICK_SPEED = 0.5f;\n\tpublic static final String STICK_IMAGE = \"/images/stick.png\";\n\n\t// Player\n\tpublic static final String PLAYER_ID = \"player\";\n\tpublic static final String NO_LIFE_LEFT = \"noLifeLeft\";\n\n\t// Pause\n\tpublic static final String PAUSE_ID = \"pause\";\n\tpublic static final String PAUSE_IMAGE = \"/images/pause.png\";\n\n\t// Win\n\tpublic static final String WIN_ID = \"win\";\n\n\t// Escape\n\tpublic static final String ESCAPE_ID = \"escape\";\n\n\t// Highscore\n\tpublic static final String HIGHSCORE_FILE = \"highscores/highscore.hsc\";\n}",
"@Override\n public void settings() {\n size(800, 800, P3D);\n }",
"public void editSimulationParameters() {\r\n \t\tdialogFactory.getDialog(new SimulationPanel(model, model, model, this), \"Define Simulation Parameters\");\r\n \t}",
"public Map getParameters() {\r\n\t\treturn parameters;\r\n\t}",
"public void setGuiHashMap() {\n\n gameMap.setGetGuiHashMapParameter(\"author\",\"Default authorName\");\n gameMap.setGetGuiHashMapParameter(\"warn\",\"Default warning\");\n gameMap.setGetGuiHashMapParameter(\"image\",\"Default image\");\n gameMap.setGetGuiHashMapParameter(\"wrap\",\"Default wrapping\");\n gameMap.setGetGuiHashMapParameter(\"scroll\",\"Default scrolling\");\n }",
"@Override\n\tpublic void settings() {\n\t\tpreviewRect = WallGeometry.scaleRectangleRounded(WallGeometry.getInstance().getWallGeometry(), Preview.SCALE);\n\t\tsize(previewRect.width, previewRect.height, P3D);\n\t}",
"private void activeDrawEffects() {\n }",
"private List<SettingItem> generateChildrenSettinItem(Context context, ParameterKey parameterKey) {\n ArrayList arrayList = new ArrayList();\n int n = .$SwitchMap$com$sonyericsson$android$camera$configuration$ParameterKey[parameterKey.ordinal()];\n Object var5_5 = null;\n SelfTimer[] arrselfTimer = null;\n switch (n) {\n case 1: {\n arrselfTimer = this.getFlashOptions();\n Flash flash = super.getCurrentFlashSetting((Flash[])arrselfTimer);\n break;\n }\n case 2: {\n arrselfTimer = SelfTimer.values();\n SelfTimer selfTimer = this.mPhotoSelfTimerSetting;\n }\n }\n if (arrselfTimer != null) {\n for (SelfTimer selfTimer : arrselfTimer) {\n void var5_6;\n SettingItemBuilder<ParameterValue> settingItemBuilder = SettingItemBuilder.build(selfTimer).iconId(selfTimer.getIconId()).textId(selfTimer.getTextId()).dialogItemType(1).executor(super.createSettingChangeExecutor(parameterKey, selfTimer));\n boolean bl = var5_6 == selfTimer;\n arrayList.add((Object)settingItemBuilder.selected(bl).commit());\n }\n return arrayList;\n }\n return arrayList;\n }",
"protected void acceptValuesInInteractiveControlPanel()\n\t{\n\t\tsuper.acceptValuesInInteractiveControlPanel();\n\t\t\n\t\taHat = aHatPanel.getVector3D();\n\t\tuHat = uHatPanel.getVector3D();\n\t\tvHat = vHatPanel.getVector3D();\n\t\tetaU = etaPanel.getVector2D().x;\n\t\tetaV = etaPanel.getVector2D().y;\n\t\tdeltaU = deltaPanel.getVector2D().x;\n\t\tdeltaV = deltaPanel.getVector2D().y;\n\t\t\n\t\tif(apertureParametersTabbedPane.getSelectedComponent().equals(zeroParametersLabel)) alphaChoice = AlphaChoice.ZERO;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(manualParametersPanel)) alphaChoice = AlphaChoice.MANUAL;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(optimisedParametersPanel)) alphaChoice = AlphaChoice.OPTIMISED;\n\n\t\tsigma1U = sigma1Panel.getVector2D().x;\n\t\tsigma1V = sigma1Panel.getVector2D().y;\n\t\tsigma2U = sigma2Panel.getVector2D().x;\n\t\tsigma2V = sigma2Panel.getVector2D().y;\n\t\talpha1U = alpha1Panel.getVector2D().x;\n\t\talpha1V = alpha1Panel.getVector2D().y;\n\t\talpha2U = alpha2Panel.getVector2D().x;\n\t\talpha2V = alpha2Panel.getVector2D().y;\n\t\tpointAtFOVCentre = pointAtFOVCentrePanel.getVector3D();\n//\t\tparallelityParameter = parallelityParameterPanel.getNumber();\n//\t\tJComboBox alphaChoiceComboBox;\n\t\tapertureCentre = apertureCentrePanel.getVector3D();\n\t\tbrightnessFactor = brightnessFactorPanel.getNumber();\n\t}",
"public void showOptions() {\n frame.showOptions();\n }",
"public String getParameters() {\r\n\t\t\r\n\t\tString strLength = String.valueOf(length);\r\n\t\tString strWidth = String.valueOf(width);\r\n\t\tString strHeight = String.valueOf(height);\r\n\t\t\r\n\t\treturn \"Length: \" + strLength + \"\\nWidth: \" + strWidth + \"\\nHeight: \" + strHeight;\r\n\t}",
"protected void init() {\n currentState.bgColor = appliedState.bgColor = gc.getBackground();\n currentState.fgColor = appliedState.fgColor = gc.getForeground();\n currentState.font = appliedState.font = gc.getFont();\n currentState.lineAttributes = gc.getLineAttributes();\n appliedState.lineAttributes = clone(currentState.lineAttributes);\n currentState.graphicHints |= gc.getLineStyle();\n currentState.graphicHints |= gc.getAdvanced() ? ADVANCED_GRAPHICS_MASK\n : 0;\n currentState.graphicHints |= gc.getXORMode() ? XOR_MASK : 0;\n\n appliedState.graphicHints = currentState.graphicHints;\n\n currentState.relativeClip = new RectangleClipping(gc.getClipping());\n currentState.alpha = gc.getAlpha();\n }",
"public void init()\n \t{\n \t\tgdsOutputMergesBoxes.setSelected(getBoolean(gdsOutMergesBoxesSetting));\n \t\tgdsOutputWritesExportPins.setSelected(getBoolean(gdsOutWritesExportPinsSetting));\n \t\tgdsOutputUpperCase.setSelected(getBoolean(gdsOutUpperCaseSetting));\n \t\tgdsDefaultTextLayer.setText(Integer.toString(getInt(gdsOutDefaultTextLayerSetting)));\n gdsOutputConvertsBracketsInExports.setSelected(getBoolean(gdsOutputConvertsBracketsInExportsSetting));\n gdsCellNameLenMax.setText(Integer.toString(getInt(gdsCellNameLenMaxSetting)));\n \n \t\t// build the layers list\n \t\tgdsLayersModel = new DefaultListModel();\n \t\tgdsLayersList = new JList(gdsLayersModel);\n \t\tgdsLayersList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n \t\tgdsLayerList.setViewportView(gdsLayersList);\n \t\tgdsLayersList.clearSelection();\n \t\tgdsLayersList.addMouseListener(new MouseAdapter()\n \t\t{\n \t\t\tpublic void mouseClicked(MouseEvent evt) { gdsClickLayer(); }\n \t\t});\n \t\tfor(Iterator<Technology> it = Technology.getTechnologies(); it.hasNext(); )\n \t\t{\n \t\t\tTechnology tech = it.next();\n \t\t\ttechnologySelection.addItem(new TechGDSTab(tech));\n \t\t}\n \t\ttechnologySelection.addActionListener(new ActionListener()\n \t\t{\n \t\t\tpublic void actionPerformed(ActionEvent evt) { techChanged(); }\n \t\t});\n \t\ttechnologySelection.setSelectedItem(Technology.getCurrent());\n \n foundrySelection.addActionListener(new ActionListener()\n \t\t{\n \t\t\tpublic void actionPerformed(ActionEvent evt) { foundryChanged(); }\n \t\t});\n \n \n // to set foundry the first time\n techChanged();\n \n \t\tGDSDocumentListener myDocumentListener = new GDSDocumentListener(this);\n \t\tgdsLayerNumber.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsLayerType.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsPinLayer.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsPinType.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsTextLayer.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsTextType.getDocument().addDocumentListener(myDocumentListener);\n \t}",
"public String[] getOptions() {\n\t\tString[] EvaluatorOptions = new String[0];\n\t\tString[] SearchOptions = new String[0];\n\t\tint current = 0;\n\n//\t\tif (m_ASEvaluator instanceof OptionHandler) {\n//\t\t\tEvaluatorOptions = ((OptionHandler) m_ASEvaluator).getOptions();\n//\t\t}\n//\n//\t\tif (m_ASSearch instanceof OptionHandler) {\n//\t\t\tSearchOptions = ((OptionHandler) m_ASSearch).getOptions();\n//\t\t}\n\n\t\tString[] setOptions = new String[10];\n//\t\tsetOptions[current++] = \"-E\";\n//\t\tsetOptions[current++] = getEvaluator().getClass().getName() + \" \"\n//\t\t\t\t+ Utils.joinOptions(EvaluatorOptions);\n//\n//\t\tsetOptions[current++] = \"-S\";\n//\t\tsetOptions[current++] = getSearch().getClass().getName() + \" \"\n//\t\t\t\t+ Utils.joinOptions(SearchOptions);\n//\t\t\n\t\t setOptions[current++] = \"-k\";\n\t\t setOptions[current++] = \"\" + getK();\n\t\t setOptions[current++] = \"-p\";\n\t\t setOptions[current++] = \"\" + getminF_Correlation();\n\n\t\twhile (current < setOptions.length) {\n\t\t\tsetOptions[current++] = \"\";\n\t\t}\n\n\t\treturn setOptions;\n\t}",
"private void listParameters(JavaSamplerContext context)\n {\n if (getLogger().isDebugEnabled())\n {\n Iterator argsIt = context.getParameterNamesIterator();\n while (argsIt.hasNext())\n {\n String name = (String) argsIt.next();\n getLogger().debug(name + \"=\" + context.getParameter(name));\n }\n }\n }",
"private void collectValuesForSettings() {\n portColumnsValue = (portColumns.getProgress());\n portRowsValue = (portRows.getProgress());\n landColumnsValue = (landColumns.getProgress());\n landRowsValue = (landRows.getProgress());\n }",
"private void qcomInitPreferences(PreferenceGroup group){\n ListPreference powerMode = group.findPreference(KEY_POWER_MODE);\n ListPreference zsl = group.findPreference(KEY_ZSL);\n ListPreference colorEffect = group.findPreference(KEY_COLOR_EFFECT);\n ListPreference faceDetection = group.findPreference(KEY_FACE_DETECTION);\n ListPreference touchAfAec = group.findPreference(KEY_TOUCH_AF_AEC);\n ListPreference selectableZoneAf = group.findPreference(KEY_SELECTABLE_ZONE_AF);\n ListPreference saturation = group.findPreference(KEY_SATURATION);\n ListPreference contrast = group.findPreference(KEY_CONTRAST);\n ListPreference sharpness = group.findPreference(KEY_SHARPNESS);\n ListPreference autoExposure = group.findPreference(KEY_AUTOEXPOSURE);\n ListPreference antiBanding = group.findPreference(KEY_ANTIBANDING);\n ListPreference mIso = group.findPreference(KEY_ISO);\n ListPreference lensShade = group.findPreference(KEY_LENSSHADING);\n ListPreference histogram = group.findPreference(KEY_HISTOGRAM);\n ListPreference denoise = group.findPreference(KEY_DENOISE);\n ListPreference redeyeReduction = group.findPreference(KEY_REDEYE_REDUCTION);\n ListPreference hfr = group.findPreference(KEY_VIDEO_HIGH_FRAME_RATE);\n ListPreference hdr = group.findPreference(KEY_AE_BRACKET_HDR);\n ListPreference jpegQuality = group.findPreference(KEY_JPEG_QUALITY);\n ListPreference videoSnapSize = group.findPreference(KEY_VIDEO_SNAPSHOT_SIZE);\n ListPreference pictureFormat = group.findPreference(KEY_PICTURE_FORMAT);\n //BEGIN: Added by zhanghongxing at 2013-01-06 for DER-173\n ListPreference videoColorEffect = group.findPreference(KEY_VIDEO_COLOR_EFFECT);\n //END: Added by zhanghongxing at 2013-01-06\n \n \n// ListPreference videoEffect = group.findPreference(KEY_VIDEO_EFFECT);\n\n\n if (touchAfAec != null) {\n filterUnsupportedOptions(group,\n touchAfAec, mParameters.getSupportedTouchAfAec());\n }\n\n if (selectableZoneAf != null) {\n filterUnsupportedOptions(group,\n selectableZoneAf, mParameters.getSupportedSelectableZoneAf());\n }\n\n if (mIso != null) {\n filterUnsupportedOptions(group,\n mIso, mParameters.getSupportedIsoValues());\n }\n\n /* if (lensShade!= null) {\n filterUnsupportedOptions(group,\n lensShade, mParameters.getSupportedLensShadeModes());\n }*/\n\n\t\tif (redeyeReduction != null) {\n filterUnsupportedOptions(group,\n redeyeReduction, mParameters.getSupportedRedeyeReductionModes());\n }\n\n if (hfr != null) {\n filterUnsupportedOptions(group,\n hfr, mParameters.getSupportedVideoHighFrameRateModes());\n }\n\n if (denoise != null) {\n filterUnsupportedOptions(group,\n denoise, mParameters.getSupportedDenoiseModes());\n }\n\n if (pictureFormat != null) {\n // getSupportedPictureFormats() returns the List<Integar>\n // which need to convert to List<String> format.\n List<Integer> SupportedPictureFormatsInIntArray = mParameters.getSupportedPictureFormats();\n List<String> SupportedPictureFormatsInStrArray = new ArrayList<String>();\n for (Integer picIndex : SupportedPictureFormatsInIntArray) {\n SupportedPictureFormatsInStrArray.add(cameraFormatForPixelFormatVal(picIndex.intValue()));\n }\n// if(1 == mParameters.getInt(\"raw-format-supported\")) {\n // getSupportedPictureFormats() doesnt have the support for RAW Pixel format.\n // so need to add explicitly the RAW Pixel Format.\n// SupportedPictureFormatsInStrArray.add(PIXEL_FORMAT_RAW);\n// }\n //BEGIN: Modified by zhanghongxing at 2013-03-12 for FBD-115\n // Remove the picture format.\n // filterUnsupportedOptions(group, pictureFormat, SupportedPictureFormatsInStrArray);\n filterUnsupportedOptions(group, pictureFormat, null);\n //END: Modified by zhanghongxing at 2013-03-12\n }\n\n if (colorEffect != null) {\n filterUnsupportedOptions(group,\n colorEffect, mParameters.getSupportedColorEffects());\n CharSequence[] entries = colorEffect.getEntries();\n if(entries == null || entries.length <= 0 ) {\n filterUnsupportedOptions(group, colorEffect, null);\n }\n }\n\n if (antiBanding != null) {\n filterUnsupportedOptions(group,\n antiBanding, mParameters.getSupportedAntibanding());\n }\n if (autoExposure != null) {\n filterUnsupportedOptions(group,\n autoExposure, mParameters.getSupportedAutoexposure());\n }\n if (!mParameters.isPowerModeSupported())\n {\n filterUnsupportedOptions(group,\n videoSnapSize, null);\n }else{\n filterUnsupportedOptions(group, videoSnapSize, sizeListToStringList(\n mParameters.getSupportedPictureSizes()));\n }\n if (histogram!= null) {\n filterUnsupportedOptions(group,\n histogram, mParameters.getSupportedHistogramModes());\n }\n\n if (hdr!= null) {\n// filterUnsupportedOptions(group,\n// hdr, mParameters.getSupportedAEBracketModes());\n }\n\n //BEGIN: Added by zhanghongxing at 2013-01-06 for DER-173\n if (videoColorEffect != null) {\n //BEGIN: Modified by zhanghongxing at 2013-04-09 for FBD-722/723\n //Remove the front camera video color effect.\n filterUnsupportedOptions(group,\n videoColorEffect, mParameters.getSupportedColorEffects());\n CharSequence[] entries = videoColorEffect.getEntries();\n if(entries == null || entries.length <= 0 ) {\n filterUnsupportedOptions(group, videoColorEffect, null);\n }\n //END: Modified by zhanghongxing at 2013-04-09\n }\n //END: Added by zhanghongxing at 2013-01-06\n \n// if (videoEffect != null) {\n// filterUnsupportedOptions(group,\n// \t\tvideoEffect, mParameters.getSupportedColorEffects());\n// } \n }",
"@Override\n\tpublic String[] getOptions() {\n\t\tVector<String> result = new Vector<String>();\n\n\t\tresult.add(\"-populationSize\");\n\t\tresult.add(\"\" + populationSize);\n\n\t\tresult.add(\"-initialMaxDepth\");\n\t\tresult.add(\"\" + maxDepth);\n\n\t\tCollections.addAll(result, super.getOptions());\n\n\t\treturn result.toArray(new String[result.size()]);\n\t}",
"protected void updateFlags() {\n USE_CANNY = USE_CANNY && mainInterface.DEBUG_FRAME;\n DEBUG_PREP_FRAME = DEBUG_PREP_FRAME && mainInterface.DEBUG_FRAME;\n DEBUG_CONTOURS = DEBUG_CONTOURS && mainInterface.DEBUG_FRAME;\n DEBUG_POLY = DEBUG_POLY && mainInterface.DEBUG_FRAME;\n DEBUG_DRAW_MARKERS = DEBUG_DRAW_MARKERS && mainInterface.DEBUG_FRAME;\n DEBUG_DRAW_MARKER_ID = DEBUG_DRAW_MARKER_ID && mainInterface.DEBUG_FRAME;\n DEBUG_DRAW_SAMPLING = DEBUG_DRAW_SAMPLING && mainInterface.DEBUG_FRAME;\n }",
"public Parameters getConfigParameters();",
"@Override\n\tpublic ArrayList<Shape3D> display() {\n\t\treturn list;\n\t}",
"private boolean canViewOptions() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n || uiStateManager.getState().equals(GameUIState.STANDBY);\n }",
"List<PowreedCommandParameter> getParameters();",
"private void applyOpenGLStartSettings(){\r\n\t\t//TODO pa.smooth() / pa.noSmooth() ver�ndert auch line_smooth!\r\n\t\t//f�r test ob multisampling lines ohne Line_smooth okay rendered m�ssen\r\n\t\t//sicherheitshalber auch die pa.smoot() etc abgefangen werden und line_smooth immer disabled sein!\r\n\t\t\r\n\t\t//TODO check line drawing and abstractvisible at stencil in this context (line_smooth)\r\n\t\t\r\n\t //TODO \r\n\t\t// - if multisampling enabled dont do line smoothing at all\r\n\t\t// - OR: disable multisampling each time before doing line_smoothing! (better but expensive?) \r\n\t\t// -> info: disabling multisampling isnt possible at runtime..\r\n\r\n\t // - or disable mutisample before drawing with line_smooth!\r\n\t\t//TOOD dont use lines to smooth some objects then (fonts, etc)\r\n\t if (MT4jSettings.getInstance().isOpenGlMode() ){\r\n\t \t\r\n\t \t//////////////////////////////\r\n\t \tthis.loadGL();\r\n\t //////////////////////////\r\n\t \r\n//\t \tGL gl = Tools3D.getGL(this);\r\n\t GLCommon gl = getGLCommon();\r\n\t \t\r\n\t \tlogger.info(\"OpenGL Version: \\\"\" + gl.glGetString(GL.GL_VERSION) + \"\\\"\" + \" - Vendor: \\\"\" + gl.glGetString(GL.GL_VENDOR) + \"\\\"\" + \" - Renderer: \\\"\" + gl.glGetString(GL.GL_RENDERER) + \"\\\"\");\r\n//\t \tlogger.info(\"Shading language version: \\\"\" + gl.glGetString(GL.GL_SHADING_LANGUAGE_VERSION) + \"\\\"\");\r\n\t \tlogger.info(\"Non power of two texture sizes allowed: \\\"\" + Tools3D.supportsNonPowerOfTwoTexture(this) + \"\\\"\");\r\n\t \tlogger.info(\"OpenGL Framebuffer Object Extension available: \\\"\" + GLFBO.isSupported(this) + \"\\\"\");\r\n\t \t\r\n\t\t\t//Set VSyncing on -> to avoid tearing \r\n\t\t\t//-> check if gfx card settings allow apps to set it!\r\n\t\t\t//-> Use with caution! only use with fps rate == monitor Hz!\r\n\t\t\t//and fps never drop below Hz! -> else choppy!\r\n\t\t\t//-> only works with opengl!\r\n\t \tTools3D.setVSyncing(this, MT4jSettings.getInstance().isVerticalSynchronization());\r\n\t\t\tlogger.info(\"Vertical Sync enabled: \\\"\" + MT4jSettings.getInstance().isVerticalSynchronization() + \"\\\"\");\r\n\t \t\r\n\t \tif ( MT4jSettings.getInstance().isMultiSampling()){\r\n\t \t\tgl.glEnable(GL.GL_MULTISAMPLE);\r\n//\t \t\tgl.glDisable(GL.GL_MULTISAMPLE);\r\n\t \t\tlogger.info(\"OpenGL multi-sampling enabled.\");\r\n\t \t}\r\n\t \tgl.glEnable(GL.GL_LINE_SMOOTH);\r\n//\t \tgl.glDisable(GL.GL_LINE_SMOOTH);\r\n\t }\r\n\t}",
"public void displayAllWaves(){\r\n // System.out.println(\"showing waves:\"+wave1.size());\r\n\r\n //we start by clearing anything we have drawn previously\r\n gc.clearRect(0, 0, canvas.widthProperty().intValue(), canvas.heightProperty().intValue());\r\n gc.setFill(backgroundColour);\r\n gc.fillRect(0, 0, canvas.widthProperty().intValue(), canvas.heightProperty().intValue());\r\n //then we draw the grid mentioned previously\r\n drawGrid();\r\n\r\n drawTriggerVoltage();\r\n\r\n drawCursors();\r\n\r\n if(showWave1) {\r\n //we then start drawing the first wave in red\r\n displayWave(wave1, wave1Colour);\r\n }\r\n\r\n if(showWaveMath){\r\n\r\n }\r\n\r\n }",
"public void setDefaultParameters() {\n\tsetParameterValue(\"genie.param.x\",\"genie.dfwx\");\n\tsetParameterValue(\"genie.param.x.begin\",\"-0.3\");\n\tsetParameterValue(\"genie.param.x.increment\",\"0.6\");\n\tsetParameterValue(\"genie.param.x.increment.type\",\"linear\");\n\tsetParameterValue(\"genie.param.x.end\",\"0.3\");\n\tsetParameterValue(\"genie.param.y\",\"genie.dfwy\");\n\tsetParameterValue(\"genie.param.y.begin\",\"-0.3\");\n\tsetParameterValue(\"genie.param.y.increment\",\"0.6\");\n\tsetParameterValue(\"genie.param.y.increment.type\",\"linear\");\n\tsetParameterValue(\"genie.param.y.end\",\"0.3\");\n\tsetParameterValue(\"genie.nsteps\",\"1001\");\n\tsetParameterValue(\"genie.npstp\",\"1000\");\n\tsetParameterValue(\"genie.iwstp\",\"1000\");\n\tsetParameterValue(\"genie.itstp\",\"10\");\n\tsetParameterValue(\"genie.restart\",\"n\");\n\tsetParameterValue(\"genie.tv\",\"3.65\");\n\tsetParameterValue(\"genie.ndta\",\"5\");\n\tsetParameterValue(\"genie.temp0\",\"5.0\");\n\tsetParameterValue(\"genie.temp1\",\"5.0\");\n\tsetParameterValue(\"genie.rel\",\"0.9\");\n\tsetParameterValue(\"genie.scf\",\"2.0\");\n\tsetParameterValue(\"genie.diff1\",\"2000.0\");\n\tsetParameterValue(\"genie.diff2\",\"1e-5\");\n\tsetParameterValue(\"genie.adrag\",\"2.5\");\n\tsetParameterValue(\"genie.diffamp1\",\"8111000\");\n\tsetParameterValue(\"genie.diffamp2\",\"79610\");\n\tsetParameterValue(\"genie.betaz1\",\"0.1111\");\n\tsetParameterValue(\"genie.betam1\",\"0.0\");\n\tsetParameterValue(\"genie.betaz2\",\"0.2626\");\n\tsetParameterValue(\"genie.betam2\",\"0.2626\");\n\tsetParameterValue(\"genie.scl_co2\",\"1.0\");\n\tsetParameterValue(\"genie.pc_co2_rise\",\"0.0\");\n\tsetParameterValue(\"genie.diffsic\",\"2000.0\");\n\tsetParameterValue(\"genie.tatm\",\"0.0\");\n\tsetParameterValue(\"genie.relh0_ocean\",\"0.0\");\n\tsetParameterValue(\"genie.relh0_land\",\"0.0\");\n\tsetParameterValue(\"genie.dfwx\",\"0.0\");\n\tsetParameterValue(\"genie.dfwy\",\"0.0\");\n\tsetParameterValue(\"genie.lout\",\"0000\");\n\tsetParameterValue(\"genie.lin\",\"0000.1\");\n }",
"public static void resetParams()\n {\n Debug = false;\n SpecOption = false;\n MyspecOption = false;\n Spec2Option = false;\n Myspec2Option = false;\n SpecFile = \"\";\n WriteASTFlag = false;\n LabelFlag = false;\n ReportLabelsFlag = false;\n LabelRoot = \"Lbl_\";\n FairnessOption = \"\";\n FairAlgorithm = false;\n CheckTermination = false;\n NoOld = false;\n Nocfg = false;\n NoDoneDisjunct = false;\n optionsInFile = false;\n versionOption = null;\n inputVersionNumber = PcalParams.versionWeight;\n PcalTLAGen.wrapColumn = 78;\n PcalTLAGen.ssWrapColumn = 45;\n tlaPcalMapping = null ;\n \n }",
"public SettingsSaver() {\n set[0] = advModeUnlocked;\n set[1] = LIM_NOTESPERLINE;\n set[2] = LIM_96_MEASURES;\n set[3] = LIM_VOLUME_LINE;\n set[4] = LIM_LOWA;\n set[5] = LIM_HIGHD;\n set[6] = LOW_A_ON;\n set[7] = NEG_TEMPO_FUN;\n set[8] = LIM_TEMPO_GAPS;\n set[9] = RESIZE_WIN;\n set[10] = ADV_MODE;\n }",
"@Override\n public void addAdditionalConfig(List<String> list, boolean visible_only) {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) getRTComponent().rc; RTGraphComponent mycomp = (RTGraphComponent) getRTComponent();\n list.add(\"#AC extents|\" + extents.getX() + \"|\" + extents.getY() + \"|\" + extents.getWidth() + \"|\" + extents.getHeight());\n // Save the retained nodes\n if (retained_nodes.size() > 0) {\n StringBuffer sb = new StringBuffer();\n Iterator<String> it = retained_nodes.iterator();\n sb.append(\"#AC retain\"); while (it.hasNext()) sb.append(\"|\" + Utils.encToURL(it.next()));\n list.add(sb.toString());\n }\n // Save the sticky labels\n if (mycomp.sticky_labels != null && mycomp.sticky_labels.size() > 0) {\n StringBuffer sb = new StringBuffer(); \n Iterator<String> it = mycomp.sticky_labels.iterator();\n sb.append(\"#AC sticky\"); while (it.hasNext()) sb.append(\"|\" + Utils.encToURL(it.next()));\n list.add(sb.toString());\n }\n // Pick out the right iterator -- if the visible one is available, use that\n Iterator<String> it;\n if (visible_only && myrc != null) it = myrc.entity_counter_context.binIterator();\n else it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n String entity = it.next(); Point2D point = entity_to_wxy.get(entity);\n list.add(\"#AC wxy|\" + Utils.encToURL(entity) + \"|\" + point.getX() + \"|\" + point.getY());\n }\n list.add(\"#AC graphend\");\n }",
"Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n return world.keySet();\n }",
"public void editPAParameters() {\r\n \t\tdialogFactory.getDialog(new ParametricAnalysisPanel(model, model, model, this), \"Define What-if analysis parameters\");\r\n \t}",
"public static int getDrawingTool(){ return selectedDrawingTool; }",
"protected void setPaintAllCmd(){\n System.out.println(\"GralCurveView.Info - paintallTrigger;\");\n bPaintAllCmd = true; //used in implementation level to force a paint of the whole curves.\n widgg.bNewGetVariables= true; //used to get faulty variables newly with an error message.\n }",
"private void initialParameters()\n\t{\n\t\tasteroidList = new ArrayList<Asteroid>();\n\t\tfor(int i = 0 ; i < INITIAL_ASTEROIDS ; i++)\n\t\t\tasteroidList.add(new Asteroid(getRandomLocationX(), getRandomLocationY(), SCREEN_WIDTH, SCREEN_HEIGHT));\n\t\t\n\t\t//========== Game Status ===========\n\t\trunning \t= true;\n\t\tisWin \t\t= false;\n\t\tisGameOver \t= false;\n\t\t\n\t\t//========== Game Craft ===========\t\t\n\t\tcraft = new Craft(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT);\n\t}",
"@Override\r\n\tpublic void setParameterValuesToGUI() {\r\n\t\tthis.pb = this.workPackage.getParameters();\r\n\r\n\t\tjSpinnerLeft.removeChangeListener(this);\r\n\t\tjSpinnerRight.removeChangeListener(this);\r\n\t\tjSpinnerTop.removeChangeListener(this);\r\n\t\tjSpinnerBottom.removeChangeListener(this);\r\n\t\tjSpinnerConst.removeChangeListener(this);\r\n\r\n\t\tjSpinnerLeft.setValue(pb.getIntParameter(\"Left\"));\r\n\t\tjSpinnerRight.setValue(pb.getIntParameter(\"Right\"));\r\n\t\tjSpinnerTop.setValue(pb.getIntParameter(\"Top\"));\r\n\t\tjSpinnerBottom.setValue(pb.getIntParameter(\"Bottom\"));\r\n\t\tjSpinnerConst.setValue(pb.getIntParameter(\"Const\"));\r\n\r\n\t\tjSpinnerLeft.addChangeListener(this);\r\n\t\tjSpinnerRight.addChangeListener(this);\r\n\t\tjSpinnerTop.addChangeListener(this);\r\n\t\tjSpinnerBottom.addChangeListener(this);\r\n\t\tjSpinnerConst.addChangeListener(this);\r\n\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pb.getIntParameter(\"NewWidth\"));\r\n\t\tjSpinnerNewHeight.setValue(pb.getIntParameter(\"NewHeight\"));\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.ZERO) buttZero.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.CONSTANT) buttConst.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.COPY) buttCopy.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.REFLECT) buttReflect.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.WRAP) buttWrap.setSelected(true);\r\n\r\n\t\tif (buttConst.isSelected()) {\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_BORDER) buttBorder.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_SIZE) buttSize.setSelected(true);\r\n\r\n\t}",
"public void initializeSelectionArray(){\n\t\ttry{Element root = new XmlReader().parse(Gdx.files.internal(xmlFile));\n\t\tElement artist = root.getChildByName(formatName(game.getArtist()));\n\t\tElement quesNum = artist.getChildByName(Integer.toString(game.getQuestion()));\n\t\tArray<Element> answerE = quesNum.getChildrenByName(\"Option\");\n//\t\tint count = answerE.size;\n//\t\tanswers = new String[count];\n\t\tfor (int i = 0; i <answerE.size; i++){\n//\t\t\tModify to add to the two lists\n//\t\t\tDelete the reference to the answers array\n//\t\t\tanswers[i]=answerE.get(i).getText();\n\t\t\t\n\t\t\toptions.add(answerE.get(i).getText());\n\t\t\toptionsList.add(answerE.get(i).getText());\n\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t}\n\t}",
"public GameProperty [] getGameProperties() {\n return this.GameProperties;\n }",
"public void options() {\n\n audio.playSound(LDSound.SMALL_CLICK);\n if (canViewOptions()) {\n Logger.info(\"HUD Presenter: options\");\n uiStateManager.setState(GameUIState.OPTIONS);\n }\n }"
] | [
"0.62950355",
"0.56076133",
"0.5398669",
"0.5343056",
"0.52796376",
"0.5257195",
"0.5241212",
"0.52181226",
"0.5183786",
"0.5064259",
"0.5062933",
"0.5055271",
"0.50493616",
"0.5037967",
"0.5037182",
"0.50367934",
"0.5032682",
"0.5024071",
"0.5018956",
"0.5017277",
"0.50159365",
"0.5006915",
"0.50001276",
"0.49995732",
"0.498789",
"0.49869835",
"0.49770454",
"0.49721318",
"0.49438164",
"0.49145794",
"0.49096957",
"0.4908069",
"0.49078846",
"0.48971054",
"0.48958394",
"0.4894434",
"0.4878546",
"0.48753905",
"0.48728487",
"0.4861132",
"0.48605734",
"0.4856274",
"0.48560697",
"0.48513928",
"0.48438132",
"0.4843729",
"0.48403773",
"0.48349395",
"0.4832811",
"0.48316526",
"0.48301408",
"0.4828561",
"0.48280334",
"0.4819555",
"0.4810046",
"0.48075426",
"0.48027965",
"0.4801879",
"0.47939655",
"0.4786749",
"0.47844946",
"0.47650343",
"0.4761557",
"0.47554037",
"0.47551286",
"0.47529057",
"0.47507113",
"0.47418332",
"0.47380042",
"0.47366294",
"0.4736155",
"0.47311538",
"0.4726833",
"0.47251225",
"0.47210222",
"0.47100565",
"0.47071326",
"0.46946374",
"0.46928993",
"0.46920913",
"0.46906248",
"0.46885735",
"0.46885136",
"0.46835482",
"0.46824384",
"0.46800682",
"0.46799377",
"0.46755588",
"0.46754977",
"0.46718144",
"0.46685046",
"0.46674705",
"0.4666327",
"0.46651137",
"0.46613172",
"0.46494216",
"0.464679",
"0.46440578",
"0.4632613",
"0.46273953",
"0.46271843"
] | 0.0 | -1 |
Reset all shape parameters to default values | public void reset()
{
Iterator i;
i = params.iterator();
while (i.hasNext()) {
((Parameter)i.next()).reset();
}
i = options.iterator();
while (i.hasNext()) {
((Parameter)i.next()).reset();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void reset() {\n darkSquare.reset();\n lightSquare.reset();\n background.reset();\n border.reset();\n showCoordinates.setSelected(resetCoordinates);\n pieceFont.reset();\n }",
"public void setDefaultParameters() {\n\t\toptions = 0;\n\t\toutBits = null;\n\t\ttext = new byte[0];\n\t\tyHeight = 3;\n\t\taspectRatio = 0.5f;\n\t}",
"public void reset() {\r\n reset(params);\r\n }",
"public void reset() {\n xmin = Float.MAX_VALUE;\n xmax = -Float.MAX_VALUE;\n ymin = Float.MAX_VALUE;\n ymax = -Float.MAX_VALUE;\n zmin = Float.MAX_VALUE;\n zmax = -Float.MAX_VALUE;\n }",
"public void reset() {\n\t\t// set any default values\n\t\t// setDefaultController() ???\n\t}",
"private void reset() {\n \n ((Shape3D)((Group)model).getChildren().get(0)).setMaterial(red);\n ((Shape3D)((Group)model).getChildren().get(1)).setMaterial(blue);\n \n }",
"public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}",
"public void reset(){\n\t\tthis.setPosition(DEFAULT_X, DEFAULT_Y);\t\n\t\tsetBounds(getX(), getY(), getDefaultWidth(), getHeight());\n\t\tcollisionBounds.setWidth(defaultWidth);\n\t\tspeed = 400;\n\t\tsetGlue(true);\n\t}",
"public void reset() {\n x = random(-2*width, 3*width); // set the x position\n y = random(-height, 2*height); // set the y position\n c[0] = color(random(150, 255), random(150, 255), random(150, 255)); // set the top color (a bit lighter)\n // randomly set the 4 colors in the base of the shape\n for (int i=1; i<5; i++) {\n c[i] = color(random(255), random(255), random(255)); // random RGB color\n }\n }",
"public void reset(Parameters params) {\r\n pui.resetParameters();\r\n for (String name : params.getSchema().parameterNames()) {\r\n ParameterSchema schema = params.getSchema().getDetails(name);\r\n Object defVal = schema.getDefaultValue();\r\n if (name.equals(ParameterConstants.DEFAULT_RANDOM_SEED_USAGE_NAME) && defVal.equals(Parameters.NULL)) {\r\n int val = (int) System.currentTimeMillis();\r\n // per JIRA 76 - \"Use positive default random seeds\"\r\n if (val < 0) val = Math.abs(val);\r\n params.setValue(ParameterConstants.DEFAULT_RANDOM_SEED_USAGE_NAME, val);\r\n } else {\r\n if (!defVal.equals(Parameters.NULL)) {\r\n params.setValue(name, defVal);\r\n }\r\n }\r\n }\r\n }",
"public void clearVars() {\n setLatitude (FLOATNULL);\n setLongitude (FLOATNULL);\n setDepth (FLOATNULL);\n setTemperatureMin (FLOATNULL);\n setTemperatureMax (FLOATNULL);\n setSalinityMin (FLOATNULL);\n setSalinityMax (FLOATNULL);\n setOxygenMin (FLOATNULL);\n setOxygenMax (FLOATNULL);\n setNitrateMin (FLOATNULL);\n setNitrateMax (FLOATNULL);\n setPhosphateMin (FLOATNULL);\n setPhosphateMax (FLOATNULL);\n setSilicateMin (FLOATNULL);\n setSilicateMax (FLOATNULL);\n setChlorophyllMin (FLOATNULL);\n setChlorophyllMax (FLOATNULL);\n }",
"private void resetParams() {\n lowerYear = 1999;\n upperYear = 2020;\n yearRestriction = false;\n\n lowerProblem = 1;\n upperProblem = 60;\n problemRestriction = false;\n partTwo = false;\n }",
"public void reset() {\r\n minX = null;\r\n maxX = null;\r\n minY = null;\r\n maxY = null;\r\n\r\n minIn = null;\r\n maxIn = null;\r\n\r\n inverted = false;\r\n }",
"protected void resetParams() {\n\t\treport.report(\"Resetting Test Parameters\");\n\t\t// numberOfRecoverys = 0;\n\t\tstreams = new ArrayList<StreamParams>();\n\t\tlistOfStreamList = new ArrayList<ArrayList<StreamParams>>();\n\t}",
"private void initializeShapeConfig(TypedArray attributes) {\n defaultShapeKey =\n attributes.getInteger(R.styleable.nox_shape, ShapeFactory.FIXED_CIRCULAR_SHAPE_KEY);\n }",
"public static void resetParams()\n {\n Debug = false;\n SpecOption = false;\n MyspecOption = false;\n Spec2Option = false;\n Myspec2Option = false;\n SpecFile = \"\";\n WriteASTFlag = false;\n LabelFlag = false;\n ReportLabelsFlag = false;\n LabelRoot = \"Lbl_\";\n FairnessOption = \"\";\n FairAlgorithm = false;\n CheckTermination = false;\n NoOld = false;\n Nocfg = false;\n NoDoneDisjunct = false;\n optionsInFile = false;\n versionOption = null;\n inputVersionNumber = PcalParams.versionWeight;\n PcalTLAGen.wrapColumn = 78;\n PcalTLAGen.ssWrapColumn = 45;\n tlaPcalMapping = null ;\n \n }",
"private void resetParameters() {\n\t\twKeyDown = false;\n\t\taKeyDown = false;\n\t\tsKeyDown = false;\n\t\tdKeyDown = false;\n\t\tmouseDown = false;\n\t\t// reset mouse\n\t\tMouse.destroy();\n\t\ttry {\n\t\t\tMouse.create();\n\t\t} catch (LWJGLException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t// resets the player's hp\n\t\tplayer.setHP(1000);\n\t\t// resets the player's position\n\t\tplayer.setX(initPlayerX);\n\t\tplayer.setY(initPlayerY);\n\t\t// the game is not over\n\t\tgameOver = false;\n\t\tstopDrawingPlayer = false;\n\t\tgameWon = false;\n\t\t// clears the entity arraylists\n\t\tenemy.clear();\n\t\tbullet.clear();\n\t\tenemy_bullet.clear();\n\t\tpowerup.clear();\n\t\texplosion.clear();\n\t\t// cash and totalCash are 0\n\t\tcash = 0;\n\t\ttotalCash = 0;\n\t\t// bullet is activated, upgraded weapons are not activated\n\t\tbulletShot = true;\n\t\tdoubleShot = false;\n\t\tlaserShot = false;\n\t\t// boss\n\t\tbossSpawned = false;\n\t\tbossMovement = 3;\n\t\tbossExplosionNum = 0;\n\t}",
"public void SetDefaultParams() {\n OCCwrapJavaJNI.BRepAlgo_NormalProjection_SetDefaultParams(swigCPtr, this);\n }",
"@Override\n public void resetAllValues() {\n }",
"public void setParametersToDefaultValues()\n/* 65: */ {\n/* 66:104 */ super.setParametersToDefaultValues();\n/* 67:105 */ this.placeholder = _placeholder_DefaultValue_xjal();\n/* 68: */ }",
"public void setDefaultParameters()\n {\n parameters = new Vector(); // must do this to clear any old parameters\n\n Parameter parameter = new Parameter( \"DataSet to Divide\",\n DataSet.EMPTY_DATA_SET );\n addParameter( parameter );\n\n parameter = new Parameter( \"Create new DataSet?\", new Boolean(false) );\n addParameter( parameter );\n }",
"public final synchronized void reset() {\n\t\tnumTypes = numCoords = 0;\n\t}",
"public void reset(){\n star.clear();\n planet.clear();\n }",
"public void assignShape() {\n\t\t\n\t}",
"public void reset(){\n x = originalX;\n y = originalY;\n dx = originalDX;\n dy = originalDY;\n }",
"public void defaultVar(ArrayCanvas canvas) {\t\t\r\n\t\tcanvas.annotations.clear();\r\n\t\tcanvas.repaint();\r\n\t}",
"public void reset() {\n\t\tx = 0;\n\t\ty = 0;\n\t\tdir = -90;\n\t\tcoul = 0;\n\t\tcrayon = true;\n\t\tlistSegments.clear();\n \t}",
"void clearShapeMap();",
"private void reset() {\n\t availableInputs = new HashSet<String>(Arrays.asList(INPUT));\n\t requiredOutputs = new HashSet<String>(Arrays.asList(OUTPUT));\n\t updateInputAndOutput(availableInputs, requiredOutputs);\n\t}",
"public void clearShapes() {\n\t\tcollectionOfNodes.clear();\n\t}",
"public void reset() {\n\t\tbg = TetrisDefaults.BGColor;\n\t\ttext = TetrisDefaults.TEXTColor;\n\t\tz = TetrisDefaults.ZColor;\n\t\ts = TetrisDefaults.SColor;\n\t\tleft = TetrisDefaults.LEFTColor;\n\t\tright = TetrisDefaults.RIGHTColor;\n\t\tline = TetrisDefaults.LINEColor;\n\t\ttri = TetrisDefaults.TRIANGLEColor;\n\t\tsquare = TetrisDefaults.SQUAREColor;\n\t\tflash = TetrisDefaults.FLASHColor;\n\t}",
"public void resetPose() {\n }",
"public static void reset(){\r\n\t\tx=0;\r\n\t\ty=0;\r\n\t}",
"public static void reset(){\n breedToShapeMapping = null;\n contents = null;\n \n pages.clear();\n speciesMap.clear();\n blocks.clear();\n constraintsMap.clear();\n BlockData.reset();\n }",
"private void reset(){\n locationFieldX.setText(\"0.00\");\n locationFieldY.setText(\"0.00\");\n locationFieldZ.setText(\"0.00\");\n rotationFieldX.setText(\"0.00\");\n rotationFieldY.setText(\"0.00\");\n rotationFieldZ.setText(\"0.00\");\n scaleField.setText(\"1.00\");\n \n setObjects();\n setImage();\n }",
"public void resetVariables() {\n\t\tArrays.fill(variables, 0.0);\n\t}",
"protected void resetInternalState() {\n setStepStart(null);\n setStepSize(minStep.multiply(maxStep).sqrt());\n }",
"void clearTypedParameters();",
"public void reset() {\n\t\tpos.tijd = 0;\r\n\t\tpos.xposbal = xposstruct;\r\n\t\tpos.yposbal = yposstruct;\r\n\t\tpos.hoek = Math.PI/2;\r\n\t\tpos.start = 0;\r\n\t\topgespannen = 0;\r\n\t\tpos.snelh = 0.2;\r\n\t\tbooghoek = 0;\r\n\t\tpos.geraakt = 0;\r\n\t\tgeraakt = 0;\r\n\t\t\r\n\t}",
"public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }",
"public void zeroValues()\n {\n fx = 0.0f;\n fy = 0.0f;\n fz = 0.0f;\n magnitude = 0.0f;\n }",
"@Override\r\n\tpublic void reset() {\r\n\t\tsuper.reset();\r\n\t\tresetMomentObservation();\r\n\t\texpectations.reset();\r\n\t}",
"public void fillDefaultValues() {\n checkUsingAdaptation();\n tfSemiSaturation.setText(Double.toString(prototypeRule\n .getSemiSaturationConstant()));\n tfSteepness.setText(Double.toString(prototypeRule.getSteepness()));\n tfTimeConstant\n .setText(Double.toString(prototypeRule.getTimeConstant()));\n tsNoise.setSelected(prototypeRule.getAddNoise());\n tsUseAdaptation.setSelected(prototypeRule.getUseAdaptation());\n tfAdaptationTime.setText(Double.toString(prototypeRule\n .getAdaptationTimeConstant()));\n tfAdaptationParam.setText(Double.toString(prototypeRule\n .getAdaptationParameter()));\n randTab.fillDefaultValues();\n }",
"@Override\r\n protected void clearSettings() {\r\n \r\n mfile = null;\r\n rmode = null;\r\n cmap = null;\r\n cmapMin = 0.0f;\r\n cmapMax = 0.0f;\r\n super.clearSettings();\r\n \r\n }",
"private void setDefaultValues() {\r\n this.nodeDegreeSpinner.setValue(display_node_degree_default);\r\n this.displayEdgesSpinner.setValue(display_edges_default);\r\n this.scaleSpinner.setValue(scale_default);\r\n this.minweightSpinner.setValue(minweight_edges_default);\r\n this.iterationsSpinner.setValue(iterations_default);\r\n this.vote_value.setValue(vote_value_default);\r\n this.mut_value.setValue(mut_value_default);\r\n this.keep_value.setValue(keepclass_value_default);\r\n\r\n this.only_sub.setSelected(display_sub_default);\r\n this.top.setSelected(true);\r\n this.continuous.setSelected(true);\r\n this.dec.setSelected(true);\r\n this.vote_value.setEnabled(false);\r\n this.is_alg_started = false;\r\n }",
"public void reset() {\n points.reset();\n paintPolygon = false;\n paintResult = false;\n repaint();\n }",
"protected void reset() {\n\t\tpush();\n\n\t\t// Clearen, en niet opnieuw aanmaken, om referenties elders\n\t\t// in het programma niet corrupt te maken !\n\t\tcurves.clear();\n\t\tselectedCurves.clear();\n\t\thooveredCurves.clear();\n\t\tselectedPoints.clear();\n\t\thooveredPoints.clear();\n\t\tselectionTool.clear();\n\t}",
"public void reset() {\n\t\tmodelVertices.clear();\n\t\ttextureVertices.clear();\n\t\tnormalVertices.clear();\n\t\tgroups.clear();\n\t\tsegments.clear();\n\t\tDebug.info(\"Jay3dModel\",\"OBJModel is empty\");\n\t}",
"void reset()\n {\n reset(values);\n }",
"protected void reset() {\r\n super.reset();\r\n this.ring = null;\r\n }",
"private void reset(){\n plotValues.clear();\n xLabels.clear();\n }",
"void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }",
"public void reset()\n {\n reset(this.map, this.heuristic, this.neighborSelector);\n }",
"private void resetAll() {\n\t\tif(mu1 != null)\n\t\t\tmodel.getView().reset(mu1);\n\t\tmu1 = null;\n\t\t\n\t\tif(mu2 != null)\n\t\t\tmodel.getView().reset(mu2);\n\t\tmu2 = null;\n\t\t\n\t\tif(functionWord != null)\n\t\t\tmodel.getView().reset(functionWord);\n\t\tfunctionWord = null;\n\t\t\n\t\tmodel.getSGCreatingMenu().reset();\n\t}",
"public void setToOriginals(){\n\t\t//set all occupied nodes as empty\n\t\tif(nodeStatus == Status.occupied){\n\t\t\tsetAsEmpty();\n\t\t}\n\t\t//if the node had a unit end on it, reset that value\n\t\tif(ended == true){\n\t\t\tended=false;\n\t\t}\n\t\tf=0;\n\t\tg=0;\n\t\th=0;\n\t}",
"public void clearParams() {\n setParams((String[]) null);\n }",
"public void reset()\n\t{\n\t\tassociations = new Vector<Association>();\n\t\tif(hotspots != null)\n\t\t{\n\t\t\tfor(int i=0; i < hotspots.size(); i++)\n\t\t\t{\n\t\t\t\thotspots.elementAt(i).bound = null;\n\t\t\t\thotspots.elementAt(i).setHighlighted(false);\n\t\t\t}\n\t\t}\n\n\t\tif(movableObjects != null)\n\t\t{\n\t\t\tfor(int i=0; i < movableObjects.size(); i++)\n\t\t\t{\n\t\t\t\tmovableObjects.elementAt(i).resetPos();\n\t\t\t\tmovableObjects.elementAt(i).bound = null;\n\t\t\t}\n\t\t}\n\t\tuser_responses=0;\n\t\tmov = null;\n\t\tstart = null;\n\t\tmpos = null;\n\t\tsetFeedback();\n\t\trepaint();\n\t}",
"public void reset() {\n super.reset();\n }",
"public void resetValues() {\n\t\tJavaValue[] publicJavaValues = this.publicVariables.values().toArray(new JavaValue[this.publicVariables.size()]);\n\t\tJavaValue[] privateJavaValues = this.privateVariables.values().toArray(new JavaValue[this.privateVariables.size()]);\n\n\t\tfor(int i = 0; i < publicJavaValues.length; i++) {\n\t\t\tpublicJavaValues[i].reset();\n\t\t}\n\n\t\tfor(int i = 0; i < privateJavaValues.length; i++) {\n\t\t\tprivateJavaValues[i].reset();\n\t\t}\n\t}",
"public void resetNodes() {\n\tmaxX = -100000;\n\tmaxY = -100000;\n\tminX = 100000;\n\tminY = 100000;\n\taverageX = 0;\n\taverageY = 0;\n }",
"public void reset() {\n\t\tvar.clear();\n\t\tname.clear();\n\t}",
"protected void reset() {\n leftSkier.reset();\n rightSkier.reset();\n }",
"public void Reset(){\n py = 0f;\n }",
"public static void reset() {\n\t\tbat1.reset();\n\t\tbat2.reset();\n\t\tball.reset();\n\t}",
"public void reset(){\r\n \tdefaultFlag = false;\r\n }",
"protected void initialize() {\r\n x = 0;\r\n y = 0;\r\n driveTrain.reInit();\r\n }",
"public void reset() {\n delta = 0.0;\n solucionActual = null;\n mejorSolucion = null;\n solucionVecina = null;\n iteracionesDiferenteTemperatura = 0;\n iteracionesMismaTemperatura = 0;\n esquemaReduccion = 0;\n vecindad = null;\n temperatura = 0.0;\n temperaturaInicial = 0.0;\n tipoProblema = 0;\n alfa = 0;\n beta = 0;\n }",
"public void reset() {\n\t\tmCenterOfProjection = new Vector3f(0, 0, 15);\n\t\tmLookAtPoint = new Vector3f(0, 0, 0);\n\t\tmUpVector = new Vector3f(0, 1, 0);\n\t\tmCameraMatrix = new Matrix4f();\n\t\tthis.update();\n\t}",
"public void clear() {\n \tthis.listShapes.clear();\n }",
"@Override\n public void reset() {\n this.posx = 0;\n this.posy = 0;\n this.rad = 0;\n this.property = new Property();\n this.property.setColor(new Color(Color.BLUE));\n }",
"public void reset(){\r\n\t\tSystem.out.println(\"(EnigmaMachine) Initial Positions: \" + Arrays.toString(initPositions));\r\n\t\trotors.setPositions(initPositions);\r\n\t}",
"TwoDShape5() {\n width = height = 0.0;\n }",
"public void reset()\t{\n\t\tthis.snake.clear();\r\n\t\tdir = 1;\r\n\t\tthis.snake.add(new Dimension(2,5));\r\n\t\tthis.snake.add(new Dimension(2,6));\r\n\t\tthis.snake.add(new Dimension(2,7));\r\n\t}",
"protected void clear() {\r\n setValue(getDefault());\r\n }",
"public void reset() {\n\n\t}",
"private void reset()\r\n\t{\r\n\t\t\r\n\t\toriginDock = null;\r\n\t\tdraggedDockable = null;\r\n\r\n\t}",
"public void reset() {\n\t\treset(false);\n\t\tGraphvizUtils.setDotExecutable(null);\n\t}",
"public void reset() {\r\n textArea1.appendText(\"\\n --- Setting all \" + name + \" variables to null\");\r\n textArea1.setForeground(Color.red);\r\n \r\n\r\n Enumeration enum2 = variableList.elements() ;\r\n while(enum2.hasMoreElements()) {\r\n RuleVariable temp = (RuleVariable)enum2.nextElement() ;\r\n temp.setValue(null) ;\r\n }\r\n }",
"public void resetWorkspace() {\n //clear all pages and their drawers\n //clear all drawers and their content\n //clear all block and renderable block instances\n workspace.reset();\n //clear procedure output information\n ProcedureOutputManager.reset();\t//*****\n\n }",
"public void resetAll() {\n Random random = new Random();\r\n for (int layer = 0; layer < neurons.length; layer++) {\r\n for (int index = 0; index < neurons[layer].length; index++) {\r\n neurons[layer][index] = new Neuron(random.nextDouble());\r\n }\r\n }\r\n for (int layer = 0; layer < connections.length; layer++) {\r\n for (int startIndex = 0; startIndex < connections[layer].length; startIndex++) {\r\n for (int endIndex = 0; endIndex < connections[layer][startIndex].length; endIndex++) {\r\n connections[layer][startIndex][endIndex] = new Connection(random.nextDouble()*10-5, random.nextDouble()*10-5);\r\n }\r\n }\r\n }\r\n }",
"private void reset() {\n\t\tfiles = new HashMap<>();\n\t\tparams = new HashMap<>();\n\t}",
"public void reset() {\n _oldColorBuffer = _oldNormalBuffer = _oldVertexBuffer = _oldInterleavedBuffer = null;\n Arrays.fill(_oldTextureBuffers, null);\n }",
"public void fillShape(Shape shape);",
"protected void reset()\n {\n this.shapeDataCache.removeAllEntries();\n this.sector = null;\n }",
"public void resetGraph(){\n removeAllSeries();\n removeSeries(xySeries);\n removeSeries(currentPoint);\n xySeries = new PointsGraphSeries<>();\n currentPoint = new PointsGraphSeries<>();\n initGraph();\n }",
"private void initDefaults() {\n _nodeFadeSourceColor = _defNodeFadeSourceColor;\n _nodeFadeDestinationColor = _defNodeFadeDestinationColor;\n\n _nodeStrokeSourceColor = _defNodeStrokeSourceColor;\n _nodeStrokeDestinationColor = _defNodeStrokeDestinationColor;\n\n _nodeStrokeSourceWidth = _defNodeStrokeSourceWidth;\n _nodeStrokeDestinationWidth = _defNodeStrokeDestinationWidth;\n\n _supportEdgeFadeSourceColor = _defSupportEdgeFadeSourceColor;\n _supportEdgeFadeDestinationColor = _defSupportEdgeFadeDestinationColor;\n\n _refuteEdgeFadeSourceColor = _defRefuteEdgeFadeSourceColor;\n _refuteEdgeFadeDestinationColor = _defRefuteEdgeFadeDestinationColor;\n\n _edgeStrokeSourceWidth = _defEdgeStrokeSourceWidth;\n _edgeStrokeDestinationWidth = _defEdgeStrokeDestinationWidth;\n\n _curvedLines = _defCurvedLines;\n\n _manualBackgroundColor = _defManualBackgroundColor;\n\n _realTimeSliderResponse = _defRealTimeSliderResponse;\n }",
"public static void reset() {\r\n\t\t// System.out.println(\"ExPar.reset()\");\r\n\t\t// new RuntimeException().printStackTrace();\r\n\t\truntimePars.clear();\r\n\t\tresetValues();\r\n\t\tGlobalAssignments.exec();\r\n\t}",
"private void resetAll() {\n resetResources();\n resetStory();\n refresh();\n }",
"public void resetModel() {\n\t\twhitePieces.removeAll();\n\t\tblackPieces.removeAll();\n\t\tcapturedPieces.removeAll(capturedPieces);\n\t\tmoveList.removeAll(moveList);\n\n\t\tinitializeBoard();\n\t\tpopulateLists();\n\t}",
"public void reset() {\n initBody();\n }",
"protected abstract void setShapes();",
"public void reset(){\n\n boxPositions = new HashMap<>();\n boxWeights = new ArrayList<Stack<Box>>();\n for(int i = 0; i < 16; i++) {\n boxPositions.put(i*40, i);\n }\n for ( int i = 0; i < 16; i++){\n boxWeights.add( new Stack< Box >());\n }\n boxGen = new BoxGenerator();\n\n timeCounter = 100;\n mc.resetLazarusPosition();\n\n }",
"public void reset ()\n\t{\n\t\t//The PaperAirplane and the walls (both types) use their reconstruct ()\n\t\t//method to set themselves back to their starting points.\n\t\tp.reconstruct ();\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i].reconstruct ();\n\t\t\n\t\tfor (int i = 0; i < sW.length; i++)\n\t\t\tsW[i].reconstruct ();\n\t\t\t\n\t\t//the time is reset using the resetTime () method from the Timer class.\n\t\ttime.resetTime ();\n\t\t\n\t\t//the score is reset using the reconstruct method from the Score class.\n\t\tscore.reconstruct ();\n\t\t\n\t\t//The following variables are set back to their original values set in\n\t\t//the driver class.\n\t\ttimePassed = 0;\t\n\t\tnumClicks = 0;\n\t\teventFrame = 0;\n\t\tlevel = 1;\n\t\txClouds1 = 0;\n\t\txClouds2 = -500;\n\t\tyBkg1 = 0;\n\t\tyBkg2 = 600;\t\t\n\t}",
"public void reset(){\n\t\tfrogReposition();\n\t\tlives = 5;\n\t\tend = 0;\n\t}",
"public void setToDefault();",
"private void reset() {\n // Init-values\n for (int i = 0; i < cells.length; i++) {\n cells[i] = 0;\n }\n\n // Random colors\n for (int i = 0; i < colors.length; i++) {\n colors[i] = Color.color(Math.random(), Math.random(), Math.random());\n }\n\n // mid = 1.\n cells[cells.length / 2] = 1;\n\n // Clearing canvas\n gc.clearRect(0, 0, canvasWidth, canvasHeight);\n }",
"private void setDefaultMode(GlobalState gs) {\n center = gs.cnt;\n double diagonal = gs.vDist * cos(gs.phi);\n double z = sin(gs.phi) * gs.vDist;\n double x = diagonal * cos(gs.theta);\n double y = diagonal * sin(gs.theta);\n \n eye = new Vector(x, y, z);\n \n }",
"public void reset() {\n // corresponding function called in the Board object to reset piece\n // positions\n board.reset();\n // internal logic reset\n lastColor = true;\n gameOver = false;\n opponentSet = false;\n }",
"public void reset()\r\n {\r\n gameBoard.reset();\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard.reset();\r\n }",
"public void reset() {\n\t\t\t\t\r\n\t\t\t}"
] | [
"0.66723007",
"0.6617755",
"0.6610432",
"0.64456916",
"0.64159554",
"0.6400285",
"0.63674754",
"0.6365657",
"0.63283694",
"0.6310529",
"0.6291282",
"0.6268583",
"0.6267599",
"0.6256641",
"0.6255057",
"0.6206461",
"0.6196378",
"0.6185788",
"0.6161746",
"0.6144888",
"0.61365646",
"0.6130664",
"0.6114044",
"0.61067486",
"0.61038315",
"0.61036557",
"0.6098944",
"0.6085227",
"0.608449",
"0.6067538",
"0.6061387",
"0.6040784",
"0.6036317",
"0.6025486",
"0.6017788",
"0.60124266",
"0.5988067",
"0.59815556",
"0.59782505",
"0.5968931",
"0.59631854",
"0.5952969",
"0.5950656",
"0.59427917",
"0.5941176",
"0.59286535",
"0.59002817",
"0.5894333",
"0.58634245",
"0.5849299",
"0.5839673",
"0.5836645",
"0.5828013",
"0.5822702",
"0.5820672",
"0.5813031",
"0.58120084",
"0.5807218",
"0.58021826",
"0.57990974",
"0.5797044",
"0.57966316",
"0.57916814",
"0.57844",
"0.5781311",
"0.57756335",
"0.5772961",
"0.5772839",
"0.57617277",
"0.5758324",
"0.5754069",
"0.57509995",
"0.57473934",
"0.57461905",
"0.5746143",
"0.5742644",
"0.5740659",
"0.5739603",
"0.5739399",
"0.57350576",
"0.5732493",
"0.5731756",
"0.57195103",
"0.5715417",
"0.57152766",
"0.57131755",
"0.5712902",
"0.57082236",
"0.5704879",
"0.57010293",
"0.5700741",
"0.5695853",
"0.569278",
"0.56919146",
"0.56911683",
"0.5691044",
"0.5689719",
"0.567267",
"0.56714505",
"0.56687516"
] | 0.663738 | 1 |
Get current frame number | public int getFrameNumber()
{
return frameNumber;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getFrame()\n\t{\n\t\treturn currFrame;\n\t}",
"int getFrame() {\n return currFrame;\n }",
"public int getFrame() {\r\n return frame;\r\n }",
"public int FrameIndex() {\r\n return frameIndex;\r\n }",
"public int getFrameID() {\n\t\treturn frameNumber;\n\t}",
"public void incrementFrameNumber()\n {\n\tframeNumber++;\n }",
"public int getFrames() {\r\n return frames;\r\n }",
"public int getPageFrameNum(PageFrame pageFrame) {\n int frameNumber = -1;\n for (int x = 0; x < 16; x++) {\n if (ram[x][0] == pageFrame) {\n frameNumber = x;\n }\n }\n return frameNumber;\n }",
"int getNumberFrames();",
"public int getKeyFrame() {\n return keyFrame;\n }",
"public int getFrameCount() {\n return frameCount;\n }",
"public BufferedImage getCurrentFrame(){\n\t\tif(first)\n\t\t\treturn animation_frame[index];\n\t\telse\n\t\t\treturn animation_frame[0];\n\t\t\n\t}",
"void setCurrentFrame(int frameNum) {\n this.currFrame = frameNum;\n }",
"public String getCalledNumber() throws FrameException {\n try {\n byte data[] = (byte[])infoElements.get(new Integer(InfoElement.CALLED_NUMBER));\n return new String(data);\n } catch (Exception e) {\n throw new FrameException(e);\n }\n }",
"public int getCurrentNumber()\r\n\t{\r\n\t\treturn currentNumber;\r\n\t}",
"int getFramesCount();",
"public String getCarFrameNum() {\n\t\treturn carFrameNum;\n\t}",
"public static int getFreeFrame(){\n\t\tint frameNo = -1;\n\t\tfor(int i=0;i<memory_fmbv.length;i++){\n\t\t\tif(memory_fmbv[i] == 0){\n\t\t\t\tframeNo = i;\n\t\t\t\tmemory_fmbv[i] = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn frameNo;\n\t}",
"public void setFrame(int value) {\r\n this.frame = value;\r\n }",
"public int[] getFrameSequence() {\n return frameSequence;\n }",
"public static int getTimeFrames() {\n return Atlantis.getBwapi().getFrameCount();\n }",
"public int getMaxFrameNumber() {\r\n return rotationFrames.size() - 1;\r\n }",
"public int getCurrentFaceNumber() {\n\t\treturn currentFaceNumber;\n\t}",
"public Texture getCurrentFrame(){\n\t\treturn images[currentFrame];\n\t}",
"private Frame getCurrentFrame() {\n\t\treturn null;\r\n\t}",
"public Frame currentFrame() {\n\t\treturn current;\n\t}",
"int getCurrentTrackNumber() {\n return currentTrackNumber;\n }",
"protected int getFramesPased() {\r\n\t\treturn framesPassed;\r\n\t}",
"private BufferedImage getCurrentAnimationFrame() {\n\t\treturn mainMenuAnimation.getCurrentFrame();\n\t\t\n\t}",
"void accessFrame(Buffer frame) {\r\n\r\n\t\t\t// For demo, we'll just print out the frame #, time &\r\n\t\t\t// data length.\r\n\r\n\t\t\tlong t = (long)(frame.getTimeStamp()/10000000f);\r\n\r\n\t\t\tStdout.log(\"Pre: frame #: \" + frame.getSequenceNumber() + \r\n\t\t\t\t\t\", time: \" + ((float)t)/100f + \r\n\t\t\t\t\t\", len: \" + frame.getLength());\r\n\t\t}",
"public String getCallingNumber() throws FrameException {\n try {\n byte data[] = (byte[])infoElements.get(new Integer(InfoElement.CALLING_NUMBER));\n return new String(data);\n } catch (Exception e) {\n throw new FrameException(e);\n }\n }",
"public TextureRegion getCurrentFrame() {\n stateTime += Gdx.graphics.getDeltaTime();\n return animation.getKeyFrame(stateTime, loop);\n }",
"public int pickVictim() {\r\n\t\t\r\n\t\tfor(int counter = 0; counter < numberOfFrame * 2; counter++) {\r\n\r\n\t\t\tif(frametab[current].getPageId().pid==INVALID_PAGEID)\r\n\t\t\t//if(frametab[current].getValid())\r\n\t\t\t{\r\n\t\t\t\tavailFrame = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(frametab[current].getPinCount() == 0) {\r\n\t\t\t\tif(frametab[current].getRef() == true) {\r\n\t\t\t\t\tframetab[current].setRef(false);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tavailFrame = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcurrent = (current + 1) % numberOfFrame;\r\n\r\n\t\t} // End for loop\r\n\t\t\r\n\t\tif(availFrame == false)\r\n\t\t\tthrow new IllegalStateException(\"No available Frame.\");\r\n\t\t\r\n\t\treturn current; \r\n\t}",
"Frame getFrame();",
"public String getCurrentFrameName()\n\t{\n\t\tJavascriptExecutor jsExecutor = (JavascriptExecutor)driver;\n\t\treturn (jsExecutor.executeScript(\"return self.name\")).toString();\n\t}",
"Integer getFrameRate() {\n return frameRate;\n }",
"public int getCurIdx() {\n\t\treturn dDisplay.getCurIdx();\n\t}",
"public String getTimeframe() {\n return this.timeframe;\n }",
"public JFrame getCurrentFrame() {\n\t\treturn currentFrame;\n\t}",
"public void nextFrame() {\r\n if (frame < maxFrames - 1) {\r\n frame++;\r\n } else {\r\n frame = 0;\r\n }\r\n }",
"public int GetCurrentTrack();",
"public int getFrameLimit() {\n\t\treturn frameLimit;\n\t}",
"public int getCurrentX() {\n return currentX;\n }",
"private void selectFrame()\n\t{\n\t\t// Increment the animation frame\n\t\tif ((long) Game.getTimeMilli() - frameStart >= interval)\n\t\t{\n\t\t\tsetFrame(currFrame+1);\n\t\t}\n\t\t// Get the path to the current frame's image\n\t\tsetFramePath();\n\t\t// If the image frame doesn't exist...\n\t\tif (!GraphicsManager.getResManager().resExists(currFramePath))\n\t\t{\n\t\t\tif (isLooping())\n\t\t\t{\n\t\t\t\tsetFrame(1);\n\t\t\t\tsetFramePath();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisFinished = true;\n\t\t\t}\n\t\t}\n\t}",
"public MemoryFrame referenceMemoryFrame(Integer num)\n {\n Collection<MemoryFrame> frameCollection = frames.values();\n MemoryFrame frame = null;\n \n for (MemoryFrame f : frameCollection) {\n if (f.getFrameNumber() == (int) num) {\n frame = frames.remove((Long) f.getLastAccessed());\n break;\n }\n }\n \n long time = System.nanoTime();\n frame.setLastAccessed(time);\n \n frames.put((Long) time, frame);\n \n return frame;\n }",
"public CyFrame captureCurrentFrame() throws IOException{\n\t//\tCyNetwork currentNetwork = Cytoscape.getCurrentNetwork();\n\t\tCyFrame frame = new CyFrame(bundleContext);\n\n\t/*\tCyApplicationManager appManager = (CyApplicationManager) getService(CyApplicationManager.class);\n\t\tCyNetworkView networkView = appManager.getCurrentNetworkView(); */\n\t\n\t\t//extract view data to make the frame\n\t\tframe.populate(); \n\t\n\t\t//set the interpolation count, or number of frames between this frame and the next to be interpolated\n\t\tframe.setInterCount(fps);\n\t\n\t\t//frame.setID(networkView.getIdentifier()+\"_\"+frameid);\n\t\t//System.out.println(\"Frame ID: \"+frameid);\n\t\n\t\t//capture an image of the frame\n\t\tframe.captureImage();\n\t\n\t\t//frameid++;\n\t\n\t\treturn frame;\n\t\n\t}",
"public int getCurrentLine() {\n return buffer.lineNumber();\n }",
"public static final native int getCurrent();",
"public int getBegin() {\r\n return (event.getStartTime() - 6) * PIXELS_PER_HOUR;\r\n }",
"public static int getCurrentStepNumber() {\n return threadStepNumber.get();\n }",
"public int getFrameInterval() {\n if (mPresentationEngine == null) {\n return 0;\n }\n return mPresentationEngine.getFrameInterval();\n }",
"public ImageIdentifier getImageIdentifier() {\n synchronized (this.imageLock) {\n return this.animation.getCurrentImage();\n }\n }",
"@XmlElement(name = \"numberOfFrames\")\n public int getNumberOfFramesSerialize() {\n return timeManager.numberOfFrames;\n }",
"private AnimFrame getFrame(final int index) {\n\t\treturn (AnimFrame)frames.get(index);\n\t}",
"int animationId();",
"public int getAnimation() {\n\t\t\treturn animation;\n\t\t}",
"private int currentPosition() {\n return robot.leftBack.getCurrentPosition();\n }",
"public int getCurrentIdx() {\n\t\treturn this.currentIdx;\n\t}",
"public int getCurrentPosition(){\n return Integer.parseInt(currentPosition);\n }",
"public int getCurrentIdx() {\n\t\treturn currentIdx;\n\t}",
"public double getFrameTime() {\n\n\t\t// Convert from milliseconds to seconds\n\t\treturn getInteger(ADACDictionary.FRAME_TIME) / 1000;\n\n\t}",
"public int getFrameLength() {\n return frameLength;\n }",
"public ChessFrame getFrame()\n {\n return frame;\n }",
"public int getTargetFPS() {\r\n return fps;\r\n }",
"public int getCurrentCounter() {\n return currentCounter;\n }",
"public double getCurrentTime() {\n\t\tif (playing)\n\t\t\treturn (System.nanoTime() - startNanoTime) / 1e9 + startTime;\n\t\telse if (currentFile == null)\n\t\t\treturn -1;\n\t\tif (debug)\n\t\t\tSystem.err.println(\"getCurrentTime(): not playing\");\n\t\treturn currentPosition / currentFile.frameSize / currentFile.frameRate;\n\t}",
"public int getCurrentPosition() {\n\t\treturn currentPosition;\n\t}",
"void doFrame() throws PlayerDebugException\n\t{\n\t\tint num = 0; // frame 0 by default \n\t\ttry\n\t\t{\n\t\t\tif (hasMoreTokens())\n\t\t\t\tnum = nextIntToken();\n\n\t\t\tpropertyPut(DISPLAY_FRAME_NUMBER, num);\n\n\t\t\tdumpFrame(num);\n\t\t\tsetListingToFrame(num);\n\t\t}\n\t\tcatch(NumberFormatException nfe)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"token\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"notANumber\", args)); //$NON-NLS-1$\n\t\t}\n catch(ArrayIndexOutOfBoundsException aie)\n {\n \tMap<String, Object> args = new HashMap<String, Object>();\n \targs.put(\"frameNumber\", Integer.toString(num)); //$NON-NLS-1$\n err(getLocalizationManager().getLocalizedTextString(\"frameDoesNotExist\", args)); //$NON-NLS-1$\n }\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noActiveSession\")); //$NON-NLS-1$\n\t\t}\n\t}",
"int getSubframesCount();",
"public int getNumFrames() {\n if ( dofs == null ) return 0;\n return dofs.length;\n }",
"public native final Node frameCurrentTarget() /*-{\n\t\treturn this.frameCurrentTarget;\n\t}-*/;",
"public int currentChunkNum() {\n\t\treturn cp.chunk().getChunkNum();\n\t}",
"int getCurrentIdx() {\n return currentIdx;\n }",
"public double getFrameX() { return isRSS()? getFrameXY().x : getX(); }",
"public long getCurrent() {\n return current;\n }",
"public native int getNumFrames() throws MagickException;",
"public int getPreviewFrameRate() {\n return getInt(\"preview-frame-rate\");\n }",
"public void setFrame(int frame)\n\t{\n\t\tisFinished = false;\n\t\tcurrFrame = frame;\n\t\tframeStart = (long) Game.getTimeMilli();\n\t}",
"@androidx.annotation.Nullable\r\n public synchronized android.graphics.Bitmap getNextFrame() {\r\n /*\r\n r7 = this;\r\n monitor-enter(r7);\r\n r0 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r0 = r0.frameCount;\t Catch:{ all -> 0x00ea }\r\n r1 = 3;\r\n r2 = 1;\r\n if (r0 <= 0) goto L_0x000d;\r\n L_0x0009:\r\n r0 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n if (r0 >= 0) goto L_0x003b;\r\n L_0x000d:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x0039;\r\n L_0x0015:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r3.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"Unable to decode frame, frameCount=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frameCount;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = \", framePointer=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r3 = r3.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r3);\t Catch:{ all -> 0x00ea }\r\n L_0x0039:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n L_0x003b:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r3 = 0;\r\n if (r0 == r2) goto L_0x00c8;\r\n L_0x0040:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r4 = 2;\r\n if (r0 != r4) goto L_0x0047;\r\n L_0x0045:\r\n goto L_0x00c8;\r\n L_0x0047:\r\n r0 = 0;\r\n r7.status = r0;\t Catch:{ all -> 0x00ea }\r\n r4 = r7.block;\t Catch:{ all -> 0x00ea }\r\n if (r4 != 0) goto L_0x0058;\r\n L_0x004e:\r\n r4 = r7.bitmapProvider;\t Catch:{ all -> 0x00ea }\r\n r5 = 255; // 0xff float:3.57E-43 double:1.26E-321;\r\n r4 = r4.obtainByteArray(r5);\t Catch:{ all -> 0x00ea }\r\n r7.block = r4;\t Catch:{ all -> 0x00ea }\r\n L_0x0058:\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.get(r5);\t Catch:{ all -> 0x00ea }\r\n r4 = (com.bumptech.glide.gifdecoder.GifFrame) r4;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r5 = r5 - r2;\r\n if (r5 < 0) goto L_0x0074;\r\n L_0x0069:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r6.get(r5);\t Catch:{ all -> 0x00ea }\r\n r5 = (com.bumptech.glide.gifdecoder.GifFrame) r5;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0075;\r\n L_0x0074:\r\n r5 = r3;\r\n L_0x0075:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n if (r6 == 0) goto L_0x007c;\r\n L_0x0079:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0080;\r\n L_0x007c:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.gct;\t Catch:{ all -> 0x00ea }\r\n L_0x0080:\r\n r7.act = r6;\t Catch:{ all -> 0x00ea }\r\n r6 = r7.act;\t Catch:{ all -> 0x00ea }\r\n if (r6 != 0) goto L_0x00aa;\r\n L_0x0086:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00a6;\r\n L_0x008e:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"No valid color table found for frame #\";\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00a6:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00aa:\r\n r1 = r4.transparency;\t Catch:{ all -> 0x00ea }\r\n if (r1 == 0) goto L_0x00c2;\r\n L_0x00ae:\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r3 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r3 = r3.length;\t Catch:{ all -> 0x00ea }\r\n java.lang.System.arraycopy(r1, r0, r2, r0, r3);\t Catch:{ all -> 0x00ea }\r\n r1 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r7.act = r1;\t Catch:{ all -> 0x00ea }\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r4.transIndex;\t Catch:{ all -> 0x00ea }\r\n r1[r2] = r0;\t Catch:{ all -> 0x00ea }\r\n L_0x00c2:\r\n r0 = r7.setPixels(r4, r5);\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r0;\r\n L_0x00c8:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00e8;\r\n L_0x00d0:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r2 = \"Unable to decode frame, status=\";\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r2 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00e8:\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00ea:\r\n r0 = move-exception;\r\n monitor-exit(r7);\r\n throw r0;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: com.bumptech.glide.gifdecoder.StandardGifDecoder.getNextFrame():android.graphics.Bitmap\");\r\n }",
"public int getCurrentPos() {\n return currentPos;\n }",
"public int getCurrentPlayerIndex(){\r\n return currentPlayerIndex;\r\n }",
"public int getCurrentNext() {\n\t\tInteger ii = (Integer) get_Value(\"CurrentNext\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}",
"public static GameFrame getGameFrame() {\n return gameFrame;\n }",
"public int getCurrentPosition() {\n\t\tif(currentPlayingItem==null) return 0;\n\t\treturn mediaPlayer.getCurrentPosition();\n\t}",
"public Integer getPositionnum() {\n\t\treturn positionnum;\n\t}",
"public static int getBlockNum() {\n\t\treturn (blockContext.blockNum);\n\t}",
"public int getLastPlayIndex() {\n\t\treturn lastMoveID;\n\t}",
"public float getFramesPerSecond() {\n return 1 / frametime;\n }",
"public double getFrameDuration();",
"@java.lang.Override\n public int getSubframesCount() {\n return instance.getSubframesCount();\n }",
"public int getCurrentTimepoint()\n\t{\n\t\treturn current_timepoint;\n\t}",
"@Override\n\tpublic float getFrameRate() {\n\t\treturn fps;\n\t}",
"private long getSeqNum() throws Exception {\n\t\tSystem.out.println(\"seq: \" + seq);\n\t\tif (seq == 256) {\n\t\t\tseq = 0;\n\t\t}\n\t\treturn seq++;\n\t}",
"public int getFrameDelay() {\n\t\treturn frameDelay;\n\t}",
"@java.lang.Override\n public com.google.protobuf.UInt64Value getFramesCount() {\n return framesCount_ == null ? com.google.protobuf.UInt64Value.getDefaultInstance() : framesCount_;\n }",
"private int findFrame(int startFrame){\n boolean flag=true;\n int startBitmap = startFrame/32;\n int startMask = startFrame%32;\n for(int i=startBitmap; i<bitMap.length; i++){\n for(int j=0; j<32;j++){\n if(flag && i==startBitmap){\n flag = false;\n j=startMask;\n }\n if(isEmpty(i,j)){\n return (i*32)+j;\n }\n }\n }\n return -1;\n }",
"public synchronized int getFPS() {\n return fps;\n }",
"public int getSeqNumber() {\n return buffer.getShort(2) & 0xFFFF;\n }",
"public short getFrameOrder()\n\t{\n\t\treturn (short) nameList.size();\n\t}",
"public int getWinnumber() {\n\t\treturn this.winnumber;\n\t}"
] | [
"0.8371775",
"0.817195",
"0.8024877",
"0.7853833",
"0.77854186",
"0.7410687",
"0.7395159",
"0.72239846",
"0.71732855",
"0.7088701",
"0.69109905",
"0.68977976",
"0.683797",
"0.6797794",
"0.66523033",
"0.6638144",
"0.6625597",
"0.65729606",
"0.65120286",
"0.65092236",
"0.6504826",
"0.6502469",
"0.6497806",
"0.6467801",
"0.6438091",
"0.6413399",
"0.63538027",
"0.63089573",
"0.62725526",
"0.6271605",
"0.6255738",
"0.62231094",
"0.6204106",
"0.61895984",
"0.61746955",
"0.6147286",
"0.61288095",
"0.61241746",
"0.61025774",
"0.61001486",
"0.60852873",
"0.6076931",
"0.60571444",
"0.6052109",
"0.6039483",
"0.60300905",
"0.6020685",
"0.60088545",
"0.5975345",
"0.59386533",
"0.5937028",
"0.5935131",
"0.5922626",
"0.5903721",
"0.5887017",
"0.58795786",
"0.5873063",
"0.5871588",
"0.58527464",
"0.5848397",
"0.58182937",
"0.5806143",
"0.57989776",
"0.57783234",
"0.5773857",
"0.5770985",
"0.5765069",
"0.57627326",
"0.5759974",
"0.57524824",
"0.5751613",
"0.57494116",
"0.57439524",
"0.57412887",
"0.5732574",
"0.5727655",
"0.57166195",
"0.5713874",
"0.57014203",
"0.56967556",
"0.56877404",
"0.5677802",
"0.5672446",
"0.56685925",
"0.56642973",
"0.5657409",
"0.56556046",
"0.5643515",
"0.5636498",
"0.5633514",
"0.56310695",
"0.5628062",
"0.5628037",
"0.5625648",
"0.5616641",
"0.56130624",
"0.56091774",
"0.5598063",
"0.55926335",
"0.5592359"
] | 0.8202021 | 1 |
Go to next frame number | public void incrementFrameNumber()
{
frameNumber++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void nextFrame() {\r\n if (frame < maxFrames - 1) {\r\n frame++;\r\n } else {\r\n frame = 0;\r\n }\r\n }",
"void openNextFrameSet();",
"public void nextFrame() {\r\n frame++;\r\n if( frame > lastEditFrame + frameDelay ) {\r\n // The last transaction is 'done'\r\n transaction = null;\r\n }\r\n }",
"public void switchToFrame(int index) {\n\t\tgetter().switchTo().frame(index);\r\n\t}",
"public void nextFrame() {\n\t\tfor (int i = 0; i < numFlakes; i++) {\n\t\t\tflakes[i].nextFrame();\n\t\t}\n\t}",
"private void selectFrame()\n\t{\n\t\t// Increment the animation frame\n\t\tif ((long) Game.getTimeMilli() - frameStart >= interval)\n\t\t{\n\t\t\tsetFrame(currFrame+1);\n\t\t}\n\t\t// Get the path to the current frame's image\n\t\tsetFramePath();\n\t\t// If the image frame doesn't exist...\n\t\tif (!GraphicsManager.getResManager().resExists(currFramePath))\n\t\t{\n\t\t\tif (isLooping())\n\t\t\t{\n\t\t\t\tsetFrame(1);\n\t\t\t\tsetFramePath();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisFinished = true;\n\t\t\t}\n\t\t}\n\t}",
"void doFrame() throws PlayerDebugException\n\t{\n\t\tint num = 0; // frame 0 by default \n\t\ttry\n\t\t{\n\t\t\tif (hasMoreTokens())\n\t\t\t\tnum = nextIntToken();\n\n\t\t\tpropertyPut(DISPLAY_FRAME_NUMBER, num);\n\n\t\t\tdumpFrame(num);\n\t\t\tsetListingToFrame(num);\n\t\t}\n\t\tcatch(NumberFormatException nfe)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"token\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"notANumber\", args)); //$NON-NLS-1$\n\t\t}\n catch(ArrayIndexOutOfBoundsException aie)\n {\n \tMap<String, Object> args = new HashMap<String, Object>();\n \targs.put(\"frameNumber\", Integer.toString(num)); //$NON-NLS-1$\n err(getLocalizationManager().getLocalizedTextString(\"frameDoesNotExist\", args)); //$NON-NLS-1$\n }\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noActiveSession\")); //$NON-NLS-1$\n\t\t}\n\t}",
"public void next()\n\t{\n\t\tSystem.err.print(\"-\");\n\t\tif(pp.available())\n\t\t{\n\t\t\tSystem.err.print(\"+\");\n\t\t\timg_header=pp.getFrameHeader();\n\t\t\tbi=pp.getFrame();\n\t\t\tip[ip_index].setImage(bi);\n\t\t\tip[ip_index].repaint();\n\t\t\tip_index++;\n\t\t\t//ip_index%=cols*rows;\n\t\t\tip_index%=tiles;\n\t\t\tpp.next();\n\t\t}\n\t\tif(panel_glass.isVisible() || is_paused)\n\t\t{\n\t\t\tupdateInfoPanel();\n\t\t\tpanel_buffer_fill.setValue(pp.getBufferFillLevel());\n\t\t\tpanel_buffer_fill.repaint();\n\t\t\tif(is_paused)\n\t\t\t{\n\t\t\t\ttry{Thread.sleep(10);}catch(Exception e){}\n\t\t\t}\n\t\t}\n\t}",
"public void nextFrame() {\r\n\t\tif (logger.isDebugEnabled())\r\n\t\t\tlogger.debug(\"Next frame\");\r\n\t\t\r\n\t\t// Start game\r\n\t\tif (state == GameState.CREATED) {\r\n\t\t\t// Change state\r\n\t\t\tstate = GameState.WAITING_FRAME;\r\n\t\t\t\r\n\t\t\t// Start scheduling thread\r\n\t\t\tstart();\r\n\t\t}\r\n\t\t// Play one step\r\n\t\telse if (state != GameState.STOPPED) {\r\n\t\t\t// Change state\r\n\t\t\tstate = GameState.WAITING_FRAME;\r\n\t\t\t\r\n\t\t\t// Wake scheduling thread up\r\n\t\t\twakeUp();\r\n\t\t}\r\n\t}",
"public void next() {\n\t\tif ((position == 0) && (pause != 3)) {\n\t\t\tpause++;\n\t\t} else {\n\t\t\tposition++;\n\t\t\tpause = 0;\n\t\t\tif (position == (origionalMessage.length() + 10)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t}\n\n\t}",
"void setCurrentFrame(int frameNum) {\n this.currFrame = frameNum;\n }",
"public boolean advance() {\n currentFrame ++;\n if(currentFrame >= frames.size()) {\n return false;\n }\n// LogU.d(\" advance 222 \"+ currentFrame);\n return true;\n }",
"protected boolean nextFrame() {\n if (counter % FRAME_DELAY == 0) {\n currFrame = (currFrame + 1) % currAnimation.getLength();\n return true;\n } else { return false; }\n }",
"public static void switchToFrameWithIndex(Integer index) {\n\t\tdriver.switchTo().frame(index);\n\t}",
"public void next(){\n if(stageNum < (defineStageNum)) {\n stageNum++;\n }else {\n stageNum = startStageNum;\n }\n }",
"public void stepForward(){\n\t\tif(timer == null){ return; }\n\t\ttimer.stop();\n\t\n\t\t//check to see if we have reached the last frame\n\t\tif(frameIndex == frames.length-1){ frameIndex = 0; }\n\t\telse{ frameIndex++; }\n\t\n\t\tframes[frameIndex].display();\n frames[frameIndex].clearDisplay();\n\t}",
"public Frame nextFrame(final Frame frame) {\n\t\tif (isFinalFrame(frame))throw new IllegalStateException(\"Invalid Entry\"); // input santization -- out of bounds when at last frame\n\t\telse return frames.get(frames.indexOf(frame) + 1); // else return the frame at next index. \n\t}",
"public void switchToFrame(int index){\n\n\t\ttry {\n\t\t\tdriver.switchTo().frame(index);\n\t\t\tLOGGER.info(\"Step : Switched to Frame with index \"+index+\" :Pass\");\n\t\t}catch(Exception e)\n\t\t{\n\t\t\tLOGGER.error(\"Step : Switched to Frame with index \"+index+\" :Fail\");\n\t\t\t//e.printStackTrace();\n\t\t\tthrow new NotFoundException(\"Exception while switching to frame\");\n\t\t\t}\n\t\t}",
"public void handleNextCode() {\n setCurrentCode((currentIndex + 1) % codeCount);\n }",
"public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"public void goToLoopCounter() throws EndTaskException {\n\t\tgoToOrigin();\n\t\tturnAround();\n\t\tmove();//lane 2\n\t\tmove();\n\t}",
"private void forwardPage()\n {\n page++;\n open();\n }",
"private void next() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n if (currentWindowIndex < currentTimeline.getWindowCount() - 1) {\n player.seekTo(currentWindowIndex + 1, C.TIME_UNSET);\n } else if (currentTimeline.getWindow(currentWindowIndex, new Timeline.Window(), false).isDynamic) {\n player.seekTo(currentWindowIndex, C.TIME_UNSET);\n }\n }",
"protected void next(long currentFrame) {\n\t\tDirection dir = scan();\n\t\t\t\t\n\t\t// Check moving\n\t\tif (dir != Direction.None) {\n\t\t\t\n\t\t\t_myState.direction = dir;\n\t\t\t\n\t\t\t// Add the key frame\n\t\t\tsetKeyFrame(currentFrame);\n\t\t\t\n\t\t\t// Check for a grunt\n\t\t\tArrayList<Grunt> list = _level.getCellManager().getGruntsAt(_myState.target);\n\t\t\tfor (Grunt grunt: list) {\n\t\t\t\t// Check the grunt has already entered the tile\n\t\t\t\tif (grunt.getTile().equals(_myState.target)) {\n\t\t\t\t\t\n\t\t\t\t\t// Check if the grunt is still nearby\n\t\t\t\t\tif (grunt.getSpeed() == 0 || grunt.getKeyFrame() > currentFrame - 20) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Kill the grunt\n\t\t\t\t\t\tgrunt.getBehaviour().webify();\n\t\t\t\t\t\t\n\t\t\t\t\t\tspin(currentFrame);\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Check enterable\n\t\t\tif (_policy.getEnterableAt(_myState.target)) {\n\t\t\t\twalk(currentFrame);\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t} else if (_level.getMap().getTileTraits(_myState.target).contains(\"hole\")) {\n\t\t\t\t\n\t\t\t\t// Start spinning a web\n\t\t\t\tspin(currentFrame);\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop the spider\n\t\tif (_myState.motion != SpiderMotion.Stopped) {\n\n\t\t\t// Stop moving\n\t\t\t_myState.moving = false;\n\t\t\t\n\t\t\t_myState.motion = SpiderMotion.Stopped;\n\t\t\t// Change the animation\n\t\t\t_animation = ResourceLoader.getAnimationForPath(\"spiderz/Idle\" + _myState.direction.toString());\n\t\t}\n\t\t\n\t\t// Stall for one turn\n\t\tsetStaticKeyFrame(currentFrame, 1);\n\t\t\n\t}",
"@Override\n\tpublic Frame getNextFrame() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Frame getNextFrame() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Frame getNextFrame() {\n\t\treturn null;\n\t}",
"public void Next(View view)\n {\n increaseNum();\n }",
"private void next() {\n if (position < tracks.size()) {\n Player.getInstance().stop();\n\n // Set a new position:\n ++position;\n\n ibSkipPreviousTrack.setImageDrawable(getResources()\n .getDrawable(R.drawable.ic_skip_previous_track_on));\n\n try {\n Player.getInstance().play(tracks.get(position));\n } catch (IOException playerException) {\n playerException.printStackTrace();\n }\n\n setImageDrawable(ibPlayOrPauseTrack, R.drawable.ic_pause_track);\n setCover(Player.getInstance().getCover(tracks.get(position), this));\n\n tvTrack.setText(tracks.get(position).getName());\n tvTrackEndTime.setText(playerUtils.toMinutes(Player.getInstance().getTrackEndTime()));\n }\n\n if (position == tracks.size() - 1) {\n ibSkipNextTrack.setImageDrawable(getResources()\n .getDrawable(R.drawable.ic_skip_next_track_off));\n }\n }",
"public abstract void goNext();",
"public abstract void nextAnimationStep();",
"public void goToNextPage() {\n nextPageButton.click();\n }",
"public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}",
"void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}",
"private void nextTurn()\n\t{\n\t\tturn++;\n\t\tFrameMap.remove();\n\t}",
"public void advance() {\n\t\tif(isFinalFrame(current)) {\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\"); // input sanitization if last frame (cant advance further )\n\t\t\t\n\t\t}\n\t\tif (!current.movesFinished()) { // input sanitization -- cant advance if the user hasnt exercised all the frames moves\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\");\n\t\t}\n\t\telse current = frames.get(frames.indexOf(current) + 1); // else updates the current frame to frame at next index. \n\t}",
"@Override\n\tpublic void navigateToNext(String phoneNum) {\n\t\t\n\t}",
"public static void clickNextBtnGame() {\t\n\t\tdriver.findElement(By.id(\"btnnext\")).click();\n\t}",
"public void gotoNext(){\r\n if(curr == null){\r\n return;\r\n }\r\n prev = curr;\r\n curr = curr.link;\r\n }",
"public void next() {\n addTracksToQueue();\n player.skipToNext();\n }",
"public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}",
"public void jumpTo(int index)\n {\n assert(index >= 0);\n assert(index < _pattern.length);\n\n _index = index;\n }",
"public void update() {\n if (next) {\n if (!loop) {\n if (currentFrame != numFrames-1) {\n currentFrame+=1;\n }\n }\n else {\n currentFrame+=1;\n currentFrame%=numFrames;\n }\n }\n else {\n if (!loop) {\n if (currentFrame != 0) {\n currentFrame-=1;\n }\n }\n else {\n currentFrame -=1;\n if (currentFrame == -1) currentFrame = numFrames - 1;\n } \n }\n }",
"void doNext() throws PlayerDebugException\n\t{\n\t\twaitTilHalted();\n\n\t\tif (!allowedToStep())\n\t\t\treturn;\n\t\t\n\t\tint count = 1;\n\t\tif (hasMoreTokens())\n\t\t\tcount = nextIntToken();\n\n\t\ttry\n\t\t{\n\t\t\twhile(count-- > 0)\n\t\t\t{\n\t\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t\t{\n\t\t\t\t\t\tm_session.stepOver();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tfor (;;)\n\t\t\t\t{\n\t\t\t\t\tdumpStep();\n\n\t\t\t\t\tif (m_requestResume) // perhaps we hit a conditional breakpoint\n\t\t\t\t\t{\n\t\t\t\t\t\tm_requestResume = false;\n\t\t\t\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tm_session.stepContinue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(NoResponseException nre)\n\t\t{\n\t\t\tif (count > 0)\n\t\t\t{\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"count\", Integer.toString(count)); //$NON-NLS-1$\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"abortingStep\", args)); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\n\t\tm_repeatLine = m_currentLine;\n\t}",
"public static void next() {\n\t\tsendMessage(NEXT_COMMAND);\n\t}",
"private int forwardPosition() {\n\t\treturn (position + 1) % (maxPosition + 1);\n\t}",
"public void stepForward() {\n\t\tposition = forwardPosition();\n\t}",
"public boolean moveNext(\n )\n {\n // Scanning the current graphics object...\n ContentObject currentObject = getCurrent();\n if(currentObject != null)\n {\n \t\n \tString cmdStr = currentObject.toString();\n \t/*\n \tif(cmdStr.contains(\"f*\") || cmdStr.contains(\"{f }\")) {\n \t\tSystem.out.println(cmdStr);\n \t}\n \t*/\n \tif(!cmdStr.contains(\"{re [36, 270, 540, 720]}, {f }\")) {\n \t\tcurrentObject.scan(state);\n \t}\n }\n\n // Moving to the next object...\n if(index < objects.size())\n {index++; refresh();}\n\n return getCurrent() != null;\n }",
"public void playNext() {\n if(mPosition < mMyTracks.size() - 1) {\n mPosition++;\n } else {\n mPosition = ++mPosition % mMyTracks.size();\n }\n prepareTrack();\n }",
"private void goToNextActivity() {\n startActivity(new Intent(this,NextActivity.class));\n }",
"private void nextTurn(){\n\t\tint[] currentTurnInfo = mTurnIndicator.nextTurn(); \n\t\tif(currentTurnInfo[TurnView.TURN_POSITION] > -1){\n\t\t\t// highlight the current player\n\t\t\tCombatAdapter adapter = (CombatAdapter) getList().getAdapter();\n\t\t\tadapter.setCurrentTurn(currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// change the turn in the game table\n\t\t\tGameTable.setTurn(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID, currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// set the label\n\t\t\tmTurn.setText(currentTurnInfo[TurnView.TURN_INIT] + \"\");\n\t\t\t// increment the round if necessary\n\t\t\tif(currentTurnInfo[TurnView.TURN_POSITION] == 0){\n\t\t\t\tint round = GameTable.addRound(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID);\n\t\t\t\tmRound.setText(round + \"\");\n\t\t\t}\n\t\t}\n\t}",
"public void skipToNext() {\n try {\n mSessionBinder.next(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling next.\", e);\n }\n }",
"public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}",
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"private void displayNext() {\r\n\t\ti++;\r\n\t\tdisplayCurrentPicture();\r\n\t}",
"@Test\n\tpublic void nextAttemptSecond() {\n\t\tMockito.when(mockBowlingGameController.isLastFrame()).thenReturn(false);\n\t\tMockito.when(mockBowlingGameController.getCurrentFrame()).thenReturn(bowler.getFrames().get(0));\n\t\tFrame frame = bowler.getFrames().get(0);\n\t\tframe.setFirstAttempt(5);\n\t\tif (!frame.isLastFrame()) {\n\t\t\tAssert.assertEquals(Attempt.SECOND, mockBowlingGameController.nextAttempt(Attempt.FIRST));\n\t\t}\n\t}",
"public int getFrame()\n\t{\n\t\treturn currFrame;\n\t}",
"private void moveToNextCard() {\r\n\t\t// This is simple enough: Move the card set to the next\r\n\t\t// card and update the label and database. If we're now on\r\n\t\t// the last card, disable the Next button and make sure\r\n\t\t// the Previous button is always enabled. Then rebuild the card\r\n\t\t// itself so the correct passcodes are displayed.\r\n \tif (cardSet.getLastCard() != Cardset.FINAL_CARD) {\r\n\t\t\tcardSet.nextCard();\r\n\t\t\tbtnPrevious.setEnabled(true);\r\n\t\t\tif (cardSet.getLastCard() == Cardset.FINAL_CARD)\r\n\t\t\t\tbtnNext.setEnabled(false);\r\n\t\t\t// Save the card set to the database:\r\n\t\t\tDBHelper.saveCardset(cardSet);\r\n\t\t\trebuildCard();\r\n\t lblCardNumber.setText(getResources().getString(R.string.cardview_card_num_prompt).replace(getResources().getString(R.string.meta_replace_token), String.valueOf(cardSet.getLastCard())));\r\n \t}\r\n }",
"private void forward() {\n index++;\n column++;\n if(column == linecount + 1) {\n line++;\n column = 0;\n linecount = content.getColumnCount(line);\n }\n }",
"@Override\n void advance() {\n }",
"public void goToNext() {\r\n\t\tif (curr == null)\r\n\t\t\treturn;\r\n\t\tprev = curr;\r\n\t\tcurr = curr.link;\r\n\t}",
"public void setFrame(int value) {\r\n this.frame = value;\r\n }",
"public void setFrame(int frame)\n\t{\n\t\tisFinished = false;\n\t\tcurrFrame = frame;\n\t\tframeStart = (long) Game.getTimeMilli();\n\t}",
"public void nextTurn() {\n\t\tLog.d(TAG, \"nextTurn()\");\t\t\n\t\ttickPeople();\n\t\t//doEvents();\n\t\tupdateBar();\n\t}",
"public void nextMove(Field field) {\n for (int i = 1; i <= 9; i++) {\n if (field.setMarker(i, marker)) {\n break;\n }\n }\n }",
"int getFrame() {\n return currFrame;\n }",
"public void moveNext() {\n\t\tcurrentElement++;\n\t}",
"@androidx.annotation.Nullable\r\n public synchronized android.graphics.Bitmap getNextFrame() {\r\n /*\r\n r7 = this;\r\n monitor-enter(r7);\r\n r0 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r0 = r0.frameCount;\t Catch:{ all -> 0x00ea }\r\n r1 = 3;\r\n r2 = 1;\r\n if (r0 <= 0) goto L_0x000d;\r\n L_0x0009:\r\n r0 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n if (r0 >= 0) goto L_0x003b;\r\n L_0x000d:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x0039;\r\n L_0x0015:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r3.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"Unable to decode frame, frameCount=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frameCount;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = \", framePointer=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r3 = r3.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r3);\t Catch:{ all -> 0x00ea }\r\n L_0x0039:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n L_0x003b:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r3 = 0;\r\n if (r0 == r2) goto L_0x00c8;\r\n L_0x0040:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r4 = 2;\r\n if (r0 != r4) goto L_0x0047;\r\n L_0x0045:\r\n goto L_0x00c8;\r\n L_0x0047:\r\n r0 = 0;\r\n r7.status = r0;\t Catch:{ all -> 0x00ea }\r\n r4 = r7.block;\t Catch:{ all -> 0x00ea }\r\n if (r4 != 0) goto L_0x0058;\r\n L_0x004e:\r\n r4 = r7.bitmapProvider;\t Catch:{ all -> 0x00ea }\r\n r5 = 255; // 0xff float:3.57E-43 double:1.26E-321;\r\n r4 = r4.obtainByteArray(r5);\t Catch:{ all -> 0x00ea }\r\n r7.block = r4;\t Catch:{ all -> 0x00ea }\r\n L_0x0058:\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.get(r5);\t Catch:{ all -> 0x00ea }\r\n r4 = (com.bumptech.glide.gifdecoder.GifFrame) r4;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r5 = r5 - r2;\r\n if (r5 < 0) goto L_0x0074;\r\n L_0x0069:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r6.get(r5);\t Catch:{ all -> 0x00ea }\r\n r5 = (com.bumptech.glide.gifdecoder.GifFrame) r5;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0075;\r\n L_0x0074:\r\n r5 = r3;\r\n L_0x0075:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n if (r6 == 0) goto L_0x007c;\r\n L_0x0079:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0080;\r\n L_0x007c:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.gct;\t Catch:{ all -> 0x00ea }\r\n L_0x0080:\r\n r7.act = r6;\t Catch:{ all -> 0x00ea }\r\n r6 = r7.act;\t Catch:{ all -> 0x00ea }\r\n if (r6 != 0) goto L_0x00aa;\r\n L_0x0086:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00a6;\r\n L_0x008e:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"No valid color table found for frame #\";\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00a6:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00aa:\r\n r1 = r4.transparency;\t Catch:{ all -> 0x00ea }\r\n if (r1 == 0) goto L_0x00c2;\r\n L_0x00ae:\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r3 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r3 = r3.length;\t Catch:{ all -> 0x00ea }\r\n java.lang.System.arraycopy(r1, r0, r2, r0, r3);\t Catch:{ all -> 0x00ea }\r\n r1 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r7.act = r1;\t Catch:{ all -> 0x00ea }\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r4.transIndex;\t Catch:{ all -> 0x00ea }\r\n r1[r2] = r0;\t Catch:{ all -> 0x00ea }\r\n L_0x00c2:\r\n r0 = r7.setPixels(r4, r5);\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r0;\r\n L_0x00c8:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00e8;\r\n L_0x00d0:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r2 = \"Unable to decode frame, status=\";\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r2 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00e8:\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00ea:\r\n r0 = move-exception;\r\n monitor-exit(r7);\r\n throw r0;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: com.bumptech.glide.gifdecoder.StandardGifDecoder.getNextFrame():android.graphics.Bitmap\");\r\n }",
"public void update() \n\t{\n\t\t// Increment if there are more than 1 frames\n\t\tif(frames.size() > 1) {\n\t\t\t\tcurrentFrameIndex++;\n\t\t}\n\t\t\n\t\t// If we've reached the end of the list, then start from\n\t\t// the beginning again\n\t\tif(currentFrameIndex >= frames.size()) {\n\t\t\t\tcurrentFrameIndex = 0;\n\t\t}\n\t}",
"public void nextStage(){\n\t\tif (this.stage >= MAX_STAGES){\n\t\t\treturn;\n\t\t}\n\t\tthis.stage++;\n\t\trepaint(); // Update stage.\n\t}",
"private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }",
"private void nextStep(){\n if(vMaze == null)\n mainMessage.setText(\"You must load a maze first!\");\n else try{\n vMaze.step();\n tileBox.getChildren().clear();\n tileBox.getChildren().add(vMaze.getTiles());\n\n mainMessage.setText(\"You took one step.\");\n if(vMaze.getRouteFinder().isFinished())\n mainMessage.setText(\"You reached the end!\");\n } catch (NoRouteFoundException e){\n mainMessage.setText(e.getMessage());\n }\n }",
"public void jumpToNextLine() {\n int currentLineNo = getCurrentLineByCursor();\n if (currentLineNo == textBuffer.getMaxLine()-1) {\n textBuffer.setCurToTail();\n return;\n }\n int curX = round(cursor.getX());\n textBuffer.setCurToTargetNo(currentLineNo+1);\n lineJumpHelper(curX);\n }",
"private void next()\r\n {\r\n if(currentCard != stack.getChildren().size()- 1) // if we are not at the last card\r\n {\r\n currentCard++; // make the next card the current card\r\n \r\n // move through the cards: show the current card, hide the others\r\n for(int i = 0; i <= stack.getChildren().size()- 1; i++)\r\n {\r\n if(i == currentCard)\r\n {\r\n stack.getChildren().get(i).setVisible(true);\r\n }\r\n else\r\n {\r\n stack.getChildren().get(i).setVisible(false);\r\n }\r\n }\r\n }\r\n }",
"void advance(int tickCount) {\n if (tickCount % 2 == 0) { // slow the animation down a little\n mySequenceIndex++;\n mySequenceIndex %= 4;\n setAnimatedTile(myAnimatedTileIndex,\n FRAME_SEQUENCE[mySequenceIndex]);\n }\n }",
"public void nextSlide() {\n\t\tif (currentSlideNumber < (showList.size()-1)) {\n\t\t\tsetSlideNumber(currentSlideNumber + 1);\n\t\t}\n\t}",
"private void nexttest(){\n\t\tif (TestListPanel.ktea2yn = true){\n\t\tnextframe = new Ktea2frame();\n\t\tDas2panel.das2fr.setVisible(false);\n\t\t}\n\t\t/*else if (wiscyn = true){\n\t\tnextframe = new Wiscframe();\n\t\tDas2panel.das2fr.setVisible(false);\n\t\t}\n\t\telse if (basc2yn = true){\n\t\tnextframe = new Basc2frame();\n\t\tDas2panel.das2fr.setVisible(false);\n\t\t}\n\t\telse {\n\t\t\n\t\t}*/\n\t\t\n\t}",
"private void next() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(2, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"Pos nextPos(Pos pos) {\n // Get my track from display\n return cd.nextPos(no, pos);\n }",
"public void stepBackward(){\n\t\tif(timer == null){ return; }\n\t\ttimer.stop();\n\t\n\t\t//check to see if we are back to the first frame\n\t\tif(frameIndex == 0){ frameIndex = frames.length-1; }\n\t\telse{ frameIndex--; }\n\t\n\t\tframes[frameIndex].display();\n frames[frameIndex].clearDisplay();\n\t}",
"private void getNext() {\n Node currNode = getScreenplayElem().getChildNodes().item(currPos++);\n while (currNode.getNodeType() != Node.ELEMENT_NODE) {\n currNode = getScreenplayElem().getChildNodes().item(currPos++);\n }\n currElem = (Element) currNode;\n }",
"public void setFrame(int newFrame) {\r\n if (newFrame < maxFrames) {\r\n frame = newFrame;\r\n }\r\n }",
"void update() {\n rectToBeDrawn = new Rect((frameNumber * frameSize.x)-1, 0,(frameNumber * frameSize.x + frameSize.x) - 1, frameSize.x);\n\n //now the next frame\n frameNumber++;\n\n //don't try and draw frames that don't exist\n if(frameNumber == numFrames){\n frameNumber = 0;//back to the first frame\n }\n }",
"public void start() {\n\t\tcurrentFrameIndex = 0;\n\t}",
"public void NextTurn(){\n\n currentTurn = currentTurn.getSiguiente();\n String turno = (String) currentTurn.getDato();\n String info[] = turno.split(\"#\");\n\n int infoIn = 4;\n for (int i = 0; i < 10; i++, infoIn += 1) {\n label_list[i].setIcon(new ImageIcon(info[infoIn]));\n this.screen.add(label_list[i]);\n }\n HP.setText(\"HP: \"+info[2]);\n action.setText(\"Action: \"+info[1]);\n mana.setText(\"Mana: \"+info[3]);\n game.setText(\"Game \"+String.valueOf(partidaNum)+\", Turn \"+info[0]);\n\n VerifyButtons();\n\n }",
"public void forwardOnClick(View view){\n while(Integer.parseInt(mazeController.getPercentDone()) < 99) {\n\n }\n Intent newIntent = new Intent(this, Play.class);\n startActivity(newIntent);\n }",
"private static Frame makeNextFrame(Player player) {\r\n Frame nextFrame = new Frame();\r\n nextFrame.setPlayer(player);\r\n\r\n return nextFrame;\r\n }",
"void doUp() throws PlayerDebugException\n\t{\n\t\tint num = propertyGet(DISPLAY_FRAME_NUMBER) + 1;\n\t\ttry\n\t\t{\n\t\t\tpropertyPut(DISPLAY_FRAME_NUMBER, num);\n\n\t\t\tdumpFrame(num);\n\t\t\tsetListingToFrame(num);\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noActiveSession\")); //$NON-NLS-1$\n\t\t}\n catch(ArrayIndexOutOfBoundsException aie)\n {\n \tMap<String, Object> args = new HashMap<String, Object>();\n \targs.put(\"frameNumber\", Integer.toString(num)); //$NON-NLS-1$\n err(getLocalizationManager().getLocalizedTextString(\"frameDoesNotExist\", args)); //$NON-NLS-1$\n }\n\t\tm_repeatLine = m_currentLine;\n\t}",
"@Override\n\tpublic void makeNextMove() \n\t{\n\t}",
"@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tgoNext();\r\n\t\t\t\t}",
"private int next(int index)\n\t{\n\t\tif (index == list.length - 1)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index + 1;\n\t\t}\n\t}",
"public void switchNextTabulator() {\r\n\t\tCTabItem[] tabItems = this.displayTab.getItems();\r\n\t\tfor (int i = 0; i < tabItems.length; i++) {\r\n\t\t\tCTabItem tabItem = tabItems[i];\r\n\t\t\tif (tabItem.getControl().isVisible()) {\r\n\t\t\t\tif (i + 1 <= tabItems.length - 1)\r\n\t\t\t\t\ttabItem.getParent().setSelection(i + 1);\r\n\t\t\t\telse\r\n\t\t\t\t\ttabItem.getParent().setSelection(0);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void next() {\n\t\t}",
"public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }",
"static void nextIteration(Configuration conf) {\n conf.setInt(STEP_PROP, getCurrentIteration(conf)+1);\n }",
"public void nextTurn() {\n do {\n colonySimulator.nextTurn(curTurn);\n curTurn++;\n try {\n Thread.sleep(200);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n } while (!stepping && queenAlive);\n }",
"public void nextLevelTogo() {\n if (this.myClearedLines % 2 == 0) {\n myLinesToGo = 2;\n } else {\n myLinesToGo = 1;\n }\n }",
"public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }",
"void onClickNextTurn();",
"public int getFrameNumber()\n {\n\treturn frameNumber;\n }"
] | [
"0.80769634",
"0.70676965",
"0.6953009",
"0.6942255",
"0.68499273",
"0.66477",
"0.6633191",
"0.66328025",
"0.65759724",
"0.65565157",
"0.653042",
"0.6526932",
"0.6525783",
"0.65106285",
"0.6500022",
"0.64395356",
"0.6371151",
"0.63526595",
"0.6271163",
"0.62137717",
"0.61790955",
"0.61757904",
"0.6172575",
"0.61677223",
"0.6149044",
"0.6149044",
"0.6149044",
"0.6134645",
"0.61014044",
"0.6064162",
"0.60454464",
"0.603747",
"0.60302126",
"0.6028635",
"0.6025714",
"0.60188586",
"0.5988043",
"0.5985664",
"0.5984486",
"0.5978075",
"0.59716696",
"0.5963235",
"0.59427106",
"0.5917232",
"0.5897312",
"0.5897089",
"0.58845943",
"0.5865692",
"0.5859481",
"0.58545226",
"0.58537275",
"0.5841372",
"0.5838612",
"0.5835018",
"0.58275616",
"0.58188",
"0.58183455",
"0.5817606",
"0.5810529",
"0.5805507",
"0.57809794",
"0.5777982",
"0.57768434",
"0.57462484",
"0.5735407",
"0.5732556",
"0.57308054",
"0.5727131",
"0.5720206",
"0.5715045",
"0.57118887",
"0.57041746",
"0.56909025",
"0.5688927",
"0.5688676",
"0.5676439",
"0.5665564",
"0.5663061",
"0.56423646",
"0.5637528",
"0.5623703",
"0.5617806",
"0.5613286",
"0.5603262",
"0.559978",
"0.5598383",
"0.55887675",
"0.5588223",
"0.5588112",
"0.558758",
"0.55851847",
"0.5582532",
"0.55809784",
"0.5580279",
"0.557731",
"0.55731344",
"0.5566559",
"0.55581605",
"0.55573165",
"0.5539102"
] | 0.7307849 | 1 |
Make clock framebyframe (each frame has 1/30 second duration) | public void setFrameByFrameClock()
{
frameByFrameClock = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void makeTimer(){\n\t\n\t\tframeIndex = 0;\n\t\n\t\t//Create a new interpolator\n\t\tInterpolator lint = new Interpolator();\n\t\n\t\t//interpolate between all of the key frames in the list to fill the array\n\t\tframes = lint.makeFrames(keyFrameList);\n\t\n\t\t//timer delay is set in milliseconds, so 1000/fps gives delay per frame\n\t\tint delay = 1000/fps; \n\t\n\t\n\t\tActionListener taskPerformer = new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tif(frameIndex == frames.length){ frameIndex = 0;}\n\n\t\t\t\tframes[frameIndex].display();\n\t\t\t\tframes[frameIndex].clearDisplay();\n\t\t\t\tframeIndex++;\n\t\t\t}\n\t\t};\n\n\t\ttimer = new Timer(delay, taskPerformer);\t\n\t}",
"public void frameForward()\n{\n stop();\n setTime(getTime() + getInterval());\n}",
"private void printTimer(){\n\t\tFrame++;\n\t\tif(isFrame()){\n\t\t\tSystem.out.println(Frame + \" updates/frames in the \" + second + \"th second\");\n\t\t\tsecond++;\n\t\t\tFrame=1;\n\t\t}\n\t}",
"private void updateTime() {\n timer.update();\n frametime = timer.getTimePerFrame();\n }",
"private void stepTiming() {\n\t\tdouble currTime = System.currentTimeMillis();\n\t\tstepCounter++;\n\t\t// if it's been a second, compute frames-per-second\n\t\tif (currTime - lastStepTime > 1000.0) {\n\t\t\tdouble fps = (double) stepCounter * 1000.0\n\t\t\t\t\t/ (currTime - lastStepTime);\n\t\t\t// System.err.println(\"FPS: \" + fps);\n\t\t\tstepCounter = 0;\n\t\t\tlastStepTime = currTime;\n\t\t}\n\t}",
"public void trackTime()\n {\n frames += 1;\n\n // Every second (roughly) reduce the time left\n if (frames % 60 == 0)\n {\n time += 1;\n showTime();\n }\n }",
"public float getFrameRate() { return 1000f/_interval; }",
"public void run(){\n this.requestFocus();\n long lastTime = System.nanoTime();\n double amountOfTicks = 60.0;\n double ns = 1000000000 / amountOfTicks;\n double delta = 0;\n long timer = System.currentTimeMillis();\n int frames = 0;\n\n while(isRunning){\n long now = System.nanoTime();\n delta += (now - lastTime) / ns;\n lastTime = now;\n while(delta >= 1){\n tick();\n delta--;\n }\n render();\n frames++;\n\n if(System.currentTimeMillis() - timer > 1000){\n timer += 1000;\n frames = 0;\n }\n }\n stop();\n }",
"private double updateFrameRate(long now) {\n long oldFrameTime = frameTimes[frameTimeIndex];\n frameTimes[frameTimeIndex] = now;\n frameTimeIndex = (frameTimeIndex + 1) % frameTimes.length;\n if (numFrameTimes < frameTimes.length) {\n numFrameTimes++;\n }\n long elapsedNanos = now - oldFrameTime;\n long elapsedNanosPerFrame = elapsedNanos / numFrameTimes;\n double frameRate = 1_000_000_000.0 / elapsedNanosPerFrame;\n return frameRate;\n }",
"public void processFrame(float deltaTime);",
"public void run() {\r\n\t\tint frames = 0;\r\n\t\tdouble unprocessedSeconds = 0;\r\n\t\tlong previousTime = System.nanoTime();\r\n\t\tdouble secondsPerTick = 1 / 60.0;\r\n\t\tint tickCount = 0;\r\n\t\tboolean ticked = false;\r\n\t\t\r\n\t\twhile (running) {\r\n\t\t\tlong currentTime = System.nanoTime();\r\n\t\t\tlong passedTime = currentTime - previousTime;\r\n\t\t\tpreviousTime = currentTime;\r\n\t\t\tunprocessedSeconds += passedTime / 1000000000.0;\r\n\t\t\trequestFocus();//has the window selected when program is lanched\r\n\r\n\t\t\twhile (unprocessedSeconds > secondsPerTick) {\r\n\t\t\t\tunprocessedSeconds -= secondsPerTick;\r\n\t\t\t\tticked = true;\r\n\t\t\t\ttickCount++;\r\n\t\t\t\tif (tickCount % 3 == 0) {//calls on tick 20x/second\r\n\t\t\t\t\ttick();\r\n\t\t\t\t\tnumberOfTicks++;\r\n\t\t\t\t}\r\n\t\t\t\tif (tickCount % 60 == 0) {\r\n\t\t\t\t\t//System.out.println(frames + \"fps\");\r\n\t\t\t\t\tfps = frames;\r\n\t\t\t\t\tpreviousTime += 1000;\r\n\t\t\t\t\tframes = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\trender();\r\n\t\t\tframes++;\r\n\t\t}\r\n\t}",
"void doOneFrame(DrawSurface d, double dt);",
"private int getFramePerSecond(Rectangle rect){\n final long recordTime=1000;\n int countFrame=0;\n try {\n Robot bot=new Robot();\n final long startTime=System.currentTimeMillis();\n while((System.currentTimeMillis()-startTime)<=recordTime){\n bot.createScreenCapture(rect);\n countFrame++;\n }\n System.out.println(\"FramePerSecond is : \"+countFrame);\n return countFrame;\n } catch (AWTException e) {\n e.printStackTrace();\n }\n return 0;\n }",
"public double getFrameDuration();",
"public void tick() {\n\t\tmFrameCount++;\n\t\t\n\t\tif (mStopwatch.getElapsedTime() > 1000) {\n\t\t\tmFramesPerSecond = mFrameCount;\n\t\t\tmFrameCount = 0;\n\t\t\t\n\t\t\tmStopwatch.restart();\n\t\t}\n\t}",
"private int calcOrderDelay()\r\n {\r\n int frameDelay = 0;\r\n if (totalSecondsElapsed >= 120)\r\n {\r\n frameDelay = 2;\r\n }\r\n else if (totalSecondsElapsed >= 90)\r\n {\r\n frameDelay = 3;\r\n }\r\n else if (totalSecondsElapsed >= 60)\r\n {\r\n frameDelay = 4;\r\n }\r\n else if (totalSecondsElapsed >= 45)\r\n {\r\n frameDelay = 5;\r\n }\r\n else if (totalSecondsElapsed >= 30)\r\n {\r\n frameDelay = 6;\r\n }\r\n else if (totalSecondsElapsed >= 15)\r\n {\r\n frameDelay = 7;\r\n }\r\n else if (totalSecondsElapsed >= 0)\r\n {\r\n frameDelay = 8;\r\n }\r\n \r\n return frameDelay * 60;\r\n }",
"public void computeAnimationFrame(int frame) {\n\t\tFont f = fnt[(frame < nSteps) ? frame : (nSteps - 1)];\r\n\t\ttxt.setFont(f);\r\n\t\tStopSize.set(f.getSize());\r\n\t}",
"@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tif (frameTick > 30) {\n\t\t\tframeTick = 0;\n\t\t\tframeState = (frameState + 1) % 2;\n\t\t}\n\t\tgc.drawImage(imageFrame.get(frameState), position.first - GameCanvas.getCurrentInstance().getStartX(),\n\t\t\t\tposition.second);\n\t\tframeTick++;\n\t}",
"public void run()\r\n {\n long lastTime = System.nanoTime();\r\n long timer = System.currentTimeMillis();\r\n // create quotient\r\n final double ns = 1000000000.0 / 60.0;\r\n // difference between start time and current time\r\n double delta = 0;\r\n // counter for frames per second\r\n int frames = 0;\r\n // counter for updates per second\r\n int updates = 0;\r\n\r\n while (running)\r\n {\r\n long now = System.nanoTime();\r\n // add up the times of every loop run and get the value in seconds /\r\n // 60 (basically increase by 1/60th of a second every loop)\r\n delta += (now - lastTime) / ns;\r\n lastTime = now;\r\n // gets called 60 times per second because of delta calculation\r\n while (delta >= 1)\r\n {\r\n update();\r\n updates++;\r\n delta--;\r\n }\r\n\r\n view.render();\r\n frames++;\r\n\r\n // gets called every second\r\n if (System.currentTimeMillis() - timer > 1000)\r\n {\r\n // \"reset\" timer variable\r\n timer += 1000;\r\n System.out.println(updates + \" ups, \" + frames + \" fps\");\r\n view.setTitle(\"| \" + updates + \" ups, \" + frames + \" fps\" + \" |\");\r\n // reset frames and updates variables to start counting from 0\r\n // at the start of every second\r\n frames = 0;\r\n updates = 0;\r\n }\r\n }\r\n }",
"public void clock(double period);",
"private long caclFrameTime(long frameTime, long it, long lastFrameTime) {\n\t\t\tlong currentFrameTime;\n\t\t\tif (it > ALPHA)\n\t\t\t\tcurrentFrameTime = (ALPHA * frameTime + lastFrameTime)\n\t\t\t\t\t\t/ (ALPHA + 1);\n\t\t\telse\n\t\t\t\tcurrentFrameTime = (it * frameTime + lastFrameTime) / (it + 1);\n\t\t\treturn currentFrameTime;\n\t\t}",
"public int executeFrame() {\n\t\t// Run one frame. This takes the time stamp marking the end of the frame\r\n\t\t// and then processes events for that frame retroactively. This method\r\n\t\t// has\r\n\t\t// the advantage of flexibility, especially if the frame rate\r\n\t\t// fluctuates.\r\n\t\t// However it is always a little behind, because it can't compute the\r\n\t\t// frame length until the end of the frame is reached. With a fixed\r\n\t\t// known\r\n\t\t// frame rate you could optimize things a bit and make the start/end\r\n\t\t// times\r\n\t\t// correspond exactly with real time.\r\n\t\t//\r\n\t\tm_clock.beginFrame();\r\n\t\t// long started = m_clock.GetSystem();\r\n\r\n\t\t//\r\n\t\t// Execute any time-based tasks\r\n\t\t//\r\n\t\t// (1) Pop the next task off the list. Since the list is always\r\n\t\t// sorted, the first item in the list is always the next task.\r\n\t\t// (2) Execute it and update times\r\n\t\t// (3) If it's expired, delete it\r\n\t\t// Otherwise, insert it into the list in its new position\r\n\t\t//\r\n\t\tTaskInfo pTaskInfo = null;\r\n\t\tTaskInfo save = m_pTaskList;\r\n\t\tpTaskInfo = getNextTimeTask(pTaskInfo);\r\n\t\twhile (pTaskInfo != null) {\r\n\t\t\tm_clock.advanceTo(pTaskInfo.time.next);\r\n\r\n\t\t\tpTaskInfo.pTask.execute(pTaskInfo.id, m_clock.getTime(), pTaskInfo.pUser);\r\n\t\t\tpTaskInfo.time.last = pTaskInfo.time.next;\r\n\t\t\tpTaskInfo.time.next += pTaskInfo.time.period;\r\n\t\t\tpTaskInfo = getNextTimeTask(pTaskInfo);\r\n\t\t}\r\n\t\tm_pTaskList = save;\r\n\t\tpTaskInfo = m_pTaskList;\r\n\t\twhile (pTaskInfo != null) {\r\n\r\n\t\t\tif (pTaskInfo.time.duration == 0 || pTaskInfo.time.duration >= pTaskInfo.time.next) {\r\n\t\t\t\t// re-insert into list with updated time\r\n\t\t\t\t// InsertTimeTask(pTaskInfo);\r\n\t\t\t} else {\r\n\t\t\t\t// task is expired, delete it\r\n\t\t\t\t// printf(\"Sched: Expired %d\\n\",pTaskInfo->id);\r\n\t\t\t\t// delete pTaskInfo;\r\n\t\t\t\tterminate(pTaskInfo.id);\r\n\t\t\t}\r\n\t\t\tpTaskInfo = pTaskInfo.pNext;\r\n\t\t}\r\n\r\n\t\t//\r\n\t\t// Advance simulation clock to end of frame\r\n\t\t//\r\n\t\tm_clock.advanceToEnd();\r\n\r\n\t\t//\r\n\t\t// Now execute all frame tasks in round-robin fashion.\r\n\t\t// Frame tasks always execute at the end of the frame just\r\n\t\t// before rendering. A priority scheme could be used to\r\n\t\t// control sequence. It would be more efficient to keep the\r\n\t\t// list sorted, the same as with time tasks (exe\r\n\t\t//\r\n\t\tsave = m_pFrameList;\r\n\t\tpTaskInfo = m_pFrameList;\r\n\t\tpTaskInfo = getNextFrameTask(pTaskInfo);\r\n\t\t// TaskInfo * pPrev = NULL;\r\n\t\twhile (pTaskInfo != null) {\r\n\t\t\tpTaskInfo.pTask.execute(pTaskInfo.id, m_clock.getFrame(), pTaskInfo.pUser);\r\n\t\t\tpTaskInfo.time.last = pTaskInfo.time.next;\r\n\t\t\tpTaskInfo.time.next += pTaskInfo.time.period;\r\n\t\t\tpTaskInfo = getNextFrameTask(pTaskInfo);\r\n\t\t}\r\n\t\tm_pFrameList = save;\r\n\t\t// 检测是否有到期的任务\r\n\t\tpTaskInfo = m_pFrameList;\r\n\t\twhile (pTaskInfo != null) {\r\n\t\t\tif (pTaskInfo.time.duration == 0 || pTaskInfo.time.duration >= pTaskInfo.time.next) {\r\n\t\t\t\t// re-insert into list with updated time\r\n\t\t\t\t// InsertFrameTask(pTaskInfo);\r\n\t\t\t} else {\r\n\t\t\t\t// task is expired, delete it\r\n\t\t\t\t// printf(\"Sched: Expired %d\\n\",pTaskInfo->id);\r\n\t\t\t\t// delete pTaskInfo;\r\n\t\t\t\tterminate(pTaskInfo.id);\r\n\t\t\t}\r\n\t\t\tpTaskInfo = pTaskInfo.pNext;\r\n\t\t}\r\n\t\tm_pFrameList = save;\r\n\t\t//\r\n\t\t// render\r\n\t\t//\r\n\t\tif (renderTask.pTask != null) {\r\n\t\t\trenderTask.pTask.execute(renderTask.id, m_clock.getFrame(), renderTask.pUser);\r\n\t\t}\r\n\r\n\t\t//\r\n\t\t// here is where we could do idle processing or load balancing\r\n\t\t//\r\n\t\t// long elapsed = m_clock.GetSystem() - started;\r\n\t\t// long frameLength = m_clock.GetFrameEnd() - m_clock.GetFrameStart();\r\n\t\t// printf(\"Busy %u ms, idle %u ms\\n\", elapsed, frameLength - elapsed);\r\n\r\n\t\t//\r\n\t\t// If any tasks are terminated during execution, it is easier to leave\r\n\t\t// them in the list until we're finished iterating through it, then\r\n\t\t// sweep\r\n\t\t// them out later.\r\n\t\t//\r\n\t\t// printf(\"EXEC END\\n\");\r\n\t\tfor (Long i : queue) {\r\n\t\t\tterminate(i);\r\n\t\t}\r\n\t\tsweepGarbage();\r\n\t\treturn 0;\r\n\t}",
"public double readClock()\n {\n\tif (frameByFrameClock) {\n\t return frameNumber * (1/30.0f);\n\t} else {\n\t long elapsed;\n\t \n\t if (drawAnimation.value) {\n\t\t// Time during animation\n\t\telapsed = System.currentTimeMillis() - startTime;\n\t } else {\n\t\t// Time during pause\n\t\telapsed = pauseTime - startTime;\n\t }\n\t \n\t return elapsed / 1000.0f;\n\t}\n }",
"public void run() {\n this.requestFocus();\n long lastTime = System.nanoTime();\n double amountOfTicks = 60.0;\n double ns = 1000000000 / amountOfTicks;\n double delta = 0;\n long timer = System.currentTimeMillis();\n int frames = 0;\n while (running) {\n long now = System.nanoTime();\n delta += (now - lastTime) / ns;\n lastTime = now;\n while (delta >= 1) {\n tick();\n delta--;\n }\n if (running) {\n render();\n }\n frames++;\n if (System.currentTimeMillis() - timer > 1000) {\n timer += 1000;\n System.out.println(\"FPS: \" + frames);\n\n frames = 0;\n }\n }\n stop();\n }",
"public void tick() {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n\n if(elapsed>delay) {\n currentFrame++;\n startTime = System.nanoTime();\n }\n if(currentFrame == images.length){\n currentFrame = 0;\n }\n }",
"static void loopcomp () {\r\n\t\tint t40k= timer(8000,40000); \r\n\t\tint t1k= timer(8000,1000); \r\n\t\tSystem.out.println(\"Total number of loops for printing every 40k loops = \" + t40k);\r\n\t\tSystem.out.println(\"Total number of loops for printing every 1k loops = \"+ t1k);\r\n\t}",
"public void run() {\n\t\tlong lastTime = System.nanoTime();\n\t\tlong timer = System.currentTimeMillis();\n\t\tfinal double ns = 1000000000.0/60;\n\t\tdouble delta = 0;\n\t\tint frames = 0;\n\t\tint updates = 0;\n\t\trequestFocus();\n\t\twhile(running){\n\t\t\tlong now = System.nanoTime();\n\t\t\tdelta += (now-lastTime) /ns;\n\t\t\tlastTime = now;\n\t\t\twhile(delta >= 1){//60 times per sec\n\t\t\t\ttick();\n\t\t\t\tupdates++;\n\t\t\t\tdelta--;\n\t\t\t}\n\t\t\trender();//as fast as i can\n\t\t\tframes ++;\n\t\t\tif(System.currentTimeMillis() -timer > 1000){\n\t\t\t\ttimer += 1000;\n\t\t\t\tSystem.out.println(\"Fps:\"+frames+\" Updates:\"+updates);\n\t\t\t\tupdates = 0;\n\t\t\t\tframes = 0;\n\t\t\t\tthis.seconds++;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private double computeFPS(double t)\n {\n\tif (t == 0 || !drawAnimation.value) {\n\t numPrevT = 0;\n\t return 0;\n\t}\n\n\tint which = numPrevT % prevT.length;\n\tdouble tdiff = t - prevT[which];\n\n\tprevT[which] = t;\n\tnumPrevT++;\n\n\t// Only compute frame rate when valid\n\tif (numPrevT <= prevT.length || tdiff <= 0) {\n\t return 0;\n\t}\n\n\treturn prevT.length / tdiff;\n }",
"public void setAnimationFrameTime(int milis) {\r\n animationFrameTime = milis; \r\n timer = new Timer(animationFrameTime, this);\r\n }",
"private void gameLoop() {\n\n\t\tlong elapsedTime = 0;\n\t\tlong newTime;\n\t\tlong oldTime = System.nanoTime();\n\t\tlong expectedTime = 1000000000 / 60;\n\t\tdouble delta;\n\n\t\tint frames = 0;\n\t\tlong frameTimer = 0;\n\n\t\twhile (!Display.isCloseRequested() && !gameOver) {\n\n\t\t\t// get new time, find elapsed time, determine delta\n\t\t\tnewTime = System.nanoTime();\n\t\t\telapsedTime = newTime - oldTime;\n\t\t\tdelta = (double)elapsedTime / (double)expectedTime;\n\t\t\toldTime = newTime;\n\n\t\t\t// update frame count\n\t\t\tframes++;\n\t\t\tframeTimer += elapsedTime;\n\n\t\t\t// if a second has passed, print the fps\n\t\t\tif (frameTimer >= 1000000000) {\n\t\t\t\tSystem.out.println(\"FPS: \" + frames);\n\t\t\t\tSystem.out.println(delta);\n\t\t\t\tframeTimer = Math.max(0, frameTimer - 1000000000);\n\t\t\t\tframes = 0;\n\t\t\t}\n\n\t\t\t// update game state\n\t\t\tsoundManager.update();\n\t\t\tstateManager.update(delta);\n\t\t\tstateManager.render();\n\t\t\tgui.update();\n\t\t\tDisplay.update();\t\n\n\t\t\t// sleep until 1/60 of a second has passed\n\t\t\tif (newTime - oldTime < expectedTime) {\n\n\t\t\t\twhile (newTime - oldTime < expectedTime) {\n\n\t\t\t\t\tnewTime = System.nanoTime();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(0);\n\t\t\t\t\t} catch (InterruptedException e) { } \n\n\t\t\t\t} \n\t\t\t}\n\t\t\telse {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(0);\n\t\t\t\t} catch (InterruptedException e) { }\n\t\t\t}\n\n\t\t}\n\t}",
"public void runAnimation() {\n int fps = 0;\n int frames = 0;\n long totalTime = 0;\n long curTime = System.currentTimeMillis();\n long lastTime = curTime;\n // Start the loop.\n while (true) {\n try {\n // Calculations for FPS.\n lastTime = curTime;\n curTime = System.currentTimeMillis();\n totalTime += curTime - lastTime;\n if (totalTime > 1000) {\n totalTime -= 1000;\n fps = frames;\n frames = 0;\n }\n ++frames;\n // clear back buffer...\n g2d = buffer.createGraphics();\n g2d.setColor(Color.WHITE);\n g2d.fillRect(0, 0, X, Y);\n // Draw entities\n ArrayList<Spawn> living = new ArrayList<Spawn>();\n if (engine != null) {\n living.addAll(engine.getFullState().living);\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.BLACK);\n Spawn s = living.get(i);\n g2d.fill(new Ellipse2D.Double(s.getX(), s.getY(), s.getRadius() * 2, s.getRadius() * 2));\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.RED);\n Spawn s = living.get(i);\n g2d.drawLine((int) (s.getCenterX()), (int) (s.getCenterY()), (int) (s.getCenterX() + s.vx()), (int) (s.getCenterY() + s.vy()));\n }\n // display frames per second...\n g2d.setFont(new Font(\"Courier New\", Font.PLAIN, 12));\n g2d.setColor(Color.GREEN);\n g2d.drawString(String.format(\"FPS: %s\", fps), 20, 20);\n // Blit image and flip...\n graphics = b.getDrawGraphics();\n graphics.drawImage(buffer, 0, 0, null);\n if (!b.contentsLost())\n b.show();\n // Let the OS have a little time...\n Thread.sleep(15);\n } catch (InterruptedException e) {\n } finally {\n // release resources\n if (graphics != null)\n graphics.dispose();\n if (g2d != null)\n g2d.dispose();\n }\n }\n }",
"private void switchTimeBase()\n {\n currentFrame.size = 0L;\n currentFrame.completeTimeMs = -1L;\n currentFrame.timestamp = -1L;\n prevFrame.copy(currentFrame);\n }",
"public static int getTimeSeconds() {\n return Atlantis.getBwapi().getFrameCount() / 30;\n }",
"public void run() {\n long lasTime = System.nanoTime();//pega o tempo atual do nosso computador em nano segundos, isso da mais precisão nos fps de maneira profissional\n double amountOfTicks = 60.0;//local onde seta o FPS.\n double ns = 1000000000 / amountOfTicks;//calculo para saber o momento certo de atualizar a tela do jogo\n double delta = 0;\n int frames = 0;\n double timer = System.currentTimeMillis();//retorna o tempo do computador, usamos isso para contagem do fps, mas é opcional.\n requestFocus();//Método que foca a tela automaticamente\n while(isRunning){\n long now = System.nanoTime();\n delta+= (now - lasTime) / ns;\n lasTime = now;\n if(delta >= 1) {\n tick();//atualização da tela.\n render();//renderização da tela.\n frames++;\n delta--;\n }\n\n if(System.currentTimeMillis() - timer >= 1000){\n System.out.println(\"FPS: \" + frames);\n frames = 0;\n timer+= 1000;\n }\n\n }\n\n stop();\n }",
"protected abstract float getFrameTimeNormalAnimation();",
"public void update(float dt){\n currentFrameTime += dt;\n if (currentFrameTime > maxFrameTime) {\n frame++;\n currentFrameTime = 0;\n }\n\n if (frame >= frameCount) {\n frame = 0;\n }\n }",
"private void updateTime(){\n currentTime = System.currentTimeMillis();\n float tp = previousTime;\n previousTime = (float)(currentTime - startingTime);\n dt = previousTime - tp;\n fps = 1000f/dt;\n }",
"private void startClock() {\r\n\t\tTimer timer = new Timer(500, new ActionListener() {\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent theEvent) {\r\n\t\t\t\tadvanceTime();\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n timer.setRepeats(true);\r\n timer.setCoalesce(true);\r\n timer.setInitialDelay(0);\r\n timer.start();\r\n\t}",
"public void frameBackward()\n{\n stop();\n setTime(getTime() - getInterval());\n}",
"public void setFrameRate(float aValue) { setInterval(Math.round(1000/aValue)); }",
"@Override\n\tpublic float getTimePerFrame() {\n\t\treturn tpf;\n\t}",
"public void animate() throws InterruptedException {\n for (int x = 0; x < repeat; x++) {\n for (int i = 0; i < MAX_FRAMES; i++) {\n nextFrame();\n pause();\n }\n changeDelay();\n }\n }",
"public static int getTimeFrames() {\n return Atlantis.getBwapi().getFrameCount();\n }",
"public void timer()\n{\n textSize(13);\n controlP5.getController(\"time\").setValue(runtimes);\n line(400, 748, 1192, 748);\n fill(255,0,0);\n for (int i =0; i<25; i++)\n {\n line(400+i*33, 743, 400+i*33, 753);\n text(i, 395 +i*33, 768);\n }\n if ((runtimes < 1 || runtimes > 28800) && s == true)\n {\n //origint = 0;\n runtimes = 1;\n //pausets = 0;\n runtimep = 0;\n } else if (runtimes > 0 && runtimes < 28800 && s == true)\n {\n runtimep = runtimes;\n runtimes = runtimes + speed;\n }\n timeh= runtimes/1200;\n timem= (runtimes%1200)/20;\n}",
"private void listFrames() {\n System.out.println(\"\\nFrames:\");\n MasterFrame master = world.getMasterFrame();\n System.out.println(master.getName() + \" moving at \" + master.getVelocity() + \"c.\");\n for (ReferenceFrame frame: world.getRelativeFrames()) {\n String speed = \" moving at \" + frame.getVelocity() + \"c relative to \" + master.getName() + \".\";\n System.out.println(frame.getName() + speed);\n }\n }",
"public void initFPS() {\n FPS = 60;\n targetTime = 1000 / FPS;\n\n gameClock = new NanoClock();\n }",
"public static void run()\r\n\t{\r\n\t\tlong lastTime = System.nanoTime();\r\n\t\tdouble nsPerTick = 1000000000D / 30D;\r\n\t\t\r\n\t\tlong lastTimer = System.currentTimeMillis();\r\n\t\tdouble delta = 0; \r\n\r\n\t\twhile(isRunning)\r\n\t\t{\r\n\t\t\tlong now = System.nanoTime();\r\n\t\t\tdelta += (now - lastTime) / nsPerTick;\r\n\t\t\tlastTime = now;\r\n\t\t\t\r\n\t\t\twhile(delta >= 1)\r\n\t\t\t{\r\n\t\t\t\tdisplay.update();\r\n\t\t\t\tdisplay.render();\r\n\t\t\t\tdelta -= 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(System.currentTimeMillis() - lastTimer > 1000)\r\n\t\t\t{\r\n\t\t\t\tlastTimer += 1000;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void drawCallDurations(GC gc) {\n if (mCalls == null || mCalls.size() < mEndCallIndex) {\n return;\n }\n\n gc.setBackground(mDurationLineColor);\n\n int callUnderScan = mPositionHelper.getCallUnderScanValue();\n for (int i = mStartCallIndex; i < mEndCallIndex; i += callUnderScan) {\n boolean resetColor = false;\n GLCall c = mCalls.get(i);\n\n long duration = c.getWallDuration();\n\n if (c.hasErrors()) {\n gc.setBackground(mGlErrorColor);\n resetColor = true;\n\n // If the call has any errors, we want it to be visible in the minimap\n // regardless of how long it took.\n duration = mPositionHelper.getMaxDuration();\n } else if (c.getFunction() == Function.glDrawArrays\n || c.getFunction() == Function.glDrawElements\n || c.getFunction() == Function.eglSwapBuffers) {\n gc.setBackground(mGlDrawColor);\n resetColor = true;\n\n // render all draw calls & swap buffer at max length\n duration = mPositionHelper.getMaxDuration();\n }\n\n Rectangle bounds = mPositionHelper.getDurationBounds(\n i - mStartCallIndex,\n c.getContextId(),\n duration);\n gc.fillRectangle(bounds);\n\n if (resetColor) {\n gc.setBackground(mDurationLineColor);\n }\n }\n }",
"public void run()\n\t{\n\t\tfloat oneFrame = 1000000000.0f / gameFPS;\n\t\t//same but for animation frames\n\t\tfloat oneAnimFrame = 1000000000.0f / animFPS;\n\t\t//current time in nanoseconds\n\t\tlong now = 0;\n\t\t//holds time of last iteration of game loop\n\t\tlong last = System.nanoTime();\n\t\t//how many frames have passed (can be a fraction)\n\t\tfloat delta = 0;\n\t\t//same but for anim frames\n\t\tfloat animDelta = 0;\n\t\t\n\t\t//for counting and displaying only \n\t\tint countFrames = 0;\n\t\tlong lastMilli = System.currentTimeMillis();\n\t\t\n\t\trequestFocus();\n\t\t//game loop\n\t\twhile (playing)\n\t\t{\n\t\t\t\n\t\t\tnow = System.nanoTime();\n\t\t\t//(now - last) time elapsed, divided by oneFrame gives\n\t\t\t//what fraction of a frame has passed\n\t\t\tdelta += (now - last) / oneFrame;\n\t\t\tanimDelta += (now - last) / oneAnimFrame;\n\t\t\tlast = now;\n\t\t\t//keep calling tick for as many frames have passed\n\t\t\t//if it's at least 1\n\t\t\tif (delta >= 1.0f)\n\t\t\t{\n\t\t\t\tcountFrames++;\n\t\t\t\twhile (delta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (animDelta >= 1.0f)\n\t\t\t{\n\t\t\t\twhile (animDelta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tanimTick();\n\t\t\t\t\tanimDelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\trender();\n\t\t\tcountFrames++;\n\t\t\tif (Math.abs(System.currentTimeMillis() - lastMilli) >= 1000)\n\t\t\t{\n\t\t\t\tFPS = countFrames;\n\t\t\t\tcountFrames = 0;\n\t\t\t\tlastMilli = System.currentTimeMillis();\n\t\t\t}\n\t\t}\n\t}",
"protected void framing(double inputSignal[]){\n double numFrames = (double)inputSignal.length / (double)(frameLength - shiftInterval);\n \n // unconditionally round up\n if ((numFrames / (int)numFrames) != 1){\n numFrames = (int)numFrames + 1;\n }\n \n // use zero padding to fill up frames with not enough samples\n double paddedSignal[] = new double[(int)numFrames * frameLength];\n for (int n = 0; n < inputSignal.length; n++){\n paddedSignal[n] = inputSignal[n];\n }\n\n frames = new double[(int)numFrames][frameLength];\n\n // break down speech signal into frames with specified shift interval to create overlap\n for (int m = 0; m < numFrames; m++){\n for (int n = 0; n < frameLength; n++){\n frames[m][n] = paddedSignal[m * (frameLength - shiftInterval) + n];\n }\n }\n }",
"@Override\n\tpublic void run() {\n\t\tif (state != 3) {\n\t\t\tthis.requestFocus();\n\t\t\tlong lastTime = System.nanoTime();\n\t\t\tdouble amountOfTicks = 60.0;\n\t\t\tdouble ns = 1000000000 / amountOfTicks;\n\t\t\tdouble delta = 0;\n\t\t\tlong timer = System.currentTimeMillis();\n\t\t\tint frames = 0;\n\t\t\twhile (isRunning) {\n\n\t\t\t\tlong now = System.nanoTime();\n\n\t\t\t\tdelta += (now - lastTime) / ns;\n\t\t\t\tlastTime = now;\n\n\t\t\t\twhile (delta >= 1) {\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t\trender();\n\t\t\t\tframes++;\n\n\t\t\t\tif (System.currentTimeMillis() - timer > 1000) {\n\t\t\t\t\ttimer += 1000;\n\t\t\t\t\tframes = 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tstop();\n\n\t\t}\n\n\t}",
"public double getFrameTime() {\n\n\t\t// Convert from milliseconds to seconds\n\t\treturn getInteger(ADACDictionary.FRAME_TIME) / 1000;\n\n\t}",
"public void stepForward(){\n\t\tif(timer == null){ return; }\n\t\ttimer.stop();\n\t\n\t\t//check to see if we have reached the last frame\n\t\tif(frameIndex == frames.length-1){ frameIndex = 0; }\n\t\telse{ frameIndex++; }\n\t\n\t\tframes[frameIndex].display();\n frames[frameIndex].clearDisplay();\n\t}",
"public void clockChange(int time);",
"public void shiftFrames(int fromTime, int aShiftTime)\n{\n // Scale frames for shapes\n for(int i=0, iMax=getOwner().getChildCount(); i<iMax; i++)\n shiftFrames(getOwner().getChild(i), fromTime, aShiftTime);\n \n // If new time beyond max, reset max time\n setTime(fromTime + aShiftTime);\n setMaxTime(getMaxTime() + aShiftTime);\n}",
"public void nextFrame() {\r\n if (frame < maxFrames - 1) {\r\n frame++;\r\n } else {\r\n frame = 0;\r\n }\r\n }",
"private void calculateDelta() {\n // 60 fps <=> delta ~ 0.016f\n //\n long curTime = SystemClock.elapsedRealtimeNanos();\n delta = (curTime - lastTime) / 1_000_000_000.0f;\n lastTime = curTime;\n }",
"public void run() {\n while (true) {\n animate();\n repaint();\n \n \n double seconds = .04; //time that 1 frame takes.\n int miliseconds = (int) (1000.0 * seconds);\n try {\n Thread.sleep(miliseconds);\n } catch (InterruptedException e) {\n }\n }\n }",
"public void moveForward() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t // 2\n\t\tseconds += tic;\n\t\tif (seconds >= 60.0) {\n\t\t\tseconds -= 60.0;\n\t\t\tminutes++;\n\t\t\tif (minutes == 60) {\n\t\t\t\tminutes = 0;\n\t\t\t\thours++;\n\t\t\t}\n\t\t}\n\t}",
"public void render(int gameSpeed){\n counterFrames++;\n if (counterFrames*gameSpeed*1000 >= (60 * (delay))){\n setDone();\n }\n }",
"public void run() {\n\t\tinitialise();\n\t\tlong beforeTime, afterTime, deltaTime = 0;\n\t\tlong counter = System.nanoTime() + 1000000000;\n\t\tint maxFPS = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes()[0]\n\t\t\t\t.getRefreshRate();\n\t\tif (maxFPS == 0) {\n\t\t\tmaxFPS = 60;\n\t\t}\n\t\tint fps = 0;\n\t\tlong minFrameTime = 1000000000l / maxFPS;\n\t\tdeltaTime = 1;\n\t\tupdate(0);\n\t\twhile (running) {\n\t\t\tbeforeTime = System.nanoTime();\n\t\t\tdraw();\n\t\t\tupdate(deltaTime / 1000000000f);\n\t\t\tafterTime = System.nanoTime();\n\t\t\tdeltaTime = afterTime - beforeTime;\n\t\t\tfps++;\n\t\t\tif (deltaTime < minFrameTime) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep((minFrameTime - deltaTime) / 1000000l);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (System.nanoTime() > counter) {\n\t\t\t\tcounter += 1000000000;\n\t\t\t\tSystem.out.println(fps);\n\t\t\t\tfps = 0;\n\t\t\t}\n\t\t}\n\t\tclose();\n\t}",
"private void createAnimation () {\n // KeyFrame frame = new KeyFrame(Duration.millis(MILLISECOND_DELAY), e -> myManager.step());\n // myAnimation = new Timeline();\n // myAnimation.setCycleCount(Timeline.INDEFINITE);\n // myAnimation.getKeyFrames().add(frame);\n }",
"public void play(){\n\t\tif(timer == null){ return; }\n\t\t//1000ms in a second, so divided by frames per second gives ms interval \n\t\ttimer.setDelay(1000/fps);\n\t\ttimer.start();\n\t}",
"public float getFramesPerSecond() {\n return 1 / frametime;\n }",
"@Override\n public void doFrame(long frameTimeNanos) {\n long now = System.currentTimeMillis();\n\n mVsyncBuffer[mVsyncIndex] = now - mLastVsync;\n\n float sum = 0L;\n mAvailableDataPoints = 0;\n float dropped = 0;\n float missing = 0;\n mPeak = 0;\n\n for (long vsync : mVsyncBuffer) {\n if (vsync <= 0) {\n continue;\n }\n\n sum += vsync;\n mAvailableDataPoints++;\n\n if (vsync > mPeak) {\n mPeak = vsync;\n }\n\n if (vsync > 17) {\n missing++;\n } else if (vsync > 34) {\n dropped++;\n }\n }\n\n // 1 second / total vsync time for 60 frames\n mAverageDuration = sum / mAvailableDataPoints;\n mMissingPercentage = 100 * (missing / mAvailableDataPoints);\n mDroppedPercentage = 100 * (dropped / mAvailableDataPoints);\n mRenderedFrames = mAvailableDataPoints - (missing + dropped);\n mFps = mAvailableDataPoints * (1000 / sum);\n\n mLastVsync = now;\n mVsyncIndex++;\n if (mVsyncIndex >= BUFFER_SIZE) {\n mVsyncIndex = 0;\n }\n\n Choreographer.getInstance().postFrameCallback(this);\n }",
"public void rotateClockWise() {\r\n\r\n transpose();\r\n\r\n // swap columns\r\n for (int col = 0; col < pixels[0].length / 2; col++) {\r\n for (int row = 0; row < pixels.length; row++) {\r\n int tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][pixels[0].length - 1 - col];\r\n pixels[row][pixels[0].length - 1 - col] = tmp;\r\n }\r\n }\r\n\r\n this.pix2img();\r\n }",
"private void startCountTime() {\n\t\tRunnable timerRunnable = () -> {\n\t\t\tinitTimer();\n\t\t\tlong millisWaitTime = 1000/CALCULATIONS_PER_SECOND;\n\t\t\tlong currT, nextT;\n\t\t\t//previous time\n\t\t\tlong prevT = System.nanoTime();\n\t\t\twhile (this.keepRunning) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(millisWaitTime);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\tcurrT = System.nanoTime();\n\t\t\t\tthis.time = (double)(currT - prevT) * 0.000000001;\n\t\t\t\tprevT = currT;\n\t\t\t\tnextT = prevT + 1000000000 / CALCULATIONS_PER_SECOND;\n\t\t\t\tthis.gameLogic.updateGame(time);\n\t\t\t\t// stop the timer game if the player lose\n\t\t\t\tif(this.gameLogic.playerLose()) {\n\t\t\t\t\tthis.stopCountTime();\n\t\t\t\t}\n\t\t\t\tlong timeWait = Math.max(nextT - System.nanoTime(),0);\n\t\t\t\ttimeWait += INCREASE_WAIT;\n\t\t\t\tmillisWaitTime = timeWait / 1000000;\n\t\t\t}\n\t\t};\n\t\tgameTimeThread = new Thread(timerRunnable);\n\t\tgameTimeThread.start();\n\t}",
"public static double timePer1000Byte(int frameSize, double frameRate) {\r\n return 1E6 / (frameSize * frameRate); \r\n }",
"public ClockPanel() {\n Border border = BorderFactory.createLineBorder(Color.green, 5); //creates a border\n setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0));\n setLabels();\n setBackground(new Color(0, 0, 0));\n setBorder(border);\n setBounds(0, 0, 390, 170);\n setVisible(true);\n\n timer = new Timer();\n TimerTask task = new TimerTask() {\n @Override\n public void run() {\n tickTock();\n }\n };\n timer.scheduleAtFixedRate(task, 0, 1000);\n }",
"private void advanceTime(){\n\t minute++;\n\t while (minute > 59) {\n\t minute -= 60;\n\t hour++;\n\t }\n\t while (hour > 23) {\n\t hour -= 24;\n\t day++;\n\t }\n\t while (day > 6) {\n\t day -= 7;\n\t }\n\n\t }",
"protected void runClock() {\r\n // stop gameClock while game is iconified\r\n if( isRunning && (getState() == Frame.NORMAL) ) {\r\n seconds++;\r\n\r\n int hrs = seconds / 3600;\r\n int mins = seconds / 60 - hrs * 60;\r\n int secs = seconds - mins * 60 - hrs * 3600;\r\n\r\n String strHr = (hrs < 10 ? \"0\" : \"\") + Integer.toString( hrs );\r\n String strMin = (mins < 10 ? \"0\" : \"\") + Integer.toString( mins );\r\n String strSec = (secs < 10 ? \"0\" : \"\") + Integer.toString( secs );\r\n\r\n timeMesg.setText( strHr + \":\" + strMin + \":\" + strSec );\r\n }\r\n }",
"private void drawTimeLine (Graphics g) {\n g.setColor (parent.parent.parent.rulerColor);\n g.fillRect (0, _yPix - 3 * parent.lineSize, _xPix, 3 * parent.lineSize);\n \n g.setColor (Color.black);\n g.drawLine (0, _yPix - 3 * parent.lineSize, _xPix, _yPix - 3 * parent.lineSize);\n double inchT = parent.getTime (parent.dpi); if (inchT <= 0) return;\n int i = (int)Math.rint (begT / inchT);\n double t = i * inchT;\n while (t < endT) {\n int xcord = i * parent.dpi - parent.getEvtXCord (begT) - \n (int)Math.rint (parent.fm.charWidth ('|') / 2.0);\n \n g.drawString (\"|\", xcord, _yPix - 2 * parent.lineSize - parent.fDescent);\n \n String t1 = (new Float (t)).toString (), t2;\n \n if (t1.indexOf ('E') == -1) {\n\tint index = max;\n\tif (index > t1.length ()) index = t1.length ();\n\tt2 = t1.substring (0, index);\n }\n else {\n\tint exp = t1.indexOf ('E');\n\tString e = t1.substring (exp, t1.length ());\n\t\n\tint si = 5; if (exp < si) si = exp;\n\tString a = t1.substring (0, si);\n\t\n\tt2 = a + e;\n }\n \n g.drawString (t2,\n xcord - (int)Math.rint (parent.fm.stringWidth (t2) / 2.0),\n _yPix - (parent.lineSize + parent.fDescent));\n t = (++i * inchT);\n }\n }",
"public Animation(BufferedImage[] images, long millisPerFrame){\n\t\tthis.images=images;\n\t\tthis.millisPerFrame = millisPerFrame;\n\t\tlooping=true;\n\t\tstart();\n\t}",
"protected void createFrames() {\n createStandingRight();\n createStandingLeft();\n createWalkingRight();\n createWalkingLeft();\n createJumpingRight();\n createJumpingLeft();\n createDying();\n }",
"private FPS(){}",
"private void updateTimer()\r\n {\n if (timeLeft > 0)\r\n {\r\n frameCounter++;\r\n \r\n // if a second has passed\r\n if (frameCounter >= frameRate)\r\n {\r\n // reset the frame counter\r\n frameCounter = 0;\r\n \r\n // update the secondsElapsed var\r\n totalSecondsElapsed++;\r\n \r\n // subtract a second from the timer\r\n timeLeft--;\r\n \r\n // change the time into mins & seconds\r\n int minsLeft = timeLeft / 60;\r\n int secondsLeft = timeLeft % 60;\r\n \r\n // update the time display (min:sec)\r\n String timerDisplay = minsLeft + \":\" + getLeadingZero(secondsLeft, 10) + secondsLeft;\r\n timerText.text = timerDisplay;\r\n timerText.updateText();\r\n }\r\n }\r\n else\r\n {\r\n endGame();\r\n }\r\n }",
"public void doOneFrame(DrawSurface d, double dt) {\n this.gameScreen.drawAllOn(d);\n if (this.counterCurrent > 0) {\n d.setColor(Color.RED);\n d.drawText(d.getWidth() / 2, d.getHeight() / 2, Integer.toString(this.counterCurrent), 50);\n\n }\n if (this.counterCurrent != this.countFrom) {\n sleeper.sleepFor((long) ((this.numOfSeconds / this.countFrom) * 1000));\n }\n this.counterCurrent--;\n\n }",
"private long m18341d(long frameCount) {\n return (1000000 * frameCount) / ((long) this.f16625s);\n }",
"public void doOneFrame(DrawSurface d, double dt) {\r\n\r\n gameScreen.drawAllOn(d);\r\n d.setColor(COLOR);\r\n d.drawText(d.getWidth() / 2, d.getHeight() / 2, this.countFrom + \"...\", 32);\r\n\r\n if (this.countFrom < 3) {\r\n this.sleeper.sleepFor(this.displayTime);\r\n }\r\n\r\n if (this.countFrom == 0) {\r\n this.stop = true;\r\n }\r\n\r\n this.countFrom--;\r\n }",
"public void run(){\n\t\tdouble target = 60.0;\n double nsPerTick = 1000000000.0 / target;\n long lastTime = System.nanoTime();\n long timer = System.currentTimeMillis();\n double unprocessed = 0.0;\n int fps = 0;\n int tps = 0;\n boolean canRender = false;\n \n while (running) {\n long now = System.nanoTime();\n unprocessed += (now - lastTime) / nsPerTick;\n lastTime = now;\n \n if(unprocessed >= 1.0){\n tick();\n unprocessed--;\n tps++;\n canRender = true;\n }else canRender = false;\n \n try {\n Thread.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n \n if(canRender){\n //render\n \trender();\n fps++;\n }\n \n if(System.currentTimeMillis() - 1000 > timer){\n timer += 1000;\n System.out.printf(\"FPS: %d | TPS: %d\\n\", fps, tps);\n fps = 0;\n tps = 0;\n }\n \n }\n \n System.exit(0);\n\t}",
"@HaxeMethodBody(\n\t\t\"{% if extra.fps %}return {{ extra.fps }};{% else %}return 60;{% end %}\"\n\t)\n\tpublic static int getFramesPerSecond() {\n\t\treturn 60;\n\t}",
"public abstract void renderFrame(Window window, float musicTime);",
"public void start() {\n initGUI();\n initDemo();\n\n float target = 1000 / 60.0f;\n float frameAverage = target;\n long lastFrame = System.currentTimeMillis();\n float yield = 10000f;\n float damping = 0.1f;\n\n while (running) {\n // adaptive timing loop from Master Onyx\n long timeNow = System.currentTimeMillis();\n frameAverage = (frameAverage * 10 + (timeNow - lastFrame)) / 11;\n lastFrame = timeNow;\n\n yield += yield * ((target / frameAverage) - 1) * damping + 0.05f;\n\n for (int i = 0; i < yield; i++) {\n Thread.yield();\n }\n\n update();\n\n // render\n Graphics2D g = (Graphics2D) strategy.getDrawGraphics();\n g.setColor(background);\n g.fillRect(0, 0, 500, 500);\n\n draw(g);\n renderGUI(g);\n g.dispose();\n strategy.show();\n }\n }",
"public TimePanel(JFrame theFrame) {\r\n\t\tsuper();\r\n\t\tthis.setBounds(10, 10, 326, 103);\r\n\t\ttheFrame.getContentPane().add(this);\r\n\t\tthis.setLayout(null);\r\n\t\t\r\n\t\tfinal Random rand = new Random();\r\n\t\t\r\n\t\tJLabel timeLabel = new JLabel(\"Time\");\r\n\t\ttimeLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\ttimeLabel.setFont(new Font(\"Verdana\", Font.BOLD, 12));\r\n\t\ttimeLabel.setBounds(113, 5, 48, 14);\r\n\t\tthis.add(timeLabel);\r\n\t\t\r\n\t\tmyCurrentTimeLabel = new JLabel(DateFormat.getDateTimeInstance().format(new Date()));\r\n\t\tmyCurrentTimeLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmyCurrentTimeLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tmyCurrentTimeLabel.setBounds(55, 23, 180, 17);\r\n\t\tthis.add(myCurrentTimeLabel);\r\n\t\tstartClock();\r\n\t\t\r\n\t\tmySunsetTime = new JLabel(\"16:\" + (50 + (rand.nextInt(8) - 4)));\r\n\t\tmySunsetTime.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmySunsetTime.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tmySunsetTime.setBounds(182, 48, 48, 14);\r\n\t\tthis.add(mySunsetTime);\r\n\t\t\r\n\t\tJLabel mySunsetLabel = new JLabel(\"Sunset\");\r\n\t\tmySunsetLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmySunsetLabel.setFont(new Font(\"Verdana\", Font.BOLD, 10));\r\n\t\tmySunsetLabel.setBounds(136, 48, 48, 14);\r\n\t\tthis.add(mySunsetLabel);\r\n\t\t\r\n\t\tJLabel myLowLabel = new JLabel(\"Low\");\r\n\t\tmyLowLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmyLowLabel.setFont(new Font(\"Verdana\", Font.BOLD, 10));\r\n\t\tmyLowLabel.setBounds(133, 68, 48, 14);\r\n\t\tthis.add(myLowLabel);\r\n\t\t\r\n\t\tmyLowTemp = new JLabel((40 + (rand.nextInt(16) - 8)) + \"F\");\r\n\t\tmyLowTemp.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmyLowTemp.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tmyLowTemp.setBounds(173, 68, 48, 17);\r\n\t\tthis.add(myLowTemp);\r\n\t\t\r\n\t\tJLabel mySunriseLabel = new JLabel(\"Sunrise\");\r\n\t\tmySunriseLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmySunriseLabel.setFont(new Font(\"Verdana\", Font.BOLD, 10));\r\n\t\tmySunriseLabel.setBounds(40, 48, 48, 14);\r\n\t\tthis.add(mySunriseLabel);\r\n\t\t\r\n\t\tmySunriseTime = new JLabel(\"07:\" + (45 + (rand.nextInt(6) - 3)));\r\n\t\tmySunriseTime.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmySunriseTime.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tmySunriseTime.setBounds(90, 48, 45, 14);\r\n\t\tthis.add(mySunriseTime);\r\n\t\t\r\n\t\tmyHiTemp = new JLabel((48 + (rand.nextInt(5) - 2)) + \"F\");\r\n\t\tmyHiTemp.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmyHiTemp.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tmyHiTemp.setBounds(88, 68, 48, 14);\r\n\t\tthis.add(myHiTemp);\r\n\t\t\r\n\t\tJLabel myHiLabel = new JLabel(\"Hi\");\r\n\t\tmyHiLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tmyHiLabel.setFont(new Font(\"Verdana\", Font.BOLD, 10));\r\n\t\tmyHiLabel.setBounds(45, 68, 48, 14);\r\n\t\tthis.add(myHiLabel);\r\n\t}",
"public void frame()\n{\n for(int cc=1;cc<8;cc++)\n {if (cc==7)\n {\n line(w1+cos(cc*TWO_PI/7)*radiu*1/3, h1+sin(cc*TWO_PI/7)*radiu*1/3, w1+cos(TWO_PI/7)*radiu*1/3, h1+sin(TWO_PI/7)*radiu*1/3);\n line(w1+cos(cc*TWO_PI/7)*radiu*2/3, h1+sin(cc*TWO_PI/7)*radiu*2/3, w1+cos(TWO_PI/7)*radiu*2/3, h1+sin(TWO_PI/7)*radiu*2/3); \n line(w1+cos(cc*TWO_PI/7)*radiu*1, h1+sin(cc*TWO_PI/7)*radiu*1, w1+cos(TWO_PI/7)*radiu*1, h1+sin(TWO_PI/7)*radiu*1);\n}\n else{\n line(w1+cos(cc*TWO_PI/7)*radiu*1/3, h1+sin(cc*TWO_PI/7)*radiu*1/3, w1+cos((cc+1)*TWO_PI/7)*radiu*1/3, h1+sin((cc+1)*TWO_PI/7)*radiu*1/3);\n line(w1+cos(cc*TWO_PI/7)*radiu*2/3, h1+sin(cc*TWO_PI/7)*radiu*2/3, w1+cos((cc+1)*TWO_PI/7)*radiu*2/3, h1+sin((cc+1)*TWO_PI/7)*radiu*2/3);\n line(w1+cos(cc*TWO_PI/7)*radiu*1, h1+sin(cc*TWO_PI/7)*radiu*1, w1+cos((cc+1)*TWO_PI/7)*radiu*1, h1+sin((cc+1)*TWO_PI/7)*radiu*1);\n \n}\n }\n for(int dd=1;dd<8;dd++)\n {if (dd==7)\n {\n line(w2+cos(dd*TWO_PI/7)*radiu*1/3, h2+sin(dd*TWO_PI/7)*radiu*1/3, w2+cos(TWO_PI/7)*radiu*1/3, h2+sin(TWO_PI/7)*radiu*1/3);\n line(w2+cos(dd*TWO_PI/7)*radiu*2/3, h2+sin(dd*TWO_PI/7)*radiu*2/3, w2+cos(TWO_PI/7)*radiu*2/3, h2+sin(TWO_PI/7)*radiu*2/3);\n line(w2+cos(dd*TWO_PI/7)*radiu*1, h2+sin(dd*TWO_PI/7)*radiu*1, w2+cos(TWO_PI/7)*radiu*1, h2+sin(TWO_PI/7)*radiu*1);\n \n}\n else{\n line(w2+cos(dd*TWO_PI/7)*radiu*1/3, h2+sin(dd*TWO_PI/7)*radiu*1/3, w2+cos((dd+1)*TWO_PI/7)*radiu*1/3, h2+sin((dd+1)*TWO_PI/7)*radiu*1/3);\n line(w2+cos(dd*TWO_PI/7)*radiu*2/3, h2+sin(dd*TWO_PI/7)*radiu*2/3, w2+cos((dd+1)*TWO_PI/7)*radiu*2/3, h2+sin((dd+1)*TWO_PI/7)*radiu*2/3);\n line(w2+cos(dd*TWO_PI/7)*radiu*1, h2+sin(dd*TWO_PI/7)*radiu*1, w2+cos((dd+1)*TWO_PI/7)*radiu*1, h2+sin((dd+1)*TWO_PI/7)*radiu*1);\n }\n }\n pushMatrix();\n translate(w1, h1);\n stroke(0);\n strokeWeight(1);\n star(0, 0, 0, 70, 7);\n popMatrix();\n pushMatrix();\n translate(w2, h2);\n stroke(0);\n strokeWeight(1);\n star(0, 0, 0, 70, 7);\n popMatrix();\n fill(255);\n ellipse(w3, h3, 140, 140);\n stroke(0);\n strokeWeight(1);\n textSize(20);\n fill(50);\n //label the weekends7\n text(\"bike\", w1+cos(TWO_PI/7)*(radiu+10), h1+sin(TWO_PI/7)*(radiu+10)); \n text(\"bus\", w1+cos(2*TWO_PI/7)*(radiu+55), h1+sin(2*TWO_PI/7)*(radiu+15)); \n text(\"car\", w1+cos(3*TWO_PI/7)*(radiu+40), h1+sin(3*TWO_PI/7)*(radiu+10)); \n text(\"subway\", w1+cos(4*TWO_PI/7)*(radiu+85), h1+sin(4*TWO_PI/7)*(radiu+10)); \n text(\"taxi\", w1+cos(5*TWO_PI/7)*(radiu+10), h1+sin(5*TWO_PI/7)*(radiu+10)); \n text(\"train\", w1+cos(6*TWO_PI/7)*(radiu+10), h1+sin(6*TWO_PI/7)*(radiu+10)); \n text(\"walk\", w1+cos(7*TWO_PI/7)*(radiu+10), h1+sin(7*TWO_PI/7)*(radiu+10)); \n //label the weekdays\n text(\"bike\", w2+cos(TWO_PI/7)*(radiu+10), h2+sin(TWO_PI/7)*(radiu+10)); \n text(\"bus\", w2+cos(2*TWO_PI/7)*(radiu+55), h2+sin(2*TWO_PI/7)*(radiu+15)); \n text(\"car\", w2+cos(3*TWO_PI/7)*(radiu+40), h2+sin(3*TWO_PI/7)*(radiu+10)); \n text(\"subway\", w2+cos(4*TWO_PI/7)*(radiu+85), h2+sin(4*TWO_PI/7)*(radiu+10)); \n text(\"taxi\", w2+cos(5*TWO_PI/7)*(radiu+10), h2+sin(5*TWO_PI/7)*(radiu+10)); \n text(\"train\", w2+cos(6*TWO_PI/7)*(radiu+10), h2+sin(6*TWO_PI/7)*(radiu+10)); \n text(\"walk\", w2+cos(7*TWO_PI/7)*(radiu+10), h2+sin(7*TWO_PI/7)*(radiu+10));\n}",
"public abstract void animation(double seconds);",
"public void tick()\r\n\t{\r\n\t\tduration = (int) (((Sys.getTime() - lastCall) * resolution) / Sys\r\n\t\t\t\t.getTimerResolution());\r\n\t\tlastCall = Sys.getTime();\r\n\t}",
"public void timer() {\r\n date.setTime(System.currentTimeMillis());\r\n calendarG.setTime(date);\r\n hours = calendarG.get(Calendar.HOUR_OF_DAY);\r\n minutes = calendarG.get(Calendar.MINUTE);\r\n seconds = calendarG.get(Calendar.SECOND);\r\n //Gdx.app.debug(\"Clock\", hours + \":\" + minutes + \":\" + seconds);\r\n\r\n buffTimer();\r\n dayNightCycle(false);\r\n }",
"private void drawSleepTimes(Canvas canvas) {\n if (mSleepTimePairs == null) {\n return;\n }\n\n for (Pair<Date, Date> pair : mSleepTimePairs) {\n float beginPos = calculateTimePosition(pair.first);\n float endPos = calculateTimePosition(pair.second);\n canvas.drawRect(beginPos, 0, endPos, scaleLinePosition, sleepTimePaint);\n }\n }",
"public static void updateFPS() {\n if (getTime() - lastFPS > 1000) {\n Display.setTitle(\"FPS: \" + fps + \" \");\n fps = 0;\n lastFPS += 1000;\n }\n fps++;\n\n }",
"void update() {\n rectToBeDrawn = new Rect((frameNumber * frameSize.x)-1, 0,(frameNumber * frameSize.x + frameSize.x) - 1, frameSize.x);\n\n //now the next frame\n frameNumber++;\n\n //don't try and draw frames that don't exist\n if(frameNumber == numFrames){\n frameNumber = 0;//back to the first frame\n }\n }",
"public long getLoopTime();",
"@SuppressWarnings(\"unused\")\r\n\tprivate void printFPS() {\r\n\t\tlong now = System.currentTimeMillis();\r\n if(now - lastFrame >= 1000l) {\r\n Log.d(TAG, fps + \" fps\");\r\n fps = 0;\r\n lastFrame = now;\r\n } else {\r\n \tfps++;\r\n }\r\n\t}",
"public void incrementFrameNumber()\n {\n\tframeNumber++;\n }",
"public void updateTimerDisplay(){\n int seconds = timeCounter / 60;\n setImage(new GreenfootImage(\"Time: \"+timeElapsed + \": \" + seconds, 24, Color.BLACK, Color.WHITE));\n }",
"private void waitFPS() {\n try {\n Thread.sleep((int) (1000.0f / 60.0f));\n } catch (InterruptedException e) {\n logger.error(\"Unable to wait some milli's !\", e);\n }\n }",
"private int toTime(int i) {\n int count = 0;\n\n //hours units\n count += toLeds((i / 6000) % 10);\n //hours tens\n count += toLeds(((i / 6000) % 100) / 10);\n\n //minutes units\n count += toLeds((i / 60) % 10);\n //minutes tens\n count += toLeds(((i / 60) % 100) / 10);\n\n //seconds units\n count += toLeds((i % 60) % 10);\n //seconds tens\n count += toLeds(((i % 60) % 100) / 10);\n\n return count;\n }",
"public void drawTimer(Graphics art)\n\t{\n\t\tcounter++;\n\t\tif(counter % 60 == 0)\n\t\t{\n\t\t\tseconds++;\n\t\t}\n\t\tart.drawString(\"Time =\"+seconds, 50, 120);\n\t}",
"private void drawClockHand(GraphicsContext gc) {\n\t\t\n\t\tdouble x1 = getX();\n\t\t//double y1 = getY() + getHeight() / 2 - getTimeLabelHeight();\n\t\tdouble y1 = getY() + (getHeight() - getTimeLabelHeight()) / 2;\n\t\tdouble x2 = getX() + Math.cos(Math.toRadians(getClockHandAngle())) \n\t\t\t\t* getClockRadius();\n\t\t\n\t\tdouble y2 = (y1) + \n\t\t\t\tMath.sin(Math.toRadians(getClockHandAngle())) \n\t\t\t\t* getClockRadius();\n\t\t\n\t\tgc.setStroke(Color.BLACK);\n\t\tgc.strokeLine(x1, y1, x2, y2);\n\t\t\n\t}",
"private void createAnimations(Texture spriteSheet, float frameTime) {\n\n TextureRegion[][] spriteRegion = TextureRegion.split(spriteSheet, TILESIZE, TILESIZE);\n\n TextureRegion[] downFrames = new TextureRegion[4];\n TextureRegion[] leftFrames = new TextureRegion[4];\n TextureRegion[] rightFrames = new TextureRegion[4];\n TextureRegion[] upFrames = new TextureRegion[4];\n\n System.arraycopy(spriteRegion[3], 0, upFrames, 0, 4);\n animations.add(new Animation<>(frameTime, upFrames));\n\n System.arraycopy(spriteRegion[1], 0, leftFrames, 0, 4);\n animations.add(new Animation<>(frameTime, leftFrames));\n\n System.arraycopy(spriteRegion[0], 0, downFrames, 0, 4);\n Animation<TextureRegion> downAnim = new Animation<>(frameTime, downFrames);\n animations.add(downAnim);\n\n System.arraycopy(spriteRegion[2], 0, rightFrames, 0, 4);\n animations.add(new Animation<>(frameTime, rightFrames));\n\n animations.add(downAnim);\n }"
] | [
"0.64038223",
"0.637513",
"0.6235222",
"0.6215622",
"0.6172475",
"0.61575615",
"0.6113391",
"0.601737",
"0.601032",
"0.5992719",
"0.5979186",
"0.5955303",
"0.5948472",
"0.5918149",
"0.59179",
"0.5898256",
"0.58529246",
"0.5838538",
"0.5838038",
"0.5833531",
"0.5829659",
"0.58148247",
"0.5799482",
"0.5797979",
"0.579787",
"0.5756453",
"0.5730585",
"0.5699083",
"0.56238985",
"0.5603033",
"0.5584983",
"0.5577958",
"0.55745584",
"0.5561498",
"0.55570054",
"0.5550585",
"0.5548112",
"0.5537996",
"0.5534471",
"0.5518688",
"0.55035996",
"0.5492993",
"0.54927087",
"0.54890186",
"0.54379344",
"0.54158646",
"0.5410694",
"0.54060984",
"0.54033625",
"0.5392743",
"0.5389815",
"0.5374275",
"0.5373006",
"0.53563863",
"0.53529465",
"0.53472406",
"0.5339373",
"0.533892",
"0.53182244",
"0.5313465",
"0.52918124",
"0.52904177",
"0.52891856",
"0.5286933",
"0.5283025",
"0.52823794",
"0.525597",
"0.5251934",
"0.52459234",
"0.52418464",
"0.5240482",
"0.52400076",
"0.5239563",
"0.5226959",
"0.5223993",
"0.5221234",
"0.52183455",
"0.52024853",
"0.5194369",
"0.519303",
"0.5158873",
"0.5133602",
"0.5126726",
"0.51203406",
"0.5104095",
"0.5101486",
"0.50990987",
"0.5092713",
"0.5092617",
"0.5091554",
"0.50883347",
"0.5084225",
"0.5079943",
"0.5079235",
"0.5077694",
"0.5068412",
"0.50545114",
"0.50528926",
"0.5043824",
"0.50371784"
] | 0.61708033 | 5 |
Record starting time of program and frame number | public void resetClock()
{
startTime = System.currentTimeMillis();
pauseTime = startTime;
computeClock = 0;
frameNumber = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long startTime();",
"public String startTime(){\r\n\t\treturn startTime;\r\n\t}",
"private void printTimer(){\n\t\tFrame++;\n\t\tif(isFrame()){\n\t\t\tSystem.out.println(Frame + \" updates/frames in the \" + second + \"th second\");\n\t\t\tsecond++;\n\t\t\tFrame=1;\n\t\t}\n\t}",
"int getStartTime();",
"int getStartTime();",
"int getStartTime();",
"private void startTiming() {\n m_startTime = Calendar.getInstance().getTimeInMillis();\n }",
"public static void startTimeMeasure() {\n \tstartTime = System.nanoTime();\n }",
"protected void setupTime() {\n this.start = System.currentTimeMillis();\n }",
"public long getBeginTime() { return beginTime; }",
"@Override\n\tpublic int getStartTime() {\n\t\treturn 0;\n\t}",
"public int getBegin() {\r\n return (event.getStartTime() - 6) * PIXELS_PER_HOUR;\r\n }",
"long getStartTime();",
"public long getStartTime () {\n if (isPerformance) {\n return System.currentTimeMillis();\n }\n else\n {\n return 0;\n }\n }",
"public int getTimeStart() {\r\n return timeStart;\r\n }",
"public void trackTime()\n {\n frames += 1;\n\n // Every second (roughly) reduce the time left\n if (frames % 60 == 0)\n {\n time += 1;\n showTime();\n }\n }",
"public String getBeginTime() {\n/* 28 */ return this.beginTime;\n/* */ }",
"public int getStartTime()\n {\n if (isRepeated()) return start;\n else return time;\n }",
"@Override\n\tpublic float getStartTime()\n\t{\n\t\treturn _tbeg;\n\t}",
"static final long getStartTimeMillis()\n {\n long startTime;\n if ((startTime = ExitMain.vmStartTime) == 0L) /* hack */\n {\n startTime = VMSystem.currentTimeMillis();\n ExitMain.vmStartTime = startTime;\n }\n return startTime;\n }",
"public long getStartTime();",
"public long getStartTime();",
"public void startTiming() {\n elapsedTime = 0;\n startTime = System.currentTimeMillis();\n }",
"public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }",
"@Override\r\n\tpublic void startTime() {\n\t\tSystem.out.println(\"인터페이스 ISports2메소드 --> startTime()\");\r\n\t\t\r\n\t}",
"public double getStartTime();",
"public int getStartTime()\n\t{\n\t\treturn startTime;\n\t}",
"public long getStartTime ()\r\n {\r\n return startTime;\r\n }",
"public abstract long startTimestamp();",
"protected long logTestStart(String methodName) {\n\t\tString startTimeString = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\").format(new Date());\n\t\tlogEntry(\"*** START \" + methodName + \": \" + testProperties.getEnvironmentName() + \" / \" + browser + \" / \"\n\t\t\t\t+ startTimeString);\n\t\treturn System.nanoTime();\n\t}",
"public void setStartTime() {\r\n startTime = System.currentTimeMillis();\r\n }",
"public String getStartTime();",
"public String getStartTime();",
"private long CurrentTime(){\n return (TotalRunTime + System.nanoTime() - StartTime)/1000000;\n }",
"public abstract void logTraceTime();",
"protected long logTestStart(String methodName, String comment) {\n\t\tscreenshotAdditionalData = comment;\n\t\tString startTimeString = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\").format(new Date());\n\t\tlogEntry(\"*** START \" + methodName + \" (\" + comment + \"): \" + testProperties.getEnvironmentName() + \" / \"\n\t\t\t\t+ browser + \" / \" + startTimeString);\n\t\treturn System.nanoTime();\n\t}",
"public void start()\r\n\t{\r\n\t\tcurrentstate = TIMER_START;\r\n\t\tstarttime = Calendar.getInstance();\r\n\t\tamountOfPause = 0;\r\n\t\trunningTime = 0;\r\n\t\tlastRunningTime = 0;\r\n\t\tpassedTicks = 0;\r\n\t}",
"public String getBeginTime() {\r\n return beginTime;\r\n }",
"public static long getStartTime() {\n return startTime;\n }",
"private void startTime()\n {\n timer.start();\n }",
"public long getTimeGameStarted() {\n \t\treturn timeGameStarted;\n \t}",
"long getVisitStarttime();",
"long getVisitStarttime();",
"@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}",
"public long getTimeStarted() {\n\t\treturn _timeStarted;\n\t}",
"public void startTime() {\n\t\tthis.clock.start();\n\t}",
"public int getTime()\n {\n if (isRepeated()) return start;\n else return time;\n }",
"public long getStartTime() {\n\t\treturn startTime;\n\t}",
"public long getStartTime() {\r\n return startTime;\r\n }",
"public abstract double calculateStartTime();",
"protected double getStartTime() {\n\t\treturn startTime;\n\t}",
"@Override\n protected void initialize() {\n startT = Timer.getFPGATimestamp();\n }",
"public void setBeginTime(String time){beginTime = time;}",
"@Override\n public String getStartInfo() {\n\n return startTime(null, DateFormat.SHORT);\n }",
"public String getStartTime() {\n return startTime;\n }",
"long getExecutionTime();",
"static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }",
"public String getTimeframe() {\n return this.timeframe;\n }",
"@DISPID(90)\r\n\t// = 0x5a. The runtime will prefer the VTID if present\r\n\t@VTID(88)\r\n\tjava.util.Date expectedBeginExecutionTime();",
"public long getStartTime() {\n return startTime;\n }",
"public long getStartTime() {\n return startTime;\n }",
"public long getStartTime() {\n return startTime;\n }",
"public long getStartTime() {\n return startTime;\n }",
"public long getStart_time() {\n return start_time;\n }",
"public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}",
"public String getBeginTime(){return beginTime;}",
"@Override\n\tpublic void setStartTime(float t) \n\t{\n\t\t_tbeg = t;\n\t}",
"public void step() {\n \tinternaltime ++;\n \n }",
"public void mo133110n() {\n this.f113321t = System.currentTimeMillis();\n }",
"public long startTimeNanos();",
"long getStartTimestamp();",
"private void printTimer() {\n\t\tif (_verbose) {\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"-- \" + getTimeString() + \" --\");\n\t\t}\n\t}",
"protected void printExecutionTime(){\n //Do nothing\n }",
"public abstract long getStartTimestamp();",
"long getStartTime() {\n return startTime;\n }",
"public double getStartTime() {\n return startTime;\n }",
"public double getStartTime() {\n return startTime;\n }",
"public String getStartTime() {\n return startTime;\n }",
"public String getStartTime() {\n return startTime;\n }",
"public String getStartTime() {\n return startTime;\n }",
"public String getStartTime() {\n return startTime;\n }",
"public static long startTimer() {\n return System.currentTimeMillis();\n }",
"public void start(){\n\n stopWatchStartTimeNanoSecs = magicBean.getCurrentThreadCpuTime();\n\n }",
"public void start(){\n\t\tstarted = true;\n\t\tlastTime = System.nanoTime();\n\t}",
"public String getFormattedTimeFromStart() {\r\n if (history.getNumberOfJumpsSoFar() == 0) {\r\n return \"00:00\";\r\n }\r\n\r\n double time = history.getTimeFromStart();\r\n double maxTime = 59.59;\r\n if (time < maxTime) {\r\n return String.format(\"%02d:%02d\", (int) (time % 60), (int) (time * 100 % 100));\r\n } else {\r\n return \"59:59\";\r\n }\r\n }",
"public float getStartTime()\r\n\t{\r\n\t\tif (starttime != null)\r\n\t\t\treturn starttime.getTimeInMillis();\r\n\t\t\r\n\t\treturn 0;\r\n\t}",
"int getMinRecordingMillis();",
"public int getTime() { return _time; }",
"public void setTimestamp() {\n timestamp = System.nanoTime();\n }",
"protected static double getFPGATime() {\n return (System.currentTimeMillis() - startTime) / 1000.0;\n }",
"private long getSampleTime() {\n return System.currentTimeMillis();\n\n }",
"public String getStartTime()\n {\n return this.startTime;\n }",
"@Override\r\n\tpublic void preExcute(long arg0) {\n\t\tstartTime = arg0;\r\n\r\n\t}",
"public String getTime_start() {\n return time_start;\n }",
"public float getTime()\r\n\t{\r\n\t\treturn runningTime;\r\n\t}",
"public void start(){\n\t\tthis.lastUpdate = System.currentTimeMillis();\n\t\tthis.millisIntoFrame=0;\n\t\tthis.currentFrame=0;\n\t}",
"void accessFrame(Buffer frame) {\r\n\r\n\t\t\t// For demo, we'll just print out the frame #, time &\r\n\t\t\t// data length.\r\n\r\n\t\t\tlong t = (long)(frame.getTimeStamp()/10000000f);\r\n\r\n\t\t\tStdout.log(\"Pre: frame #: \" + frame.getSequenceNumber() + \r\n\t\t\t\t\t\", time: \" + ((float)t)/100f + \r\n\t\t\t\t\t\", len: \" + frame.getLength());\r\n\t\t}",
"public String getStarttime() {\n return starttime;\n }",
"public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }",
"public long getBeginTime() {\n return mBeginTime;\n }",
"public Integer getStartTime() {\n return startTime;\n }"
] | [
"0.66657233",
"0.64865386",
"0.6482655",
"0.6481915",
"0.6481915",
"0.6481915",
"0.6365042",
"0.6343393",
"0.6330949",
"0.6324169",
"0.62865233",
"0.6282018",
"0.6262729",
"0.6249631",
"0.623347",
"0.623323",
"0.62144536",
"0.6207802",
"0.62016016",
"0.62001956",
"0.61928153",
"0.61928153",
"0.61749506",
"0.6168857",
"0.61453116",
"0.61447793",
"0.61342645",
"0.6105371",
"0.60881275",
"0.60784006",
"0.60714346",
"0.6063457",
"0.6063457",
"0.6062757",
"0.60479325",
"0.60286224",
"0.60039157",
"0.6002108",
"0.5997673",
"0.5996939",
"0.5977977",
"0.5954274",
"0.5954274",
"0.5950877",
"0.5947481",
"0.5925191",
"0.5921601",
"0.59142333",
"0.59084463",
"0.58855903",
"0.587103",
"0.5867559",
"0.5864874",
"0.5862539",
"0.5853532",
"0.58444583",
"0.58437324",
"0.58402675",
"0.5837067",
"0.5819358",
"0.5819358",
"0.5819358",
"0.5819358",
"0.5815641",
"0.57994306",
"0.579916",
"0.5799118",
"0.5796773",
"0.5795697",
"0.57934505",
"0.5787331",
"0.57851386",
"0.5784723",
"0.57840085",
"0.57799387",
"0.5777262",
"0.5777262",
"0.5776035",
"0.5776035",
"0.5776035",
"0.5776035",
"0.57755655",
"0.575448",
"0.57534945",
"0.5747771",
"0.5744097",
"0.57437056",
"0.57258624",
"0.57209194",
"0.5720855",
"0.5719458",
"0.57148933",
"0.5709008",
"0.5707842",
"0.5704223",
"0.5701269",
"0.56987345",
"0.5695699",
"0.56924987",
"0.5690736",
"0.5680826"
] | 0.0 | -1 |
Pause clock (time doesn't elapse) | public void pauseClock(boolean stop)
{
long now = System.currentTimeMillis();
if (stop) {
pauseTime = now;
} else {
startTime += now - pauseTime;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void pauseUntilNextClock(){\n\t\tlong sleepTime = (long) (1000.0 / Settings.getSettings().getClockSpeed())\n\t\t\t\t- (System.currentTimeMillis() - this.mStartOfClock);\n\t\t\n\t\tif(sleepTime > 0){\n\t\t\ttry {\n\t\t\t\tThread.sleep(sleepTime);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}else{\n\t\t\tSystem.out.println(\"WARNING: System cannot keep up with simulator clock speed!\");\n\t\t\tSystem.out.println(\"WARNING: Reduce clock speed!\");\n\t\t\t}\n\t\t\n\t\tthis.mStartOfClock = System.currentTimeMillis();\n\t}",
"@Override\n public void pauseClock() {\n state = ClockState.PAUSED;\n // TODO Auto-generated method stub\n\n }",
"public void pause() {\n\t\tsleep(2000);\n\t}",
"public void clock(double period);",
"public void pause() {\n\n if (timer != null) {\n\n // Arreter le timer\n stop();\n\n // Mise à jour\n update();\n }\n }",
"public void pause() {\n long currentTime = System.currentTimeMillis();\n ms = originalms - currentTime;\n }",
"public void pause() {}",
"private void pause() {\n pause(myDelay);\n }",
"public void pause() {\n cancelCallback();\n mStartTimeMillis *= -1;\n }",
"public void clockChange(int time);",
"public void pause(){\n\t\tif(timer == null){ return; }\n\t\ttimer.stop();\n\t}",
"protected void pause() {\n sleep(300);\n }",
"public void cont(){\n\t\t//System.out.println(\"SimulationTime.cont\");\n\t\tif(this.running && this.pause){\n\t\t\tthis.pause = false;\n\t\t}\n\t}",
"public static void pauseTiming() {\n SimulatorJNI.pauseTiming();\n }",
"public void newTurnPauseCountdown()\n {\n pauseNewTurn = true;\n pauseNewTurnTimer = 169;\n }",
"public void pause() {\r\n\t}",
"private static void pause1()\n\t{\n\t\tpause( 1000 );\n\t}",
"protected void pause(){}",
"private void startClock() {\r\n\t\tTimer timer = new Timer(500, new ActionListener() {\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent theEvent) {\r\n\t\t\t\tadvanceTime();\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n timer.setRepeats(true);\r\n timer.setCoalesce(true);\r\n timer.setInitialDelay(0);\r\n timer.start();\r\n\t}",
"private void pause() {\n\t\t// TODO\n\t}",
"public void pause();",
"public void pause();",
"public void pause();",
"public void pause() {\n pause = true;\n }",
"public void pause() {\r\n fPause = true;\r\n }",
"private void pauseGame() {\n\t\ttimer.cancel();\n\t}",
"public synchronized void pause() {\r\n\r\n\t\tpaused = true;\r\n\t}",
"public void pause() {\n }",
"protected void runClock() {\r\n // stop gameClock while game is iconified\r\n if( isRunning && (getState() == Frame.NORMAL) ) {\r\n seconds++;\r\n\r\n int hrs = seconds / 3600;\r\n int mins = seconds / 60 - hrs * 60;\r\n int secs = seconds - mins * 60 - hrs * 3600;\r\n\r\n String strHr = (hrs < 10 ? \"0\" : \"\") + Integer.toString( hrs );\r\n String strMin = (mins < 10 ? \"0\" : \"\") + Integer.toString( mins );\r\n String strSec = (secs < 10 ? \"0\" : \"\") + Integer.toString( secs );\r\n\r\n timeMesg.setText( strHr + \":\" + strMin + \":\" + strSec );\r\n }\r\n }",
"public void pauseGame(int time) {\n\t\t\tif (extended)//if the slider is currently extended stop the timer\n\t\t\t\textendTimer.stop();\n\t\t\tpauseTimer = new Timer(time, this);//set the pause timer for the time and then start the timer. set the pause flag to true\n\t\t\tpauseTimer.start();\n\t\t\tpause=true;\n\t\t}",
"private void timerPause() {\n timerStop();\n\n // Start the pause timer\n pauseTimer_startTime = System.currentTimeMillis();\n pauseTimerHandler.postDelayed(pauseTimerRunnable, 0);\n }",
"synchronized void pause() {\n\t\tpaused = true;\n\t}",
"public void pause() {\n\t\t// TODO Auto-generated method stub\n\t}",
"@Override\n\t\tpublic void pause() {\n\t\t \n\t\t}",
"public void setDelay(double clock);",
"private void pauseTimer() {\n myTimer.stop();\n disableGamePlayKeys();\n repaint();\n }",
"void pause();",
"void pause();",
"void pause();",
"void pause();",
"public void Pause();",
"public static void pause(int pause)\n {\n if(pause<0)\n {pause=0;}\n try\n {\n Thread.sleep(pause);\n }catch(InterruptedException ex){}\n }",
"public void setPause(boolean p) {\n pause = p;\n if (pause) {\n timerS.cancel();\n// System.out.println(\"Pause!\");\n } else if (!pause) {\n timerS = new Timer();\n// System.out.println(\"Weiter!\");\n strgTimer = new StrgTimer(this, strgTimer.getTime());\n timerS.scheduleAtFixedRate(strgTimer, 0, strgPause);\n }\n }",
"@Override\r\n public void pause() {}",
"public void pause()\n\t{\n\t\tplayState = Status.PAUSED;\n\t\tlastUpdate = -1;\n\t\ttmr.stop();\n\t}",
"public void timer() \r\n\t{\r\n\t\tSeconds.tick();\r\n\t \r\n\t if (Seconds.getValue() == 0) \r\n\t {\r\n\t \tMinutes.tick();\r\n\t \r\n\t \tif (Minutes.getValue() == 0)\r\n\t \t{\r\n\t \t\tHours.tick();\r\n\t \t\t\r\n\t \t\tif(Hours.getValue() == 0)\r\n\t \t\t{\r\n\t \t\t\tHours.tick();\r\n\t \t\t}\r\n\t \t}\r\n\t }\t\t\r\n\t \r\n\t updateTime();\r\n\t }",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}",
"public void pause(double seconds) \n { \n try \n { \n Thread.sleep(Math.round(1000.0 * seconds)); \n } \n catch (InterruptedException e) \n { \n e.printStackTrace(); \n }\n }",
"public void pauseFor( final long ms )\n\t{\n\t\tpauseUntil( System.currentTimeMillis() + ms );\n\t}",
"public void pause(int time) {\n\t\ttry {\n\t\t\tThread.sleep(time);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(\"Sleep Failure.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void pause() {\n int m = 0;\n for (int j = 0; j <= 1000000000; ++j) {\n for (int i = 0; i <= 1000000000; ++i) ++m;\n }\n\n }",
"@Override\r\n public void pause() {\n }",
"@Override\r\n public void pause() {\n }",
"@Override\r\n public void pause() {\n }",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"@Override\n\tpublic void pause() {\n\t\t\n\t}",
"public void pause()\n {\n paused = true;\n }",
"public void currentTime() {\n Thread clock = new Thread() {\n public void run() {\n for (;;) {\n Calendar cal = new GregorianCalendar();\n int second = cal.get(Calendar.SECOND);\n int minute = cal.get(Calendar.MINUTE);\n int hour = cal.get(Calendar.HOUR);\n \n txtKluar.setText(hour + \":\" + minute + \":\" + second + \" \");\n try {\n sleep(1000);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }\n }\n };\n clock.start();\n }",
"@Override\r\n\tpublic void pause() {\n\t}",
"private void pause(long howLong)\r\n {\r\n try \r\n {\r\n Thread.sleep(howLong);\r\n }\r\n catch(InterruptedException e) \r\n {\r\n\r\n }\r\n }",
"public void pause() {\n isPaused = true;\n System.out.println(\"pausing\");\n timeline.stop();\n }",
"private void pause()\n {\n mPaused = true;\n mCurrentTurn.addTurnTime( getElapsedTime() );\n mCountdownTimer.cancel();\n mPauseResumeButton.setText( \"Resume\" ); // TODO resourcify\n }",
"@Override\n \tpublic void pause() {\n \t}",
"public void pauseWorkout(){\n mStart = 0;\n mEnd = 0;\n mIsPlay = false;\n mIsPause = true;\n mFabPlay.setIcon(R.mipmap.ic_play_arrow_white_24dp);\n if(mCounter != null) {\n if (mCounter.timerCheck()) mCounter.cancel();\n mCurrentTime = mCounter.timerPause();\n }\n if(mIsFirstAppRun){\n mTxtBreakTime.setText(mCurrentTime);\n }else {\n if (mIsBreak) {\n // If this is break, set mTimer to break time view and set sub title view\n // with initial time\n mTxtBreakTime.setText(mCurrentTime);\n mTxtSubTitle.setText(mCurrentTime);\n } else {\n mTxtSubTitle.setText(mCurrentTime);\n }\n }\n }",
"public void pause() {\n\t\tsynchronized(this) {\n\t\t\tpaused = true;\n\t\t}\n\t}",
"public void pause() {\n paused = true;\n }",
"public void pause() {\n paused = true;\n }"
] | [
"0.759768",
"0.7367342",
"0.7313543",
"0.7287339",
"0.7281851",
"0.72734",
"0.7245597",
"0.723405",
"0.71746063",
"0.7152675",
"0.7124173",
"0.71171194",
"0.7093522",
"0.7090708",
"0.7071888",
"0.70095605",
"0.6995731",
"0.69826967",
"0.69818",
"0.6960215",
"0.69532293",
"0.69532293",
"0.69532293",
"0.69532186",
"0.6951034",
"0.6929446",
"0.6926343",
"0.69045734",
"0.6888324",
"0.6879705",
"0.6835745",
"0.68351686",
"0.6834343",
"0.67995733",
"0.67944247",
"0.6793534",
"0.679102",
"0.679102",
"0.679102",
"0.679102",
"0.6782052",
"0.6767901",
"0.67628866",
"0.67586464",
"0.6747073",
"0.67320365",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.6718219",
"0.67154074",
"0.6708822",
"0.669167",
"0.6684194",
"0.6681844",
"0.6681844",
"0.6681844",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66667855",
"0.66591454",
"0.66581833",
"0.6657988",
"0.6654488",
"0.66505617",
"0.6645929",
"0.6632462",
"0.66260207",
"0.6624487",
"0.6613583",
"0.6613583"
] | 0.75829107 | 1 |
Return current time (in seconds) since program started (or if frameByFrameClock is true, then return time of current frame number) | public double readClock()
{
if (frameByFrameClock) {
return frameNumber * (1/30.0f);
} else {
long elapsed;
if (drawAnimation.value) {
// Time during animation
elapsed = System.currentTimeMillis() - startTime;
} else {
// Time during pause
elapsed = pauseTime - startTime;
}
return elapsed / 1000.0f;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getCurrentTime() {\n\t\tif (playing)\n\t\t\treturn (System.nanoTime() - startNanoTime) / 1e9 + startTime;\n\t\telse if (currentFile == null)\n\t\t\treturn -1;\n\t\tif (debug)\n\t\t\tSystem.err.println(\"getCurrentTime(): not playing\");\n\t\treturn currentPosition / currentFile.frameSize / currentFile.frameRate;\n\t}",
"public static long currentTimeInSecond() {\n return Instant.now().getEpochSecond();\n }",
"public long getCurrentSystemTime() {\n return getSystemTime() - startSystemTimeNano;\n }",
"public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }",
"public static float getCurrentTime(){\n return (float)(System.currentTimeMillis()-t0)/1000.0f;\r\n }",
"private long CurrentTime(){\n return (TotalRunTime + System.nanoTime() - StartTime)/1000000;\n }",
"static final long getStartTimeMillis()\n {\n long startTime;\n if ((startTime = ExitMain.vmStartTime) == 0L) /* hack */\n {\n startTime = VMSystem.currentTimeMillis();\n ExitMain.vmStartTime = startTime;\n }\n return startTime;\n }",
"public float getCurrentTime()\r\n\t{\r\n\t\tcurrenttime = Calendar.getInstance();\r\n\t\treturn currenttime.getTimeInMillis();\r\n\t}",
"public float getCurrentTime () {\n\t\treturn timer;\n\t}",
"public long getCurrentWallClockTime() {\n return System.currentTimeMillis() - startWallClockTime;\n }",
"public static long getSystemTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()): 0L;\n }",
"public static long CLOCK() {\n return java.lang.System.currentTimeMillis();\n }",
"public static long getUserTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadUserTime(): 0L;\n }",
"public static long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n\n }",
"public float getCurrentTime()\n\t{\n\t\treturn currentTime;\n\t}",
"public double getFrameTime() {\n\n\t\t// Convert from milliseconds to seconds\n\t\treturn getInteger(ADACDictionary.FRAME_TIME) / 1000;\n\n\t}",
"private long getSystemTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()) : 0L;\n }",
"public long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n}",
"public static int getTimeSeconds() {\n return Atlantis.getBwapi().getFrameCount() / 30;\n }",
"public static long getUserTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadUserTime( ) : 0L;\n }",
"public static long getTime() \r\n {\r\n return System.nanoTime(); \r\n }",
"public double getCurrentTime() {\n\t\treturn currentTime;\n\t}",
"public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}",
"public double getCurrentTime() {\n if (music == null) {\n return -1;\n }\n \n double currentTime = music.getCurrentTime();\n \n // Returns the next start time so that even if music isn't playing, the line still renders\n if (currentTime == -1) {\n return nextStartTime;\n }\n \n return currentTime;\n }",
"public long getCurrentTimeMillis() {\n return System.currentTimeMillis();\n }",
"public long getStartTime () {\n if (isPerformance) {\n return System.currentTimeMillis();\n }\n else\n {\n return 0;\n }\n }",
"public static int getTime() {\n\t\treturn time;\n\t}",
"long getCurrentTimeMs();",
"public static long now() {\n return System.nanoTime();\n }",
"private long getUserTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadUserTime() : 0L;\n }",
"public long getUserTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadUserTime( ) : 0L;\n}",
"public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}",
"public long getCurrentTime() {\n return currentTime;\n }",
"public long getTimeGameStarted() {\n \t\treturn timeGameStarted;\n \t}",
"public float getTime()\r\n\t{\r\n\t\treturn runningTime;\r\n\t}",
"private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }",
"public synchronized static int getTime() {\n\t\treturn time;\n\t}",
"public double time() {\n long diff = System.nanoTime() - start;\n double seconds = diff * 0.000000001;\n return seconds;\n }",
"long getCurrentClockNs() {\n return System.nanoTime();\n }",
"@Override\n\tpublic long getTime() {\n\t\treturn System.nanoTime() - startTime;\n\t}",
"protected long getCurrentTime() {\n return System.currentTimeMillis();\n }",
"public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }",
"public long getCurrentThreadUserTime() {\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\treturn bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadUserTime() : -1L;\n\t}",
"public static long getRunningTime(long startTime) {\n return System.currentTimeMillis()-startTime;\n }",
"private static long getCurrentTime() {\n return (new Date()).getTime();\n }",
"public static String getCurrentTime()\n\t{\n\t\treturn getTime(new Date());\n\t}",
"public Date getCurrentTime() {\r\n return currentTime.getTime();\r\n }",
"public int getCurrentTimepoint()\n\t{\n\t\treturn current_timepoint;\n\t}",
"public static int getCurrentSecond()\n\t{\n\t\treturn Calendar.getInstance().get(Calendar.SECOND);\n\t}",
"public long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}",
"public int getSystemTime() {\n\t\treturn this.systemTime;\n\t}",
"public org.ros.message.Time getCurrentTime() {\n return time.getCurrentTime();\n }",
"public static long getTime() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}",
"@Override\n\tpublic long getCurrentTime() {\n\t\treturn 0;\n\t}",
"public static long getElapsedTime() {\n long time = System.currentTimeMillis() - START_TIME;\n // long time = System.nanoTime() / 1000000;\n return time;\n }",
"public long getSimTime() {\n\t return now;\n\t}",
"public long getCurrentThreadKernelTime() {\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\treturn bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime() : -1L;\n\t}",
"long getCurrentTimeMs() {\n return System.currentTimeMillis();\n }",
"public static long getCpuTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadCpuTime(): 0L;\n }",
"int getCPU_time();",
"public float getSecondsElapsed() { return _startTime==0? 0 : (System.currentTimeMillis() - _startTime)/1000f; }",
"private long getCpuTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L;\n }",
"public int getTime()\n {\n if (isRepeated()) return start;\n else return time;\n }",
"int time()\n\t{\n\t\treturn totalTick;\n\t}",
"@Override\n\tpublic long currentTimeMillis() {\n\t\treturn this.currentTime;\n\t}",
"public int getTime() {\n\t\treturn time;\n\t}",
"public int getTime() {\n\t\treturn time;\n\t}",
"public long getCurrentUserTime() {\n return getUserTime() - startUserTimeNano;\n }",
"public static long todayStartTimeInSecond() {\n return LocalDateTime.of(LocalDate.now(), LocalTime.MIN).toEpochSecond(getStandardOffset());\n }",
"public long elapsedTime(){\n\n // calculate elapsed time by getting current CPU time and substracting the CPU time from when we started the stopwatch\n\n // this does not stop the stopwatch\n\n return (magicBean.getCurrentThreadCpuTime() - stopWatchStartTimeNanoSecs);\n\n }",
"public float getStartTime()\r\n\t{\r\n\t\tif (starttime != null)\r\n\t\t\treturn starttime.getTimeInMillis();\r\n\t\t\r\n\t\treturn 0;\r\n\t}",
"public int getTime() {\n\n\t\treturn time;\n\t}",
"public static long getCpuTime(){\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ?\n bean.getCurrentThreadCpuTime() : 0L;\n }",
"public static int getNowTime() {\n\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HHmmss\");\n\t\treturn Integer.parseInt(timeFormat.format(new Date()));\n\t}",
"public String getCurrentTime() {\n return currentTime;\n }",
"public static long getCpuTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadCpuTime( ) : 0L;\n }",
"long time() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}",
"public static long getCpuTime( ) {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n\n bean.getCurrentThreadCpuTime( ) : 0L;\n\n }",
"private static Timestamp getCurrentTimeInSeconds() {\n\t\tLong mseconds = System.currentTimeMillis();\n\t\tmseconds = mseconds - mseconds % 1000;\n\t\treturn new Timestamp(mseconds);\n\t}",
"public long startTime();",
"public long getCpuTime() {\n\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\treturn bean.isCurrentThreadCpuTimeSupported() ?\n\t\t\tbean.getCurrentThreadCpuTime() : 0L;\n\t\n}",
"public float getTimeSeconds() { return getTime()/1000f; }",
"public static String getCurrentTime() {\r\n\t\tDate date = new Date();\r\n\t\treturn date.toString();\r\n\t}",
"String getCurTime();",
"public double getUserTimeSec() {\n\treturn getUserTime() / Math.pow(10, 9);\n}",
"public double getSimulationTime() {\n\t\treturn Kernel.getSingleton().getSimulationClock().getSimulationTime();\n\t}",
"public static long time() {\n return date().getTime();\n }",
"public String getCurrentThreadTimeInfo() {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\tif(!bean.isCurrentThreadCpuTimeSupported())\n\t\t\treturn timeInfo;\n\t\tlong userTime = bean.getCurrentThreadUserTime();\n\t\tlong cpuTime = bean.getCurrentThreadCpuTime();\n\n\t\tsb.append(userTime).append(\"#\").append(cpuTime);\n\t\ttimeInfo = sb.toString();\n//\t\tSystem.out.println(\"lib: \" + timeInfo);\n\t\treturn timeInfo;\n\t}",
"long getExecutionTime();",
"public static long GetElapsedTime() {\n\t\treturn System.currentTimeMillis() - _lTime;\n\t}",
"public int getTime() {\r\n return time;\r\n }",
"public static long getStartTime() {\n return startTime;\n }",
"public long getStartSystemTime() {\r\n return startSystemTime;\r\n }",
"@DISPID(55)\r\n\t// = 0x37. The runtime will prefer the VTID if present\r\n\t@VTID(53)\r\n\tint actualCPUTime_Seconds();",
"public static long getElapsedTime() {\n\t\tlong elapsed;\n\t\tif (running) {\n\t\t\telapsed = (System.nanoTime() - startTime);\n\t\t} else {\n\t\t\telapsed = (stopTime - startTime);\n\t\t}\n\t\treturn elapsed;\n\t}",
"public long getSystemStartTime() {\n return (this.systemStartTime);\n }",
"public int getTime() {\n return time;\n }",
"public int getTime() {\n return time;\n }",
"public int getTime() {\n return time;\n }",
"public static final String CurrentTime() {\n\t\t\n\t\tfinal SimpleDateFormat DF = new SimpleDateFormat(\"HH:mm:ss\");\n\t\treturn DF.format(new Date());\n\t}"
] | [
"0.72588",
"0.71723163",
"0.7093082",
"0.7085816",
"0.7000981",
"0.6966011",
"0.6918885",
"0.6904326",
"0.6897248",
"0.6864255",
"0.6853339",
"0.68337744",
"0.67932814",
"0.67913234",
"0.67900115",
"0.67609197",
"0.67573214",
"0.6731804",
"0.673135",
"0.6682272",
"0.6663969",
"0.6663944",
"0.6659636",
"0.6646225",
"0.6641459",
"0.66254556",
"0.6616834",
"0.6612094",
"0.6600747",
"0.6596865",
"0.6596755",
"0.659135",
"0.6566374",
"0.65646",
"0.6562831",
"0.6549224",
"0.65431696",
"0.65122914",
"0.65001994",
"0.6491113",
"0.6490092",
"0.64878386",
"0.648733",
"0.6482146",
"0.6458193",
"0.6453783",
"0.6418801",
"0.6415454",
"0.6406134",
"0.6397649",
"0.6360511",
"0.63531005",
"0.6343901",
"0.6326063",
"0.6323038",
"0.6313447",
"0.63099533",
"0.63006127",
"0.6297894",
"0.6279461",
"0.6278465",
"0.62698853",
"0.6269204",
"0.62617755",
"0.62535316",
"0.6229627",
"0.6229627",
"0.62265927",
"0.6226521",
"0.62174165",
"0.6203811",
"0.6188252",
"0.6187285",
"0.61853194",
"0.6179767",
"0.6175829",
"0.61720234",
"0.61621207",
"0.6150721",
"0.61353755",
"0.6133435",
"0.6133386",
"0.61328226",
"0.61267895",
"0.6118883",
"0.6117565",
"0.61071926",
"0.6104578",
"0.609793",
"0.6097865",
"0.6093567",
"0.6091942",
"0.60908073",
"0.6082348",
"0.60749614",
"0.60663736",
"0.6036074",
"0.6036074",
"0.6036074",
"0.60218716"
] | 0.64420944 | 46 |
Build the contents of the scene (no OpenGL calls are allowed in here, as it hasn't been initialized yet) | public void build()
{
Point3d loc;
computeFPS(0);
// Make random number generator
if (seed == -1) {
seed = System.currentTimeMillis() % 10000;
System.out.println("Seed value: " + seed);
}
rgen = new Random(seed);
// Create empty scene
obstacles = new Vector<Obstacle>();
critters = new Vector<Critter>();
// ---------------
// Create a couple of trees, one big and one smaller
obstacles.addElement(new Tree(rgen, 5, 6, 4.5f, 0.4f, 0.0f, 0.0f));
obstacles.addElement(new Tree(rgen, 4, 6, 2.5f, 0.15f, 8.0f, -5.0f));
// Create a few rocks
obstacles.addElement(new Rock(rgen, 4, 2, 2, 1));
obstacles.addElement(new Rock(rgen, 3, 4, 8, 1));
obstacles.addElement(new Rock(rgen, 3, 7, 2, 2));
obstacles.addElement(new Rock(rgen, 2, -2.6, -9, 2));
obstacles.addElement(new Rock(rgen, 4, -2, -3, 1));
obstacles.addElement(new Rock(rgen, 3, -2, -1.11, 1));
// Create the main bug
mainBug = new Bug(rgen, 0.4f, -1, 1, 0.1f, 0.0f);
critters.addElement(mainBug);
// baby critters
critters.addElement(new Bug(rgen, 0.1f, -5, 6, 0.1, 0.0f));
critters.addElement(new Bug(rgen, 0.15f, -7, -6, 0.1, 0.0f));
critters.addElement(new Bug(rgen, 0.2f, -8, 1, 0.1, 0.0f));
//predator
predator = new Predator(rgen, 0.3f, -9, 9, 0, 0);
critters.addElement(predator);
goal = new Point3d(rgen.nextDouble()*5, rgen.nextDouble()*5, 0);
target = 0;
// Reset computation clock
computeClock = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void buildScene() {\n Geometry cube1 = buildCube(ColorRGBA.Red);\n cube1.setLocalTranslation(-1f, 0f, 0f);\n Geometry cube2 = buildCube(ColorRGBA.Green);\n cube2.setLocalTranslation(0f, 0f, 0f);\n Geometry cube3 = buildCube(ColorRGBA.Blue);\n cube3.setLocalTranslation(1f, 0f, 0f);\n\n Geometry cube4 = buildCube(ColorRGBA.randomColor());\n cube4.setLocalTranslation(-0.5f, 1f, 0f);\n Geometry cube5 = buildCube(ColorRGBA.randomColor());\n cube5.setLocalTranslation(0.5f, 1f, 0f);\n\n rootNode.attachChild(cube1);\n rootNode.attachChild(cube2);\n rootNode.attachChild(cube3);\n rootNode.attachChild(cube4);\n rootNode.attachChild(cube5);\n }",
"private void buildScene() {\n for (int i = 0; i < Layer.LAYERCOUNT.ordinal(); i++) {\n SceneNode layer = new SceneNode();\n sceneLayers[i] = layer;\n\n sceneGraph.attachChild(layer);\n }\n\n // Prepare the tiled background\n Texture texture = textures.getTexture(Textures.DESERT);\n IntRect textureRect = new IntRect(worldBounds);\n texture.setRepeated(true);\n\n // Add the background sprite to the scene\n SpriteNode backgroundSprite = new SpriteNode(texture, textureRect);\n backgroundSprite.setPosition(worldBounds.left, worldBounds.top);\n sceneLayers[Layer.BACKGROUND.ordinal()].attachChild(backgroundSprite);\n\n // Add player's aircraft\n playerAircraft = new Aircraft(Aircraft.Type.EAGLE, textures);\n playerAircraft.setPosition(spawnPosition);\n playerAircraft.setVelocity(40.f, scrollSpeed);\n sceneLayers[Layer.AIR.ordinal()].attachChild(playerAircraft);\n\n // Add two escorting aircrafts, placed relatively to the main plane\n Aircraft leftEscort = new Aircraft(Aircraft.Type.RAPTOR, textures);\n leftEscort.setPosition(-80.f, 50.f);\n playerAircraft.attachChild(leftEscort);\n\n Aircraft rightEscort = new Aircraft(Aircraft.Type.RAPTOR, textures);\n rightEscort.setPosition(80.f, 50.f);\n playerAircraft.attachChild(rightEscort);\n }",
"private void buildWorld() {\r\n\t\tremoveAll();\r\n\t\tintro = null;\r\n\t\tfacingEast = true;\r\n\t\t\r\n\t\taddLevels();\r\n\t\taddCharacters();\r\n\t\taddLifeDisplay();\r\n\t}",
"public void buildInitialScene() {\n\t\t\n\t\t//Creation image background\n\t\tfinal String BACKGROUND_PATH = \"src/assets/img/temp_background.png\";\n\t\tthis.background = new GameImage(BACKGROUND_PATH);\n\n\t\t//Creation image Game Over\n\t\tfinal String GAME_OVER_PATH = \"src/assets/img/erro.png\";\n\t\tthis.errorScene = new Sprite(GAME_OVER_PATH);\n\n\t\t//Game over sprite center position\n\t\tthis.errorScene.x = spos.calculatePosition(WindowConstants.WIDTH, 2, this.errorScene, 2);\n\t\tthis.errorScene.y = spos.calculatePosition(WindowConstants.HEIGHT, 2, this.errorScene, 2);\n\t}",
"private void build()\n\t{\n\t\tengine.addSystem(new InputSystem());\n\t\tengine.addSystem(new MovementSystem());\n\t\t\n\t}",
"public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }",
"@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }",
"public void createScene();",
"public void createNodes() {\n\n //Current wave text\n currentWaveText = new Text();\n currentWaveText.setY(50);\n currentWaveText.setX(Constants.GAME_WIDTH / 2 - 150);\n currentWaveText.setTextAlignment(TextAlignment.LEFT);\n currentWaveText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 36));\n currentWaveText.setFill(Color.TOMATO);\n currentWaveText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(currentWaveText);\n\n //Health bar\n healthBar = new Rectangle(healthBarMaxWidth, healthBarMaxHeight, Color.LIMEGREEN);\n healthBar.setY(10);\n healthBar.setX(10);\n\n FXGL.getGameScene().addUINode(healthBar);\n\n //Health bar background\n healthBackground = new Rectangle(healthBarMaxWidth, healthBarMaxHeight);\n healthBackground.setY(10);\n healthBackground.setX(10);\n healthBackground.setFill(Color.TRANSPARENT);\n healthBackground.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(healthBackground);\n\n //Amount of ammo text\n amountOfAmmoText = new Text(10, 100, \"\");\n amountOfAmmoText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n amountOfAmmoText.setFill(Color.LIMEGREEN);\n amountOfAmmoText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(amountOfAmmoText);\n\n //Active weapon text\n activeWeaponText = new Text(10, 70, \"\");\n activeWeaponText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n activeWeaponText.setFill(Color.LIMEGREEN);\n activeWeaponText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(activeWeaponText);\n\n //Reloading text\n reloadingText = new Text(10, 130, \"\");\n reloadingText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n reloadingText.setFill(Color.LIMEGREEN);\n reloadingText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(reloadingText);\n update();\n }",
"public WorldScene makeScene() {\r\n WorldScene scene = this.getEmptyScene();\r\n //make the image to draw \\/ \\/\r\n WorldImage cell = new EmptyImage();\r\n\r\n if (this.allCellsFlooded()) {\r\n cell = this.drawWin();\r\n }\r\n else if (this.currTurn >= this.maxTurn) {\r\n cell = this.drawLose();\r\n }\r\n else {\r\n cell = this.drawBoard();\r\n }\r\n\r\n //place the image on the scene \\/ \\/\r\n scene.placeImageXY(cell, 100, 200);\r\n\r\n return scene;\r\n }",
"private void initScene() {\n myStringBuilder.append(\"<svg width=\\\"\" + width + \"\\\" height=\\\"\" + height +\n \"\\\" version=\\\"1.1\\\"\\n\" + \" xmlns=\\\"http://www.w3.org/2000/svg\\\">\");\n }",
"public void renderScene() {\n\t\tscene.ready=false;\n\t\tscene.num_points=0;\n\t\tscene.num_triangles=0;\n\t\tscene.num_tri_vertices=0;\n\t\tscene.list_of_triangles.clear(); // reset the List of Triangles (for z-sorting purposes)\n\t\tscene.num_objects_visible=0;\n\t\ttotal_cost=0;\n\t\tupdateLighting();\n\t\tfor (int i=0; i<num_vobjects;i++) {\n\t\t\tif (vobject[i].potentially_visible) {\n\t\t\t\tif (checkVisible(i)) {\n\t\t\t\t\tscene.num_objects_visible++;\n\t\t\t\t\tcalculateRelativePoints(i);\n\t\t\t\t\tif (scene.dot_field) {defineDots(i);} \n\t\t\t\t\tif (scene.wireframe) {defineTriangles(i);}\n\t\t\t\t\tif (scene.solid_poly) {defineTriangles(i);}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tif (scene.z_sorted) {Collections.sort(scene.list_of_triangles);}\n\t\tscene.ready=true;\n\t}",
"public void init() {\n try {\n java.net.URL codeBase = getCodeBase();\n codeBaseString = codeBase.toString();\n } catch (Exception e) {\n // probably running as an application, try the application\n // code base\n codeBaseString = \"file:./\";\n }\n\n if (colorMode == USE_COLOR) {\n objColor = red;\n } else {\n objColor = white;\n }\n\n Container contentPane = getContentPane();\n\n contentPane.setLayout(new BorderLayout());\n\n GraphicsConfiguration config = SimpleUniverse\n .getPreferredConfiguration();\n\n canvas = new Canvas3D(config);\n\n u = new SimpleUniverse(canvas);\n\n if (isApplication) {\n offScreenCanvas = new OffScreenCanvas3D(config, true);\n // set the size of the off-screen canvas based on a scale\n // of the on-screen size\n Screen3D sOn = canvas.getScreen3D();\n Screen3D sOff = offScreenCanvas.getScreen3D();\n Dimension dim = sOn.getSize();\n dim.width *= OFF_SCREEN_SCALE;\n dim.height *= OFF_SCREEN_SCALE;\n sOff.setSize(dim);\n sOff.setPhysicalScreenWidth(sOn.getPhysicalScreenWidth()\n * OFF_SCREEN_SCALE);\n sOff.setPhysicalScreenHeight(sOn.getPhysicalScreenHeight()\n * OFF_SCREEN_SCALE);\n\n // attach the offscreen canvas to the view\n u.getViewer().getView().addCanvas3D(offScreenCanvas);\n\n }\n contentPane.add(\"Center\", canvas);\n\n // setup the env nodes and their GUI elements\n setupLights();\n setupBackgrounds();\n setupFogs();\n setupSounds();\n\n // Create a simple scene and attach it to the virtual universe\n BranchGroup scene = createSceneGraph();\n\n // set up sound\n u.getViewer().createAudioDevice();\n\n // get the view\n view = u.getViewer().getView();\n\n // Get the viewing platform\n ViewingPlatform viewingPlatform = u.getViewingPlatform();\n\n // Move the viewing platform back to enclose the -4 -> 4 range\n double viewRadius = 4.0; // want to be able to see circle\n // of viewRadius size around origin\n // get the field of view\n double fov = u.getViewer().getView().getFieldOfView();\n\n // calc view distance to make circle view in fov\n float viewDistance = (float) (viewRadius / Math.tan(fov / 2.0));\n tmpVector.set(0.0f, 0.0f, viewDistance);// setup offset\n tmpTrans.set(tmpVector); // set trans to translate\n // move the view platform\n viewingPlatform.getViewPlatformTransform().setTransform(tmpTrans);\n\n // add an orbit behavior to move the viewing platform\n OrbitBehavior orbit = new OrbitBehavior(canvas, OrbitBehavior.STOP_ZOOM);\n orbit.setSchedulingBounds(infiniteBounds);\n viewingPlatform.setViewPlatformBehavior(orbit);\n\n u.addBranchGraph(scene);\n\n contentPane.add(\"East\", guiPanel());\n }",
"private void builder(){\r\n //Objects\r\n //Left\r\n canvasStackPane.setAlignment(Pos.TOP_LEFT);\r\n left1HintButton = new Button(\"Hint\");\r\n left2Button = new Button(\"New Graph\");\r\n left3Button = new Button(\"New GameMode\");\r\n left4Button = new Button(\"New GraphMode\");\r\n left5Button = new Button(\"Finished\");\r\n leftRestLabel = new Label();\r\n //Up\r\n upperLeftButton = new Label(\"Menu\");\r\n upperLeftButton.setAlignment(Pos.CENTER);\r\n upper1Label = new Label();\r\n upper2Label = new Label();\r\n upper3Label = new Label();\r\n upperRestLabel = new Label();\r\n //calculateVectors\r\n backPane.setPickOnBounds(false);\r\n textFieldVertices.setPromptText(\"Vertices\");\r\n textFieldEdges.setPromptText(\"Edges\");\r\n gameEnd.setSpacing(30);\r\n gameEnd.setAlignment(Pos.CENTER);\r\n gameWinStackPane.setAlignment(Pos.CENTER);\r\n hBoxWin.setAlignment(Pos.CENTER);\r\n hBoxWin.setSpacing(30);\r\n canvasStackPane.setPickOnBounds(true);\r\n canvas.setPickOnBounds(true);\r\n canvas.getGraphicsContext2D().setLineWidth(2.5);\r\n }",
"public WorldScene makeScene() {\n WorldScene w = new WorldScene(width * scale, height * scale);\n for (Vertex v : vertices) {\n Color color = generateColor(v);\n w.placeImageXY(new RectangleImage(scale, scale, OutlineMode.SOLID, color),\n (v.x * scale) + (scale * 1 / 2), (v.y * scale) + (scale * 1 / 2));\n }\n for (Edge e : walls) {\n if (e.to.x == e.from.x) {\n w.placeImageXY(\n new RectangleImage(scale, scale / 10, OutlineMode.SOLID, Color.black),\n (e.to.x * scale) + (scale * 1 / 2),\n ((e.to.y + e.from.y) * scale / 2) + (scale * 1 / 2));\n }\n else {\n w.placeImageXY(\n new RectangleImage(scale / 10, scale, OutlineMode.SOLID, Color.black),\n ((e.to.x + e.from.x) * scale / 2) + (scale * 1 / 2),\n (e.to.y * scale) + (scale * 1 / 2));\n }\n }\n return w;\n }",
"public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public WorldScene makeScene() {\n WorldScene scene = new WorldScene(this.width * GamePiece.GAMEPIECE_SIZE,\n this.height * GamePiece.GAMEPIECE_SIZE);\n WorldImage row = new EmptyImage();\n for (int i = 0; i < this.width; i++) {\n WorldImage column = new EmptyImage();\n for (int j = 0; j < this.height; j++) {\n column = new AboveImage(column, this.board.get(i).get(j)\n .drawPiece(this.board.get(powerRow).get(powerCol), this.radius));\n }\n row = new BesideImage(row, column);\n }\n scene.placeImageXY(row, (this.width * GamePiece.GAMEPIECE_SIZE) / 2,\n (this.height * GamePiece.GAMEPIECE_SIZE) / 2);\n return scene;\n }",
"public WorldScene makeScene() {\n WorldScene ws = new WorldScene(ForbiddenIslandWorld.ISLAND_SIZE,\n ForbiddenIslandWorld.ISLAND_SIZE);\n for (Cell c : this.board) {\n ws.placeImageXY(c.drawCell(waterHeight), c.x * 10, c.y * 10);\n }\n for (Target t : this.helicopterpieces) {\n ws.placeImageXY(t.drawPiece(), t.x * 10, t.y * 10);\n }\n ws.placeImageXY(this.player.drawPerson(), player.x * 10, player.y * 10);\n ws.placeImageXY(this.player2.drawPerson2(), player2.x * 10, player2.y * 10);\n return ws;\n }",
"private Scene createMainMenuScene() {\n VBox root = new VBox();\n root.setId(\"pane\");\n root.setAlignment(Pos.CENTER);\n root.setSpacing(BUTTON_DISTANCE);\n\n Label lTitle = new Label(\"2048 Fx\");\n lTitle.setId(\"title-label\");\n root.getChildren().add(lTitle);\n\n Button bNewGame = new Button(\"New game\");\n bNewGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n Game.board.init();\n }\n });\n bNewGame.setId(\"c16\");\n root.getChildren().add(bNewGame);\n\n Button bLoadGame = new Button(\"Load game\");\n bLoadGame.setId(\"c256\");\n bLoadGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Load saving\");\n File directory = new File(\"./savegames\");\n if (!directory.exists()) {\n directory = new File(\"./\");\n }\n fileChooser.setInitialDirectory(directory);\n FileChooser.ExtensionFilter extFilter =\n new FileChooser.ExtensionFilter(\"Saved 2048 games\", \"*.saving\");\n fileChooser.getExtensionFilters().add(extFilter);\n File file = fileChooser.showOpenDialog(Game.stage);\n if (file != null) {\n Game.board.replay(file);\n }\n }\n });\n root.getChildren().add(bLoadGame);\n\n Button bSettings = new Button(\"Settings\");\n bSettings.setId(\"c4096\");\n bSettings.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n settingsMenu();\n }\n });\n root.getChildren().add(bSettings);\n\n Button bGenerate = new Button(\"Also\");\n bGenerate.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n\tGame.statBoard.statMenu();\n }\n });\n bGenerate.setId(\"c1024\");\n root.getChildren().add(bGenerate);\n\n Button bQuit = new Button(\"Quit\");\n bQuit.setId(\"c65536\");\n bQuit.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileHandler.saveSettings(Game.settings);\n Game.stage.close();\n }\n });\n root.getChildren().add(bQuit);\n Scene menuScene = new Scene(root, Game.WINDOW_SIZE_X, Game.WINDOW_SIZE_Y);\n menuScene.getStylesheets().\n addAll(this.getClass().getResource(\"menu.css\").toExternalForm());\n return menuScene;\n }",
"public static Scene scene2() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene2\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initAmbient(new Vec(0.4))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game).\r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// Add lighting condition:\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.7));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public static Scene scene4() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene4\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t\r\n\t\t// (2) Add two domes to make it look like we split a sphere in half. \r\n\t\tShape domeShape = new Dome(new Point(2.0, 0.0, -10.0), 5.0, new Vec(1.0, 0.0, 0.0));\r\n\t\tMaterial domeMat = Material.getRandomMaterial();\r\n\t\tSurface domeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\tdomeShape = new Dome(new Point(-2.0, 0.0, -10.0), 5.0, new Vec(-1.0, 0.0, 0.0));\r\n\t\tdomeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 75.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 6.0, -10.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(.5,0.5,0.5));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public Scene() {}",
"public void buildWorld() {\n buildBoundaryWall();\n buildDiscreteWorld();\n removeBoundaryWall();\n reorganizeNote();\n connectWorld();\n buildWall();\n }",
"public void run() throws Exception {\n settings = WindowSettings.builder()\n// .setWindowMode( WindowMode.FULLSCREEN )\n// .setWindowMode( WindowMode.BORDERLESS )\n .setWindowMode( WindowMode.WINDOWED )\n .setMonitorIndex( 1 )\n .setResizeable( true )\n// .setPositionX( -1920 )\n// .setWidth( -1 )\n// .setHeight( -1 )\n .build();\n \n //Here most likely we will only use Rectangle for objects like bullets and characters and RectangleGrid for terrain\n //RectangleGrid provides nice method for translating array position into rendered space position so they can be shared for same terrains\n //Texture path can be either file in filesystem or within jar\n var texture1 = Texture.create( \"resources/First Oracle/grid.png\" );\n var texture2 = Texture.create( \"resources/First Oracle/texture3D.png\" );\n var overlayObject = new DirectableRectangle();\n overlayObject.setTexture( texture1 );\n \n //Example initialisation of map\n var terrain = new StaticCubeGrid();\n terrain.setTexture( texture2 );\n \n var array = new CubeGrid[ 20 ][ 10 ][ 20 ];\n \n for ( var x = 0; x < 20; x++ ) {\n for ( var y = 0; y < 10; y++ ) {\n for ( var z = 0; z < 20; z++ ) {\n array[ x ][ y ][ z ] = terrain;\n }\n }\n }\n \n //GridRenderer will be changed so it works as either 2D or 3D. For now leave it as it is so you can see whether the rendering still works.\n grid3DRenderer = new BoundedGrid3D( 100, 25, 5 );\n grid2DRenderer = new DummyGrid2D();\n //Rendered scene is what is displayed via OpenGL rendering, it should be most likely moved to SceneProvider\n //Which will provide next scenes to renderObject when something changes.\n renderedScene = new RenderableSceneMutable( settings );\n \n //Scene provider could be used for providing different scenes. For example one for open credits, one for main menu and one for game.\n //New scenes could be created when other scene is presented and immediately switched to when ready.\n //Now we are providing one scene so this simple lambda can be used instead.\n sceneProvider = () -> renderedScene ;\n\n //Overlay is rendered on top of anything so it's good for UI elements, although only 2D objects are supported.\n RegistrableOverlay overlay = new RegistrableOverlayImpl();\n overlay.registerOverlay( overlayObject );\n renderedScene.setOverlay( overlay );\n \n //Renderer is class that contains all information like scenes and grids.\n renderer = new WindowRenderer(\n grid2DRenderer,\n grid3DRenderer,\n sceneProvider\n );\n \n //Window is window displayed with OpenGL\n //Also it initialises OpenGL (via init()) content and initialises most of the objects passed via parameters\n //It also contains rendering loop which is done via run() method, best if called as another thread since it will block current thread for ever.\n window = WindowBuilder.simpleWindow( settings, renderer ).build();\n \n //Camera controller provides two cameras: 2D and 3D, which are updated corresponding to used input.\n cameraController = CameraController.createAndStart( window, settings, CameraKeyMap.getFunctionalKeyLayout(), 10, 15f );\n \n //Now the Scene3D is being set up like camera, which objects etc.\n //Scene2D is similar but you are providing 2D Objects instead of 3D\n //Scenes 2D and 3D are designed to be used for in game objects like characters, terrain or items\n renderedScene.setScene3D( new RenderableScene3DImpl( cameraController.getCamera3D(), Collections.emptyList(), array, FirstOracleConstants.INDEX_ZERO_3I ) );\n \n //Background is bunch of 2D objects rendered beneath other elements, so could be used for background images or skybox.\n //It also provides background colour which can be seen when there are no objects displayed in some places.\n renderedScene.setBackground( new RenderableBackgroundImpl( IdentityCamera2D.getCamera(), Collections.emptyList(), FirstOracleConstants.WHITE ) );\n \n overlay.registerOverlay( new FpsCounter( window ) );\n \n //At last the window loop must be run in this thread. ( or thread where init() was called )\n window.run();\n }",
"public void create() {\n connect();\n batch = new SpriteBatch();\n font = new BitmapFont();\n\n audioManager.preloadTracks(\"midlevelmusic.wav\", \"firstlevelmusic.wav\", \"finallevelmusic.wav\", \"mainmenumusic.wav\");\n\n mainMenuScreen = new MainMenuScreen(this);\n pauseMenuScreen = new PauseMenuScreen(this);\n settingsScreen = new SettingsScreen(this);\n completeLevelScreen = new CompleteLevelScreen(this);\n completeGameScreen = new CompleteGameScreen(this);\n\n setScreen(mainMenuScreen);\n }",
"private void build() {\r\n \tapplyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n setContentPane(buildContentPane());\r\n setTitle(getWindowTitle());\r\n setJMenuBar(\r\n createMenuBuilder(this).buildMenuBar(\r\n settings,\r\n createHelpActionListener(),\r\n createAboutActionListener()));\r\n setIconImage(readImageIcon(\"eye_16x16.gif\").getImage());\r\n }",
"private void initializeGUIComponents() {\n\t\tmyScene = new Scene(myRoot);\n ButtonConditionManager.getInstance().beginListeningToScene(myScene);\n\t\tmyStage.setTitle(\"MY PLAYER VIEW\");\n\t\tmyStage.setScene(myScene);\n\t\tmyStage.show();\n\t\tmyCanvas = new GameCanvas();\n\t\tmyRoot.getChildren().add(myCanvas.getNode());\n\t\tmyCanvas.getNode().toBack();\n\t}",
"private void construct(){\n TriangleMesh mesh;\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/bunny.obj\");\n mesh.setMaterial(new MaterialNode(0.1f, 0.1f, .5f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/cube.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 0, 0));\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/teddy.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 0, 1, 0));\n mesh.setMaterial(new MaterialNode(0.1f, .5f, 0.1f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/sphere.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 1, 0));\n mesh.setMaterial(new MaterialNode(1, 0, 0, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n scene.calculateNormals();\n scene.setupRendering();\n }",
"private void createScene() {\r\n imageView.setFitWidth(400);\r\n imageView.setFitHeight(300);\r\n\r\n Scene scene = new Scene(rootScene(), 700, 600);\r\n\r\n primaryStage.setTitle(TITLE);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n }",
"private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }",
"protected Scene buildScene() throws FileNotFoundException, NoSuchObjectException {\n SplitPane split = new SplitPane();\n Scene myGameScene = new Scene(split, 800, 600);\n split.setDividerPositions(0.35f, 0.6f);\n attachStyle(myGameScene, \"GameView\");\n\n Pane leftPane = getPane(myGameResourceBundle.getString(\"LeftPaneCss\"));\n buildLeftSplitPane(leftPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n Pane rightPane = getPane(myGameResourceBundle.getString(\"RightPaneCss\"));\n Entity player = getPlayerEntity();\n background = new ImageView(new Image(new FileInputStream(levelInfoParser.getBackgroundImage())));\n cameraView = new CameraView(player, myGameScene.heightProperty(), myGameScene.widthProperty());\n buildRightSplitPane(rightPane);\n cameraView.bindBackgroundImage(background);\n ImageView playerDisplay = cameraView.createPlayerDisplay(player);\n setUpGameOver(player);\n rightPane.getChildren().add(playerDisplay);\n split.getItems().addAll(leftPane, rightPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n myGameScene.setOnKeyPressed(e -> handleKeyPressed(e));\n cameraView.handleCamera(rightPane, playerDisplay,background);\n myGameScene.setOnKeyReleased(e->handleKeyReleased(e));\n rightPane.requestFocus();\n rightPane.setFocusTraversable(true);\n return myGameScene;\n }",
"private void createMenuChildScene() {\n\t\tmenuChildScene = new MenuScene(camera);\n\t\tmenuChildScene.setPosition(0, 0);\n\n\t\tfinal IMenuItem profile02MenuItem = new ScaleMenuItemDecorator(\n\t\t\t\tnew SpriteMenuItem(MENU_PROFILE02,\n\t\t\t\t\t\tresourcesManager.btProfile02TR, vbom), 1f, .8f);\n\t\tfinal IMenuItem profile24MenuItem = new ScaleMenuItemDecorator(\n\t\t\t\tnew SpriteMenuItem(MENU_PROFILE24,\n\t\t\t\t\t\tresourcesManager.btProfile24TR, vbom), 1f, .8f);\n\t\tfinal IMenuItem profile4MenuItem = new ScaleMenuItemDecorator(\n\t\t\t\tnew SpriteMenuItem(MENU_PROFILE4,\n\t\t\t\t\t\tresourcesManager.btProfile4TR, vbom), 1f, .8f);\n\n\t\tmenuChildScene.addMenuItem(profile02MenuItem);\n\t\tmenuChildScene.addMenuItem(profile24MenuItem);\n\t\tmenuChildScene.addMenuItem(profile4MenuItem);\n\n\t\tmenuChildScene.buildAnimations();\n\t\tmenuChildScene.setBackgroundEnabled(false);\n\n\t\tprofile02MenuItem.setPosition(150, 280);\n\t\tprofile24MenuItem.setPosition(400, 280);\n\t\tprofile4MenuItem.setPosition(650, 280);\n\n\t\tmenuChildScene.setOnMenuItemClickListener(this);\n\t\t\n\t\t//-- change language button -----------------------------------------------------------------------------\n\t\t\n\t\tchangLang = new TiledSprite(400,60, resourcesManager.btLangTR, vbom){\n\t\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\tswitch(pSceneTouchEvent.getAction()){\n\t\t\tcase TouchEvent.ACTION_DOWN:\n\t\t\t\tbreak;\n\t\t\tcase TouchEvent.ACTION_UP:\n\t\t\t\tplaySelectSound();\n\t\t\t\tif(localLanguage==0){\n\t\t\t\t\tchangeLanguage(\"UK\");\n\t\t\t\t\tthis.setCurrentTileIndex(1);\n\t\t\t\t\tlocalLanguage=1;\n\t\t\t\t}else if (localLanguage==1) {\n\t\t\t\t\tchangeLanguage(\"FR\");\n\t\t\t\t\tthis.setCurrentTileIndex(0);\n\t\t\t\t\tlocalLanguage=0;\n\t\t\t\t}\n\t\t\t\tupdateTexts();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\t\n\t\tif(localLanguage==0){\t\t\t\n\t\t\tchangLang.setCurrentTileIndex(0);\n\t\t}else{\t\t\n\t\t\tchangLang.setCurrentTileIndex(1);\n\t\t}\n\t\t\n\t\tthis.attachChild(changLang);\n\t\tthis.registerTouchArea(changLang);\n\t\t//-----------------------------------------------------------------------------------------------------\n\n\n\t\tsetChildScene(menuChildScene);\n\t}",
"public void createLevel(){\n for(LevelController rc: rooms ) {\n rc.loadContent();\n rc.setScreenListener(listener);\n rc.setCanvas(canvas);\n }\n }",
"public void Scene() {\n Scene scene = new Scene(this.root);\n this.stage.setScene(scene);\n this.stage.show();\n }",
"public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}",
"private void buildWindow(){\r\n\t\tthis.setSize(new Dimension(600, 400));\r\n\t\tFunctions.setDebug(true);\r\n\t\tbackendConnector = new BackendConnector(this);\r\n\t\tguiManager = new GUIManager(this);\r\n\t\tmainCanvas = new MainCanvas(this);\r\n\t\tadd(mainCanvas);\r\n\t}",
"private void buildComponents() {\r\n buildJMenuBar();\r\n setJMenuBar( gameBar );\r\n\r\n buildScorePanel();\r\n buildInfoPanel();\r\n\r\n getContentPane().add( scorePanel, \"North\" );\r\n getContentPane().add( infoPanel, \"South\" );\r\n }",
"public void buildFrame();",
"@Override\r\n\tpublic void start(Stage primaryStage) throws Exception {\r\n\t\tstagePrimary = primaryStage;\r\n\t\tstagePrimary.setTitle(\"Intelligent Building By Curtis Baldwin\");\r\n\t\tBorderPane bp = new BorderPane();\r\n\t\tbp.setPadding(new Insets(10, 20, 10, 20));\r\n\r\n\t\tbp.setTop(setMenu()); // put menu at the top\r\n\r\n\t\tGroup root = new Group(); // create group with canvas\r\n\t\tCanvas canvas = new Canvas(500, 500);\r\n\t\troot.getChildren().add(canvas);\r\n\t\tbp.setCenter(root); // load canvas to left area\r\n\r\n\t\tgc = canvas.getGraphicsContext2D(); // context for drawing\r\n\r\n\t\ttimer = new AnimationTimer() { // set up timer\r\n\t\t\tpublic void handle(long currentNanoTime) {\r\n\t\t\t\ttheBuilding.update();\r\n\t\t\t\ttheBuilding.updateHoover();\r\n\t\t\t\tdrawBuilding();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\trtPane = new VBox(); // set vBox on right to list items\r\n\t\trtPane.setAlignment(Pos.TOP_LEFT);\r\n\t\trtPane.setPadding(new Insets(5, 75, 75, 5));\r\n\t\tbp.setRight(rtPane);\r\n\r\n\t\tbp.setBottom(setButtons()); // set bottom pane with buttons\r\n\r\n\t\tScene scene = new Scene(bp, 800, 600); // set overall scene\r\n\t\tbp.prefHeightProperty().bind(scene.heightProperty());\r\n\t\tbp.prefWidthProperty().bind(scene.widthProperty());\r\n\r\n\t\tprimaryStage.setScene(scene);\r\n\t\tprimaryStage.show();\r\n\t\twhichBuild = 0;\r\n\t\ttheBuilding = new Building(buildingString());\r\n\t\tshowWelcome(); // set welcome message\r\n\t\tdrawBuilding();\r\n\t}",
"private void initRendering() {\n\t\tmActivity.showDebugMsg(\" initRendering\");\n\t\tGLES20.glClearColor(0.0f, 0.0f, 0.0f, Vuforia.requiresAlpha() ? 0.0f : 1.0f);\n\n\t\tfor (Texture t : mTextures) {\n\t\t\tGLES20.glGenTextures(1, t.mTextureID, 0);\n\t\t\tGLES20.glBindTexture(GLES20.GL_TEXTURE_2D, t.mTextureID[0]);\n\t\t\tGLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);\n\t\t\tGLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);\n\t\t\tGLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, t.mWidth, t.mHeight, 0, GLES20.GL_RGBA,\n\t\t\t\t\tGLES20.GL_UNSIGNED_BYTE, t.mData);\n\t\t}\n\n\t\tshaderProgramID = ArUtils.createProgramFromShaderSrc(\n\t\t\t\tShaders.CUBE_MESH_VERTEX_SHADER,\n\t\t\t\tShaders.CUBE_MESH_FRAGMENT_SHADER);\n\n\t\tvertexHandle = GLES20.glGetAttribLocation(shaderProgramID,\n\t\t\t\t\"vertexPosition\");\n\t\ttextureCoordHandle = GLES20.glGetAttribLocation(shaderProgramID,\n\t\t\t\t\"vertexTexCoord\");\n\t\tmvpMatrixHandle = GLES20.glGetUniformLocation(shaderProgramID,\n\t\t\t\t\"modelViewProjectionMatrix\");\n\t\ttexSampler2DHandle = GLES20.glGetUniformLocation(shaderProgramID,\n\t\t\t\t\"texSampler2D\");\n\n\t\tif (!mModelIsLoaded) {\n\t\t\t//object = new Teapot();\n\t\t\tobject = mActivity.get3DObject();\n\t\t\tobjectScaleFloat *= object.getDefScale();\n\t\t\t//minObjectScale *= object.getDefScale();\n\t\t\t//maxObjectScale *= object.getDefScale();\n\n\t\t\tmActivity.showDebugMsg(\"Loading model Teapot\");\n\t\t\t// Hide the Loading Dialog\n\t\t\t//mActivity.loadingDialogHandler.sendEmptyMessage(LoadingDialogHandler.HIDE_DIALOG);\n\t\t}\n\n\t}",
"void createScene(){\n\t\tmainScene = new Scene(mainPane);\r\n\t\t\r\n\t\t//If keyEvent is not focussed on a node on the scene, you can attach\r\n\t\t//a keyEvent to a scene to be consumed by the screen itself.\r\n\t\tCloser closer = new Closer();\r\n\t\tmainScene.setOnKeyPressed(closer);\r\n\t}",
"private void createScene() \n {\n PlatformImpl.startup(\n new Runnable() {\n public void run() { \n Group root = new Group(); \n Scene scene = new Scene(root, 80, 20); \n SizeView sizeview = createSizeView(scene);\n root.getChildren().add(sizeview);\n jfxPanel.setScene(scene); \n } \n }); \n }",
"public void build() {\n x = vertices.get(0);\n y = vertices.get(1);\n vertices.reverse();\n BodyFactory.createPolyLine(x, y, vertices.toArray(), BodyDef.BodyType.StaticBody, LineType.SOLID);\n }",
"private Node generateView() {\n Text text = new Text(\"Click to\\nextinguish!\");\n text.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD, Font.getDefault().getSize()));\n text.setTextAlignment(TextAlignment.CENTER);\n text.setPickOnBounds(false);\n text.setMouseTransparent(true);\n\n VBox box = new VBox(5.0);\n\n AnimationChannel animChannel = new AnimationChannel(FXGL.image(\"flames.png\"), 4, 20, 20,\n Duration.seconds(ANIM_TIME), 0, 3);\n AnimatedTexture texture = new AnimatedTexture(animChannel).loop();\n texture.setFitWidth(SIZE);\n texture.setFitHeight(SIZE);\n texture.setSmooth(false);\n texture.setPickOnBounds(true);\n texture.setOnMousePressed(pEvt -> {\n FXGL.play(\"sizzle.wav\");\n FXGL.removeUINode(box);\n mCount--;\n if (mCount <= 0) {\n onCompleted();\n }\n pEvt.consume();\n });\n\n // Wrap in entity so animation plays\n mEntity = FXGL.entityBuilder().view(texture).buildAndAttach();\n\n box.getChildren().addAll(text, texture);\n box.setAlignment(Pos.CENTER);\n box.setPickOnBounds(false);\n\n // Fix width for accurate location generation\n box.setMinWidth(SIZE * 2.0);\n box.setMaxWidth(SIZE * 2.0);\n box.setPrefWidth(SIZE * 2.0);\n\n return box;\n }",
"private void initComponents() {\n\n scenePanel = new javax.swing.JPanel();\n\n setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.PAGE_AXIS));\n\n scenePanel.setLayout(new javax.swing.BoxLayout(scenePanel, javax.swing.BoxLayout.LINE_AXIS));\n add(scenePanel);\n }",
"public void loadContent()\r\n\t{\r\n\t\t// Load the current scene's content.\r\n\t\tif (_CurrentScene != null)\r\n\t\t{\r\n\t\t\t_CurrentScene.loadContent();\r\n\t\t}\r\n\t}",
"private void buildContentPane() {\n\t\t// The JPanel that will become the content pane\n\t\tJPanel cp = new JPanel();\n\t\tcp.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS));\n\n\t\tlanguagePanel = initLanguagePanel();\n\t\tcp.add(languagePanel);\n\n\t\tinputPanel = initInputPanel();\n\t\tcp.add(inputPanel);\n\n\t\tJPanel btnPanel = initBtnPanel();\n\t\tcp.add(btnPanel);\n\n\t\toutputPanel = initOutputPanel();\n\t\tcp.add(outputPanel);\n\n\t\tJPanel picturePanel = initPicturePanel();\n\t\tif(picturePanel == null) {\n\t\t\tframe.setSize(FRAME_WIDTH, FRAME_SMALL_HEIGHT);\n\t\t}\n\t\telse {\n\t\t\tcp.add(picturePanel);\n\t\t}\n\n\t\tLanguage selectedLang = languagePanel.getSelectedLanguage();\n\t\tsetLanguage(selectedLang);\n\n\t\tframe.setContentPane(cp);\n\t}",
"public void startApp() throws MIDletStateChangeException {\n // Catch exceptions here before they go too far.\n try {\n // Create a new M3G world.\n myWorld = new World();\n\n // In this world, we have a root group which will contain everything else\n // and which is tilted 15 degrees towards the camera.\n Group rootGroup2 = new Group();\n myWorld.addChild(rootGroup2);\n rootGroup2.setOrientation(15.0f, 1.0f, 0.0f, 0.0f);\n\n // Under this, we have a second group which will be the one we rotate\n // to get an all-round view of the game grid.\n rootGroup = new Group();\n rootGroup2.addChild(rootGroup);\n\n // We now create a parallel camera - parallel projection is faster than\n // perspective, and since we are rendering 512 separate objects that's a\n // saving worth having.\n Camera myCamera = new Camera();\n myWorld.addChild(myCamera);\n myWorld.setActiveCamera(myCamera);\n\n myCamera.setParallel(CUBESIZE * 1.5f, 1.0f, -CUBESIZE, CUBESIZE);\n\n // This is geometry data for the shape that represents a single cell - a cube. \n // It consists of 6 triangle strips, one for each face, each of which\n // has 2 triangles (and therefore 4 vertices). We will set the vertex\n // colors so that the colors of the sides are different from each other.\n\n // This data is shared by all the cells in the grid, rather than each having\n // its own copy. This keeps memory overhead down.\n int[][] aaStripLengths = {\n { 4 },\n { 4 },\n { 4 },\n { 4 },\n { 4 },\n { 4 }\n };\n\n // These are the vertex positions\n short[] aPos =\n {\n \n // Front\n -1, -1, 1, // B\n 1, -1, 1, // C\n -1, 1, 1, // A\n 1, 1, 1, // D\n // Bottom\n -1, -1, -1, // F\n 1, -1, -1, // G\n -1, -1, 1, // B\n 1, -1, 1, // C\n // Top\n -1, 1, 1, // A\n 1, 1, 1, // D\n -1, 1, -1, // E\n 1, 1, -1, // H\n // Right\n 1, 1, 1, // D\n 1, -1, 1, // C\n 1, 1, -1, // H\n 1, -1, -1, // G\n // Left\n -1, -1, 1, // B\n -1, 1, 1, // A\n -1, -1, -1, // F\n -1, 1, -1, // E\n // Back\n 1, -1, -1, // G\n -1, -1, -1, // F\n 1, 1, -1, // H\n -1, 1, -1 // E\n };\n\n // These are the colors for the vertices\n byte[] aCol =\n {\n \n // Front\n -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, // Bottom\n 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, // Top\n 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, \n // Right\n -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, \n // Left\n -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, // Back\n 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1,\n };\n\n // Calculate the number of submeshes and vertices directly from the sizes\n // of the arrays. This prevents us getting a mismatch if we decide to change\n // the cells to a different shape later.\n int cSubmeshes = aaStripLengths.length;\n int cVertices = aPos.length / 3;\n\n // We will share a default appearance between all the faces on the cube. Each\n // face is a separate \"submesh\" - it can have a separate appearance if we wish.\n Appearance app = new Appearance();\n\n // We need to specify an appearance and the submesh data for each face.\n Appearance[] appa = new Appearance[cSubmeshes];\n IndexBuffer[] iba = new IndexBuffer[cSubmeshes];\n\n int startIndex = 0;\n\n for (int i = 0; i < cSubmeshes; i++) {\n // We use the same appearance for each.\n appa[i] = app;\n\n // And we create a new triangle strip array for each submesh.\n // The start index for each one just follows on from previous submeshes.\n iba[i] = new TriangleStripArray(startIndex, aaStripLengths[i]);\n\n for (int j = 0; j < aaStripLengths[i].length; j++)\n startIndex += aaStripLengths[i][j];\n }\n\n // Now we create a new vertex buffer that contains all the above information\n VertexBuffer vertexBuffer = new VertexBuffer();\n vertexBuffer.setDefaultColor(0xFFFFFFFF); // white\n\n {\n // Copy the vertex positions into a VertexArray object\n VertexArray vaPos = new VertexArray(cVertices, 3, 2);\n vaPos.set(0, cVertices, aPos);\n vertexBuffer.setPositions(vaPos, 0.40f, null);\n }\n\n {\n // Copy the vertex colors into a VertexArray object\n VertexArray vaCols = new VertexArray(cVertices, 3, 1);\n vaCols.set(0, cVertices, aCol);\n vertexBuffer.setColors(vaCols);\n }\n\n // Create all the cells, in a random state.\n // The X, Y and Z positions of the cells range from -CUBESIZE/2 to +CUBESIZE/2 units.\n // They are all children of the rootGroup object.\n cells = new Mesh[NUMCELLS];\n nextState = new byte[NUMCELLS];\n currentState = new byte[NUMCELLS];\n rand = new Random();\n\n int index = 0;\n\n for (int i = 0; i < CUBESIZE; i++) {\n float x = ((i * 2) - CUBESIZE) * 0.5f;\n\n for (int j = 0; j < CUBESIZE; j++) {\n float y = ((j * 2) - CUBESIZE) * 0.5f;\n\n for (int k = 0; k < CUBESIZE; k++) {\n float z = ((k * 2) - CUBESIZE) * 0.5f;\n\n Mesh m = new Mesh(vertexBuffer, iba, appa);\n m.setTranslation(x, y, z);\n rootGroup.addChild(m);\n\n // This test gives a 1 in 4 chance of being alive at the start\n currentState[index] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n cells[index++] = m;\n }\n }\n }\n\n // Attach to display\n myDisplay.setCurrent(myCanvas);\n\n // Force a repaint so that we get the update loop started.\n myCanvas.repaint();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void simpleInitApp() {\n setDisplayStatView(false);\n setDisplayFps(false);\n\n // just a blue box\n Box mesh = new Box(1, 1, 1);\n Geometry geom = new Geometry(\"Box\", mesh);\n Material mat = new Material(assetManager,\n \"Common/MatDefs/Misc/Unshaded.j3md\");\n mat.setColor(\"Color\", ColorRGBA.Blue);\n geom.setMaterial(mat);\n rootNode.attachChild(geom);\n\n // Display a line of text in the default font on depth layer 0\n guiFont = assetManager.loadFont(\"Interface/Fonts/Default.fnt\");\n distanceText = new BitmapText(guiFont);\n distanceText.setSize(guiFont.getCharSet().getRenderedSize());\n distanceText.move( // x/y coordinates and z = depth layer 0\n settings.getWidth() / 2 + 50,\n distanceText.getLineHeight() + 20,\n 0);\n guiNode.attachChild(distanceText);\n\n // Display a 2D image or icon on depth layer -2\n Picture frame = new Picture(\"User interface frame\");\n frame.setImage(assetManager, \"Interface/frame.png\", false);\n frame.move(settings.getWidth() / 2 - 265, 0, -2);\n frame.setWidth(530);\n frame.setHeight(10);\n guiNode.attachChild(frame);\n\n // Display a 2D image or icon on depth layer -1\n Picture logo = new Picture(\"logo\");\n logo.setImage(assetManager, \"Interface/Monkey.png\", true);\n logo.move(settings.getWidth() / 2 - 47, 2, -1);\n logo.setWidth(95);\n logo.setHeight(75);\n guiNode.attachChild(logo);\n }",
"@Override\n\tpublic void create() {\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t\n\t\t//Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\t\n\t\t//initialize controller and renderer\n\t\tworldController = new WorldController();\n\t\tworldRenderer= new WorldRenderer(worldController);\n\t\t\n\t\t//The world is not paused on start\n\t\tpaused = false;\n\t}",
"@Override\n\tpublic void createScene()\n\t\n\t{\n\t loading = new Sprite (0,0,resourceManager.loadingRegion,vbo); // тупо ставим спрайт с картинкой\n\t\tattachChild(loading);\n\t}",
"public static void start(){\n new Light(new Vector3f(getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2));\n Keyboard.enableRepeatEvents(true);\n createWindow();\n initGL();\n generateWorld();\n Game.gameLoop();\n }",
"public static Scene scene8() {\r\n\t\t// Define basic properties of the scene\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0),\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 1.5)\r\n\t\t\t\t.initName(\"scene8\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.81,0.93,1))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\t\t// Add Surfaces to the scene.\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-1,0.0), new Point(0.0, -1, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial().initKa(new Vec(0.2)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(0, 10, -25), 10);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(false)\r\n\t\t\t\t.initRefractionIndex(0).initReflectionIntensity(0.4).initKs(new Vec(1.0)).initKd(new Vec(0));\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tdouble[] radiuses = new double[] { 0.3, 0.8, 1, 1.5, 2, 1.4, 0.2, 0.9, 1.2, 2.1 };\r\n\r\n\t\tfor (int i = -10; i < 10; i+=3) {\r\n\t\t\tint sphereCenterZ = -5 + (int)(Math.random() * 3);\r\n\t\t\tint radiusIndex = (int)(Math.random() * 10);\r\n\t\t\tdouble radius = radiuses[radiusIndex];\r\n\t\t\tShape distantSphere1 = new Sphere(new Point(i, radiuses[radiusIndex] - 1, sphereCenterZ), radius);\r\n\t\t\tMaterial distantSphere1Mat = Material.getRandomMaterial();\r\n\t\t\tSurface distantSphere1Surface = new Surface(distantSphere1, distantSphere1Mat);\r\n\t\t\tfinalScene.addSurface(distantSphere1Surface);\r\n\t\t}\r\n\r\n\t\t// Add light sources:\r\n\t\tLight dirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\tdirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\treturn finalScene;\r\n\t}",
"public RenderEngine() {\n\t\twindow = Window.getInstance();\n\t\t\n\t\ttestEntity = new Entity(\"skull/skull.obj\", \"./res/models/skull/skull.png\", new Vector3f(0,0,0), new Vector3f(0,0,0));\n\t\ttestEntity.getWorldTransform().setScaling(new Vector3f(0.01f,0.01f,0.01f));\n\t\t\n\t\ttestEntity2 = new Entity(\"dummy/dummy.obj\", \"./res/models/dummy/dummy.jpg\", new Vector3f(0,8,0), new Vector3f(0,0,0));\n\t\ttestEntity2.getWorldTransform().setScaling(new Vector3f(0.05f,0.05f,0.05f));\n\t\t\n\t\ttestLight = new Light(new Vector3f(-5,5,-5), new Vector3f(1,1,1));\n\t\ttestLight.getWorldTransform().setScaling(new Vector3f(0.1f,0.1f,0.1f));\n\t\t\n\t\tsky = new SkyDome();\n\t\t\n\t}",
"public Scene createScene() {\n root = new Group();\n key = new Group();\n Scene scene = new Scene(root, 500, 500, Color.WHITE);\n addRootNode();\n setupKey();\n getAlreadyConnectedPeers();\n return scene;\n }",
"public void loadContent(){\n\t\tspriteBatch = new SpriteBatch(getGraphicsDevice());\n\t\t//TODO: put content loading code here\n\t\t\n\t}",
"public void build() {\n\t\tgenerate();\n\t\tstoreAns();\n\t\t// display();\n\t}",
"public void initScenes()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n m_pInScene.setPosition(new CCPoint(-(s.width - 0.5f), 0));\n }",
"public static Scene scene7() {\r\n\t\tPoint cameraPosition = new Point(-3.0, 1.0, 6.0);\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */cameraPosition,\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene7\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.01,0.19,0.22))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-4.3,0.0), new Point(0.0, -4.3, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial()\r\n\t\t\t\t.initKa(new Vec(0.11,0.09,0.02)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(1.5, 0, -3.5), 4);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(true)\r\n\t\t\t\t.initRefractionIntensity(0.8).initRefractionIndex(1.35).initReflectionIntensity(0.4);\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tPoint sunPosition = new Point(0, 3, -45);\r\n\t\tShape sunDome = new Dome(sunPosition, 8, new Vec(0, 1, 0));\r\n\t\tMaterial sunDomeMat = Material.getMetalMaterial().initKa(new Vec(0.95,0.84,0.03));\r\n\t\tSurface sunDomeSurface = new Surface(sunDome, sunDomeMat);\r\n\t\tfinalScene.addSurface(sunDomeSurface);\r\n\r\n\t\tVec sunDirection = cameraPosition.sub(sunPosition);\r\n\t\tLight sunLight = new DirectionalLight(sunDirection, new Vec(0.95,0.84,0.03));\r\n\t\tfinalScene.addLightSource(sunLight);\r\n\r\n\t\treturn finalScene;\r\n\t}",
"@Override\npublic void populateScene() {\n\t\n}",
"private void buildUIElements() {\n uiCamera = new OrthographicCamera( Global.WINDOW_WIDTH, Global.WINDOW_HEIGHT );\n uiViewport = new ExtendViewport( Global.WINDOW_WIDTH, Global.WINDOW_HEIGHT, uiCamera );\n\n //Build the table.\n uiStage = new Stage( uiViewport );\n rootTable = new Table( VisUI.getSkin() );\n uiStage.addActor( rootTable );\n rootTable.setFillParent( true );\n rootTable.left().top();\n\n //Fill up the healthMeter is images to be used as healthBars.\n for ( int i = 0; i < 20; i++ ) {\n healthMeter.add( new Image( healthBars.findRegion( \"highHealth\" ) ) );\n }\n }",
"public static Node buildWorld(AssetManager assetManager) {\n TextureKey keyFloor = new TextureKey(\"Models/Scene/wall_diffuse_1.jpg\", false);// pave_color.jpg\n Texture texFloor = assetManager.loadTexture(keyFloor);\n\n TextureKey keyNorm = new TextureKey(\"Models/Scene/wall_normal.jpg\", false);// pave_norm.jpg\n Texture texNormalPlane = assetManager.loadTexture(keyNorm);\n\n Material mat_basic = new Material(assetManager, \"Common/MatDefs/Light/PBRLighting.j3md\");\n mat_basic.setTexture(\"BaseColorMap\", texFloor);\n mat_basic.setTexture(\"NormalMap\", texNormalPlane);\n mat_basic.setFloat(\"Metallic\", 0.1f);\n mat_basic.setFloat(\"Roughness\", 0.00f);\n mat_basic.setFloat(\"Glossiness\", 0.5f);\n\n // Must be false - otherwise uv gets messed up.\n TextureKey keyFloor2 = new TextureKey(\"Models/Scene/deck.jpg\", false);\n Texture texFloor2 = assetManager.loadTexture(keyFloor2);\n TextureKey keyNorm2 = new TextureKey(\"Models/Scene/deck_normal.jpg\", false);\n Texture texNormalPlane2 = assetManager.loadTexture(keyNorm2);\n\n Material mat_basic2 = new Material(assetManager, \"Common/MatDefs/Light/PBRLighting.j3md\");\n mat_basic2.setTexture(\"BaseColorMap\", texFloor2);\n mat_basic2.setFloat(\"Metallic\", 0.1f);\n mat_basic2.setFloat(\"Roughness\", 0.1f);\n mat_basic2.setTexture(\"NormalMap\", texNormalPlane2);\n // Scene\n Node scene = (Node) assetManager.loadModel(\"Models/Scene/testScene.gltf\");\n\n // Tiling\n ((Geometry) scene.getChild(\"Plane\")).getMesh().scaleTextureCoordinates(new Vector2f(4, 4));\n mat_basic.getTextureParam(\"BaseColorMap\").getTextureValue().setWrap(WrapMode.Repeat);\n mat_basic.getTextureParam(\"NormalMap\").getTextureValue().setWrap(WrapMode.Repeat);\n // Tex for scene\n scene.getChild(\"Plane\").setMaterial(mat_basic);\n scene.getChild(\"Cube\").setMaterial(mat_basic2);\n\n Node probeNode = (Node) assetManager.loadModel(\"Models/Scene/market.j3o\");\n LightProbe probe = (LightProbe) probeNode.getLocalLightList().iterator().next();\n scene.addLight(probe);\n\n // We must add a light to make the model visible\n // Light\n DirectionalLight sun = new DirectionalLight();\n sun.setColor(ColorRGBA.White.mult(0.75f));\n sun.setDirection(new Vector3f(-.5f, -.5f, -.5f).normalizeLocal());\n scene.addLight(sun);\n\n return scene;\n }",
"@Override\n\tpublic void create() {\n\t\t// This should come from the platform\n\t\theight = platform.getScreenDimension().getHeight();\n\t\twidth = platform.getScreenDimension().getWidth();\n\n\t\t// create the drawing boards\n\t\tsb = new SpriteBatch();\n\t\tsr = new ShapeRenderer();\n\n\t\t// Push in first state\n\t\tgsm.push(new CountDownState(gsm));\n//\t\tgsm.push(new PlayState(gsm));\n\t}",
"public void build(){\n\t\t\r\n\t\t\tsetTitle(\"Temperature\");\r\n\t\t\tsetSize(220,150);\r\n\t\t\tsetLocationRelativeTo(null);\r\n\t\t\tsetResizable(false);\r\n\t\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\tsetVisible(true);\r\n\t\r\n\t\t\t\r\n\t\t\tsetContentPane(buildContentPane());\r\n\t\t}",
"private void GameInitialize()\r\n { \r\n // set to fullscreen to use the entire \r\n // display or false to only use\r\n // the area inbetween the two bars on the display\r\n setFullScreenMode(true);\r\n\r\n // setup 3D\r\n try\r\n {\r\n Object3D[] buffer = Loader.load(\"/RaptorWalk.m3g\");\r\n\r\n for(int i = 0; i < buffer.length; i++)\r\n {\r\n if(buffer[i] instanceof World)\r\n {\r\n // get our world node\r\n mWorld = (World)buffer[i];\r\n mEnemy = (SkinnedMesh)mWorld.find(56);\r\n mEnemyTimer = 0;\r\n break;\r\n }\r\n }\r\n }\r\n catch(Exception e) \r\n { System.out.println(\"Loading error!\" + e.getMessage()); }\r\n\r\n // create a game font\r\n mGameFont = Font.getFont(Font.FACE_MONOSPACE, \r\n Font.STYLE_PLAIN, Font.SIZE_SMALL);\r\n\r\n // Get the active camera from the world\r\n mCam = mWorld.getActiveCamera();\r\n mCam.translate(0, 1.0f, 0);\r\n\r\n // Create an ambient light and add it to the world node\r\n Light light = new Light();\r\n light.setMode(Light.AMBIENT);\r\n light.setIntensity(3);\r\n mWorld.addChild(light);\r\n }",
"public void setupScene() {\n\t\tplayScene = new Scene(new Group());\n\t\tupdateScene(playScene);\n\t\twindow.setScene(playScene);\n\t\twindow.show();\n\t}",
"@Override\n public void create() {\n tex = new Texture(Gdx.files.internal(\"data/scene.png\"));\n\n //important since we aren't using some uniforms and attributes that SpriteBatch expects\n ShaderProgram.pedantic = false;\n\n //print it out for clarity\n System.out.println(\"Vertex Shader:\\n-------------\\n\\n\" + VERT);\n System.out.println(\"\\n\");\n System.out.println(\"Fragment Shader:\\n-------------\\n\\n\" + FRAG);\n\n shader = new ShaderProgram(VERT, FRAG);\n if (!shader.isCompiled()) {\n System.err.println(shader.getLog());\n System.exit(0);\n }\n if (shader.getLog().length() != 0)\n System.out.println(shader.getLog());\n\n\n batch = new SpriteBatch(1000, shader);\n batch.setShader(shader);\n\n cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n cam.setToOrtho(false);\n }",
"@Override\n\tpublic void showContents() {\n\t\tprogram.add(Background);\n\t\tprogram.add(lvl1);\n\t\tprogram.add(lvl2);\n\t\tprogram.add(lvl3);\n\t\tprogram.add(Back);\n\n\t}",
"Scenes() {\n\n // Determines the length of the image arrays\n slideAmount = new int[sceneAmount];\n slideAmount[0] = 3;\n slideAmount[1] = 4;\n slideAmount[2] = 3;\n slideAmount[3] = 6;\n\n\n texts = new PImage[sceneAmount];\n SlideScene0 = new PImage[slideAmount[0]];\n SlideScene1 = new PImage[slideAmount[1]];\n SlideScene2 = new PImage[slideAmount[2]];\n SlideScene3 = new PImage[slideAmount[3]];\n\n //SlideScene4 = new PImage[slideAmount[4]];\n\n // Loads the border image\n border = loadImage(\"slideShow/border.png\");\n videoBackground = loadImage(\"slideShow/scene4/Background.PNG\");\n\n // Load in the text as images into the array\n for (int i = 0; i < sceneAmount; i++) {\n texts[i] = loadImage(\"text/text\" + i + \".png\");\n }\n\n // load the slideshow images into the array\n for (int d = 0; d < sceneAmount; d++) {\n for (int i = 0; i < slideAmount[d]; i++) {\n switch(d) {\n case 0:\n SlideScene0[i] = loadImage(\"slideShow/scene0/slide\" + i + \".png\");\n break;\n case 1:\n SlideScene1[i] = loadImage(\"slideShow/scene1/slide\" + i + \".png\");\n break;\n case 2:\n SlideScene2[i] = loadImage(\"slideShow/scene2/slide\" + i + \".png\");\n break;\n case 3:\n SlideScene3[i] = loadImage(\"slideShow/scene3/slide\" + i + \".png\");\n break;\n }\n }\n }\n }",
"@Override\n\tpublic Scene onLoadScene() {\n\t\tmEngine.registerUpdateHandler(new FPSLogger());\n\t\tScene scene=new Scene();\n\t\tAutoParallaxBackground autoParallaxBackground=new AutoParallaxBackground(0, 0, 0, 5);\n\t\tautoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 0, mTextureRegion)));\n\t\tscene.setBackground(autoParallaxBackground);\n\t\t//Position of the Sprite in the region\n\t\tAnimatedSprite banana=new AnimatedSprite(200,200,bananaRegion);\n\t\tbanana.animate(100);\n\t\tscene.attachChild(banana);\n\t\treturn scene;\n\t}",
"public WorldEditor() {\n \t\tthis.layers = new LinkedList<TextureLayer>();\n \t\tthis.setMinimumSize(new Dimension(1024, 768));\n \t\tContainer c = getContentPane();\n \t\tc.setLayout(new BorderLayout());\n \t\ttry {\n \t\t\tList<Tuple> ui = SADDL.parse(new InputStreamReader(getClass()\n \t\t\t\t\t.getResourceAsStream(\"res/menubar.sdl\")));\n \t\t\tfor (Tuple tuple : ui) {\n \t\t\t\tif (tuple.getKey().equalsIgnoreCase(\"MenuBar\")) {\n \t\t\t\t\tsetJMenuBar(new JKMenuBar((List<Tuple>) tuple.getValue()));\n \t\t\t\t}\n \t\t\t}\n \t\t\t// for the moment lets do it by hand, soemday well make it data\n \t\t\t// driven\n \t\t\tEnumButtonBar bar = new EnumButtonBar<ModeEnum>(ModeEnum.values());\n \t\t\tbar.addListener(new EnumButtonBarListener() {\n \n \t\t\t\t@Override\n \t\t\t\tpublic void enumSet(Enum actualEnum) {\n \t\t\t\t\tcurrentMode = (ModeEnum)actualEnum;\n \t\t\t\t\tif(currentMode == ModeEnum.Raise || currentMode == ModeEnum.Lower || currentMode == ModeEnum.Smooth\n \t\t\t\t\t\t\t|| currentMode == ModeEnum.Paint || currentMode == ModeEnum.Erase) {\n \t\t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\t\tif(brush.getParent() == null) world.attachChild(brush);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\t\tworld.detachChild(brush);\n \t\t\t\t\t}\n \t\t\t\t\tif(currentMode == ModeEnum.Raise || currentMode == ModeEnum.Lower || currentMode == ModeEnum.Smooth) {\n \t\t\t\t\t\tbrush.setColor(ColorRGBA.red);\n \t\t\t\t\t} else if(currentMode == ModeEnum.Paint || currentMode == ModeEnum.Erase) {\n \t\t\t\t\t\tbrush.setColor(ColorRGBA.blue);\n \t\t\t\t\t}\n \t\t\t\t\tmouseListener.setMode(currentMode);\n \t\t\t\t\tbrush.updateRenderState();\n \t\t\t\t}\n \t\t\t});\n \t\t\tc.add(bar, BorderLayout.NORTH);\n \t\t\tviewPanel = new JPanel();\n \t\t\tviewPanel.setName(\"View\");\n \t\t\tviewPanel.setLayout(new BorderLayout());\n \t\t\tviewPanel.setBorder(new TitledBorder(new LineBorder(Color.BLACK),\n \t\t\t\"View\"));\n \t\t\tc.add(viewPanel, BorderLayout.CENTER);\n \t\t\tconsolePane = new JTabbedPane();\n \t\t\tconsolePane.setPreferredSize(new Dimension(800, 100));\n \t\t\tconsolePane.setName(\"Console Pane\");\n \t\t\tJPanel consolePanel = new JPanel();\n \t\t\tconsolePanel.setLayout(new BorderLayout());\n \t\t\tconsoleOutput = new JTextArea();\n \t\t\tconsolePanel.add(consoleOutput, BorderLayout.CENTER);\n \t\t\tconsolePane.addTab(\"Console\", new JScrollPane(consolePanel));\n \t\t\tc.add(consolePane, BorderLayout.SOUTH);\n \t\t\tprojectPane = new JTabbedPane();\n \t\t\ttreeScrollPane = new JPanel();\n \t\t\ttreeScrollPane.setLayout(new BorderLayout());\n \t\t\tprojectPane.addTab(\"Scene Graph\", treeScrollPane);\n \t\t\tJPanel texturePanel = new JPanel();\n \t\t\ttextures = new PopUpList(new DefaultListModel());\n \t\t\ttextures.addListSelectionListener(new ListSelectionListener(){\n \n \t\t\t\t@Override\n \t\t\t\tpublic void valueChanged(ListSelectionEvent e) {\n \t\t\t\t\tselectedLayer = (TextureLayer)textures.getSelectedValue();\n \t\t\t\t}});\n \n \t\t\ttexturePanel.add(new JScrollPane(textures));\n \t\t\t// add menu items to texture popup menu\n \t\t\tJMenuItem deleteTexture = new JMenuItem(\"Delete\");\n \t\t\tdeleteTexture.addActionListener(new ActionListener(){\n \n \t\t\t\t@Override\n \t\t\t\tpublic void actionPerformed(ActionEvent e) {\n \t\t\t\t\tTextureManager.releaseTexture(selectedLayer.getAlpha());\n \t\t\t\t\tTextureManager.releaseTexture(selectedLayer.getColor());\n \t\t\t\t\tterrainView.detachPass(selectedLayer.getPass());\n \t\t\t\t\tterrainView.updateRenderState();\n \t\t\t\t\tDefaultListModel model = (DefaultListModel) textures.getModel();\n \t\t\t\t\tmodel.remove(textures.getSelectedIndex());\n \t\t\t\t\ttextures.repaint();\n \t\t\t\t}});\n \t\t\ttextures.addToPopup(deleteTexture);\n \t\t\tprojectPane.addTab(\"Texture Layers\",textures);\n \t\t\tprojectPane.setPreferredSize(new Dimension(200, 400));\n \t\t\tc.add(projectPane, BorderLayout.WEST);\n \t\t\tJPanel eastPanel = new JPanel();\n \t\t\teastPanel.setLayout(new GridLayout(2, 1));\n \t\t\tobjectAttr = new JPanel();\n \t\t\tobjectAttr.setName(\"Object Attributes\");\n \t\t\tobjectAttr.setBorder(new TitledBorder(new LineBorder(Color.BLACK), \"Object Attributes\"));\n \t\t\tobjectAttr.setLayout(new BorderLayout());\n \t\t\tobjectAttrTable = new AttributeEditor();\n \t\t\tobjectAttr.add(new JScrollPane(objectAttrTable),\n \t\t\t\t\tBorderLayout.CENTER);\n \t\t\teastPanel.add(objectAttr);\n \t\t\ttoolAttr = new JPanel();\n \t\t\ttoolAttr.setBorder(new TitledBorder(new LineBorder(Color.BLACK),\n \t\t\t\"Tool Attributes\"));\n \t\t\ttoolAttr.setLayout(new BorderLayout());\n \t\t\ttoolAttrTable = new AttributeEditor();\n \t\t\ttoolAttrTable.addListener(new AttributeEditorListener(){\n \t\t\t\t@Override\n \t\t\t\tpublic void attributeChanged(String key, String value) {\n \t\t\t\t\tif(key.equalsIgnoreCase(\"radius\")) {\n \t\t\t\t\t\tbrush.setRadius(Float.valueOf(value));\n \t\t\t\t\t} else if(key.equalsIgnoreCase(\"intensity\")) {\n \t\t\t\t\t\tbrush.setIntensity(Float.valueOf(value));\n \t\t\t\t\t}\n \t\t\t\t}});\n \t\t\ttoolAttr.add(new JScrollPane(toolAttrTable), BorderLayout.CENTER);\n \t\t\teastPanel.add(toolAttr);\n \t\t\teastPanel.setPreferredSize(new Dimension(200, 400));\n \t\t\tc.add(eastPanel, BorderLayout.EAST);\n \t\t\tsetDefaultCloseOperation(this.DISPOSE_ON_CLOSE);\n \t\t\timpl = new WorldEditorCanvasImpl(800, 600);\n \t\t\tset3DCanvas(impl);\n \t\t\tinitProperties();\n \t\t\t((JKMenuBar) getJMenuBar())\n \t\t\t.addListener(new WorldEditorMenuListener() {\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doAttachTo() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateDirectionalLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateLineParticle() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreatePointLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateProjectedWater() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateQuadParticle() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateQuadWater() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateSpotLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateTextureLayer() {\n \t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\tJFileChooser chooser = new JFileChooser();\n \t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\n \t\t\t\t\t\t\t\"Color Map Images\", \"jpg\",\"bmp\",\"tga\");\n \t\t\t\t\tchooser.setFileFilter(filter);\n \t\t\t\t\tint returnVal = chooser.showOpenDialog(WorldEditor.this);\n \t\t\t\t\tif (returnVal != JFileChooser.APPROVE_OPTION){\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\tFile colorMap = chooser.getSelectedFile();\n \t\t\t\t\tfilter = new FileNameExtensionFilter(\n \t\t\t\t\t\t\t\"AlphaMapImage\", \"tga\", \"png\");\n \t\t\t\t\tchooser.setFileFilter(filter);\n \t\t\t\t\treturnVal = chooser.showOpenDialog(WorldEditor.this);\n \t\t\t\t\tif (returnVal != JFileChooser.APPROVE_OPTION){\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\tFile alphaMap = chooser.getSelectedFile();\n \t\t\t\t\tDefaultListModel mdl = (DefaultListModel) textures.getModel();\n \t\t\t\t\tfloat xBound = ((BoundingBox)terrainView.getTerrainCluster().getWorldBound()).xExtent;\n \t\t\t\t\tfloat zBound = ((BoundingBox)terrainView.getTerrainCluster().getWorldBound()).zExtent;\n \t\t\t\t\tTextureLayer layer = new TextureLayer(colorMap,alphaMap, xBound, zBound);\n \t\t\t\t\tlayers.add(layer);\n \t\t\t\t\tmdl.add(mdl.size(),layer);\n \t\t\t\t\tterrainView.attachPass(layer.createPass(blend));\n \t\t\t\t\tterrainView.updateRenderState();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateWorld() {\n \t\t\t\t\tString[] names = new String[EWorld.values().length];\n \t\t\t\t\tfor (int i = 0; i < names.length; i++) {\n \t\t\t\t\t\tnames[i] = EWorld.values()[i].name();\n \t\t\t\t\t}\n \t\t\t\t\tString selected = (String) JOptionPane\n \t\t\t\t\t.showInputDialog(WorldEditor.this,\n \t\t\t\t\t\t\t\"What kind of world\",\n \t\t\t\t\t\t\t\"Create World\",\n \t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null,\n \t\t\t\t\t\t\tnames, names[0]);\n \t\t\t\t\tif (selected == null)\n \t\t\t\t\t\treturn;\n \t\t\t\t\tEWorld selectedEworld = EWorld.valueOf(selected);\n \t\t\t\t\tworld = new EditableWorld(selectedEworld);\n \t\t\t\t\ttreeModel.addChild(impl.getRootNode(), world);\n \t\t\t\t\tWorldEditor.this.repaint();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doDettachFromParent() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExit() {\n \t\t\t\t\tdispose();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExportWorld() {\n \t\t\t\t\tdlg = new ExportDialog(WorldEditor.this);\n \t\t\t\t\tif (dlg.showDialog()){\n \t\t\t\t\t\texportAction = new Callable() {\n \t\t\t\t\t\t\t@Override\n \t\t\t\t\t\t\tpublic Object call() throws Exception {\n \t\t\t\t\t\t\t\t\tif(dlg.hasFile()) {\n \t\t\t\t\t\t\t\t\t\tCloneImportExport cloner = new CloneImportExport();\n \t\t\t\t\t\t\t\t\t\tcloner.saveClone(world);\n \t\t\t\t\t\t\t\t\t\tEditableWorld cloneWorld = (EditableWorld)cloner.loadClone();\n \t\t\t\t\t\t\t\t\t\tWorld node = (World)cloneWorld.constructFinal();\n \t\t\t\t\t\t\t\t\t\tif(!dlg.exportTextures()) {\n \t\t\t\t\t\t\t\t\t\t\tthis.stripTexure(node);\n \t\t\t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\t\t\twhile(!layers.isEmpty()) {\n \t\t\t\t\t\t\t\t\t\t\t\tthis.exportAlpha(layers.pop());\n \t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\t\t\tBinaryExporter.getInstance().save(node, dlg.getFile());\n \t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n \t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\treturn null;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tprivate void stripTexure(Node node) {\n \t\t\t\t\t\t\t\tnode.clearRenderState(RenderState.RS_TEXTURE);\n \t\t\t\t\t\t\t\tfor(int i = 0; i < node.getQuantity(); i++) {\n \t\t\t\t\t\t\t\t\tSpatial child = node.getChild(i);\n \t\t\t\t\t\t\t\t\tif(child instanceof PassNode) ((PassNode)child).clearAll();\n \t\t\t\t\t\t\t\t\telse if(child instanceof Node) this.stripTexure((Node)child);\n \t\t\t\t\t\t\t\t\telse child.clearRenderState(RenderState.RS_TEXTURE);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tprivate void exportAlpha(TextureLayer layer) {\n \t\t\t\t\t\t\t\tString raw = dlg.getFile().getPath();\n \t\t\t\t\t\t\t\tString path = raw.substring(0, raw.lastIndexOf(\"\\\\\")+1) + layer.getAlphaName() + EDataType.Texture.getExtension();\n \t\t\t\t\t\t\t\tFile file = new File(path);\n \t\t\t\t\t\t\t\ttry {file.createNewFile();} catch (IOException e) {e.printStackTrace();}\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tBinaryExporter.getInstance().save(layer.getAlpha().getImage(), file);\n \t\t\t\t\t\t\t\t} catch (IOException e) {\n \t\t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t};\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExportSelected() {\n \t\t\t\t\tExportDialog dlg = new ExportDialog(WorldEditor.this);\n \t\t\t\t\tif (dlg.showDialog()){\n \t\t\t\t\t\tString exportName = dlg.getName();\n \t\t\t\t\t\tboolean exportTextures = dlg.exportTextures();\n \t\t\t\t\t}\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doHelp() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doImportModel() {\n \t\t\t\t\t// TODO\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doModelPerspective() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doMove() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doNew() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doOpen() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateX() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateY() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateZ() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doWorldPerspective() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \t\t\t});\n \n \t\t\tpack();\n \t\t\tsetSize(800, 600);\n \t\t\tsetVisible(true);\n \t\t\t// Note, this requires youi to refresh the canvas whenever a change\n \t\t\t// is\n \t\t\t// made to re-render it. If you want automatic refresh agt the cost\n \t\t\t// of\n \t\t\t// some performance, uncomment this line...\n \t\t\t// /startAutoRefresh(canvas);\n \t\t} catch (IOException ex) {\n \t\t\tLogger.getLogger(WorldEditor.class.getName()).log(Level.SEVERE,\n \t\t\t\t\tnull, ex);\n \t\t}\n \t}",
"public void display() {\n push();\n noStroke();\n\n // creates the Box around the menus\n fill(backgroundColor); // light grey\n rect(0, 0, sidebarWidth, height);\n\n // for loops that draws each scenes icon\n for (int i = 0; i < sceneAmount; i++) {\n\n //checks the for loop has reach the icon for the current scene\n if (i == scene) {\n push();\n\n // Draws a rectancle in the place where the icon is gonna be\n fill(chosenColor); // light blue color\n rect(0, (i * height / sceneAmount ), sidebarWidth, height / sceneAmount);\n pop();\n }\n \n\n // Draws the icons one after the others with a determined distance between them\n image(sidebarLogos[i], 0, (i * height / sceneAmount ), sidebarWidth, height / sceneAmount);\n\n // if chosen scene draws glow effect ontop\n if (i == scene) {\n image(glow, 0, (i * height / sceneAmount ), sidebarWidth, height / sceneAmount);\n }\n }\n\n // draws shadow image ontop of all the icons\n image(shadow, 0, 0);\n pop();\n }",
"private void createScene(Group globalRoot, Group root3D) {\n if(appView.getSelectedRunway().equals(\"\")){\n createGeneralScene(root3D);\n generateGeneralLegend(globalRoot);\n } else if(appView.getMenuPanel().isIsolateMode()){\n createIsolatedScene(globalRoot, root3D);\n generateSelectedLegend(globalRoot);\n } else {\n createSelectedScene(globalRoot, root3D);\n generateSelectedLegend(globalRoot);\n }\n }",
"public void init()\r\n {\r\n\t\t/* initialize the widget */\r\n\t\tint width = gl.getWidth();\r\n\t\tint height = gl.getHeight();\r\n\r\n\t\t// Initialize the rendering viewport size to OpenGL\r\n\t\tgl.viewport( 0, 0, width, height );\r\n\t\tgl.matrixMode( GL.PROJECTION );\t// Set up the camera mode\r\n\t\tgl.loadIdentity();\t\t\t\t\t// Reset the transformation matrix\r\n\t\tif (width <= height)\r\n\t\t\tgl.ortho (-50.0, 50.0, -50.0*(double)height/(double)width,\r\n\t\t\t\t 50.0*(double)height/(double)width, -1.0, 1.0);\r\n\t\telse\r\n\t\t\tgl.ortho (-50.0*(double)width/(double)height,\r\n\t\t\t 50.0*(double)width/(double)height, -50.0, 50.0, -1.0, 1.0);\r\n\t\tgl.matrixMode( GL.MODELVIEW );\t\t// Reset to model transforms\r\n }",
"public void build()\n\t{\n\t\t// TODO: Is the order okay?\n\n\t\t// Frame\n\t\tthis.setDefaultCloseOperation(HIDE_ON_CLOSE);\n\t\tthis.contentPane = new JPanel();\n\t\tthis.contentPane.setLayout(new BorderLayout(0, 0));\n\t\tthis.setContentPane(contentPane);\n\n\t\t// Split pane\n\t\tthis.splitPane = new JSplitPane();\n\t\tthis.splitPane.setBorder(new EmptyBorder(0, 5, 5, 5));\n\t\tthis.contentPane.add(splitPane, BorderLayout.CENTER);\n\n\t\t// tree pane (left side)\n\t\tJPanel panel = new JPanel();\n\t\tthis.splitPane.setLeftComponent(panel);\n\t\tpanel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));\n\n\t\tthis.treePane = new JScrollPane();\n\t\tpanel.add(treePane);\n\n\t\t// Context pane (right side)\n\t\tJPanel panel_1 = new JPanel();\n\t\tthis.splitPane.setRightComponent(panel_1);\n\t\tpanel_1.setLayout(new BoxLayout(panel_1, BoxLayout.X_AXIS));\n\n\t\tthis.contextPane = new JScrollPane();\n\t\tpanel_1.add(contextPane);\n\n\t\tJPanel buttonPanel = createButtonPanel();\n\t\tthis.add(buttonPanel, BorderLayout.SOUTH);\n\n\t\tthis.splitPane.setDividerLocation(DEFAULT_DIVIDER_LOCATION);\n\n\t\t// Menu bar\n\t\tthis.menuBar = new StyleEditorMenuBar(this.guiController);\n\t\tthis.setJMenuBar(menuBar);\n\n\t\t// Tool bar\n\t\tthis.styleEditorToolBar = new StyleEditorToolBar(this.guiController);\n\t\tthis.add(styleEditorToolBar, BorderLayout.NORTH);\n\n\t\t// Combo box (from tool bar)\n\t\tthis.styleComboBox = this.styleEditorToolBar.getComboBox();\n\n\t\t// Create style tree(s):\n\t\tsynchronizeStyles();\n\n\t\t// Tree object\n\t\tthis.treePane.setViewportView(getCurrentStyleTree());\n\t\tgetCurrentStyleTree().updateTree();\n\n\t\tthis.contextPane.setViewportView(getCurrentStyleTree().getRoot().getPanel());\n\t\tthis.contextPane.getVerticalScrollBar().setUnitIncrement(10);\n\t\tthis.synchronizeStyles();\n\n\t\tthis.pack();\n\n\t\tthis.built = true;\n\t}",
"private void initGL() {\n\t\ttry {\n\t\t\tDisplay.setDisplayMode(new DisplayMode(displayWidth, displayHeight));\n\t\t\tDisplay.setVSyncEnabled(true);\n\t\t\tDisplay.setTitle(\"Shooter\");\n\t\t\tDisplay.create();\n\t\t} catch (LWJGLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t\t// init OpenGL\n\t\tglEnable(GL_TEXTURE_2D);\n\t\t\n\t\tglClearColor(0.0f, 0.0f, 0.0f, 0.0f);\n\t\t\n\t\t// enable alpha blending\n\t\tglEnable(GL_BLEND);\n\t\tglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\n\t\t\n\t\tglViewport(0, 0, displayWidth, displayHeight);\n\t\t\n\t\tglMatrixMode(GL_PROJECTION);\n\t\tglLoadIdentity();\n\t\tglOrtho(0, displayWidth, displayHeight, 0, 1, -1);\n\t\tglMatrixMode(GL_MODELVIEW);\n\t}",
"public void start(Mainwindow scene) {\n //绑定controller\n view = scene;\n\n //初始化Log文件和Logger\n File logFile = new File(logPath + System.currentTimeMillis() + \".log\");\n try {\n logFile.createNewFile();\n System.out.println(\"Game record is saved in \" + logFile.getAbsolutePath());\n }\n catch (IOException ioe) {\n System.err.println(\"Cannot create log file\");\n ioe.printStackTrace();\n }\n gameLogger.initialize(GameLogger.WRITE_LOG, logFile);\n\n //初始化葫芦娃\n CalabashBrother[] huluwa = {\n new CalabashBrother(this, background, 6),\n new CalabashBrother(this, background, 3),\n new CalabashBrother(this, background, 0),\n new CalabashBrother(this, background, 2),\n new CalabashBrother(this, background, 4),\n new CalabashBrother(this, background, 1),\n new CalabashBrother(this, background, 5),\n };\n SortController.sort(huluwa);\n for (int i = 0; i < huluwa.length; ++i) {\n huluwa[i].setCampId(Camp.GOOD);\n huluwa[i].setLife(120);\n huluwa[i].setAtk(30 + i);\n String iconPath = getClass().getResource(resourcesPath + Integer.toString(huluwa[i].getNum() + 1) + \".png\").toString();\n huluwa[i].setIcon(iconPath);\n }\n\n //初始化反派战斗人员\n Monster[] evils = {\n new Monster(this, background, \"蝎子精\"),\n new Monster(this, background, \"小喽啰1\"),\n new Monster(this, background, \"小喽啰2\"),\n new Monster(this, background, \"小喽啰3\"),\n new Monster(this, background, \"小喽啰4\"),\n new Monster(this, background, \"小喽啰5\"),\n new Monster(this, background, \"小喽啰6\"),\n };\n //单独设置蝎子精\n evils[0].setCampId(Camp.BAD);\n evils[0].setLife(150);\n evils[0].setAtk(40);\n evils[0].setIcon(getClass().getResource( resourcesPath + \"scorpion.png\").toString());\n //设置小喽啰\n for (int i = 1; i < evils.length; ++i) {\n evils[i].setCampId(Camp.BAD);\n evils[i].setLife(100);\n evils[i].setAtk(20);\n evils[i].setIcon(getClass().getResource(resourcesPath + \"monster.png\").toString());\n }\n\n //初始化爷爷:技能-加血\n Leader grandpa = Leader.getInstance(this, background, \"爷爷\");\n grandpa.setCampId(Camp.GOOD);\n grandpa.setLife(100);\n grandpa.setIcon(getClass().getResource( resourcesPath +\"grandpa.png\").toString());\n grandpa.setBuff(obj -> { obj.setLife(obj.getLife() + 20); });\n grandpa.setBuffSign(new Image(getClass().getResource(resourcesPath + \"lifeup.png\").toString()));\n\n //初始化蛇精:技能-加攻击力\n Leader snaker = Leader.getInstance(this, background, \"蛇精\");\n snaker.setCampId(Camp.BAD);\n snaker.setLife(120);\n snaker.setIcon(getClass().getResource(resourcesPath + \"snaker.png\").toString());\n snaker.setBuff(obj -> { obj.setAtk(obj.getAtk() + 20); });\n snaker.setBuffSign(new Image(getClass().getResource(resourcesPath + \"atkup.png\").toString()));\n\n numOfGood = huluwa.length + 1;\n numOfBad = evils.length + 1;\n\n initializeFormation(background, snaker, evils, grandpa, huluwa);\n updateView();\n\n //启动所有线程,开始战斗\n System.out.println(\"Game start!\");\n exec = Executors.newCachedThreadPool();\n exec.execute(grandpa);\n exec.execute(snaker);\n for (int i = 0; i < huluwa.length; ++i) {\n exec.execute(huluwa[i]);\n }\n for (int i = 0; i < evils.length; ++i) {\n exec.execute(evils[i]);\n }\n exec.shutdown();\n }",
"private BranchGroup getScene(){\n BranchGroup scene = new BranchGroup();\r\n\r\n // transformgroup zawierający robota oraz podłoże\r\n world = new TransformGroup();\r\n world.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_READ);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);\r\n TransformGroup robotTg;\r\n\r\n // nasz robot pobrany z klasy Robot\r\n robotTg = robot.getGroup();\r\n robotTg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n world.addChild(robotTg);\r\n\r\n // tworzenie scian\r\n float szerokoscScian = 10f;\r\n makeWalls(szerokoscScian);\r\n\r\n // tworzenie podłoża\r\n TransformGroup ground = new TransformGroup();\r\n Shape3D gr = new MyShapes().makeGround(new Point3f(szerokoscScian, 0f, szerokoscScian),\r\n new Point3f(szerokoscScian, 0f, -szerokoscScian), new Point3f(-szerokoscScian, 0f, -szerokoscScian),\r\n new Point3f(-szerokoscScian, 0f, szerokoscScian));\r\n gr.setUserData(new String(\"ground\"));\r\n Appearance appGround = new Appearance();\r\n appGround.setTexture(createTexture(\"grafika/floor.jpg\"));\r\n gr.setAppearance(appGround);\r\n\r\n // detekcja kolizji dla ziemi\r\n CollisionDetector collisionGround = new CollisionDetector(gr, new BoundingSphere(), this, robot);\r\n ground.addChild(gr);\r\n world.addChild(collisionGround);\r\n world.addChild(ground);\r\n\r\n // światła\r\n Color3f light1Color = new Color3f(1.0f, 1.0f, 1.0f);\r\n Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);\r\n BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);\r\n\r\n DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);\r\n light1.setInfluencingBounds(bounds);\r\n scene.addChild(light1);\r\n\r\n // obiekt do podnoszenia\r\n object = new Sphere(0.15f, robot.createAppearance(new Color3f(Color.ORANGE)));\r\n object.getShape().setUserData(new String(\"object\"));\r\n objectTransform = new Transform3D();\r\n objectTransform.setTranslation(objPos);\r\n objectTg = new TransformGroup(objectTransform);\r\n objectTg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n objectTg.addChild(object);\r\n objectGroup = new BranchGroup();\r\n objectGroup.setCapability(BranchGroup.ALLOW_DETACH);\r\n objectGroup.addChild(objectTg);\r\n world.addChild(objectGroup);\r\n\r\n // klasa behavior która służy do obsługiwania klawiatury\r\n Moving moving = new Moving(robot);\r\n moving.setSchedulingBounds(bounds);\r\n world.addChild(moving);\r\n\r\n // klasa behavior która odświeża się 60 razy na sekundę i odpowiada ona np. za nagrywanie, odtworzenie nagrania\r\n // symulowanie grawitacji\r\n loop = new GameLoop(this, robot);\r\n loop.setSchedulingBounds(bounds);\r\n world.addChild(loop);\r\n\r\n // detekcja kolizji dla obiektu\r\n CollisionDetector collisionObject = new CollisionDetector(object.getShape(), new BoundingSphere(new Point3d(), 0.15), this, robot);\r\n world.addChild(collisionObject);\r\n\r\n scene.addChild(world);\r\n\r\n scene.compile();\r\n return scene;\r\n }",
"@Override\n protected Scene onCreateScene() {\n this.getWindowManager().getDefaultDisplay().getMetrics(metrics);\n this.mEngine.registerUpdateHandler(new FPSLogger());\n inventoryEntity.attachChild(new Rectangle(0,0,125,780,new VertexBufferObjectManager()));\n viennaPracticeScene.attachChild(inventoryEntity);\n\n final Entity doorEntity = new Entity(50,270,100,100);\n Rectangle r = new Rectangle(0,0,120,300,new VertexBufferObjectManager());\n r.setSkewY(-20);\n r.setColor(Color.BLACK);\n doorEntity.attachChild(r);\n viennaPracticeScene.attachChild(doorEntity);\n\n final Entity beethovenEntity = new Entity(CAMERA_WIDTH/2,CAMERA_HEIGHT/2);\n beethovenEntity.attachChild(beethovenSprite);\n viennaPracticeScene.attachChild(beethovenEntity);\n\n final Text beethovenSpeech = new Text(0, 70, this.font, \"...Alas!\\nI, the great Beethoven, have broken my strings!\", this.getVertexBufferObjectManager());\n beethovenSpeech.setWidth(850);\n beethovenSpeech.setAutoWrap(AutoWrap.NONE);\n beethovenSpeech.setHorizontalAlign(HorizontalAlign.CENTER);\n\n guitarStringSprite.setColor(Color.WHITE);\n guitarStringSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n toggleColor();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n }\n });\n viennaPracticeScene.registerTouchArea(guitarStringSprite);\n\n beethovenSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n beethovenEntity.attachChild(beethovenSpeech);\n Timer timer = new Timer();\n Long delayTime = (long) (30 * 100);\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n beethovenEntity.detachChild(beethovenSpeech);\n }\n }, delayTime);\n }\n });\n viennaPracticeScene.registerTouchArea(beethovenSprite);\n\n viennaPracticeScene.setOnSceneTouchListener(new IOnSceneTouchListener() {\n @Override\n public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {\n float xCoordinate = pSceneTouchEvent.getX();\n float yCoordinate = pSceneTouchEvent.getY();\n if (pSceneTouchEvent.isActionDown() && pSceneTouchEvent.getX() < 70) {\n Intent startIntent = new Intent(ViennaPracticeActivity.this.getApplication(), ViennaStreetActivity.class);\n startIntent.putExtra(\"game\", game);\n ViennaPracticeActivity.this.startActivity(startIntent);\n ViennaPracticeActivity.this.finish();\n ViennaPracticeActivity.this.game.switchToScene(jlstanford.bsu.edu.game.Scene.VIENNA_STREET);\n } else if (pSceneTouchEvent.isActionDown() && ((xCoordinate < 335 && xCoordinate > 263) && (yCoordinate < 284 && yCoordinate > 124))) {\n player = ViennaPracticeActivity.this.game.getPlayer();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n ViennaPracticeActivity.this.toastOnUiThread(\"Got Guitar Strings!\");\n loadInventoryItems();\n } else {\n }\n return false;\n }\n });\n\n loadInventoryItems();\n final Sprite spriteBG = new Sprite(405,240,CAMERA_WIDTH,CAMERA_HEIGHT,this.backgroundTiledTextureRegion,this.getVertexBufferObjectManager());\n SpriteBackground bg = new SpriteBackground(spriteBG);\n viennaPracticeScene.setBackground(bg);\n\n return viennaPracticeScene;\n }",
"@Override\n\tpublic void create() {\n\t\t// TODO: create completely new batches for sprites and models\n\t\tsprites = new SpriteBatch();\n\t\tmodelBatch = new ModelBatch();\n\n\t\t// TODO: create a new environment\n\t\t// set a new color attribute for ambient light in the environment\n\t\t// add a new directional light to the environment\n\n\t\tenvironment = new Environment();\n\t\tenvironment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 0.1f));\n\t\tenvironment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));\n\n\t\t// create a new logo texture from the \"data/firstorder.png\" file\n\t\tlogo = new Texture(\"data/firstorder.png\");\n\n\t\t// TODO: create a new perspective camera with a field-of-view of around 70,\n\t\t// and the width and height found in the Gdx.graphics class\n\t\t// set the position of the camera to (100, 100, 100)\n\t\t// set the camera to look at the origin point (0, 0, 0)\n\t\t// set the near and far planes of the camera to 1 and 300\n\t\t// update the camera\n\t\tint width = Gdx.graphics.getWidth();\n\t\tint height = Gdx.graphics.getHeight();\n\t\tcam = new PerspectiveCamera(70f, width, height);\n\t\tcam.position.set(100f,100f,100f);\n\t\tcam.lookAt(0f, 0f, 0f);\n\t\tcam.near = 1f;\n\t\tcam.far = 300f;\n\t\tcam.update();\n\n\t\tbackgroundMusic = Gdx.audio.newMusic(Gdx.files.internal(\"data/StarWarsMusicTheme.mp3\"));\n\t\tbackgroundMusic.setLooping(true);\n\t\tbackgroundMusic.play();\n\n\t\t// create a new model loader\n\t\tfinal ModelLoader modelLoader = new ObjLoader();\n\n\t\t// TODO: load the internal file \"data/stormtrooper.obj\" into the model variable\n\t\tmodel = modelLoader.loadModel(Gdx.files.internal(\"data/stormtrooper_unwrapped.obj\"));\n\n\t\t// TODO: create a new model instance and scale it to 20% it's original size (it's huge...)\n\t\tinstance = new ModelInstance(model); // ← our model instance is here\n\t\tinstance.transform.scale(0.2f, 0.2f, 0.2f);\n\n\t\t// TODO: set the helmet details material to a new diffuse black color attribute\n\n\t\tgetHelmetDetails().material = new Material(ColorAttribute.createDiffuse(Color.BLACK));\n\t\tgetHelmetMoreDetails().material = new Material(ColorAttribute.createDiffuse(Color.DARK_GRAY));\n\t\tgetHelmetBase().material = new Material(ColorAttribute.createDiffuse(Color.WHITE));\n\n\t\t// set the input processor to work with our custom input:\n\t\t// clicking the image in the lower right should change the colors of the helmets\n\t\t// bonus points: implement your own GestureDetector and an input processor based on it\n\t\tGdx.app.log(\"instance node size\", \"\"+String.valueOf(instance.nodes.size));\n\n\n\t\tGdx.input.setInputProcessor(new FirstOrderInputProcessor(cam, new Runnable() {\n\t\t\tprivate Texture camouflage = new Texture(\"data/camouflage.png\");\n\t\t\tprivate Texture paper = new Texture(\"data/paper.png\");\n\t\t\tprivate Texture hive = new Texture(\"data/hive.png\");\n\t\t\tprivate Texture strips = new Texture(\"data/strip.png\");\n\t\t\tprivate Texture grass = new Texture(\"data/grass.jpeg\");\n\t\t\tpublic void run() {\n\t\t\t\t// TODO: change the helmet details material to a new diffuse random color\n\n\t\t\t\tgetHelmetDetails().material = getRandomMaterial();\n\t\t\t\tgetHelmetMoreDetails().material = getRandomMaterial();\n\n\t\t\t\t// bonus points:\n\t\t\t\t// randomly change the material of the helmet base to a texture\n\t\t\t\t// from the files aloha.png and camouflage.png (or add your own!)\n\t\t\t\tgetHelmetBase().material = getRandomMaterial();\n\t\t\t\tsetRandomLight();\n\n\t\t\t}\n\n\t\t\tprivate Material getRandomMaterial() {\n\t\t\t\tint rand = (int) (MathUtils.random() * 100) % 8;\n\t\t\t\tGdx.app.log(\"Random\", \"\" + rand);\n\n\t\t\t\t//Texture aloha = new Texture(\"data/aloha.png\");\n\t\t\t\tMaterial randMaterial = null;\n\n\t\t\t\tswitch (rand) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\trandMaterial = new Material(ColorAttribute.createReflection(Color.WHITE));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\trandMaterial = new Material(TextureAttribute.createDiffuse(paper));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\trandMaterial = new Material(TextureAttribute.createDiffuse(hive));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\trandMaterial = new Material(TextureAttribute.createDiffuse(camouflage));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\trandMaterial = new Material(ColorAttribute.createDiffuse(getRandomColor()));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\trandMaterial = new Material(TextureAttribute.createDiffuse(strips));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\trandMaterial = new Material(TextureAttribute.createDiffuse(grass));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn randMaterial;\n\t\t\t}\n\t\t}));\n\t}",
"private void createGeneralScene(Group root3D){\n generateRunways(root3D);\n for(String runwayId: controller.getRunways()){\n genRunwayName(root3D, runwayId, runwayElevation);\n }\n generateLighting(root3D);\n pointCameraAt(new Point3D(0,0,0),root3D);\n }",
"protected Scene createView() {\n\t\treturn null;\n\t}",
"public Texture build() {\n FrameBuffer buffer = new FrameBuffer(Format.RGB565, maxWidth, maxHeight, false);\n buffer.begin();\n for (TextureRegion texture : textures) {\n \t// TODO Créer la texture dynamiquement\n }\n buffer.end();\n Texture result = buffer.getColorBufferTexture();\n buffer.dispose();\n return result;\n }",
"@Override\r\n\tpublic void createScene() {\n\t\tthis.setBackground(new Background(255, 255, 255));\r\n\t\tsLogo = new Sprite(BaseActivity.WIDTH / 2, BaseActivity.HEIGHT / 2, logoRegion.getWidth() * 1.23f, logoRegion.getHeight() * 1.23f, logoRegion, engine.getVertexBufferObjectManager());\r\n\t\tthis.attachChild(sLogo);\r\n\t\tSystem.out.println(\"stufff\");\r\n\t\t\r\n\t\tengine.registerUpdateHandler(new TimerHandler(0.2f, new ITimerCallback() \r\n\t {\r\n\t public void onTimePassed(final TimerHandler pTimerHandler) \r\n\t {\r\n\t System.out.println(\"stuff1\");\r\n\t engine.unregisterUpdateHandler(pTimerHandler);\r\n\t PlayScene play = new PlayScene(engine, activity, camera);\r\n\t play.createScene();\r\n\t engine.setScene(play);\r\n\t Resources.getInstance().music.setLooping(true);\r\n\t \t\tResources.getInstance().music.play();\r\n\t play.start();\r\n\t }\r\n\t }));\r\n\t}",
"public void run() {\n\n\t\ttry {\n\t\t\tDisplay.setDisplayMode(new DisplayMode(windowWidth, windowHeight));\n\t\t\tDisplay.setTitle(TITLE);\n\t\t\tDisplay.create();\n\t\t} catch (LWJGLException e) {\n\t\t\tSystem.err.println(\"Error: Failed to create display\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\t/*\n\t\t * Initialize LWJGL and OpenGL\n\t\t */\n\t\t{\n\t\t\tGL11.glViewport(0, 0, windowWidth, windowHeight);\n\t\t\tGL11.glEnable(GL11.GL_DEPTH_TEST);\n\t\t\tGL11.glDepthFunc(GL11.GL_LEQUAL);\n\t\t\tGL11.glShadeModel(GL11.GL_SMOOTH);\n\t\t\tGL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);\n\t\t\tGL11.glEnable(GL11.GL_BLEND);\n\t\t\tGL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);\n\t\t\t// GL11.glEnable(GL11.GL_ALPHA_TEST);\n\t\t\tGL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);\n\t\t\tGL11.glClearColor(0.0f, 0.0f, 0.0f, 1f);\n\t\t}\n\n\t\ttry {\n\t\t\twhile (!(Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_Q))) {\n\t\t\t\t// Don't eat everything!!!\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(16);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tsetCamera();\n\n\t\t\t\t/*\n\t\t\t\t * Draw Code\n\t\t\t\t */\n\n\t\t\t\tsynchronized (model.drawableObjects) {\n\t\t\t\t\tfor (Drawable drawable : model.drawableObjects)\n\t\t\t\t\t\tdrawable.draw();\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * End draw code\n\t\t\t\t */\n\n\t\t\t\tDisplay.update();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Uncaught exception in View main loop: \" + e.getMessage()\n\t\t\t\t\t+ \"\\nCleaning up and exiting.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t/*\n\t\t * Clean up\n\t\t */\n\n\t\tmodel.endGame();\n\t\tcontroller.endGame();\n\t\tDisplay.destroy();\n\t}",
"protected void loadScene(\r\n ) {\r\n // Remove the old scene as needed\r\n \tif ( mLastScene != null ) {\r\n \t\tif ( mPhysicsState != null ) {\r\n \t\t\tmPhysicsState.getPhysicsSpace().removeAll( mLastScene );\r\n \t\t}\r\n \t\trootNode.detachChild( mLastScene );\r\n \t\tmLastScene = null;\r\n \t\t\r\n \t\tif ( !mPostText.isEmpty() ) mPostText.pop();\r\n \t}\r\n \tString sceneName = mSceneList.get( mSceneIndex );\r\n \tif ( sceneName != null ) synchronized( this ) {\r\n \t\tif ( mLoadingScene == null ) {\r\n \t\t\tmLoadingScene = sceneName;\r\n \t\t\tCSGTestDriver.postText( this, mTextDisplay, \"** LOADING ==> \" + mLoadingScene, false );\r\n \t\t\tthis.notifyAll();\r\n \t\t}\r\n \t} else {\r\n \t\tCSGTestDriver.postText( this, mTextDisplay, mNullSceneMsg, true );\r\n \t}\r\n }",
"public EDMGraphScene() {\n setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);\n\n addChild(backgroundLayer);\n addChild(mainLayer);\n addChild(connectionLayer);\n addChild(upperLayer);\n\n router = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);\n\n getActions().addAction(ActionFactory.createZoomAction());\n getActions().addAction(ActionFactory.createPanAction());\n getActions().addAction(ActionFactory.createSelectAction(new SceneSelectProvider()));\n\n graphLayout.addGraphLayoutListener(new GridGraphListener());\n sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);\n }",
"public void prepare(){\n\t\tGL11.glEnable(GL11.GL_DEPTH_TEST);\n\t\tGL11.glClear( GL11.GL_COLOR_BUFFER_BIT|GL11.GL_DEPTH_BUFFER_BIT );\n\t\tGL11.glClearColor(1, 0, 0, 1);\n\t\t\n\t}",
"void loadFXMLElements () {\n Parent menuRoot = menuScene.getRoot();\n Parent mainRoot = mainScene.getRoot();\n\n// all ScrollPanes\n mainPane = (ScrollPane) mainScene.getRoot().lookup(\"#main_scrollPane\");\n menuPane = (ScrollPane) menuScene.getRoot().lookup(\"#menu_scrollPane\");\n persistentPane = (ScrollPane) mainScene.getRoot().lookup(\"#main_persistentScrollPane\");\n\n// top bar controls\n mainBarClose = (Button) mainRoot.lookup(\"#main_barClose\");\n mainBarMaximise = (Button) mainRoot.lookup(\"#main_barMaximise\");\n mainBarMinimise = (Button) mainRoot.lookup(\"#main_barMinimise\");\n\n menuBarClose = (Button) menuRoot.lookup(\"#menu_barClose\");\n menuBarMaximise = (Button) menuRoot.lookup(\"#menu_barMaximise\");\n menuBarMinimise = (Button) menuRoot.lookup(\"#menu_barMinimise\");\n\n// all Nodes in Menu\n messageLabel = (Label) menuRoot.lookup(\"#menu_messageLabel\");\n exitButton = (Button) menuRoot.lookup(\"#menu_goToMain\");\n addTimelineButton = (Button) menuRoot.lookup(\"#menu_addTimeline\");\n addEventButton = (Button) menuRoot.lookup(\"#menu_addEvent\");\n saveButton = (Button) menuRoot.lookup(\"#menu_save\");\n deleteButton = (Button) menuRoot.lookup(\"#menu_delete\");\n\n cancelTimelineButton = (Button) menuRoot.lookup(\"#menu_exitAddTimeline\");\n cancelEventButton = (Button) menuRoot.lookup(\"#menu_exitAddEvent\");\n confirmDeleteButton = (Button) menuRoot.lookup(\"#menu_confirmDelete\");\n cancelDeleteButton = (Button) menuRoot.lookup(\"#menu_cancelDelete\");\n\n// new Timeline Nodes\n timeline_nameField = (TextField) addTimelineScene.lookup(\"#timeline_nameField\");\n timeline_addButton = (Button) addTimelineScene.lookup(\"#timeline_createButton\");\n timeline_editButton = (Button) addTimelineScene.lookup(\"#timeline_editButton\");\n timeline_addLabel = (Label) addTimelineScene.lookup(\"#timeline_addLabel\");\n timeline_editLabel = (Label) addTimelineScene.lookup(\"#timeline_editLabel\");\n\n// new Event Nodes\n timelineChoice = (ChoiceBox) addEventScene.lookup(\"#event_timelineChoice\");\n event_nameField = (TextField) addEventScene.lookup(\"#event_nameField\");\n event_startDayField = (TextField) addEventScene.lookup(\"#event_startDayField\");\n event_startMonthField = (TextField) addEventScene.lookup(\"#event_startMonthField\");\n event_startYearField = (TextField) addEventScene.lookup(\"#event_startYearField\");\n event_endDayField = (TextField) addEventScene.lookup(\"#event_endDayField\");\n event_endMonthField = (TextField) addEventScene.lookup(\"#event_endMonthField\");\n event_endYearField = (TextField) addEventScene.lookup(\"#event_endYearField\");\n event_notesField = (TextField) addEventScene.lookup(\"#event_notesField\");\n event_addButton = (Button) addEventScene.lookup(\"#event_createButton\");\n event_editButton = (Button) addEventScene.lookup(\"#event_editButton\");\n event_addLabel = (Label) addEventScene.lookup(\"#event_addLabel\");\n event_editLabel = (Label) addEventScene.lookup(\"#event_editLabel\");\n }",
"public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }",
"private void init() {\n\t\tdisplay = new Display(title, width, height);\n\t\tdisplay.getFrame().addKeyListener(keyManager); //lets us access keyboard\n\t\tdisplay.getFrame().addMouseListener(mouseManager);\n\t\tdisplay.getFrame().addMouseMotionListener(mouseManager);\n\t\tdisplay.getCanvas().addMouseListener(mouseManager);\n\t\tdisplay.getCanvas().addMouseMotionListener(mouseManager);\n\t\tAssets.init();\n\t\t\n\t\tgameCamera = new GameCamera(this, 0,0);\n\t\thandler = new Handler(this);\n\t\t\n\t\tgameState = new GameState(handler);\n\t\tmenuState = new MenuState(handler);\n\t\tsettingState = new SettingState(handler);\n\t\tmapState = new mapState(handler);\n\t\tmansionState = new mansionState(handler);\n\t\tparkState = new parkState(handler);\n\t\tjazzState = new jazzState(handler);\n\t\tmansionGardenState = new mansionGardenState(handler);\n\t\tmansionArcadeState = new mansionArcadeState(handler);\n\t\tmansionStudyState = new mansionStudyState(handler);\n\t\tjazzPRoomState = new jazzPRoomState(handler);\n\t\tState.setState(menuState);\n\t}",
"@Override\r\n public Sprite build() {\r\n return new Sprite(imageView, totalNbrFrames, columns, offsetX, offsetY, widthFrame, heightFrame);\r\n }",
"public void create() {\n\t\trandomUtil = new RandomUtil();\n\t\t// create the camera using the passed in viewport values\n\t\tcamera = new OrthographicCamera(viewPortWidth, viewPortHeight);\n\t\tbatch.setProjectionMatrix(camera.combined);\n\t\tdebugRender = new Box2DDebugRenderer(true, false, false, false, false, true);\n\t\ttestWorld = new TestWorld(assetManager.blockManager(), new Vector2(0, 0f));\n\t\ttestWorld.genWorld(debugUtil);\n\t\ttestWorld.setCamera(getCamera());\n\t\tplayer.createBody(testWorld.getWorld(), BodyType.DynamicBody);\n\t\ttestWorld.getPlayers().add(player);\n\t\tworldParser = new WorldParser(testWorld, \"Test World\");\n\t\tworldParser = new WorldParser(testWorld, \"Test Write\");\n\t\tworldParser.parseWorld();\n\t\twriter = new WorldWriter(\"Test Write\", testWorld);\n\t}",
"public Scene(long seedVal, boolean niceVal, double clockSpeedVal, \n String dumpPrefixVal)\n {\n seed = seedVal;\n nice = niceVal;\n clockSpeed = clockSpeedVal;\n dumpPrefix = dumpPrefixVal;\n\n // Allocate parameters\n params = new Vector<DoubleParameter>();\n options = new Vector<BooleanParameter>();\n\n tH = addParameter(new DoubleParameter(\"Left/Right\", 0, -10, 10, 1));\n tV = addParameter(new DoubleParameter(\"Down/Up\", -2, -10, 10, 1));\n tZ = addParameter(new DoubleParameter(\"Out/In\", 0, -30, 20, 1));\n\n rAlt = addParameter(new DoubleParameter(\"Altitude\", 15, -15, 80, 1));\n rAzim = addParameter(new DoubleParameter(\"Azimuth\", 0, -180, 180, 1));\n\n drawAnimation = addOption(new BooleanParameter(\"Animation\", \n false, 2));\n drawTime = addOption(new BooleanParameter(\"Show time\",\n dumpPrefix == null, \n 1));\n drawBugView = addOption(new BooleanParameter(\"Bug camera view\", \n false, 1));\n \n //goal = new Point3d(rgen.nextDouble() * 5, rgen.nextDouble() * 5, 0);\n\n build();\n }",
"public static void setScene() {\n\n Shape ground = new Plane(vec3(0.0, -1.0, 0.0), vec3(0, 1, -0.2), new Diffuse(new Vec3(1,1,1), white));\n \n /* Shape globe1 = new Sphere(vec3(0.0, 2, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe2 = new Sphere(vec3(2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe3 = new Sphere(vec3(-2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n*/\n Shape globe1T = new Sphere(vec3(0.0, 2, -2.0), 0.3, new Diffuse(new Vec3(1,1,1), white));\n // Shape globe2T = new Sphere(vec3(-0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1),yellow));\n // Shape globe3T = new Sphere(vec3(0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1), yellow));\n\n \n \n Shape globe4 = new Sphere(vec3(0.0, 2, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe5 = new Sphere(vec3(2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe6 = new Sphere(vec3(-2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n \n Shape globe7 = new Sphere(vec3(0.0, 2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe8 = new Sphere(vec3(2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe9 = new Sphere(vec3(-2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe7D = new Sphere(vec3(0.0, -2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n\n Shape globeC = new Sphere(vec3(0.0, 0.0, -6.0), 1.0, new Diffuse(new Vec3(1,1,1), red));\n \n ArrayList<Shape> shapes = new ArrayList<>();\n shapes.add(bg);\n shapes.add(ground);\n shapes.add(globe1T);\n // shapes.add(globe2T);\n // shapes.add(globe3T);\n //shapes.add(globe4);\n //shapes.add(globe5);\n shapes.add(globe7);\n shapes.add(globe8);\n shapes.add(globe9);\n shapes.add(globe7D);\n shapes.add(globeC);\n gr = new Group(shapes);\n /////////////////////////////--------------------------------------\n \n \n }",
"@Override\n\tpublic void create () {\n\t\tgempiresAssetHandler = new GempiresAssetHandler(this);\n\t\tbatch = new SpriteBatch();\n\t\tcastle = new CastleScreen(this);\n\t\tsetScreen(new MainMenuScreen(this));\n\t}",
"private void loadScene() throws IOException {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"CurriculumDisplaySE.fxml\"));\n loader.setController(this);\n Parent root = loader.load();\n scene = new Scene(root);\n }",
"public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}",
"private void createUI() {\n\t\tthis.rootPane = new TetrisRootPane(true);\n\t\tthis.controller = new TetrisController(this, rootPane, getWorkingDirectory());\n\t\tthis.listener = new TetrisActionListener(controller, this, rootPane);\n\t\t\n\t\trootPane.setActionListener(listener);\n\t\trootPane.setGameComponents(controller.getGameComponent(), controller.getPreviewComponent());\n\t\trootPane.initialize();\n\t\t\n\t\tPanelBorder border = controller.getPlayer().getPanel().getPanelBorder(\"Tetris v\" + controller.getVersion());\n\t\tborder.setRoundedCorners(true);\n\t\tJPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));\n\t\tpanel.setBackground(getBackgroundColor(border.getLineColor()));\n\t\tpanel.setBorder(border);\n\t\tpanel.setPreferredSize(new Dimension(564, 551));\n\t\tpanel.add(rootPane);\n\t\trootPane.addPanelBorder(border, panel);\n\t\t\n\t\tthis.setContentPane(panel);\n\t\tthis.setSize(564, 550);\n\t\t\n\t\tcontroller.initializeUI();\n\t}",
"public void create() {\n\t\t// TODO Auto-generated method stub\n\t\tskin = new Skin(Gdx.files.internal(\"uiskin.json\"));\n\t\tstage = new Stage();\n\t\tfinal TextButton playButton = new TextButton(\"Play\", skin, \"default\"); // Creates button with label \"play\"\n\t\tfinal TextButton leaderboardButton = new TextButton(\"Leaderboards\", skin, \"default\"); // Creates button with\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// label \"leaderboards\"\n\t\tfinal TextButton optionsButton = new TextButton(\"Options\", skin, \"default\"); // Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"options\"\n\t\tfinal TextButton userInfoButton = new TextButton(\"User Info\", skin, \"default\");// Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"User Info\"\n\t\tfinal TextButton quitGameButton = new TextButton(\"Exit Game\", skin, \"default\");\n\n\t\t// Three lines below this set the widths of buttons using the constant widths\n\t\tplayButton.setWidth(Gdx.graphics.getWidth() / 3);\n\t\tleaderboardButton.setWidth(playButton.getWidth());\n\t\toptionsButton.setWidth(playButton.getWidth());\n\t\tuserInfoButton.setWidth(playButton.getWidth());\n\t\tquitGameButton.setWidth(playButton.getWidth());\n\n\t\t// Set the heights using constant height\n\t\tplayButton.setHeight(Gdx.graphics.getHeight() / 15);\n\t\tleaderboardButton.setHeight(playButton.getHeight());\n\t\toptionsButton.setHeight(playButton.getHeight());\n\t\tuserInfoButton.setHeight(playButton.getHeight());\n\t\tquitGameButton.setHeight(playButton.getHeight());\n\n\t\t// Sets positions for buttons\n\t\tplayButton.setPosition(Gdx.graphics.getWidth() / 20, Gdx.graphics.getHeight() / 3);\n\t\tleaderboardButton.setPosition(playButton.getX(), playButton.getY() - leaderboardButton.getHeight());\n\t\toptionsButton.setPosition(playButton.getX(), leaderboardButton.getY() - optionsButton.getHeight());\n\t\tuserInfoButton.setPosition(playButton.getX(), optionsButton.getY() - userInfoButton.getHeight());\n\t\tquitGameButton.setPosition(playButton.getX(), userInfoButton.getY() - quitGameButton.getHeight());\n\n\t\t// User Info Name and sign in/ sign out button at the top of the screen\n\t\tfinal Label userInfoLabel = new Label(\"HI GUYS: \" + Constants.user, skin, \"default\");\n\t\tfinal TextButton userSignButton = new TextButton(\"singin/out\", skin, \"default\");\n\t\tuserSignButton.setHeight(Gdx.graphics.getHeight() / 40);\n\t\tuserSignButton.setPosition(Gdx.graphics.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userSignButton.getHeight());\n\t\tif (Constants.userID == 0)\n\t\t\tuserSignButton.setText(\"Sign In\");\n\t\telse\n\t\t\tuserSignButton.setText(\"Sign Out\");\n\t\tuserSignButton.addListener(new ClickListener() { // When Sign in/Sing out is pressed in the top right\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tif (Constants.userID == 0) { // If no one is signed in\n\t\t\t\t\tdispose();\n\t\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\t\t\t\t} else { // If a user is currently signed in\n\t\t\t\t\tConstants.userID = 0;\n\t\t\t\t\tConstants.user = \"Temporary User\";\n\t\t\t\t\tcreate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuserInfoLabel.setHeight(userSignButton.getHeight());\n\t\tuserInfoLabel.setPosition(Gdx.graphics.getWidth() - userInfoLabel.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userInfoLabel.getHeight());\n\t\tstage.addActor(userInfoLabel);\n\t\tstage.addActor(userSignButton);\n\n\t\tplayButton.addListener(new ClickListener() { // This tells button what to do when clicked\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LobbyScreen(game)); // Switch over to lobby screen\n\t\t\t}\n\t\t});\n\n\t\tleaderboardButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LeaderboardScreen(game)); // Switch over to leaderboard screen\n\t\t\t}\n\t\t});\n\n\t\toptionsButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\t// Do some stuff when clicked\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new OptionsScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tuserInfoButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tquitGameButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t});\n\n\t\t// Adds all buttons to stage to be rendered\n\t\tstage.addActor(playButton);\n\t\tstage.addActor(leaderboardButton);\n\t\tstage.addActor(optionsButton);\n\t\tstage.addActor(userInfoButton);\n\t\tstage.addActor(quitGameButton);\n\n\t\tGdx.input.setInputProcessor(stage);\n\t}"
] | [
"0.82793736",
"0.7344033",
"0.696501",
"0.68827933",
"0.6676073",
"0.6591689",
"0.65192",
"0.6477455",
"0.643434",
"0.64305824",
"0.6419188",
"0.64176816",
"0.6417495",
"0.64156705",
"0.6408762",
"0.6400707",
"0.6338915",
"0.6276471",
"0.62379295",
"0.62127614",
"0.6171154",
"0.61600757",
"0.6127347",
"0.6118753",
"0.6112566",
"0.6111231",
"0.6102129",
"0.60980666",
"0.6095645",
"0.6087783",
"0.6086429",
"0.6074032",
"0.6063956",
"0.6057287",
"0.6032458",
"0.60228765",
"0.60186744",
"0.6009444",
"0.5980176",
"0.5958742",
"0.59586084",
"0.5954246",
"0.59456426",
"0.5944899",
"0.59349394",
"0.5932646",
"0.59234047",
"0.59095854",
"0.5906094",
"0.5874535",
"0.58697367",
"0.5869514",
"0.5860338",
"0.58591086",
"0.5848795",
"0.58392453",
"0.5837014",
"0.5822784",
"0.58193576",
"0.5814473",
"0.5768067",
"0.5764657",
"0.5760686",
"0.57580835",
"0.57391155",
"0.57387364",
"0.5736648",
"0.5727197",
"0.5714093",
"0.56984293",
"0.56914437",
"0.56856674",
"0.5683266",
"0.5670844",
"0.5666995",
"0.5658272",
"0.5657634",
"0.5655063",
"0.56480736",
"0.56478363",
"0.563831",
"0.56277573",
"0.56176275",
"0.5615981",
"0.5613724",
"0.5608974",
"0.5604829",
"0.55940807",
"0.5589215",
"0.55834574",
"0.5582515",
"0.5579549",
"0.5575962",
"0.555888",
"0.55584246",
"0.55487925",
"0.55428463",
"0.55407715",
"0.5539598",
"0.55376405"
] | 0.651114 | 7 |
Perform computation for critter movement so they are updated to the current time | public void process()
{
// Get current time
double t = readClock() * clockSpeed;
double dTime = t - computeClock;
double dtMax = 1/50.0f;
// Set current time on display
computeClock = t;
// Only process if time has elapsed
if (dTime <= 0)
return;
// ---------------
// Compute accelerations, then integrate (using Critter methods)
// This part advances the simulation forward by dTime seconds, but
// using steps that are no larger than dtMax (this means it takes
// more than one step when dTime > dtMax -- the number of steps
// you need is stored in numSteps).
// *** placeholder value
int numSteps = (int) Math.floor(dTime / dtMax);
// compute a new 'goal' point for the mainbug to attract toward - every 7 seconds
if ((computeClock) - (goalPickClock) > 7)
{
// pick a new random goal point
goal = new Point3d(rgen.nextDouble()*16-8, rgen.nextDouble()*16-8, 0);
goalPickClock = computeClock;
target = (int)rgen.nextDouble()*(critters.size()-2);
while (critters.get(target) == predator || critters.get(target) == mainBug)
target = (int)(rgen.nextDouble()*(critters.size()-1));
}
// Here is the rough structure of what you'll need
//
// numSteps = how many steps to take for stable integration
// do numSteps times
// - reset acceleration
// - compute acceleration (adding up accelerations from attractions,
// repulsions, drag, ...)
// - integrate (by dTime/numSteps)
// end
//
// ...
for (int i = 0; i < numSteps; i++)
{
for (int k = 0; k < critters.size(); k++)
{
Critter tmp = critters.get(k);
tmp.accelReset();
tmp.accelDrag(0.6); // dampening
if (tmp == mainBug)// big bug follows randomized 'goal' point (food? water? shelter? )
{
tmp.accelAttract(goal, 0.1, 1);
tmp.accelAttract(predator.getLocation(), -rgen.nextDouble()*0.3, -2);
tmp.accelAttract(origin, 0.25, 1); // attraction toward center of scene
}
else if (tmp == predator )
{
tmp.accelAttract(critters.get(target).getLocation(), rgen.nextDouble()*0.4, 2);
}
else
{
// baby bugs follow big bug and are repelled from other baby bugs and predator!
tmp.accelAttract(mainBug.getLocation(), rgen.nextDouble()*0.3, 1);
tmp.accelAttract(predator.getLocation(), -rgen.nextDouble()*0.45, -3);
for (int m = 0; m < critters.size(); m++)
{
if (critters.get(m) != mainBug && critters.get(m) != tmp)
tmp.accelAttract(critters.get(m).getLocation(), -rgen.nextDouble()*0.5, -1);
}
}
// repulsion away from obstacles
for (int j = 0; j < obstacles.size(); j++)
{
tmp.accelAttract(obstacles.get(j).getLocation(), -0.5, -2);
}
tmp.integrate(dTime/numSteps);
}
}
// Keyframe motion for each critter
for (int i = 0; i < critters.size(); i++)
{
critters.get(i).keyframe(critters.get(i).dist);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void worldTimeStep() {\r\n \t\r\n \t//remake the hash map based on the x and y coordinates of the critters\r\n \tremakeMap(population);\r\n \t\r\n \t//Iterate through the grid positions in the population HashMap\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n \twhile (populationIter.hasNext()) { \r\n String pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \tthisCritter.hasMoved = false;\r\n \tthisCritter.doTimeStep();\r\n \tif(thisCritter.hasMoved || thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n }\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved);\r\n \t\r\n \tdoEncounters();\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved); //Stage 1 Complete\r\n \r\n \t//deduct resting energy cost from all critters in the hash map\r\n \t//could do a FOR EACH loop instead of iterator -- fixed\r\n \tpopulationIter = population.keySet().iterator();\r\n \twhile(populationIter.hasNext()) {\r\n \t\tString pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the Critters attached to the keys in the Hash Map\r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//deduct the rest energy cost from each critter\r\n \tthisCritter.energy = thisCritter.energy - Params.REST_ENERGY_COST;\r\n \t//remove all critters that have died after reducing the rest energy cost\r\n \tif(thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n \t}\r\n \t\r\n \tmergePopulationMoved(babies);\r\n \t\r\n \t\r\n \t//add the clovers in each refresh of the world \r\n \ttry {\r\n \t\tfor(int j = 0; j < Params.REFRESH_CLOVER_COUNT; j++) {\r\n \t\t\tcreateCritter(\"Clover\");\r\n \t\t}\r\n \t} catch(InvalidCritterException p) {\r\n \t\tp.printStackTrace();\r\n \t}\r\n }",
"public final void processMovement() {\r\n\t\tif (isMoving()) {\r\n\t\t\tlong elapsed = System.currentTimeMillis() - moveStart;\r\n\t\t\tmovementPercent = (((float) elapsed) / ((float) movementTime));\r\n\t\t\tif (movementPercent < 1f) {\r\n\t\t\t\txOff = -getWrappedEntity().getDir().getXOff()\r\n\t\t\t\t\t\t* Math.round((1f - movementPercent)\r\n\t\t\t\t\t\t\t\t* TileConstants.TILE_WIDTH);\r\n\t\t\t\tzOff = -getWrappedEntity().getDir().getZOff()\r\n\t\t\t\t\t\t* Math.round((1f - movementPercent)\r\n\t\t\t\t\t\t\t\t* TileConstants.TILE_HEIGHT);\r\n\t\t\t} else {\r\n\t\t\t\tmovementPercent = 0f;\r\n\t\t\t\tmoveStart = -1;\r\n\t\t\t\txOff = 0;\r\n\t\t\t\tzOff = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected final void run(int direction) {\r\n \t\r\n \t//deduct this from the critter's energy\r\n \tenergy = energy - Params.RUN_ENERGY_COST;\r\n \t\r\n \tif(hasMoved == false) {\r\n \t\tif((isFight == false || (isFight == true && unoccupiedPosition(direction, 2) == true)) && energy > 0) {\r\n \t\t\t\r\n \t\t\t//get the critter's new position\r\n \t\t\tint[] critterCoord = getCritterPos(direction, 2);\r\n \t\t\tx_coord = critterCoord[0];\r\n \t\t\ty_coord = critterCoord[1];\r\n \t\t\t\r\n \t\t\thasMoved = true;\r\n \t\t\tisFight = false;\r\n \t\t\r\n \t\t\tString critterPos = Integer.toString(x_coord) + \"_\" + Integer.toString(y_coord);\r\n \t\t\t\r\n \t\t\tArrayList<Critter> critterList = populationMoved.get(critterPos);\r\n \t\t\t\r\n \t\t\t//if there are already critters in this grid position\r\n \t\t\tif(!(critterList == null)) {\r\n \t\t\t\tcritterList.add(this);\r\n \t\t\t\tpopulationMoved.replace(critterPos, critterList);\r\n \t\t\t\t\r\n \t\t\t//if critter moves into an empty space\r\n \t\t\t} else {\r\n \t\t\t\tArrayList<Critter> newList = new ArrayList<Critter>();\r\n \t\t\t\tnewList.add(this);\r\n \t\t\t\tpopulationMoved.put(critterPos, newList);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t}\r\n \t}\r\n }",
"protected final void walk(int direction) {\r\n \t//deduct this from the critter's energy\r\n \tenergy = energy - Params.WALK_ENERGY_COST;\r\n \t\r\n \tif(hasMoved == false) {\r\n \t\tif((isFight == false || (isFight == true && unoccupiedPosition(direction, 1) == true)) && energy > 1) {\r\n \t\t\t//get new critter position\r\n \t\t\tint[] critterCoord = getCritterPos(direction, 1);\r\n \t\t\tx_coord = critterCoord[0];\r\n \t\t\ty_coord = critterCoord[1];\r\n \t\t\t\r\n \t\t\thasMoved = true;\r\n \t\t\tisFight = false;\r\n \t\t\r\n \t\t\tString critterPos = Integer.toString(x_coord) + \"_\" + Integer.toString(y_coord);\r\n \t\t\t\r\n \t\t\tArrayList<Critter> critterList = populationMoved.get(critterPos);\r\n \t\t\t\r\n \t\t\t//if there are critters already in this grid position\r\n \t\t\tif(!(critterList == null)) {\r\n \t\t\t\tcritterList.add(this);\r\n \t\t\t\tpopulationMoved.replace(critterPos, critterList);\r\n \t\t\t\t\r\n \t\t\t//if the critter moves into an empty space\t\r\n \t\t\t} else {\r\n \t\t\t\tArrayList<Critter> newList = new ArrayList<Critter>();\r\n \t\t\t\tnewList.add(this);\r\n \t\t\t\tpopulationMoved.put(critterPos, newList);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t}\r\n \t}\r\n }",
"public static void worldTimeStep() {\n\t\t\n\t//Do time step for all critters\n\t\tfor (Critter c: population) {\n\t\t\tc.doTimeStep();\t\t\t\n\t\t}\n\t\n\t\t\n\t//Resolve encounters\n\t\tIterator<Critter> it1 = population.iterator();\n\t\tfightMode = true;\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tCritter c = it1.next();\n\t\t\tIterator<Critter> it2 = population.iterator();\n\t\t\twhile(it2.hasNext()&&(c.energy > 0)) \n\t\t\t{\t\n\t\t\t\tCritter a =it2.next();\n\t\t\t\tif((c != a)&&(a.x_coord==c.x_coord)&&(a.y_coord==c.y_coord))\n\t\t\t\t{\n\t\t\t\t\tboolean cFighting = c.fight(a.toString());\n\t\t\t\t\tboolean aFighting = a.fight(c.toString());\n\t\t\t\t//If they are both still in the same location and alive, then fight\n\t\t\t\t\tif ((a.x_coord == c.x_coord) && (a.y_coord == c.y_coord) && (a.energy > 0) && (c.energy > 0)) {\t\t\n\t\t\t\t\t\tint cFight=0;\n\t\t\t\t\t\tint aFight=0;\n\t\t\t\t\t\tif(cFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcFight = getRandomInt(100);\n\t\t\t\t\t\t\tcFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taFight =getRandomInt(100);\n\t\t\t\t\t\t\taFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cFight>aFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tc.energy+=(a.energy/2);\n\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(aFight>cFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t//it1.remove()\n\t\t\t\t\t\t\tc.energy=0;\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(aFight>50)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t\t//it1.remove();\n\t\t\t\t\t\t\t\tc.energy=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tc.energy+=(a.energy);\n\t\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfightMode = false;\n\t\t\n\t//Update rest energy and reset hasMoved\n\t\tfor (Critter c2: population) {\n\t\t\tc2.hasMoved = false;\n\t\t\tc2.energy -= Params.rest_energy_cost;\n\t\t}\n\t\t\n\t//Spawn offspring and add to population\n\t\tpopulation.addAll(babies);\n\t\tbabies.clear();\n\t\t\n\t\tIterator<Critter> it3 = population.iterator();\n\t\twhile(it3.hasNext())\n\t\t{\n\t\t\tif(it3.next().energy<=0)\n\t\t\t\tit3.remove();\n\t\t}\n\t//Create new algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i++) {\n\t\t\ttry {\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t} catch (InvalidCritterException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void update(long timeElapsed, UpdateListener ful)\n\t{\n\t\tbyte x = (byte) (int) Math.floor(getX());\n\t\tbyte y = (byte) (int) Math.floor(getY());\n\t\t\n\t\tCell currentlyOn = ful.getCell(x, y);\n\t\t\n\t\tbyte dX = 0;\n\t\tbyte dY = 0;\n\t\t\n\t\tswitch(getState())\n\t\t{\n\t\t\tcase PlayerState.RUNNING_N:\n\t\t\tcase PlayerState.RUNNING_N2:\n\t\t\t\tdY = -1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_E:\n\t\t\tcase PlayerState.RUNNING_E2:\n\t\t\t\tdX = +1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_S:\n\t\t\tcase PlayerState.RUNNING_S2:\n\t\t\t\tdY = +1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_W:\n\t\t\tcase PlayerState.RUNNING_W2:\n\t\t\t\tdX = -1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.IDLE:\n\t\t\tcase PlayerState.IDLE2:\n\n\t\t\t\tbreak;\n\t\t\tcase PlayerState.PLACING_BOMB:\n\n\t\t\t\tcurrentlyOn.handleWalkOn(this, ful);\n\t\t\t\tdidChange = true;\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\t\t\n\t\tif((getState() | 0x1) != 11)\n\t\t{\n\t\t\tfinal float isle_width = 0.1f;\n\t\t\tfinal float proximity = 0.5f - isle_width;\n\n\t\t\tCell nextCellA = ful.getCell((byte) Math.floor(getX() + dX * proximity + dY * isle_width), (byte) Math.floor(getY() + dY * proximity + dX * isle_width));\n\t\t\tCell nextCellB = ful.getCell((byte) Math.floor(getX() + dX * proximity - dY * isle_width), (byte) Math.floor(getY() + dY * proximity - dX * isle_width));\n\n\t\t\tif(nextCellA.canWalkOn() && nextCellB.canWalkOn())\n\t\t\t{\n\t\t\t\tfloat movedist = getSpeed() * timeElapsed / 1000.0F;\n\t\t\t\t\n\t\t\t\tif(movedist > 0.5F)\n\t\t\t\t{\n\t\t\t\t\tmovedist = 0.5F;\n\t\t\t\t}\n\t\t\t\tif(dX == 0)\n\t\t\t\t{\n\t\t\t\t\tsetY(getY() + dY * movedist);\n\t\t\t\t\t\n\t\t\t\t\tdidChange = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsetX(getX() + dX * movedist);\n\t\t\t\t\t\n\t\t\t\t\tdidChange = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tanimationTimer += timeElapsed;\n\t\tif(animationTimer > GameConsts.ANIMATION_TIME)\n\t\t{\n\t\t\tsetState((byte) (getState() ^ 1)); // Hampeln\n\t\t\tanimationTimer = 0;\n\t\t\tdidChange = true;\n\t\t}\n\t\t\n\t\tcurrentlyOn.handleWalkOn(this, ful); // die in fire, pick up Specials\n\t}",
"public void prisonerUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tcreature.setAttacking(false);\r\n\t\troamArea();\r\n\t\tif (!checkCollision(x, y)) {\r\n\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}",
"public void update(float deltaTime) {\n if (creationPoint.y != (int)(GameView.instance.groundLevel - height*3/4) || creationPoint.x != x+width/2){\n creationPoint.x = x+width/2-width/4;\n creationPoint.y = (int)(GameView.instance.groundLevel - height/2)+height/8;\n }\n\n\n if(isStanding) {\n\n /*System.out.println(creationPoint.x);\n System.out.println(GameView.instance.player.position.x);\n System.out.println(GameView.instance.player.position.x-creationPoint.x);\n System.out.println(GameView.instance.cameraSize*attackRange);*/\n\n tax();\n\n\n //=======================================================================================//\n\n //Buildings\n\n //=======================================================================================//\n\n\n grow();\n\n\n // = ======== == ==\n // = = == == ==\n // ===== == ====\n // = = == == ===\n\n if (inRange() && !surrender) {\n countdown+=GameView.instance.fixedDeltaTime;\n //System.out.println(countdown);\n float shootSpeed=4-lv;\n if (countdown > 1000*shootSpeed) {\n\n if (countdown > 1200*shootSpeed && attack == 0) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1400*shootSpeed && attack == 1) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1600*shootSpeed && attack == 2) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown >= 1800*shootSpeed) {\n countdown = 0;\n attack = 0;\n }\n }\n }\n if ((Scene.instance.timeOfDay) / (Scene.instance.dayLength) > 0.6) {\n spawnedNPC = false;\n }\n if(!spawnedNPC) {\n //spawning thief\n if ((townFear > 20 && lv != 0 && (currentGold < maxGold / 2)) || (goldRate < 200 && lv != 0) && Scene.instance.day > 2) {\n GameView.instance.npc_pool.spawnThiefs(x, (int) GameView.instance.groundLevel, 1, this);\n }\n if(!surrender) {\n //spawning dragonslayer\n if (townFear > 30 && lv != 0) {\n GameView.instance.npc_pool.spawnDragonLayers(x, (int) GameView.instance.groundLevel, this);\n }\n\n //spawning wizard\n if (townFear > 35 && lv == 2 && !summonedWizard) {\n GameView.instance.npc_pool.spawnFarmers(x, (int) GameView.instance.groundLevel, this);\n summonedWizard = true;\n }\n }\n spawnedNPC = true;\n }\n\n if(!surrender) {\n if (townFear > surrenderFear) {\n surrender = true;\n flag.setSurrender(surrender);\n SoundEffects.instance.play(SoundEffects.TRIBUTE);\n }\n }\n else {\n if(townFear < surrenderFear/2) {\n surrender = false;\n flag.setSurrender(surrender);\n\n }\n }\n\n\n\n Flagposition(deltaTime);\n }\n else {\n buildingImage = SpriteManager.instance.getBuildingSprite(\"FortressRuin\");\n\n if(beenEmptied == false){\n GoldPool.instance.spawnGold(collider.centerX(), collider.centerY(),Math.min(currentGold,100*(lv+1)) );\n beenEmptied = true;\n }\n townFear = 0;\n }\n\n //==== ===== ===== = == ==== ============================\n //= = == = = = = == = = ============================\n //==== == ===== ===== == ==== ============================\n //= == ===== = = = == = == ============================\n repair(deltaTime);\n\n for(int i = 0; i < currentBuildingsLeft.size(); i++){\n currentBuildingsLeft.get(i).update(deltaTime);\n }\n\n for(int i = 0; i < currentBuildingsRight.size(); i++){\n currentBuildingsRight.get(i).update(deltaTime);\n }\n super.update(deltaTime);\n\n }",
"public void updateClock(){\n clock += 1;\n if(clock >= 10000){\n clock = 0;\n }\n if (clock % (180 - playerShipManaRate) == 0){\n updateMana(\"player\", 1);\n }\n if (clock % (180 - enemyShipManaRate) == 0){\n updateMana(\"enemy\", 1);\n }\n }",
"@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }",
"@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}",
"@Override\n public void update(long now) {\n if (moveRequested) {\n if (canMove(direction)) {\n doMove(direction);\n }\n }\n moveRequested = false;\n\n if(isDamageTaken()){\n invicibleTimer.StartTimer(now);\n setDamageTaken(false);\n }\n\n this.invicibleTimer.update(now);\n setCanTakeDamage(invicibleTimer.isFinished() || !invicibleTimer.isRunnig());\n\n }",
"@Override\n public void detectAndSendChanges() {\n super.detectAndSendChanges();\n\n final int newStoredFuel = this.tileAdvancedFurnace.getStoredFuel();\n final int newSmeltTime = this.tileAdvancedFurnace.getRemainingSmeltTime();\n if ((lastStoredFuel != newStoredFuel) || (lastSmeltTime != newSmeltTime)) {\n this.lastStoredFuel = newStoredFuel;\n this.lastSmeltTime = newSmeltTime;\n for (int i = 0; i < this.crafters.size(); ++i) {\n final ICrafting icrafting = (ICrafting) this.crafters.get(i);\n icrafting.sendProgressBarUpdate(this, UPDATEID_STORED_OPERATIONS, newStoredFuel);\n icrafting.sendProgressBarUpdate(this, UPDATEID_SMELTTIME_REMAINING, newSmeltTime);\n }\n }\n }",
"public static void worldTimeStep() {\n\t\t//System.out.println(\"Time Step: \" + count);\n\t\tcount = count + 1;\n\t for (Critter A : Critter.population){\n\t if(A.energy<=0){\n\t\t\t\tA.isAlive = false;\n }\n else if(A.energy>0){\n\t A.isAlive=true;\n A.doTimeStep();\n if(A.energy<0){\n\t\t\t\t\tA.isAlive = false;\n\t\t\t\t}\n }\n\n }\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n encounters2();\n\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n\t\tmapCheck();\n\t\t// we have add reproduction\n\n\t\t// we have to add algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i = i + 1){\n\t\t\t//Algae child = new Algae();\n\t\t\t//child.setEnergy(Params.start_energy);\n\t\t\t//makecritter takes care of anything\n\t\t\ttry{\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t}\n\t\t\tcatch(InvalidCritterException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t//deduct rest energy\n\t\tfor (Critter A : Critter.population){\n\t\t\tA.energy = A.getEnergy() - Params.rest_energy_cost;\n\t\t\tif(A.getEnergy()<=0){\n\t\t\t\tA.isAlive=false;\n\t\t\t}\n\t\t}\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t\t//babies add\n\t\tfor(Critter b: babies){\n\t\t\tb.isAlive=true;\n\t\t\tpopulation.add(b);\n\t\t}\n\t\t//not sure if this removes everything\n\t\tbabies.clear();\n\t}",
"public void guardUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tif (creature.getCreature().equals(CreatureType.PGuard) || creature.getCreature().equals(CreatureType.SGuard)){ //Patrol Guards and Stationary Guards\r\n\t\t\tif (index > checkpoints.size()-1){\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\tgoToLocation (checkpoints.get(index));\r\n\t\t} else if(creature.getCreature().equals(CreatureType.RGuard)){ //Roaming Guards\r\n\t\t\troamArea();\r\n\t\t} if (!checkCollision(x, y)) {\r\n\t\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}",
"public void ApplyMovement() {\n long currTime = SystemClock.uptimeMillis();\n if(currTime - lastUpdateTime < 16){\n return;\n }\n lastUpdateTime = currTime;\n\n\n double tl_power_raw = movement_y-movement_turn+movement_x*1.5;\n double bl_power_raw = movement_y-movement_turn- movement_x*1.5;\n double br_power_raw = -movement_y-movement_turn-movement_x*1.5;\n double tr_power_raw = -movement_y-movement_turn+movement_x*1.5;\n\n\n\n\n //find the maximum of the powers\n double maxRawPower = Math.abs(tl_power_raw);\n if(Math.abs(bl_power_raw) > maxRawPower){ maxRawPower = Math.abs(bl_power_raw);}\n if(Math.abs(br_power_raw) > maxRawPower){ maxRawPower = Math.abs(br_power_raw);}\n if(Math.abs(tr_power_raw) > maxRawPower){ maxRawPower = Math.abs(tr_power_raw);}\n\n //if the maximum is greater than 1, scale all the powers down to preserve the shape\n double scaleDownAmount = 1.0;\n if(maxRawPower > 1.0){\n //when max power is multiplied by this ratio, it will be 1.0, and others less\n scaleDownAmount = 1.0/maxRawPower;\n }\n tl_power_raw *= scaleDownAmount;\n bl_power_raw *= scaleDownAmount;\n br_power_raw *= scaleDownAmount;\n tr_power_raw *= scaleDownAmount;\n\n\n //now we can set the powers ONLY IF THEY HAVE CHANGED TO AVOID SPAMMING USB COMMUNICATIONS\n topLeft.setPower(tl_power_raw);\n bottomLeft.setPower(bl_power_raw);\n bottomRight.setPower(br_power_raw);\n topRight.setPower(tr_power_raw);\n }",
"public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }",
"public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }",
"public void update()\n\t{\n\t\tgameTime++;\n\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < gameObj[i].size(); j++)\n\t\t\t{\n\t\t\t\t/*If the object implements movable\n\t\t\t\t * call the move method in each object\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof Imovable)\n\t\t\t\t\t((MovableObject)gameObj[i].get(j)).move();\n\t\t\t\t/*call CheckBlink() method in SpaceStation\n\t\t\t\t * if the time % blinkRate == 0\n\t\t\t\t * the visibility with be switched\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof SpaceStation)\n\t\t\t\t\t((SpaceStation)gameObj[i].get(j)).checkBlink(gameTime);\n\t\t\t\t/*check if missiles are out of fuel\n\t\t\t\tand remove if fuel = 0\n\t\t\t\t*/\n\t\t\t\tif(gameObj[i].get(j) instanceof Missile)\n\t\t\t\t\tif(((Missile)gameObj[i].get(j)).getFuel() <= 0)\n\t\t\t\t\t\tgameObj[i].remove(j);\n\t\t\t}\n\t\t}\t\t\n\t\tSystem.out.println(\"World updated\");\n\t}",
"public void move()\n\t{\n time++;\n\t\tif (time % 10 == 0)\n\t\t{\n\t\t\thistogramFrame.clearData();\n\t\t}\n\t\tfor (int i = 0; i < nwalkers; i++)\n\t\t{\n\t\t\tdouble r = random.nextDouble();\n\t\t\tif (r <= pRight)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] + 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] - 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft + pDown)\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] + 1;\n\t\t\t}\n\t\t\tif (time % 10 == 0)\n\t\t\t{\n\t\t\t\thistogramFrame.append(Math.sqrt(xpositions[i] * xpositions[i]\n\t\t\t\t\t\t+ ypositions[i] * ypositions[i]));\n\t\t\t}\n\t\t\txmax = Math.max(xpositions[i], xmax);\n\t\t\tymax = Math.max(ypositions[i], ymax);\n\t\t\txmin = Math.min(xpositions[i], xmin);\n\t\t\tymin = Math.min(ypositions[i], ymin);\n\t\t}\n\t}",
"public void timeToCheckWorker() {\n notifyCanMove(this.getCurrentTurn().getCurrentPlayer());\n }",
"public void detectAndSendChanges() {\n super.detectAndSendChanges();\n\n for (int var1 = 0; var1 < this.crafters.size(); ++var1) {\n ICrafting var2 = (ICrafting) this.crafters.get(var1);\n\n if (this.brewTime != this.tileBrewingStand.getField(0)) {\n var2.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getField(0));\n }\n }\n\n this.brewTime = this.tileBrewingStand.getField(0);\n }",
"public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}",
"public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}",
"@Override\n public void specialUpdate(double time) {\n if(relativeAngle > maxAngle) {\n angleDirection = -1;\n }\n if(relativeAngle < minAngle) {\n angleDirection = 1;\n }\n relativeAngle += angleDirection * BODY_MEMBER_MOVING_SPEED * time * (person.getCurrentSpeed() / 2.0);\n }",
"public void performance() {\n\t\tPositionVo s = currentPerformed.getFirst();\n\t\t@SuppressWarnings(\"unused\")\n\t\tPositionVo e = currentPerformed.getLast();\n//\t\tint timeCost = (int) (e.getTime() - s.getTime());\n//\t\tint span = (int) Math.abs(e.getHead().getX() - s.getHead().getX());\n\t\t// TODO according to the moving rate decide how many nodes fill the gap\n\n\t\tint size = currentPerformed.size();\n\n\t\tfor (int i = 1; i < size * 4 - 4; i += 4) {\n\t\t\tPositionVo s1 = currentPerformed.get(i - 1);\n\t\t\tPositionVo s2 = currentPerformed.get(i);\n\n\t\t\tPoint[] delta_Head = sim_dda(s1.getHead(), s2.getHead(), 4);\n\t\t\tPoint[] delta_left_hand = sim_dda(s1.getLeftHand(), s2.getRightHand(), 4);\n\t\t\tPoint[] delta_right_hand = sim_dda(s1.getRightHand(), s2.getRightHand(), 4);\n\n\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\tcurrentPerformed.add(i + j, new PositionVo(delta_Head[j], delta_left_hand[j], delta_right_hand[j]));\n\t\t}\n\n\t\tnCount = currentPerformed.size();\n\t\tcursor = 0;\n\n\t\t/* (*)absolute point = initial point - current point */\n\t\treferX -= s.getHead().getX();\n\t\treferY += s.getHead().getY();\n\t\tcurrReferX = referX;\n\t\tcurrReferY = referY;\n\n\t\t/* update gui */\n\t\tmanager.proceBar.setMinimum(0);\n\t\tmanager.proceBar.setMaximum(nCount);\n\t\t/* end */\n\n\t\tstartTimer((int) (ANIMATE_FPS * speedRate));\n\t}",
"public void Update() {\r\n\t\t//if player is near and haven't fired in a while, fire a projectile\r\n\t\tif(!playerNear().equals(\"n\") && j > 250){\r\n\t\t\tfireProjectile(playerNear());\r\n\t\t\tj = 0;\r\n\t\t}\r\n\t\tj++;\r\n\r\n\t\t//COLLISION\r\n\t\tfor(int i = 0; i < AdventureManager.currentRoom.projectiles.size(); i++){ //Checks for collision with player projectiles\r\n\t\t\tif(((AdventureManager.currentRoom.projectiles.get(i).x + 50 > x) && (AdventureManager.currentRoom.projectiles.get(i).x + 50 < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\t\t\t\t\t|| ((AdventureManager.currentRoom.projectiles.get(i).x > x) && (AdventureManager.currentRoom.projectiles.get(i).x < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\r\n\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\tswitch(AdventureManager.currentRoom.projectiles.get(i).type) {\r\n\t\t\t\t\tcase \"fireball\": health -= AdventureManager.toon.intelligence; break;\r\n\t\t\t\t\tcase \"sword\": health -= AdventureManager.toon.strength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tAdventureManager.currentRoom.projectiles.get(i).kill();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif((AdventureManager.toon.y < y+50) && (AdventureManager.toon.y > y+40) && //Checks for collision with player\r\n\t\t\t\t(((AdventureManager.toon.x > x) && (AdventureManager.toon.x < x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 > x) && AdventureManager.toon.x+50 < x+50))) {\r\n\t\t\tAdventureManager.toon.y = y+55; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if((AdventureManager.toon.y+100 < y) && (AdventureManager.toon.y+100 > y-5) && (((AdventureManager.toon.x >= x) && (AdventureManager.toon.x <= x+50)) //Checks for collision with player\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 >= x) && (AdventureManager.toon.x+50 <= x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+25 >= x) && AdventureManager.toon.x+25 <= x+50))) {\r\n\t\t AdventureManager.toon.y = y-105; AdventureManager.toon.repaint();\r\n\t\t AdventureManager.toon.jumpCount = 25;\r\n\t\t if(contact <= 0){\r\n\t\t\t AdventureManager.toon.damage(1);\r\n\t\t\t contact = 50;\r\n\t\t }\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x + 50) > x) && ((AdventureManager.toon.x+50)<x+20) && ( //Left Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+45))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x-51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x) > x+40) && ((AdventureManager.toon.x)<x+50) && ( //Right Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+50))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x+51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcontact--;\r\n\t\tif(health<=0){\r\n\t\t\tsetVisible(false);\r\n\t\t\talive = false;\r\n\t\t\tAdventureManager.currentRoom.enemies.remove(this);\r\n\t\t}\r\n\r\n\r\n\r\n\t\t\tif((y+100)>=AdventureManager.floorHeight) {\r\n\t\t\t\ty= AdventureManager.floorHeight -100;\r\n\t\t\t\tgravity *= 0;\r\n\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgravity = 3;}\r\n\r\n\t\t\ty += gravity; setLocation(x,y);\r\n\r\n\t\t\tswitch(movetype) {\r\n\t\t\tcase 0: chasePlayer(); break;\r\n\t\t\tcase 1: randomMove(); break;\r\n\t\t\tcase 2: dontMove(); break;\r\n\t\t\t}\r\n\r\n\t\t\t}",
"public abstract double sensingTime();",
"@Override\n\tprotected void execute() {\n\t\tif(Math.abs(Robot.oi.stick.getY()-this.lastValue) < RobotMap.lambda){\n\t\t\tif(System.currentTimeMillis()-this.lastTime > 1000){\n\t\t\t\tRobot.arm.set(0);\n\t\t\t} else {\n\t\t\t\tRobot.arm.set(Robot.oi.stick.getY());\n\t\t\t}\n\t\t} else {\n\t\t\tthis.lastTime = System.currentTimeMillis();\n\t\t\tthis.lastValue = Robot.oi.stick.getY();\t\n\t\t\tRobot.arm.set(Robot.oi.stick.getY());\n\t\t}\n\t}",
"public void onUpdate()\n {\n super.onUpdate();\n this.jumpMovementFactor = 0.0F;\n this.renderYawOffset = this.rotationPitch = this.rotationYaw = 0.0F;\n\n if (this.target != null && this.target instanceof EntityLiving)\n {\n EntityLiving var1 = (EntityLiving) this.target;\n\n if (var1.getHealth() <= 0 || !this.canEntityBeSeen(var1))\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n return;\n }\n } else\n {\n if (this.target != null && this.target.isDead)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n return;\n }\n\n if (this.target == null)\n {\n this.target = this.worldObj.getClosestPlayerToEntity(this, -1.0D);\n\n if (this.target == null)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n\n return;\n }\n }\n }\n\n if (this.posX == (double) this.getOrgX() && this.posY == (double) this.getOrgY() && this.posZ == (double) this.getOrgZ())\n {\n if (!this.isReformed())\n {\n this.setReformed(true);\n }\n\n this.stop();\n this.moveTimer = 0;\n }\n\n if (this.slider == null)\n {\n Vec3 var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);\n Vec3 var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n MovingObjectPosition var18 = this.worldObj.rayTraceBlocks(var16, var2);\n var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);\n var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\n if (var18 != null)\n {\n var2 = Vec3.createVectorHelper(var18.hitVec.xCoord, var18.hitVec.yCoord, var18.hitVec.zCoord);\n }\n\n if (!this.worldObj.isRemote)\n {\n Object var4 = null;\n List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(4.0D, 4.0D, 4.0D));\n double var6 = 0.0D;\n\n for (int var8 = 0; var8 < var15.size(); ++var8)\n {\n Entity var9 = (Entity) var15.get(var8);\n\n if (var9.canBeCollidedWith() && var9 != this)\n {\n float var10 = 0.3F;\n\n if (var9 instanceof EntitySlider)\n {\n this.slider = (EntitySlider) var9;\n var18 = null;\n }\n\n AxisAlignedBB var11 = var9.boundingBox.expand((double) var10, (double) var10, (double) var10);\n MovingObjectPosition var12 = var11.calculateIntercept(var16, var2);\n\n if (var12 != null)\n {\n double var13 = var16.distanceTo(var12.hitVec);\n\n if (var13 < var6 || var6 == 0.0D)\n {\n var6 = var13;\n }\n }\n }\n }\n }\n\n if (this.slider == null || this.slider.isDead)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n }\n } else if (this.slider.target != this.target)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n } else\n {\n this.fallDistance = 0.0F;\n double var17;\n double var5;\n double var3;\n\n if (this.gotMovement)\n {\n if (this.isCollided)\n {\n var17 = this.posX - 0.5D;\n var3 = this.boundingBox.minY + 0.75D;\n var5 = this.posZ - 0.5D;\n\n if (this.crushed)\n {\n this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, \"random.explode\", 3.0F, (0.625F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);\n this.worldObj.playSoundAtEntity(this, \"aeboss.slider.collide\", 2.5F, 1.0F / (this.rand.nextFloat() * 0.2F + 0.9F));\n }\n\n this.stop();\n } else\n {\n if (this.speedy < 2.0F)\n {\n this.speedy += 0.035F;\n }\n\n this.motionX = 0.0D;\n this.motionY = 0.0D;\n this.motionZ = 0.0D;\n\n if (this.direction == 0)\n {\n this.motionY = (double) this.speedy;\n\n if (this.boundingBox.minY > (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY + 0.35D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 1)\n {\n this.motionY = (double) (-this.speedy);\n\n if (this.boundingBox.minY < (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY - 0.25D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 2)\n {\n this.motionX = (double) this.speedy;\n\n if (this.posX > (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX + 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 3)\n {\n this.motionX = (double) (-this.speedy);\n\n if (this.posX < (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX - 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 4)\n {\n this.motionZ = (double) this.speedy;\n\n if (this.posZ > (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ + 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 5)\n {\n this.motionZ = (double) (-this.speedy);\n\n if (this.posZ < (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ - 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n }\n }\n } else\n {\n this.motionY = 0.0D;\n\n if (this.moveTimer > 0)\n {\n --this.moveTimer;\n this.motionX = 0.0D;\n this.motionY = 0.0D;\n this.motionZ = 0.0D;\n } else\n {\n var17 = Math.abs(this.posX - (this.reform ? (double) this.getOrgX() : this.target.posX));\n var3 = Math.abs(this.boundingBox.minY - (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY));\n var5 = Math.abs(this.posZ - (this.reform ? (double) this.getOrgZ() : this.target.posZ));\n\n if (var17 > var5)\n {\n this.direction = 2;\n\n if (this.posX > (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX))\n {\n this.direction = 3;\n }\n } else\n {\n this.direction = 4;\n\n if (this.posZ > (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ))\n {\n this.direction = 5;\n }\n }\n\n if (var3 > var17 && var3 > var5 || var3 > 0.25D && this.rand.nextInt(5) == 0)\n {\n this.direction = 0;\n\n if (this.posY > (this.reform ? (double) this.getOrgY() : this.target.posY))\n {\n this.direction = 1;\n }\n }\n\n this.gotMovement = true;\n }\n }\n\n if (this.harvey > 0.01F)\n {\n this.harvey *= 0.8F;\n }\n }\n }",
"public void abstractUpdateAI()\n {\n player.setClock(player.getClock()+1);\n \n if (player.getClock() > 15 && player.getAlive()) { \n updateAI();\n } \n }",
"public void update() {\n\t\t\n\t\t//System.out.println(this.observer);\n\t\t\n\t\tif(this.isCollidable == false){\n\t\t\tthis.x = -500;\n\t\t\tthis.y = -500;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (this.life < this.maxLife && !this.isDead()){\n\t\t\t\n\t\t\tif(recovery >= 1){\n\t\t\t\tthis.setLife(this.life + 1);\n\t\t\t\trecovery = 0;\n\t\t\t}\n\t\t\t\n\t\t\trecovery += 0.01;\n\t\t}\n\t\t\n\t\tsuper.update();\n\t\t\n\t\t//Shield movement\n\t\tInteger horizontalCorrection = (this.width - player.width)/2;\n\t\tInteger verticalCorrection = (this.height - player.height)/2;\n\n\t\t//Adjusting position player with force shield\n\t\tthis.x = player.x - horizontalCorrection;\n\t\tthis.y = player.y - verticalCorrection;\n\t}",
"@Override\n\tpublic void update_logic()\n\t{\n\t\tArrayList<Double> angleList = new ArrayList<Double>();\n\t\tfor(GameObject item : sightList)\n\t\t{\n\t\t\tangleList.add(ALL.point_direction(x, y, item.getX(), item.getY()));\n\t\t}\n\t\t\n\t\t// only if there is something to run from\n\t\tif (angleList.size() > 0)\n\t\t{\n\t\t\trunFromOthers(angleList);\n\t\t} else {\n\t\t\tmotion_set(direction, 0);\n\t\t}\n\t\t\n\t\t// show a debug message\n\t\tdebugString = Integer.toString(resources);\n\n\t}",
"@Override \n\tpublic ShotInfo process(double dtime, ShotInfo shotInfo) {\n\t\tVector2d currentPosition = shotInfo.getPosition2D();\n\t\tVector2d currentVelocity = shotInfo.getVelocity2D();\n\t\tboolean hitWater = false;\n\n\t\tfor (double timer = 0; timer < dtime; timer += step) {\n\t\t\tif (currentVelocity.length() == 0) {\n\t\t\t\tcurrentVelocity = currentVelocity.add(new Vector2d(1e-20,1e-20));\n\t\t\t}\n\t\t\tVector2d currentAcceleration = acceleration(currentPosition,currentVelocity);\n\n\t\t\t//Calculate next position and next velocity\n\t\t\tVector2d nextPosition = currentPosition.add(currentVelocity.multiply(step));\n\t\t\tVector2d nextVelocity = currentVelocity.add(currentAcceleration.multiply(step));\n\n\t\t\t//update position and velocity\n\t\t\tcurrentPosition = checkOutOfBounds(nextPosition);\n\t\t\tcurrentVelocity = limitVelocity(nextVelocity);\n\n\t\t\t//Check for collisions and react accordingly\n\t\t\tVector3f ballPosition = new Vector3f((float) currentPosition.x, (float) course.height.evaluate(currentPosition), (float) currentPosition.y);\n\n\t\t\t//Check for water 'collision'\n\t\t\tif (!botMod) {\n\t\t\t\tVector3d collisionNormal = CheckCollision.checkForCollision(game.getTrees().getTrees(), course.goal, course.ball, ballPosition);\n\t\t\t\tif(collisionNormal!=null){\n\t\t\t\t\tSystem.out.println(\"YEE\");\n\n\t\t\t\t\tdouble A = (currentVelocity.dotProduct(collisionNormal.getVector2D()))/(currentVelocity.length()*collisionNormal.getVector2D().length());\n\t\t\t\t\tdouble angle = Math.acos(A);\n\t\t\t\t\tcurrentVelocity = currentVelocity.rotate(angle);\n\t\t\t\t}\n\n\t\t\t\thitWater = WaterHit.hitWater(ballPosition);\n\t\t\t\tif(hitWater){\n\t\t\t\t\tWaterHit.showWaterHitUI(game, ballPosition);\n\t\t\t\t\tcourse.ball.setVelocity(new Vector3d(0, 0, 0));\n\t\t\t\t\tcurrentVelocity = new Vector2d(0, 0);\n\t\t\t\t\ttimer = dtime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!hitWater) {\n\t\t\tshotInfo.setPosition3D(new Vector3d(currentPosition.x, course.height.evaluate(currentPosition), currentPosition.y));\n\t\t\tshotInfo.setVelocity3D(new Vector3d(currentVelocity.x, 0, currentVelocity.y));\n\t\t}\n\n\t\treturn new ShotInfo(shotInfo);\n\t}",
"protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }",
"public static void update() \r\n {\r\n lastTime = currentTime; \r\n currentTime = getTime(); \r\n }",
"public void update()\n {\n // always roatating time by 7 for fixed point calculation\n x = (velocity*cos(theta) *time) >> 21;\n int yFirstPart = (int)(velocity*sin(theta)*time) >> 21;\n int ySecondPart = (int)((g*time*time) >> 15);\n y = yFirstPart - ySecondPart;\n y =initialY - y;\n x= x + initialX;\n time+= updateSpeed;\n if(lastY == -1)\n {\n lastY = y;\n }else{\n int direction = lastY - y;\n if(lastDirection == -1)\n {\n lastDirection = direction;\n }else{\n if(lastDirection != 0 && direction != 0)\n {\n \n int signOfDirection = lastDirection / Math.abs(lastDirection);\n int signOfLastDirection = direction / Math.abs(direction);\n if(signOfDirection != signOfLastDirection)\n {\n if(!reachedTop)\n {\n onTop();\n reachedTop = true;\n }\n \n setIsOnHalf(true);\n }\n }\n lastY = y;\n }\n \n }\n }",
"public void updateGameTime() {\n\t\tGameTime = Timer.getMatchTime();\n\t}",
"public void activateUncontrolledMoves() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n actualPoint = new Point();\n actualPoint.x = 0;\n actualPoint.y = 0;\n final int maxX = wheel.getBounds().width(); //This represent the max X possible coord on the wheel\n final int maxY = wheel.getBounds().height();\n int timeBtwnMvmnts = 5000; //Time between each new movement\n while (true) {\n\n try {\n Thread.sleep(timeBtwnMvmnts);//Waiting for the next movement\n } catch (InterruptedException e) {\n\n }\n if (isUncontrolledActivated) { //If is activated continue\n double userCurrentSnap = USER_CURRENT_BREATH_RATE; //Snapshot to the current BR\n\n //Getting the percent of excess according to the max ideal breathing rate and the max posible rate (20)\n //Consider 6-8, MAX_IDEAL_BREATH_RATE (8) will be the max\n double referenceDistance = MAX_BREATH_RATE - MAX_IDEAL_BREATH_RATE;\n double myRateExcess = userCurrentSnap - MAX_IDEAL_BREATH_RATE;\n double relationPreferedActual = myRateExcess / referenceDistance;\n double percentOfExcess = relationPreferedActual * 100;\n\n Random r = new Random();\n\n //Probability of appearance of each special move\n if (percentOfExcess <= 40 && percentOfExcess > 10) { //A little error margin to make it easier. Nets to be 10% excess\n //Boost, stop, roll , inverted. probabilities (70,16,10,4)\n int diceRolled = r.nextInt(100); //This works as the \"probability\"\n if (diceRolled < 4) {// 4% inverted\n /*Enable inverted controlling. Determine how much time is this going to last.\n Not more than the time between each movement.*/\n final int duration = new Random().nextInt(timeBtwnMvmnts - 1000) + 1000;\n invertControls(duration);\n } else if (diceRolled >= 4 && diceRolled < 14) { // 10% roll\n uncRoll(maxX, maxY);\n } else if (diceRolled >= 14 && diceRolled < 30) { // 16% stop\n uncStop();\n } else if (diceRolled >= 30 && diceRolled < 100) { // 70% boost\n int whichBoost = new Random().nextInt(1);\n if (whichBoost == 0)\n uncBackwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n else\n uncForwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n }\n timeBtwnMvmnts = 8000;\n } else if (percentOfExcess <= 60 && percentOfExcess > 10) {\n //Boost, stop, roll , inverted. probabilities (45,30,15,10)\n int diceRolled = r.nextInt(100);\n if (diceRolled < 10) {// 10% inverted\n final int duration = new Random().nextInt(timeBtwnMvmnts - 1000) + 1000;\n invertControls(duration);\n } else if (diceRolled >= 10 && diceRolled < 25) { // 15% roll\n uncRoll(maxX, maxY);\n } else if (diceRolled >= 25 && diceRolled < 55) { // 30% stop\n uncStop();\n } else if (diceRolled >= 55 && diceRolled < 100) { // 45% boost\n int whichBoost = new Random().nextInt(1);\n if (whichBoost == 0)\n uncBackwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n else\n uncForwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n }\n timeBtwnMvmnts = 6700;\n } else if (percentOfExcess > 10) {//Percent > 60\n //Boost, stop, roll , inverted. probabilities (5,10,25,60)\n int diceRolled = r.nextInt(100);\n if (diceRolled < 60) {// 60% inverted\n final int duration = new Random().nextInt(timeBtwnMvmnts - 1000) + 1000;\n invertControls(duration);\n } else if (diceRolled >= 60 && diceRolled < 85) { // 25% roll\n uncRoll(maxX, maxY);\n } else if (diceRolled >= 85 && diceRolled < 95) { // 10% stop\n uncStop();\n } else if (diceRolled >= 95 && diceRolled < 100) { // 5% boost\n int whichBoost = new Random().nextInt(1);\n if (whichBoost == 0)\n uncBackwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n else\n uncForwardBoost(actualPoint.x, actualPoint.y, maxX, maxY);\n }\n timeBtwnMvmnts = 5000;\n }\n\n } else {\n break;\n }\n }\n }\n }).start();\n }",
"public void move(long deltaTime) {\n\n Point currentTile = getOccupyingTile(position);\n\n /*\n if (!Simulator.getInstance().getTileMap().isInsideMap(currentTile))\n return;\n\n if (Simulator.getInstance().getTileMap().isAWall(currentTile) || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n*/\n\n if (Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n\n\n if (!Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile) && Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector().equals(new Point2D.Double(0.0, 0.0))) {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n double angle = 0;\n while ((angle >= 60 && angle <= 120) || (angle >= 150 && angle <= 210) || (angle >= 240 && angle <= 300) || (angle >= 330) || (angle <= 30)) {\n\n angle = Math.random() * 360;\n }\n setVector(new Point2D.Double(Math.cos(Math.toRadians(angle)) / 1.5, Math.sin(Math.toRadians(angle)) / 1.5));\n } else {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n }\n\n\n Point2D vectorDiff = new Point2D.Double(vector.getX() - targetVector.getX(), vector.getY() - targetVector.getY());\n\n if (vectorDiff.getX() < 0)\n vector.setLocation(vector.getX() + 0.001 * velocity * deltaTime, vector.getY());\n else if (vectorDiff.getX() > 0)\n vector.setLocation(vector.getX() - 0.001 * velocity * deltaTime, vector.getY());\n\n if (vectorDiff.getY() < 0)\n vector.setLocation(vector.getX(), vector.getY() + 0.001 * velocity * deltaTime);\n else if (vectorDiff.getY() > 0)\n vector.setLocation(vector.getX(), vector.getY() - 0.001 * velocity * deltaTime);\n\n\n Point2D newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n Point targetTile = getOccupyingTile(newPosition);\n\n\n Point direction = getDirection(currentTile, targetTile);\n\n\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) {// || Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n\n if (Simulator.getInstance().isUsingBounceCollision()) {\n if (direction.x > 0 || direction.x < 0)\n vector.setLocation(vector.getX() * -0.5, vector.getY());\n if (direction.y > 0 || direction.y < 0)\n vector.setLocation(vector.getX(), vector.getY() * -0.5);\n\n newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n targetTile = getOccupyingTile(newPosition);\n\n //Secondary check to make sure the bounce doesn't make it go out of bounds\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) { //|| Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n vector.setLocation(0, 0);\n } else {\n setPosition(newPosition);\n }\n\n\n } else {\n vector.setLocation(0, 0);\n }\n\n } else {\n setPosition(newPosition);\n }\n\n }",
"@Override\n\tpublic void update() \n\t{\n\t\tPoint loc = getLocationCopy();\n\t\tEnemy c = game.findNearestEnemy(loc);\n\t\tif (c == null)\n\t\t\treturn;\n\t\t\n\t\tif(c.getLocation().distance(loc) < 100 && game.getFrameCount() % 30 == 0)\n\t\t{\n\t\t\tFlyingSalt s = new FlyingSalt(game, loc, \n\t\t\t\t\t\t\t\t\tc.getLocation().x - position.x,\n\t\t\t\t\t\t\t\t\tc.getLocation().y - position.y);\n\t\t\tgame.addAnimatable(s);\n\t\t}\n\t}",
"public void timePasses(){\n crtClock++;\n if(crtClock==25)crtClock=1; // If end of day, reset to 1\n if(crtClock<=opHours)tellMeterToConsumeUnits(unitsPerHr);\n }",
"@Override\n public void update() {\n if(alive==false){\n afterBeKilled();\n return;\n }\n animate();\n chooseState();\n checkBeKilled();\n if(attack){\n if(timeBetweenShot<0){\n chooseDirection();\n attack();\n timeBetweenShot=15;\n }\n else{\n timeBetweenShot--;\n }\n\n }\n else{\n calculateMove();\n setRectangle();\n }\n }",
"public abstract void update(float time);",
"public void updateMhos() { \r\n\r\n\t\tfor (int i = 0; i < 12; i++) {\r\n\t\t\tif (Mhos[i].isAlive) {// Mho AI\r\n\t\t\t\t\r\n\t\t\t\tif (Mhos[i].x == p.x) // directly vertical\r\n\t\t\t\t\tif (Mhos[i].y > p.y) // move up\r\n\t\t\t\t\t\tmoveMho(i, 0, -1);\r\n\t\t\t\t\telse // move down\r\n\t\t\t\t\t\tmoveMho(i, 0, 1);\r\n\r\n\t\t\t\telse if (Mhos[i].y == p.y) { // directly horizontal\r\n\t\t\t\t\tif (Mhos[i].x > p.x) {\r\n\t\t\t\t\t\tmoveMho(i, -1, 0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmoveMho(i, 1, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tint relPos = Mhos[i].relToPlayer(p.x, p.y);\r\n\t\t\t\t\tint horDist = Math.abs(Mhos[i].x - p.x);\r\n\t\t\t\t\tint verDist = Math.abs(Mhos[i].y - p.y);\r\n\r\n\t\t\t\t\tif (relPos == 1) { // top right\r\n\t\t\t\t\t\tif (!(board[Mhos[i].x - 1][Mhos[i].y + 1] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x - 1][Mhos[i].y + 1] instanceof Mho)) {\r\n\t\t\t\t\t\t\t// directly diagonal\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 1);\r\n\t\t\t\t\t\t} else if (horDist >= verDist && !(board[Mhos[i].x - 1][Mhos[i].y] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x - 1][Mhos[i].y] instanceof Mho)) // horizontal\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 0);\r\n\r\n\t\t\t\t\t\telse if (horDist <= verDist && !(board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence) // vertical\r\n\t\t\t\t\t\t\tmoveMho(i, 0, 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// tries to move on a fence now\r\n\t\t\t\t\t\telse if (board[Mhos[i].x - 1][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 1);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x - 1][Mhos[i].y] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 0);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 0, 1);\r\n\r\n\t\t\t\t\t} else if (relPos == 2) { // top left\r\n\t\t\t\t\t\tif (!(board[Mhos[i].x + 1][Mhos[i].y + 1] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x + 1][Mhos[i].y + 1] instanceof Mho)) {\r\n\t\t\t\t\t\t\t// directly diagonal\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 1);\r\n\t\t\t\t\t\t} else if (horDist >= verDist && !(board[Mhos[i].x + 1][Mhos[i].y] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x + 1][Mhos[i].y] instanceof Mho)) // horizontal\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 0);\r\n\r\n\t\t\t\t\t\telse if (horDist <= verDist && !(board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence) // vertical\r\n\t\t\t\t\t\t\tmoveMho(i, 0, 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// tries to move on a fence now\r\n\t\t\t\t\t\telse if (board[Mhos[i].x + 1][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 1);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x + 1][Mhos[i].y] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 0);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x][Mhos[i].y + 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 0, 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else if (relPos == 3) { // bottom left\r\n\t\t\t\t\t\tif (!(board[Mhos[i].x + 1][Mhos[i].y - 1] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x + 1][Mhos[i].y - 1] instanceof Mho)) {\r\n\t\t\t\t\t\t\t// directly diagonal\r\n\t\t\t\t\t\t\tmoveMho(i, 1, -1);\r\n\t\t\t\t\t\t} else if (horDist >= verDist && !(board[Mhos[i].x + 1][Mhos[i].y] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x + 1][Mhos[i].y] instanceof Mho)) // horizontal\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 0);\r\n\r\n\t\t\t\t\t\telse if (horDist <= verDist && !(board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence) // vertical\r\n\t\t\t\t\t\t\tmoveMho(i, 0, -1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// tries to move on a fence now\r\n\t\t\t\t\t\telse if (board[Mhos[i].x + 1][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 1, -1);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x + 1][Mhos[i].y] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 1, 0);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 0, -1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else if (relPos == 4) { // bottom right\r\n\t\t\t\t\t\tif (!(board[Mhos[i].x - 1][Mhos[i].y - 1] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x - 1][Mhos[i].y - 1] instanceof Mho)) {\r\n\t\t\t\t\t\t\t// directly diagonal\r\n\t\t\t\t\t\t\tmoveMho(i, -1, -1);\r\n\t\t\t\t\t\t} else if (horDist >= verDist && !(board[Mhos[i].x - 1][Mhos[i].y] instanceof Fence\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x - 1][Mhos[i].y] instanceof Mho)) // horizontal\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 0);\r\n\r\n\t\t\t\t\t\telse if (horDist <= verDist && !(board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\t\t|| board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence) // vertical\r\n\t\t\t\t\t\t\tmoveMho(i, 0, -1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// tries to move on a fence now\r\n\t\t\t\t\t\telse if (board[Mhos[i].x - 1][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, -1, -1);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x - 1][Mhos[i].y] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, -1, 0);\r\n\t\t\t\t\t\telse if (horDist >= verDist && board[Mhos[i].x][Mhos[i].y - 1] instanceof Fence)\r\n\t\t\t\t\t\t\tmoveMho(i, 0, -1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"public void update() {\n\t\tupdateController();\n\t\tupdateTimer();\n\t\tupdateTrifecta();\n\t\tupdateGyro();\n\t\tupdateGameTime();\n\t\t//updateTilt();\n\t}",
"public void updateGrade() throws SimulationStopException{\r\n /*if(realtime){\r\n double[] pos1 = gps.getPos();\r\n \r\n double []pos2 = gps.getPos();\r\n double product = (6378100)*Math.PI/18000;\r\n grade = (pos1[2]-pos2[2])/\r\n Math.sqrt(Math.pow((pos1[1]-pos2[1])*product,2) +\r\n Math.pow((pos1[0]-pos2[0])*product,2));\r\n }*/\r\n if(time.isRunning()){\r\n\r\n try {\r\n \t//calculate grade\r\n \tif(index!=0){\r\n grade = ((roadData[altIndex][index] - roadData[altIndex][index-1])/\r\n (roadData[distIndex][index] - roadData[distIndex][index-1]));\r\n \t}\r\n \r\n // calculate orientation (used for wind and turns)\r\n /* Understandable version...\r\n * product = 60/0.5399555*1000\r\n *\r\n * distLat = (tempLat - lat)*product;\r\n * distLon = (tempLon - lon)*product*Math.cos((tempLat + lat)/2*Math.PI/180);\r\n * carAngle = atan(distLon/distLat) + PI/2\r\n * */\r\n \r\n carAngle = Math.atan((roadData[lonIndex][index]-roadData[lonIndex][index+1])\r\n \t\t*Math.cos((roadData[latIndex][index]+roadData[latIndex][index+1])/2*Math.PI/180)/\r\n (roadData[latIndex][index]-roadData[latIndex][index+1])) + Math.PI/2;\r\n while(carAngle>Math.PI*2){\r\n \tcarAngle-=Math.PI*2;\r\n }\r\n\r\n index++;\r\n segsLeft--;\r\n // if we hit a control point, stop for ctrlTimeLength seconds of time\r\n if(roadData[distIndex][index]>ctrlPts[ctrlIndex]&&ctrlIndex<=ctrlPts.length){\r\n time.ctrlPointHit(ctrlTimeLength);\r\n System.out.println(\"Control Point: \" + roadData[distIndex][index]);\r\n ctrlIndex++;\r\n }\r\n }\r\n catch (IndexOutOfBoundsException e) {\r\n throw new SimulationStopException(\"Simulation stopped at control point \"+ctrlIndex);\r\n // Is this message right!?\r\n }\r\n }\r\n }",
"private void updateMovement() {\n if (_movementTask == null) {\n return;\n }\n\n if (getOwner().isDead() || _followTarget != null && _followTarget.isDead()) {\n cancelMoveTask2(true);\n return;\n }\n\n // Movement is invalid! Queue a new movement and wait again!\n if (_destinationLocation == null)\n {\n if (_waypoints.peek() != null) {\n _destinationLocation = _waypoints.poll();\n\n if (getOwner().getLocation().getGameSector() != null && getOwner().getLocation().getGameSector().hasActiveNeighbours()) {\n double validatedZ = GeoService.getInstance().validateZ(_destinationLocation.getX(), _destinationLocation.getY(), _destinationLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n if (_destinationLocation != null) {\n _destinationLocation.setZ(validatedZ);\n }\n else {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n _isSectorActive = true;\n }\n else {\n _isSectorActive = false;\n }\n notifySector(true);\n }\n else\n {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n }\n\n if (_destinationLocation != null) {\n // Update current character movement, the location.\n float deltaTime = (System.currentTimeMillis() - _movementTick) / 1000.0f;\n float movementSpeed = getOwner().getActionStorage().getMoveSpeed();\n if (getOwner().getActionStorage().getAction().getActionChartActionT().getApplySpeedBuffType().isMove()) {\n movementSpeed *= (getOwner().getGameStats().getMoveSpeedRate().getMoveSpeedRate() + 1_000_000.0f) / 1_000_000.0f;\n }\n\n Location ownerLocation = getOwner().getLocation();\n\n double movementDirectionX = _destinationLocation.getX() - ownerLocation.getX();\n double movementDirectionY = _destinationLocation.getY() - ownerLocation.getY();\n double movementDirectionZ = _destinationLocation.getZ() - ownerLocation.getZ();\n\n double directionLength = Math.sqrt(Math.pow(movementDirectionX, 2) + Math.pow(movementDirectionY, 2) + Math.pow(movementDirectionZ, 2));\n movementDirectionX /= directionLength;\n movementDirectionY /= directionLength;\n movementDirectionZ /= directionLength;\n\n ownerLocation.setXYZ(\n ownerLocation.getX() + movementDirectionX * movementSpeed * deltaTime,\n ownerLocation.getY() + movementDirectionY * movementSpeed * deltaTime,\n ownerLocation.getZ() + movementDirectionZ * movementSpeed * deltaTime\n );\n\n if (_isSectorActive && !_navigationType.isAir()) {\n double validatedZ = GeoService.getInstance().validateZ(ownerLocation.getX(), ownerLocation.getY(), ownerLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n ownerLocation.setZ(validatedZ);\n }\n\n if (ownerLocation.isValid() && World.getInstance().getWorldMap().updateLocation(getOwner(), ownerLocation.getX(), ownerLocation.getY())) {\n double distanceToPoint = MathUtils.getDistance(ownerLocation, _destinationLocation) - getOwner().getTemplate().getBodySize();\n notifyVehicleMovement();\n\n if (_followTarget != null) {\n distanceToPoint -= _followTarget.getTemplate().getBodySize();\n\n if (!MathUtils.isInRange(_destinationLocation, _followTarget.getLocation(), 150)) {\n _destinationLocation.setLocation(_followTarget.getLocation());\n notifySector(true);\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n } else {\n // Check if we are near another destination, then we will\n // switch to another waypoint instead to continue our journey.\n Location nextWaypoint = _waypoints.peek();\n if (nextWaypoint != null) {\n if (distanceToPoint < 100) {\n _destinationLocation = null;\n }\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n }\n } else {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n }\n }\n _movementTick = System.currentTimeMillis();\n }",
"private long calcSeekTime (int newCylinder)\r\n\t{\r\n\t\t//\tCompute number of cylinders to move.\r\n\t\tint moveCyl = Math.abs(newCylinder - this.cylinder);\r\n\t\t//\tCompute time to move that many cylinders.\r\n\t\tlong moveTime = (long)(2 * config.getRampTime());\r\n\t\tmoveTime += Math.round(moveCyl * config.getTrack2Track());\r\n\t\treturn moveTime;\r\n\t}",
"private void playerMoved(int currentPlayer, int currentUnit, boolean moved)\r\n {\r\n if(moved == true)//if player has made a legitimate move\r\n {\r\n worldPanel.repaint();\r\n int movesLeft = 0;\r\n if(currentPlayer == 1)\r\n {\r\n int myPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n\r\n //check to see if a player challenges another player\r\n for(int i = 0; i < worldPanel.player2.getNumUnits(); i++)\r\n {\r\n int pos = worldPanel.player2.units[i].getPosition();\r\n if(myPos == pos)\r\n {\r\n fight(1, currentUnit - 1, i);\r\n return;\r\n }\r\n }//end for\r\n\r\n //check to see if a player captures a city\r\n for(int i = 0; i < worldPanel.player2.getNumCities(); i++)\r\n {\r\n int pos = worldPanel.player2.cities[i].getLocation();\r\n if(myPos == pos)\r\n {\r\n captureCity(1,i);\r\n return;\r\n }\r\n }//end for\r\n movesLeft = worldPanel.player1.units[currentUnit - 1].getMovementsLeft();\r\n int temp = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n int temp1 = mapPieces[0][temp];\r\n if(temp1 == 54 || temp1 == 51 || temp1 == 52 || temp1 == 53)//if unit moves on rock or something\r\n worldPanel.player1.units[currentUnit - 1].setMovementsLeft(movesLeft - 2);\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player1.units[currentUnit - 1].getMovementsLeft();\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int myPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n\r\n //check to see if a player challenges another player\r\n for(int i = 0; i < worldPanel.player1.getNumUnits(); i++)\r\n {\r\n int pos = worldPanel.player1.units[i].getPosition();\r\n if(myPos == pos)\r\n {\r\n fight(2, currentUnit - 1, i);\r\n return;\r\n }\r\n }\r\n\r\n //check to see if a player captures a city\r\n for(int i = 0; i < worldPanel.player1.getNumCities(); i++)\r\n {\r\n int pos = worldPanel.player1.cities[i].getLocation();\r\n if(myPos == pos)\r\n {\r\n captureCity(2,i);\r\n return;\r\n }\r\n }//end for\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n int temp = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n int temp1 = mapPieces[0][temp];\r\n if(temp1 == 54 || temp1 == 51 || temp1 == 52 || temp1 == 53)//if unit moves on rock or something\r\n worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 2);\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n\r\n //worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n }\r\n\r\n if(movesLeft <= 0)//if unit has run out of moves\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n worldPanel.player1.units[currentUnit - 1].resetMovement();\r\n }\r\n if(currentPlayer == 2)\r\n {\r\n worldPanel.player2.units[currentUnit - 1].resetMovement();\r\n }\r\n currentUnit++;\r\n }//end if\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n\t\t\t\t\t\t{\r\n worldPanel.setCurrentPlayer(1);\r\n\t\t\t\t\t\t\t\tyear = unitPanel.getYear() + 20;//add 20 years to the game\r\n\t\t\t\t\t\t}\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n setInfoPanel();//set up the information panel\r\n }",
"public static void periodic() {\n a2 = limelightTable.getEntry(\"ty\").getDouble(0); //Sets a2, the y position of the target\n d = Math.round((h2-h1) / Math.tan(Math.toRadians(a1+a2))); //Calculates distance using a tangent\n\n if(m_gamepad.getStartButtonReleased()) { //Reset errorSum to 0 when start is released\n errorSum = 0;\n }\n\n shooting(); //Determine when we should be shooting\n reportStatistics(); //Report telemetry to the Driver Station\n }",
"void updatePercepts() {\n clearPercepts();\n \n Location r1Loc = model.getAgPos(0);\n //Location r2Loc = model.getAgPos(1);\n \n Literal pos1 = Literal.parseLiteral(\"pos(r1,\" + r1Loc.x + \",\" + r1Loc.y + \")\");\n // Literal pos2 = Literal.parseLiteral(\"pos(r2,\" + r2Loc.x + \",\" + r2Loc.y + \")\");\n\n addPercept(pos1);\n //addPercept(pos2);\n \n if (model.hasObject(Const.ObstacleCode, r1Loc)) {\n addPercept(Const.v1);\n }\n// if (model.hasObject(Const.ObstacleCode, r2Loc)) {\n// addPercept(Const.v2);\n// }\n }",
"public void testConstantSpeed() {\n double endtime = racetrack.getPerimeter() / racetrack.getVelocity();\n double epsilon = 0.000000000001;\n uniformMotion(racetrack, 0, endtime, dt, velocity, epsilon);\n }",
"private static void move() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(timer);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\trunTime += timer;\r\n\t\tif (runTime > stepUp) {\r\n\t\t\ttimer *= 0.9;\r\n\t\t\tstepUp += 5000;\r\n\t\t}\r\n\r\n\t\tupdateSnake(lastMove);\r\n\t\t// updateField();\r\n\r\n\t\tif (score >= 10 && (r.nextInt(40) == 0)) {\r\n\t\t\taddFood(MOUSE);\r\n\t\t}\r\n\t\tif (score >= 30 && (r.nextInt(50) == 0)) {\r\n\t\t\taddFood(POISON);\r\n\t\t}\r\n\t}",
"public void updateBestTime(int room_idx){\n float time = rooms[room_idx].getTimer();\n if (time<bestTime[room_idx]){bestTime[room_idx]=time;}\n curTime[room_idx] = time;\n rooms[room_idx].resetTimer();\n }",
"public static void speedup(){\n\t\tif(bossair.periodairinit > Framework.nanosecond){\n\t\t\t\tbossair.periodair-=Framework.nanosecond/18; \n\t\t\t\tbossair.xmoving-=0.03; \n\t\t}\n\t\t\t\n\t}",
"public void compute() {\n\t\t// Fire as continuously as gun heating will allow.\n\t\tif (getGunCurrentTemp() < getGunUnjamTemp() && fires)\n\t\t\tfire((float)(Math.random() * 360.0));\n\t\t// Might as well wait the gun can be reloaded\n\t\tUtility.delay(getGunReloadDurationMillis());\n\t}",
"public void update()\n {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n if(elapsed>100)\n {\n hard += 20; // increase difficulty\n score = Dynamics.getPosition();\n startTime = System.nanoTime();\n }\n dx = (int)Dynamics.getVelocityX();\n\n animation.update();\n x += dx;\n if(x < 0){\n x = 0;\n } else if (x+width > GamePanel.WIDTH){\n x = GamePanel.WIDTH-width;\n }\n\n }",
"@Override\n public void run() {\n updateMovement();\n }",
"public void update() {\n if(this.getLine(0) != \"\") this.setLine(0, \"\");\n if(this.getLine(0) != plugin.getGameManager().getAlivePlayers().size() + \" §7Joueurs\") this.setLine(1, plugin.getGameManager().getAlivePlayers().size() + \" §7Joueurs\");\n if(this.getLine(0) != Team.getTeams().size() + \" §7Equipes\") this.setLine(2, Team.getTeams().size() + \" §7Equipes\");\n if(this.getLine(0) != \" \") this.setLine(3, \" \");\n\n /* Timer part */\n if(plugin.getGameManager().hasStarted()) {\n this.setLine(4, \"§eTimer: §r\" + getFormattedTimer(plugin.getTimerManager().getMinutesLeft(), plugin.getTimerManager().getSecondsLeft()) + \" [§bE\" + getFormattedEpisode(plugin.getTimerManager().getEpisode()) + \"§r]\");\n\n String text = \"\";\n List<Integer> timers = new ArrayList<>();\n if(!plugin.getGameManager().isPvpActivated())\n timers.add(plugin.getTimerManager().getMinutesPvpLeft());\n if(!plugin.getGameManager().isRolesActivated())\n timers.add(plugin.getTimerManager().getMinutesRolesLeft());\n if(!plugin.getGameManager().isKitsActivated())\n timers.add(plugin.getTimerManager().getMinutesKitsLeft());\n if(!plugin.getBorderManager().isShrinking())\n timers.add(plugin.getTimerManager().getMinutesBorderLeft());\n\n try {\n int min = timers\n .stream()\n .filter(v -> v != -1)\n .mapToInt(v -> v)\n .min()\n .orElseThrow(NoSuchElementException::new);\n\n if(min == plugin.getTimerManager().getMinutesPvpLeft() && !plugin.getGameManager().isPvpActivated())\n text = \"Pvp\";\n else if(min == plugin.getTimerManager().getMinutesRolesLeft() && !plugin.getGameManager().isRolesActivated())\n text = \"Equipes\";\n else if(min == plugin.getTimerManager().getMinutesKitsLeft() && !plugin.getGameManager().isKitsActivated())\n text = \"Kits\";\n else if(min == plugin.getTimerManager().getMinutesBorderLeft() && !plugin.getBorderManager().isShrinking())\n text = \"Bordure\";\n\n if(!text.equals(\"\")) {\n this.setLine(5, \"§c\" + text + \": §r< \" + (min + 1) + \"min\");\n }\n } catch (NoSuchElementException e) {\n this.removeLine(5);\n }\n }\n }",
"public void updateTask() {\n/* 137 */ if (this.field_190859_a.func_190718_dR()) {\n/* */ \n/* 139 */ EntityLlama entityllama = this.field_190859_a.func_190716_dS();\n/* 140 */ double d0 = this.field_190859_a.getDistanceToEntity((Entity)entityllama);\n/* 141 */ float f = 2.0F;\n/* 142 */ Vec3d vec3d = (new Vec3d(entityllama.posX - this.field_190859_a.posX, entityllama.posY - this.field_190859_a.posY, entityllama.posZ - this.field_190859_a.posZ)).normalize().scale(Math.max(d0 - 2.0D, 0.0D));\n/* 143 */ this.field_190859_a.getNavigator().tryMoveToXYZ(this.field_190859_a.posX + vec3d.xCoord, this.field_190859_a.posY + vec3d.yCoord, this.field_190859_a.posZ + vec3d.zCoord, this.field_190860_b);\n/* */ } \n/* */ }",
"@Override\n public void processStimulus(Enumeration criteria) {\n quadParts.updateData(updater); // request an update of the geometry\n wakeupOn(timedelay);\n }",
"public void doTimeStep() {\r\n\t\twalk(getRandomInt(8));\r\n\t\tif (getEnergy() < 6 * Params.min_reproduce_energy && getEnergy() > Params.min_reproduce_energy) {\r\n\t\t\tCritter1 child = new Critter1();\r\n\t\t\treproduce(child, getRandomInt(8));\r\n\t\t\tnumberSpawned += 1;\r\n\t\t}else if(getEnergy() < Params.min_reproduce_energy) {\r\n\t\t\treturn;\r\n\t\t}else {\r\n\t\t\tCritter1 child1 = new Critter1();\r\n\t\t\treproduce(child1, getRandomInt(8));\r\n\t\t\tCritter1 child2 = new Critter1();\r\n\t\t\treproduce(child2, getRandomInt(8));\r\n\t\t\tnumberSpawned += 2;\r\n\t\t}\t\r\n\t}",
"public void update()\r\n\t{\r\n\t\tList<Unit> deadButNotFinished = new ArrayList<Unit>();\r\n\t\t//first check for dead units\r\n\t\tfor(int i = 0; i < units.size();)\r\n\t\t\tif(units.get(i).getState() == MapItemState.Dead && units.get(i).finished()) {\r\n\t\t\t\towner.notifySweepAndPruneUnitRemoved(units.remove(i));\r\n\t\t\t} else if(units.get(i).getState().equals(MapItemState.Dead)) {\r\n\t\t\t\tdeadButNotFinished.add(units.remove(i));\r\n\t\t\t} else {\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\r\n\t\t//don't do anything if there are no units\r\n\t\tif(units.size() <= 0 && deadButNotFinished.size() <= 0)\r\n\t\t{\r\n\t\t\tinCombat = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t//if(!(units.get(0) instanceof Gate))\r\n\t\t\t//System.out.println(\"Unit position == \" + units.get(0).getPosition().getX() + \", \" + units.get(0).getPosition().getY());\r\n\t\t\r\n\t\t//first get the max radius\r\n\t\tdouble maxRad = 0;\r\n\t\tPosition center = this.getCenter();\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tdouble rad = Math.sqrt(center.distanceSquared(u.getPosition())) + u.getCombatStrategy().getRange();\r\n\t\t\tif(rad > maxRad)\r\n\t\t\t\tmaxRad = rad;\r\n\t\t}\r\n\t\t\r\n\t\t//this is to prevent units from doing a run by on accident\r\n\t\tif(maxRad < owner.getWidth())\r\n\t\t\tmaxRad = owner.getWidth();\r\n\t\t\r\n\t\tAABB box = new AABB(center.getX() - maxRad, center.getY() - maxRad, \r\n\t\t\t\tcenter.getX() + maxRad, center.getY() + maxRad);\r\n\t\tList<Unit> unitsInRange = owner.getUnitsIn(box);\r\n\t\tList<Unit> alliesInRange = new ArrayList<Unit>();\r\n\t\t//remove friendly units\r\n\t\tfor(int i = 0; i < unitsInRange.size();)\r\n\t\t\tif(unitsInRange.get(i).getOwner().equals(units.get(0).getOwner()))\r\n\t\t\t\talliesInRange.add(unitsInRange.remove(i));\r\n\t\t\telse\r\n\t\t\t\ti++;\r\n\t\t\r\n\t\t//if there are units, we're in combat!\r\n\t\tif(unitsInRange.size() > 0)\r\n\t\t{\r\n\t\t\t//for efficiency reasons\r\n\t\t\tUnit[] unitsInRangeArray = unitsInRange.toArray(new Unit[unitsInRange.size()]);\r\n\t\t\tUnit[] alliesInRangeArray = alliesInRange.toArray(new Unit[alliesInRange.size()]);\r\n\t\t\tfor(Unit u : units)\r\n\t\t\t\tu.getCombatStrategy().fight(unitsInRangeArray, alliesInRangeArray);\r\n\t\t\tinCombat = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tinCombat = false;\r\n\t\t\t//figure out which direction we're going\r\n\t\t\tboolean forward = true;\r\n\t\t\tif (origin.getTransformation().getPosition().distanceSquared(\r\n\t\t\t\t\towner.getPosition(1).getPosition()) < origin.getTransformation().getPosition()\r\n\t\t\t\t\t.distanceSquared(owner.getPosition(0).getPosition()))\r\n\t\t\t\tforward = false;\r\n\t\t\t\r\n\t\t\t//we're gonna move straight forward because I said so -Connor\r\n\t\t\tdouble wayTheFuckOutThere = 100000000;\r\n\t\t\tdouble min = 1;\r\n\t\t\t\r\n\t\t\t//for efficiency reasons\r\n\t\t\tHashMap<Unit, Transformation> closestPoints = new HashMap<Unit, Transformation>();\r\n\t\t\t\r\n\t\t\t//go through each unit and see how far it's going to go\r\n\t\t\tfor(int i = 0; i < units.size();)\r\n\t\t\t{\r\n\t\t\t\tUnit u = units.get(i);\r\n\t\t\t\tdouble pos = u.getPositionAlongCurve();\r\n\t\t\t\tNode target = owner.getNodes()[0];\r\n\t\t\t\tif(target.equals(origin))\r\n\t\t\t\t\ttarget = owner.getNodes()[1];\r\n\t\t\t\t//check to see if we've made it to the node we're going for\r\n\t\t\t\t//also, don't allow entering the node if the gate is still up\r\n\t\t\t\tif(((forward && Math.abs(1 - pos) <= 0.01) || (!forward && Math.abs(pos) <= 0.01)) && \r\n\t\t\t\t\t\t(owner.getGate(target) == null || owner.getGate(target).getState().equals(MapItemState.Dead) \r\n\t\t\t\t\t\t\t\t|| u.getOwner().equals(owner.getGate(target).getOwner())))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(target.getOwner() == null || target.isContested() || !target.getOwner().equals(u.getOwner()))\r\n\t\t\t\t\t\ttarget.setInvader(u.getOwner());\r\n\t\t\t\t\tu.setTransformation(target.getTransformation());\r\n\t\t\t\t\ttarget.addUnit(u);\r\n\t\t\t\t\towner.notifySweepAndPruneUnitRemoved(units.remove(i));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t//if we're close enough but the gate isn't down\r\n\t\t\t\telse if((forward && Math.abs(1 - pos) <= 0.01) || (!forward && Math.abs(pos) <= 0.01))\r\n\t\t\t\t{\r\n\t\t\t\t\tTransformation t = owner.getPosition(pos);\r\n\t\t\t\t\tclosestPoints.put(u, t);\r\n\t\t\t\t\tu.setState(MapItemState.Idle);\r\n\t\t\t\t\tu.getMovementStrategy().setTarget(u.getTransformation());\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\r\n\t\t\t\tTransformation t = owner.getPosition(pos);\r\n//\t\t\t\tif(Math.abs(t.getRotation()) < .001){\r\n//\t\t\t\t\tSystem.out.println(\"t's rotation is 0\");\r\n//\t\t\t\t}\r\n\t\t\t\tclosestPoints.put(u, t);\r\n\t\t\t\tdouble angle = t.getRotation();\r\n\t\t\t\tif(!forward)\r\n\t\t\t\t\tangle -= Math.PI;\r\n\t\t\t\tdouble m = u.getMovementStrategy().setTarget(\r\n\t\t\t\t\t\tnew Transformation(u.getPosition().add(\r\n\t\t\t\t\t\t\t\twayTheFuckOutThere * Math.cos(angle),\r\n\t\t\t\t\t\t\t\twayTheFuckOutThere * Math.sin(angle)), angle));\r\n\t\t\t\tif(m < min)\r\n\t\t\t\t\tmin = m;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//go through each unit and set its actual target\r\n\t\t\tdouble dis = wayTheFuckOutThere*min;\r\n\t\t\tfor(int i = 0; i < units.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tdouble angle = closestPoints.get(units.get(i)).getRotation();\r\n\t\t\t\tif(!forward)\r\n\t\t\t\t\tangle -= Math.PI;\r\n//\t\t\t\tTransformation t = owner.getPosition(owner.getClosestPointRatio(closestPoints.get(i)\r\n//\t\t\t\t\t\t\t\t.getPosition().add(dis * Math.cos(angle),dis * Math.sin(angle)))); \r\n\t\t\t\tTransformation t = new Transformation(units.get(i).getPosition().add(dis*Math.cos(angle), dis*Math.sin(angle)), angle);\r\n\t\t\t\tunits.get(i).getMovementStrategy().setTarget(t);\r\n\t\t\t}\r\n\t\t\tinCombat = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tu.getMovementStrategy().move();\r\n\t\t\tu.updateMapItem();\r\n\t\t}\r\n\t\t\r\n\t\t//add the dead but not finished units back in\r\n\t\t//also call update for them so they may finish their abilities\r\n\t\tfor(Unit u : deadButNotFinished)\r\n\t\t{\r\n\t\t\tu.updateMapItem();\r\n\t\t\tunits.add(u);\r\n\t\t}\r\n\t\t\r\n\t\tfor(Unit u : unitsInNeedOfRemoval)\r\n\t\t{\r\n\t\t\tunits.remove(u);\r\n\t\t\towner.notifySweepAndPruneUnitRemoved(u);\r\n\t\t}\r\n\t\tunitsInNeedOfRemoval.clear();\r\n\t}",
"private void calculateCrit(Monster target, MonsterParts part, Weapon weapon, double motionValue) throws InvalidPartException {\n \n if (target.isWeakness(part)) {\n if (Math.random() < (Math.abs((weapon.getAffinity() + weaknessExploit)/100.0)) && (weapon.getAffinity() + weaknessExploit) < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < ((weapon.getAffinity() + weaknessExploit)/100.0) && (weapon.getAffinity() + weaknessExploit) > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() *target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n } else {\n if (Math.random() < (Math.abs(weapon.getAffinity()/100.0)) && weapon.getAffinity() < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < (weapon.getAffinity()/100.0) && weapon.getAffinity() > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n }\n\n }",
"private void movementPhase() {\n ClickObserver.getInstance().setCreatureFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n TheCupGUI.update();\n Board.removeCovers();\n }\n });\n for (Player p : playerList) {\n \tplayer = p;\n player.flipAllUp();\n\t ClickObserver.getInstance().setActivePlayer(player);\n\t ClickObserver.getInstance().setCreatureFlag(\"Movement: SelectMovers\");\n\t InfoPanel.uncover(player.getName());\n\t if (p.getHexesWithPiece().size() > 0) {\n\t \tClickObserver.getInstance().setClickedTerrain(p.getHexesWithPiece().get(0));\n\t }\n\t pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n \t GUI.getHelpText().setText(\"Movement Phase: \" + player.getName()\n + \", Move your armies\");\n \t Game.getRackGui().setOwner(player);\n }\n });\n\t \n\t while (isPaused) {\n \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t }\n\t InfoPanel.cover(player.getName());\n player.flipAllDown();\n }\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(true);\n }\n });\n ClickObserver.getInstance().setCreatureFlag(\"\");\n }",
"public void update()\n\t{\n\t\tif(currentState == moving)\n\t\t{\n\t\t\tx += xSpeed;\n\t\t\ty += ySpeed;\n\t\t\t\n\t\t\tif(x < 0 || x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\tif(y < 0 || y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\t\n\t\t\tif(x < 0)\n\t\t\t\tx = 0;\n\t\t\tif(x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\tx = world.getSIMULATION_WIDTH() - individualSize;\n\t\t\t\n\t\t\tif(y < 0)\n\t\t\t\ty = 0;\n\t\t\tif(y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\ty = world.getSIMULATION_HEIGHT() - individualSize;\n\t\t}\n\t\tfor(PlayPauseTimer timer: timerList)\n\t\t\ttimer.update();\n\t\tworld.locationUpdate(this);\n\t}",
"public void update()\n\t{\n\t\t// if the wave spawner is ON and not all waves have been spawned\n\t\tif(this.active && !waveList.isEmpty())\n\t\t{\n\t\t\t// if the cooldown between waves has elapsed\n\t\t\tif(waveTimer.isReady() && currentWave != null)\n\t\t\t{\t\t\n\t\t\t\t// the first instant that the waveTimer is finished is when\n\t\t\t\t// the total time until the next wave needs to start counting down\n\t\t\t\tif(timeUntilNextWaveTimer.isReady())\n\t\t\t\t{\n\t\t\t\t\tthis.currentWaveNumber++;\n\t\t\t\t\ttimeUntilNextWaveTimer.start(currentWave.getTotalDuration());\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if we haven't spawned all the piggies in this wave\n\t\t\t\tif(currentWave.getNumberOfWalkers() > 0)\n\t\t\t\t{\n\t\t\t\t\t// if the appropriate amount of time has passed between spawns\n\t\t\t\t\tif(spawnTimer.isReady())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.doSpawnProcess();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void update(float delta) {\n\tif (player.getState() == PlayerState.JUMPING) {\n\t walkingStateTime = 0;\n\t jumpingStateTime += delta;\n\t} else if (player.getState() == PlayerState.WALKING) {\n\t jumpingStateTime = 0;\n\t walkingStateTime += delta;\n\t} else if (player.getState() == PlayerState.IDLE) {\n\t walkingStateTime = 0;\n\t jumpingStateTime = 0;\n\t}\n\t\n }",
"public static void updatePosition() {\n\t\tfor (int i = 0; i < TitanV4.planets.length; i++) { //compute forces between all celestial corpses\n\t\t\tfor(int j=i; j<TitanV4.planets.length; j++){\n\t\t\t\tif (i != j) {\n\t\t\t\t\tdouble upper = TitanV4.G*TitanV4.planets[i].getMass() * TitanV4.planets[j].getMass();\n\t\t\t\t\tdouble lower = TitanV4.planets[i].getPosition().distanceFrom(TitanV4.planets[j].getPosition());\n\t\t\t\t\tdouble gravitation = upper/lower;\n\t\t\t\t\tVector a = new Vector();\n\t\t\t\t\ta = TitanV4.planets[i].getPosition().substract(TitanV4.planets[j].getPosition()).normalize().multiply(-1);\n\n\t\t\t\t\tTitanV4.planets[i].force.add(a.multiply(gravitation));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//compute acceleration vector for each celestial corpse but the sun\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tTitanV4.planets[i].acceleration = (TitanV4.planets[i].force.divide(TitanV4.planets[i].getMass()));\n\t\t}\n\n\t\t//calculate change in speed over deltaT\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tVector oldVelocity = new Vector(TitanV4.planets[i].velocity);\n\t\t\tTitanV4.planets[i].velocity.add((TitanV4.planets[i].acceleration.multiply(TitanV4.deltaT)));\n\n\t\t\tVector posChange = new Vector();\n\t\t\tposChange = (oldVelocity.add(velocity).divide(2)).multiply(TitanV4.deltaT);\n\t\t\tTitanV4.planets[i].pos.add(posChange);\n\t\t}\n\t}",
"@Override\n protected void execute() {\n m_currentTime = Timer.getFPGATimestamp();\n// used for more precise calculations\n m_currentError = m_desiredDistance - Robot.m_drive.Position();\n// ^^ tells how much further the Robot goes\n m_derivative = (m_currentError - m_oldError) / (m_currentTime - m_oldTime);\n// ^^ PID formula stuff. The change of error / change of time to be more precise\n m_output = m_currentError * constants.kP + constants.kD * m_derivative;\n// tells how much power the motor will change\n Robot.m_drive.SetPower(m_output);\n// changes motor power\n\n m_oldError = m_currentError;\n// how error distance updates so it won't repeat old mistake\n m_oldTime = m_currentTime;\n// same as line above\n }",
"protected final void walk(int direction) {\n\t\tint temp_x = x_coord;\n\t\tint temp_y = y_coord;\n\t//Update location\t\n\t\tif (!hasMoved) {\n\t\t\ttemp_x += x_directions[direction];\n\t\t\ttemp_x += Params.world_width;\n\t\t\ttemp_x %= Params.world_width;\n\t\t\ttemp_y += y_directions[direction];\n\t\t\ttemp_y += Params.world_height;\n\t\t\ttemp_y %= Params.world_height;\n\t\t}\t\n\t//Specific to walking during fight\n\t\tif (fightMode) {\n\t\t\tboolean critterInLocation = false;\n\t\t\tfor (Critter c: population) {\n\t\t\t\tif ((c.x_coord == temp_x) && (c.y_coord == temp_y)) {\n\t\t\t\t\tcritterInLocation = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!critterInLocation) {\n\t\t\t\tx_coord = temp_x;\n\t\t\t\ty_coord = temp_y;\n\t\t\t}\n\t\t}\n\t\telse {\t\t\t\t\t//Specific to walking in time step\n\t\t\tx_coord = temp_x;\n\t\t\ty_coord = temp_y;\n\t\t}\n\t//Update energy\n\t\tenergy -= Params.walk_energy_cost;\n\t//Update hasMoved\n\t\thasMoved = true;\n\t}",
"public abstract float getSecondsPerUpdate();",
"public void update(){\n\t\tdouble timeStep = (double) 1 / METERS_PER_X_TICKS;\n\t\t\n\t\tdouble newXVel = xVel + xAccel * timeStep;\n\t\tdouble newYVel = yVel + yAccel * timeStep;\n\t\t\n//\t\tdouble deltaX = timeStep * (xVel + newXVel) / 2;\n//\t\tdouble deltaY = timeStep * (yVel + newYVel) / 2;\n\t\t\n\t\tdouble deltaX = timeStep * xVel;\n\t\tdouble deltaY = timeStep * yVel;\n\t\t\n\t\txCoord += deltaX;\n\t\tyCoord += deltaY;\n\t\t\n\t\txVel = newXVel;\n\t\tyVel = newYVel;\n\t\t\n\t\t//record new location\n\t\tif(recordPath)\n\t\t\tmyEnviron.getEntityHistories().get(ID).add(new double[]{xCoord, yCoord, xVel, yVel});\n\t\t\n\t\tcontactBlock = null; // reset to the appropriate block during block collision process, if needed\n\t\tcontactBlockSideNum = -1;\n\t\tcontactBlockVertexNum = -1;\n\t\tlifetime++;\n\t}",
"@Override\n public void Update()\n {\n\n activity.runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n if(geoTarget == null)\n {\n txtInstructions.setVisibility(VISIBLE);\n txtFlightTime.setVisibility(GONE);\n }\n else\n {\n GeoCoord geoFrom = bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition();\n float fltDistance = geoFrom.DistanceTo(geoTarget);\n\n txtFlightTime.setText(context.getString(R.string.flight_time_target, TextUtilities.GetTimeAmount(game.GetTimeToTarget(geoFrom, geoTarget, game.GetConfig().GetMissileSpeed(missileType.GetSpeedIndex())))));\n txtInstructions.setVisibility(GONE);\n txtFlightTime.setVisibility(VISIBLE);\n txtOutOfRange.setVisibility(fltDistance > game.GetConfig().GetMissileRange(missileType.GetRangeIndex()) ? VISIBLE : GONE);\n imgTracking.setVisibility(bTrackPlayer ? VISIBLE : GONE);\n\n //Update trajectory.\n List<LatLng> points = new ArrayList<LatLng>();\n points.add(Utilities.GetLatLng(bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition()));\n\n if(bTrackPlayer)\n {\n geoTarget = game.GetPlayer(lTrackPlayerID).GetPosition();\n }\n\n points.add(Utilities.GetLatLng(geoTarget));\n\n targetTrajectory.setPoints(points);\n }\n }\n });\n }",
"public void generalUpdate() {\n\n\t\tif (player.isDead()) {\n\t\t\trespawnTimer++;\n\t\t\tif (respawnTimer > 90) {\n\t\t\t\treset();\n\t\t\t}\n\t\t}\n\t\tif (started) {\n\t\t\tplayer.generalUpdate();\n\n\t\t\tspawnCount++;\n\t\t\tif (spawnCount > 100) {\n\t\t\t\tcreateWall();\n\t\t\t\tspawnCount = 0;\n\t\t\t}\n\t\t}\n\n\t\tsky.generalUpdate();\n\t\tmountains.generalUpdate();\n\t\ttrees.generalUpdate();\n\n\t\t//Cycle through walls ArrayList and update each one\n\t\t\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tw.generalUpdate();\n\t\t}\n\t\t//Same thing with Ground objects\n\t\t\n\t\tfor (int i = 0; i < ground.size(); i++) {\n\t\t\tGround g = ground.get(i);\n\t\t\tg.generalUpdate();\n\n\t\t\t//Also check each for collision with player\n\t\t\t\n\t\t\tif (player.getBounds().overlaps(g.getBounds())\n\t\t\t\t\t&& player.isDead() == false) {\n\t\t\t\tplayer.die();\n\t\t\t\tAssets.playSound(\"hit\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//When walls go off screen, delete\n\t\t\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tif (w.getBounds().x < -64) {\n\t\t\t\twalls.remove(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < checkPoints.size(); i++) {\n\t\t\tWall c = checkPoints.get(i);\n\t\t\tc.generalUpdate();\n\t\t}\n\n\t\tfor (int i = 0; i < checkPoints.size(); i++) {\n\t\t\tWall c = checkPoints.get(i);\n\t\t\tif (c.getBounds().x <= player.getBounds().x) {\n\t\t\t\tscore++;\n\t\t\t\tcheckPoints.remove(i);\n\t\t\t\ti--;\n\t\t\t\tAssets.playSound(\"score\");\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tif (player.getBounds().overlaps(w.getBounds())\n\t\t\t\t\t&& player.isDead() == false) {\n\t\t\t\tplayer.die();\n\t\t\t\tAssets.playSound(\"hit\");\n\t\t\t}\n\t\t}\n\n\t\tif (score > highScore) {\n\t\t\thighScore = score;\n\t\t}\n\n\t}",
"@Override\n\tpublic void updatePosition()\n\t{\n\t\tif(!fired && !pathfinding)\n\t\t{\n\t\t\tif(x == destX && y == destY)\n\t\t\t{\n\t\t\t\tfired = true;\n\t\t\t\tvehicle.msgAnimationDestinationReached();\n\t\t\t\tcurrentDirection = MovementDirection.None;\n\t\t\t\t\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\tif(cIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t{\n\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(allowedToMove || drunk)\n\t\t\t{\n\t\t\t\tswitch(currentDirection)\n\t\t\t\t{\n\t\t\t\t\tcase Right:\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Down:\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x % CityPanel.GRID_SIZE == 0 && y % CityPanel.GRID_SIZE == 0 && !moves.isEmpty())\n\t\t\t{\t\n\t\t\t\tif(allowedToMove || drunk)\n\t\t\t\t{\n\t\t\t\t\tcurrentDirection = moves.pop();\n\t\t\t\t\n\t\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\t\n\t\t\t\t\tif(current != next)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\n\t\t\t\t\tswitch(currentDirection)\n\t\t\t\t\t{\n\t\t\t\t\tcase Down:next = new Point(current.x,current.y + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:next = new Point(current.x - 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Right:next = new Point(current.x + 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:next = new Point(current.x,current.y - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:next = current;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[next.y][next.x].tryAcquire())\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(next.y).get(next.x);\n\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Pathfinder.isCrossWalk(next, city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(Gui g : guiList)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(g instanceof PassengerGui)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(nextIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextIntersection.acquireAll();\n\t\t\t\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tguiList.add(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!allowedToMove && drunk)\n\t\t{\n\t\t\tcity.addGui(new ExplosionGui(x,y));\n\t\t\tSystem.out.println(\"DESTROYING\");\n\t\t\tcity.removeGui(this);\n\t\t\tvehicle.stopThread();\n\t\t\tsetPresent(false);\n\t\t\t\n\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\n\t\t\tif(cIntersection == null)\n\t\t\t{\n\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t{\n\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t{\n\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t}\n\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void notifyAllTimePassed() {\r\n // Make a copy of the Sprites before iterating over them.\r\n List<Sprite> spritesCopy = new ArrayList<Sprite>(this.sprites);\r\n for (Sprite s : spritesCopy) {\r\n s.timePassed();\r\n }\r\n }",
"public void update() {\n super.update();\n // Code specific to the ship gameObject\n action = ctrl.action();\n direction.rotate(action.turn * STEER_RATE * Constants.DT);\n velocity.addScaled(direction, (MAG_ACC * Constants.DT * action.thrust));\n position.addScaled(velocity, DRAG * Constants.DT);\n position.wrap(Constants.FRAME_WIDTH, Constants.FRAME_HEIGHT);\n\n // Checks if the user is pressing forwards\n if(action.thrust == 1){\n thrusting = true;\n } else{\n thrusting = false;\n }\n time -= 1;\n if(action.shoot && time <= 0){\n mkBullet();\n time = 30;\n }\n\n if(invincible)\n color = Color.blue;\n else\n color = Color.cyan;\n }",
"public static void increaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker > 5)\r\n\t\t\tEnemy._timerTicker -= 2;\r\n\t\tif (Player._timerTicker < 100)\r\n\t\t\tPlayer._timerTicker += 2;\r\n\t}",
"public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}",
"public void update()\n\t{\n\t\t//\tTHE WORLD HAS ENDED DO NOT EXECUTE FURTHER\n\t\tif( end )\n\t\t{\n\t\t\tsafeEnd = true;\n\t\t\treturn;\n\t\t}\n\n\t\t//Plot graphics\n\t\tif(plot){\n\t\t\thealthyFunction.show(infectedFunction, healthyFunction);\n\t\t\tbusFunction.show(infectedFunction, seasFunction, busFunction, colFunction, ellFunction, smpaFunction, lawFunction);\n\t\t\tplot = false;\n\t\t}\n\n\t\t//\tsafe point to manage human/zombie ratios\n\t\t//\tTODO: Modify infect to also switch zombies to humans\n\t\tinfect();\n\t\tgetWell();\n\t\taddFromQueue();\n\n\t\t//\tupdate all entities\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.update(zombiesPaused);\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.update(humansPaused);\n\t\t}\n\n\t\tif( zc!=zombies.size() || hc!=humans.size() )\n\t\t{\n\t\t\tzc = zombies.size();\n\t\t\thc = humans.size();\n\t\t\tSystem.out.println(zc+\"/\"+hc);\n\t\t}\n\n\t\t//Add points to our functions\n\t\thealthyFunction.add(time,humans.size());\n\t\tinfectedFunction.add(time,zombies.size());\n\t\tseascount = smpacount = ellcount = lawcount = buscount = colcount = 0;\n\t\tfor (int i = 0; i < humans.size(); i++) {\n\t\t\tEntity curr = humans.get(i);\n\t\t\tif (curr instanceof SEAS) {\n\t\t\t\tseascount++;\n\t\t\t} else if (curr instanceof SMPA) {\n\t\t\t\tsmpacount++;\n\t\t\t} else if (curr instanceof Elliot) {\n\t\t\t\tellcount++;\n\t\t\t} else if (curr instanceof Law) {\n\t\t\t\tlawcount++;\n\t\t\t} else if (curr instanceof Business) {\n\t\t\t\tbuscount++;\n\t\t\t} else if (curr instanceof Columbian) {\n\t\t\t\tcolcount++;\n\t\t\t}\n\t\t}\n\t\tbusFunction.add(time, buscount);\n\t\tcolFunction.add(time, colcount);\n\t\tellFunction.add(time, ellcount);\n\t\tlawFunction.add(time, lawcount);\n\t\tsmpaFunction.add(time, smpacount);\n\t\tseasFunction.add(time, seascount);\n\t\ttime++;\n\t}",
"void updateTotals () {\n\n speed_kts_mph_kmh_ms_info = make_speed_kts_mph_kmh_ms_info(velocity);\n double lift = foil_lift();\n double drag = total_drag();\n \n // This computes location of the center of gravity of the craft\n // (rider, roughly) in relation to the leading edge (aka LE) of the\n // mast (roughly, front bolt of DT). \n //\n // Mtipping is 0.5*eff_strut_span*strut,drag\n //\n // cg_pos: x-axis offset relative to strut bottom LE. \"fore\" is -, \"aft\" is +,\n dash.cg_pos = find_cg_xpos(); \n // cg_pos_board_level: at board level where x=0 at strut's board-side LE.\n // strut tilt correction is required. example:\n // cg_pos=-35cm, xoff_tip=5cm (horue,dmitry) cg_pos_board_level=-30-5=-35\n dash.cg_pos_board_level = dash.cg_pos;\n\n // foilboard AOA correction. when the board is at high angle of\n // attack, the computed offset is only an approximation, rider is more\n // forward *alone the board surface* in reality. for 90 degree strut,\n // it is the hypotenuse where the adjasent is -dash.cg_pos + cos(\n // BOARD_THICKNESS + strut.span)\n if (rider_xpos_tilt_correction) {\n double pitch_rad = Math.toRadians(craft_pitch);\n double hypo = BOARD_THICKNESS + strut.span;\n double deck_rot_adj = - // when AOA is positive, and cg_pos is\n // negative, increses the magnitude\n hypo * Math.sin(pitch_rad);\n\n // board deck offset is hypotenuse; adjasent value is dash.cg_pos plus\n // deck_rot_adjn\n \n // deck_x_offset is the 'hypotenuse' H = A / cos(A)\n double deck_x_offset = (dash.cg_pos + deck_rot_adj) // the 'adjasent'\n / Math.cos(pitch_rad);\n\n // apply correction\n dash.cg_pos_board_level = deck_x_offset;\n }\n\n // cg_pos_board_level: at board level where x=0 at strut's board-side LE.\n // strut tilt correction is required. example for AoA=0:\n // cg_pos=-30cm, xoff_tip=5cm (horue,dmitry) cg_pos_board_level=-30-5=-35\n dash.cg_pos_board_level -= strut.xoff_tip;\n\n \n // rider_countering_x_offset is computed and saved to reflect posture\n // change due to (a) headwind (b) propulsion pull as follows below\n double rider_countering_x_offset = 0;\n\n // (a) Headwind.\n // Two square triangles: rider_offset/height = rider.drag/weight\n if (!in.opts.ignore_air_resistance)\n rider_countering_x_offset += -(rider.drag/rider.weight)* RIDER_CG_HEIGHT;\n\n // (b) Propulsion pull. \n // Rider's force-countering stance is in effect only if the drive force is applied\n // above the board, which implies it goes through rider's body\n if (DRIVING_FORCE_HEIGHT > 0) {\n // drive force, scaled to be considering coming from the rider CG height spot\n double drive_force_scaled = \n (in.opts.ignore_drive_moment)\n ? 0\n : (total_drag() * DRIVING_FORCE_HEIGHT/RIDER_CG_HEIGHT);\n // two square triangles: rider_offset/height = drive_force_scaled/weight\n rider_countering_x_offset += (drive_force_scaled/rider.weight)* RIDER_CG_HEIGHT; // wasFF 0.86;\n }\n rider.force_countering_x_offest = rider_countering_x_offset;\n dash.cg_pos_of_rider = dash.cg_pos_board_level + rider.force_countering_x_offest;\n\n // factored out to dash.loadPanel()\n // if (can_do_gui_updates) {\n // dash.loadPanel();\n // }\n }",
"@Override\n public void periodic() {\n if(m_Turret.OnTarget()){\n velocity = calculateRPMs();\n pidController.setReference(velocity, ControlType.kVelocity);\n SmartDashboard.putNumber(\"shooter Desired velocity\", velocity );\n SmartDashboard.putNumber(\"shooter Actual velocity\", encoder.getVelocity());\n \n if(atRPM() && accumulator > 100){\n m_Indexer.shooting();\n hasShot = true;\n }\n }else{\n accumulator = 0;\n if(hasShot){\n m_Indexer.endShooting();\n hasShot = false;\n }\n }\n\n SmartDashboard.putBoolean(\"shooter at rpm\", atRPM() && accumulator > 100);\n }",
"public void update(){\n\t\t\tif (x<200){\n\t\t\t\txmoving=1; \n\t\t\t}\n\t\t\tif (x>900){ \n\t\t\t\txmoving=-.1; \n\t\t\t} \n\n\t\t\tx+=xmoving;\n\n\t}",
"protected void prospect(){\n //While the Gold Position is undetermined, keep updating the camera\n cam.activateTFOD();\n\n runtime.reset();\n resetHeading();\n rotatedLeft = false;\n rotatedRight = false;\n rotatePhoneMount(.48);\n\n while(cam.getGoldPosition() == BuggleCam.GOLD_POSITION.NULL && runtime.seconds() < 4 && opModeIsActive()) {\n cam.betterUpdate(telemetry);\n //telemetry.update();\n if(runtime.seconds() > 2 && !rotatedRight) {\n rotatePhoneMount(.65);\n rotatedRight = true;\n }\n }\n if(cam.getGoldPosition() == BuggleCam.GOLD_POSITION.NULL)\n rotatedLeft = true;\n if(rotatedRight && !rotatedLeft)\n cam.setGoldPosition(BuggleCam.GOLD_POSITION.RIGHT);\n else if(rotatedRight)\n cam.setGoldPosition(BuggleCam.GOLD_POSITION.LEFT);\n cam.stopTFOD();\n\n }",
"public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\trobot.probability[a][b] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\tif (a == 0 || a == 7 || b == 0 || b == 7) {\r\n\t\t\t\t\trobot.probability[a][b] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 6; a++) {\r\n\t\t\tfor (int b = 0; b < 6; b++) {\r\n\t\t\t\tif (robot.map[a][b].getOccupied() == 1) {\r\n\t\t\t\t\trobot.probability[a + 1][b + 1] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Step1: use ArrayList to save all of the probability situation.\r\n\t\tfloat front, left, right, back;\r\n\t\tfront = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\tleft = USThread.disSample[0];\r\n\t\trobot.setmotorM(-180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tright = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\trobot.correctHeading(180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tback = USThread.disSample[0];\r\n\t\trobot.correctHeading(180);\r\n\t\tfor (int a = 1; a < 7; a++) {\r\n\t\t\tfor (int b = 1; b < 7; b++) {\r\n\t\t\t\tif (robot.probability[a][b] == -1) {\r\n\t\t\t\t\tif (((robot.probability[a][b + 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t//direction is north\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(0, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"0 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a + 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is east\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(1, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"1 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a][b - 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is sourth\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(2, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"2 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a - 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is west\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(3, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"3 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Step 2: use loop to take control of robot walk and check the location correction\r\n\t\tboolean needLoop = true;\r\n\t\tint loopRound = 0;\r\n\t\twhile (needLoop) {\r\n\t\t\t// One of way to leave the loop is at the hospital\r\n\t\t\tif ((ColorThread.leftColSample[0] >= 0.2 && ColorThread.leftColSample[1] < 0.2\r\n\t\t\t\t\t&& ColorThread.leftColSample[1] >= 0.14 && ColorThread.leftColSample[2] <= 0.8)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] >= 0.2 && ColorThread.rightColSample[1] < 0.2\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[1] >= 0.11 && ColorThread.rightColSample[2] <= 0.08)) {\r\n\t\t\t\trobot.updatePosition(0, 0);\r\n\t\t\t\tint numOfAtYellow = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtYellow++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtYellow == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\t//have two way to go to the yellow part\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//Another way to leave the loop is the robot arrive the green cell.\r\n\t\t\tif ((ColorThread.leftColSample[0] <= 0.09 && ColorThread.leftColSample[1] >= 0.17\r\n\t\t\t\t\t&& ColorThread.leftColSample[2] <= 0.09)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] <= 0.09 && ColorThread.rightColSample[1] >= 0.014\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[2] <= 0.11)) {\r\n\t\t\t\trobot.updatePosition(5, 0);\r\n\t\t\t\tint numOfAtGreen = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtGreen++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtGreen==1) {\r\n\t\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The third way of leave the loop is the robot have already know his position and direction.\r\n\t\t\tint maxStepNumber = 0;\r\n\t\t\tint numberOfMaxSteps = 0;\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() > maxStepNumber) {\r\n\t\t\t\t\tmaxStepNumber = robot.listOfPro.get(i).getSteps();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\tnumberOfMaxSteps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (numberOfMaxSteps == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\t\trobot.updatePosition(robot.listOfPro.get(i).getNowX() - 1,\r\n\t\t\t\t\t\t\t\trobot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The below part are the loops.\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\t// move\r\n\t\t\t\r\n\t\t\tif (front > 0.25) {\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (left > 0.25) {\r\n\t\t\t\trobot.correctHeading(-90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (right > 0.25) {\r\n\t\t\t\trobot.correctHeading(90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// It time to check the around situation\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t//System.out.println(robot.listOfPro.get(i).getSteps());\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\tif (((front < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\tif (((left < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\tif (((back < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (((right < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tloopRound++;\r\n\t\t}\r\n\t\t// if is out the while loop, it will find the heading and the position of robot right now.\r\n\t\t//Step 3: It is time to use wavefront to come back to the hospital\r\n\t\trobot.restoreDefault();\r\n\t\trobot.RunMode = 1;\r\n\t\tColorThread.updatePos = true;\r\n\t\tColorThread.updateCritical = true;\r\n\t}",
"private void waitConstant() {\r\n \t\tlong\tlwait = CL_FRMPRDAC;\r\n \t\t// drawing is active?\r\n \t\tif(m_fHorzShift == 0 && m_lTimeZoomStart == 0\r\n \t\t\t\t&& GloneApp.getDoc().isOnAnimation() == false)\r\n \t\t\tlwait = CL_FRMPRDST;\t\t// stalled\r\n \r\n \t\t// make constant fps\r\n \t\t// http://stackoverflow.com/questions/4772693/\r\n \t\tlong\tldt = System.currentTimeMillis() - m_lLastRendered;\r\n \t\ttry {\r\n \t\t\tif(ldt < lwait)\r\n \t\t\t\tThread.sleep(lwait - ldt);\r\n \t\t} catch (InterruptedException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t}",
"public void updateSpeed() {\n\t\t// should work b/c of integer arithmetic\n\t\tif(isTwoPlayer)\n\t\t\treturn;\n\t\t//System.out.println(\"speed up factor: \" + speedUpFactor);\n\t\t//System.out.println(\"numlinescleared/6: \" + numLinesCleared/6);\n\t\tif (speedUpFactor != numLinesCleared/6) {\n\t\t\t// speed by 10% every lines cleared, needs to be checked\n\t\t\tspeedUpFactor = numLinesCleared/6;\n\t\t\tif(!(defaultSpeed - 30*speedUpFactor <= 0))\n\t\t\t\tdefaultSpeed = defaultSpeed - 30*speedUpFactor;\n\t\t\tlevel = speedUpFactor;\n\t\t}\n\t\t//System.out.println(\"default speed: \" + defaultSpeed);\n\t}",
"public void update() {\n if (!outOfBounds()) {\n super.move(dirVec.mul(ShadowDefend.getTimescale() * speed));\n }\n super.update();\n }",
"@Override\n protected void execute() {\n double now = Timer.getFPGATimestamp();\n double deltaT = now - startT;\n if(deltaT < 1){\n Robot.hatchIntake.hatchSolenoid(false);\n }else if(deltaT > 1 && deltaT < 1.5){\n Robot.hatchIntake.hatchSolenoid(true);\n }\n }",
"public abstract void calculateMovement();",
"public int getTurnaround (){\n return finishingTime-arrival_time;\n }",
"public void timeForFight(final int posR, final int posC) {\n if (posR < 0 || posC < 0 || mapTerain.length <= posR || mapTerain[0].length <= posC) {\n return;\n }\n\n if (secondPlayerOnPos[posR][posC] != null) {\n StandardPlayer p1 = firstPlayerOnPos[posR][posC];\n StandardPlayer p2 = secondPlayerOnPos[posR][posC];\n\n if (p1.getCurrentHp() <= 0 || p2.getCurrentHp() <= 0) {\n return;\n }\n\n p1.setIncomingDamage(0);\n p2.setIncomingDamage(0);\n\n p1.calculateStrike(heroSpells, p2, mapTerain[posR][posC]);\n p1.setHasAttacked(true);\n p2.calculateStrike(heroSpells, p1, mapTerain[posR][posC]);\n p2.setHasAttacked(true);\n\n p1.takeDamage();\n p2.takeDamage();\n\n if (p1.getCurrentHp() <= 0 && p2.getCurrentHp() <= 0) {\n observer.updatePlayerKillingOther(p1, p2);\n observer.updatePlayerKillingOther(p2, p1);\n return;\n }\n\n if (p2.getKillXp(p1)) {\n observer.updatePlayerKillingOther(p2, p1);\n p2.checkLevelUp();\n }\n\n if (p1.getKillXp(p2)) {\n observer.updatePlayerKillingOther(p1, p2);\n p1.checkLevelUp();\n }\n }\n }",
"public void gameUpdate()\n {\n\t\tcheckCollisions();\n\t\t\n\t\tif(up)\t\tcraft.accelerat();\t\t\n\t\tif(left)\tcraft.rotateLeft();\n\t\tif(right) \tcraft.rotateRight();\n\t\t\n\t\tcraft.move();\n\t\tmoveAstroids();\n }",
"@Override\n\tpublic void update(float delta) {\n\t\tHashMap<Coordinate, MapTile> currentView = getView();\n\t\tcheckStateChange();\n\t\tfor(Coordinate i : currentView.keySet()) {\n\t\t\t\n\t\t\t//Building up wholeMap with data from currentView\n\t\t\tif(i.x >= 0 && i.y >= 0 && i.x < World.MAP_WIDTH && i.y < World.MAP_HEIGHT ) {\n\t\t\t\twholeMap.put(i, currentView.get(i));\n\t\t\t}\n\t\n\t\t}\n//\t\tif(getSpeed() > CAR_SPEED/2f){\n//\t\t\tapplyBrake();\n//\t\t}\n\n//\t\tif(checkWallAhead(getOrientation(), currentView)){\n//\t\t\tisReversing = true;\n//\t\t}\n//\t\tif(checkRightWall(getOrientation(), currentView)){\n//\t\t\tisTurningLeft = true;\n//\t\t}\n//\t\tif(checkLeftWall(getOrientation(), currentView)){\n//\t\t\tisTurningRight = true;\n//\t\t}\n\n\n\n\t\tdebugPrint(\"STATES: A: \" + isAccelerating +\" Rv: \"+ isReversing +\n\t\t\" L: \"+ isTurningLeft + \" R: \"+isTurningRight);\n\n\n\t\t//Handles Steering\n\t\tif(isTurningLeft){\n\t\t\tdebugPrint(\"TRYING TO TURN LEFT\");\n\t\t\tapplySafeLeftTurn(delta);\n\t\t} else if(isTurningRight){\n\t\t\tdebugPrint(\"TRYING TO TURN RIGHT\");\n\t\t\tapplySafeRightTurn(delta);\n\t\t}\n\t\tif(isAccelerating){\n\t\t\tdebugPrint(\"No\");\n\t\t\tapplySafeForwardAcceleration();\n\t\t}\n\n\t\tif(isReversing){\n\t\t\tapplySafeReverseAcceleration();\n//\t\t\tisReversing = false;\n\n\t\t}\n\n\n\n\n\n\t\t//\n\t\tif(hasReachedNextDest) {\n\t\t\tdebugPrint(\"Recalculating Route.\");\n\t\t\tList<Node> result =exploreDijkstras(new Coordinate(carrrr.getPosition()));\n\t\t\tresult.add(new Node(\"1,2\"));\n\t\t\tpathList.add(result);\n\t\t\thasReachedNextDest = false;\n\t\t}\n\n\n\n\n\t\t//Car movement code-----------------------------------------------------------------------------------\n\t\t//If there's a path in the path array to follow\n\t\tif(pathList.size() > 0 || processing) {\n\t\t\tif(processing) {\n\t\t\t\tcheckStateChange();\n\n\t\t\t\t//Identify if target tile is N,S,E or W.\n\t\t\t\ttry {\n\t\t\t\t\tpath.get(counter+1);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tdebugPrint(\"Starting new path\");\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\thasReachedNextDest = true;\n\t\t\t\t}\n\n\n\n\t\t\t\tCoordinate currPos = new Coordinate (getPosition());\n\t\t\t\tCoordinate targetPos = new Coordinate(path.get(counter).getName());\n\n\t\t\t\tif(!coordList.contains(currPos)){\n\t\t\t\t\tdebugPrint(\"Recalculating Route (Not on route).\");\n\t\t\t\t\tList<Node> result =exploreDijkstras(new Coordinate(getPosition()));\n\t\t\t\t\tresult.add(new Node(\"99,99\")); //This is just to make sure something is there.\n\t\t\t\t\tpathList.add(result);\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\tdebugPrint(result);\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\n\t\t\t\tWorldSpatial.Direction dir = getDirection(currPos, targetPos);\n\n\t\t\t\tboolean isFacingTarget = false;\n\n\t\t\t\tSystem.out.println(\"-----------------\");\n\t\t\t\tdebugPrint(\"currPos: \"+ currPos);\n\t\t\t\tdebugPrint(\"targetPos: \"+ targetPos);\n\t\t\t\tSystem.out.println(\"-----------------\");\n\n\t\t\t\t// If we are on the target, move on to next.\n\t\t\t\tif(currPos.equals(targetPos)) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\tcurrPos = targetPos;\n\t\t\t\t\ttargetPos = new Coordinate(path.get(counter).getName());\n\n\n\n\t\t\t\t\tif(!isFacingTarget){\n//\t\t\t\t\t\tisTurningSoon = true;\n\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\t\t\t\t\t}\n\t\t\t\t\tdir = getDirection(currPos, targetPos);\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir + \"|| carFront: \" + getOrientation());\n\t\t\t\t\tisFacingTarget = dir.equals(getOrientation());\n\n\t\t\t\t\tif(dir.equals(oppositeOfOrientation(getOrientation()))){\n\t\t\t\t\t\tisReversing = true;\n\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not on target yet.\n\t\t\t\t\tif(!isFacingTarget && isReversing) {\n\t\t\t\t\t\t//If not moving in Direction of target Coord:\n\t\t\t\t\t\tif(leftOrRight(dir) == null){\n\t\t\t\t\t\t\t//this is bad.\n\t\t\t\t\t\t\tdebugPrint(\"Not left or right?\");\n\t\t\t\t\t\t\tdebugPrint(\"UTURN REQUIRED\");\n\t\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisReversing = false;\n\t\t\t\t\t\t\tdebugPrint(\"leftOrRight: \" + leftOrRight(dir));\n\t\t\t\t\t\t\tlastTurnDirection = leftOrRight(dir);\n\t\t\t\t\t\t\tint targetDegree = directionToDegree(dir);\n\n\t\t\t\t\t\t\tdebugPrint(\"PEEK: \"+peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().toString());\n\n\t\t\t\t\t\t\tif(peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(currPos)){\n\t\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(lastTurnDirection.equals(WorldSpatial.RelativeDirection.RIGHT)){\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(targetPos)){\n\t\t\t\t\t\t\t\t\tdebugPrint(\"RIGHT TURN SAFE\");\n\t\t\t\t\t\t\t\t\tisTurningRight = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningRight = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.LEFT, delta).getCoordinate().equals(targetPos)) {\n\t\t\t\t\t\t\t\t\tdebugPrint(\"LEFT TURN SAFE\");\n\n\t\t\t\t\t\t\t\t\tisTurningLeft = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treadjust(lastTurnDirection, delta);\n\t\t\t\t\t\t//If moving in right direction,\n\t\t\t\t\t\t//Accelerate if not traveling at max speed\n\t\t\t\t\t\tfloat x = CAR_SPEED;\n\t\t\t\t\t\tif(isTurningSoon) {\n\t\t\t\t\t\t\tx = CAR_SPEED/4f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(getSpeed() < x){\n\t\t\t\t\t\t\tisTurningSoon = false;\n\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif(useTestPath){\n\t\t\t\t\tmakeTestPath();\n\t\t\t\t\tpath = testpath;\n\t\t\t\t} else {\n\t\t\t\t\tpath = pathList.poll();\n\t\t\t\t\t//Populate coordList\n\t\t\t\t\tfor(Node n: path){\n\t\t\t\t\t\tcoordList.add(new Coordinate(n.getName()));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tdebugPrint(path);\n\t\t\t\tprocessing = true; \n\t\t\t\t\n\t\t\t}\n\t\n\t\t\t\n\t\t} else {\n\t\t\tdebugPrint(\"End of path list\");\n\t\t}\n\n\n\n\n\n\n\n/*\t\t// If you are not following a wall initially, find a wall to stick to!\n\t\tif(!isFollowingWall){\n\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\tapplyForwardAcceleration();\n\t\t\t}\n\t\t\t// Turn towards the north\n\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.NORTH)){\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\tif(checkNorth(currentView)){\n\t\t\t\t// Turn right until we go back to east!\n\t\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.EAST)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Once the car is already stuck to a wall, apply the following logic\n\t\telse{\n\n\t\t\t// Readjust the car if it is misaligned.\n\t\t\treadjust(lastTurnDirection,delta);\n\n\t\t\tif(isTurningRight){\n\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\telse if(isTurningLeft){\n\t\t\t\t// Apply the left turn if you are not currently near a wall.\n\t\t\t\tif(!checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to determine whether or not the car is next to a wall.\n\t\t\telse if(checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t// Maintain some velocity\n\t\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t}\n\t\t\t\t// If there is wall ahead, turn right!\n\t\t\t\tif(checkWallAhead(getOrientation(),currentView)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tisTurningRight = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// This indicates that I can do a left turn if I am not turning right\n\t\t\telse{\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tisTurningLeft = true;\n\t\t\t}\n\t\t}\n\n\t\t*/\n\n\t}",
"protected void execute() {\n \t\n \tcurrent_time = System.currentTimeMillis();\n \t\n \tlift.liftDown(LIFT_SPEED);\n }",
"protected final void run(int direction) {\n\t\tint temp_x = x_coord;\n\t\tint temp_y = y_coord;\n\t//Update location (*2 because we move twice in same direction)\t\n\t\tif (!hasMoved) {\n\t\t\ttemp_x += (x_directions[direction] * 2);\n\t\t\ttemp_x += Params.world_width;\n\t\t\ttemp_x %= Params.world_width;\n\t\t\ttemp_y += (y_directions[direction] * 2);\n\t\t\ttemp_y += Params.world_height;\n\t\t\ttemp_y %= Params.world_height;\n\t\t}\n\t//Specific to running during fight\n\t\tif (fightMode) {\n\t\t\tboolean critterInLocation = false;\n\t\t\tfor (Critter c: population) {\n\t\t\t\tif ((c.x_coord == temp_x) && (c.y_coord == temp_y)) {\n\t\t\t\t\tcritterInLocation = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!critterInLocation) {\n\t\t\t\tx_coord = temp_x;\n\t\t\t\ty_coord = temp_y;\n\t\t\t}\n\t\t}\n\t\telse {\t\t\t\t\t//Specific to walking in time step\n\t\t\tx_coord = temp_x;\n\t\t\ty_coord = temp_y;\n\t\t}\n\t//Update energy\n\t\tenergy -= Params.run_energy_cost;\n\t//Update hasMoved\n\t\thasMoved = true;\n\t}",
"public void trackAndFire() {\n \t \tdouble theta;\n double distanciaObjetivo = myPos.distance(objetivo.pos);\n //Hallar el proximo punto en un perímetro definido\n \t\t//(30,30) elimina bordes y despues el -60 para la longitud de los dados\n Rectangle2D.Double perimetro = new Rectangle2D.Double(30, 30, getBattleFieldWidth() - 60, getBattleFieldHeight() - 60);\n \n \n \n //if my cannon is locked and ready and i got some energy left fire with\n //appropiate energy to not get stuck, fire in the execute rather than now\n \n if(getGunTurnRemaining() == 0 && myEnergy > 1) {\n setFire( Math.min(Math.min(myEnergy/6.0, 1000/distanciaObjetivo), objetivo.energy/3.0) );\n }\n \n //any other case, ill get aim lock with this function\n //normalize sets between pi -pi\n setTurnGunRightRadians(Utils.normalRelativeAngle(angulo(objetivo.pos, myPos) - getGunHeadingRadians()));\n \n\n double distNextPunto = myPos.distance(futurePos);\n \n \n if(distNextPunto > 20) {\n \t//aun estamos lejos\n \n \t\t\n \t\t//theta es el angulo que hemos de cortar para ponernos \"encarando\" bien\n theta = angulo(futurePos, myPos) - getHeadingRadians();\n \n \n double sentido = 1;\n \n if(Math.cos(theta) < 0) {\n theta += Math.PI;\n sentido = -1;\n }\n \n setAhead(distNextPunto * sentido);\n theta = Utils.normalRelativeAngle(theta);\n setTurnRightRadians(theta);\n \n if(theta > 1)setMaxVelocity(0.0);\n else setMaxVelocity(8.0); // max\n \n \t\n \n } else {\n \t //ENTRO AQUI SI ME QUEDA POCO PARA LLEGAR, SMOOTH CORNERING\n\n \t\t\n //probar 1000 coordenadas\n int iterNum = 1000;\n Point2D.Double cand;\n for(int i =0; i < iterNum; i++){\n \n //i dont want it to be close to another bot, thats the meaning of distanciaObjetivo*0.8\n cand = hallarPunto(myPos, Math.min(distanciaObjetivo*0.8, 100 + iterNum*Math.random()), 2*Math.PI*Math.random());\n if(perimetro.contains(cand) && evalHeuristic(cand) < evalHeuristic(futurePos)) {\n futurePos = cand;\n }\n \n \n } \n \n prevPos = myPos;\n \n }\n }",
"public void timePassed() {\n this.moveOneStep();\n }"
] | [
"0.6837626",
"0.642158",
"0.61378384",
"0.6103444",
"0.60098916",
"0.5918249",
"0.5917248",
"0.5884102",
"0.5876254",
"0.58653975",
"0.5827244",
"0.58070076",
"0.58058417",
"0.5788149",
"0.57664746",
"0.57443553",
"0.573525",
"0.57321215",
"0.572866",
"0.5716976",
"0.56939685",
"0.5680565",
"0.567615",
"0.5674439",
"0.56700206",
"0.5662577",
"0.56493795",
"0.5620951",
"0.5618186",
"0.56002307",
"0.5598954",
"0.559848",
"0.55984133",
"0.55932915",
"0.5568596",
"0.5564621",
"0.555974",
"0.55590576",
"0.55559844",
"0.55429846",
"0.5542253",
"0.5540409",
"0.553336",
"0.55293006",
"0.5520936",
"0.5515839",
"0.5508316",
"0.55072457",
"0.5504831",
"0.5504181",
"0.5498044",
"0.5493442",
"0.54918456",
"0.5491168",
"0.5490609",
"0.5489301",
"0.548497",
"0.54841864",
"0.5481211",
"0.5472606",
"0.54721725",
"0.54721427",
"0.54718",
"0.5464512",
"0.5460915",
"0.5458512",
"0.5457796",
"0.5452656",
"0.5452472",
"0.5446396",
"0.54428303",
"0.54259074",
"0.5423337",
"0.5422446",
"0.5418686",
"0.5413816",
"0.5412631",
"0.5411671",
"0.5407267",
"0.54049253",
"0.5402003",
"0.5401303",
"0.5399715",
"0.5399011",
"0.539773",
"0.5395198",
"0.5395099",
"0.53924626",
"0.539162",
"0.5390329",
"0.5388838",
"0.5385992",
"0.5385789",
"0.5383509",
"0.5382529",
"0.5381551",
"0.53804386",
"0.5379135",
"0.53785545",
"0.53768677"
] | 0.6509518 | 1 |
Transformation of scene based on GUI values (also transform scene so Z is up, X is forward) | private void transformation(GL gl)
{
// Make X axis face forward, Y right, Z up
// (map ZXY to XYZ)
gl.glRotated(-90, 1, 0, 0);
gl.glRotated(-90, 0, 0, 1);
if (drawBugView.value) {
// ---- "Bug cam" transformation (for mainBug)
// this is the inverse of the M transformation that places the bug in the scene (based on mainbug pos and vel)
double angle = Math.atan2(mainBug.vel.y, mainBug.vel.x);
gl.glRotated(Math.toDegrees(Math.PI - angle), 0, 0, 1);
//drawing a bit above the z axis so we can see the ground
gl.glTranslated(-mainBug.pos.x, -mainBug.pos.y, -mainBug.pos.z-0.2);
} else {
// ---- Ordinary scene transformation
// Move camera back so that scene is visible
gl.glTranslated(-20, 0, 0);
// Translate by Zoom/Horiz/Vert
gl.glTranslated(tZ.value, tH.value, tV.value);
// Rotate by Alt/Azim
gl.glRotated(rAlt.value, 0, 1, 0);
gl.glRotated(rAzim.value, 0, 0, 1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"@FXML\n public void translation(){\n double x = Double.parseDouble(translation_x.getText());\n double y = Double.parseDouble(translation_y.getText());\n double z = Double.parseDouble(translation_z.getText());\n\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n t1.getTetraeder()[0].setPoint(A[0]+x,A[1]+y,A[2]+z);\n t1.getTetraeder()[1].setPoint(B[0]+x,B[1]+y,B[2]+z);\n t1.getTetraeder()[2].setPoint(C[0]+x,C[1]+y,C[2]+z);\n t1.getTetraeder()[3].setPoint(D[0]+x,D[1]+y,D[2]+z);\n\n redraw();\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"private void initCamera(SubScene scene, Group root){\n //Create a perspective camera for 3D use and add it to the scene.\n PerspectiveCamera camera = new PerspectiveCamera(true);\n scene.setCamera(camera);\n\n //Set the camera's field of view, near and far pane, and starting zoom.\n camera.setFieldOfView(80);\n camera.setNearClip(1);\n camera.setFarClip(5000);\n camera.setTranslateZ(-1000);\n\n //Initiate the rotation objects used for rotating the camera about the world.\n Rotate xRotate = new Rotate(0, Rotate.X_AXIS);\n Rotate yRotate = new Rotate(0, Rotate.Y_AXIS);\n root.getTransforms().addAll(xRotate, yRotate);\n\n //Bind the property so it automatically updates.\n xRotate.angleProperty().bind(angleX);\n yRotate.angleProperty().bind(angleY);\n\n //Add an event listener to track the start of a mouse drag when the mouse is clicked.\n scene.setOnMousePressed(event -> {\n dragStartX = event.getSceneX();\n dragStartY = event.getSceneY();\n anchorAngleX = angleX.get();\n anchorAngleY = angleY.get();\n });\n\n //Add an event listener to update the rotation objects based on the distance dragged.\n scene.setOnMouseDragged(event -> {\n //A modifier (0.2 in this case) is used to control the sensitivity.\n Double newAngleX = anchorAngleX - (dragStartY - event.getSceneY())*0.2;\n //Restrict the rotation to angles less than 90.\n if(newAngleX > 90){\n angleX.set(90);\n //Restrict the rotation to angles greater than 5.\n } else if (newAngleX < 5){\n angleX.set(5);\n } else {\n angleX.set(newAngleX);\n }\n angleY.set(anchorAngleY + (dragStartX - event.getSceneX())*0.2);\n });\n\n //Add an event listener to move the camera away or towards the scene using the mouse wheel.\n scene.setOnScroll(event -> {\n Double delta = event.getDeltaY();\n //If the mouse scrolls in, and the camera is not too close, then move the camera closer.\n if(delta > 0 && camera.getTranslateZ() <= -100){\n camera.setTranslateZ(camera.getTranslateZ()*0.975);\n //Else, if the mouse scrolls out and it's not too far away, then move the camera away.\n } else if(delta <0 && camera.getTranslateZ() >= -3000){\n camera.setTranslateZ(camera.getTranslateZ()* 1/0.975);\n }\n });\n }",
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"godot.wire.Wire.Transform getTransformValue();",
"public Transform getTransformation() {\n Transform t = Transform.newTranslation(position);\n t = t.compose(Transform.newScale(scale));\n t = t.compose(Transform.newXRotation(rotation.x));\n t = t.compose(Transform.newYRotation(rotation.y));\n t = t.compose(Transform.newZRotation(rotation.z));\n return t;\n }",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}",
"private void positionObjectInScene(float x, float y, float z) {\n setIdentityM(modelMatrix, 0);\n translateM(modelMatrix, 0, x, y, z);\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix,\n 0, modelMatrix, 0);\n }",
"public Matrix getTransform()\n {\n return transform;\n }",
"public PVector getTransformedPosition(){\n\t\treturn gui.getTransform().transform(position);\n\t}",
"private static void norm3JS() {\n\n // Drive\n axLeftX.setAxis(leftJoystick, 0); //Mecanum (Arcade) Left/Right turn\n axLeftY.setAxis(leftJoystick, 1); //Mecanum (Arcade) Fwd/Bkwd\n axRightX.setAxis(rightJoystick, 0); //Mecanum Rotate orientation\n axRightY.setAxis(rightJoystick, 1); //unassigned\n\n btnGyroReset.setButton(rightJoystick, 6); // reset gyro to 0\n\n btnHoldLeft.setButton(rightJoystick, 4); //??\n btnHoldCenter.setButton(rightJoystick,3); //??\n btnHoldRight.setButton(rightJoystick, 5); //??\n \n // Gear\n btnPickupGear.setButton(coJoystick, 2); // Pickup gear off floor\n btnPlaceGear.setButton(coJoystick, 5); // Place gear on ship peg\n \n // Shooter\n btnShooter.setButton(coJoystick, 1); // Start shooter then feeder(s)\n btnAgitator.setButton(coJoystick, 3); // Agitate the ball bin\n \n // Climb\n btnClimber.setButton(coJoystick, 8); // Climber rotating\n \n }",
"@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }",
"public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }",
"public void setTransform(Transform transform);",
"godot.wire.Wire.Transform2D getTransform2DValue();",
"public void start(Stage myStage) { \n \n // Give the stage a title. \n myStage.setTitle(\"Effects and Transforms Demo\"); \n \n // Use a FlowPane for the root node. In this case, \n // vertical and horizontal gaps of 20 are used. \n FlowPane rootNode = new FlowPane(20, 20); \n \n // Center the controls in the scene. \n rootNode.setAlignment(Pos.CENTER); \n \n // Create a scene. \n Scene myScene = new Scene(rootNode, 300, 120); \n \n // Set the scene on the stage. \n myStage.setScene(myScene); \n \n // Add rotation to the transform list for the Rotate button. \n btnRotate.getTransforms().add(rotate); \n \n // Add scaling to the transform list for the Scale button. \n btnScale.getTransforms().add(scale); \n \n // Set the reflection effect on the reflection label. \n reflection.setTopOpacity(0.7); \n reflection.setBottomOpacity(0.3); \n reflect.setEffect(reflection); \n \n // Handle the action events for the Rotate button. \n btnRotate.setOnAction(new EventHandler<ActionEvent>() { \n public void handle(ActionEvent ae) { \n // Each time button is pressed, it is rotated 30 degrees \n // around its center. \n angle += 15.0; \n \n rotate.setAngle(angle); \n rotate.setPivotX(btnRotate.getWidth()/2); \n rotate.setPivotY(btnRotate.getHeight()/2); \n } \n }); \n \n // Handle the action events for the Scale button. \n btnScale.setOnAction(new EventHandler<ActionEvent>() { \n public void handle(ActionEvent ae) { \n // Each time button is pressed, the button's scale is changed. \n scaleFactor += 0.1; \n if(scaleFactor > 2.0) scaleFactor = 0.4; \n \n scale.setX(scaleFactor); \n scale.setY(scaleFactor); \n \n } \n }); \n \n // Handle the action events for the Blur button. \n btnBlur.setOnAction(new EventHandler<ActionEvent>() { \n public void handle(ActionEvent ae) { \n // Each time button is pressed, its blur status is changed. \n if(blurVal == 10.0) { \n blurVal = 1.0; \n btnBlur.setEffect(null); \n btnBlur.setText(\"Blur off\"); \n } else { \n blurVal++; \n btnBlur.setEffect(blur); \n btnBlur.setText(\"Blur on\"); \n } \n blur.setWidth(blurVal); \n blur.setHeight(blurVal); \n } \n }); \n \n // Add the label and buttons to the scene graph. \n rootNode.getChildren().addAll(btnRotate, btnScale, btnBlur, reflect); \n \n // Show the stage and its scene. \n myStage.show(); \n }",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"Transforms getTransforms();",
"public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}",
"public void rotateToFront() {\n SXRTransform transform = mSceneRootObject.getTransform();\n transform.setRotation(1, 0, 0, 0);\n transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);\n }",
"public Transform getTransform () {\n\t\torg.jbox2d.common.Transform trans = body.getTransform();\n\t\ttransform.vals[Transform.POS_X] = trans.p.x;\n\t\ttransform.vals[Transform.POS_Y] = trans.p.y;\n\t\ttransform.vals[Transform.COS] = trans.q.c;\n\t\ttransform.vals[Transform.SIN] = trans.q.s;\n\t\treturn transform;\n\t}",
"public Transform getTransform() {return transform;}",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"private void setupTransformationMatrix(ShapeRenderer renderer){\n\t\trenderer.identity();\n\t\trenderer.translate(cx, cy, 0);\n\t\trenderer.rotate(0, 0, 1, angle); \n\t\trenderer.translate(-cx, -cy, 0);\n\t}",
"void transformPage(View page, float position);",
"protected synchronized void resetModelViewMatrix()\n {\n Matrix4d transform = new Matrix4d();\n // translate so that the viewer is at the origin\n Matrix4d translation = new Matrix4d();\n translation.setTranslation(myPosition.getLocation().multiply(-1.));\n // rotate to put the viewer pointing in the -z direction with the up\n // vector along the +y axis.\n Quaternion quat = Quaternion.lookAt(myPosition.getDir().multiply(-1.), myPosition.getUp());\n Matrix4d rotation = new Matrix4d();\n rotation.setRotationQuaternion(quat);\n // set the transform.\n transform.multLocal(rotation);\n transform.multLocal(translation);\n myModelViewMatrix = transform.toFloatArray();\n setInverseModelViewMatrix(transform.invert());\n clearModelToWindowTransform();\n }",
"public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }",
"private void setTheScene()\n {\n board.setLocalRotation(Quaternion.IDENTITY);\n board.rotate(-FastMath.HALF_PI, -FastMath.HALF_PI, 0);\n board.setLocalTranslation(0, 0, -3);\n\n cam.setLocation(new Vector3f(0, 0, 10));\n cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);\n }",
"public void keyPressed(KeyEvent evt) {\n Vector3f translate = new Vector3f();\n Vector3f transball = new Vector3f();\n \n plane_trans.get( translate ); \n ball_trans.get( transball ); \n \n if (evt.getKeyChar()=='a') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(Math.PI/36.0d);\n plane_trans.mul(rotate);\n \n //transball.x += 0.4f;\n \n \n \n }\n if (evt.getKeyChar()=='d') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n //transball.x -= 0.3f;\n }\n \n /*if (evt.getKeyChar()=='s') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y += 0.5f;\n }*/\n \n /*if (evt.getKeyChar()=='w') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y -= 0.4f;\n \n }*/\n \n if (evt.getKeyChar()=='i') {\n //transball.x = 0.0f;\n //transball.y = -3.00f;\n //transball.z = 0.3f;\n plane_trans.set(new Vector3f(0.0f, 1.5f, 9985.0f));\n \n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/3.0d);\n plane_trans.mul(rotate);\n }\n \n if(evt.getKeyChar()=='l'){\n stime = 2000;\n movement();\n \n \n }\n \n // (-5,5) (-5,-4) (5,-4) (5,5)\n // x varies from -5 to 5\n // y varies from 5 to -4\n \n /*if(transball.x< -5 || transball.x>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }\n if(transball.y < -4 || transball.y>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }*/\n \n \n //ball_trans.setTranslation( transball );\n //ballTG.setTransform(ball_trans);\n \n plane_trans.setTranslation( translate );\n planeTG.setTransform(plane_trans);\n \n // make a rectangle and usse its four coordinates to check where the ball is in the area or outside\n // resetball();\n \n \n \n }",
"private static void norm2JS() {\n\n // Drive\n axLeftX.setAxis(leftJoystick, 0); //Mecanum (Arcade) Left/Right turn\n axLeftY.setAxis(leftJoystick, 1); //Mecanum (Arcade) Fwd/Bkwd\n axRightX.setAxis(rightJoystick, 0); //Mecanum Rotate orientation\n axRightY.setAxis(rightJoystick, 1); //unassigned\n\n btnGyroReset.setButton(rightJoystick, 6); // reset gyro to 0\n\n btnHoldLeft.setButton(rightJoystick, 4); //??\n btnHoldCenter.setButton(rightJoystick,3); //??\n btnHoldRight.setButton(rightJoystick, 5); //??\n \n // Gear\n btnPickupGear.setButton(leftJoystick, 2); // Pickup gear off floor\n btnPlaceGear.setButton( leftJoystick, 5); // Place gear on ship peg\n \n // Shooter\n btnShooter.setButton( leftJoystick, 1); // Start shooter then feeder(s)\n btnAgitator.setButton(leftJoystick, 3); // Agitate the ball bin\n \n // Climb\n btnClimber.setButton(leftJoystick, 8); // Climber rotating\n\n }",
"public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"void setTransforms(Transforms transforms);",
"public void transform(Vector3D V) {\r\n\t\tVector3D rv = new Vector3D();\r\n\t\trv.x = V.x * M11 + V.y * M21 + V.z * M31 + V.w * M41;\r\n\t\trv.y = V.x * M12 + V.y * M22 + V.z * M32 + V.w * M42;\r\n\t\trv.z = V.x * M13 + V.y * M23 + V.z * M33 + V.w * M43;\r\n\t\trv.w = V.x * M14 + V.y * M24 + V.z * M34 + V.w * M44;\r\n\t\tV.set(rv);\r\n\t}",
"public Vector3f getTranslationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_translate;\n\t}",
"@Override\n public void updateScene() {\n scene.backgroundColor().setAll(new Color4(224, 237, 246, 255));\n\n if (!object3DConfigured || !sensor.validValue())\n return;\n\n IotSensor.Value value = sensor.getValue();\n object3D.rotation().x = value.getRoll();\n object3D.rotation().y = value.getYaw();\n object3D.rotation().z = value.getPitch();\n }",
"public final native Mat4 translate(double x, double y, double z) /*-{\n return $wnd.mat4.translate(this, [x, y, z]);\n }-*/;",
"public abstract Transformation updateTransform(Rectangle selectionBox);",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"@FXML\n private void move() {\n TranslateTransition transition = new TranslateTransition();\n transition.setNode(move);\n transition.setDuration(Duration.seconds(1.5));\n transition.setFromX(-1000);\n transition.setToX(1000);\n transition.setAutoReverse(true);\n transition.setCycleCount(Timeline.INDEFINITE);\n transition.play();\n }",
"private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }",
"@Override\n public void update(double delta) {\n model.rotateXYZ(0,(1 * 0.001f),0);\n\n float acceleration = 0.1f;\n float cameraSpeed = 1.5f;\n\n // Left - right\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_PRESS)\n speedz+= (speedz < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_RELEASE)\n speedz-= (speedz-acceleration > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_PRESS)\n speedz-= (speedz > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_RELEASE)\n speedz+= (speedz+acceleration < 0) ? acceleration : 0;\n\n // Forward - backward\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_PRESS)\n speedx+= (speedx < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_RELEASE)\n speedx-= (speedx > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_PRESS)\n speedx-= (speedx > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_RELEASE)\n speedx+= (speedx+acceleration < 0) ? acceleration : 0;\n\n // up - down\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_PRESS)\n speedy+= (speedy < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_RELEASE)\n speedy-= (speedy > 0.1) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_PRESS)\n speedy-= (speedy > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_RELEASE)\n speedy+= (speedy < 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_TAB) == GLFW_PRESS) {\n speedz = 0;\n speedx = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_R) == GLFW_PRESS) {\n debugCameraObject.eyePos.x = 0;\n debugCameraObject.eyePos.y = 0;\n debugCameraObject.eyePos.z = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_T) == GLFW_PRESS) {\n showSkybox = !showSkybox;\n }\n\n\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.RIGHT, (float) (speedz * delta));\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.FORWARD, (float) (speedx * delta));\n }",
"public AffineTransform3D() {\r\n\t\tthis.M11 = 1;\r\n\t\tthis.M12 = 0;\r\n\t\tthis.M13 = 0;\r\n\t\tthis.M14 = 0;\r\n\t\tthis.M21 = 0;\r\n\t\tthis.M22 = 1;\r\n\t\tthis.M23 = 0;\r\n\t\tthis.M24 = 0;\r\n\t\tthis.M31 = 0;\r\n\t\tthis.M32 = 0;\r\n\t\tthis.M33 = 1;\r\n\t\tthis.M34 = 0;\r\n\t\tthis.M41 = 0;\r\n\t\tthis.M42 = 0;\r\n\t\tthis.M43 = 0;\r\n\t\tthis.M44 = 1;\r\n\t}",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public void translate( float x, float y, float z )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, z ) );\n\t\tmat.mul( opMat );\n\t}",
"public void handle(ActionEvent ae) {\n angle += 15.0; \n \n rotate.setAngle(angle); \n rotate.setPivotX(btnRotate.getWidth()/2); \n rotate.setPivotY(btnRotate.getHeight()/2); \n }",
"abstract void translate(double x, double y, double z);",
"private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }",
"public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}",
"public void transformChanged(Transform3D transform) {\r\n\t}",
"public void doRender(EntityNinjastar ninjastar, double transX, double transY, double transZ, float param5, float dir){\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n GlStateManager.pushMatrix();\n\n GlStateManager.translate((float) transX, (float) transY, (float) transZ);\n\n //moved\n GlStateManager.enableRescaleNormal();\n float scale = 0.75F;\n GlStateManager.scale(scale, scale, scale);\n\n GlStateManager.rotate(ninjastar.prevRotationYaw + (ninjastar.rotationYaw - ninjastar.prevRotationYaw) * dir - 90.0F, 0.0F, 1.0F, 0.0F);\n GlStateManager.rotate(ninjastar.getRandomTilt(), 1.0F, 0.0F, 0.0F);\n\n //moved\n bindEntityTexture(ninjastar);\n\n Tessellator tessellator = Tessellator.getInstance();\n WorldRenderer worldRenderer = tessellator.getWorldRenderer();\n\n// GlStateManager.enableRescaleNormal();\n\n// float scale = 0.05F;\n// GlStateManager.scale(scale, scale, scale);\n\n GL11.glNormal3f(0.0F, 0.0F, scale);\n\n worldRenderer.startDrawingQuads();\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 0, 0);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 1, 0);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 1, 1);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 0, 1);\n tessellator.draw();\n\n GlStateManager.rotate(100.0F, 1.0F, 0.0F, 0.0F);\n worldRenderer.startDrawingQuads();\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 0, 0);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 1, 0);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 1, 1);\n worldRenderer.addVertexWithUV(-2.0D, -2.0D, 0.0D, 0, 1);\n tessellator.draw();\n\n //added\n this.renderItemNinjastar.renderItemModel(this.func_177082_d(ninjastar));\n\n GlStateManager.disableRescaleNormal();\n GlStateManager.popMatrix();\n\n super.doRender(ninjastar, transX, transY, transZ, param5, dir);\n\n }",
"private void positionTableInScene()\n\t{\n\t\tMatrix.setIdentityM(mModelMatrix, 0);\n\t\tMatrix.rotateM(mModelMatrix, 0, -90f, 1f, 0f, 0f);\n\t\tMatrix.multiplyMM(mModelViewProjectionMatrix, 0, mViewProjectionMatrix, 0, mModelMatrix, 0);\n\t}",
"private void translate(final double w, final double h, final double z) {\n mesh.setTranslation(0, w / 2, h / 2 + z);\n }",
"public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}",
"public Matrix4f getTranslationMat() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_translateMat;\n\t}",
"public abstract Vector4fc rotateAbout(float angle, float x, float y, float z);",
"public void setX() {\n m_frontLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n m_frontRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n }",
"public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }",
"public void setTransform(int jointIndex, int index, float value) {\r\n\t\tswitch(index) {\r\n\t\tcase 0: this.translations[jointIndex].x = value; break;\r\n\t\tcase 1: this.translations[jointIndex].y = value; break;\r\n\t\tcase 2: this.translations[jointIndex].z = value; break;\r\n\t\tcase 3: this.orientations[jointIndex].x = value; break;\r\n\t\tcase 4: this.orientations[jointIndex].y = value; break;\r\n\t\tcase 5:\r\n\t\t\tthis.orientations[jointIndex].z = value;\r\n\t\t\tthis.processOrientation(this.orientations[jointIndex]);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"@Override\n public void start(Stage primaryStage) throws Exception {\n PerspectiveCamera camera = new PerspectiveCamera(true);\n camera.setTranslateZ(-10000);\n camera.setNearClip(0.1);\n camera.setFarClip(100000.0);\n\n //Creates group that holds sphere\n Group group = new Group();\n //Create subscene that holds group\n SubScene world = new SubScene(group, 3.0 * WIDTH / 4.0, HEIGHT, true, SceneAntialiasing.DISABLED);\n\n //Container for controls\n VBox controls = new VBox(10);\n controls.setAlignment(Pos.TOP_CENTER);\n controls.setPadding(new Insets(10, 0, 0, 0));\n\n //Slider that changes G value\n Label gLabel = new Label(\"Gravitational Constant\");\n Slider gConstant = new Slider(.001, 100000, 6.67408 * Math.pow(10, 2));\n gConstant.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n VectorUpdater.G = newValue.doubleValue();\n }\n });\n\n //Slider that changes simulation speed\n Label timeLabel = new Label(\"Simulation Speed\");\n Slider timeConstant = new Slider(0, 10, 0);\n timeConstant.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n delay = newValue.longValue();\n }\n });\n\n //Slider the controls zoom\n Label zoomLabel = new Label(\"Zoom\");\n Slider zoom = new Slider(-50000, 10000, -10000);\n zoom.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n camera.setTranslateZ(newValue.doubleValue());\n }\n });\n\n //All control text fields\n TextField massField = new TextField(\"Mass\");\n TextField radiusField = new TextField(\"Radius\");\n TextField x = new TextField(\"X Coordinate\");\n TextField y = new TextField(\"Y Coordinate\");\n TextField z = new TextField(\"Z Coordinate\");\n TextField vx = new TextField(\"X Velocity\");\n TextField vy = new TextField(\"Y Velocity\");\n TextField vz = new TextField(\"Z Velocity\");\n Label pad = new Label();\n pad.setPrefHeight(40);\n\n //Control buttons\n Button addSphere = new Button(\"Add Sphere\");\n HBox buttons = new HBox(5);\n Button toggle = new Button(\"Start\");\n Button clear = new Button(\"Clear\");\n buttons.setAlignment(Pos.CENTER);\n buttons.getChildren().addAll(toggle, clear);\n\n //Adds items to control menu\n controls.getChildren().addAll(massField, radiusField, x, y, z, vx, vy, vz, addSphere, pad, gLabel, gConstant, timeLabel,\n timeConstant, zoomLabel, zoom, buttons);\n\n //Animates program\n AnimationTimer timer = new AnimationTimer() {\n long time = System.nanoTime();\n\n @Override\n public void handle(long now) {\n if ((now - time) * Math.pow(10, -7) > delay) {\n VectorUpdater.updateVectors(spheres, 0.017);\n for (PhysicalSphere sphere : spheres) {\n double dx = sphere.getVelocityVector().getX() * 0.017;\n double dy = sphere.getVelocityVector().getY() * 0.017;\n double dz = sphere.getVelocityVector().getZ() * 0.017;\n sphere.setTranslateX(sphere.getTranslateX() + dx);\n sphere.setTranslateY(sphere.getTranslateY() + dy);\n sphere.setTranslateZ(sphere.getTranslateZ() + dz);\n }\n time = now;\n }\n }\n };\n\n\n addSphere.setOnAction(event -> {\n //Checks all text fields and formats ones that are not numbers\n for (Node field : controls.getChildren()) {\n if (field instanceof TextField) {\n try {\n Double.parseDouble(((TextField) field).getText());\n } catch (Exception e) {\n ((TextField) field).setText(\"0\");\n }\n }\n }\n //Velocity vector\n Point3D velocity = new Point3D(Double.parseDouble(vx.getText()), Double.parseDouble(vy.getText()),\n Double.parseDouble(vz.getText()));\n double mass = Double.parseDouble(massField.getText());\n double radius = Double.parseDouble(radiusField.getText());\n if(mass == 0)\n mass = 500;\n if(radius == 0)\n radius = 500;\n PhysicalSphere sphere = new PhysicalSphere(radius, mass, velocity);\n group.getChildren().add(sphere);\n sphere.setTranslateX(Double.parseDouble(x.getText()));\n sphere.setTranslateY(Double.parseDouble(y.getText()));\n sphere.setTranslateZ(Double.parseDouble(z.getText()));\n spheres.add(sphere);\n massField.setText(\"Mass\");\n radiusField.setText(\"Radius\");\n vx.setText(\"X Velocity\");\n vy.setText(\"Y Velocity\");\n vz.setText(\"Z Velocity\");\n x.setText(\"X Coordinate\");\n y.setText(\"Y Coordinate\");\n z.setText(\"Z Coordinate\");\n });\n\n //Clears spheres\n clear.setOnAction(event -> {\n group.getChildren().clear();\n spheres.clear();\n });\n\n //Toggles timer\n toggle.setOnAction(event -> {\n if (toggle.getText().equals(\"Start\")) {\n timer.start();\n toggle.setText(\"Stop\");\n } else {\n timer.stop();\n toggle.setText(\"Start\");\n }\n });\n\n //Gets anchor\n world.setOnMousePressed(event -> {\n anchorX = event.getSceneX();\n anchorY = event.getSceneY();\n });\n\n //Adds drag amount to anchor\n world.setOnMouseDragged(event -> {\n camera.setTranslateX(cameraX + (anchorX - event.getSceneX()) * 10);\n camera.setTranslateY(cameraY + (anchorY - event.getSceneY()) * 10);\n });\n\n //Logs new camera location\n world.setOnMouseReleased(event -> {\n cameraX = camera.getTranslateX();\n cameraY = camera.getTranslateY();\n });\n\n //Create border layout\n BorderPane layout = new BorderPane();\n layout.setPadding(new Insets(0, 10, 0, 10));\n layout.setCenter(world);\n layout.setRight(controls);\n\n //Create main scene and add layout\n Scene scene = new Scene(layout, WIDTH, HEIGHT, true);\n world.setFill(Color.LIGHTSTEELBLUE);\n world.setCamera(camera);\n\n //Make the main stage\n primaryStage.setTitle(\"3D Physics Simulation\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }",
"private void pointCameraAt(Point3D target,Group root){\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()-xOffset);\n node.setTranslateY(node.getTranslateY()-yOffset);\n node.setTranslateZ(node.getTranslateZ()-zOffset);\n }\n\n xOffset = -target.getX(); yOffset = -target.getY(); zOffset = -target.getZ();\n\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()+xOffset);\n node.setTranslateY(node.getTranslateY()+yOffset);\n node.setTranslateZ(node.getTranslateZ()+zOffset);\n }\n }",
"protected void build_transforms()\n {\n goniometer_rotation = tof_calc.makeEulerRotation( phi, chi, -omega );\n\n goniometer_rotation_inverse = \n tof_calc.makeEulerRotationInverse( phi, chi, -omega );\n }",
"private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }",
"@FXML\n void zInPressed(ActionEvent event) {\n\t\tcanvas.setScaleX(canvas.getScaleX()*1.1);\n\t\tcanvas.setScaleY(canvas.getScaleY()*1.1);\n }",
"private void positionTableInScene() {\n setIdentityM(modelMatrix, 0);\n rotateM(modelMatrix, 0, -90f, 1f, 0f, 0f);\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix,\n 0, modelMatrix, 0);\n }",
"public Vector3f getTranslationVec(int xform) {\n\t\treturn m_xforms[xform].m_translate;\n\t}",
"private void adjustEViewPosition() {\n double aVec[] = theRocket.getCoordSys().getPositionVec();\n CoordSys eViewSys = new CoordSys();\n eViewSys.setZAxis(VMath.normalize(aVec));\n\n aVec = VMath.vecMultByScalar(aVec, 2.5);\n eViewSys.setPositionAsVec(aVec);\n\n double[] zAxis = VMath.normalize(eViewSys.zAxis().getVectorForm());\n double[] yAxis = VMath.normalize(theRocket.getCoordSys().yAxis().getVectorForm());\n double[] xAxis = VMath.normalize(VMath.crossprd(yAxis, zAxis));\n yAxis = VMath.crossprd(zAxis, xAxis);\n eViewSys.setXAxis(xAxis);\n eViewSys.setYAxis(yAxis);\n eViewSys.setZAxis(zAxis);\n\n eViewSys.xRotate(180);\n eViewSys.zRotate(-90);\n eView.setViewingCoordSys(eViewSys);\n }",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public void mygluLookAt(\n double eX, double eY, double eZ,\n double cX, double cY, double cZ,\n double upX, double upY, double upZ) {\n\n double[] F = new double[3];\n double[] UP = new double[3];\n double[] s = new double[3];\n double[] u = new double[3];\n\n F[0] = cX-eX;\n F[1] = cY-eY;\n F[2] = cZ-eZ;\n UP[0] = upX;\n UP[1] = upY;\n UP[2] = upZ;\n normalize(F);\n normalize(UP);\n crossProd(F, UP, s);\n crossProd(s, F, u);\n\n double[] M = new double[16];\n\n // Switching to row-major order\n M[0] = s[0];\n M[4] = u[0];\n M[8] = -F[0];\n M[12] = 0;\n M[1] = s[1];\n M[5] = u[1];\n M[9] = -F[1];\n M[13] = 0;\n M[2] = s[2];\n M[6] = u[2];\n M[10] = -F[2];\n M[14] = 0;\n M[3] = 0;\n M[7] = 0;\n M[11] = 0;\n M[15] = 1;\n\n projection.multiply(M);\n projection.translate((float)-eX, (float)-eY, (float)-eZ);\n }",
"public void setTranslation(float x, float y,float z) {\n\t\tm_xforms[NvCameraXformType.MAIN].m_translate.set(x, y, z);\n\t}",
"public IKQuadrupedModel() {\n\t\t/*\n\t\ttextureWidth = 16;\n\t\ttextureHeight = 16;\n\n\t\tbase = new ModelRenderer(this);\n\t\tbase.setRotationPoint(0.0F, 4.6F, 0.0F);\n\t\tbase.setTextureOffset(0, 0).addBox(-4.5F, -4.6F, -4.5F, 9.0F, 24.0F, 9.0F, 0.0F, false);\n\n\t\tnorth = new IKModelRenderer(this);\n\t\tnorth.setRotationPoint(0.0F, 0.4F, -4.5F);\n\t\tbase.addChild(north);\n\t\tnorth.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tnorth2 = new IKModelRenderer(this);\n\t\tnorth2.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\tnorth.addChild(north2);\n\t\tnorth2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tnorth3 = new IKModelRenderer(this,0,0,-13);\n\t\tnorth3.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\tnorth2.addChild(north3);\n\t\tnorth3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth = new IKModelRenderer(this);\n\t\tsouth.setRotationPoint(0.0F, 0.4F, 4.5F);\n\t\tbase.addChild(south);\n\t\tsouth.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth2 = new IKModelRenderer(this);\n\t\tsouth2.setRotationPoint(0.0F, 0.0F, 12.5F);\n\t\tsouth.addChild(south2);\n\t\tsouth2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.5F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth3 = new IKModelRenderer(this,0,0,13);\n\t\tsouth3.setRotationPoint(0.0F, 0.0F, 13.5F);\n\t\tsouth2.addChild(south3);\n\t\tsouth3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest = new IKModelRenderer(this);\n\t\twest.setRotationPoint(4.5F, 0.4F, 0.0F);\n\t\tbase.addChild(west);\n\t\t//setRotationAngle(west, 0.0F, -1.5708F, 0.0F);\n\t\twest.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest2 = new IKModelRenderer(this);\n\t\twest2.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\twest.addChild(west2);\n\t\twest2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest3 = new IKModelRenderer(this,0,0,-13);\n\t\twest3.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\twest2.addChild(west3);\n\t\twest3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast = new IKModelRenderer(this);\n\t\teast.setRotationPoint(-4.5F, 0.4F, 0.0F);\n\t\tbase.addChild(east);\n\t\t//setRotationAngle(east, 0.0F, -1.5708F, 0.0F);\n\t\teast.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast2 = new IKModelRenderer(this);\n\t\teast2.setRotationPoint(0.0F, 0.0F, 13.0F);\n\t\teast.addChild(east2);\n\t\teast2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast3 = new IKModelRenderer(this,0,0,13);\n\t\teast3.setRotationPoint(0.0F, 0.0F, 13.0F);\n\t\teast2.addChild(east3);\n\t\teast3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\t\t*/\n\n\t\ttextureWidth = 128;\n\t\ttextureHeight = 128;\n\n\t\tTorso = new ModelRenderer(this);\n\t\tTorso.setRotationPoint(0.0F, 24.0F, 0.0F);\n\t\tTorso.setTextureOffset(0, 0).addBox(-6.0F, -28.0F, -10.0F, 12.0F, 9.0F, 23.0F, 0.0F, false);\n\n\t\tHead = new ModelRenderer(this);\n\t\tHead.setRotationPoint(0.0F, -23.0F, -10.0F);\n\t\tTorso.addChild(Head);\n\t\tHead.setTextureOffset(25, 32).addBox(-4.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(12, 18).addBox(-1.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(10, 14).addBox(2.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(0, 32).addBox(-5.0F, -4.0F, -5.0F, 10.0F, 5.0F, 5.0F, 0.0F, false);\n\n\t\tJaw = new ModelRenderer(this);\n\t\tJaw.setRotationPoint(0.0F, 2.4F, 0.0F);\n\t\tHead.addChild(Jaw);\n\t\tJaw.setTextureOffset(30, 32).addBox(-5.0F, -0.4F, -5.0F, 10.0F, 1.0F, 5.0F, 0.0F, false);\n\n\t\tFRLeg = new IKModelRenderer(this);\n\t\tFRLeg.setRotationPoint(-6.0F, -20.0F, -7.5F);\n\t\tTorso.addChild(FRLeg);\n\t\tsetRotationAngle(FRLeg, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg.setTextureOffset(18, 55).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin = new IKModelRenderer(this);\n\t\tFRShin.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg.addChild(FRShin);\n\t\tsetRotationAngle(FRShin, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin.setTextureOffset(10, 42).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin.addChild(FRFoot);\n\t\tFRFoot.setTextureOffset(57, 0).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg3 = new IKModelRenderer(this);\n\t\tFRLeg3.setRotationPoint(-6.0F, -20.0F, 1.5F);\n\t\tTorso.addChild(FRLeg3);\n\t\tsetRotationAngle(FRLeg3, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg3.setTextureOffset(30, 52).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin3 = new IKModelRenderer(this);\n\t\tFRShin3.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg3.addChild(FRShin3);\n\t\tsetRotationAngle(FRShin3, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin3.setTextureOffset(40, 40).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot3 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot3.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin3.addChild(FRFoot3);\n\t\tFRFoot3.setTextureOffset(50, 44).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg6 = new IKModelRenderer(this);\n\t\tFRLeg6.setRotationPoint(6.0F, -20.0F, 1.5F);\n\t\tTorso.addChild(FRLeg6);\n\t\tsetRotationAngle(FRLeg6, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg6.setTextureOffset(20, 42).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin6 = new IKModelRenderer(this);\n\t\tFRShin6.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg6.addChild(FRShin6);\n\t\tsetRotationAngle(FRShin6, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin6.setTextureOffset(0, 0).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot6 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot6.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin6.addChild(FRFoot6);\n\t\tFRFoot6.setTextureOffset(0, 14).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg4 = new IKModelRenderer(this);\n\t\tFRLeg4.setRotationPoint(-6.0F, -20.0F, 10.5F);\n\t\tTorso.addChild(FRLeg4);\n\t\tsetRotationAngle(FRLeg4, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg4.setTextureOffset(50, 50).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin4 = new IKModelRenderer(this);\n\t\tFRShin4.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg4.addChild(FRShin4);\n\t\tsetRotationAngle(FRShin4, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin4.setTextureOffset(30, 38).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot4 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot4.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin4.addChild(FRFoot4);\n\t\tFRFoot4.setTextureOffset(50, 38).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg5 = new IKModelRenderer(this);\n\t\tFRLeg5.setRotationPoint(6.0F, -20.0F, 10.5F);\n\t\tTorso.addChild(FRLeg5);\n\t\tsetRotationAngle(FRLeg5, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg5.setTextureOffset(47, 0).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin5 = new IKModelRenderer(this);\n\t\tFRShin5.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg5.addChild(FRShin5);\n\t\tsetRotationAngle(FRShin5, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin5.setTextureOffset(10, 0).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot5 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot5.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin5.addChild(FRFoot5);\n\t\tFRFoot5.setTextureOffset(47, 13).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg2 = new IKModelRenderer(this);\n\t\tFRLeg2.setRotationPoint(6.0F, -20.0F, -7.5F);\n\t\tTorso.addChild(FRLeg2);\n\t\tsetRotationAngle(FRLeg2, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg2.setTextureOffset(40, 54).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin2 = new IKModelRenderer(this);\n\t\tFRShin2.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg2.addChild(FRShin2);\n\t\tsetRotationAngle(FRShin2, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin2.setTextureOffset(0, 42).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot2 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot2.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin2.addChild(FRFoot2);\n\t\tFRFoot2.setTextureOffset(0, 56).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\t/*\n textureWidth = 16;\n\t\ttextureHeight = 16;\n\t\tbase = new IKModelRenderer(this);\n\t\tbase.setRotationPoint(0.0F, 24.0F, 0.0F);\n\t\tbase.setTextureOffset(0, 0).addBox(-8.0F, -2.0F, -8.0F, 16.0F, 2.0F, 16.0F, 0.0F, false);\n\t\t\n\t\tarm = new IKModelRenderer(this);\n\t\tarm.setRotationPoint(0.0F, -2.0F, 0.0F);\n\t\tbase.addChild(arm);\n\t\tarm.setTextureOffset(0, 0).addBox(-1.5F, -16.0F, -1.5F, 3.0F, 16.0F, 3.0F, 0.0F, false);\n\t\t\n\t\telbow = new IKModelRenderer(this);\n\t\telbow.setRotationPoint(0.0F, -16.0F, 0.0F);\n\t\tarm.addChild(elbow);\n\t\telbow.setTextureOffset(0, 0).addBox(-1.5F, -16.0F, -1.5F, 3.0F, 16.0F, 3.0F, 0.0F, false);\n\n\t\tforearm = new IKModelRenderer(this,0,27,0);\n\t\tforearm.setRotationPoint(0.0F, -16.0F, 0.0F);\n\t\telbow.addChild(forearm);\n\t\tforearm.setTextureOffset(0, 0).addBox(-1.5F, -23.0F, -1.5F, 3.0F, 23.0F, 3.0F, 0.0F, false);\n\t\tforearm.setTextureOffset(0, 0).addBox(-2.5F, -27.0F, -2.5F, 5.0F, 4.0F, 5.0F, 0.0F, false);\n\t\t*/\n\t}",
"public void updateTransformMatrix(float[] fArr) {\n boolean z;\n float f;\n float f2;\n boolean z2 = true;\n if (!this.mVideoStabilizationCropped || !ModuleManager.isVideoModule()) {\n f2 = 1.0f;\n f = 1.0f;\n z = false;\n } else {\n f2 = MOVIE_SOLID_CROPPED_X * 1.0f;\n f = MOVIE_SOLID_CROPPED_Y * 1.0f;\n z = true;\n }\n if (this.mNeedCropped) {\n f2 *= this.mScaleX;\n f *= this.mScaleY;\n z = true;\n }\n if (this.mDisplayOrientation == 0) {\n z2 = z;\n }\n if (z2) {\n Matrix.translateM(fArr, 0, 0.5f, 0.5f, 0.0f);\n Matrix.rotateM(fArr, 0, (float) this.mDisplayOrientation, 0.0f, 0.0f, 1.0f);\n Matrix.scaleM(fArr, 0, f2, f, 1.0f);\n Matrix.translateM(fArr, 0, -0.5f, -0.5f, 0.0f);\n }\n }",
"private void rotateTransformPoints(double angle) {\n int i;\n for(i=1; i<9;i++) {\n GeoVector vec = new GeoVector(this.transformPointers[i].getX(), this.transformPointers[i].getY(), this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n vec.rotate(((angle*-1.0) * (2.0*Math.PI))/360);\n vec.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.transformPointers[i].translate( (int)(vec.getX() - this.transformPointers[i].getX()), (int)(vec.getY() - this.transformPointers[i].getY()));\n }\n\n }",
"public double update() {\n\t\t double time=System.currentTimeMillis();\n\t\t boolean update=false;\n\t\t \n\t\t// Keyboard handling\n\t\tif (scene.ready) {\n\t\t\tif (command==KeyEvent.VK_D) \n\t\t\t\tcamera.y_rot=camera.y_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_A)\n\t\t\t\tcamera.y_rot=camera.y_rot-0.02;\n\t\t\tif (command==KeyEvent.VK_Q)\n\t\t\t\tcamera.z_rot=camera.z_rot-0.02;\n\t\t\tif (command==KeyEvent.VK_E)\n\t\t\t\tcamera.z_rot=camera.z_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_R)\n\t\t\t\tcamera.x_rot=camera.x_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_F)\n\t\t\t\tcamera.x_rot=camera.x_rot-0.02;\n\n\t\t\tif (command==KeyEvent.VK_W)\n\t\t\t\tcamera.translateWithRespectToView(0,0,250);\n\t\t\tif (command==KeyEvent.VK_S)\n\t\t\t\tcamera.translateWithRespectToView(0,0,-250);\n\t\t\tif (command==KeyEvent.VK_Z)\n\t\t\t\tcamera.translateWithRespectToView(-250,0,0);\n\t\t\tif (command==KeyEvent.VK_X)\n\t\t\t\tcamera.translateWithRespectToView(250,0,0);\n\t\t\tif (command==KeyEvent.VK_T)\n\t\t\t\tcamera.translateWithRespectToView(0,250,0);\n\t\t\tif (command==KeyEvent.VK_G)\n\t\t\t\tcamera.translateWithRespectToView(0,-250,0);\n\n\t\t\tif (command==KeyEvent.VK_J)\n\t\t\t\tvobject[0].rotate(0,-0.01,0);\n\t\t\tif (command==KeyEvent.VK_L)\n\t\t\t\tvobject[0].rotate(0,0.01,0);\n\t\t\tif (command==KeyEvent.VK_I)\n\t\t\t\tvobject[0].rotate(0.01,0.0,0);\n\t\t\tif (command==KeyEvent.VK_K)\n\t\t\t\tvobject[0].rotate(-0.01,0,0);\n\t\t\tif (command==KeyEvent.VK_U)\n\t\t\t\tvobject[0].rotate(0,0.00,-0.01);\n\t\t\tif (command==KeyEvent.VK_O)\n\t\t\t\tvobject[0].rotate(0.0,0,0.01);\n\n\t\t\tif (command==KeyEvent.VK_1) \n\t\t\t{scene.dot_field= !scene.dot_field;}\n\t\t\tif (command==KeyEvent.VK_2)\n\t\t\t{scene.wireframe= !scene.wireframe;}\n\t\t\tif (command==KeyEvent.VK_3)\n\t\t\t{scene.solid_poly= !scene.solid_poly;}\n\t\t\tif (command==KeyEvent.VK_4)\n\t\t\t{scene.hidden_face= !scene.hidden_face;}\n\t\t\tif (command==KeyEvent.VK_5)\n\t\t\t{scene.simple_shaded= !scene.simple_shaded;}\n\t\t\tif (command==KeyEvent.VK_6)\n\t\t\t{scene.z_sorted= !scene.z_sorted;}\n\t\t\tif (command==KeyEvent.VK_7)\n\t\t\t{scene.gouraud_shaded= !scene.gouraud_shaded;}\n\t\t\tif (command==KeyEvent.VK_8)\n\t\t\t{scene.fullstats= !scene.fullstats;}\n\n\t\t\tif (command==KeyEvent.VK_0 && scene.ready)\n\t\t\t{worldgrid.diamondSquare(1,roughness,1); \n\t\t\t}\n\n\t\t\tif (command==KeyEvent.VK_9) \n\t\t\t{scene.surface= !scene.surface;}\n\n\t\t\tif (command==KeyEvent.VK_P && scene.ready) {\n\t\t\t\t//Planet myplanet=new Planet(60);\n\t\t\t\tmyplanet.Iterate(0.1,1,1);\n\t\t\t\t//myplanet.scale(2000);\n\t\t\t\tvobject[0]=myplanet;\n\t\t\t}\n\n\t\t\tcommand=0;\n\t\t}\n\n\t\t// generic\n\n\t\tif (!scene.surface) {\t\n\t\t\tif (!scene.test) {\n\t\t\t\tvobject[0].rotate(0.000,0.002,0.000);\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvobject[0].rotate(0.008,0.005,0.01);\n\t\t\t}\n\t\t}\n\n\n\t\n\t\tif ((first_time) && (scene.surface)) {foreThoughtThread.start(); first_time=false; }\n\t\tupdateLighting();\n\t\treturn tick_time_seconds;\n\t}",
"private void setOrigin() {\n Hep3Vector origin = VecOp.mult(CoordinateTransformations.getMatrix(), _sensor.getGeometry().getPosition());\n // transform to p-side\n Polygon3D psidePlane = this.getPsidePlane();\n Translation3D transformToPside = new Translation3D(VecOp.mult(-1 * psidePlane.getDistance(),\n psidePlane.getNormal()));\n this._org = transformToPside.translated(origin);\n }",
"public Mat4x4 getMatView() {\n Mat4x4 matCameraRotX = MatrixMath.matrixMakeRotationX(cameraRot.getX());\n Mat4x4 matCameraRotY = MatrixMath.matrixMakeRotationY(cameraRot.getY());\n Mat4x4 matCameraRotZ = MatrixMath.matrixMakeRotationZ(cameraRot.getZ());\n Mat4x4 matCameraRotXY = MatrixMath.matrixMultiplyMatrix(matCameraRotX, matCameraRotY);\n Mat4x4 matCameraRot = MatrixMath.matrixMultiplyMatrix(matCameraRotXY, matCameraRotZ);\n matCamera = calculateMatCamera(up, target, matCameraRot);\n matView = MatrixMath.matrixQuickInverse(matCamera);\n return matView;\n }",
"@Override\n public Matrix4 calculateTransform(long now, float deltaSeconds) {\n transform.idt();\n for (final Action action : pressed.values().toArray()) {\n action.perform(deltaSeconds);\n }\n scrollAction.perform();\n return transform;\n }",
"void rotateInv() {\n startAnimation(allSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n rotateCubeSwap();\n rotateCubeSwap();\n rotateCubeSwap();\n }",
"public WorldToScreenTransform getWorldToScreenTransform() { return this; }",
"public BranchGroup cubo1(){\n\t\t\tBranchGroup objRoot = new BranchGroup();\n\n\t TransformGroup objScale = new TransformGroup();\n\t Transform3D t3d = new Transform3D();\n\t Transform3D rotate = new Transform3D();\n Transform3D tempRotate = new Transform3D();\n\t \t rotate.rotX(Math.PI/1.0d);\n tempRotate.rotY(Math.PI/1.80d);\n Matrix3d n = new Matrix3d();\n Vector3d op = new Vector3d(.5,.05,.5);\n tempRotate.setScale(op);\n Vector3d op2 = new Vector3d(-.5,.6,1);\n tempRotate.setTranslation(op2);\n rotate.mul(tempRotate);\n TransformGroup objRotate = new TransformGroup(rotate);\n\n objRoot.addChild(objRotate);\n\t \n t3d.mul(rotate);\n\t objScale.setTransform(t3d);\n\t \n\t objRoot.addChild(objScale);\n\n\tTransformGroup objTrans = new TransformGroup();\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n\t\t\t\t\t\n\t\t\n\t\tobjScale.addChild(objTrans);\n\n\t\tint flags = ObjectFile.RESIZE;\n\t\tif (!noTriangulate) flags |= ObjectFile.TRIANGULATE;\n\t\tif (!noStripify) flags |= ObjectFile.STRIPIFY;\n\t\tObjectFile f = new ObjectFile(flags, \n\t\t (float)(creaseAngle * Math.PI / 180.0));\n\t\tScene s = null;\n\t\ttry {\n\t\t s = f.load(filename);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (ParsingErrorException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (IncorrectFormatException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\t \n\t\tobjTrans.addChild(s.getSceneGroup());\n\t\t\n \n \n\t\tBoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);\n\n\t Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);\n\t Background bgNode = new Background(bgColor);\n\t bgNode.setApplicationBounds(bounds);\n\t objRoot.addChild(bgNode);\n\n\t\treturn objRoot;\n\t\t \n\t }",
"public void draw() {\n background(255);\n pushMatrix();\n translate(width/2,height/2+20,-160);\n rotateX(PI/3);\n rotateZ(theta);\n land.render(); \n popMatrix();\n\n land.calculate();\n \n theta += 0.0025f;\n}",
"private void UpdateTransform()\n\t{\t\n\t\tTransform transform = parent.transform;\n\t\t\n\t\tVector2 friction = Vector2.Scale(-frictionCoefficient,velocity);\n\t\tfloat angularFriction = -frictionCoefficient*angularVelocity;\n\t\t\n\t\t//Newton integration P = P + dP + acceleration * dt^2\n\t\ttransform.position.x += velocity.x + (acceleration.x *deltaTime*deltaTime) + friction.x;\n\t\ttransform.position.y += velocity.y + (acceleration.y *deltaTime*deltaTime) + friction.y;\n\t\ttransform.rotation += angularVelocity + angularAcceleration*deltaTime*deltaTime + angularFriction ;\n\t\t\n\t}",
"public void rotation(){\n\n double x=Double.parseDouble(rotationx.getText());\n double y=Double.parseDouble(rotationy.getText());\n double z=Double.parseDouble(rotationz.getText());\n if (checkbox.isSelected()){\n cls_zahnrad.rotieren(x,y,z);\n return;\n }\n Triangle[] dreiecke = t1.getFlaechen();\n x=2*Math.PI/360*x;\n y=2*Math.PI/360*y;\n z=2*Math.PI/360*z;\n double[] A,B,C;\n\n double pktx=0,pkty=0,pktz=0;\n\n if (radio12.isSelected()){\n pktx = Double.parseDouble(rotationpktx.getText());\n pkty = Double.parseDouble(rotationpkty.getText());\n pktz = Double.parseDouble(rotationpktz.getText());\n }\n\n for (Triangle i :dreiecke){\n for (int j=0; j<3;j++){\n double xtemp,ytemp,ztemp;\n xtemp=i.getTriangle()[j].getPoint()[0]-pktx;\n ytemp=i.getTriangle()[j].getPoint()[1]-pkty;\n ztemp=i.getTriangle()[j].getPoint()[2]-pktz;\n i.getTriangle()[j].setPoint(xtemp,ytemp,ztemp);\n }\n }\n\n for (Triangle t1 : dreiecke){\n A=t1.getTriangle()[0].getPoint();\n B=t1.getTriangle()[1].getPoint();\n C=t1.getTriangle()[2].getPoint();\n double[][]punkte={A,B,C};\n\n for (int i=0; i<punkte.length; i++){\n double temp0,temp1,temp2;\n\n //Rotation um Parallele der X-Achse durch das Rotationszentrum\n if (x!=0){\n temp1=punkte[i][1]*Math.cos(x)-punkte[i][2]*Math.sin(x);\n temp2=punkte[i][1]*Math.sin(x)+punkte[i][2]*Math.cos(x);\n punkte[i][1]=temp1;\n punkte[i][2]=temp2;\n }\n\n //Rotation um Parallele der Y-Achse durch das Rotationszentrum\n if (y!=0){\n temp0=punkte[i][0]*Math.cos(y)+punkte[i][2]*Math.sin(y);\n temp2=-punkte[i][0]*Math.sin(y)+punkte[i][2]*Math.cos(y);\n punkte[i][0]=temp0;\n punkte[i][2]=temp2;\n }\n\n //Rotation um Parallele der Z-Achse durch das Rotationszentrum\n if (z!=0){\n temp0=punkte[i][0]*Math.cos(z)-punkte[i][1]*Math.sin(z);\n temp1=punkte[i][0]*Math.sin(z)+punkte[i][1]*Math.cos(z);\n punkte[i][0]=temp0;\n punkte[i][1]=temp1;\n }\n }\n A=punkte[0];\n B=punkte[1];\n C=punkte[2];\n t1.getTriangle()[0].setPoint(A[0],A[1],A[2]);\n t1.getTriangle()[1].setPoint(B[0],B[1],B[2]);\n t1.getTriangle()[2].setPoint(C[0],C[1],C[2]);\n }\n for (Triangle i :dreiecke){\n for (int j=0; j<3;j++){\n double xtemp,ytemp,ztemp;\n xtemp=i.getTriangle()[j].getPoint()[0]+pktx;\n ytemp=i.getTriangle()[j].getPoint()[1]+pkty;\n ztemp=i.getTriangle()[j].getPoint()[2]+pktz;\n i.getTriangle()[j].setPoint(xtemp,ytemp,ztemp);\n }\n }\n redraw();\n /*\n System.out.println(\"A \"+Arrays.toString(t1.getTetraeder()[0].getPoint()));\n System.out.println(\"B \"+Arrays.toString(t1.getTetraeder()[1].getPoint()));\n System.out.println(\"C \"+Arrays.toString(t1.getTetraeder()[2].getPoint()));\n System.out.println(\"D \"+Arrays.toString(t1.getTetraeder()[3].getPoint()));\n System.out.println(Arrays.toString(Mittelpunkt));\n */\n }",
"public void translate(float x, float y, float z) {\n Matrix.translateM(mModelMatrix, 0, x, y, z);\n }",
"public void displayTranslated(float x, float y, float angleDegrees) {\n /*\n pushMatrix();\n translate(x, y);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n popMatrix();\n shape(fullCar);\n */\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n shape(fullCar);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n }",
"private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }",
"public Matrix4 getTransformMatrix() {\n return transformMatrix;\n }",
"public Matrix4f getWorldMatrix() {\n\n\t\t// First identity\n\t\tmTranformation.identity();\n\n\t\t// Translate\n\t\tmTranformation.translate(position);\n\n\t\t// Rotate object at the center of the texture\n\t\tfloat x = 0.5f * mWidth;\n\t\tfloat y = 0.5f * mHeight;\n\n\t\t// Do rotating\n\t\tmTranformation.translate(new Vector3f(x, y, 0));\n\t\tmTranformation.rotateZ((float) Math.toRadians(rotation.z));\n\t\tmTranformation.translate(new Vector3f(-x, -y, 0));\n\n\t\t// mTranformation.scale(scale, scale, 1);\n\t\tmTranformation.scaleAround(scale, x, y, 0);\n\n\t\treturn mTranformation;\n\t}",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"public BranchGroup cubo3(){\n\t\t\tBranchGroup objRoot = new BranchGroup();\n\n\n\t TransformGroup objScale = new TransformGroup();\n\t Transform3D t3d = new Transform3D();\n\n\t Transform3D rotate = new Transform3D();\n Transform3D tempRotate = new Transform3D();\n\t \t rotate.rotX(Math.PI/1.0d);\n tempRotate.rotY(Math.PI/1.80d);\n Matrix3d n = new Matrix3d();\n Vector3d op = new Vector3d(.01,1,1);\n tempRotate.setScale(op);\n Vector3d op2 = new Vector3d(-.01,-.5,2);\n tempRotate.setTranslation(op2);\n rotate.mul(tempRotate);\n // rotate.mul(objScale);\n TransformGroup objRotate = new TransformGroup(rotate);\n \n //objRotate.addChild(new ColorCube(0.4));\n objRoot.addChild(objRotate);\n\t \n t3d.mul(rotate);\n\t objScale.setTransform(t3d);\n\t \n\t objRoot.addChild(objScale);\n\n\tTransformGroup objTrans = new TransformGroup();\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n\t\t\t\t\t\n\t\t\n\t\tobjScale.addChild(objTrans);\n\n\t\tint flags = ObjectFile.RESIZE;\n\t\tif (!noTriangulate) flags |= ObjectFile.TRIANGULATE;\n\t\tif (!noStripify) flags |= ObjectFile.STRIPIFY;\n\t\tObjectFile f = new ObjectFile(flags, \n\t\t (float)(creaseAngle * Math.PI / 180.0));\n\t\tScene s = null;\n\t\ttry {\n\t\t s = f.load(filename);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (ParsingErrorException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (IncorrectFormatException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\t \n\t\tobjTrans.addChild(s.getSceneGroup());\n\t\t\n \n\n\t\tBoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);\n\n\n\t \n\t // Set up the background\n\t Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);\n\t Background bgNode = new Background(bgColor);\n\t bgNode.setApplicationBounds(bounds);\n\t objRoot.addChild(bgNode);\n\n\t\treturn objRoot;\n\t\t \n\t }",
"public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}",
"void setRotation (DMatrix3C R);",
"private void updateLabels(ArSceneView sceneView,Node node)\n {\n\n Vector3 camera = sceneView.getScene().getCamera().getWorldPosition();\n Vector3 uiPosition = node.getWorldPosition();\n Vector3 direction = Vector3.subtract(camera, uiPosition);\n Quaternion lookRotation = Quaternion.lookRotation(direction, Vector3.up());\n node.setLocalPosition(new Vector3(0,0.02f,0));\n node.setWorldRotation(lookRotation);\n }",
"private void applyTransforms(Painter painter) {\r\n\r\n\t\t//Define and apply transforms\r\n\t\tTransform \r\n\t\t\tat = p.transformAt(atX, atY),\r\n\t\t\tturn = p.transformTurn(toRadians(atAngle), 0, 0);\r\n\t\tp.applyTransforms(new Transform[]{at, turn}, false, new Painter[]{painter});\r\n\t}",
"public void setTransform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"setTransform\");\r\n\t}"
] | [
"0.6410406",
"0.6276188",
"0.6275169",
"0.62646776",
"0.62593555",
"0.5789711",
"0.57264364",
"0.57046306",
"0.5692931",
"0.56905836",
"0.5677321",
"0.56234276",
"0.5608493",
"0.55819464",
"0.5570441",
"0.5565043",
"0.5550907",
"0.55487394",
"0.552021",
"0.551757",
"0.55077136",
"0.5503988",
"0.5494982",
"0.54921687",
"0.5490203",
"0.54893214",
"0.54863495",
"0.5481437",
"0.5477392",
"0.54590774",
"0.54526514",
"0.5449",
"0.54407936",
"0.5437175",
"0.5425555",
"0.5404231",
"0.5371474",
"0.53438675",
"0.53422564",
"0.5338747",
"0.5336291",
"0.5326595",
"0.53262424",
"0.5313727",
"0.53125083",
"0.53026193",
"0.5299499",
"0.5294874",
"0.5279425",
"0.5267375",
"0.52652806",
"0.52613276",
"0.52556556",
"0.52471083",
"0.52443266",
"0.5243159",
"0.52381885",
"0.5238025",
"0.52337915",
"0.5228309",
"0.5226001",
"0.5223877",
"0.52234924",
"0.5215598",
"0.5211768",
"0.52086395",
"0.5204572",
"0.5189813",
"0.5185202",
"0.5164999",
"0.5162735",
"0.5161731",
"0.51590294",
"0.5152765",
"0.5147436",
"0.51205456",
"0.5118652",
"0.51160496",
"0.5097648",
"0.5096831",
"0.5092548",
"0.5081786",
"0.50634193",
"0.50547117",
"0.50486267",
"0.5048461",
"0.50355613",
"0.5035433",
"0.5028954",
"0.5026908",
"0.5024063",
"0.5016822",
"0.5010488",
"0.49982393",
"0.49896398",
"0.4984458",
"0.49811974",
"0.49773154",
"0.49718076",
"0.4959318"
] | 0.62955576 | 1 |
Define materials and lights | private void materialSetup(GL gl)
{
float white[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float black[] = { 0.0f, 0.0f, 0.0f, 1.0f };
float dim[] = { 0.1f, 0.1f, 0.1f, 1.0f };
// Set up material and light
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, dim, 0);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, white, 0);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, dim, 0);
gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 5);
// Set light color
gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, dim, 0);
gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, white, 0);
gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, black, 0);
// Turn on light and lighting
gl.glEnable(GL.GL_LIGHT0);
gl.glEnable(GL.GL_LIGHTING);
// Allow glColor() to affect current diffuse material
gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE);
gl.glEnable(GL.GL_COLOR_MATERIAL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initMaterials()\r\n {\r\n get_availableMaterials().add(\r\n new Material( \"Wood\", EnvSettings.WOOD_COLOR, EnvSettings.WOOD_SPECIFIC_HEAT,\r\n EnvSettings.WOOD_TRANSPARENCY, EnvSettings.WOOD_THERMAL_CONDUCTIVITY,\r\n EnvSettings.WOOD_FLAME_POINT, EnvSettings.WOOD_DURABILITY, true, EnvSettings.WOOD_SMOKE_CAPACITY ) );\r\n get_availableMaterials().add(\r\n new Material( \"Air\", Scene3D.setBlue( _worldInitTemp ), EnvSettings.AIR_SPECIFIC_HEAT,\r\n EnvSettings.AIR_TRANSPARENCY, EnvSettings.AIR_THERMAL_CONDUCTIVITY,\r\n EnvSettings.VAPOR_FLAME_POINT, (int)( EnvSettings.INFINITIVE ), false , EnvSettings.AIR_SMOKE_CAPACITY) );\r\n get_availableMaterials().add(\r\n new Material( \"Metal\", EnvSettings.METAL_COLOR, EnvSettings.METAL_SPECIFIC_HEAT,\r\n EnvSettings.METAL_TRANSPARENCY, EnvSettings.METAL_THERMAL_CONDUCTIVITY,\r\n EnvSettings.INFINITIVE, (int)( EnvSettings.INFINITIVE ), false, EnvSettings.METAL_SMOKE_CAPACITY ) );\r\n }",
"private void configureMaterials() {\n quadMaterial = new Material(assetManager,\n \"Common/MatDefs/Misc/Unshaded.j3md\");\n quadMaterial.setColor(\"Color\", ColorRGBA.Green.clone());\n RenderState ars = quadMaterial.getAdditionalRenderState();\n ars.setWireframe(true);\n }",
"void setupLights() {\n\n lightGroup = new Group();\n\n // Set up the ambient light\n lightAmbient = new AmbientLight(darkGrey);\n lightAmbient.setInfluencingBounds(infiniteBounds);\n lightAmbient.setCapability(Light.ALLOW_STATE_WRITE);\n lightAmbient.setEnable(true);\n lightGroup.addChild(lightAmbient);\n\n // Set up the directional light\n Vector3f lightDirection = new Vector3f(0.65f, -0.65f, -0.40f);\n lightDirectional = new DirectionalLight(white, lightDirection);\n lightDirectional.setInfluencingBounds(infiniteBounds);\n lightDirectional.setEnable(true);\n lightDirectional.setCapability(Light.ALLOW_STATE_WRITE);\n lightGroup.addChild(lightDirectional);\n\n // Set up the point light\n Point3f lightPosition = new Point3f(-1.0f, 1.0f, 0.6f);\n lightPoint = new PointLight(white, lightPosition, attenuation);\n lightPoint.setInfluencingBounds(infiniteBounds);\n lightPoint.setEnable(false);\n lightPoint.setCapability(Light.ALLOW_STATE_WRITE);\n lightPoint.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightGroup.addChild(lightPoint);\n\n // Set up the spot light\n // Point the light back at the origin\n lightSpot = new SpotLight(white, lightPosition, attenuation,\n lightDirection, (float) Math.toRadians(spotSpreadAngle),\n spotConcentration);\n lightSpot.setInfluencingBounds(infiniteBounds);\n lightSpot.setEnable(false);\n lightSpot.setCapability(Light.ALLOW_STATE_WRITE);\n lightSpot.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_CONCENTRATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_SPREAD_ANGLE_WRITE);\n lightGroup.addChild(lightSpot);\n }",
"public void setMaterial(Material mat)\r\n\t{\r\n\t\tgl.glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat.ambient);\r\n\t\tgl.glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat.diffuse);\r\n\t\tgl.glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat.specular);\r\n\t\tgl.glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.8F);\r\n\t\tgl.glColor3f(mat.diffuse[0],mat.diffuse[1],mat.diffuse[2]);\r\n\t}",
"private void addLights() {\n \t\tLight light = new DirectionalLight(\n \t\t\t\tnew Color3f(1f, 1f, 1f), new Vector3f(-1f, -1f, -1f));\n \t\t\n \t\tlight.setInfluencingBounds(\n \t\t\t\tnew BoundingSphere(new Point3d(0, 0, 0), 10));\n \t\t\n \t\tmyScene.addChild(light);\n \t\t\n \t\tlight = new DirectionalLight(\n \t\t\t\tnew Color3f(0.3f, 0.1f, 0.1f), new Vector3f(1f, 0f, 0f));\n \t\t\n \t\tlight.setInfluencingBounds(\n \t\t\t\tnew BoundingSphere(new Point3d(0, 0, 0), 10));\n \t\t\n \t\tmyScene.addChild(light);\n \t}",
"private void initLighting() {\n\t\t\n\t\t\n\t\tfloat lmodel_ambient[] = { 1f, 1f, 1f, 1.0f };\n\t\t// Hintergrundbeleuchtung definieren\n\t\tglLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);\n\n\t\t// Eine weitere Lichtquellen definieren\n\t\t\n\t\tglEnable(GL_LIGHTING);\n\n\t\tspotLight.turnLightOn();\n\t\tpointLight.turnLightOn();\n\t}",
"public void setLight1(){\n }",
"private void setUp9SpheresScene() {\n camera = new Camera(\n new Point3D(0, 0, 9),\n new Point3D(0,0,0),\n new Point3D(0,1,0),\n Math.PI * 0.5, width, height\n );\n camera.moveForward(1.0);\n\n exposure = 1.0;\n ambientLight = new LightIntensity();\n ambientLight.red = 0.2;\n ambientLight.green = 0.2;\n ambientLight.blue = 0.2;\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.7, .7, .7),\n new RectFace(\n new Point3D(-1.1, 9.99, -5.0),\n new Point3D(1.1, 9.99, -5.0),\n new Point3D(-1.1, 9.99, -6.0)\n )\n ));\n\n Material reflective = new Material();\n reflective.diffuseReflectivity.red = 0.2;\n reflective.diffuseReflectivity.green = 0.2;\n reflective.diffuseReflectivity.blue = 0.2;\n reflective.directReflectivity = LightIntensity.makeUniformRGB(0.5);\n\n Material glass = new Material();\n glass.diffuseReflectivity.red = 0.0;\n glass.diffuseReflectivity.green = 0.0;\n glass.diffuseReflectivity.blue = 0.0;\n glass.passthroughIntensity.red = 0.9;\n glass.passthroughIntensity.green = 0.9;\n glass.passthroughIntensity.blue = 0.9;\n glass.directReflectivity = LightIntensity.makeUniformRGB(0.1);\n glass.refractionIndex = 1.33;\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,0), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,2), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,4), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,0), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,2), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,4), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,0), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,2), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,4), 1), reflective));\n\n Box boundingBox = new Box(\n new Point3D(-10,10, 10),\n new Point3D(-10,10, -10),\n new Point3D(10,10, 10),\n new Point3D(-10,-10, 10)\n );\n\n Material leftWallMaterial = new Material();\n leftWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, 0.3);\n leftWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material rightWallMaterial = new Material();\n rightWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, .7);\n rightWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material frontWallMaterial = new Material();\n frontWallMaterial.diffuseReflectivity = new LightIntensity(0.3,0.3, 0.3);\n frontWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material backWallMaterial = new Material();\n backWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, 0.3);\n backWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material topWallMaterial = new Material();\n topWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n topWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material bottomWallMaterial = new Material();\n bottomWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n bottomWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n try {\n bottomWallMaterial.texture = ImageIO.read(new File(\"C:\\\\Class_work\\\\checkerboard.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n solids.add(new RectFace.FaceSolid(boundingBox.left, leftWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.right, rightWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.front, frontWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.back, backWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.top, topWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.bottom, bottomWallMaterial));\n }",
"@Override\n protected void createMesh() {\n rayLight.getScope().add(camera);\n\n light = new PointLight(Color.GAINSBORO);\n light.setTranslateX(-300);\n light.setTranslateY(300);\n light.setTranslateZ(-2000);\n\n light2 = new PointLight(Color.ALICEBLUE);\n light2.setTranslateX(300);\n light2.setTranslateY(-300);\n light2.setTranslateZ(2000);\n\n light3 = new PointLight(Color.SPRINGGREEN);\n light3.setTranslateY(-2000);\n //create a target\n target1 = new Sphere(180);\n target1.setId(\"t1\");\n target1.setDrawMode(DrawMode.LINE);\n target1.setCullFace(CullFace.NONE);\n target1.setTranslateX(500);\n target1.setTranslateY(500);\n target1.setTranslateZ(500);\n target1.setMaterial(red);\n // create another target\n target2 = new Sphere(150);\n target2.setId(\"t2\");\n target2.setDrawMode(DrawMode.LINE);\n target2.setCullFace(CullFace.NONE);\n target2.setTranslateX(-500);\n target2.setTranslateY(-500);\n target2.setTranslateZ(-500);\n target2.setMaterial(blue);\n\n origin = new Box(20, 20, 20);\n origin.setDrawMode(DrawMode.LINE);\n origin.setCullFace(CullFace.NONE);\n \n model = new Group(target1, target2, origin, light, light2, light3, rayLight);\n }",
"public void setMaterials(List<Material> materials)\n {\n this.materials = materials;\n }",
"public void setLighting(GL3 gl) {\n\t\t // Set the lighting properties\n\t\t\n\t\t// get sunlight vector coords\n\t\tfloat xSun = terrain.getSunlight().getX();\n\t\tfloat ySun = terrain.getSunlight().getY();\n\t\tfloat zSun = terrain.getSunlight().getZ();\n\t\t\n/*\t\t// check fps\n\t\tPoint3D torchPos;\n\t\tif (camera.getPerson().isFps()) {\n\t\t\ttorchPos = new Point3D(camera.getGlobalPosition().getX(), camera.getGlobalPosition().getY(), camera.getGlobalPosition().getZ());\n*/\n\t\tPoint3D torchPos;\n\t\t// check fps\n\t\tif (person.isFps()) {\n\t\t\ttorchPos = new Point3D(person.getCamera().getGlobalPosition().getX(),\n\t\t\t\t\tperson.getCamera().getGlobalPosition().getY(),\n\t\t\t\t\tperson.getCamera().getGlobalPosition().getZ());\n\t\t} else { \n\t\t\ttorchPos = new Point3D(person.getGlobalPosition().getX(),\n\t\t\t\t\tperson.getGlobalPosition().getY() + 0.2f, \n\t\t\t\t\tperson.getGlobalPosition().getZ());\n\t\t}\n\t\t\n Shader.setPoint3D(gl, \"sunlight\", new Point3D(xSun,ySun,zSun)); // set sunlight vector to passed in vector \n Shader.setColor(gl, \"lightIntensity\", Color.WHITE);\n \n // Set the material properties\n Shader.setColor(gl, \"ambientCoeff\", Color.WHITE);\n Shader.setColor(gl, \"diffuseCoeff\", new Color(0.5f, 0.5f, 0.5f));\n Shader.setFloat(gl, \"phongExp\", 16f);\n \n // for torch light\n Shader.setFloat(gl, \"cutoff\", 90f); // in degrees\n Shader.setPoint3D(gl, \"posTorch\", torchPos);\n Shader.setFloat(gl, \"attenuationFactor\", 40f); \n Shader.setColor(gl, \"lightIntensityTorch\", Color.YELLOW); \n \n if (day) {\n \t// light properties for day\n Shader.setColor(gl, \"specularCoeff\", new Color(0.8f, 0.8f, 0.8f));\n \tShader.setColor(gl, \"ambientIntensity\", new Color(0.2f, 0.2f, 0.2f));\n Shader.setPoint3D(gl, \"dirTorch\", new Point3D(0,0,0)); // set torchDir vector \n } else { \n \t// light properties for night \n Shader.setColor(gl, \"specularCoeff\", new Color(0.5f, 0.5f, 0.5f));\n \tShader.setColor(gl, \"ambientIntensity\", new Color(0.01f, 0.01f, 0.01f));\n Shader.setPoint3D(gl, \"dirTorch\", new Point3D(0,0,1)); // set torchDir vector \n }\n\t}",
"public static void setLightInfo()\n {\n for(int i = 0; i <= 19; i++)\n {\n lights.add(new Light());\n }\n\n //-----set position for all 15 lights-----\\\n //light1 -- middle light\n lights.get(0).setX(475);\n lights.get(0).setY(585);\n\n //--- left side --- \\\\\n\n //light2 - -\n lights.get(1).setX(350);\n lights.get(1).setY(570);\n\n //light3 - -\n lights.get(2).setX(230);\n lights.get(2).setY(530);\n\n //light4 - -\n lights.get(3).setX(130);\n lights.get(3).setY(470);\n\n //light5 - -\n lights.get(4).setX(110);\n lights.get(4).setY(410);\n\n //light6 - -\n lights.get(5).setX(165);\n lights.get(5).setY(370);\n\n //light7 - -\n lights.get(6).setX(230);\n lights.get(6).setY(350);\n\n //light8 - -\n lights.get(7).setX(290);\n lights.get(7).setY(340);\n\n //light9 - -\n lights.get(8).setX(355);\n lights.get(8).setY(337);\n\n //light10 - -\n lights.get(9).setX(420);\n lights.get(9).setY(336);\n\n\n //---- middle ----\\\\\n\n //light11 -\n lights.get(10).setX(485);\n lights.get(10).setY(335);\n\n //---- Right side of circle ----\\\\\n\n //light12 -\n lights.get(11).setX(540);\n lights.get(11).setY(336);\n\n //light13 -\n lights.get(12).setX(595);\n lights.get(12).setY(337);\n\n //light14 -\n lights.get(13).setX(655);\n lights.get(13).setY(340);\n\n //light15 -\n lights.get(14).setX(720);\n lights.get(14).setY(350);\n\n //light16 -\n lights.get(15).setX(785);\n lights.get(15).setY(370);\n\n //light17 -\n lights.get(16).setX(840);\n lights.get(16).setY(410);\n\n //light18 -\n lights.get(17).setX(820);\n lights.get(17).setY(470);\n\n //light19 -\n lights.get(18).setX(720);\n lights.get(18).setY(530);\n\n //light20 -\n lights.get(19).setX(600);\n lights.get(19).setY(570);\n\n }",
"@Override\n public void simpleInitApp() {\n cam.setLocation(new Vector3f(-2.336393f, 11.91392f, -7.139601f));\n cam.setRotation(new Quaternion(0.23602544f, 0.11321983f, -0.027698677f, 0.96473104f));\n\n Material mat = new Material(assetManager,\"Common/MatDefs/Light/Lighting.j3md\");\n mat.setFloat(\"Shininess\", 15f);\n mat.setBoolean(\"UseMaterialColors\", true);\n mat.setColor(\"Ambient\", ColorRGBA.Yellow.mult(0.2f));\n mat.setColor(\"Diffuse\", ColorRGBA.Yellow.mult(0.2f));\n mat.setColor(\"Specular\", ColorRGBA.Yellow.mult(0.8f));\n\n Material matSoil = new Material(assetManager,\"Common/MatDefs/Light/Lighting.j3md\");\n matSoil.setFloat(\"Shininess\", 15f);\n matSoil.setBoolean(\"UseMaterialColors\", true);\n matSoil.setColor(\"Ambient\", ColorRGBA.Gray);\n matSoil.setColor(\"Diffuse\", ColorRGBA.Black);\n matSoil.setColor(\"Specular\", ColorRGBA.Gray);\n\n Spatial teapot = assetManager.loadModel(\"Models/Teapot/Teapot.obj\");\n teapot.setLocalTranslation(0,0,10);\n\n teapot.setMaterial(mat);\n teapot.setShadowMode(ShadowMode.CastAndReceive);\n teapot.setLocalScale(10.0f);\n rootNode.attachChild(teapot);\n\n Geometry soil = new Geometry(\"soil\", new Box(800, 10, 700));\n soil.setLocalTranslation(0, -13, 550);\n soil.setMaterial(matSoil);\n soil.setShadowMode(ShadowMode.CastAndReceive);\n rootNode.attachChild(soil);\n\n DirectionalLight light=new DirectionalLight();\n light.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());\n light.setColor(ColorRGBA.White.mult(1.5f));\n rootNode.addLight(light);\n\n // load sky\n Spatial sky = SkyFactory.createSky(assetManager, \"Textures/Sky/Bright/FullskiesBlueClear03.dds\", SkyFactory.EnvMapType.CubeMap);\n sky.setCullHint(Spatial.CullHint.Never);\n rootNode.attachChild(sky);\n\n FilterPostProcessor fpp = new FilterPostProcessor(assetManager);\n int numSamples = getContext().getSettings().getSamples();\n if (numSamples > 0) {\n fpp.setNumSamples(numSamples);\n }\n pf = new PosterizationFilter();\n fpp.addFilter(pf);\n\n viewPort.addProcessor(fpp);\n initInputs();\n\n }",
"private Material(float[] diffuse, float[] specular, float shininess) {\n this.diffuse = diffuse;\n this.specular = specular;\n this.shininess = shininess;\n }",
"private Material(float[] diffuse, float[] specular, float shininess) {\n this.diffuse = diffuse;\n this.specular = specular;\n this.shininess = shininess;\n }",
"private void setUp2SpheresScene() {\n camera = new Camera(\n new Point3D(0, 0, 9),\n new Point3D(0,0,0),\n new Point3D(0,1,0),\n Math.PI * 0.5, width, height\n );\n camera.moveForward(1.0);\n\n exposure = 1.0;\n ambientLight = new LightIntensity();\n ambientLight.red = 0.2;\n ambientLight.green = 0.2;\n ambientLight.blue = 0.2;\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.7, .7, .3),\n new RectFace(\n new Point3D(-1.1, 9.99, -5.0),\n new Point3D(1.1, 9.99, -5.0),\n new Point3D(-1.1, 9.99, -6.1)\n )\n ));\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.4, .3, .7),\n new RectFace(\n new Point3D(-4.1, 2.99, -5.0),\n new Point3D(-2.9, 2.99, -5.0),\n new Point3D(-4.1, 2.99, -6.1)\n )\n ));\n\n Material reflective = new Material();\n reflective.diffuseReflectivity.red = 0.2;\n reflective.diffuseReflectivity.green = 0.2;\n reflective.diffuseReflectivity.blue = 0.2;\n reflective.directReflectivity = LightIntensity.makeUniformRGB(0.5);\n\n Material glass = new Material();\n glass.diffuseReflectivity.red = 0.0;\n glass.diffuseReflectivity.green = 0.0;\n glass.diffuseReflectivity.blue = 0.0;\n glass.passthroughIntensity.red = 0.9;\n glass.passthroughIntensity.green = 0.9;\n glass.passthroughIntensity.blue = 0.9;\n glass.directReflectivity = LightIntensity.makeUniformRGB(0.1);\n glass.refractionIndex = 1.33;\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-5, -3, -5), 2.5), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(5, -3, -5), 2.5), new Material()));\n\n Box boundingBox = new Box(\n new Point3D(-10,10, 10),\n new Point3D(-10,10, -10),\n new Point3D(10,10, 10),\n new Point3D(-10,-10, 10)\n );\n\n Material leftWallMaterial = new Material();\n leftWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, 0.3);\n\n Material rightWallMaterial = new Material();\n rightWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, .7);\n\n Material frontWallMaterial = new Material();\n frontWallMaterial.diffuseReflectivity = new LightIntensity(0.3,0.3, 0.3);\n\n Material backWallMaterial = new Material();\n backWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, 0.3);\n\n Material topWallMaterial = new Material();\n topWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n\n Material bottomWallMaterial = new Material();\n bottomWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n\n try {\n bottomWallMaterial.texture = ImageIO.read(new File(\"C:\\\\Class_work\\\\checkerboard.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n solids.add(new RectFace.FaceSolid(boundingBox.left, leftWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.right, rightWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.front, frontWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.back, backWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.top, topWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.bottom, bottomWallMaterial));\n }",
"public void ApplyMaterial(TF3D_Material mat)\n\t{\n\t\tif (mat.typ == F3D.MAT_TYPE_TEXTURE)\n\t\t{\n\n\t\t\tthis.ResetMaterial();\n\t\t\t\n\t\t\tif (mat.bAlphaTest)\n\t\t\t{\n\t\t\t\tglEnable(GL_ALPHA_TEST);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_ALPHA_TEST);\n\t\t\t}\n\n\t\t\tif (mat.bDepthTest)\n\t\t\t{\n\t\t\t\tglEnable(GL_DEPTH_TEST);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_DEPTH_TEST);\n\t\t\t}\n\n\t\t\tif (mat.bFaceCulling)\n\t\t\t{\n\t\t\t\tglEnable(GL_CULL_FACE);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_CULL_FACE);\n\t\t\t}\n\n\t\t\tif (F3D.Config.use_gl_light)\n\t\t\t{\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_AMBIENT, F3D.GetBuffer.Float(mat.colors.ambient));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE, F3D.GetBuffer.Float(mat.colors.diffuse));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_SPECULAR, F3D.GetBuffer.Float(mat.colors.specular));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_EMISSION, F3D.GetBuffer.Float(mat.colors.emissive));\n\t\t\t\tglMaterialf(GL_FRONT, GL_SHININESS, mat.colors.shinisess);\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglColor4f(mat.colors.diffuse[0], mat.colors.diffuse[1], mat.colors.diffuse[2], mat.colors.diffuse[3]);\n\t\t\t}\n\n\t\t\tfor (int u = 0; u < F3D.MAX_TMU; u++)\n\t\t\t{\n\t\t\t\tif (mat.texture_unit[u].bEvent)\n\t\t\t\t{\n\t\t\t\t\tF3D.MaterialEvents.Apply(u, mat.texture_unit[u].event_id);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tF3D.MaterialEvents.ResetEvent(u);\n\t\t\t\t}\n\n\t\t\t\tif (mat.texture_unit[u].bTexture)\n\t\t\t\t{\n\t\t\t\t\tF3D.Textures.ActivateLayer(u);\n\t\t\t\t\tF3D.Textures.Bind(mat.texture_unit[u].texture_id);\n\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tF3D.Textures.DeactivateLayer(u);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// SHADER\n\t\tif (mat.typ == F3D.MAT_TYPE_SHADER)\n\t\t{\n\n\t\t\tif (mat.bAlphaTest)\n\t\t\t{\n\t\t\t\tglEnable(GL_ALPHA_TEST);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_ALPHA_TEST);\n\t\t\t}\n\n\t\t\tif (mat.bDepthTest)\n\t\t\t{\n\t\t\t\tglEnable(GL_DEPTH_TEST);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_DEPTH_TEST);\n\t\t\t}\n\n\t\t\tif (mat.bFaceCulling)\n\t\t\t{\n\t\t\t\tglEnable(GL_CULL_FACE);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tglDisable(GL_CULL_FACE);\n\t\t\t}\n\n\t\t\t\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_AMBIENT, F3D.GetBuffer.Float(mat.colors.ambient));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE, F3D.GetBuffer.Float(mat.colors.diffuse));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_SPECULAR, F3D.GetBuffer.Float(mat.colors.specular));\n\t\t\t\tglMaterial(GL_FRONT_AND_BACK, GL_EMISSION, F3D.GetBuffer.Float(mat.colors.emissive));\n\t\t\t\tglMaterialf(GL_FRONT, GL_SHININESS, mat.colors.shinisess);\n\n\t\t\t\n\n\t\t\tif (mat.use_shader)\n\t\t\t{\n\t\t\t\tF3D.Shaders.UseProgram(mat.shader_id);\n\t\t\t}\n\t\t\t\n\t\t\tfor (int u = 0; u < F3D.MAX_TMU; u++)\n\t\t\t{\n\t\t\t\tif (mat.texture_unit[u].bEvent)\n\t\t\t\t{\n\t\t\t\t\tF3D.MaterialEvents.Apply(u, mat.texture_unit[u].event_id);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tF3D.MaterialEvents.ResetEvent(u);\n\t\t\t\t}\n\n\t\t\t\tif (mat.texture_unit[u].bTexture)\n\t\t\t\t{\n\t\t\t\t\tF3D.Textures.ActivateLayer(u);\n\t\t\t\t\tF3D.Textures.Bind(mat.texture_unit[u].texture_id);\n\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tF3D.Textures.DeactivateLayer(u);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t}",
"private void lightOn(Map<Light, Matrix4f> lights) {\n numLight = 0;\n GL3 gl = glContext.getGL().getGL3();\n FloatBuffer fb4 = Buffers.newDirectFloatBuffer(4);\n LightLocation lightLoc = new LightLocation();\n for (Entry<Light, Matrix4f> entry : lights.entrySet()) {\n Light light = entry.getKey();\n Matrix4f lightTransForm = entry.getValue();\n Vector4f lightPosition = lightTransForm.transform(new Vector4f(light.getPosition()));\n Vector4f lightDirection = lightTransForm.transform(new Vector4f(light.getSpotDirection()));\n String lightName = \"light[\" + numLight + \"]\";\n lightLoc.position = shaderLocations.getLocation(lightName + \".position\");\n lightLoc.ambient = shaderLocations.getLocation(lightName + \".ambient\");\n lightLoc.diffuse = shaderLocations.getLocation(lightName + \".diffuse\");\n lightLoc.specular = shaderLocations.getLocation(lightName + \".specular\");\n lightLoc.direction = shaderLocations.getLocation(lightName + \".direction\");\n lightLoc.cutOff = shaderLocations.getLocation(lightName + \".cutOff\");\n\n gl.glUniform4fv(lightLoc.position, 1, lightPosition.get(fb4));\n gl.glUniform3fv(lightLoc.ambient, 1, light.getAmbient().get(fb4));\n gl.glUniform3fv(lightLoc.diffuse, 1, light.getDiffuse().get(fb4));\n gl.glUniform3fv(lightLoc.specular, 1, light.getSpecular().get(fb4));\n gl.glUniform4fv(lightLoc.direction, 1, lightDirection.get(fb4));\n gl.glUniform1f(lightLoc.cutOff, light.getSpotCutoff());\n numLight++;\n }\n gl.glUniform1i(shaderLocations.getLocation(\"numLights\"), numLight);\n }",
"private void renderLights() {\n\t\t\n\t}",
"@Override\n public void drawMesh(String name, util.Material material, String textureName, final Matrix4f transformation) {\n if (meshRenderers.containsKey(name)) {\n GL3 gl = glContext.getGL().getGL3();\n //get the color\n\n FloatBuffer fb4 = Buffers.newDirectFloatBuffer(4);\n FloatBuffer fb16 = Buffers.newDirectFloatBuffer(16);\n\n int loc = -1;\n\n loc = shaderLocations.getLocation(\"material.ambient\");\n if (loc >= 0) {\n gl.glUniform3fv(loc, 1, material.getAmbient().get(fb4));\n } else {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.ambient \\\"\");\n }\n\n loc = shaderLocations.getLocation(\"material.diffuse\");\n if (loc >= 0) {\n gl.glUniform3fv(loc, 1, material.getDiffuse().get(fb4));\n } else {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.diffuse \\\"\");\n }\n\n if (loc >= 0) {\n loc = shaderLocations.getLocation(\"material.specular\");\n gl.glUniform3fv(loc, 1, material.getSpecular().get(fb4));\n } else {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.specular \\\"\");\n }\n\n loc = shaderLocations.getLocation(\"material.shininess\");\n if (loc >= 0) {\n gl.glUniform1f(loc, material.getShininess());\n } else {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.shininess \\\"\");\n }\n\n loc = shaderLocations.getLocation(\"modelview\");\n if (loc >= 0) {\n gl.glUniformMatrix4fv(loc, 1, false, transformation.get(fb16));\n }\n else {\n throw new IllegalArgumentException(\"No shader variable for \\\" modelview \\\"\");\n }\n\n loc = shaderLocations.getLocation(\"normalmatrix\");\n if (loc>=0) {\n Matrix4f normalmatrix = new Matrix4f(transformation).invert().transpose();\n gl.glUniformMatrix4fv(loc,1,false,normalmatrix.get(fb16));\n }\n else {\n throw new IllegalArgumentException(\"No shader variable for \\\" normalmatrix \\\"\");\n }\n\n\n\n if (textures.containsKey(textureName))\n textures.get(textureName).getTexture().bind(gl);\n else if (textures.containsKey(\"white\"))\n textures.get(\"white\").getTexture().bind(gl);\n\n meshRenderers.get(name).draw(glContext);\n }\n }",
"public void setParameters(MaterialParams mp);",
"public void setMaterial(String material) {\n this.material = material;\n }",
"void animate( LightCondition lights );",
"@Override\n public void initScene()\n {\n myLight.position.setAll(300,150,150);\n\n myLight = new Light();\n myLight.type(LightType.DIRECTIONAL);\n\n scene.lights().add(myLight);\n scene.backgroundColor().setAll(255,255,255,1);\n\n IParser myParser = Parser.createParser(Parser.Type.MAX_3DS, getResources(), \"min3d.sampleProject1:raw/squared_robot_3ds\", false);\n myParser.parse();\n\n androidRobot3DObject = myParser.getParsedObject();\n androidRobot3DObject.position().x = androidRobot3DObject.position().y = androidRobot3DObject.position().z = 0;\n\n\n // We scale the robot, check this value if you want to target another scale\n androidRobot3DObject.scale().x = androidRobot3DObject.scale().y = androidRobot3DObject.scale().z = 1f;\n scene.addChild(androidRobot3DObject);\n\n // Preloading the textures with the textureManager()\n Bitmap b;\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_body_business);\n Shared.textureManager().addTextureId(b, \"squared_robot_body_business\");\n b.recycle();\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_body);\n Shared.textureManager().addTextureId(b, \"squared_robot_body\");\n b.recycle();\n\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_arm);\n Shared.textureManager().addTextureId(b,\"squared_robot_arm\");\n b.recycle();\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_foot);\n Shared.textureManager().addTextureId(b,\"squared_robot_foot\");\n b.recycle();\n\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_antenna);\n Shared.textureManager().addTextureId(b,\"squared_robot_antenna\");\n b.recycle();\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_head);\n Shared.textureManager().addTextureId(b,\"squared_robot_head\");\n b.recycle();\n\n b = Utils.makeBitmapFromResourceId(R.drawable.squared_robot_head_business);\n Shared.textureManager().addTextureId(b,\"squared_robot_head_business\");\n b.recycle();\n\n loadAllTextures();\n\n }",
"public void read() {\n prepareAdditionalStates();\n materialParameters.clear();\n int level = 0;\n boolean params = false;\n boolean states = false;\n try {\n //scan material text\n for (String line : material.asLines()) {\n //trim line incl comments\n line = trimLine(line);\n //find and load matdef file\n if (line.startsWith(\"Material \") || line.startsWith(\"Material\\t\") && level == 0) {\n parseMaterialProperties(line);\n }\n //start parsing material parameters\n if (line.startsWith(\"MaterialParameters \") || line.startsWith(\"MaterialParameters\\t\") || line.startsWith(\"MaterialParameters{\") && level == 1) {\n params = true;\n }\n //start parsing renderstates\n if (line.startsWith(\"AdditionalRenderState \") || line.startsWith(\"AdditionalRenderState\\t\") || line.startsWith(\"AdditionalRenderState{\") && level == 1) {\n states = true;\n }\n //up a level\n if (line.indexOf(\"{\") != -1) {\n level++;\n }\n //down a level, stop processing parameters/states\n if (line.indexOf(\"}\") != -1) {\n level--;\n if (params) {\n params = false;\n }\n if (states) {\n states = false;\n }\n }\n //try reading parameter\n if (level == 2 && params) {\n int colonIdx = line.indexOf(\":\");\n if (colonIdx != -1) {\n String[] lines = line.split(\":\");\n MaterialProperty prop = new MaterialProperty();\n prop.setName(lines[0].trim());\n if (lines.length > 1) {\n prop.setValue(lines[lines.length - 1].trim());\n }\n materialParameters.put(prop.getName(), prop);\n }\n }\n //try reading state\n if (level == 2 && states) {\n String[] lines = null;\n int colonIdx = line.indexOf(\" \");\n if (colonIdx != -1) {\n lines = line.split(\" \");\n }\n colonIdx = line.indexOf(\"\\t\");\n if (colonIdx != -1) {\n lines = line.split(\"\\t\");\n }\n if (lines != null) {\n MaterialProperty prop = new MaterialProperty();\n String name = lines[0].trim();\n prop.setName(name);\n if (additionalRenderStates.get(name) != null) {\n\n prop.setType(additionalRenderStates.get(name).getType());\n if (lines.length > 1) {\n String value = \"\";\n for (int i = 1; i < lines.length; i++) {\n value += \" \" + lines[i];\n }\n prop.setValue(value.trim());\n } \n additionalRenderStates.put(prop.getName(), prop);\n }\n }\n }\n }\n checkWithMatDef();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n }",
"public Material create();",
"protected static void setLightUniform(@NotNull Shape shape) {\n\t\tshape.shaderProgram.setUniform2f(\"resolution\", Display.getSizeF());\n\t\tshape.shaderProgram.setUniform3f(\"ambient\", Lights.ambient);\n\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tif (i >= Lights.lights.size()) break;\n\n\t\t\tLight l = Lights.lights.get(i);\n\t\t\tshape.shaderProgram.setUniform2f(\"lights[\"+i+\"].position\", l.getPosition());\n\t\t\tshape.shaderProgram.setUniform3f(\"lights[\"+i+\"].color\", l.getColor());\n\t\t\tshape.shaderProgram.setUniform1f(\"lights[\"+i+\"].intensity\", l.getIntensity());\n\t\t}\n\t}",
"protected SoftwareLight() {\r\n ambient = new Color3f(0.0f, 0.0f, 0.0f);\r\n diffuse = new Color3f(0.0f, 0.0f, 0.0f);\r\n specular = new Color3f(0.0f, 0.0f, 0.0f);\r\n intensity = 0.0f;\r\n on = false;\r\n\r\n // no attenuation\r\n m_fAttenuate = 1.0f;\r\n m_fSpot = 1.0f;\r\n }",
"public SceneLight(String name, int light_number, \n\t\t\tColor4f ambient, Color4f diffuse, Color4f specular, \n\t\t\tdouble posx,double posy,double posz,\n\t\t\tdouble directionx,double directiony,double directionz,\n\t\t\tfloat spot_Cutoff,float intensity, \n\t\t\tfloat constant_attenuation_constant,float linear_attenuation_constant,\n\t\t\tfloat quad_attenuation_constant){\n\t\t\n\t\tthis.name=name;\n\t\tthis.light_number=light_number;\n\t\tposition=new Vector3d(posx,posy,posz);\n\t\tdirection=new Vector3d(directionx,directiony,directionz);\n\t\tthis.ambient=ambient;\n\t\tthis.diffuse=diffuse;\n\t\tthis.specular=specular;\n\t\tthis.spot_Cutoff=spot_Cutoff;\n\t\tthis.intensity=intensity;\n\t\tthis.constant_attenuation_constant=constant_attenuation_constant;\n\t\tthis.linear_attenuation_constant=linear_attenuation_constant;\n\t\tthis.quad_attenuation_constant=quad_attenuation_constant;\n\t}",
"public abstract Color3f traceLight(Vector3f pos, Vector3f normal,\n\t Material m, List<Shape> objects);",
"public static Node buildWorld(AssetManager assetManager) {\n TextureKey keyFloor = new TextureKey(\"Models/Scene/wall_diffuse_1.jpg\", false);// pave_color.jpg\n Texture texFloor = assetManager.loadTexture(keyFloor);\n\n TextureKey keyNorm = new TextureKey(\"Models/Scene/wall_normal.jpg\", false);// pave_norm.jpg\n Texture texNormalPlane = assetManager.loadTexture(keyNorm);\n\n Material mat_basic = new Material(assetManager, \"Common/MatDefs/Light/PBRLighting.j3md\");\n mat_basic.setTexture(\"BaseColorMap\", texFloor);\n mat_basic.setTexture(\"NormalMap\", texNormalPlane);\n mat_basic.setFloat(\"Metallic\", 0.1f);\n mat_basic.setFloat(\"Roughness\", 0.00f);\n mat_basic.setFloat(\"Glossiness\", 0.5f);\n\n // Must be false - otherwise uv gets messed up.\n TextureKey keyFloor2 = new TextureKey(\"Models/Scene/deck.jpg\", false);\n Texture texFloor2 = assetManager.loadTexture(keyFloor2);\n TextureKey keyNorm2 = new TextureKey(\"Models/Scene/deck_normal.jpg\", false);\n Texture texNormalPlane2 = assetManager.loadTexture(keyNorm2);\n\n Material mat_basic2 = new Material(assetManager, \"Common/MatDefs/Light/PBRLighting.j3md\");\n mat_basic2.setTexture(\"BaseColorMap\", texFloor2);\n mat_basic2.setFloat(\"Metallic\", 0.1f);\n mat_basic2.setFloat(\"Roughness\", 0.1f);\n mat_basic2.setTexture(\"NormalMap\", texNormalPlane2);\n // Scene\n Node scene = (Node) assetManager.loadModel(\"Models/Scene/testScene.gltf\");\n\n // Tiling\n ((Geometry) scene.getChild(\"Plane\")).getMesh().scaleTextureCoordinates(new Vector2f(4, 4));\n mat_basic.getTextureParam(\"BaseColorMap\").getTextureValue().setWrap(WrapMode.Repeat);\n mat_basic.getTextureParam(\"NormalMap\").getTextureValue().setWrap(WrapMode.Repeat);\n // Tex for scene\n scene.getChild(\"Plane\").setMaterial(mat_basic);\n scene.getChild(\"Cube\").setMaterial(mat_basic2);\n\n Node probeNode = (Node) assetManager.loadModel(\"Models/Scene/market.j3o\");\n LightProbe probe = (LightProbe) probeNode.getLocalLightList().iterator().next();\n scene.addLight(probe);\n\n // We must add a light to make the model visible\n // Light\n DirectionalLight sun = new DirectionalLight();\n sun.setColor(ColorRGBA.White.mult(0.75f));\n sun.setDirection(new Vector3f(-.5f, -.5f, -.5f).normalizeLocal());\n scene.addLight(sun);\n\n return scene;\n }",
"private void generateLights(Universe universe) throws SAXException {\n ArrayList<SceneLight> lights = universe.getScene().getLightArray();\n for (int i = 0; i < lights.size(); i++) {\n saver.addAttribute(\"type\", XmlSaver.CDATA, lights.get(i).getLightType().name());\n saver.startTag(\"light\");\n Color3f color = new Color3f(lights.get(i).getColor());\n saver.startTag(\"color\", Converter.tuple3fToString(color));\n switch(lights.get(i).getLightType()){\n// case ambient:\n case point:\n Point3f position = lights.get(i).getPosition();\n saver.startTag(\"position\", Converter.tuple3fToString(position));\n Point3f attenuation = lights.get(i).getAttenuation();\n saver.startTag(\"attenuation\", Converter.tuple3fToString(attenuation));\n break;\n case directional:\n Vector3f direction = lights.get(i).getDirection();\n saver.startTag(\"direction\", Converter.tuple3fToString(direction));\n break;\n }\n saver.closeTag(\"light\");\n }\n }",
"public void setAsMaterial(Material mat) throws IOException {\n assert (mat.getMaterialDef().getAssetName() != null);\n setName(\"MyMaterial\");\n setMatDefName(mat.getMaterialDef().getAssetName());\n createBaseMaterialFile();\n materialParameters.clear();\n Collection<MatParam> params = mat.getParams();\n for (Iterator<MatParam> it = params.iterator(); it.hasNext();) {\n MatParam matParam = it.next();\n materialParameters.put(matParam.getName(), new MaterialProperty(matParam));\n }\n additionalRenderStates.put(\"Wireframe\", new MaterialProperty(\"OnOff\", \"Wireframe\", mat.getAdditionalRenderState().isWireframe() ? \"On\" : \"Off\"));\n additionalRenderStates.put(\"DepthWrite\", new MaterialProperty(\"OnOff\", \"DepthWrite\", mat.getAdditionalRenderState().isDepthWrite() ? \"On\" : \"Off\"));\n additionalRenderStates.put(\"DepthTest\", new MaterialProperty(\"OnOff\", \"DepthTest\", mat.getAdditionalRenderState().isDepthTest() ? \"On\" : \"Off\"));\n additionalRenderStates.put(\"ColorWrite\", new MaterialProperty(\"OnOff\", \"ColorWrite\", mat.getAdditionalRenderState().isColorWrite() ? \"On\" : \"Off\"));\n additionalRenderStates.put(\"PointSprite\", new MaterialProperty(\"OnOff\", \"PointSprite\", mat.getAdditionalRenderState().isPointSprite() ? \"On\" : \"Off\"));\n additionalRenderStates.put(\"FaceCull\", new MaterialProperty(\"FaceCullMode\", \"FaceCull\", mat.getAdditionalRenderState().getFaceCullMode().name()));\n additionalRenderStates.put(\"Blend\", new MaterialProperty(\"BlendMode\", \"Blend\", mat.getAdditionalRenderState().getBlendMode().name()));\n additionalRenderStates.put(\"AlphaTestFalloff\", new MaterialProperty(\"Float\", \"AlphaTestFalloff\", mat.getAdditionalRenderState().getAlphaFallOff() + \"\"));\n additionalRenderStates.put(\"PolyOffset\", new MaterialProperty(\"Float,Float\", \"PolyOffset\", mat.getAdditionalRenderState().getPolyOffsetUnits() + \" \" + mat.getAdditionalRenderState().getPolyOffsetFactor()));\n checkWithMatDef();\n setAsText(getUpdatedContent());\n }",
"protected void initLight(GL10 gl) {\n\t\tgl.glEnable(GL10.GL_LIGHTING);\n\t\tgl.glEnable(GL10.GL_LIGHT0);\n\t\tgl.glEnable(GL10.GL_LIGHT1);\n\t\tgl.glShadeModel(GL10.GL_SMOOTH);\n\t\tthis.mLight = new Light();\n\t\tthis.mLight.initAmbient(-0.2f, -0.2f, -0.2f, 1.0f);\n\t\tthis.mLight.initDiffuse(1.f, 1.0f, 1.0f, 1f);\n\t\tthis.mLight.initSpecular(1.0f, 1.0f, 1.0f, 1.0f);\n\t\tthis.mLight.initPosition(0.0f, 3f, 20f, 0.0f);\n\t\tthis.mLight.setLight(gl, GL10.GL_LIGHT0);\n\t\t\n\t\tthis.mLight2 = new Light();\n\t\tthis.mLight2.initAmbient(-0.1f, -0.1f, -0.1f, 1.0f);\n\t\tthis.mLight2.initDiffuse(1f, 1f, 1f, 1f);\n\t\tthis.mLight2.initSpecular(1f, 1f, 1f, 1f);\n\t\tthis.mLight2.initPosition(0f, 2f, 13.5f, 0.0f);\n\t\tthis.mLight2.setLight(gl, GL10.GL_LIGHT1);\n//\t\tgl.glDisable(GL10.GL_LIGHT1);\n\t}",
"@Element \n public void setMaterial(String material) {\n this.material = material;\n }",
"public void setLEDLights(int lightID);",
"private void updateLight() {\r\n\t}",
"public void\nsetSpecularElt( SbColor color )\n//\n{\n this.coinstate.specular.copyFrom(color);\n}",
"public void init() {\n createVertexShader(vertexShader(true));\n createFragmentShader(fragShader.SHADER_STRING);\n\n /* Binds the code and checks that everything has been done correctly. */\n link();\n\n createUniform(\"worldMatrix\");\n createUniform(\"modelMatrix\");\n createUniform(\"normalMatrix\");\n\n /* Initialization of the shadow map matrix uniform. */\n createUniform(\"directionalShadowMatrix\");\n\n /* Create uniform for material. */\n createMaterialUniform(\"material\");\n createUniform(\"texture_sampler\");\n /* Initialization of the light's uniform. */\n createUniform(\"camera_pos\");\n createUniform(\"specularPower\");\n createUniform(\"ambientLight\");\n createPointLightListUniform(\"pointLights\", LightModel.MAX_POINTLIGHT);\n createSpotLightUniformList(\"spotLights\", LightModel.MAX_SPOTLIGHT);\n createDirectionalLightUniform(\"directionalLight\");\n createUniform(\"shadowMapSampler\");\n createUniform(\"bias\");\n }",
"public void setMaterial(java.lang.String material) {\r\n this.material = material;\r\n }",
"public void\n\t setColorMaterialElt( boolean value )\n\t \n\t {\n//\t if (ivState.lightModel == LightModel.BASE_COLOR.getValue()) value = false;\n//\t ivState.colorMaterial = value;\n\t }",
"public Material() {}",
"protected void initMaterial(Node node) {\n Renderer renderer = DisplaySystem.getDisplaySystem().getRenderer();\n MaterialState nodeMaterial = renderer.createMaterialState();\n nodeMaterial.setAmbient(CONNECTOR_LINE_COLOR);\n nodeMaterial.setDiffuse(CONNECTOR_LINE_COLOR);\n nodeMaterial.setSpecular(new ColorRGBA(0.1f, 0.1f, 0.1f, 1.0f));\n nodeMaterial.setShininess(0.4f);\n node.setRenderState(nodeMaterial);\n }",
"public Light(){\n this(0.0, 0.0, 0.0);\n }",
"@Override\n\tpublic String addmaterial() {\n\t\treturn \"Leather Material is ready\";\n\t}",
"public void setStaticLight(boolean staticLight);",
"public void run() {\n\n\t\t\t\tgetHelmetDetails().material = getRandomMaterial();\n\t\t\t\tgetHelmetMoreDetails().material = getRandomMaterial();\n\n\t\t\t\t// bonus points:\n\t\t\t\t// randomly change the material of the helmet base to a texture\n\t\t\t\t// from the files aloha.png and camouflage.png (or add your own!)\n\t\t\t\tgetHelmetBase().material = getRandomMaterial();\n\t\t\t\tsetRandomLight();\n\n\t\t\t}",
"public void setMATERIAL(java.lang.String MATERIAL) {\r\n this.MATERIAL = MATERIAL;\r\n }",
"public void updateMaterial() {\n this.material = world.getRecipeManager().getFirstMatch(RecipeTypes.MATERIAL, this, world).orElse(null);\n }",
"public void defineRawMaterial(String name,\r\n\t\t\t\t\t\t\t\t\t double calories,\r\n\t\t\t\t\t\t\t\t\t double proteins,\r\n\t\t\t\t\t\t\t\t\t double carbs,\r\n\t\t\t\t\t\t\t\t\t double fat){\r\n\t\trawMats.add(new Material(name,calories,proteins,carbs,fat,true));\r\n\t}",
"private static void doModify3DAttributes(Home home,\n int groundColor, \n HomeTexture groundTexture, \n int skyColor, \n HomeTexture skyTexture, int lightColor, \n float wallsAlpha) {\n HomeEnvironment homeEnvironment = home.getEnvironment();\n homeEnvironment.setGroundColor(groundColor);\n homeEnvironment.setGroundTexture(groundTexture);\n homeEnvironment.setSkyColor(skyColor);\n homeEnvironment.setSkyTexture(skyTexture);\n homeEnvironment.setLightColor(lightColor);\n homeEnvironment.setWallsAlpha(wallsAlpha);\n }",
"public Light(Color color){\n this.color = color;\n this.castsShadows = false;\n }",
"@Override\r\n public void simpleInitApp(\r\n ) {\n\t flyCam.setMoveSpeed( 20 );\t\t\t// Move a bit faster\r\n\t flyCam.setDragToRotate( true );\t\t// Only use the mouse while it is clicked\r\n\t \r\n \tGeometry aGeometry;\r\n \tMaterial mat_csg;\r\n \tNode aNode = new Node( \"CSGSamples\" );\r\n\r\n mat_csg = new Material( assetManager, \"Common/MatDefs/Misc/ShowNormals.j3md\" );\r\n aGeometry = new Geometry( \"Box2\", new Box( 1, 1, 1 ) );\r\n //aGeometry = new Geometry( \"Cylinder\", new Cylinder( 32, 32, 1.1f, 1.5f, true ) );\r\n aGeometry.setMaterial( mat_csg );\r\n aGeometry.move( -2f, 0f, 0f );\r\n aNode.attachChild( aGeometry );\r\n\r\n //mat_csg = assetManager.loadMaterial( \"Textures/Debug/Wireframe.j3m\" );\r\n //mat_csg = assetManager.loadMaterial( \"Textures/Terrain/BrickWall/BrickWall.j3m\" );\r\n \r\n Material sphereMat = new Material(assetManager, \r\n \"Common/MatDefs/Light/Lighting.j3md\");\r\n sphereMat.setTexture(\"DiffuseMap\", \r\n assetManager.loadTexture(\"Textures/Terrain/Pond/Pond.jpg\"));\r\n sphereMat.setTexture(\"NormalMap\", \r\n assetManager.loadTexture(\"Textures/Terrain/Pond/Pond_normal.png\"));\r\n sphereMat.setBoolean(\"UseMaterialColors\",true); \r\n sphereMat.setColor(\"Diffuse\",ColorRGBA.White);\r\n sphereMat.setColor(\"Specular\",ColorRGBA.White);\r\n sphereMat.setFloat(\"Shininess\", 64f); // [0,128]\r\n\r\n aGeometry = new Geometry( \"Box1\", new Box( 1, 1, 1 ) );\r\n //aGeometry = new Geometry( \"Cylinder\", new Cylinder( 32, 32, 1.1f, 1.5f, true ) );\r\n aGeometry.setMaterial( sphereMat );\r\n aGeometry.move( 2f, 0f, 0f );\r\n aNode.attachChild( aGeometry );\r\n \r\n //mat_csg = assetManager.loadMaterial( \"Textures/Terrain/Rock/Rock.j3m\" );\r\n Light aLight = new AmbientLight();\r\n aLight.setColor( ColorRGBA.White );\r\n aNode.addLight( aLight );\r\n\r\n\r\n/***\r\n\t // Long cylinder that pokes out of the cube\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 2.5f, CSGGeometry.CSGOperator.UNION, false );\r\n \taGeometry.move( 0f, 3, 0f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 2.5f, CSGGeometry.CSGOperator.DIFFERENCE, false );\r\n \taGeometry.move( 3f, 0f, 0f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 2.5f, CSGGeometry.CSGOperator.INTERSECTION, false );\r\n \taGeometry.move( 0f, 0f, 3f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 2.5f, CSGGeometry.CSGOperator.SKIP, false );\r\n \taGeometry.move( -3f, 0f, 0f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.SKIP, 2.5f, CSGGeometry.CSGOperator.UNION, false );\r\n \taGeometry.move( 0f, -3f, 0f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \t// Short cylinder that does not span out of the cube\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 1.5f, CSGGeometry.CSGOperator.UNION, true );\r\n \taGeometry.move( 0f, 3f, -8f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 1.5f, CSGGeometry.CSGOperator.DIFFERENCE, true );\r\n \taGeometry.move( 3f, 0f, -8f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildShape( CSGGeometry.CSGOperator.UNION, 1.5f, CSGGeometry.CSGOperator.INTERSECTION, false );\r\n \taGeometry.move( 0f, 0f, -8f );\r\n \taNode.attachChild( aGeometry );\r\n \t\r\n \taGeometry = buildSimpleShape( 0, false );\r\n \taGeometry.move( -3f, -3f, 0f );\r\n \taNode.attachChild( aGeometry );\r\n****/\r\n \t// Preserve the samples\r\n \tFile aFile = new File( \"CSGTestD.xml\" );\r\n \tJmeExporter anExporter = new XMLExporter();\r\n \ttry {\r\n \t\tanExporter.save( aNode, aFile );\r\n \t\tSystem.out.println( \"Export to: \" + aFile.getCanonicalPath() );\r\n \t} catch( Exception ex ) {\r\n \t\tSystem.out.println( \"***Export Failed: \" + ex );\r\n \t}\r\n \t// Display what we have\r\n \trootNode.attachChild( aNode );\r\n }",
"public Light(Vector3f position, Vector3f colour, Vector3f attenuation) {\r\n\t\tthis.position = position;\r\n\t\tthis.colour = colour;\r\n\t\tthis.attenuation = attenuation;\r\n\t}",
"public void addLight(int id) {\n\tif(!lights.containsKey(id)) {\n\t lights.put(id, true);\n\t GL11.glEnable(id);\n\t}\n }",
"public void setMaterialIndex(int index) { materialIndex = index; }",
"private void initMesh() {\n\t\tfloat[] vertices = { -1, -1, 0, 1, -1, 0, -1, 1, 0, 1, 1, 0 };\n\t\tfloat[] texCoords = { 0, 0, 1, 0, 0, 1, 1, 1 };\n\t\tint[] indices = { 0, 1, 2, 3 };\n\t\tmesh = new StaticMesh(gl, vertices, null, texCoords, indices);\n\t\tmesh.setPositionIndex(shader.getAttributeLocation(\"aVertexPosition\"));\n\t\tmesh.setNormalIndex(-1);\n\t\tmesh.setTexCoordIndex(shader.getAttributeLocation(\"aTextureCoord\"));\n\t\tmesh.setBeginMode(BeginMode.TRIANGLE_STRIP);\n\t}",
"@Override\n public void drawMesh(String name, util.Material material, String textureName,\n final Matrix4f transformation) {\n if (meshRenderers.containsKey(name)) {\n GL3 gl = glContext.getGL().getGL3();\n FloatBuffer fb16 = Buffers.newDirectFloatBuffer(16);\n FloatBuffer fb4 = Buffers.newDirectFloatBuffer(4);\n\n if (textures != null && textures.containsKey(textureName)) {\n gl.glEnable(gl.GL_TEXTURE_2D);\n gl.glActiveTexture(gl.GL_TEXTURE0);\n gl.glUniform1i(shaderLocations.getLocation(\"image\"), 0);\n\n Texture texture = textures.get(textureName).getTexture();\n\n texture.setTexParameteri(gl, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);\n texture.setTexParameteri(gl, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT);\n texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);\n texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);\n\n texture.setMustFlipVertically(true);\n Matrix4f textureTrans = new Matrix4f();\n if (texture.getMustFlipVertically()) { //for flipping the image vertically\n textureTrans = new Matrix4f().translate(0, 1, 0).scale(1, -1, 1);\n }\n gl.glUniformMatrix4fv(shaderLocations.getLocation(\"texturematrix\"), 1, false,\n textureTrans.get(fb16));\n gl.glDisable(gl.GL_TEXTURE_2D);\n texture.bind(gl);\n }\n\n //get the color\n\n //set the color for all vertices to be drawn for this object\n\n int loc = shaderLocations.getLocation(\"material.ambient\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.ambient \\\"\");\n }\n gl.glUniform3fv(loc, 1,\n material.getAmbient().get(fb4));\n\n loc = shaderLocations.getLocation(\"material.diffuse\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.diffuse \\\"\");\n }\n gl.glUniform3fv(loc, 1,\n material.getDiffuse().get(fb4));\n\n loc = shaderLocations.getLocation(\"material.specular\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.specular \\\"\");\n }\n gl.glUniform3fv(loc, 1,\n material.getSpecular().get(fb4));\n\n loc = shaderLocations.getLocation(\"material.shininess\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" material.shininess \\\"\");\n }\n gl.glUniform1f(loc, material.getShininess());\n\n loc = shaderLocations.getLocation(\"modelview\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" modelview \\\"\");\n }\n gl.glUniformMatrix4fv(loc, 1, false, transformation.get(fb16));\n\n loc = shaderLocations.getLocation(\"normalmatrix\");\n if (loc < 0) {\n throw new IllegalArgumentException(\"No shader variable for \\\" normalmatrix \\\"\");\n }\n Matrix4f normalmatrix = new Matrix4f(transformation);\n normalmatrix = normalmatrix.invert().transpose();\n gl.glUniformMatrix4fv(shaderLocations.getLocation(\"normalmatrix\"), 1,\n false, normalmatrix.get(fb16));\n\n meshRenderers.get(name).draw(glContext);\n }\n }",
"public void renderLights()\r\n\t{\r\n\t\tlightHandler.render();\r\n\t}",
"public void setLights(boolean lights) {\n \tthis.lightsAreOn = lights;\n }",
"public void initLight(GL10 gl)\n\t{\n\t\tgl.glEnable(GL10.GL_LIGHT0);// 打开0号光源\n\n\t\t// 环境光设置\n\t\tfloat[] ambientParams =\n\t\t{ 0.46f, 0.21f, 0.05f, 1.0f };// 光参数 RGBA\n\t\tgl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, ambientParams, 0);\n\n\t\t// 散射光设置\n\t\tfloat[] diffuseParams =\n\t\t{ 0.46f, 0.21f, 0.05f, 1.0f };\n\t\tgl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, diffuseParams, 0);\n\n\t\t// 镜面光设置\n\t\tfloat[] specularParams =\n\t\t{ 0.46f, 0.21f, 0.05f, 1.0f };\n\t\tgl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, specularParams, 0);\n\n\t\t// 指定光源位置\n\t\tfloat[] directionParams =\n\t\t{ -1f, 1f, 1f, 0 };// 定向光\n\t\tgl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, directionParams, 0);\n\t}",
"@Override\n\tpublic void create() {\n\t\tassetManager = new AssetManager();\n\t\tassetManager.load(ROLIT_BOARD_MODEL, Model.class);\n\t\tassetManager.load(ROLIT_BALL_MODEL, Model.class);\n\t\t\n\t\t//construct the lighting\n\t\tenvironment = new Environment();\n\t\tenvironment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));\n\t\tenvironment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));\n\t\t\n\t\tmodelBatch = new ModelBatch();\n\t\t\n\t\tcam = new PerspectiveCamera(67f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n\t\t\n\t\tGdx.input.setInputProcessor(new InputHandler());\n\t}",
"@Override\n \t\t\t\tpublic void doCreateDirectionalLight() {\n \n \t\t\t\t}",
"WorldMaterialMap getMaterialMap();",
"void createMaterial(Material material) throws CreateException;",
"@Override\r\n public void simpleUpdate(float tpf) {\r\n// if (firstload == true) {\r\n// MainGUI.Splash.setVisible(false);\r\n// MainGUI.mjf.setVisible(true);\r\n// }\r\n light1.setDirection(\r\n new Vector3f(\r\n cam.getDirection().x,\r\n cam.getDirection().y,\r\n cam.getDirection().z));\r\n\r\n if (GUI.shapeList.isEmpty()) {\r\n rootNode.detachAllChildren();\r\n drawAxis();\r\n }\r\n if(GUI.ShapeStack.getSelectedValue() == null && !GUI.shapeList.isEmpty())\r\n {\r\n rootNode.detachAllChildren();\r\n drawAxis();\r\n for(int ii = 0 ; ii < GUI.shapeList.size(); ii++)\r\n {\r\n Shape s = GUI.shapeList.get(ii);\r\n Geometry g = s.generateGraphics();\r\n Material m = new Material(assetManager,\r\n \"Common/MatDefs/Light/Lighting.j3md\");\r\n\r\n m.setBoolean(\"UseMaterialColors\", true);\r\n m.setColor(\"Diffuse\", ColorRGBA.LightGray);\r\n m.setColor(\"Specular\", ColorRGBA.LightGray);\r\n m.setFloat(\"Shininess\", 128); // [0,128]\r\n\r\n g.setMaterial(m);\r\n rootNode.attachChild(g); \r\n }\r\n }\r\n// com.jme3.scene.shape.Box boxMesh = new com.jme3.scene.shape.Box((float) 10 / 2, (float) 10 / 2, (float) 10 / 2);\r\n// Geometry boxGeo = new Geometry(\"Shiny rock\", boxMesh);\r\n// boxGeo.setLocalTranslation((float) 0, (float) 0, (float) 0);\r\n// TangentBinormalGenerator.generate(boxMesh);\r\n// Geometry g = boxGeo;\r\n// Material m = new Material(assetManager,\r\n// \"Common/MatDefs/Light/Lighting.j3md\");\r\n//\r\n// m.setBoolean(\"UseMaterialColors\", true);\r\n// m.setColor(\"Diffuse\", ColorRGBA.LightGray);\r\n// m.setColor(\"Specular\", ColorRGBA.LightGray);\r\n// m.setFloat(\"Shininess\", 128); // [0,128]\r\n//\r\n// g.setMaterial(m);\r\n// rootNode.attachChild(g);\r\n\r\n// if (MainGUI.ShapeJList.getSelectedValue() != null) {\r\n// rootNode.detachAllChildren();\r\n// drawAxis();\r\n// for (int i = 0; i < MainGUI.allShapes.size(); i++) {\r\n// Shape s = MainGUI.allShapes.get(i);\r\n// Geometry g = s.draw();\r\n// Material m = new Material(assetManager,\r\n// \"Common/MatDefs/Light/Lighting.j3md\");\r\n//\r\n// m.setBoolean(\"UseMaterialColors\", true);\r\n// m.setColor(\"Diffuse\", ColorRGBA.LightGray);\r\n// m.setColor(\"Specular\", ColorRGBA.LightGray);\r\n// m.setFloat(\"Shininess\", 128f); // [0,128]\r\n//\r\n// if (i == MainGUI.ShapeJList.getSelectedIndex()) {\r\n// m = new Material(assetManager,\r\n// \"Common/MatDefs/Light/Lighting.j3md\");\r\n//\r\n// m.setBoolean(\"UseMaterialColors\", true);\r\n// m.setColor(\"Diffuse\", ColorRGBA.Orange);\r\n// m.setColor(\"Specular\", ColorRGBA.Orange);\r\n// m.setFloat(\"Shininess\", 128f); // [0,128]\r\n//\r\n// }\r\n// g.setMaterial(m);\r\n// rootNode.attachChild(g);\r\n//\r\n// }\r\n// }\r\n// if (!MainGUI.allShapes.isEmpty() && MainGUI.ShapeJList.getSelectedValue() == null) {\r\n// rootNode.detachAllChildren();\r\n// drawAxis();\r\n// for (int i = 0; i < MainGUI.allShapes.size(); i++) {\r\n// Shape s = MainGUI.allShapes.get(i);\r\n// Geometry g = s.draw();\r\n// Material m = new Material(assetManager,\r\n// \"Common/MatDefs/Light/Lighting.j3md\");\r\n//\r\n// m.setBoolean(\"UseMaterialColors\", true);\r\n// m.setColor(\"Diffuse\", ColorRGBA.LightGray);\r\n// m.setColor(\"Specular\", ColorRGBA.LightGray);\r\n// m.setFloat(\"Shininess\", 128); // [0,128]\r\n//\r\n// g.setMaterial(m);\r\n// rootNode.attachChild(g);\r\n// }\r\n// }\r\n firstload = false;\r\n }",
"public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}",
"public void init(SoState state)\n\n{\n // Set to GL defaults:\n// ivState.ambientColor.copyFrom( getDefaultAmbient());\n// ivState.emissiveColor.copyFrom( getDefaultEmissive());\n// ivState.specularColor.copyFrom( getDefaultSpecular());\n// ivState.shininess = getDefaultShininess();\n// ivState.colorMaterial = false;\n// ivState.blending = false;\n// ivState.lightModel = LightModel.PHONG.getValue();\n \n // Initialize default color storage if not already done\n if (defaultDiffuseColor == null) {\n defaultDiffuseColor = SbColorArray.allocate(1);\n defaultDiffuseColor.get(0).setValue(getDefaultDiffuse());\n defaultTransparency = new float[1];\n defaultTransparency[0] = getDefaultTransparency();\n defaultColorIndices = new int[1];\n defaultColorIndices[0] = getDefaultColorIndex();\n defaultPackedColor = new int[1];\n defaultPackedColor[0] = getDefaultPacked();\n }\n \n //following value will be matched with the default color, must\n //differ from 1 (invalid) and any legitimate nodeid. \n// ivState.diffuseNodeId = 0;\n// ivState.transpNodeId = 0;\n// //zero corresponds to transparency off (default).\n// ivState.stippleNum = 0;\n// ivState.diffuseColors = defaultDiffuseColor;\n// ivState.transparencies = defaultTransparency;\n// ivState.colorIndices = defaultColorIndices;\n// ivState.packedColors = defaultPackedColor;\n//\n// ivState.numDiffuseColors = 1;\n// ivState.numTransparencies = 1;\n// ivState.packed = false;\n// ivState.packedTransparent = false;\n// ivState.transpType = SoGLRenderAction.TransparencyType.SCREEN_DOOR.ordinal(); \n// ivState.cacheLevelSetBits = 0;\n// ivState.cacheLevelSendBits = 0;\n// ivState.overrideBlending = false;\n// \n// ivState.useVertexAttributes = false;\n//\n// ivState.drawArraysCallback = null;\n// ivState.drawElementsCallback = null; \n// ivState.drawArraysCallbackUserData = null;\n// ivState.drawElementsCallbackUserData = null; \n\n coinstate.ambient.copyFrom(getDefaultAmbient());\n coinstate.specular.copyFrom(getDefaultSpecular());\n coinstate.emissive.copyFrom(getDefaultEmissive());\n coinstate.shininess = getDefaultShininess();\n coinstate.blending = /*false*/0;\n coinstate.blend_sfactor = 0;\n coinstate.blend_dfactor = 0;\n coinstate.alpha_blend_sfactor = 0;\n coinstate.alpha_blend_dfactor = 0;\n coinstate.lightmodel = LightModel.PHONG.getValue();\n coinstate.packeddiffuse = false;\n coinstate.numdiffuse = 1;\n coinstate.numtransp = 1;\n coinstate.diffusearray = SbColorArray.copyOf(lazy_defaultdiffuse);\n coinstate.packedarray = IntArrayPtr.copyOf(lazy_defaultpacked);\n coinstate.transparray = FloatArray.copyOf(lazy_defaulttransp);\n coinstate.colorindexarray = IntArrayPtr.copyOf(lazy_defaultindex);\n coinstate.istransparent = false;\n coinstate.transptype = (int)(SoGLRenderAction.TransparencyType.BLEND.getValue());\n coinstate.diffusenodeid = 0;\n coinstate.transpnodeid = 0;\n coinstate.stipplenum = 0;\n coinstate.vertexordering = VertexOrdering.CCW.getValue();\n coinstate.twoside = false ? 1 : 0;\n coinstate.culling = false ? 1 : 0;\n coinstate.flatshading = false ? 1 : 0;\n coinstate.alphatestfunc = 0;\n coinstate.alphatestvalue = 0.5f;\n}",
"public static void makeGeometry(AssetManager am) {\n geom = am.loadModel(\"Models/container/container.j3o\");\n mat = new Material(am, \"Common/MatDefs/Misc/Unshaded.j3md\");\n Texture Tex = am.loadTexture(\n \"Textures/Container/Template/texture.png\");\n\n\n Colors.add(am.loadTexture(\n \"Textures/Container/blue.png\"));\n Colors.add(am.loadTexture(\n \"Textures/Container/green.png\"));\n Colors.add(am.loadTexture(\n \"Textures/Container/purple.png\"));\n Colors.add(am.loadTexture(\n \"Textures/Container/red.png\"));\n companyTextures.put(\"UPS\", am.loadTexture(\n \"Textures/Container/UPS.png\"));\n companyTextures.put(\"CocaCola\", am.loadTexture(\n \"Textures/Container/cocacola.png\"));\n companyTextures.put(\"McDonalds\", am.loadTexture(\n \"Textures/Container/mac.png\"));\n\n companyTextures.put(\"Grolsch\", am.loadTexture(\n \"Textures/Container/grolsch.png\"));\n companyTextures.put(\"Heineken\", am.loadTexture(\n \"Textures/Container/heineken.png\"));\n companyTextures.put(\"Nestle\", am.loadTexture(\n \"Textures/Container/nestle.png\"));\n companyTextures.put(\"Shell\", am.loadTexture(\n \"Textures/Container/shell.png\"));\n companyTextures.put(\"DeutschePost\", am.loadTexture(\n \"Textures/Container/post.png\"));\n companyTextures.put(\"PostBank\", am.loadTexture(\n \"Textures/Container/postbank.png\"));\n companyTextures.put(\"Airfrance\", am.loadTexture(\n \"Textures/Container/airfrance.png\"));\n\n companyTextures.put(\"BallastNedam\", am.loadTexture(\n \"Textures/Container/ballastnedam.png\"));\n companyTextures.put(\"Manpower\", am.loadTexture(\n \"Textures/Container/manpower.png\"));\n\n companyTextures.put(\"Lufthansa\", am.loadTexture(\n \"Textures/Container/lufthansa.png\"));\n companyTextures.put(\"Bayer\", am.loadTexture(\n \"Textures/Container/bayer.png\"));\n\n\n companyTextures.put(\"Danone\", am.loadTexture(\n \"Textures/Container/danone.png\"));\n companyTextures.put(\"Ericsson\", am.loadTexture(\n \"Textures/Container/ericsson.png\"));\n\n companyTextures.put(\"Danone\", am.loadTexture(\n \"Textures/Container/danone.png\"));\n companyTextures.put(\"Ericsson\", am.loadTexture(\n \"Textures/Container/ericsson.png\"));\n\n\n companyTextures.put(\"OCE\", am.loadTexture(\n \"Textures/Container/oce.png\"));\n companyTextures.put(\"BeterBed\", am.loadTexture(\n \"Textures/Container/beterbed.png\"));\n\n companyTextures.put(\"TenCate\", am.loadTexture(\n \"Textures/Container/tencate.png\"));\n\n companyTextures.put(\"FederalExpress\", am.loadTexture(\n \"Textures/Container/fedex.png\"));\n companyTextures.put(\"IBM\", am.loadTexture(\n \"Textures/Container/IBM.png\"));\n companyTextures.put(\"KraftFoods\", am.loadTexture(\n \"Textures/Container/kraft.png\"));\n companyTextures.put(\"Hanjin\", am.loadTexture(\n \"Textures/Container/hanjin.png\"));\n companyTextures.put(\"CargoTrans\", am.loadTexture(\n \"Textures/Container/cargotrans.png\"));\n\n\n companyTextures.put(\"Metro\", am.loadTexture(\n \"Textures/Container/metro.png\"));\n companyTextures.put(\"Carrefour\", am.loadTexture(\n \"Textures/Container/carefour.png\"));\n companyTextures.put(\"Amstel\", am.loadTexture(\n \"Textures/Container/amstel.png\"));\n companyTextures.put(\"TransNL\", am.loadTexture(\n \"Textures/Container/transnl.png\"));\n companyTextures.put(\"Gilette\", am.loadTexture(\n \"Textures/Container/gillete.png\"));\n\n\n companyTextures.put(\"WalMart\", am.loadTexture(\n \"Textures/Container/walmart.png\"));\n companyTextures.put(\"Delhaize\", am.loadTexture(\n \"Textures/Container/delhaize.png\"));\n companyTextures.put(\"BASF\", am.loadTexture(\n \"Textures/Container/basf.png\"));\n companyTextures.put(\"SeaTrans\", am.loadTexture(\n \"Textures/Container/seatrans.png\"));\n companyTextures.put(\"DowChemical\", am.loadTexture(\n \"Textures/Container/dow.png\"));\n\n companyTextures.put(\"AXA\", am.loadTexture(\n \"Textures/Container/axe.png\"));\n companyTextures.put(\"LLyod\", am.loadTexture(\n \"Textures/Container/lloyd.png\"));\n \n companyTextures.put(\"GJMW\", am.loadTexture(\n \"Textures/Container/GJMW.png\"));\n companyTextures.put(\"WoodNorge\", am.loadTexture(\n \"Textures/Container/woodnorge.png\"));\n companyTextures.put(\"FlowersNL\", am.loadTexture(\n \"Textures/Container/flowersnl.png\"));\n \n companyTextures.put(\"FruitINT\", am.loadTexture(\n \"Textures/Container/fruitint.png\"));\n companyTextures.put(\"IntTrans\", am.loadTexture(\n \"Textures/Container/inttrans.png\"));\n companyTextures.put(\"MaasHolland\", am.loadTexture(\n \"Textures/Container/maasholland.png\"));\n\n mat.setTexture(\"ColorMap\", Tex);\n r = new Random();\n\n mat.setColor(\"Color\", ColorRGBA.White);\n\n geom.setMaterial(mat);\n }",
"public void saveMaterials() {\n\t}",
"public static void init() {\n\t\tsetOrtho(Display.getWidth(), Display.getHeight());\n\t\tglEnable(GL_BLEND);\n\t\tglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\n\t\t\n\t\tLights.init();\n\t\tenableCulling();\n\t}",
"public Limelight(String name, boolean mode3D) {\n this(name);\n this.mode3d = mode3D; \n }",
"public void initialize()\r\n\t{\r\n\t\tgl.glClearColor(0.0F, 0.0F, 0.0F, 1.0F);\r\n\t\t// initialize blending for transparency\r\n\t\tgl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\r\n\t\tgl.glEnable(GL_DEPTH_TEST);\r\n\t\tgl.glEnable(GL_DITHER);\r\n\t\t//gl.disable(GL_ALPHA_TEST);\r\n\t\t//gl.disable(GL_COLOR_MATERIAL);\r\n\t\tgl.glShadeModel(GL_SMOOTH);\r\n\t\tgl.glDepthFunc( GL_LEQUAL );\r\n\t\tgl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);\r\n\t\tgl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);\r\n\t\tgl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\r\n\t\tgl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\r\n\t\tgl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);\r\n\t\tgl.glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);\r\n\t\tgl.glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);\r\n\t\tglj.gljCheckGL();\r\n\t}",
"public void add(Material m) {\r\n\t\tthis.materials.add(m);\r\n\t}",
"public static void lightSetUp()\r\n {\r\n lightStatusNode green = new lightStatusNode(\"Green\");\r\n lightStatusNode green2 = new lightStatusNode(\"Green\");\r\n lightStatusNode green3 = new lightStatusNode(\"Green\");\r\n lightStatusNode yellow = new lightStatusNode(\"Yellow\");\r\n lightStatusNode yellow2 = new lightStatusNode(\"Yellow\");\r\n lightStatusNode yellow3 = new lightStatusNode(\"Yellow\");\r\n lightStatusNode red = new lightStatusNode(\"Red\");\r\n lightStatusNode red2 = new lightStatusNode(\"Red\");\r\n lightStatusNode red3 = new lightStatusNode(\"Red\");\r\n lightStatusNode red4 = new lightStatusNode(\"Red\");\r\n lightStatusNode red5 = new lightStatusNode(\"Red\");\r\n lightStatusNode red6 = new lightStatusNode(\"Red\");\r\n green.setNext(green2);\r\n green2.setNext(green3);\r\n green3.setNext(yellow);\r\n yellow.setNext(yellow2);\r\n yellow2.setNext(yellow3);\r\n yellow3.setNext(red);\r\n red.setNext(red2);\r\n red2.setNext(red3);\r\n red3.setNext(red4);\r\n red4.setNext(red5);\r\n red5.setNext(red6);\r\n red6.setNext(green);\r\n light = green;\r\n light2 = red;\r\n }",
"public String getMaterial() {\n return material;\n }",
"public String getMaterial() {\n return material;\n }",
"public void bind()\r\n\t{\r\n\t\tVector3f color;\r\n\r\n\t\tcolor = ambient;\r\n\t\tglColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT);\r\n\t\tglColor4f(color.x, color.y, color.z, transparency);\r\n\r\n\t\tcolor = diffuse;\r\n\t\tglColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);\r\n\t\tglColor4f(color.x, color.y, color.z, transparency);\r\n\r\n\t\tcolor = specular;\r\n\t\tglColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);\r\n\t\tglColor4f(color.x, color.y, color.z, transparency);\r\n\r\n\t\tif (texture != null)\r\n\t\t{\r\n\t\t\ttexture.bind();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tglBindTexture(GL_TEXTURE_2D, 0);\r\n\t\t}\r\n\t}",
"public Pj3dLight Light()\r\n\t{\r\n\t\tPj3dLight light = new Pj3dLight(this);\r\n\t\treturn light;\r\n\t}",
"private void construct(){\n TriangleMesh mesh;\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/bunny.obj\");\n mesh.setMaterial(new MaterialNode(0.1f, 0.1f, .5f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/cube.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 0, 0));\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/teddy.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 0, 1, 0));\n mesh.setMaterial(new MaterialNode(0.1f, .5f, 0.1f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/sphere.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 1, 0));\n mesh.setMaterial(new MaterialNode(1, 0, 0, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n scene.calculateNormals();\n scene.setupRendering();\n }",
"public void useLighting(Lighting[] lightings) {\n int num = 0;\n for (Lighting lighting : lightings)\n for (int j = 0; j < lighting.getNumLights(); j++) {\n SpotLightSource source = lighting.getSource(j);\n setUniformV3(getLightsMemberLocation(num, STRUCT_POS), source.getPos());\n setUniformV3(getLightsMemberLocation(num, STRUCT_COLOR), source.getColor());\n setUniformV3(getLightsMemberLocation(num, STRUCT_AM_COLOR), source.getAmColor());\n setUniformf(getLightsMemberLocation(num, STRUCT_ATTENUATION), source.getAttenuation());\n setUniformf(getLightsMemberLocation(num, STRUCT_GRADIENT), source.getGradient());\n num++;\n }\n setUniformi(uNumLights, num);\n }",
"public static List<Material> parseMTL(File f, Model m)\n\t{\n\t\tList<Material> mats = new ArrayList<Material>();\n\t\tint matNum = -1;\n\n\t\ttry{\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(f));\n\t\t\tMaterial mtl = null;\n\t\t\tString line;\n\n\t\t\twhile((line = reader.readLine())!=null)\n\t\t\t{\t\n\t\t\t\t//Declaring a new material\n\t\t\t\tif(line.startsWith(\"newmtl \"))\n\t\t\t\t{\n\t\t\t\t\t//If this is not the first material,\n\t\t\t\t\t//Add the current material to the mats list\n\t\t\t\t\t//before creating a new one\n\t\t\t\t\tif(mtl != null)\n\t\t\t\t\t\tmats.add(mtl);\n\n\t\t\t\t\t//Make mtl a new material and set name and id\n\t\t\t\t\tmtl = new Material();\n\t\t\t\t\tmtl.name = line.split(\" \")[1];\n\t\t\t\t\tmtl.id = -1;\n\t\t\t\t}\n\t\t\t\t//Specifying ambient color of material\n\t\t\t\telse if(line.startsWith(\"Ka \"))\n\t\t\t\t{\n\t\t\t\t\t//Just split line up and set the ambient\n\t\t\t\t\tmtl.ambient = new Vector3f(\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3])\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//Specifying diffuse color of material\n\t\t\t\telse if(line.startsWith(\"Kd \"))\n\t\t\t\t{\n\t\t\t\t\tmtl.diffuse = new Vector3f(\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3])\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//Specifying specular color of material\n\t\t\t\telse if(line.startsWith(\"Ks \"))\n\t\t\t\t{\n\t\t\t\t\tmtl.specular = new Vector3f(\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2]),\n\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3])\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//Specifying coefficiant of specular color\n\t\t\t\t//TODO add support for specular coefficiants\n\t\t\t\telse if(line.startsWith(\"Ns \"))\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t\t//Specifying ambient texture map\n\t\t\t\t//TODO add support for ambient texture map\n\t\t\t\telse if(line.startsWith(\"map_Ka \"))\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\t//Specifying diffuse texture map\n\t\t\t\telse if(line.startsWith(\"map_Kd \"))\n\t\t\t\t{\n\t\t\t\t\tmatNum++;\n\t\t\t\t\t//Set the material's texture to specified texture\n\t\t\t\t\tmtl.texture = MyTextureLoader.getTexture(f.getParentFile() + File.separator + line.split(\" \")[1]);\n\t\t\t\t\tm.textures.add(mtl.texture);\n\t\t\t\t\t//m.texture = mtl.texture;\n\t\t\t\t\tmtl.id = matNum;\n\t\t\t\t}\n\t\t\t\t//Specifying specular texture map\n\t\t\t\t//TODO add support for specular texture map\n\t\t\t\telse if(line.startsWith(\"map_Ks \"))\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t\t//Specifying highlight component map\n\t\t\t\t//TODO add support for highlight component map\n\t\t\t\telse if(line.startsWith(\"map_Ns \"))\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\n\t\t\tmats.add(mtl);\n\t\t}\n\t\tcatch(FileNotFoundException e){e.printStackTrace();} \n\t\tcatch (IOException e) {e.printStackTrace();}\n\n\t\treturn mats;\n\t}",
"OurIfcMaterial createOurIfcMaterial();",
"public SGNode initialise() {\n\n //Import textures\n int[] dirtySnow_texture = TextureLibrary.loadTexture(gl, \"textures/dirty_snow.jpg\");\n int[] snow_texture = TextureLibrary.loadTexture(gl, \"textures/snow_test.jpg\");\n int[] button_texture = TextureLibrary.loadTexture(gl, \"textures/wood.jpg\");\n int[] carrot_texture = TextureLibrary.loadTexture(gl, \"textures/carrot.jpg\");\n int[] stone_texture = TextureLibrary.loadTexture(gl, \"textures/stone.jpg\");\n int[] santa_texture = TextureLibrary.loadTexture(gl, \"textures/santa_texture.jpg\");\n int[] fluff_texture = TextureLibrary.loadTexture(gl, \"textures/fluff_texture.jpg\");\n\n //BODY && HEAD///////////////////////////////////////////////////////////////////////////////////////////////////////////\n Shader shader = new Shader(gl, \"vs/standard.txt\", \"fs/snowman.txt\");\n Mesh mesh = new Mesh(gl, Sphere.vertices.clone(), Sphere.indices.clone());\n Material material = new Material(new Vec3(0.2f, 0.2f, 0.31f), new Vec3(0.2f, 0.2f, 0.2f), new Vec3(0.1f, 0.1f, 0.1f),2.0f);\n Mat4 modelMatrix = Mat4Transform.translate(0,0.5f,0);\n sphere = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, snow_texture, dirtySnow_texture);\n\n //Models for the head\n shader = new Shader(gl, \"vs/standard.txt\", \"fs/single_texture.txt\");\n\n stoneMouth = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, stone_texture);\n nose = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, carrot_texture);\n\n //button model used for eyes and three buttons\n modelMatrix = Mat4Transform.translate(0,0.5f,0);\n button = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, button_texture);\n\n //Hat\n hatfluff = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, snow_texture, fluff_texture);\n bobble = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, fluff_texture);\n material = new Material(new Vec3(0.8f, 0.1f, 0.1f), new Vec3(0.8f, 0.1f, 0.1f), new Vec3(0.6f, 0.6f, 0.6f),2.0f);\n mesh = new Mesh(gl, Cone.vertices.clone(), Cone.indices.clone());\n santaHat = new Model(gl, camera, light, spotLight, shader, material, modelMatrix, mesh, santa_texture);\n\n // SNOWMAN CONSTRUCTION////////////////////////////////////////////////////////////////////////////////////////////////////\n\n float x, y, z;\n Mat4 buttonScaleTransform = Mat4Transform.scale(BUTTONSIZE, BUTTONSIZE, BUTTONSIZE);\n\n snowmanRoot = new NameNode(\"root\");\n snowmanRockTransform = new TransformNode(\"rock snowman\", new Mat4(1));\n snowmanMoveXTranslate = new TransformNode(\"snowman x move transform\", new Mat4(1));\n snowmanMoveZTranslate = new TransformNode(\"snowman Z move transform\", new Mat4(1));\n //////////////////////////BODY///////////////////////////////////////////////\n NameNode body = new NameNode(\"body\");\n Mat4 m = Mat4Transform.scale(BODYSIZE,BODYSIZE,BODYSIZE);\n m = Mat4.multiply(m, Mat4Transform.translate(0,0.5f,0));\n\n TransformNode bodyTransform = new TransformNode(\"body transform\", m);\n ModelNode bodyShape = new ModelNode(\"Sphere(body)\", sphere);\n\n /////////////////////BUTTONS///////////////////////////////////////\n NameNode buttons = new NameNode(\"buttons\");\n y = (float)(BODYSIZE*0.486);\n z = (float)(BODYSIZE*0.502);\n m = Mat4.multiply(Mat4Transform.translate(0, y, z), buttonScaleTransform);\n TransformNode buttonOneTransform = new TransformNode(\"button one\", m);\n ModelNode buttonOneShape = new ModelNode(\"button one\", button);\n\n y = (float)(BODYSIZE*0.686);\n z = (float)(BODYSIZE*0.469);\n m = Mat4.multiply(Mat4Transform.translate(0, y, z), buttonScaleTransform);\n TransformNode buttonTwoTransform = new TransformNode(\"button two\", m);\n ModelNode buttonTwoShape = new ModelNode(\"button two\", button);\n\n y = (float)(BODYSIZE*0.886);\n z = (float)(BODYSIZE*0.356);\n m = Mat4.multiply(Mat4Transform.translate(0, y, z), buttonScaleTransform);\n TransformNode buttonThreeTransform = new TransformNode(\"button three\", m);\n ModelNode buttonThreeShape = new ModelNode(\"button three\", button);\n\n //translate head up body height\n m = Mat4Transform.translate(0,(float)(BODYSIZE/2),0);\n TransformNode halfBodyHeight = new TransformNode(\"body height transform\", m);\n rollHead = new TransformNode(\"body height transform\", new Mat4(1));\n m = Mat4Transform.translate(0,(float)(BODYSIZE/2),0);\n TransformNode bodyHeight = new TransformNode(\"body height transform\", m);\n ///////////////////////////////HEAAD/////////////////////////////////////////////////\n NameNode head = new NameNode(\"head\");\n m = Mat4Transform.scale(HEADSIZE,HEADSIZE,HEADSIZE);\n m = Mat4.multiply(m, Mat4Transform.translate(0,0.5f,0));\n TransformNode headTransform = new TransformNode(\"head transform\", m);\n ModelNode headShape = new ModelNode(\"Sphere(head)\", sphere);\n\n ///////////////////EYES//////////////////////////////////////////////////\n NameNode eyes = new NameNode(\"eyes\");\n x = (float)(HEADSIZE*0.14);\n y = (float)(HEADSIZE*0.7);\n z = (float)(HEADSIZE*0.47);\n m = Mat4.multiply(Mat4Transform.translate(-x, y, z), buttonScaleTransform);\n TransformNode eyeLeftTransform = new TransformNode(\"eye left\", m);\n ModelNode eyeLeftShape = new ModelNode(\"eye left\", button);\n\n m = Mat4.multiply(Mat4Transform.translate(x, y, z), buttonScaleTransform);\n TransformNode eyeRightTransform = new TransformNode(\"eye right\", m);\n ModelNode eyeRightShape = new ModelNode(\"eye right\", button);\n\n ///////////////////NOSE///////////////////////////////////////////////////\n NameNode carrotNose = new NameNode(\"nose\");\n y = (float)(HEADSIZE*0.5);\n z = (float)(HEADSIZE* 0.6);\n m = Mat4.multiply(Mat4Transform.translate(0, y, z), Mat4Transform.scale(0.15f,0.15f,0.6f));\n TransformNode noseTransform = new TransformNode(\"nose transform\", m);\n ModelNode noseShape = new ModelNode(\"nose shape\", nose);\n\n ///////////////////MOUTH////////////////////////////////////////////////\n NameNode mouth = new NameNode(\"mouth\");\n y = (float)(HEADSIZE*0.3);\n z = (float)(HEADSIZE*0.45);\n m = Mat4.multiply(Mat4Transform.translate(0, y, z), Mat4Transform.scale(0.45f,0.15f,0.15f));\n TransformNode mouthTransform = new TransformNode(\"mouth transform\", m);\n ModelNode mouthShape = new ModelNode(\"mouth shape\", stoneMouth);\n\n //////////////////HAT////////////////////////////////////////////////////////\n\n NameNode hatFluff = new NameNode(\"hatFluff\");\n m = Mat4Transform.scale(HEADSIZE-0.15f,HEADSIZE-0.5f,HEADSIZE-0.15f);\n float theHeight = (float)(HEADSIZE/2 );\n m = Mat4.multiply(m, Mat4Transform.translate(0,theHeight + 0.2f,0));\n TransformNode hatFluffTransfom = new TransformNode(\"hatFluff transform\", m);\n ModelNode hatFluffShape = new ModelNode(\"hatFluff shape\", hatfluff);\n\n NameNode hat = new NameNode(\"hat\");\n y = (float)(HEADSIZE);\n m = Mat4.multiply(Mat4Transform.translate(0, y+ 1.62f,0 ), Mat4Transform.scale(1f,1f,1f));\n m = Mat4.multiply(m, Mat4Transform.rotateAroundY(180));\n TransformNode hatTransform = new TransformNode(\"hat transform\", m);\n ModelNode hatShape = new ModelNode(\"hat shape\", santaHat);\n\n\n NameNode hat_bobble = new NameNode(\"bobble_right\");\n y = (float)(HEADSIZE);\n m = Mat4.multiply(Mat4Transform.rotateAroundZ(-60), Mat4Transform.translate(0,0.1f,0 ));\n m = Mat4.multiply(m, Mat4Transform.scale(0.5f,0.5f,0.5f));\n TransformNode bobbleTransform = new TransformNode(\"bobble_right transform\", m);\n ModelNode bobbleShape = new ModelNode(\"bobble_right shape\", bobble);\n\n\n snowmanRoot.addChild(snowmanMoveXTranslate);\n snowmanMoveXTranslate.addChild(snowmanMoveZTranslate);\n snowmanMoveZTranslate.addChild(snowmanRockTransform);\n snowmanRockTransform.addChild(body);\n\n //BODY\n body.addChild(bodyTransform);\n bodyTransform.addChild(bodyShape);\n body.addChild(buttons);\n buttons.addChild(buttonOneTransform);\n buttonOneTransform.addChild(buttonOneShape);\n buttons.addChild(buttonTwoTransform);\n buttonTwoTransform.addChild(buttonTwoShape);\n buttons.addChild(buttonThreeTransform);\n buttonThreeTransform.addChild(buttonThreeShape);\n\n //HEAD\n body.addChild(halfBodyHeight);\n halfBodyHeight.addChild(rollHead);\n rollHead.addChild(bodyHeight);\n bodyHeight.addChild(head);\n head.addChild(headTransform);\n headTransform.addChild(headShape);\n head.addChild(eyes);\n eyes.addChild(eyeLeftTransform);\n eyeLeftTransform.addChild(eyeLeftShape);\n eyes.addChild(eyeRightTransform);\n eyeRightTransform.addChild(eyeRightShape);\n head.addChild(carrotNose);\n carrotNose.addChild(noseTransform);\n noseTransform.addChild(noseShape);\n head.addChild(mouth);\n mouth.addChild(mouthTransform);\n mouthTransform.addChild(mouthShape);\n\n //Hat\n head.addChild(hat);\n hat.addChild(hatTransform);\n hatTransform.addChild(hatShape);\n hatShape.addChild(hat_bobble);\n hat_bobble.addChild(bobbleTransform);\n bobbleTransform.addChild(bobbleShape);\n hat.addChild(hatFluff);\n hatFluff.addChild(hatFluffTransfom);\n hatFluffTransfom.addChild(hatFluffShape);\n\n\n snowmanRoot.update();\n\n return snowmanRoot;\n }",
"private void initLight(double cx, double cy) {\n light = new ConeLight(cx, cy, cx + 800, cy, Color.WHITE, 1000, math);\n light.setBrightness(.07f);\n lightController = new DirectedLightController((DirectedLight) light);\n }",
"String getMaterial();",
"public void setHasLightSource(Creature creature, byte colorRed, byte colorGreen, byte colorBlue, byte radius) {\n/* 5521 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 5525 */ if (vz.getWatcher().getWurmId() == creature.getWurmId())\n/* */ {\n/* 5527 */ vz.sendAttachCreatureEffect(null, (byte)0, colorRed, colorGreen, colorBlue, radius);\n/* */ \n/* */ }\n/* */ else\n/* */ {\n/* 5532 */ vz.sendAttachCreatureEffect(creature, (byte)0, colorRed, colorGreen, colorBlue, radius);\n/* */ }\n/* */ \n/* */ }\n/* 5536 */ catch (Exception e) {\n/* */ \n/* 5538 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }",
"private void createModel() {\n model = new Node(\"Enemy\"+enemyCounter);\n Box b = new Box(.5f, 2, .5f);\n Geometry bg = new Geometry(\"Box\", b);\n Material bm = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n Sphere sphere = new Sphere(32, 32, 1.5f, false, false);\n Geometry sg = new Geometry(\"Sphere\", sphere);\n Material sm = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n bm.setColor(\"Color\", ColorRGBA.Blue);\n sm.setColor(\"Color\", ColorRGBA.Red);\n bg.setMaterial(bm); \n sg.setMaterial(sm);\n model.attachChild(bg);\n model.attachChild(sg);\n sg.setLocalTranslation(0,2.5f,0);\n \n attachChild(model);\n }",
"ExpMaterial createExpMaterial(Container container, Lsid lsid);",
"private void initRender() {\n if (!isRenderable()) {\n throw new IllegalStateException(\"Make the mesh renderable before rendering!\");\n }\n \n //Set active texture if it exists\n if (material.hasTexture()) {\n glActiveTexture(GL_TEXTURE0);\n glBindTexture(GL_TEXTURE_2D, material.getTexture().getId());\n }\n\n if (material.hasNormalMap()) {\n glActiveTexture(GL_TEXTURE1);\n glBindTexture(GL_TEXTURE_2D, material.getNormalMap().getId());\n }\n\n //Draw mesh\n glBindVertexArray(vaoId);\n glEnableVertexAttribArray(0);\n glEnableVertexAttribArray(1);\n glEnableVertexAttribArray(2);\n glEnableVertexAttribArray(3);\n glEnableVertexAttribArray(4);\n }",
"public Light(Color color, boolean castsShadows){\n this.color = color;\n this.castsShadows = castsShadows;\n }",
"public void renderWorld(boolean renderWithLight);",
"public void Load(String filename)\n\t{\n\t\tTF3D_PARSER PARSER = new TF3D_PARSER();\n\t\tTF3D_Material mat;\n\t\tint BLOCK_ID;\n\t\tString tmp_str;\n\n\t\tSystem.out.println(\"Loading config... \" + filename);\n\t\tBoolean Exist = F3D.AbstractFiles.ExistFile(filename);\n\n\t\tif (!Exist)\n\t\t{\n\t\t\tSystem.out.print(\"Can't load file:\" + filename);\t\t\t\n\t\t}\n\n\t\tPARSER.ParseFile(F3D.AbstractFiles.GetFullPath(filename));\n\n\t\tfor (BLOCK_ID = 0; BLOCK_ID < PARSER.GetBlocksCount(); BLOCK_ID++)\n\t\t{\n\t\t\tPARSER.SetBlock(BLOCK_ID);\n\t\t\tmat = new TF3D_Material();\n\n\t\t\t// get type\n\t\t\ttmp_str = PARSER.GetAs_STRING(\"type\");\n\n\t\t\tif (tmp_str.equalsIgnoreCase(\"MAT_TEXTURE\"))\n\t\t\t{\n\t\t\t\tmat.typ = F3D.MAT_TYPE_TEXTURE;\n\t\t\t}\n\n\t\t\tif (tmp_str.equalsIgnoreCase(\"MAT_SHADER\"))\n\t\t\t{\n\t\t\t\tmat.typ = F3D.MAT_TYPE_SHADER;\n\t\t\t\t// get Shader name\n\t\t\t\tmat.shader_name = PARSER.GetAs_STRING(\"shader\");\n\t\t\t\tmat.shader_id = F3D.Shaders.FindByName(mat.shader_name);\n\t\t\t\tif (mat.shader_id >= 0)\n\t\t\t\t{\n\t\t\t\t\tmat.use_shader = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get name\n\t\t\tmat.name = PARSER.GetAs_STRING(\"name\");\n\n\t\t\t// get material colors deinition\t\t\t \n\n\t\t\tmat.colors.SetDiffuse(PARSER.GetAs_VECTOR4F(\"diffuse\"));\n\t\t\tmat.colors.SetAmbient(PARSER.GetAs_VECTOR4F(\"ambient\"));\n\t\t\tmat.colors.SetSpecular(PARSER.GetAs_VECTOR4F(\"specular\"));\n\t\t\tmat.colors.SetEmissive(PARSER.GetAs_VECTOR4F(\"emissive\"));\n\t\t\tmat.colors.shinisess = PARSER.GetAs_FLOAT(\"shinisess\");\n\t\t\t\n\t\t\tif (mat.colors.shinisess>128.0f)\n\t\t\t{\n\t\t\t\tmat.colors.shinisess=127.0f;\n\t\t\t}\n\t\t\t\n\t\t\t// get texture 0 .. 3\n\t\t\tmat.texture_unit[0].texture_name = PARSER.GetAs_STRING(\"texture_0\");\n\t\t\tmat.texture_unit[1].texture_name = PARSER.GetAs_STRING(\"texture_1\");\n\t\t\tmat.texture_unit[2].texture_name = PARSER.GetAs_STRING(\"texture_2\");\n\t\t\tmat.texture_unit[3].texture_name = PARSER.GetAs_STRING(\"texture_3\");\n\n\t\t\t// get event 0 .. 3\n\t\t\tmat.texture_unit[0].event_name = PARSER.GetAs_STRING(\"event_0\");\n\t\t\tmat.texture_unit[1].event_name = PARSER.GetAs_STRING(\"event_1\");\n\t\t\tmat.texture_unit[2].event_name = PARSER.GetAs_STRING(\"event_2\");\n\t\t\tmat.texture_unit[3].event_name = PARSER.GetAs_STRING(\"event_3\");\n\n\t\t\t// get depthtest\n\t\t\tmat.bDepthTest = PARSER.GetAs_BOOLEAN(\"depthtest\");\n\n\t\t\t// get alphatest\n\t\t\tmat.bAlphaTest = PARSER.GetAs_BOOLEAN(\"alphatest\");\n\n\t\t\t// get faceculling\n\t\t\tmat.bFaceCulling = PARSER.GetAs_BOOLEAN(\"faceculling\");\n\t\t\tF3D.Log.warning(\"Culling\", mat.name + \" \" + mat.bFaceCulling.toString());\n\n\t\t\t// prepare textures\n\t\t\tfor (int t = 0; t < F3D.MAX_TMU; t++)\n\t\t\t{\n\t\t\t\tif (mat.texture_unit[t].texture_name.equals(\"none\"))\n\t\t\t\t{\n\t\t\t\t\tmat.texture_unit[t].bTexture = false;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tBoolean exist = F3D.Textures.Exist(mat.texture_unit[t].texture_name);\n\n\t\t\t\t\tif (exist)\n\t\t\t\t\t{\n\t\t\t\t\t\tmat.texture_unit[t].texture_id = F3D.Textures.FindByName(mat.texture_unit[t].texture_name);\n\t\t\t\t\t\tmat.texture_unit[t].bTexture = true;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tF3D.Log.error(\"TF3D_SurfaceManager\", \"Texture name: '\" + mat.texture_unit[t].texture_name + \"' missing (texture you have to load first !)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mat.texture_unit[t].event_name.equalsIgnoreCase(\"none\"))\n\t\t\t\t{\n\t\t\t\t\tmat.texture_unit[t].bEvent = false;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tBoolean exist = F3D.MaterialEvents.Exist(mat.texture_unit[t].event_name);\n\n\t\t\t\t\tif (exist)\n\t\t\t\t\t{\n\t\t\t\t\t\tmat.texture_unit[t].event_id = F3D.MaterialEvents.FindByName(mat.texture_unit[t].event_name);\n\t\t\t\t\t\tmat.texture_unit[t].bEvent = true;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tF3D.Log.error(\"TF3D_SurfaceManager\", \"Event name: '\" + mat.texture_unit[t].event_name + \"' missing (events you have to load first !)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.Add(mat);\n\t\t}\n\n\t}",
"public static void start(){\n new Light(new Vector3f(getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2));\n Keyboard.enableRepeatEvents(true);\n createWindow();\n initGL();\n generateWorld();\n Game.gameLoop();\n }",
"public LightSystem(Vector3f position, Vector3f default_position, Vector3f colour, Vector3f attenuation) {\n super(position, colour, attenuation);\n this.default_position = default_position;\n\t}",
"public Light(boolean isOn) {\n\t\tthis.isOn = isOn;\n\t}",
"private void initRendering() {\n\t\tmActivity.showDebugMsg(\" initRendering\");\n\t\tGLES20.glClearColor(0.0f, 0.0f, 0.0f, Vuforia.requiresAlpha() ? 0.0f : 1.0f);\n\n\t\tfor (Texture t : mTextures) {\n\t\t\tGLES20.glGenTextures(1, t.mTextureID, 0);\n\t\t\tGLES20.glBindTexture(GLES20.GL_TEXTURE_2D, t.mTextureID[0]);\n\t\t\tGLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);\n\t\t\tGLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);\n\t\t\tGLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, t.mWidth, t.mHeight, 0, GLES20.GL_RGBA,\n\t\t\t\t\tGLES20.GL_UNSIGNED_BYTE, t.mData);\n\t\t}\n\n\t\tshaderProgramID = ArUtils.createProgramFromShaderSrc(\n\t\t\t\tShaders.CUBE_MESH_VERTEX_SHADER,\n\t\t\t\tShaders.CUBE_MESH_FRAGMENT_SHADER);\n\n\t\tvertexHandle = GLES20.glGetAttribLocation(shaderProgramID,\n\t\t\t\t\"vertexPosition\");\n\t\ttextureCoordHandle = GLES20.glGetAttribLocation(shaderProgramID,\n\t\t\t\t\"vertexTexCoord\");\n\t\tmvpMatrixHandle = GLES20.glGetUniformLocation(shaderProgramID,\n\t\t\t\t\"modelViewProjectionMatrix\");\n\t\ttexSampler2DHandle = GLES20.glGetUniformLocation(shaderProgramID,\n\t\t\t\t\"texSampler2D\");\n\n\t\tif (!mModelIsLoaded) {\n\t\t\t//object = new Teapot();\n\t\t\tobject = mActivity.get3DObject();\n\t\t\tobjectScaleFloat *= object.getDefScale();\n\t\t\t//minObjectScale *= object.getDefScale();\n\t\t\t//maxObjectScale *= object.getDefScale();\n\n\t\t\tmActivity.showDebugMsg(\"Loading model Teapot\");\n\t\t\t// Hide the Loading Dialog\n\t\t\t//mActivity.loadingDialogHandler.sendEmptyMessage(LoadingDialogHandler.HIDE_DIALOG);\n\t\t}\n\n\t}",
"private void createLights(TiledMap map)\r\n\t{\r\n\t\tlightLayer = map.getLayers().get(\"Lights\").getObjects();\r\n\r\n\t\tfor (int count = 0; count < lightLayer.getCount(); count++)\r\n\t\t{\r\n\t\t\tRectangleMapObject obj = (RectangleMapObject) lightLayer.get(count);\r\n\r\n\t\t\tnew PointLight(lightHandler, 10, Color.WHITE, 30,\r\n\t\t\t\t\tobj.getRectangle().x / Constants.BOX_SCALE,\r\n\t\t\t\t\tobj.getRectangle().y / Constants.BOX_SCALE);\r\n\t\t}\r\n\t}",
"public ItemBuilder setMaterial(Material material) {\r\n\t\tthis.material = material;\r\n\t\treturn this;\r\n\t}",
"public void setMaterial(NBTTagCompound tag) {\n if(tag!=null && tag.hasKey(Names.NBT.material) && tag.hasKey(Names.NBT.materialMeta)) {\n this.materialName = tag.getString(Names.NBT.material);\n this.materialMeta = tag.getInteger(Names.NBT.materialMeta);\n }\n }"
] | [
"0.7363775",
"0.7273748",
"0.7012916",
"0.6750069",
"0.66694564",
"0.6632567",
"0.6567647",
"0.6529665",
"0.65258616",
"0.6490759",
"0.6467179",
"0.6465052",
"0.6432142",
"0.6430687",
"0.6430687",
"0.6420572",
"0.6399848",
"0.6390274",
"0.6283923",
"0.62771624",
"0.6226007",
"0.6199204",
"0.61943847",
"0.6189099",
"0.61866486",
"0.6181703",
"0.6125626",
"0.6108068",
"0.60720825",
"0.6069505",
"0.6055254",
"0.6054095",
"0.6050315",
"0.6032037",
"0.6016597",
"0.6014293",
"0.60138",
"0.6003406",
"0.60033727",
"0.6000789",
"0.5999768",
"0.5995125",
"0.5975447",
"0.59472996",
"0.5942163",
"0.5921326",
"0.5909961",
"0.59020627",
"0.5901519",
"0.58687294",
"0.585724",
"0.585559",
"0.58506083",
"0.5836524",
"0.58274287",
"0.5821403",
"0.58113444",
"0.58078915",
"0.5799578",
"0.57960343",
"0.57827246",
"0.5770728",
"0.5767039",
"0.5764866",
"0.57556295",
"0.5741553",
"0.5729692",
"0.57114714",
"0.5703382",
"0.5697436",
"0.56847245",
"0.5683789",
"0.56818277",
"0.56654084",
"0.56370103",
"0.5629839",
"0.5629839",
"0.5626684",
"0.5624992",
"0.5622626",
"0.5621685",
"0.561463",
"0.5606511",
"0.5604237",
"0.5603088",
"0.5600361",
"0.55880356",
"0.5586215",
"0.558554",
"0.55784935",
"0.557835",
"0.5577715",
"0.5565899",
"0.55630493",
"0.5560302",
"0.55499846",
"0.5549984",
"0.5545661",
"0.55420625",
"0.55359435"
] | 0.74324614 | 0 |
Draw text info on display | private void drawText(GL gl, GLUT glut, double t)
{
String message;
DecimalFormat twodigit = new DecimalFormat("00");
// Put orthographic matrix on projection stack
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glOrtho(0, 1, 0, 1, -1, 1);
gl.glMatrixMode(GL.GL_MODELVIEW);
// Form text
message = new String((int)t/60 + ":" +
twodigit.format((int)t % 60) + "." +
twodigit.format((int)(100 * (t - (int)t))));
// Add on frame rate to message if it has a valid value
double fps = computeFPS(t);
if (fps != 0) {
DecimalFormat fpsFormat = new DecimalFormat("0.0");
message = message + " (" + fpsFormat.format(fps) + " fps)";
fpsFormat = null;
}
gl.glDisable(GL.GL_LIGHTING);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glPushMatrix();
gl.glLoadIdentity();
// Draw text
gl.glColor3d(0.8, 0.2, 0.2);
gl.glRasterPos2d(0.01, 0.01);
glut.glutBitmapString(glut.BITMAP_HELVETICA_18, message);
message = null;
// Draw bug cam label
if (drawBugView.value) {
message = new String("BUG CAM");
gl.glRasterPos2d(0.45, 0.01);
gl.glColor3d(1.0, 1.0, 1.0);
glut.glutBitmapString(glut.BITMAP_HELVETICA_18, message);
message = null;
}
glut.glutBitmapString(glut.BITMAP_HELVETICA_10, new String(goal.toString()));
message = new String(Double.toString(mainBug.dist));
glut.glutBitmapString(glut.BITMAP_HELVETICA_10, message);
gl.glPopMatrix();
gl.glEnable(GL.GL_DEPTH_TEST);
// Put back original viewing matrix
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL.GL_MODELVIEW);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void draw_text() {\n\t\tcopy_text_into_buffer();\n\t\tVoteVisApp.instance().image(text_buffer_, frame_height_ / 2,\n\t\t\t-text_graphics_.height / 2);\n\t}",
"public void displayText() {\n\n // Draws the border on the slideshow aswell as the text\n image(border, slideshowPosX - borderDisplace, textPosY - textMargin - borderDisplace);\n\n // color of text background\n fill(textBackground);\n\n //background for text\n rect(textPosX - textMargin, textPosY - textMargin, textSizeWidth + textMargin * 2, textSizeHeight + textMargin * 2);\n\n //draw text\n image(texts[scene], textPosX, textPosY, textSizeWidth, textSizeHeight, 0, 0 + scrolled, texts[scene].width, textSizeHeight + scrolled);\n }",
"private void draw(){\n\t\t\t Point level = new Point(txtBoard_top_left.x, txtBoard_top_left.y);\n\t\t\t level_info = new TextInfo(g, level, txt_width, size*4, LEVEL, this.level);\n\t\t\t level_info.drawTextInfo();\n\t\t\t \n\t\t\t // draw 2nd text info\n\t\t\t Point lines = new Point(level.x, level.y+size*2);\n\t\t\t lines_info = new TextInfo(g, lines, txt_width, size*4, LINES, this.lines);\n\t\t\t lines_info.drawTextInfo();\n\t\t\t \n\t\t\t // draw 3rd text info\n\t\t\t Point score = new Point(lines.x, lines.y+size*2);\n\t\t\t score_info = new TextInfo(g, score, txt_width, size*4, SCORE, this.score);\n\t\t\t score_info.drawTextInfo();\t\t\n\t\t}",
"public void infoDisplay()\n{\n image(logo, 710, 100);\n textSize(40);\n fill(0);\n text(\"Beijing Residents Trajectory\", 600, 50);\n textSize(30);\n fill(0, 102, 153);\n text(\"Movement Analysis\", 80, 30);\n textSize(18);\n// text(\"Mode Switch\", 150, 70);\n fill(0);\n textSize(30);\n text(\"Weekday\", 340, 90);\n text(\"Weekend\", 1180, 90);\n textSize(13);\n fill(0, 102, 153); \n text(\"Read Me\", tx, ty);\n text(\"SPACE - start & pause\", tx, ty+bl);\n text(\" TAB - change basemap\", tx, ty+2*bl);\n text(\" < - backwards\", tx, ty+3*bl);\n text(\" > - forwards\", tx, ty+4*bl);\n text(\" z - zoom to layer\", tx, ty+5*bl);\n text(\"Click legend button to select transport mode\", tx, ty+6*bl);\n textSize(15);\n fill(255, 0, 0);\n text(\"CURRENT TIME \" + timeh + \":\" + timem, 740, 650);\n}",
"private void createText() {\n Texture texture = new Texture(Gdx.files.internal(\"Text/item.png\"));\n texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);\n TextureRegion region = new TextureRegion(texture);\n display = new BitmapFont(Gdx.files.internal(\"Text/item.fnt\"), region, false);\n display.setUseIntegerPositions(false);\n display.setColor(Color.BLACK);\n }",
"void draw_text(int x, int y, char[][] _display, String txt) {\n for (int i = 0; i < txt.length(); i++)\n {\n draw_char(x + i, y, _display, txt.charAt(i));\n }\n }",
"public void renderText(float x ,float y ){\n ttf.drawString(x, y, text);\n }",
"@Override\n\tpublic void render(Canvas c) {\n\t\tc.drawText(text,(float)x+width,(float)y+height , paint);\n\t\t\n\t}",
"private void drawXYZText() {\n\t\t//Draw text X - red\n\t\tgl.glColor3f(1.0f, 0.0f, 0.0f);\n\t\tgl.glRasterPos3f(1,0,0);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"X\");\n\t\tgl.glEnd();\n\t\t//Draw text -X - red\n\t\tgl.glColor3f(1.0f, 0.0f, 0.0f);\n\t\tgl.glRasterPos3f(-1,0,0);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"-X\");\n\t\tgl.glEnd();\n\t\t\n\t\t//Draw text Y - Green\n\t\tgl.glColor3f(0.0f, 1.0f, 0.0f);\n\t\tgl.glRasterPos3f(0,1,0);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"Y\");\n\t\tgl.glEnd();\n\t\t//Draw text -Y - Green\n\t\tgl.glColor3f(0.0f, 1.0f, 0.0f);\n\t\tgl.glRasterPos3f(0,-1,0);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"-Y\");\n\t\tgl.glEnd();\n\t\t\n\t\t//Draw text Z - Blue\n\t\tgl.glColor3f(0.0f, 0.0f, 1.0f);\n\t\tgl.glRasterPos3f(0,0,1);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"Z\");\n\t\tgl.glEnd();\n\t\t//Draw text -Z - Blue\n\t\tgl.glColor3f(0.0f, 0.0f, 1.0f);\n\t\tgl.glRasterPos3f(0,0,-1);\n\t\tglut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, \"-Z\");\n\t\tgl.glEnd();\n\t}",
"public void drawNoticeText(int h){\r\n Font font=new Font(\"SanSerif\",Font.BOLD,15); \r\n g.setColor(Color.red);\r\n g.setFont(font);\r\n String t=\"NOTE: All players cannot be on the same team.\";\r\n g.drawString(t,50,265);\r\n t=\"Use WASD to move.\";\r\n g.drawString(t,50,48); \r\n t=\"Press SPACE on the Start Button to Begin!\";\r\n g.drawString(t,120,h-5); \r\n \r\n font=new Font(\"SanSerif\",Font.BOLD,40); \r\n g.setColor(Color.black);\r\n g.setFont(font); \r\n t=\"Settings\";\r\n g.drawString(t,330,40); \r\n }",
"public void updateText()\r\n\t{\r\n\t\tdouble smallest = Math.min(menu.getController().getWidth(), menu.getController().getHeight());\r\n\t\tdouble equivalent12 = smallest/55;//Equivalent of 12 point font on base dimensions\r\n\t\t\r\n\t\ttextRenderer = new TextRenderer(new Font(fontName, Font.PLAIN, (int)(equivalent12*size)), true, true);\r\n\t}",
"@Override\n\tpublic void paint(Graphics e) {\n\t\tsuper.paint(e);\n\t\te.drawString(text, 20, 20);\n\t}",
"private void drawText(Graphics2D g2, String text, String fontName) {\n\n int fontSize = Math.round(getHeight() * factor);\n\n Font baseFont = new Font(fontName, Font.PLAIN, fontSize);\n Font font = baseFont.deriveFont(attr);\n\n GlyphVector gv = font.createGlyphVector(frc, text);\n Rectangle pixelBounds = gv.getPixelBounds(frc, 0, 0);\n\n int centerX = getWidth() / 2;\n int centerY = getHeight() / 2;\n\n float offsetX = pixelBounds.x + (pixelBounds.width / 2);\n float offsetY = pixelBounds.y + (pixelBounds.height / 2);\n\n AffineTransform at = new AffineTransform();\n at.translate(centerX - offsetX, centerY - offsetY);\n Shape outline = gv.getOutline();\n outline = at.createTransformedShape(outline);\n g2.fill(outline);\n }",
"@Override\r\n\tpublic void onCustomDraw(Graphics2D g) {\n\t\tg.setColor(Color.black);\r\n\t\tg.fillRect(x, y, width, height);\r\n\t\tg.setColor(Color.green);\r\n\t\tfor(int i = 0; i < 50; i++){\r\n\t\t\tif(text[i] != null){\r\n\t\t\t\tg.drawString(text[i], 11, (i*10)+20);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void drawLabel(){\n FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal(\"Rubik-Regular.ttf\"));\n FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();\n parameter.size = 25;\n parameter.color = Color.BLACK;\n BitmapFont font2 = generator.generateFont(parameter);\n\n font2.getData().setScale(FONT_SCALE);\n\n font2.draw(game.getBatch(), \"Please insert the IP Address\\n you see on you partner's screen\", 50, 600);\n }",
"public void renderText(String text, int x, int y)\n {\n renderText(text, x, y, 0x00000000);\n }",
"public void cbDisplayPointText()\n {\n \tif (!m_white.wasSuccess()) \n \t return;\n \n \tString str = m_white.getResponse();\n Vector<Pair<String, String> > pairs = \n StringUtils.parseStringPairList(str);\n \n m_guiboard.clearMarks();\n \n for (int i=0; i<pairs.size(); i++) {\n \t HexPoint point = HexPoint.get(pairs.get(i).first);\n String value = pairs.get(i).second;\n m_guiboard.setText(point, value);\n \t}\n \tm_guiboard.repaint();\n }",
"public static void draw() {\n\t\tStdDraw.clear();\n\t\tStdDraw.text(.5, .90, hint);\n\t\tStdDraw.text(.5, .5, label);\n\t\tStdDraw.text(0.5, 0.3, textBeingEntered);\n\t\tStdDraw.show(0);\n\n\t}",
"public void draw(SpriteBatch batch, String text, float x, float y, GameContainer c, StyledText style);",
"public void draw() {\n\t\tGL11.glColor3f(0.5f,0.5f,1.0f);\n\t\n\t\t// draw quad\n\t\tGL11.glBegin(GL11.GL_QUADS);\n\t\t\tGL11.glVertex2f(x,y);\n\t\t\tGL11.glVertex2f(x+width,y);\n\t\t\tGL11.glVertex2f(x+width,y+height);\n\t\t\tGL11.glVertex2f(x,y+height);\n\t\tGL11.glEnd();\n\t\t\n\t\tif(text != null || !text.equals(\"\"))\n\t\t\tfont.drawString(text, x, y);\n\t\n\t}",
"@Override\r\n\tpublic void render(GameContainer gc, Renderer r) {\n\t\tr.drawTextInBox(posX, posY, width, height, color1, text);\r\n\t\t//r.noiseGen();\r\n\t}",
"private void drawText(Graphics2D g, double xCenter, double yCenter, VisualItem item, String text, boolean drawBackground)\n {\n if (m_font == null) \n {\n m_font = item.getFont();\n m_font = FontLib.getFont(m_font.getName(), m_font.getStyle(), m_font.getSize());\n }\n \n g.setFont(m_font);\n FontMetrics fm = DEFAULT_GRAPHICS.getFontMetrics(m_font);\n int textH = fm.getHeight();\n int textW = fm.stringWidth(text);\n \n \t\t// Render a filled circular background\n if (drawBackground)\n {\n \tdouble radius = Math.max(textH, textW) / 2; \t\n \tEllipse2D circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, radius * 2, radius * 2);\n \tGraphicsLib.paint(g, item, circle, getStroke(item), RENDER_TYPE_FILL);\n }\n \n\t\t// Render the text \n\t\tint textColor = item.getTextColor();\n g.setPaint(ColorLib.getColor(textColor));\n\t\t\n\t boolean useInt = 1.5 > Math.max(g.getTransform().getScaleX(), g.getTransform().getScaleY());\n if ( useInt ) {\n g.drawString(text, (int)xCenter - textW/2, (int)yCenter + textH/2 - 3);\n } else {\n g.drawString(text, (float)xCenter - textW/2, (float)yCenter + textH/2 - 3);\n }\n }",
"public void screenText(Canvas canvas){\n Paint paint = new Paint();\n paint.setColor(Color.WHITE);\n paint.setTextSize(30);\n paint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));\n canvas.drawText(\"Score: \"+ (newPlayer.getScore()), 10, height-10, paint);\n canvas.drawText(\"Best Score: \"+ getRecord(), width-215, height-10, paint);\n canvas.drawText(\"Level: \" + level, 10, height-550, paint);\n\n //If the game is reset will run a seperate screen text\n if (!newPlayer.getRunning()&&gamenew&&reset){\n Paint newPaint = new Paint();\n newPaint.setTextSize(40);\n newPaint.setColor(Color.WHITE);\n newPaint.setTypeface(Typeface.create(Typeface.DEFAULT,Typeface.BOLD));\n canvas.drawText(\"Click to start!\", width/2-50, height/2, newPaint);\n\n newPaint.setTextSize(20);\n canvas.drawText(\"Press and hold for the ship to hover up\", width/2-50,height/2+20,newPaint);\n canvas.drawText(\"Release to let the ship go down!\", width/2-50,height/2+40,newPaint);\n }\n\n }",
"@Override\n\tpublic void draw3dText(Vector3f location, String textString) {\n\n\t}",
"void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color);",
"public void displayToScreen(String str){\r\n textPane1.setText(str);\r\n paintDiamond();\r\n }",
"@Override\n\tpublic void render() {\n\t\tif (this.hidden) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.render();\n\n\t\tthis.font.draw(Graphics.batch, this.label, this.getX(),\n\t\t\tthis.getY() + (this.getHeight() - this.font.getLineHeight()) / 2);\n\t}",
"public void draw(Graphics2D gc){\r\n\r\n Font curFont = gc.getFont();\r\n gc.setFont(font);\r\n Paint curColor = gc.getPaint();\r\n gc.setPaint(textColor);\r\n //gc.drawString(text, x, y); // This would look better but doesn't seem to work with hit testing.\r\n\r\n FontRenderContext frc = gc.getFontRenderContext();\r\n TextLayout textLayout = new TextLayout(text, font, frc);\r\n AffineTransform moveTo = AffineTransform.getTranslateInstance(x, y);\r\n textShape = textLayout.getOutline(moveTo);\r\n gc.fill(textShape);\r\n gc.setFont(curFont);\r\n gc.setPaint(curColor);\r\n }",
"public void drawCenteredText(String text, int x, int y);",
"public void drawInfoWindow(){\n\n p.pushMatrix();\n p.translate(0,0); // translate whole window if necessary\n\n // display name and show\n p.stroke(0);\n p.strokeWeight(2);\n p.textSize(30);\n p.fill(0);\n p.text(\"Info\",735,35);\n p.rectMode(CORNER);\n p.fill(219, 216, 206);\n p.rect(730,40,550,700);\n p.rectMode(CENTER);\n\n p.fill(0);\n p.pushMatrix();{\n p.translate(740,80);\n p.textSize(15);\n p.text(\"General\",0,-20);\n p.line(-3,-15,150,-15);\n p.text(\"Speed: \" + manipulator.maxSpeed,0,0);\n p.text(\"Angle of rotation for segment_1: \" + p.degrees(manipulator.segment_1_rot),0,20);\n p.text(\"Angle of rotation for segment_2: \" + p.degrees(manipulator.segment_2_rot),0,40);\n\n\n }p.popMatrix();\n\n p.popMatrix();\n\n }",
"public void drawText(final String text, final int xPos, final int yPos, final Color color){\n font.setColor(Color.BLACK);\n font.setScale(0.51f);\n batch.begin();\n setDrawmode(GL10.GL_MODULATE);\n font.drawMultiLine(batch, text, xPos, yPos);\n batch.end();\n \n font.setColor(Color.WHITE);\n font.setScale(0.5f);\n batch.begin();\n font.drawMultiLine(batch, text, xPos, yPos);\n batch.end();\n font.setScale(1f);\n }",
"private void drawText(Graphics2D g2)\n\t{\n\t\tfinal int PADDING = 5;\n\t\tfinal Rectangle bounds = getBounds();\n\t\tfinal String[] texts = getText().split(\"\\\\ \");\n\n\t\tfinal Font effectiveFont = font.deriveFont(font.getSize() * parent.getZoom());\n\n\t\tfinal FontMetrics metrics = g2.getFontMetrics(effectiveFont);\n\n\t\tfinal int hgt = metrics.getHeight();\n\t\tint adv, offsetY = bounds.y + PADDING + hgt, offsetX = PADDING;\n\t\tg2.setFont(effectiveFont);\n\n\t\tfor (final String text2 : texts)\n\t\t{\n\t\t\tfinal String currentText = text2 + \" \";\n\t\t\tadv = metrics.stringWidth(currentText);\n\n\t\t\tif (offsetX + adv > bounds.width - PADDING * 2)\n\t\t\t{\n\t\t\t\toffsetY += hgt; // new line\n\t\t\t\toffsetX = PADDING;\n\t\t\t}\n\n\t\t\tg2.drawString(currentText, bounds.x + offsetX, offsetY);\n\t\t\toffsetX += adv;\n\t\t}\n\t}",
"private void addText(Graphics g, Font font, Color frontColor, Rectangle rectangle, Color backColor, String str, int xPos, int yPos) {\n g.setFont(font);\n g.setColor(frontColor);\n if (rectangle != null) {\n g.drawRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n }\n g.setColor(backColor);\n if (rectangle != null) {\n g.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n }\n g.setColor(frontColor);\n g.drawString(str, xPos, yPos);\n }",
"public Text(int x, int y, String text, int size) {\r\n this.x = x;\r\n this.y = y;\r\n this.text = text;\r\n this.font = Font.SANS_SERIF;\r\n this.size = size;\r\n \r\n }",
"public GraphicsText(String text, float x, float y){\r\n this.x = x;\r\n this.y = y;\r\n this.text = text;\r\n textColor = Color.BLACK;\r\n font = new Font(\"SanSerif\", Font.PLAIN, 14);\r\n }",
"@Override\n protected void onDraw(Canvas canvas) {\n mTextPain.setColor(mColor);\n canvas.drawText(mText,getWidth() / 2-mTextBound.width()/2,getHeight()/2+mTextBound.height()/2,mTextPain);\n }",
"public abstract double drawString(AEColor clr, double font_size, String str, double mid_x, double mid_y);",
"public void displayLeft(String text, int x, int y) {\n\t\tgc.setFont(vector); //set the font \n\t\tgc.setFill(Color.WHITE); //set the color of the text\n\t\tgc.fillText(text, x, y); //draw the text\n\t}",
"public void renderText(String text, int x, int y, int color)\n {\n renderText(text, x, y, color, 1.0f);\n }",
"public GLGraphics drawText(String text, float x, float y, float w, float h) {\n\t\treturn drawText(text, x, y, w, h, VAlign.LEFT);\n\t}",
"@Override\r\n public void draw(Canvas canvas) {\r\n if (text == null) {\r\n throw new IllegalStateException(\"Attempting to draw a null text.\");\r\n }\r\n\r\n // Draws the bounding box around the TextBlock.\r\n RectF rect = new RectF(text.getBoundingBox());\r\n rect.left = translateX(rect.left);\r\n rect.top = translateY(rect.top);\r\n rect.right = translateX(rect.right);\r\n rect.bottom = translateY(rect.bottom);\r\n canvas.drawRect(rect, rectPaint);\r\n\r\n // Log.d(\"area\", \"text: \" + text.getText() + \"\\nArea: \" + Area);\r\n /**Here we are defining a Map which takes a string(Text) and a Integer X_Axis.The text will act as key to the X_Axis.\r\n Once We Got the X_Axis we will pass its value to a SparseIntArray which will Assign X Axis To Y Axis\r\n .Then We might Create another Map which will Store Both The text and the coordinates*/\r\n int X_Axis = (int) rect.left;\r\n int Y_Axis = (int) rect.bottom;\r\n\r\n // Renders the text at the bottom of the box.\r\n Log.d(\"PositionXY\", \"x: \"+X_Axis +\" |Y: \"+ Y_Axis);\r\n canvas.drawText(text.getText(), rect.left, rect.bottom, textPaint); // rect.left and rect.bottom are the coordinates of the text they can be used for mapping puposes\r\n\r\n\r\n }",
"public void empSlotText(SpriteBatch batch){\n batch.setProjectionMatrix(textCam.combined);\n String text = \"\"+manager.getEmployees()+\"/\"+manager.getEmployeeSlots();\n batch.begin();\n font2.draw(batch,text, 730, 370);\n batch.end();\n }",
"private void showPopText(Canvas canvas, String content, float x, float y) {\n int heightOffSet = 40;\n int margin = 10;\n int rectRadius = 4;\n\n //draw rounded rectangle\n Rect popupTextRect = new Rect();\n Paint paint = new Paint();\n paint.getTextBounds(content + \" \", 0, content.length() + 2, popupTextRect);\n paint.setAntiAlias(true);\n paint.setColor(Color.BLACK);\n paint.setTextSize(heightOffSet / 2);\n RectF r =\n new RectF(x - popupTextRect.width() - margin, y - (mFontSize * heightOffSet + 0.5f),\n x + popupTextRect.width() / 6 + (mFontSize * margin + 0.5f),\n y - (mFontSize * heightOffSet * 2 / 5));\n canvas.drawRoundRect(r, (mFontSize * rectRadius), (mFontSize * rectRadius), paint);\n\n //draw triangle.\n Path path = new Path();\n path.moveTo(x, y - (mFontSize * heightOffSet * 2 / 5));\n path.lineTo(x, y - (mFontSize * 10));\n path.lineTo(x - (mFontSize * 5), y - (mFontSize * heightOffSet / 2));\n path.close();\n canvas.drawPath(path, paint);\n\n //draw text\n paint.setColor(Color.WHITE);\n FontMetricsInt fontMetrics = paint.getFontMetricsInt();\n int baseline =\n (int) (r.top + (r.bottom - r.top - fontMetrics.bottom + fontMetrics.top) / 2 -\n fontMetrics.top);\n paint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(content, r.centerX(), baseline, paint);\n }",
"private String showText() {\n\t\tString text = \"\";\n\t\ttry {\n\t\t\tString line1 = \"\";\n\t\t\tString line2 = \"\";\n\t\t\tString line3 = \"\";\n\t\t\tfor (LakeTile lake_tile : removed_laketile) {\n\t\t\t\tint i = removed_laketile.indexOf(lake_tile);\n\t\t\t\tPosition pos = removed_position.get(i);\n\t\t\t\tQueue<Color> color_queue = lake_tile.getColorOfFourSides();\n\t\t\t\tArrayList<Color> color_list = new ArrayList<Color>(color_queue);\n\n\t\t\t\tline1 += String.format(\"%12s\", \"\");\n\t\t\t\tline1 += Color.getColorText(color_list.get(0), \" \");\n\n\t\t\t\tline1 += String.format(\"%4s\", \"\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tline2 += String.format(\"%2s\", lake_tile.getIndex());\n\t\t\t\tline2 += \":\";\n\t\t\t\tline2 += String.format(\"%-7s\",\"(\" + pos.getX() + \",\" + pos.getY() + \")\");\n\t\t\t\tline2 += Color.getColorText(color_list.get(3), \" \");\n\t\t\t\tline2 += \" \";\n\t\t\t\tif (lake_tile.isPlatform()) {\n\t\t\t\t\tline2 += \"O\";\n\t\t\t\t} else {\n\t\t\t\t\tline2 += \"X\";\n\t\t\t\t}\n\t\t\t\tline2 += \" \" + Color.getColorText(color_list.get(1), \" \") + \" \";\n\n\t\t\t\tline3 += String.format(\"%12s\", \"\");\n\t\t\t\tline3 += Color.getColorText(color_list.get(2), \" \");\n\t\t\t\tline3 += String.format(\"%4s\", \"\");\n\n\t\t\t}\n\t\t\ttext += line1 + \"\\n\";\n\t\t\ttext += line2 + \"\\n\";\n\t\t\ttext += line3 + \"\\n\";\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\ttext = \"No Data\";\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\n\t}",
"public void drawText(Canvas canvas) {\n Paint paint = new Paint();\n paint.setColor(Color.rgb(240, 230, 140)); //gold color\n paint.setTextSize(30);\n paint.setTypeface(Typeface.SANS_SERIF);\n\n canvas.drawText(\"SCORE: \" + player.getScore(), WIDTH - 250, HEIGHT - 10, paint); //display player score\n canvas.drawText(\"LEVEL: \" + level, 100, HEIGHT - 10, paint); //display level\n\n if(!player.getPlaying()){ //if player is dead\n paint.setColor(Color.rgb(102, 0, 0));\n paint.setTextSize(50);\n paint.setTypeface(Typeface.DEFAULT_BOLD);\n canvas.drawText(\"OH DEAR, YOU ARE DEAD!\", WIDTH/2 - 320, HEIGHT/2, paint); //print death message\n gameOver();\n }\n }",
"public void render (DrawingCanvas canvas){\n //System.out.println(\"drawing \"+wd+\"*\"+ht+\" at (\"+x+\",\"+y+\")\");\n canvas.setForeground(col);\n canvas.drawString(str, x, y, false);\n canvas.setForeground(Color.lightGray);\n canvas.drawRect(x,y-13,(str.length()*8),16);\n }",
"@Override\r\n\tprotected void draw(PGraphics pg) {\r\n\t\tif(font == null) {\r\n\t\t\tfont = rootContainer.getPApplet().createFont(\"Arial\", ((int)this.height * 0.8F));\r\n\t\t}\r\n\t\tpg.stroke(0);\r\n\t\tpg.strokeWeight(3);\r\n\t\tpg.noFill();\r\n\t\tif(activated == false) {\r\n\t\t}else {\r\n\t\t\tpg.line(x, y, x+height, y+height);\r\n\t\t\tpg.line(x+height, y, x, y+height);\r\n\t\t}\r\n\t\tpg.rect(x, y, height, height);\r\n\t\tpg.textAlign(PApplet.LEFT, PApplet.CENTER);\r\n\t\tpg.textFont(font);\r\n\t\tpg.fill(this.textColor.red, textColor.green, textColor.blue, textColor.alpha);\r\n\t\tpg.text(this.text, x+height+(height/2), y-3, width-height, height);\r\n\t}",
"public void draw(GL2 gl)\r\n\t{\r\n\t\tdouble width = menu.getController().getWidth(), height = menu.getController().getHeight();\r\n\t\ttextRenderer.beginRendering((int)width, (int)height);\r\n\t\tif (mouseInBounds())\r\n\t\t\ttextRenderer.setColor(1f, 1f, 0f, 1f);\r\n\t\telse\r\n\t\t\ttextRenderer.setColor(1f, 1f, 1f, 1f);\r\n\t\tif (align == 0)\r\n\t\t\tdrawStringLeft(textRenderer, message, (int)(width*x), (int)(height*y));\r\n\t\tif (align == 1)\r\n\t\t\tdrawStringCenter(textRenderer, message, (int)(width*x), (int)(height*y));\r\n\t\tif (align == 2)\r\n\t\t\tdrawStringRight(textRenderer, message, (int)(width*x), (int)(height*y));\r\n\t\ttextRenderer.endRendering();\r\n\t}",
"@Override\n public void paint(Graphics g, ImageObserver observer) {\n if (font != null)\n g.setFont(font);\n g.setColor(color);\n g.drawString(lName + \": \" + value, x, y);\n }",
"public void drawText(String text, float x, float y, float size) {\n\t\tTextLoader.addLargeText(text, x, y, size, this);\n\t}",
"public void draw(Graphics2D g2d) {\r\n g2d.setFont(new Font(font, Font.BOLD, size));\r\n g2d.drawString(text, x, y);\r\n }",
"public void drawBitmapText(Canvas c)\r\n\t{\r\n c.drawBitmap(frames[this.getcurrentFrame()], this.getX(),this.getY(),null);\r\n\tc.drawText(this.text, this.getX()+this.getWidth()+10,this.getY()+this.getHeight()+10, this.p);\t\r\n\t}",
"public void displayText(String message,float x, float y, boolean bottom) {\n\t\tif (! bottom) {\n\t\t\tGlyphLayout layout = new GlyphLayout(bitmapFont, message);\n\t\t\tfloat fontWidth = layout.width;\n\t\t\tfloat fontHight = layout.height;\n\t\t\tfloat position_x = (screenWidth / 2 - fontWidth / 2) + x;\n\t\t\tfloat position_y = (screenHeight / 2 - fontHight / 2) + y;\n\t\t\tbitmapFont.draw(batch, message, position_x, position_y);\n\n\t\t} else {\n\t\t\tbitmapFont.draw(batch, message, x, y);\n\t\t}\n\t}",
"public void renderText(TextRenderInfo renderInfo) {\n \tsuper.renderText(renderInfo);\n\t\tpage.setText(getResultantText());\n \twriteText();\n }",
"public void display() {\n float dRadial = reactionRadialMax - reactionRadial;\n if(dRadial != 0){\n noStroke();\n reactionRadial += abs(dRadial) * radialEasing;\n fill(255,255,255,150-reactionRadial*(255/reactionRadialMax));\n ellipse(location.x, location.y, reactionRadial, reactionRadial);\n }\n \n // grow text from point of origin\n float dText = textSizeMax - textSize;\n if(dText != 0){\n noStroke();\n textSize += abs(dText) * surfaceEasing;\n textSize(textSize);\n }\n \n // draw agent (point)\n fill(255);\n pushMatrix();\n translate(location.x, location.y);\n float r = 3;\n ellipse(0, 0, r, r);\n popMatrix();\n noFill(); \n \n // draw text \n textSize(txtSize);\n float lifeline = map(leftToLive, 0, lifespan, 25, 255);\n if(mouseOver()){\n stroke(229,28,35);\n fill(229,28,35);\n }\n else {\n stroke(255);\n fill(255);\n }\n \n text(word, location.x, location.y);\n \n // draw connections to neighboars\n gaze();\n }",
"private void renderTypeString() {\n StdDraw.setCanvasSize(START_WIDTH * TILE_SIZE, START_HEIGHT * TILE_SIZE);\n Font font = new Font(\"Monaco\", Font.BOLD, 20);\n StdDraw.setFont(font);\n StdDraw.setXscale(0, START_WIDTH );\n StdDraw.setYscale(0, START_HEIGHT );\n StdDraw.clear(Color.BLACK);\n StdDraw.setPenColor(Color.WHITE);\n StdDraw.enableDoubleBuffering();\n StdDraw.text(START_WIDTH / 2, START_HEIGHT / 2, \"Typed the seed and end with letter S\");\n StdDraw.show();\n }",
"private void drawAgentInfo(Graphics2D graphics, int x, int y,\n int width, int height, Insets borders)\n {\n final int verticalSpaceBeforeText = 20;\n // Find the size of string in the font being used by the current\n // Graphics2D context.\n FontMetrics font = graphics.getFontMetrics();\n String agentInfo = null;\n int textWidth = 0;\n int textHeight = 0;\n int totalTextHeight = 0;\n int maxTextWidth = 0;\n\n if (GRID_LEGEND_HORIZONTAL) {\n agentInfo = \"Infected: \" + simulation.getNumInfectedHumans() +\n \" \" +\n \"Uninfected: \" + simulation.getNumUninfectedAgents() +\n \" \" +\n \"Infested: \" + simulation.getNumInfestedHosts() +\n \" \" +\n \"Uninfested: \" + simulation.getNumUninfestedHosts() +\n \" \" +\n \"Treated: \" + simulation.getNumTreatedAgents();\n \n Rectangle2D rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight = textHeight;\n maxTextWidth = textWidth;\n int startStringAt = (width - textWidth) / 2;\n\n // center text horizontally (max sure left side at least draws w/in\n // the viewport window -- i.e., x at least 0)\n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + verticalSpaceBeforeText);\n\n } else {\n agentInfo = \"Infected: \" + simulation.getNumInfectedHumans();\n Rectangle2D rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight = textHeight;\n maxTextWidth = textWidth;\n \n int startStringAt = (width - textWidth) / 2;\n\n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + totalTextHeight + verticalSpaceBeforeText);\n \n agentInfo = \"Uninfected: \" + simulation.getNumUninfectedAgents();\n rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight += textHeight;\n if (textWidth > maxTextWidth){\n maxTextWidth = textWidth;\n }\n //startStringAt = (width - textWidth) / 2;\n\n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + totalTextHeight + verticalSpaceBeforeText);\n \n agentInfo = \"Infested: \" + simulation.getNumInfestedHosts();\n rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight += textHeight;\n if (textWidth > maxTextWidth){\n maxTextWidth = textWidth;\n }\n //startStringAt = (width - textWidth) / 2;\n \n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + totalTextHeight + verticalSpaceBeforeText);\n \n agentInfo = \"Uninfested: \" + simulation.getNumUninfestedHosts();\n rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight += textHeight;\n if (textWidth > maxTextWidth){\n maxTextWidth = textWidth;\n }\n //startStringAt = (width - textWidth) / 2;\n \n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + totalTextHeight + verticalSpaceBeforeText);\n agentInfo = \"Treated: \" + simulation.getNumTreatedAgents();\n rect = font.getStringBounds(agentInfo, graphics);\n\n textWidth = (int)(rect.getWidth());\n textHeight = (int)(rect.getHeight());\n totalTextHeight += textHeight;\n if (textWidth > maxTextWidth){\n maxTextWidth = textWidth;\n }\n //startStringAt = (width - textWidth) / 2;\n \n graphics.drawString(agentInfo, Math.max(x + startStringAt, 0), \n y + height + totalTextHeight + verticalSpaceBeforeText);\n }\n\n // Make sure the image plus text (which may be a new one loaded in) is\n // visible in the scroll pane. If this isn't somewhere, scrollbars \n // won't work in the main screen's encompassing JScrollPane.\n setPreferredSize(\n new Dimension(\n Math.max(width + borders.left + borders.right, maxTextWidth + 10),\n height + borders.top + borders.bottom \n + verticalSpaceBeforeText + totalTextHeight + 10));\n\n }",
"public void drawText(Font theFont, String str, int x, int y)\r\n\t{\n\t\tFont ft = g.getFont();\r\n\r\n\t\tg.setFont(theFont);\r\n\r\n\t\t// @@@ IM ignore the WMFGraphics method, since it relies on JDK1.2 code\r\n\t\t// (AttributedIterator)\r\n\t\t// g.drawString(str, x, y);\r\n\t\twmf.textOut(x, y, str);\r\n\r\n\t\t// restore the font\r\n\t\tg.setFont(ft);\r\n\t\tif (DEBUG_OUTPUT)\r\n\t\t\tMWC.Utilities.Errors.Trace.trace(\"drawText\");\r\n\t}",
"private void drawStrings(Graphics g, int wid, int hei) {\n Font f = new Font(\"Font.PLAIN\", Font.BOLD, hei / 20);\n g.setFont(f);\n g.setColor(Color.white);\n g.drawString(\"LEVEL\", wid / 2 - 3 * wid / 20 - 2, hei / 10 - 2);\n g.drawString(\"TIME\", wid / 2 - 3 * wid / 20 + 5, hei / 10 * 3 - 2);\n g.drawString(\"CHIPS\", wid / 2 - 3 * wid / 20 - 2, hei / 2 - 2);\n g.drawString(\"LEFT\", wid / 2 - 3 * wid / 20 + hei / 63 - 2, hei / 2 + hei / 20 + 3);\n g.setColor(Color.black);\n g.drawString(\"LEVEL\", wid / 2 - 3 * wid / 20 + 2, hei / 10 + 2);\n g.drawString(\"TIME\", wid / 2 - 3 * wid / 20 + 9, hei / 10 * 3 + 2);\n g.drawString(\"CHIPS\", wid / 2 - 3 * wid / 20 + 2, hei / 2 + 2);\n g.drawString(\"LEFT\", wid / 2 - 3 * wid / 20 + hei / 63 + 2, hei / 2 + hei / 20 + 7);\n g.setColor(Color.red);\n g.drawString(\"LEVEL\", wid / 2 - 3 * wid / 20, hei / 10);\n g.drawString(\"TIME\", wid / 2 - 3 * wid / 20 + 7, hei / 10 * 3);\n g.drawString(\"CHIPS\", wid / 2 - 3 * wid / 20, hei / 2);\n g.drawString(\"LEFT\", wid / 2 - 3 * wid / 20 + hei / 63, hei / 2 + hei / 20 + 5);\n }",
"public void strokeString(float x, float y, String text);",
"public void paint (Graphics g) {\n text.setText(perfweb.genReport());\n super.paint(g);\n }",
"public abstract void drawString(String str, int x, int y);",
"public void paint(MapCanvas canvas, Point insertPoint) {\n Graphics2D graphics = null;\n if ((this.text != null) && (insertPoint != null) && (canvas != null) && \n ((graphics = canvas.graphics) != null)) {\n Font curFont = graphics.getFont();\n Color curColor = graphics.getColor();\n AffineTransform curTransForm = graphics.getTransform();\n try {\n TextStyle style = this.getTextStyle();\n FontMetrics fontMetrics = this.textFont.setCanvas(canvas);\n int textHeight = fontMetrics.getHeight();\n int x = insertPoint.x;\n int y = insertPoint.y;\n int textWidth = fontMetrics.stringWidth(this.text);\n// if ((style.orientation == TextStyle.Orientation.VerticalDn) || \n// (style.orientation == TextStyle.Orientation.VerticalUp)) {\n// if (style.hAlign == TextStyle.Horizontal.Center) {\n// y -= textWidth/2;\n// } else if (style.hAlign == TextStyle.Horizontal.Right) {\n// y -= textWidth;\n// }\n//\n// if (style.vAlign == TextStyle.Vertical.Middle) {\n// x += textHeight/2;\n// } else if (style.vAlign == TextStyle.Vertical.Top) {\n// x += textHeight;\n// }\n// } else {\n if (style.hAlign == TextStyle.Horizontal.Center) {\n x -= textWidth/2;\n } else if (style.hAlign == TextStyle.Horizontal.Right) {\n x -= textWidth;\n }\n\n if (style.vAlign == TextStyle.Vertical.Middle) {\n y += textHeight/2;\n } else if (style.vAlign == TextStyle.Vertical.Top) {\n y += textHeight;\n }\n //} \n float rotate = style.orientation.rotate;\n if (rotate != 0.0f) {\n AffineTransform transform = new AffineTransform();\n transform.translate(0.0d, 0.0d);\n transform.rotate(rotate, insertPoint.x, insertPoint.y);\n graphics.transform(transform);\n }\n \n graphics.drawString(this.text, x, y - fontMetrics.getDescent());\n } catch (Exception exp) {\n LOGGER.log(Level.WARNING, \"{0}.paint Error:\\n {1}\",\n new Object[]{this.getClass().getSimpleName(), exp.getMessage()});\n } finally {\n if (curFont != null) {\n graphics.setFont(curFont);\n }\n if (curColor != null) {\n graphics.setColor(curColor);\n }\n if (curTransForm != null) {\n graphics.setTransform(curTransForm);\n }\n }\n }\n }",
"@Override\n public void display() {\n EasyViewer.beginOverlay();\n \n glColor4d( 0,1,0,alpha.getValue() );\n glLineWidth(2); \n glBegin( GL_LINE_STRIP );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100 +i*i );\n }\n glEnd();\n \n glColor4d( 1,0,0,alpha.getValue() );\n glPointSize(5);\n glBegin( GL_POINTS );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100+i*i );\n } \n glEnd();\n \n \n // lets draw some 2D text\n// glColor4d( 1,1,1,1 ); \n// EasyViewer.printTextLines( \"(100,100)\", 100, 100, 12, GLUT.BITMAP_HELVETICA_10 );\n// glRasterPos2d( 200, 200 );\n// EasyViewer.printTextLines( \"(200,200)\\ncan have a second line of text\", 200, 200, 12, GLUT.BITMAP_HELVETICA_10 );\n \n EasyViewer.endOverlay();\n \n }",
"private float drawText(Graphics2D g2d) {\n float yOffset = 0; // 1\" top margin\r\n for (TextLayout tl : textLayouts) {\r\n yOffset += tl.getAscent();\r\n tl.draw(g2d, 0, yOffset);\r\n yOffset += tl.getDescent();\r\n yOffset += tl.getLeading();\r\n }\r\n return yOffset;\r\n }",
"void displayInfoText(String info) {\n resultWindow.removeAll();\n JLabel label = new JLabel(info);\n label.setFont(resultFont);\n resultWindow.add(label);\n revalidate();\n repaint();\n }",
"public void paint (Graphics g) {\n text.setText(perfweb.genReport());\n super.paint(g);\n }",
"@Override\n public int drawString(String text, int x, int y, int color) {\n return this.drawString(text, x, y, color, false);\n }",
"@Override\n public void render(Graphics g) {\n\n int x = g.repositionX((int) _coordOrigin._x + (int) _pos._x);\n int y = g.repositionY((int) _coordOrigin._y + ((int) _pos._y * (-1)));\n\n g.newFont(_f, g.repositionX(_lineThickness), _b);\n g.setColor(_c);\n g.drawText(_t, g.getCanvas().getX() + x, g.getCanvas().getY() + y);\n }",
"public void paintComponent(Graphics g){\n super.paintComponent(g);\n\n //casting the Graphics g to Graphics2D which is the updated version\n Graphics2D g2d = (Graphics2D)g;\n g2d.setFont(new Font(\"Times new Roman,\", Font.PLAIN,20));\n g2d.setColor(Color.white);\n //class rendering hints attribute to specify whether you want objects to be rendered as quickly as possible\n g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);\n\n int y = textY;\n\n for(String line : text.split(\"\\n\")){\n int stringLength = (int)g2d.getFontMetrics().getStringBounds(line,g2d).getWidth();\n int x = getWidth()/2 - stringLength/2;\n g2d.drawString(line,x, y +=28);\n }\n }",
"@Override\n public void updateDrawState(TextPaint ds) {\n }",
"public TextDisplay(){\n // Default values for all TextDisplays \n fontSize = 20.0f;\n fontColor = new Color(0, 0, 0);\n fieldWidth = 100;\n fieldHeight = 30;\n drawStringX = 0;\n drawStringY = 15;\n input = \"\";\n hasBackground = false;\n \n // TextDisplays' TextArea specifics\n borderWidth = 5;\n borderHeight = 5;\n borderColor = new Color(0, 0, 0, 128);\n backgroundColor = new Color (255, 255, 255, 128);\n }",
"@Override\n protected void paintForeground(Graphics2D g) {\n\n int fontSize = 40;\n\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, fontSize));\n g.setColor(Color.black);\n g.drawString(\"Points:\" + rat.getFoodCount(), 0, 40);\n\n }",
"public DisplayText (GraphicsContext gc, Canvas gameCanvas, int size) {\n\t\tthis.gc = gc;\n\t\tthis.gameCanvas = gameCanvas;\n\t\t\n\t\t vector = Font.loadFont(getClass().getResourceAsStream(\"/fonts/Vectorb.ttf\"), size); //load my custom font at the specified size \n\t}",
"private void drawTextBox(Graphics g, int x, int y, int width, int height) {\n\n\t// draw a rectangle\n\tg.setColor(Color.BLACK);\n\tg.drawRect(x, y, width, height);\n\n\t// determine the text size\n\tint textSize = (int) (height * TEXT_RATIO);\n\n\t// determine the text margins\n\tint textMargin = (int) (width * TEXT_MARGIN_RATIO);\n\n\t// coordinates to print message\n\tint xCoord = x + textMargin;\n\tint yCoord = y + height - textMargin;\n\n\t// set up the font\n\tg.setColor(Color.BLACK);\n\tg.setFont(new Font(\"Times New Roman\", Font.BOLD, textSize));\n\n\t// print the text\n\tg.drawString(MESSAGE, xCoord, yCoord);\n }",
"private void drawDescription(){\n image.clear();\n \n String[] words = desc.split(\" \");\n int lineCounter = 1;\n int length = 0;\n int index = 0;\n String line1 = \"\";\n String line2 = \"\";\n String line3 = \"\";\n String line4 = \"\";\n String line5 = \"\";\n \n image.setColor(DESCRIPTION_BG_COLOR);\n image.fill();\n image.setColor(DESCRIPTION_COLOR);\n \n // Determines how many words to put on each line so it fits in the image\n while(index != words.length){\n if((length += words[index].length() + 1) * DESCRIPTION_FONT.getSize() * 0.6 < image.getWidth()){\n length += words[index].length() + 1;\n if(lineCounter == 1) line1 += words[index] + \" \";\n else if(lineCounter == 2) line2 += words[index] + \" \";\n else if(lineCounter == 3) line3 += words[index] + \" \";\n else if(lineCounter == 4) line4 += words[index] + \" \";\n else if(lineCounter == 5) line5 += words[index] + \" \";\n index++;\n }\n else{\n lineCounter++;\n length = 0;\n }\n }\n \n // Determines where to draw each string so that it always stays centered\n if(lineCounter == 1) image.drawString(line1, (image.getWidth() - (int)(line1.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() / 2) + DESCRIPTION_FONT.getSize() / 4);\n else if(lineCounter == 2){\n image.drawString(line1, (image.getWidth() - (int)(line1.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 2 / 5) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line2, (image.getWidth() - (int)(line2.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 3 / 5) + DESCRIPTION_FONT.getSize() / 4);\n }\n else if(lineCounter == 3){\n image.drawString(line1, (image.getWidth() - (int)(line1.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 3 / 10) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line2, (image.getWidth() - (int)(line2.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() / 2) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line3, (image.getWidth() - (int)(line3.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 7 / 10) + DESCRIPTION_FONT.getSize() / 4);\n }\n else if(lineCounter == 4){\n image.drawString(line1, (image.getWidth() - (int)(line1.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() / 5) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line2, (image.getWidth() - (int)(line2.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 2 / 5) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line3, (image.getWidth() - (int)(line3.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 3 / 5) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line4, (image.getWidth() - (int)(line4.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 4 / 5) + DESCRIPTION_FONT.getSize() / 4);\n }\n else if(lineCounter == 5){\n image.drawString(line1, (image.getWidth() - (int)(line1.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() / 10) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line2, (image.getWidth() - (int)(line2.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 3 / 10) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line3, (image.getWidth() - (int)(line3.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() / 2) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line4, (image.getWidth() - (int)(line4.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 7 / 10) + DESCRIPTION_FONT.getSize() / 4);\n image.drawString(line5, (image.getWidth() - (int)(line5.length() * DESCRIPTION_FONT.getSize() * 0.6)) / 2, (image.getHeight() * 9 / 10) + DESCRIPTION_FONT.getSize() / 4);\n }\n setImage(image);\n }",
"public void drawMoneyText(SpriteBatch batch){\n batch.setProjectionMatrix(textCam.combined);\n batch.begin();\n font.draw(batch,\"\"+manager.getMoney(),710, 447);\n batch.end();\n }",
"@Override\n public void fillText(String text, double x, double y) {\n graphicsEnvironmentImpl.fillText(canvas, text, x, y);\n }",
"public interface IText extends ISinglePoint {\n\n /**\n * Defines whether the text rotation is relative to the screen or geographic\n * north\n * \n * @author sgilbert\n * \n */\n public static enum TextRotation {\n SCREEN_RELATIVE, NORTH_RELATIVE\n }\n\n /**\n * Defines the text justification options\n * \n * @author sgilbert\n * \n */\n public static enum TextJustification {\n LEFT_JUSTIFY, CENTER, RIGHT_JUSTIFY\n }\n\n /**\n * Defines available font styles\n * \n * @author sgilbert\n * \n */\n public static enum FontStyle {\n REGULAR, BOLD, ITALIC, BOLD_ITALIC\n }\n\n public static enum DisplayType {\n NORMAL, BOX, UNDERLINE, OVERLINE\n }\n\n /**\n * Gets the text to draw\n * \n * @return Array of text strings\n */\n public String[] getString();\n\n /**\n * Gets the name of the font to use\n * \n * @return font name\n */\n public String getFontName();\n\n /**\n * Gets the size of the font\n * \n * @return font size\n */\n public float getFontSize();\n\n /**\n * Gets the font style to use\n * \n * @return font style\n */\n public FontStyle getStyle();\n\n /**\n * Gets the lat/lon refernce position for the text display\n * \n * @return lat/lon coordinate\n */\n public Coordinate getPosition();\n\n /**\n * Gets the color to use for the text\n * \n * @return text color\n */\n public Color getTextColor();\n\n /**\n * Gets the specified justification\n * \n * @return the text justification\n */\n public TextJustification getJustification();\n\n /**\n * Gets the rotation angle to use\n * \n * @return rotation angle\n */\n public double getRotation();\n\n /**\n * Gets how the rotation angle is applied\n * \n * @return the rotation relativity\n */\n public TextRotation getRotationRelativity();\n\n /**\n * Determines whether the text should be displayed with an outline box\n * \n * @return true, if outline box should be displayed\n */\n public DisplayType getDisplayType();\n\n /**\n * Determines whether text background should be masked out.\n * \n * @return true, if background is to be masked\n */\n public Boolean maskText();\n\n /**\n * Gets the offset in the x direction for the text location. The offset is\n * specified in half-characters.\n * \n * @return The x direction offset\n */\n public int getXOffset();\n\n /**\n * Gets the offset in the y direction for the text location. The offset is\n * specified in half-characters.\n * \n * @return The y direction offset\n */\n public int getYOffset();\n\n public Boolean getHide();\n\n public Boolean getAuto();\n\n public int getIthw();\n\n public int getIwidth();\n\n}",
"public void drawString(AttributedCharacterIterator iterator, float x, float y)\r\n\t{\r\n\t\t// System.out.println(\"drawString att2\");\r\n\t}",
"public String toString(){\n return (\"TextShape \"+x+\" \"+y+\" \"+col.getRed()+\" \"+col.getGreen()+\" \"+col.getBlue()+\" \"+str);\n }",
"public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawString(\"(\" + p.x + \", \" + p.y + \")\", p.x, p.y);\n }",
"private void showLabel(String text, Color color) {\n GLabel result = new GLabel(text);\n result.setFont(\"Verdana-60\");\n result.setColor(color);\n result.sendToFront();\n add(result, (getWidth() - result.getWidth()) /2, (getHeight() - result.getHeight()) / 2 );\n pause(FREEZE_TIME);\n remove(result);\n }",
"public void title(){\n textFont(select,30);\n fill(150);\n text(\"PLANE SELECT\",482,72);\n fill(0);\n text(\"PLANE SELECT\",480,70);\n}",
"Text createText();",
"public void displayCenter(String text, int x, int y) {\n\t\tgc.setFont(vector); //set the font of the text\n\t\tgc.setFill(Color.WHITE); //set the color of the text \n\t\tgc.setTextAlign(TextAlignment.CENTER); //set text alignment to center \n\t\tgc.fillText(text, x, y); //draw the text \n\t}",
"public void displayMessage(String text)\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.DISPLAY_INFO_TOAST;\r\n message.obj = text;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }",
"@Override\r\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\r\n\t\tg.drawString(str, 10, 10);\r\n\t\tg.drawLine(10, 20, 110, 20);\r\n\t\tg.drawRect(pX, 30, 100, 100);\r\n\t\t\r\n\t}",
"public void paint(Graphics g)\r\n {\r\n // place content of current note in the text area\r\n text.setText(snp.getNote());\r\n }",
"@Override\n public void draw( Graphics g )\n {\n g.setFont(new Font(\"Times New Roman\", Font.BOLD, 20));\n g.setColor( Color.BLUE );\n g.fillOval( baseX, baseY, myWidth, myHeight );\n g.setColor( Color.BLACK );\n g.drawString( card, baseX + 7, baseY + 20 ); }",
"public void initializeText(){\n\t\tfont = new BitmapFont();\n\t\tfont1 = new BitmapFont();\n\t\tfont1.setColor(Color.BLUE);\n\t\tfont2 = new BitmapFont();\n\t\tfont2.setColor(Color.BLACK);\n\t}",
"private static void drawOutlineText(Canvas canvas, Paint textPaint, String str,\n float x, float y) {\n // Is there a better way to do this?\n textPaint.setColor(0xff000000);\n canvas.drawText(str, x-1, y, textPaint);\n canvas.drawText(str, x+1, y, textPaint);\n canvas.drawText(str, x, y-1, textPaint);\n canvas.drawText(str, x, y+1, textPaint);\n canvas.drawText(str, x-0.7f, y-0.7f, textPaint);\n canvas.drawText(str, x+0.7f, y-0.7f, textPaint);\n canvas.drawText(str, x-0.7f, y+0.7f, textPaint);\n canvas.drawText(str, x+0.7f, y+0.7f, textPaint);\n textPaint.setColor(0xffffffff);\n canvas.drawText(str, x, y, textPaint);\n }",
"@Override\n\tpublic void draw() {\n\t\tif (isWhite){\n\t\t\tSystem.out.print(\"\\u2656\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.print(\"\\u265C\");\n\t\t}\t\t\n\t}",
"@Override\n\tpublic void render(Canvas canvas) {\n\t\tPaint paint = new Paint();\n\t\tpaint.setColor(Color.parseColor(\"#D95B43\"));\n\t\tpaint.setTextSize(50 * Globals.scaleY);\n\t\tint width = (int)paint.measureText(this.toString(), 0, this.toString().length());\n\t\t\n\t\tthis.x = (int) ((gamePanel.width - width) / 2.0f);\n\t\t\n\t\tcanvas.drawText(this.toString(), x, y, paint);\n\t}",
"@Override\n\tpublic String drawForConsole() {\n\t\tString[][] output = new String[this.getWidth()][this.getHeight()];\n\t\tString image = \"\";\n\t\tfor (int x = 0; x < this.getWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.getHeight(); y++) {\n\t\t\t\tif (x == 0 || x == this.getWidth() - 1) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else if (y == 0 || y == this.getHeight() -1) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else if (this.isFilledIn()) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else {\n\t\t\t\t\toutput[x][y] = \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int y = 0; y < this.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < this.getWidth(); x++) {\n\t\t\t\timage += output[x][y];\n\t\t\t\tif (x == this.getWidth() - 1) {\n\t\t\t\t\timage += \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn image;\n\t}",
"public void display()\n\t{\n\t\tfor(Character characher : characterAdded)\n\t\t{\t\n\t\t\tif(!characher.getIsDragging())\n\t\t\t{ \n\t\t\t\t//when dragging, the mouse has the exclusive right of control\n\t\t\t\tcharacher.x = (float)(circleX + Math.cos(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t\tcharacher.y = (float)(circleY + Math.sin(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint lineWeight = 0;\n\t\t//draw the line between the characters on the circle\n\t\tif(characterAdded.size() > 0)\n\t\t{\n\t\t\tfor(Character characher : characterAdded)\n\t\t\t{\n\t\t\t\tfor(Character ch : characher.getTargets())\n\t\t\t\t{\n\t\t\t\t\tif(ch.net_index != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int i = 0; i < links.size(); i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJSONObject tem = links.getJSONObject(i);\n\t\t\t\t\t\t\tif((tem.getInt(\"source\") == characher.index) && \n\t\t\t\t\t\t\t\t\t\t\t\t(tem.getInt(\"target\") == ch.index))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlineWeight = tem.getInt(\"value\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tparent.strokeWeight(lineWeight/4 + 1);\t\t\n\t\t\t\t\t\tparent.noFill();\n\t\t\t\t\t\tparent.stroke(0);\n\t\t\t\t\t\tparent.line(characher.x, characher.y, ch.x, ch.y);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void drawTextMarker(Graphics g, String[] messages, int yLine, Player owner) {\n\t\tint xCenter = getGameWidthPixels() / 2;\n\t\tVector2DLong position0Inverted = new Vector2DLong(xCenter, yLine),\n\t\t\t\tposition1NonInverted = new Vector2DLong(xCenter, getGameHeightPixels() - yLine);\n\t\tdrawScoreMarker(g, new ScoreMarker(messages[0], position0Inverted, owner, true));\n\t\tdrawScoreMarker(g, new ScoreMarker(messages[1], position1NonInverted, owner, false));\n\t}",
"@Override\r\n\tpublic void setText() {\n\t\t\r\n\t}",
"public void drawString(AttributedCharacterIterator iterator, int x, int y)\r\n\t{\r\n\t\t// System.out.println(\"drawString att\");\r\n\t}",
"private void addTextObject(GraphicObject g_obj, int x, int y) {\n Color stroke = new Color(0, 0, 0, 0);\n\n g_obj.setFillColor(this.currentFillColor);\n g_obj.setStroke(stroke, 0);\n\n\t\tthis.canvas.add(g_obj, x, y);\n\t}"
] | [
"0.8029109",
"0.7531652",
"0.7504347",
"0.72831327",
"0.7209377",
"0.7202204",
"0.7176653",
"0.7114804",
"0.70863914",
"0.706743",
"0.705147",
"0.7016692",
"0.69730926",
"0.6953304",
"0.6947246",
"0.6903869",
"0.68958527",
"0.68872654",
"0.6863805",
"0.6822462",
"0.67732334",
"0.67612255",
"0.6749562",
"0.6746296",
"0.67145073",
"0.67024535",
"0.6677572",
"0.66700965",
"0.6660273",
"0.6654327",
"0.6651663",
"0.66477567",
"0.6644104",
"0.6643857",
"0.66390806",
"0.6638776",
"0.6610676",
"0.6603297",
"0.6591933",
"0.6591434",
"0.6588309",
"0.6565316",
"0.65630996",
"0.6543878",
"0.65389293",
"0.6535914",
"0.65319145",
"0.6513423",
"0.65110326",
"0.6507393",
"0.6499201",
"0.64988935",
"0.64917654",
"0.6491664",
"0.64797854",
"0.6465283",
"0.6458223",
"0.64575726",
"0.6457173",
"0.6456425",
"0.64443344",
"0.64442194",
"0.6436247",
"0.64352024",
"0.64320743",
"0.6431702",
"0.64229697",
"0.6409876",
"0.6407339",
"0.63994414",
"0.6390783",
"0.6388575",
"0.63821447",
"0.63764125",
"0.63724905",
"0.63652825",
"0.6358595",
"0.63542604",
"0.6350731",
"0.6349884",
"0.63432485",
"0.6343231",
"0.6333427",
"0.6333033",
"0.6326996",
"0.63263667",
"0.632567",
"0.6320311",
"0.63169515",
"0.63153434",
"0.63144046",
"0.63075566",
"0.63041663",
"0.62995726",
"0.62989146",
"0.62899923",
"0.6287924",
"0.62782586",
"0.6277814",
"0.6262217"
] | 0.6492177 | 52 |
Restart average when animation stops | private double computeFPS(double t)
{
if (t == 0 || !drawAnimation.value) {
numPrevT = 0;
return 0;
}
int which = numPrevT % prevT.length;
double tdiff = t - prevT[which];
prevT[which] = t;
numPrevT++;
// Only compute frame rate when valid
if (numPrevT <= prevT.length || tdiff <= 0) {
return 0;
}
return prevT.length / tdiff;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void restart() {\n \tanimation.stop();\n \tspeed = 1;\n \tstart(stage);\n }",
"@Override\n public void onAnimationRepeat(Animation arg0) {\n \n }",
"public abstract void animationStopped();",
"private void terminateAnimation() {\n doRun = false;\n }",
"@Override\n protected void animStop() {\n }",
"@Override\n\t\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\t\t\n\t\t\t}",
"public void onAnimationRepeat(Animation animation) {\n\r\n }",
"public void onAnimationRepeat(Animation animation) {\n }",
"@Override\n\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\n\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\n\t\t\t\t\t\t\t}",
"@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\t\t\t\t\r\n\t\t\t}",
"public void onAnimationRepeat(Animation arg0) {\n\t}",
"@Override\n\t\t\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onAnimationRepeat(Animation arg0) {\n\n\t\t\t\t\t}",
"public abstract void animationReelFinished();",
"public void animate(){\n\n if (ra1.hasStarted() && ra2.hasStarted()) {\n\n// animation1.cancel();\n// animation1.reset();\n// animation2.cancel();\n// animation2.reset();\n gear1Img.clearAnimation();\n gear2Img.clearAnimation();\n initializeAnimations(); // Necessary to restart an animation\n button.setText(R.string.start_gears);\n }\n else{\n gear1Img.startAnimation(ra1);\n gear2Img.startAnimation(ra2);\n button.setText(R.string.stop_gears);\n }\n }",
"public void start() {\n if(mCancelAnim){\n setCancelAnimator(false);\n onEnd();\n return;\n }\n if (count <= 0) {\n setCancelNext(true);\n onEnd();\n return; //end\n }\n //start once now\n /* Logger.d(\"AnimateHelper\",\"start_before_start\",\"count = \" + count +\n \",already started ?=\" + anim.isStarted());*/\n --count;\n anim.start();\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n }",
"@Override public void onAnimationRepeat(Animator arg0) {\n\n }",
"public abstract void animation(double seconds);",
"private void rerunAnimation() {\n transition.playFromStart();\r\n}",
"@Override\n\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\n\t\t}",
"@Override\n public void onAnimationRepeat(Animation animation) {\n\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n\n }",
"private void loopButton(ActionEvent e) {\n if (loop) {\n if (drawPanel.animationDone()) {\n this.tick = 0;\n atTick(this.tick);\n timer.restart();\n }\n }\n }",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\r\n\t\t\t\t}",
"public void setGreenAnimation(){\n va.setDuration(75);\n va.setEvaluator(new ArgbEvaluator());\n va.setRepeatCount(ValueAnimator.INFINITE);\n va.setRepeatMode(ValueAnimator.REVERSE);\n va.start();\n\n //va.cancel();\n }",
"@Override\r\n public void onAnimationRepeat(Animator arg0)// 动画重复\r\n {\n\r\n }",
"@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onAnimationRepeat(Animation animation) {\n\n }",
"@Override\n public void onAnimationRepeat(Animation animation) {\n\n }",
"@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\r\n\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n\t\tpublic void onAnimationRepeat(Animator animation) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onAnimationRepeat(Animator animation) {\n\t\t\t\n\t\t}",
"@Override\n\t public void onAnimationRepeat(Animation animation) {\n\t \n\t }",
"public void animate()\n\t{\n\t\tanimation.read();\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n\n if (animationInProgress) {\n logger.info(\"Lost frame...\");\n return;\n }\n animationInProgress = true;\n\n java.util.List<Double> toIndex = indexFind.get(0);\n\n int value = Step + stepStep * animDirection;\n if (value < 1) {\n value = 1;\n }\n else if (value > toIndex.size()) {\n value = toIndex.size() - 1;\n }\n\n Step = value;\n\n try {\n long start = System.currentTimeMillis();\n XYPlot plot = (XYPlot)this.chartPanel.getChart().getPlot();\n currentIndex = Step - 1;\n plot.setDomainCrosshairValue(toIndex.get(currentIndex));\n //selectStructure(Step);\n //structureManagerInterface.selectStructure(currentIndex);\n float secs = (System.currentTimeMillis() - start) / 1000.0f;\n logger.info(\"Elapsed time: \" + secs);\n //setSnapshotValue(Step);\n }\n catch (Exception ex) {\n animationInProgress = false;\n timer.stop();\n JOptionPane.showMessageDialog(this, \"Error during animation: \" + ex.getMessage() + \"\\nAnimation stopped\", \"Error\",\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n\n if (animationMode == 0) { // Animate once\n if (Step == 1 && animDirection == -1) {\n stopAnimation();\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n stopAnimation();\n }\n }\n\n else if (animationMode == 1) { // Animate in loop\n if (Step == 1 && animDirection == -1) {\n Step = toIndex.size();\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n Step = 1;\n }\n }\n\n else if (animationMode == 2) { // Animate back & forth\n if (Step == 1 && animDirection == -1) {\n if (toIndex.size() > 1) {\n Step = 1;\n animDirection = 1;\n }\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n if (toIndex.size() > 1) {\n Step = toIndex.size() - 1;\n animDirection = -1;\n }\n }\n }\n\n animationInProgress = false;\n }",
"@Override\n public void onAnimationRepeat(Animator animation) {\n }",
"@Override\n public void onAnimationEnd(Animation animation) {\n mGameLoop.doStart();\n }",
"@Override\n\tpublic void onAnimationRepeat(Animation animation) {\n\n\t}",
"public void updateAnimation() {\n\t\tif (anim < 1000) {\n\t\t\tanim++;\n\t\t} else anim = 0;\n\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onAnimationRepeat(Animator animation) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onAnimationRepeat(Animator animation) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void onAnimationRepeat(Animation animation) {\n\t }",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\n\n\t\t\t}",
"@Override\n public void onAnimationRepeat(Animator animation) {\n\n }",
"public abstract void animationStarted();",
"public abstract void nextAnimationStep();",
"private void m23259e() {\n boolean z;\n if (this.f19138f != null) {\n ValueAnimator valueAnimator = this.f19137e;\n if (valueAnimator != null) {\n z = valueAnimator.isStarted();\n this.f19137e.cancel();\n this.f19137e.removeAllUpdateListeners();\n } else {\n z = false;\n }\n this.f19137e = ValueAnimator.ofFloat(0.0f, ((float) (this.f19138f.f19131u / this.f19138f.f19130t)) + 1.0f);\n this.f19137e.setRepeatMode(this.f19138f.f19129s);\n this.f19137e.setRepeatCount(this.f19138f.f19128r);\n this.f19137e.setDuration(this.f19138f.f19130t + this.f19138f.f19131u);\n this.f19137e.addUpdateListener(this.f19133a);\n if (z) {\n this.f19137e.start();\n }\n }\n }",
"@Override\n public void onAnimationRepeat(Animator arg0) {\n\n }",
"@Override\n\tpublic void onAnimationRepeat(Animator arg0) {\n\n\t}",
"private void idleAnimation(){\n timer++;\n if( timer > 4 ){\n setImage(loadTexture());\n animIndex++;\n timer= 0;\n if(animIndex > maxAnimIndex ){\n animIndex = 0;\n }\n }\n }",
"protected abstract void onAnimStart(boolean isCancelAnim);",
"@Override\n\t\t\tpublic void loopDone() {\n\t\t\t\t\n\t\t\t\tif (gamersArray.size()>0){\n\t\t\t\t\tattractAnim.stop();\n\t\t\t\t\t// need to call from main thread!\n\t\t\t\t\tmUIHandler.post(new Runnable(){\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tchangeState(State.WAIT_FOR_START);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"protected abstract void animate(int anim);",
"public void onAnimationRepeat(Animation animation) {\n\t\t\t}",
"public void startAnimation()\n {\n if ( animationTimer == null )\n {\n currentImage = 0; // display first image\n \n // Create timer\n animationTimer = new Timer ( ANIMATION_DELAY, new TimerHandler() );\n \n animationTimer.start(); // start Timer\n } // end if statement\n else // animationTimer already exists, restart animation\n {\n if ( ! animationTimer.isRunning() )\n animationTimer.restart();\n } // end else statement\n }",
"@Override\n public void run() {\n runAnimation();\n }",
"public void onAnimationRepeat(Animation animation) {\n }",
"@Override\n protected void animStart() {\n }",
"void onAnimationEnd();",
"public void restart() {\n\t\telements[currentElement - 1].turnOff();\n\t\tstart();\n\t}",
"@Override\n public void onAnimationStart(Animation animation) {\n number++;\n }",
"public void replay() {\n if (currentAnimation == null) play();\n else currentAnimation.playFromStart();\n }",
"void stopAnimation()\n {\n animationTimer.cancel();\n }",
"public void act() \n {\n if(images != null)\n {\n if(animationState == AnimationState.ANIMATING)\n {\n if(animationCounter++ > delay)\n {\n animationCounter = 0;\n currentImage = (currentImage + 1) % images.length;\n setImage(images[currentImage]);\n }\n }\n else if(animationState == AnimationState.SPECIAL)\n {\n setImage(specialImage);\n }\n else if(animationState == AnimationState.RESTING)\n {\n animationState = AnimationState.FROZEN;\n animationCounter = 0;\n currentImage = 0;\n setImage(images[currentImage]);\n }\n }\n }",
"@Override\n protected void onRestart() {\n super.onRestart();\n handler.postDelayed(myRun, speed);\n }",
"void onAnimationStart();",
"protected abstract void onAnimEnd(boolean isCancelAnim);",
"void animationFinished();",
"public void startAnimation() {\n animationStart = System.currentTimeMillis();\n }",
"public void stopAnimation() {\r\n\t\tani.stop();\r\n\t}",
"@Override\n public void onAnimationEnd(Animation animation) {\n startGame();\n }",
"public void anim() {\n // start the timer\n t.start();\n }",
"public void stopAnimation()\n {\n animationTimer.stop();\n }",
"public void startAnimation() {\n int delay = 50; // milliseconds\n ActionListener taskPerformer = new ActionListener() {\n public void actionPerformed(ActionEvent evt) {\n if (counter < points.length - 1) {\n counter += 20;\n if (counter > points.length) {\n counter = points.length - 1;\n ((Timer) evt.getSource()).stop();\n notifyStopped();\n }\n validate();\n repaint();\n } else {\n ((Timer) evt.getSource()).stop();\n notifyStopped();\n }\n }\n };\n new Timer(delay, taskPerformer, getFreeColClient()).start();\n }",
"@Override\n void tryStartOrResumeInfiniteAnimation() {\n if (!isInfiniteAnimator() || mAnimator.getValues() == null) {\n return;\n }\n\n if (isPaused()) {\n if (mQuotaManager.tryAcquireQuota(1)) {\n mListener.mIsUsingQuota.set(true);\n // to simplify the synchronization after pause, always resume the main animator\n // and set the aux animator to beginning to be ready to resume before repeating\n // the main one.\n mAnimator.resume();\n mAuxAnimator.setCurrentFraction(0);\n }\n } else if (!isRunning()) {\n // Infinite animators created when this node was invisible have not started yet.\n tryStartAnimation();\n }\n }",
"@Override\n public void onAnimationEnd() {\n }",
"@Override\n public void run() {\n AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();\n frameAnimation.stop();\n }"
] | [
"0.69305503",
"0.6622276",
"0.66017383",
"0.65922296",
"0.65395087",
"0.64851254",
"0.64828664",
"0.64828664",
"0.64742273",
"0.64649105",
"0.64630866",
"0.64630866",
"0.646012",
"0.646012",
"0.6415948",
"0.64010394",
"0.63986206",
"0.63986206",
"0.6394022",
"0.63858527",
"0.637273",
"0.63672143",
"0.63672143",
"0.63672143",
"0.63672143",
"0.63325185",
"0.6325565",
"0.6309766",
"0.62963855",
"0.6294982",
"0.6294982",
"0.62811047",
"0.62705195",
"0.62705195",
"0.62705195",
"0.62705195",
"0.6240365",
"0.6218761",
"0.6218761",
"0.6212225",
"0.62099385",
"0.62080854",
"0.6200397",
"0.6200397",
"0.6198565",
"0.6198565",
"0.6198565",
"0.6184108",
"0.6184108",
"0.61805636",
"0.61805636",
"0.61786866",
"0.6169388",
"0.6159576",
"0.61518216",
"0.6150751",
"0.6143859",
"0.61372554",
"0.6127762",
"0.610909",
"0.61041635",
"0.61022913",
"0.61022913",
"0.61022913",
"0.61022913",
"0.61022913",
"0.61022913",
"0.60908073",
"0.6090669",
"0.6086895",
"0.6076191",
"0.60757303",
"0.6045965",
"0.60428005",
"0.6033618",
"0.6018412",
"0.6001249",
"0.5996062",
"0.5953703",
"0.59382385",
"0.5934157",
"0.5932613",
"0.59181863",
"0.5886293",
"0.58817255",
"0.5861537",
"0.58338416",
"0.5832891",
"0.58217216",
"0.58201617",
"0.5818525",
"0.5809412",
"0.5789975",
"0.57841367",
"0.5781342",
"0.57776535",
"0.57509696",
"0.57471365",
"0.57468736",
"0.5745902",
"0.57441443"
] | 0.0 | -1 |
An identifier with the intention of being globally unique. | @Schema(required = true, description = "An identifier with the intention of being globally unique. ")
public String getVnfInstanceId() {
return vnfInstanceId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getUniqueId();",
"String uniqueId();",
"private UniqueIdentifier(){\n\t\t\n\t}",
"String getUniqueID();",
"public String getUniqueID();",
"public String getUniqueID ( ) { return _uniqueID; }",
"@Override\n\tpublic native final String createUniqueId() /*-{\n // In order to force uid's to be document-unique across multiple modules,\n // we hang a counter from the document.\n if (!this.gwt_uid) {\n this.gwt_uid = 1;\n }\n\n return \"gwt-uid-\" + this.gwt_uid++;\n\t}-*/;",
"private static String localUnique(){\n\t\tfinal long counterValue = instanceCounter.getAndIncrement();\n\t\tString unique = uniqueTop + String.format(\"%08d\", counterValue);\n\t\treturn unique;\t\t\n\t}",
"public static String aUniqueIdentifier() {\n return \"MONEXT\" + new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n }",
"UUID getUniqueId();",
"public static String randomIdentifier() {\r\n\t\tfinal String lexicon = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\t\tfinal java.util.Random rand = new java.util.Random();\r\n\t\t// consider using a Map<String,Boolean> to say whether the identifier is\r\n\t\t// being used or not\r\n\t\tfinal Set<String> identifiers = new HashSet<String>();\r\n\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\twhile (builder.toString().length() == 0) {\r\n\t\t\tint length = rand.nextInt(5) + 5;\r\n\t\t\tfor (int i = 0; i < length; i++)\r\n\t\t\t\tbuilder.append(lexicon.charAt(rand.nextInt(lexicon.length())));\r\n\t\t\tif (identifiers.contains(builder.toString()))\r\n\t\t\t\tbuilder = new StringBuilder();\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}",
"public String getUniqueId() {\n return _uniqueId;\n }",
"public static String getUniqueIdentifier() {\r\n UUID uuid = UUID.randomUUID();\r\n return uuid.toString();\r\n }",
"private static long getGlobalId() {\n return globalId++;\n }",
"java.lang.String getIdentifier();",
"String createUniqueID(String n){\n String uniqueID =UUID.randomUUID().toString();\n return n + uniqueID;\n }",
"public static String uniqueId() {\r\n return UUID.randomUUID().toString();\r\n }",
"private String generateUniqueIdString() {\r\n return TimeBasedUUID.getUUIDAsString();\r\n }",
"String getUnique();",
"public String createUniqueScriptInstanceIdentifier() {\n\n\t\tLOGGER.debug(\"Creating a unique script instance identifier\");\n\n\t\t// generate a random name for the connection\n\t\tCalendar myCalendar = Calendar.getInstance();\n\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(\"yyyyMMddHHmmssS\");\n\t\tString scriptIdentifier = \"scriptInstance\"\n\t\t\t\t+ dateFormatter.format(myCalendar.getTime())\n\t\t\t\t+ randomNameSequence;\n\t\trandomNameSequence = randomNameSequence + 1;\n\n\t\tLOGGER.info(\"Generated unique script instance identifier [\"\n\t\t\t\t+ scriptIdentifier + \"]\");\n\n\t\treturn scriptIdentifier;\n\t}",
"public int getUniqueId() {\r\n\t\treturn uniqueId;\r\n\t}",
"public static String makeAnonID() {\n String id = \"__anon\" + nextAnonID;\n nextAnonID++;\n return id;\n }",
"public static String uniqueId() {\n return UUID.randomUUID().toString();\n }",
"String generateUID();",
"protected int getUniqueID() {\n\t\treturn uniqueID;\n\t}",
"String getIdentifier();",
"String getIdentifier();",
"String getIdentifier();",
"String getIdentifier();",
"String getIdentifier();",
"String getIdentifier();",
"String getIdentifier();",
"public String uniqueId() {\n return this.uniqueId;\n }",
"public String getUniqueID()\r\n {\r\n return (m_uniqueID);\r\n }",
"int getIdentifier();",
"public String getUniqueIdentifier(){\n return (streetAddress + aptNumber + zip).toLowerCase().replaceAll(\"\\\\s+\",\"\"); \n }",
"public String getUniqueIdValue() {\n return uniqueIdValue;\n }",
"private String creatUniqueID(){\n long ID = System.currentTimeMillis();\n return Long.toString(ID).substring(9,13);\n }",
"protected abstract String getIdentifier();",
"Identifier getId();",
"public String getIdentifierString();",
"public String getIdentifier();",
"public String getIdentifier();",
"public int getIdentifier();",
"@Schema(required = true, description = \"An identifier with the intention of being globally unique. \")\n public String getId() {\n return id;\n }",
"public int identifier();",
"public String getUniqueID() {\n return this.uniqueID;\n }",
"@NonNull String identifier();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"String id();",
"static String generateId() {\r\n\t\treturn UUID.randomUUID().toString().replaceAll(\"-\", \"\");\r\n\t}",
"public void generateID()\n {\n ID = this.hashCode();\n }",
"public int getUniqueID() { \n return -1;\n }",
"private String setUniqueIdentifier(String sUid, Set<Attribute> attrs) {\n\t\tLOG.info(\"BEGIN\");\n\t\tSet<Attribute> currentAttrSet = new HashSet<Attribute>(AttributeUtil\n\t\t\t\t.getCurrentAttributes(attrs));\n\t\tString cUid = AttributeUtil.getNameFromAttributes(currentAttrSet)\n\t\t\t\t.getNameValue();\n\t\tif (cUid.equals(sUid)) {\n\t\t\tsUid = getUniqueIdentifier(cUid);\n\t\t}\n\t\tLOG.info(\"END :: \" + sUid);\n\t\treturn sUid;\n\t}",
"public int hashCode() {\n/* 781 */ return getUniqueId().hashCode();\n/* */ }",
"protected UniqueID() {\n UUID newID = UUID.randomUUID();\n this.mostSigBits = newID.getMostSignificantBits();\n this.leastSigBits = newID.getLeastSignificantBits();\n }",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();"
] | [
"0.7642663",
"0.7632102",
"0.7609607",
"0.75684726",
"0.7332398",
"0.72924423",
"0.7221237",
"0.71983284",
"0.7166887",
"0.7143184",
"0.71310735",
"0.70370036",
"0.70310867",
"0.7003024",
"0.6968177",
"0.6954913",
"0.6951806",
"0.6946664",
"0.69176143",
"0.6914219",
"0.6882111",
"0.6858556",
"0.68294626",
"0.6828604",
"0.6816279",
"0.6789615",
"0.6789615",
"0.6789615",
"0.6789615",
"0.6789615",
"0.6789615",
"0.6789615",
"0.67682546",
"0.6741641",
"0.6732884",
"0.6726964",
"0.6707377",
"0.67059016",
"0.66985345",
"0.66971874",
"0.6679381",
"0.66633654",
"0.66633654",
"0.6653717",
"0.6646343",
"0.6631213",
"0.6625738",
"0.660764",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66066",
"0.66004485",
"0.65798485",
"0.6579457",
"0.6573679",
"0.6572976",
"0.6548487",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766",
"0.6542766"
] | 0.0 | -1 |
STARTED The VNF instance is up and running. STOPPED The VNF instance has been shut down. | @Schema(required = true, description = "STARTED - The VNF instance is up and running. STOPPED - The VNF instance has been shut down. ")
public ChangeStateToEnum getChangeStateTo() {
return changeStateTo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start() {\r\n vcr().start();\t\r\n }",
"public void start() {\n System.out.println(\"This vehicle starts\");\n }",
"@Test(groups = {\"rest-commands\"}, dependsOnMethods = {\"createStandaloneInstanceTest\"})\n public void startInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandStartInstance(STANDALONE_INSTANCE);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandStartInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandStartInstance command execution failed: \" + gfie.getMessage());\n }\n }",
"public void startEngine(){\r\n isEngineRunning = true;\r\n System.out.println(\"[i] Engine is running.\");\r\n }",
"public void start() {\n System.out.println(\"Machine started.\");\n }",
"public void starting();",
"public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }",
"public void run()\n\t{\n\t\trunning = true;\n\t\tSystem.out.println(\"Server started on port \" + port);\n\t}",
"@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"TESLA has been started\");\n\t}",
"public default void start(){\n printNonStatic(\"Started vehicle\");\n }",
"@Override\n public void run() {\n startVMS(mStrVMID, mParams);\n }",
"public void start() {\n System.out.println(\"start\");\n }",
"protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }",
"protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }",
"@DISPID(82)\r\n\t// = 0x52. The runtime will prefer the VTID if present\r\n\t@VTID(80)\r\n\tasci.activebatch.enumInstanceState instanceState();",
"public void start() {}",
"public void start() {}",
"@Override\n public void start() {\n swerveDebug(500, \"SwerveAutoTEST::start\", \"START\");\n\n // Call the super/base class start method.\n super.start();\n\n\n // *************************************************\n // *************************************************\n // ****** set debugging on or off and options ******\n // *************************************************\n // *************************************************\n debugActive = Boolean.TRUE;\n // always add one for the state set in init below\n debugStates = 2;\n debugStartState = autoStates.SWERVE_AUTO_TESTING_TURN_BACK;\n // *************************************************\n // *************************************************\n \n\n swerveDebug( 500, \"SwerveAutoTEST::start\", \"DONE\");\n }",
"public boolean startVBClone() {\n\n String out = RapidUtils\n .executeCommand(\"/usr/local/bin/VBoxManage startvm \" + this.name + \" --type headless\");\n\n if (out.contains(\"has been successfully started.\")) {\n return true;\n }\n\n return false;\n }",
"protected void serverStarted()\r\n {\r\n System.out.println\r\n (\"Server listening for connections on port \" + getPort());\r\n }",
"@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}",
"public void start() {\n\t\tSystem.out.println(\"BMW Slef-----start\");\n\t}",
"public void start() {\n }",
"public void start() {\n\n\t}",
"public void start()\n {\n }",
"public void start()\n {}",
"public void start() {\n\t\t\n\t}",
"public void start() {\n\t\t\n\t}",
"private boolean startVirtualMachine(String instanceId) throws Exception {\n try {\n CloudStackUserVm resp = getApi().startVirtualMachine(instanceId);\n if (logger.isDebugEnabled())\n logger.debug(\"Starting VM \" + instanceId);\n return resp != null;\n } catch (Exception e) {\n logger.error(\"StartVirtualMachine - \", e);\n throw new Exception(e.getMessage() != null ? e.getMessage() : e.toString());\n }\n }",
"@DISPID(83)\r\n\t// = 0x53. The runtime will prefer the VTID if present\r\n\t@VTID(81)\r\n\tasci.activebatch.enumInstanceStateDetail instanceStateDetail();",
"public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }",
"boolean isStarted();",
"boolean isStarted();",
"boolean initializeStart() {\n if (state != PlatformState.STOPPED) {\n return false;\n }\n state = PlatformState.STARTING;\n return true;\n }",
"public void start()\r\n\t{\n\tSystem.out.println(\"normal start method\");\r\n\t}",
"public void start() {\n\n }",
"public void start(){\n }",
"@Override\n public void start() {\n System.out.println(\"smart life cycle start\");\n flag = true;\n }",
"public static void vu0Start() { }",
"public PedoListener() {\n this.starttimestamp = 0;\n this.startsteps = 0;\n this.setStatus(PedoListener.STOPPED);\n\t\t\t\t\n\t\t Log.i(TAG, \"PedoListener Init service for steps\");\n }",
"public void start() {\n\t\tSystem.out.println(\"开启系统1\");\r\n\t}",
"@Test(expected = org.apache.axis.AxisFault.class)\n\tpublic void testStartInstance_4()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tSAPInstance aInstance = new SAPInstance();\n\t\tOperationOptions aOptions = new OperationOptions();\n\n\t\tOperationResult result = fixture.startInstance(aInstance, aOptions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}",
"@Test\n\tpublic void testStartInstance_1()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tSAPInstance aInstance = new SAPInstance();\n\t\tOperationOptions aOptions = new OperationOptions();\n\n\t\tOperationResult result = fixture.startInstance(aInstance, aOptions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}",
"@Test(expected = org.apache.axis.NoEndPointException.class)\n\tpublic void testStartInstance_5()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub((URL) null, new DeployWSServiceLocator());\n\t\tSAPInstance aInstance = new SAPInstance();\n\t\tOperationOptions aOptions = new OperationOptions();\n\n\t\tOperationResult result = fixture.startInstance(aInstance, aOptions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}",
"private void start() {\n\n\t}",
"public boolean start() {\n\t\treturn true;\n\t}",
"private void foundRunning() {\n\t\tif (state == BridgeState.RUNNING || state == BridgeState.CREATED) {\n\t\t\tstate = BridgeState.RUNNING;\n\t\t}\n\t}",
"@Override\r\n public boolean isRunning()\r\n {\n return initialized;\r\n }",
"@Override\n public void start() {\n System.out.println(\"The SportCar is started !\");\n }",
"public boolean isRunning()\n {\n\n // TODO Auto-generated method stub\n return !started || running;\n }",
"public boolean start();",
"public boolean isStarted(){\n \treturn started;\n }",
"public void startup() {\n\t\tstart();\n }",
"@Test(expected = org.apache.axis.AxisFault.class)\n\tpublic void testStartInstance_3()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tSAPInstance aInstance = new SAPInstance();\n\t\tOperationOptions aOptions = new OperationOptions();\n\n\t\tOperationResult result = fixture.startInstance(aInstance, aOptions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}",
"@Override\r\n\tpublic void volume() {\n\t\tSystem.out.println(\"Turn up\");\r\n\t\t\r\n\t}",
"public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}",
"protected void serverStopped()\n {\n // System.out.println\n // (\"Server has stopped listening for connections.\");\n }",
"public void start() {\n\t\t// Used to keep track of if we're still attached to the VM.\n\t\tScheduledFuture<?> future = null;\n\t\ttry {\n\t\t\t// Start redirecting process output\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tInputStream pOutput = vm.process().getInputStream();\n\t\t\tInputStream pErr = vm.process().getErrorStream();\n\t\t\tfuture = ThreadUtil.runRepeated(PRINT_THREAD_DELAY, () -> {\n\t\t\t\ttry {\n\t\t\t\t\t// Handle receiving output\n\t\t\t\t\tif (out != null) {\n\t\t\t\t\t\tint size = pOutput.available();\n\t\t\t\t\t\tif (size > 0) {\n\t\t\t\t\t\t\tint n = pOutput.read(buffer, 0, Math.min(size, buffer.length));\n\t\t\t\t\t\t\tout.println(new String(buffer, 0, n));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize = pErr.available();\n\t\t\t\t\t\tif (size > 0) {\n\t\t\t\t\t\t\tint n = pErr.read(buffer, 0, Math.min(size, buffer.length));\n\t\t\t\t\t\t\tout.println(new String(buffer, 0, n));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch(IOException ex) {\n\t\t\t\t\terror(ex, \"Exception occurred while processing VM IPC\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t// Handle vm events\n\t\t\teventLoop();\n\t\t} catch(VMDisconnectedException ex) {\n\t\t\t// Expected\n\t\t} catch(InterruptedException ex) {\n\t\t\terror(ex, \"Failed processing VM event queue\");\n\t\t}\n\t\tif (future != null)\n\t\t\tfuture.cancel(true);\n\t}",
"public boolean isStarted() {\n \t\treturn isStarted;\n \t}",
"@Override\n public synchronized void start() {\n\n lifecycleState = LifecycleState.START;\n }",
"@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"BMW -- start\");\n\t}",
"public boolean checkEngineStatus(){\r\n return isEngineRunning;\r\n }",
"@Test\n public void testLifeCycle() {\n NewServerResponse serverResponse = connection.createServer(\n \"test.ivan.api.com\", \"lenny\", \"MIRO1B\");\n Server server = serverResponse.getServer();\n // Now we have the server, lets restart it\n assertNotNull(server.getId());\n ServerInfo serverInfo = connection.restartServer(server.getId());\n\n // Should be running now.\n assertEquals(serverInfo.getState(), RunningState.RUNNING);\n assertEquals(server.getName(), \"test.ivan.api.com\");\n assertEquals(server.getImageId(), \"lenny\");\n connection.destroyServer(server.getId());\n }",
"public void start() {\n\t\tSystem.out.println(\"BMW.........start!!!.\");\n\t}",
"@DISPID(47)\r\n\t// = 0x2f. The runtime will prefer the VTID if present\r\n\t@VTID(45)\r\n\tint instancesSucceeded();",
"protected void start() {\n }",
"@Override\n\tpublic void startUp() {\n\t\tSystem.out.println(\"disk startup!\");\n\n\t}",
"public boolean isStartingUp() {\r\n\t\treturn isStartingUp;\r\n\t}",
"public abstract void started();",
"public void start() {\n mStateMachine.sendMessage(SoftApStateMachine.CMD_START, mApConfig);\n }",
"public synchronized void setStopped() {\n state = STOPPED;\n }",
"public boolean isRunning() {\r\n\t\treturn __flagRunning;\r\n\t}",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"@Override\r\n\tpublic void volumeUp() {\n\t\tSystem.out.println(\"ig tv volume on\");\r\n\r\n\t}",
"public boolean isRunning ()\n {\n return server == null ? false : true;\n }",
"@Override\n\tpublic void volumeUp() {\n\t\tSystem.out.println(\"samsongTV volumeUp\");\n\n\t}",
"public static boolean vu0IsRunning() { return false; }",
"public void startTracking()\n\t{\t\n\t\tProcessBuilder starterProcess = new ProcessBuilder(\"ssh\", \n\t\t\t\t\t\t\t\t\t\t\"pi@\" + RASPBERRY_PI_LOCATION,\n\t\t\t\t\t\t\t\t\t\t\"\\\"sudo /home/pi/code/stop_vision.sh && /home/pi/code/start_vision.sh \" + \n\t\t\t\t\t\t\t\t\t\tFPS + \" \" + \n\t\t\t\t\t\t\t\t\t\tIMAGE_WIDTH + \"x\" + IMAGE_HEIGHT + \"\\\"\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tstarterProcess.start();\n\t\t\ttracking = true;\n\t\t\tSystem.out.println(\"Started vision tracking on Pi\");// + startedProcess + \" (Error:\" + startedProcess.getErrorStream() + \")\");\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"Could not start process to commence Raspberry Pi GRIP program: \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public String getServicingEventLogInstanceStatus() {\n return servicingEventLogInstanceStatus;\n }",
"boolean isOpen() {\n return state == RUNNING;\n }",
"public void start()\n/* 354: */ {\n/* 355:434 */ onStartup();\n/* 356: */ }",
"@Override public void start() {\n }",
"public void start() {\r\n\t\trunning = true;\r\n\t\trun();\r\n\t}",
"public void startService() {\n log_d( \"startService()\" );\n \tint state = execStartService();\n\t\tswitch( state ) {\n\t\t\tcase STATE_CONNECTED:\n\t\t\t\tshowTitleConnected( getDeviceName() );\n\t\t\t\thideButtonConnect();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tshowTitleNotConnected();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public void start() {\n LOG.entering(CLASS_NAME, \"start\");\n if (state.compareAndSet(STOPPING, STARTED)) {\n // Keep same thread running if STOPPING\n }\n else if (state.compareAndSet(STOPPED, STARTED)) {\n new Thread(this, \"XoaEventProcessor\").start();\n }\n }",
"public void run() {\n running = true;\n System.out.println(\"Server started on port: \" + port);\n manageClients();\n receive();\n startConsole();\n }",
"void start() {\n }",
"boolean hasStarted() {\n return hasStarted;\n }",
"public boolean isStarted()\n\t{\n\t\treturn isStarted;\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}"
] | [
"0.5963577",
"0.57415855",
"0.56513697",
"0.5628433",
"0.55327535",
"0.54999375",
"0.54910916",
"0.54830855",
"0.544776",
"0.5435269",
"0.54312223",
"0.54094124",
"0.5405372",
"0.5391041",
"0.5387136",
"0.5370157",
"0.5370157",
"0.536346",
"0.5356714",
"0.53460914",
"0.53447163",
"0.5317138",
"0.5304751",
"0.5302058",
"0.52993476",
"0.52945215",
"0.52903736",
"0.52903736",
"0.52865803",
"0.527602",
"0.52703387",
"0.5245916",
"0.5245916",
"0.5240348",
"0.523892",
"0.5230628",
"0.52210665",
"0.5215456",
"0.5214897",
"0.5212983",
"0.52055496",
"0.5201293",
"0.5185528",
"0.51758444",
"0.5175406",
"0.51744473",
"0.51712704",
"0.51710165",
"0.5170041",
"0.51629",
"0.51525986",
"0.5152438",
"0.5146206",
"0.51414865",
"0.5139917",
"0.5139411",
"0.5133357",
"0.51285017",
"0.512438",
"0.51201344",
"0.51055527",
"0.51035714",
"0.5097755",
"0.509687",
"0.50908107",
"0.50904036",
"0.5084147",
"0.50748456",
"0.5065457",
"0.5055661",
"0.50527483",
"0.5049933",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044506",
"0.5044136",
"0.5041649",
"0.50404036",
"0.5038189",
"0.50372463",
"0.50350314",
"0.5030907",
"0.5030229",
"0.5024832",
"0.50119585",
"0.4990629",
"0.49864954",
"0.49789965",
"0.49784607",
"0.49752995",
"0.4971602",
"0.49676937"
] | 0.0 | -1 |
FORCEFUL: The VNFM will stop the VNF immediately after accepting the request. GRACEFUL: The VNFM will first arrange to take the VNF out of service after accepting the request. Once that operation is successful or once the timer value specified in the \"gracefulStopTimeout\" attribute expires, the VNFM will stop the VNF. | @Schema(description = "* FORCEFUL: The VNFM will stop the VNF immediately after accepting the request. * GRACEFUL: The VNFM will first arrange to take the VNF out of service after accepting the request. Once that operation is successful or once the timer value specified in the \"gracefulStopTimeout\" attribute expires, the VNFM will stop the VNF. ")
public StopTypeEnum getStopType() {
return stopType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Schema(description = \"The time interval (in seconds) to wait for the VNF to be taken out of service during graceful stop, before stopping the VNF. \")\n public Integer getGracefulStopTimeout() {\n return gracefulStopTimeout;\n }",
"public static void triggerImmediateForcefulShutdown() {\n triggerImmediateForcefulShutdown(1);\n }",
"public void stopMAS(int deadline) throws Exception;",
"public void triggerTimeout(List<TOMMessage> requestList) {\n\n ObjectOutputStream out = null;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n\n int regency = lcManager.getNextReg();\n \n requestsTimer.stopTimer();\n requestsTimer.Enabled(false);\n\n\t// still not in the leader change phase?\n if (lcManager.getNextReg() == lcManager.getLastReg()) {\n\n lcManager.setNextReg(lcManager.getLastReg() + 1); // define next timestamp\n\n regency = lcManager.getNextReg(); // update variable \n\n // store messages to be ordered\n lcManager.setCurrentRequestTimedOut(requestList);\n\n // store information about messages that I'm going to send\n lcManager.addStop(regency, this.controller.getStaticConf().getProcessId());\n\n //execManager.stop(); // stop consensus execution\n\n //Get requests that timed out and the requests received in STOP messages\n //and add those STOPed requests to the client manager\n addSTOPedRequestsToClientManager();\n List<TOMMessage> messages = getRequestsToRelay();\n\n try { // serialize content to send in STOP message\n out = new ObjectOutputStream(bos);\n\n if (messages != null && messages.size() > 0) {\n\n\t\t\t\t\t//TODO: If this is null, then there was no timeout nor STOP messages.\n //What to do?\n byte[] serialized = bb.makeBatch(messages, 0, 0, controller.getStaticConf().getUseSignatures() == 1);\n out.writeBoolean(true);\n out.writeObject(serialized);\n } else {\n out.writeBoolean(false);\n logger.warn(\"Strange... did not include any request in my STOP message for regency \" + regency);\n }\n\n out.flush();\n bos.flush();\n\n byte[] payload = bos.toByteArray();\n\n out.close();\n bos.close();\n\n // send STOP-message \n logger.info(\"Sending STOP message to install regency \" + regency + \" with \" + (messages != null ? messages.size() : 0) + \" request(s) to relay\");\n \n LCMessage stop = new LCMessage(this.controller.getStaticConf().getProcessId(), TOMUtil.STOP, regency, payload);\n requestsTimer.setSTOP(regency, stop); // make replica re-transmit the stop message until a new regency is installed\n communication.send(this.controller.getCurrentViewOtherAcceptors(), stop);\n\n } catch (IOException ex) {\n logger.error(\"Could not serialize STOP message\", ex);\n } finally {\n try {\n out.close();\n bos.close();\n } catch (IOException ex) {\n logger.error(\"Could not serialize STOP message\", ex);\n }\n }\n\n }\n\n processOutOfContextSTOPs(regency); // the replica might have received STOPs\n // that were out of context at the time they\n // were received, but now can be processed\n \n startSynchronization(regency); // evaluate STOP messages\n \n }",
"public static void stopServerImmediately(Object syncObject) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.stopServerImmediately\");\n if (syncObject != null) {\n if (QVCSEnterpriseServer.getServerIsRunningFlag()) {\n synchronized (syncObject) {\n ServerResponseFactory.setShutdownInProgress(true);\n QVCSEnterpriseServer.setShutdownInProgress(true);\n try {\n syncObject.wait();\n } catch (InterruptedException e) {\n Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, e);\n } finally {\n serverProxyObject = null;\n }\n }\n } else {\n serverProxyObject = null;\n }\n } else {\n if (QVCSEnterpriseServer.getServerIsRunningFlag()) {\n try {\n ServerResponseFactory.setShutdownInProgress(true);\n QVCSEnterpriseServer.setShutdownInProgress(true);\n Thread.sleep(KILL_DELAY);\n serverProxyObject = null;\n }\n catch (InterruptedException ex) {\n Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n serverProxyObject = null;\n }\n }\n }",
"public void emergencyStopIssued()\n {\n // Default implementation does nothing\n }",
"@PostMapping(value = \"/stop\")\n public ResponseEntity stop(){\n try {\n CommandExecutor.execute(Commands.shutdown);\n return ResponseEntity.ok().build();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return ResponseEntity.status(500).build();\n }",
"public void deliverTimeoutRequest(LCMessage msg) {\n\n switch (msg.getType()) {\n case TOMUtil.STOP: { // message STOP\n\n logger.info(\"Last regency: \" + lcManager.getLastReg() + \", next regency: \" + lcManager.getNextReg());\n\n // this message is for the next leader change?\n if (msg.getReg() == lcManager.getLastReg() + 1) {\n\n logger.debug(\"Received regency change request\");\n\n TOMMessage[] requests = deserializeTOMMessages(msg.getPayload());\n\n // store requests that came with the STOP message\n lcManager.addRequestsFromSTOP(requests);\n\n // store information about the message STOP\n lcManager.addStop(msg.getReg(), msg.getSender());\n\n processOutOfContextSTOPs(msg.getReg()); // the replica might have received STOPs\n // that were out of context at the time they\n // were received, but now can be processed\n\n startSynchronization(msg.getReg()); // evaluate STOP messages\n\n } else if (msg.getReg() > lcManager.getLastReg()) { // send STOP to out of context if\n // it is for a future regency\n logger.debug(\"Keeping STOP message as out of context for regency \" + msg.getReg());\n outOfContextLC.add(msg);\n\n } else {\n logger.debug(\"Discarding STOP message\");\n }\n }\n break;\n case TOMUtil.STOPDATA: { // STOPDATA messages\n\n int regency = msg.getReg();\n\n logger.info(\"Last regency: \" + lcManager.getLastReg() + \", next regency: \" + lcManager.getNextReg());\n\n // Am I the new leader, and am I expecting this messages?\n if (regency == lcManager.getLastReg()\n && this.controller.getStaticConf().getProcessId() == execManager.getCurrentLeader()/*(regency % this.reconfManager.getCurrentViewN())*/) {\n\n logger.debug(\"I'm the new leader and I received a STOPDATA\");\n processSTOPDATA(msg, regency);\n } else if (msg.getReg() > lcManager.getLastReg()) { // send STOPDATA to out of context if\n // it is for a future regency\n\n logger.debug(\"Keeping STOPDATA message as out of context for regency \" + msg.getReg());\n outOfContextLC.add(msg);\n\n } else {\n logger.debug(\"Discarding STOPDATA message\");\n }\n }\n break;\n case TOMUtil.SYNC: { // message SYNC\n\n int regency = msg.getReg();\n\n logger.info(\"Last regency: \" + lcManager.getLastReg() + \", next regency: \" + lcManager.getNextReg());\n\n // I am expecting this sync?\n boolean isExpectedSync = (regency == lcManager.getLastReg() && regency == lcManager.getNextReg());\n\n // Is this sync what I wanted to get in the previous iteration of the synchoronization phase?\n boolean islateSync = (regency == lcManager.getLastReg() && regency == (lcManager.getNextReg() - 1));\n\n //Did I already sent a stopdata in this iteration?\n boolean sentStopdata = (lcManager.getStopsSize(lcManager.getNextReg()) == 0); //if 0, I already purged the stops,\n //which I only do when I am about to\n //send the stopdata\n\n // I am (or was) waiting for this message, and did I received it from the new leader?\n if ((isExpectedSync || // Expected case\n (islateSync && !sentStopdata)) && // might happen if I timeout before receiving the SYNC\n (msg.getSender() == execManager.getCurrentLeader())) {\n\n //if (msg.getReg() == lcManager.getLastReg() &&\n //\t\tmsg.getReg() == lcManager.getNextReg() && msg.getSender() == lm.getCurrentLeader()/*(regency % this.reconfManager.getCurrentViewN())*/) {\n processSYNC(msg.getPayload(), regency);\n\n } else if (msg.getReg() > lcManager.getLastReg()) { // send SYNC to out of context if\n // it is for a future regency\n logger.debug(\"Keeping SYNC message as out of context for regency \" + msg.getReg());\n outOfContextLC.add(msg);\n\n } else {\n logger.debug(\"Discarding SYNC message\");\n }\n }\n break;\n\n }\n\n }",
"private void setAutoSelfDestruct() {\n \n try{\n //Sets task to shut server down \n this.timer.schedule(new TimerTask() {\n @Override\n public void run() {\n if(clientHandlers.isEmpty()){\n System.err.println(\"Closing due to inactivity\");\n System.exit(0);\n }else{\n setAutoSelfDestruct();\n }\n }\n }, (60000*3));\n }catch( IllegalStateException e){\n System.err.println(\"Timer is being reset\");\n this.timer = new Timer();\n setAutoSelfDestruct();\n }\n }",
"pb4server.CancelCureSoliderAskReq getCancelCureSoliderAskReq();",
"public static void vu0Stop() { }",
"public void setAllowStop(boolean allowed);",
"@Override\n public void interruptWait() {\n _vcVlsi.cancelWaitForUpdates();\n }",
"void canceledPendingNodeStop();",
"void setStopTimeout(int stopTimeout);",
"private void reStartTimeout() {\n cancelTask();\n startTimeout();\n }",
"public void forceTimeout() {\n getTimeoutScheduler().forceExecute();\n }",
"public boolean stop(long timeout, TimeUnit timeUnit) {\n/* 73 */ setStopping();\n/* 74 */ boolean stopped = stop(this.future);\n/* 75 */ setStopped();\n/* 76 */ return stopped;\n/* */ }",
"private void reconsiderStop(NodeReference position, NodeReference station, IVehicleContext context) {\n NodeReference prev = context.getChargingStop();\n float ar = context.getEV().getActionRadius() / 1000; //convert m to km.\n //float distanceBef = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n context.scheduleChargingStop(station);\n float distanceAft = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n if (distanceAft > ar) {\n context.scheduleChargingStop(prev);\n }else{\n eventcontroller.publishEvent(\"agent:dmas:reconsider\", \"vehicle\",context.getEV().getVehicleEntity().getVehicleReference().getId());\n }\n }",
"private static synchronized void requestStop() {\n stopRequested = true;\n }",
"public void stopRequest()\r\n\t{\r\n\t\tnoStopRequested = false;\r\n\t\tinternalThread.interrupt();\r\n\t}",
"@Test\r\n public void test_stop() throws InterruptedException {\r\n final CountDownLatch expectedTimeoutReceivedLatch = new CountDownLatch(1);\r\n final CountDownLatch timeoutWhichShouldNeverBeReceivedLatch = new CountDownLatch(2);\r\n final IExpiryAction<Long> timeoutAction = new IExpiryAction<Long>() {\r\n @Override\r\n public void onTimeout(final Long payload) {\r\n //\r\n // count-down our latches. The first latch only requires one\r\n // invocation, the second expects two (though the second should\r\n // never be received)\r\n //\r\n expectedTimeoutReceivedLatch.countDown();\r\n timeoutWhichShouldNeverBeReceivedLatch.countDown();\r\n }\r\n };\r\n\r\n final int taskTimeout = 100;\r\n final ExpiryViceroy<Long> timeoutManager = ExpiryViceroy.start(timeoutAction, taskTimeout,\r\n TimeUnit.MILLISECONDS);\r\n\r\n //\r\n // ensure it's running - add a task which will expire\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(1));\r\n final boolean timeoutReached = expectedTimeoutReceivedLatch.await(1, TimeUnit.SECONDS);\r\n Assert.assertTrue(\"timeout reached\", timeoutReached);\r\n\r\n //\r\n // now kill the timeout manager ...\r\n //\r\n timeoutManager.stop();\r\n\r\n //\r\n // ... and submit another task.\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(2));\r\n final boolean timeoutNeverReceived = timeoutWhichShouldNeverBeReceivedLatch.await(taskTimeout + 100,\r\n TimeUnit.MILLISECONDS);\r\n Assert.assertFalse(\"a second timeout should never have been called\", timeoutNeverReceived);\r\n }",
"@Override\n\tpublic void forceStop(String tenantId, String serverId) throws Exception {\n\t\tSystem.out.println(\"force stop \" + tenantId + \"'s server \" + serverId + \"!!\");\n\t}",
"@Override\n public void close() throws Exception {\n Future<Boolean> stopped = gracefulStop(mgr, Duration.create(5, TimeUnit.SECONDS));\n Await.result(stopped, Duration.create(5, TimeUnit.SECONDS));\n\n system.terminate();\n Await.result(system.whenTerminated(), Duration.create(5, TimeUnit.SECONDS));\n }",
"public synchronized void requestStop() \n\t{\n\t\tstoprequested = true;\n\t}",
"void stop(long timeout);",
"@Override\n public void stop() {\n Thread t = new Thread(server::stopOrderProcess);\n t.setName(\"Server close task\");\n t.start();\n serverFrame.enableControls(false, false);\n enableControls(false, false);\n }",
"public void stoptimertask() {\n if (timer != null) {\r\n timer.cancel();\r\n timer = null;\r\n }}",
"@Override\r\n\tprotected IAPIResponse executeLegacyService(APIRequestVO apiVO) {\r\n\t\tSOCancelResponse cancelResponse = new SOCancelResponse();\r\n\t\treturn cancelResponse;\r\n\t}",
"public void stoptimertask() {\n\t\tif (timer != null) {\n\t\t\ttimer.cancel();\n\t\t\ttimer = null;\n\t\t}\n\t}",
"public void processLocalTimeout(ScheduledLocalTimeout scheduledTimeout) {\n\t\tfinal View view = scheduledTimeout.view();\n\n\t\tif (!view.equals(this.latestViewUpdate.getCurrentView())) {\n\t\t\tlog.trace(\"LocalTimeout: Ignoring timeout {}, current is {}\", scheduledTimeout, this.latestViewUpdate.getCurrentView());\n\t\t\treturn;\n\t\t}\n\n\t\tlog.trace(\"LocalTimeout: {}\", scheduledTimeout);\n\n\t\tthis.isViewTimedOut = true;\n\n\t\tupdateTimeoutCounters(scheduledTimeout);\n\n\t\tthis.safetyRules\n\t\t\t.getLastVote(view)\n\t\t\t.map(this.safetyRules::timeoutVote)\n\t\t\t.ifPresentOrElse(\n\t\t\t\t/* if there is a previously sent vote, we time it out and broadcast to all nodes */\n\t\t\t\tvote -> this.voteDispatcher.dispatch(this.validatorSet.nodes(), vote),\n\t\t\t\t/* otherwise, we asynchronously insert an empty vertex and, when done,\n\t\t\t\t\twe send a timeout vote on it (see processBFTUpdate) */\n\t\t\t\t() -> createTimeoutVertexAndSendVote(view));\n\n\t\trescheduleTimeout(scheduledTimeout);\n\t}",
"public static void stop(){\n printStatic(\"Stopped vehicle\");\n }",
"public void stoptimertask() {\n if (timer != null) {\n timer.cancel();\n timer = null;\n }\n }",
"public void stoptimertask() {\n if (timer != null) {\n timer.cancel();\n timer = null;\n }\n }",
"public void stoptimertask() {\n if (timer != null) {\n timer.cancel();\n timer = null;\n }\n }",
"public void stoptimertask() {\n if (timer != null) {\n timer.cancel();\n timer = null;\n }\n }",
"pb4server.CancelMakeSoliderAskReq getCancelMakeSoliderAskReq();",
"int hardTimeout();",
"public void halt(ServiceResult result);",
"public void stopSoft() {\n stopped.set(true);\n }",
"public native void disableRetransmitCountFactorInRTO();",
"public void signalFree() {\n lock.lock();\n try {\n Log.d(TAG, \"Signaling NsdManager Resolver as free\");\n busy = false;\n condition.signal();\n } finally {\n lock.unlock();\n }\n }",
"public void stopping() {\n super.stopping();\n }",
"public synchronized void stop()\r\n/* 78: */ {\r\n/* 79:203 */ if (!this.monitorActive) {\r\n/* 80:204 */ return;\r\n/* 81: */ }\r\n/* 82:206 */ this.monitorActive = false;\r\n/* 83:207 */ resetAccounting(milliSecondFromNano());\r\n/* 84:208 */ if (this.trafficShapingHandler != null) {\r\n/* 85:209 */ this.trafficShapingHandler.doAccounting(this);\r\n/* 86: */ }\r\n/* 87:211 */ if (this.scheduledFuture != null) {\r\n/* 88:212 */ this.scheduledFuture.cancel(true);\r\n/* 89: */ }\r\n/* 90: */ }",
"public void Stop(){\r\n\t\trunning = false;\r\n\t\thelp.print(\"Closing server, waiting for workers to complete\");\r\n\t}",
"public void stopAutomaticRefresh() {\n try {\n dnsService.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void stop() {\n\t\tthread.requestStop = true;\n\t\tlong start = System.currentTimeMillis()+timeout;\n\t\twhile( start > System.currentTimeMillis() && thread.running )\n\t\t\tThread.yield();\n\n\t\tdevice.stopDepth();\n\t\tdevice.stopVideo();\n\t\tdevice.close();\n\t}",
"java.util.concurrent.Future<StopApplicationResult> stopApplicationAsync(StopApplicationRequest stopApplicationRequest);",
"private void doStop()\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n \"STOP\", \r\n null,\r\n null,\r\n null, \r\n null,\r\n false,\r\n null,\r\n null ) );\r\n }",
"public void stopping();",
"private void cancelTimeout(){\n\t\tSharedPreferences timeout = mContext.getSharedPreferences(\"Timeout\"+Integer.toString(mRid), Context.MODE_PRIVATE);\n\t SharedPreferences.Editor editor = timeout.edit();\n\t editor.putLong(\"start\", 0);\n\t editor.apply();\n\t}",
"public void cancel() {\n target.setAllowFlight(false);\n target.setWalkSpeed(0.01F);\n target.setFlySpeed(0.01F);\n targets.remove(target);\n\n JavaUtils.broadcastStage(\"done\",this);\n }",
"private void checkTimeout() {\n/* 169 */ if (this.socket != null) {\n/* */ \n/* 171 */ long i = this.keepaliveTimeoutMs;\n/* */ \n/* 173 */ if (this.listRequests.size() > 0)\n/* */ {\n/* 175 */ i = 5000L;\n/* */ }\n/* */ \n/* 178 */ long j = System.currentTimeMillis();\n/* */ \n/* 180 */ if (j > this.timeLastActivityMs + i)\n/* */ {\n/* 182 */ terminate(new InterruptedException(\"Timeout \" + i));\n/* */ }\n/* */ } \n/* */ }",
"public final void zzf() throws RemoteException {\r\n this.zzaa.zzar.setSessionTimeoutDuration(this.zzba);\r\n }",
"public void emergencyStopMode() {\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.EMERGENCY_STOP));\n this.mode = State.EMERGENCY_STOP;\n }",
"public boolean getAllowStop();",
"private void safeStop() {\n getRobotDrive().stop();\n //pneumatics.stop();\n }",
"public void acceptTimeout();",
"public abstract void cancel(float timeoutInSeconds)\n throws NotImplementedException, IncorrectStateException,\n TimeoutException, NoSuccessException;",
"public void handleTimeout();",
"pb4server.CureSoliderAskReq getCureSoliderAskReq();",
"@Override\n\tpublic void requestStopInstance() {\n\t\tif (!isStarted.get() && !enableRequested.get()) {\n\t\t\tLOGGER.error(\"requestStopInstance: Instance not started - ignoring request\");\n\t\t\treturn;\n\t\t}\n\t\tenableRequested.set(false);\n\t\tstopRequested.set(true);\n\t\tsynchronized (lockPeerChange) {\n\t\t\tlockPeerChange.notifyAll();\n\t\t}\n\t}",
"@Override\r\n\tprotected void doStop() throws Exception {\n\r\n\t}",
"public void forceShutdown() {\n shutdown(true);\n }",
"public void setTerminationAfterToolchainTimeout(final long gracePeriod) {\r\n\t\tsynchronized (this) {\r\n\t\t\tif (mTimeoutAttached.getAndSet(true)) {\r\n\t\t\t\tthrow new ConcurrentModificationException(\r\n\t\t\t\t\t\t\"You tried to attach a timeout twice for the monitored process\" + mID);\r\n\t\t\t}\r\n\r\n\t\t\tif (gracePeriod < 0) {\r\n\t\t\t\tthrow new IllegalArgumentException(\"millis must be non-negative\");\r\n\t\t\t}\r\n\r\n\t\t\tnew Thread(new Runnable() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\timpatientWaitUntilToolchainTimeout(gracePeriod);\r\n\t\t\t\t}\r\n\t\t\t}, \"ToolchainTimeout watcher for \" + mID).start();\r\n\t\t}\r\n\t}",
"private void checkIfForceKill() {\n SharedPreferences settings = PreferenceManager\n .getDefaultSharedPreferences(this);\n boolean forceKill = settings.getBoolean(\n FORCE_EXIT_APPLICATION, false);\n\n if (forceKill) {\n //CLEAR THE FORCE_EXIT SETTINGS\n SharedPreferences.Editor editor = settings.edit();\n editor.putBoolean(FORCE_EXIT_APPLICATION, false);\n // Commit the edits!\n editor.apply();\n //HERE STOP ALL YOUR SERVICES\n finish();\n }\n }",
"@PreDestroy\n public void preDestroy() {\n scheduledFuture.cancel(true);\n execService.shutdown();\n }",
"public void forceStop() {\r\n\t\tchaseObj = false;\r\n\t}",
"public void forcedTermination(TerminationEvent evt){\r\n final\tName name = evt.getConsultant().getName();\r\n System.out.println(name + \" was fired.\");\r\n forcedTc++;\r\n }",
"public Future<ApiResponse<Void>> deleteWorkforcemanagementManagementunitTimeofflimitAsync(ApiRequest<Void> request, final AsyncApiCallback<ApiResponse<Void>> callback) {\n try {\n final SettableFuture<ApiResponse<Void>> future = SettableFuture.create();\n final boolean shouldThrowErrors = pcapiClient.getShouldThrowErrors();\n pcapiClient.invokeAsync(request, null, new AsyncApiCallback<ApiResponse<Void>>() {\n @Override\n public void onCompleted(ApiResponse<Void> response) {\n notifySuccess(future, callback, response);\n }\n\n @Override\n public void onFailed(Throwable exception) {\n if (exception instanceof ApiException) {\n @SuppressWarnings(\"unchecked\")\n ApiResponse<Void> response = (ApiResponse<Void>)(ApiResponse<?>)exception;\n notifySuccess(future, callback, response);\n }\n if (shouldThrowErrors) {\n notifyFailure(future, callback, exception);\n }\n else {\n @SuppressWarnings(\"unchecked\")\n ApiResponse<Void> response = (ApiResponse<Void>)(ApiResponse<?>)(new ApiException(exception));\n notifySuccess(future, callback, response);\n }\n }\n });\n return future;\n }\n catch (Throwable exception) {\n return Futures.immediateFailedFuture(exception);\n }\n }",
"public abstract void ResloveService() throws IOException;",
"@Override\n public synchronized Response FailHandler(Request req) throws RemoteException {\n this.isTerminate = true;\n this.isSuccess = false;\n return null;\n }",
"pb4server.CancelCureSoliderAskReqOrBuilder getCancelCureSoliderAskReqOrBuilder();",
"public boolean emergencyStop()\n {\n return finchController.emergencyStop();\n }",
"void stopNodeAgentServices();",
"void handleTimeoutTask();",
"public void stop() {\n awaitStop();\n }",
"public boolean stop() throws ConfigurationException {\r\n\t\t\r\n\t\tRPCServer server;\r\n\t\t\r\n\t\tlogger.info(\"Received stop request\");\r\n\r\n\t\t// Closing all index writers\r\n\t\tIndexHolder.closeAllWriters();\r\n\r\n\t\t// TODO: add more security. \r\n\t\t// It shouldn't be possible for every client to stop the rpc server.\r\n\t\tserver = RPCServer.getInstance();\r\n\t\tserver.setAlive(false);\r\n\r\n\t\t// Set server status inactive\r\n\t\tilServerStatus.setActive(false);\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Override\n protected void handleExecuteTimeoutException(final TimeoutException timeoutEx) {\n officeProcessManager.restartDueToTaskTimeout();\n }",
"@Override\n public void stop() {\n leftFrontDrive.setPower(0.0);\n rightFrontDrive.setPower(0.0);\n leftRearDrive.setPower(0.0);\n rightRearDrive.setPower(0.0);\n\n // Disable Tracking when we are done;\n targetsUltimateGoal.deactivate();\n\n //closes object detection to save system resouces\n if (tfod != null) {\n tfod.shutdown();\n }\n }",
"public abstract void stopService();",
"public static void triggerImmediateForcefulShutdown(int status) {\n triggerImmediateForcefulShutdown(status, true);\n }",
"public CompletableFuture<MockServerClient> stop(boolean ignoreFailure) {\n if (!stopFuture.isDone()) {\n getMockServerEventBus().publish(EventType.STOP);\n removeMockServerEventBus();\n new Scheduler.SchedulerThreadFactory(\"ClientStop\").newThread(() -> {\n try {\n sendRequest(request().withMethod(\"PUT\").withPath(calculatePath(\"stop\")), false);\n if (!hasStopped()) {\n for (int i = 0; !hasStopped() && i < 50; i++) {\n TimeUnit.MILLISECONDS.sleep(5);\n }\n }\n } catch (RejectedExecutionException ree) {\n if (!ignoreFailure && MockServerLogger.isEnabled(TRACE)) {\n MOCK_SERVER_LOGGER.logEvent(\n new LogEntry()\n .setLogLevel(TRACE)\n .setMessageFormat(\"request rejected while closing down, logging in case due other error \" + ree)\n .setThrowable(ree)\n );\n }\n } catch (Exception e) {\n if (!ignoreFailure && MockServerLogger.isEnabled(WARN)) {\n MOCK_SERVER_LOGGER.logEvent(\n new LogEntry()\n .setLogLevel(WARN)\n .setMessageFormat(\"failed to send stop request to MockServer \" + e.getMessage())\n );\n }\n }\n if (!eventLoopGroup.isShuttingDown()) {\n eventLoopGroup.shutdownGracefully();\n }\n stopFuture.complete(clientClass.cast(this));\n }).start();\n }\n return stopFuture;\n }",
"@Override\n public void tuningPeriodic() {\n\n }",
"@Override\n\t\tpublic void endService() {\n\t\t\t\n\t\t}",
"public void clearRemoteRequestTimeout() {\n\t\tsetRemoteRequestTimeout(\"0\");\n\t}",
"protected void postStop() throws FailedToStopException { }",
"java.util.concurrent.Future<TerminateSolNetworkInstanceResult> terminateSolNetworkInstanceAsync(\n TerminateSolNetworkInstanceRequest terminateSolNetworkInstanceRequest);",
"void resetForce();",
"private NodeRestartRequest() {\n\t\t}",
"boolean hasSolverTimeLimitSeconds();",
"@Override\n\tpublic void onModServerStopping2(FMLServerStoppingEvent aEvent) {\n\t}",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tmmServerSocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}",
"TransitionRequestResult forceCancel(String namespace, String wid) throws Exception;",
"@Override\n public void Tick(long deltaInMillis) {\n long wastedDeltaInMillis = 0;\n switch (state) {\n case INACTIVE:\n if(CONFIG.CURRENT_TIME.compareTo(start) >= 0 && CONFIG.CURRENT_TIME.compareTo(start.plus(deltaInMillis, ChronoUnit.MILLIS)) < 0) {\n currRouteIndex = 0;\n SetState(VehicleState.MOVING);\n wastedDeltaInMillis = CONFIG.CURRENT_TIME.minusNanos(start.toNanoOfDay()).toNanoOfDay()/1000000;\n }\n break;\n case MOVING:\n Route currRoute = routes.get(currRouteIndex);\n\n // get current street modifier\n double streetModifier = StreetState.LOW.getModifier();\n for(int i=0; i<currRoute.getRoute().size(); i++) {\n if(Math2D.getRouteLength(currRoute, 0, i) / Math2D.getRouteLength(currRoute) > progressTowardsNextStop)\n break;\n streetModifier = currRoute.getRoute().get(i).getStreet().getStreetState().getModifier();\n }\n\n progressTowardsNextStop += deltaInMillis * streetModifier / (currRoute.getExpectedDeltaTime()*1000);\n // vehicle arrived to next stop\n if(progressTowardsNextStop >= 1) {\n wastedDeltaInMillis = (long)((progressTowardsNextStop-1)*currRoute.getExpectedDeltaTime()/streetModifier)*1000;\n SetState(VehicleState.STOPPED);\n }\n if(currRouteIndex < routes.size())\n CONFIG.controller.SetVehicle(this, getPosition(progressTowardsNextStop));\n break;\n case STOPPED:\n stopTimeInMillis += deltaInMillis;\n // after arriving at a stop, wait for passenger to get off\n if (stopTimeInMillis >= CONFIG.EXPECTED_STOP_TIME*1000) {\n wastedDeltaInMillis = stopTimeInMillis-(long)CONFIG.EXPECTED_STOP_TIME*1000;\n stopTimeInMillis = 0;\n progressTowardsNextStop = 0.0;\n currRouteIndex++;\n\n if(currRouteIndex < routes.size()) {\n // start new route\n SetState(VehicleState.MOVING);\n } else {\n // if there is no route left, delete the vehicle and wait for next day\n SetState(VehicleState.INACTIVE);\n CONFIG.controller.RemoveVehicle(this);\n }\n }\n break;\n }\n\n // when the delta is set to a high number, we might experience situations where one delta is enough to satisfy more states in a row in a single tick\n if(wastedDeltaInMillis > 0) {\n Tick(wastedDeltaInMillis);\n }\n }",
"public void stopSolving() {\n\t\tstopped = true;\n\t}",
"public void stopDtmf();",
"public void cancelAllRequests(boolean mayInterruptIfRunning, RequestHandle cnt) {\n // client.get\n\n }",
"double getSolverTimeLimitSeconds();",
"@Override\n public void run() {\n Log.d(TAG, \"resolve: Timing out\");\n if (multicastLock.isHeld()) {\n multicastLock.release();\n\n if (nsdManagerResolverAvailState != null) {\n nsdManagerResolverAvailState.signalFree();\n }\n }\n }"
] | [
"0.5814835",
"0.49538738",
"0.4921506",
"0.484321",
"0.48360515",
"0.482952",
"0.48176935",
"0.4813559",
"0.48016593",
"0.47820702",
"0.47599635",
"0.47122493",
"0.47069052",
"0.46620825",
"0.46467474",
"0.46218458",
"0.46016794",
"0.45999044",
"0.45809814",
"0.45513383",
"0.4542891",
"0.45424226",
"0.45385954",
"0.45230895",
"0.45202672",
"0.4496447",
"0.44805923",
"0.4476955",
"0.4466313",
"0.4461599",
"0.44588104",
"0.4458467",
"0.44362494",
"0.44362494",
"0.44362494",
"0.44362494",
"0.4426141",
"0.4417129",
"0.4404038",
"0.43827024",
"0.43808475",
"0.437272",
"0.4372367",
"0.43708274",
"0.43699354",
"0.43630645",
"0.4362817",
"0.43434358",
"0.4341812",
"0.43401286",
"0.43287858",
"0.43193424",
"0.42983666",
"0.4296761",
"0.42937997",
"0.42912525",
"0.4287627",
"0.42806685",
"0.42787156",
"0.42723635",
"0.4265183",
"0.42613134",
"0.42543197",
"0.42468542",
"0.42447197",
"0.4242812",
"0.42405075",
"0.42380455",
"0.42366186",
"0.42350423",
"0.42345345",
"0.42329204",
"0.42298532",
"0.4229065",
"0.42150477",
"0.42133448",
"0.4208298",
"0.4196593",
"0.41940984",
"0.41931772",
"0.41914934",
"0.41734236",
"0.41720343",
"0.41620722",
"0.4152493",
"0.41496962",
"0.4148963",
"0.41480154",
"0.41454467",
"0.41404164",
"0.41398162",
"0.41366142",
"0.41365907",
"0.41301942",
"0.4129868",
"0.41291562",
"0.4124723",
"0.41165307",
"0.41131184",
"0.4107012"
] | 0.5652294 | 1 |
The time interval (in seconds) to wait for the VNF to be taken out of service during graceful stop, before stopping the VNF. | @Schema(description = "The time interval (in seconds) to wait for the VNF to be taken out of service during graceful stop, before stopping the VNF. ")
public Integer getGracefulStopTimeout() {
return gracefulStopTimeout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@DefaultValue(\"600\")\n long getPodTerminationGracePeriodSeconds();",
"void stop(long timeout);",
"@Override\n public void interruptWait() {\n _vcVlsi.cancelWaitForUpdates();\n }",
"@Override\n\t\t\tpublic int durationToWait() {\n\t\t\t\treturn getCarType() == 2 ? 60000 : 15000;\n\t\t\t}",
"void setStopTimeout(int stopTimeout);",
"public static void longWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(15);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}",
"int getShutdownWaitTimeMs();",
"public void stopWaitTime(){\r\n\t\twaitTime.stop();\r\n\t}",
"abstract public int getServiceInterval();",
"public int getTimeoutInterval() {\n return timeoutInterval_;\n }",
"@DefaultValue(\"1800000\")\n long getPodTerminationGcTimeoutMs();",
"long getIntervalInSeconds();",
"public long getScheduleToCloseTimeoutSeconds() {\n return scheduleToCloseTimeoutSeconds;\n }",
"private void checkTimeout() {\n/* 169 */ if (this.socket != null) {\n/* */ \n/* 171 */ long i = this.keepaliveTimeoutMs;\n/* */ \n/* 173 */ if (this.listRequests.size() > 0)\n/* */ {\n/* 175 */ i = 5000L;\n/* */ }\n/* */ \n/* 178 */ long j = System.currentTimeMillis();\n/* */ \n/* 180 */ if (j > this.timeLastActivityMs + i)\n/* */ {\n/* 182 */ terminate(new InterruptedException(\"Timeout \" + i));\n/* */ }\n/* */ } \n/* */ }",
"public void stop() throws InterruptedException {\n if (server != null) {\n server.shutdown().awaitTermination(30, TimeUnit.SECONDS);\n }\n }",
"void shutdown(final Duration timeout);",
"public void stopMAS(int deadline) throws Exception;",
"public void uncStop() {\n\n new Thread(new Runnable() {\n\n @Override\n public void run() {\n int time = 7;\n if (ACTUAL_DIFICULTY == EASY)\n time = 7;\n if (ACTUAL_DIFICULTY == MEDIUM)\n time = 12;\n if (ACTUAL_DIFICULTY == HARD)\n time = 16;\n int count = 0;\n while (count < time) {\n drive_control.stopDriving();\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n\n }\n count++;\n }\n restoreValues();\n }\n }).start();\n }",
"@Override\n\tpublic void waitTimedOut() {\n\t\t\n\t\tif( busylinetimer == null )\n\t\t\treturn;\n\t\t\n\t\tbusylinetimer.stop();\n\t\tbusylinetimer = null;\n\t\t\n\t\tlog.info(\"linea ocupada por mas de 120 segundos, iniciando proceso para colgar llamada.......\");\n\t\t\n\t\tnew CellPhoneHandUpCall(modem,false);\n\t}",
"@Override\n public void stop() {\n\n service.shutdown();\n\n while (!service.isTerminated()) {\n try {\n logger.warn(\"Waiting for zabbix service to stop\");\n service.awaitTermination(500, TimeUnit.MILLISECONDS);\n } catch (InterruptedException ex) {\n logger.warn(\"Interrupted while waiting\"\n + \" for zabbix monitor to shutdown\", ex);\n service.shutdownNow();\n }\n }\n \n zabbixServers.clear();\n \n }",
"public void setNortpTimeout(int seconds);",
"double getSolverTimeLimitSeconds();",
"private void setAutoSelfDestruct() {\n \n try{\n //Sets task to shut server down \n this.timer.schedule(new TimerTask() {\n @Override\n public void run() {\n if(clientHandlers.isEmpty()){\n System.err.println(\"Closing due to inactivity\");\n System.exit(0);\n }else{\n setAutoSelfDestruct();\n }\n }\n }, (60000*3));\n }catch( IllegalStateException e){\n System.err.println(\"Timer is being reset\");\n this.timer = new Timer();\n setAutoSelfDestruct();\n }\n }",
"long getTimeout();",
"@DefaultValue(\"300\")\n int getDeleteGracePeriodSeconds();",
"@AfterEach\n public void setTimeInterval() {\n try {\n TimeUnit.SECONDS.sleep(Long.valueOf(settings.getTimeInterval()));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void setMaxInactiveInterval(int interval);",
"void willStopNodeInBackgroundAfterDelay(int seconds);",
"int getMaxInactiveInterval();",
"public static void stop(){\n printStatic(\"Stopped vehicle\");\n }",
"float getDuration() throws InterruptedException, ConnectionLostException;",
"private void updateInterval() {\n this.mNetworkUpdateInterval = Settings.System.getInt(this.mContext.getContentResolver(), \"status_bar_network_speed_interval\", 4000);\n }",
"public void onThreadWaitTimeout(SceKernelThreadInfo thread) {\n // Untrack\n if (removeWaitingThread(thread)) {\n // Return WAIT_TIMEOUT\n thread.cpuContext._v0 = ERROR_KERNEL_WAIT_TIMEOUT;\n } else {\n log.warn(\"EventFlag deleted while we were waiting for it! (timeout expired)\");\n // Return WAIT_DELETE\n thread.cpuContext._v0 = ERROR_KERNEL_WAIT_DELETE;\n }\n }",
"public int getDelayedTimeout();",
"private void waitFor(ExpectedCondition condition, Integer timeOutInSeconds) {\n timeOutInSeconds = timeOutInSeconds != null ? timeOutInSeconds : 60;\n WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);\n wait.until(condition);\n }",
"private void blockUntilShutdown() throws InterruptedException {\n if (server!=null){\n server.awaitTermination();\n }\n }",
"public int getNortpTimeout();",
"private void startTimeOut(int seconds){\n\n timeoutTimer = new CountDownTimer(seconds* 1000 + 1000, 1000) {\n\n public void onTick(long millisUntilFinished) {}\n\n public void onFinish() {\n progressDialog.cancel();\n showErrorDialog(getString(R.string.msgNoConnection));\n }\n }.start();\n }",
"public void shutdownProcess() {\n Timer shutdownTimer = new Timer();\n TimerTask shutdownTask = new TimerTask() {\n @Override\n public void run() {\n finishShutdown();\n }\n };\n if (this.offlineButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.offlineButton.setSelected(true);\n }\n this.statusLed.setSlowBlink(true);\n this.offlineButton.setDisable(true);\n this.shutdownButton.setDisable(true);\n shutdownTimer.schedule(shutdownTask, 10000l);\n }",
"void setMaxInactiveInterval(int interval);",
"public int getMaxInactiveInterval();",
"void timedOut();",
"public void setTerminationAfterToolchainTimeout(final long gracePeriod) {\r\n\t\tsynchronized (this) {\r\n\t\t\tif (mTimeoutAttached.getAndSet(true)) {\r\n\t\t\t\tthrow new ConcurrentModificationException(\r\n\t\t\t\t\t\t\"You tried to attach a timeout twice for the monitored process\" + mID);\r\n\t\t\t}\r\n\r\n\t\t\tif (gracePeriod < 0) {\r\n\t\t\t\tthrow new IllegalArgumentException(\"millis must be non-negative\");\r\n\t\t\t}\r\n\r\n\t\t\tnew Thread(new Runnable() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\timpatientWaitUntilToolchainTimeout(gracePeriod);\r\n\t\t\t\t}\r\n\t\t\t}, \"ToolchainTimeout watcher for \" + mID).start();\r\n\t\t}\r\n\t}",
"public void Stop(){\r\n\t\trunning = false;\r\n\t\thelp.print(\"Closing server, waiting for workers to complete\");\r\n\t}",
"public static int getTimeOut() {\n\t\tTIME_OUT = 10;\n\t\treturn TIME_OUT;\n\t}",
"protected int maxTimeout() { return 15*1000*1000; }",
"@Override\r\n public void run() {\n if (D) Log.w(TAG, \"Wait Progress Timeout\");\r\n // stop timer\r\n cancelProgressBar();\r\n\r\n if (mProgressBarSupperCallback != null) {\r\n mProgressBarSupperCallback.onSupperTimeout();\r\n }\r\n }",
"public DeleteInfrastructure gracePeriodSeconds(Number gracePeriodSeconds) {\n put(\"gracePeriodSeconds\", gracePeriodSeconds);\n return this;\n }",
"int getHeartbeatInterval();",
"public void awaitTermination(long timeout) throws InterruptedException {\n\t\tthis.controller.awaitTermination(timeout);\n\t}",
"public int getPollInterval();",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void webDriverTimeout(){\n try {\n Thread.sleep(TIMEOUT_SHORT);\n } catch (InterruptedException e){\n e.printStackTrace();\n }\n }",
"public synchronized void setRemovalTimeout(long removalTimeout) {\n this.removalTimeout = removalTimeout;\n }",
"default public int getAliveInterval() \t\t\t\t\t{ return 1000; }",
"public boolean stop(long timeout, TimeUnit timeUnit) {\n/* 73 */ setStopping();\n/* 74 */ boolean stopped = stop(this.future);\n/* 75 */ setStopped();\n/* 76 */ return stopped;\n/* */ }",
"public void waitForNotificationOrFail() {\n new PollingCheck(5000) {\n @Override\n protected boolean check() {\n return mContentChanged;\n }\n }.run();\n mHT.quit();\n }",
"public int getTIME_OUT() {\n\t\treturn TIME_OUT;\n\t}",
"public int explicitWait(){\n\t\tString time_out = null;\n\t\ttry {\n\t\t\ttime_out = new AutomationConfigurator().getTimeOut();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (time_out == null){\n\t\t\treturn default_timeout;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Integer.parseInt(time_out);\n\t\t}\n\t}",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void blockUntilShutdown() throws InterruptedException {\n\t\tif (server != null) {\n\t\t\tserver.awaitTermination();\n\t\t}\n\t}",
"private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}",
"public void stop() {\n executorService.shutdown();\n try {\n if (!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {\n executorService.shutdownNow();\n }\n } catch (InterruptedException e) {\n executorService.shutdownNow();\n }\n }",
"public DeleteAPIServer gracePeriodSeconds(Number gracePeriodSeconds) {\n put(\"gracePeriodSeconds\", gracePeriodSeconds);\n return this;\n }",
"public void blockUntilShutdown() throws InterruptedException {\r\n\t\tif (server != null) {\r\n\t\t\tserver.awaitTermination();\r\n\t\t}\r\n\t}",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"private void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"int getTimeout();",
"void endPeriodic() {\n\t\tupdateDashboard();\n\t}",
"public synchronized void stop()\r\n/* 78: */ {\r\n/* 79:203 */ if (!this.monitorActive) {\r\n/* 80:204 */ return;\r\n/* 81: */ }\r\n/* 82:206 */ this.monitorActive = false;\r\n/* 83:207 */ resetAccounting(milliSecondFromNano());\r\n/* 84:208 */ if (this.trafficShapingHandler != null) {\r\n/* 85:209 */ this.trafficShapingHandler.doAccounting(this);\r\n/* 86: */ }\r\n/* 87:211 */ if (this.scheduledFuture != null) {\r\n/* 88:212 */ this.scheduledFuture.cancel(true);\r\n/* 89: */ }\r\n/* 90: */ }",
"public int getTimeout();",
"public void onSupperTimeout() {\r\n }",
"@Override\n public Duration getWait() {\n return duration;\n }",
"private void stopWait(int ticket) throws CommandException, InterruptedException {\n if (DEBUG) System.err.printf(\"Train: %d\\tWaiting for track %d\\n\", this.id, ticket);\n TSimInterface.getInstance().setSpeed(this.id, 0);\n acc(ticket);\n TSimInterface.getInstance().setSpeed(this.id, speed);\n if (DEBUG) System.err.printf(\"Train: %d\\tGot track %d\\n\", this.id, ticket);\n }",
"public void stop() {\n\t\tthread.requestStop = true;\n\t\tlong start = System.currentTimeMillis()+timeout;\n\t\twhile( start > System.currentTimeMillis() && thread.running )\n\t\t\tThread.yield();\n\n\t\tdevice.stopDepth();\n\t\tdevice.stopVideo();\n\t\tdevice.close();\n\t}",
"public void decommission() {\n\t\tlogger.debug(\"Decommission signal received. Shutting down...\");\n\t\tlogger.logServiceStop(servicePID);\n\t\tkeepRunning = false;\n\t}",
"public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {\r\n return dead;\r\n }",
"public int getTimeOut() {\n return timeOut;\n }",
"public static void shortWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(5);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}",
"public void run() {\n\ttimedOut = false;\n\tlong startTime = new Date().getTime();\n\tlong delta = 0;\n\twhile (delta < interval) {\n\t try {\n\t\tThread.sleep(interval - delta);\n\t } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n\t\treturn;\n\t }\n\t delta = new Date().getTime() - startTime;\n\t}\n\ttimedOut = true;\n\ttimeoutHandler.handleTimeout();\n\treturn;\n }",
"@Override\n public void loop() {\n try {\n if ((runtime.seconds()-prevTime) >= 60) {\n prevTime = (long)runtime.seconds();\n writer.write(\"\\n\" + String.format(Locale.US, \"%f\", runtime.seconds()/60) + \",\" +\n String.format(Locale.US,\"%2.2f\", batVolt.getVoltage()) + \",\");\n robot.shooterServoDown(false);\n Thread.sleep(800);\n robot.shooterServoDown(true);\n }else if (batVolt.getVoltage() < 10 || robot.touchSensor.isPressed()) {\n if (writer != null)\n writer.close();\n robot.shooterPower(0);\n requestOpModeStop();\n }\n telemetry.addData(\"Runtime\", runtime.toString());\n telemetry.addData(\"PrevTime\", prevTime);\n } catch (IOException | InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void blockUntilShutdown() throws InterruptedException {\n if (server != null) {\n server.awaitTermination();\n }\n }",
"Integer getStartTimeout();",
"static void waitServerResponse(){\n try {\n Thread.sleep(5000);\n }catch(InterruptedException e){\n System.out.println(\"The application close due to an error.\");\n System.exit(-1);\n }\n }",
"public LWTRTPdu timeout() throws IncorrectTransitionException;",
"@Test\r\n public void test_stop() throws InterruptedException {\r\n final CountDownLatch expectedTimeoutReceivedLatch = new CountDownLatch(1);\r\n final CountDownLatch timeoutWhichShouldNeverBeReceivedLatch = new CountDownLatch(2);\r\n final IExpiryAction<Long> timeoutAction = new IExpiryAction<Long>() {\r\n @Override\r\n public void onTimeout(final Long payload) {\r\n //\r\n // count-down our latches. The first latch only requires one\r\n // invocation, the second expects two (though the second should\r\n // never be received)\r\n //\r\n expectedTimeoutReceivedLatch.countDown();\r\n timeoutWhichShouldNeverBeReceivedLatch.countDown();\r\n }\r\n };\r\n\r\n final int taskTimeout = 100;\r\n final ExpiryViceroy<Long> timeoutManager = ExpiryViceroy.start(timeoutAction, taskTimeout,\r\n TimeUnit.MILLISECONDS);\r\n\r\n //\r\n // ensure it's running - add a task which will expire\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(1));\r\n final boolean timeoutReached = expectedTimeoutReceivedLatch.await(1, TimeUnit.SECONDS);\r\n Assert.assertTrue(\"timeout reached\", timeoutReached);\r\n\r\n //\r\n // now kill the timeout manager ...\r\n //\r\n timeoutManager.stop();\r\n\r\n //\r\n // ... and submit another task.\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(2));\r\n final boolean timeoutNeverReceived = timeoutWhichShouldNeverBeReceivedLatch.await(taskTimeout + 100,\r\n TimeUnit.MILLISECONDS);\r\n Assert.assertFalse(\"a second timeout should never have been called\", timeoutNeverReceived);\r\n }",
"public interface StopDetector extends USMEvent {\n\n\t/********\n\t * Called periodically to check if the service is up.\n\t * \n\t * @return true if the service is stopped, false if it is functioning correctly.\n\t * @throws USMException in case of an error while executing the detector. An exception will not cause the service to\n\t * be considered stopped.\n\t */\n\tboolean isServiceStopped()\n\t\t\tthrows USMException;\n\n}",
"int hardTimeout();",
"public void stopping();",
"public final void downTime() {\n RxDisposableManager.getInstance().add(getTAG(), Observable.interval(0, 1, TimeUnit.SECONDS).take(61).compose(RxUtil.applyIO()).subscribe(new CouponGetActivity$downTime$sub$1(this)));\n }",
"public long getIntervalSeconds()\n {\n return __m_IntervalSeconds;\n }",
"public Integer getHealthCheckGracePeriodSeconds() {\n return this.healthCheckGracePeriodSeconds;\n }",
"void awaitNanos(final long timeout) throws InterruptedException;",
"public DeleteImage gracePeriodSeconds(Number gracePeriodSeconds) {\n put(\"gracePeriodSeconds\", gracePeriodSeconds);\n return this;\n }",
"public void suspend()\r\n {\r\n chargeStatus = STATUS_NOT_CHARGING;\r\n connectionStatus = STATUS_OFFLINE;\r\n timerStop(); //...Suspends the update timer. \r\n }",
"boolean timedOut() {\n\treturn timedOut;\n }",
"public void stop() {\n awaitStop();\n }"
] | [
"0.5918351",
"0.5707371",
"0.5695191",
"0.56679296",
"0.5608688",
"0.55780655",
"0.5538683",
"0.542748",
"0.5415506",
"0.5379132",
"0.5337933",
"0.52923465",
"0.52404696",
"0.5239658",
"0.5220363",
"0.5219263",
"0.52154064",
"0.520506",
"0.5179333",
"0.507578",
"0.5054976",
"0.5049826",
"0.50443816",
"0.5036874",
"0.50282764",
"0.50260496",
"0.5020141",
"0.50192213",
"0.5017104",
"0.50004214",
"0.499922",
"0.4994877",
"0.4993676",
"0.498785",
"0.4967797",
"0.49650073",
"0.49642324",
"0.49607292",
"0.49600986",
"0.49595237",
"0.49473977",
"0.49317572",
"0.49252957",
"0.49120525",
"0.49105972",
"0.49066636",
"0.490453",
"0.4902985",
"0.490222",
"0.489604",
"0.48924702",
"0.48916996",
"0.4888766",
"0.48865247",
"0.4882682",
"0.48820624",
"0.48811367",
"0.4878226",
"0.48775452",
"0.48689422",
"0.48689422",
"0.4867125",
"0.4859071",
"0.48461884",
"0.48459575",
"0.4843312",
"0.48348635",
"0.48348635",
"0.48348635",
"0.48348635",
"0.48231936",
"0.48199967",
"0.48115295",
"0.48068202",
"0.4804036",
"0.47992894",
"0.47956762",
"0.47930822",
"0.4786853",
"0.47863412",
"0.47858623",
"0.47671545",
"0.47641513",
"0.47608086",
"0.47589496",
"0.47555912",
"0.47553566",
"0.47509387",
"0.47498173",
"0.47486112",
"0.47449318",
"0.47439396",
"0.4736658",
"0.47294417",
"0.47254333",
"0.47250798",
"0.4722245",
"0.47221297",
"0.47171783",
"0.4717101"
] | 0.7533556 | 0 |
This type represents a list of keyvalue pairs. The order of the pairs in the list is not significant. In JSON, a set of key value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. | @Schema(description = "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159. ")
public Object getAdditionalParam() {
return additionalParam;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void set(K key, List<V> value) {\n\t\t\n\t}",
"public NamedList() {\n\t\tnvPairs = new ArrayList<Object>();\n\t}",
"java.util.List<KeyValuePair>\n getInfoList();",
"ListOfValuesType createListOfValuesType();",
"Plist()\n {\n m_dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n m_dateFormat.setTimeZone(TimeZone.getTimeZone(\"Z\"));\n m_simpleTypes = new HashMap<Class<?>, ElementType>();\n m_simpleTypes.put(Integer.class, ElementType.INTEGER);\n m_simpleTypes.put(Byte.class, ElementType.INTEGER);\n m_simpleTypes.put(Short.class, ElementType.INTEGER);\n m_simpleTypes.put(Short.class, ElementType.INTEGER);\n m_simpleTypes.put(Long.class, ElementType.INTEGER);\n m_simpleTypes.put(String.class, ElementType.STRING);\n m_simpleTypes.put(Float.class, ElementType.REAL);\n m_simpleTypes.put(Double.class, ElementType.REAL);\n m_simpleTypes.put(byte[].class, ElementType.DATA);\n m_simpleTypes.put(Boolean.class, ElementType.TRUE);\n m_simpleTypes.put(Date.class, ElementType.DATE);\n }",
"public void setValues(List<Object> values);",
"ListValue createListValue();",
"public void setT(List<String> e);",
"public List<Object> getValues();",
"void setListProperty(Object name, List<Object> list) throws JMSException;",
"@SuppressWarnings(\"unchecked\")\r\n\tstatic public TypeToken<List<AssociationFeaturePojo>> listType() { return new TypeToken<List<AssociationFeaturePojo>>(){}; }",
"public List<JsonValue> getValues() {\n\t\treturn values;\n\t}",
"Rule ListType() {\n // Push 1 ListTypeNode onto the value stack\n return Sequence(\n \"list \",\n \"<\",\n FieldType(),\n \"> \",\n Optional(CppType()),\n actions.pushListTypeNode());\n }",
"public String getType() {return \"Pair\";}",
"public ListElement(K key, V value) {\n this.key = key;\n this.value = value;\n this.next = null;\n }",
"private SimpleConfigList parseArray() {\n ConfigOrigin arrayOrigin = lineOrigin();\n List<AbstractConfigValue> values = new ArrayList<AbstractConfigValue>();\n\n consolidateValueTokens();\n\n TokenWithComments t = nextTokenIgnoringNewline();\n\n // special-case the first element\n if (t.token == Tokens.CLOSE_SQUARE) {\n return new SimpleConfigList(arrayOrigin,\n Collections.<AbstractConfigValue> emptyList());\n } else if (Tokens.isValue(t.token) || t.token == Tokens.OPEN_CURLY\n || t.token == Tokens.OPEN_SQUARE) {\n values.add(parseValue(t));\n } else {\n throw parseError(addKeyName(\"List should have ] or a first element after the open [, instead had token: \"\n + t\n + \" (if you want \"\n + t\n + \" to be part of a string value, then double-quote it)\"));\n }\n\n // now remaining elements\n while (true) {\n // just after a value\n if (checkElementSeparator()) {\n // comma (or newline equivalent) consumed\n } else {\n t = nextTokenIgnoringNewline();\n if (t.token == Tokens.CLOSE_SQUARE) {\n return new SimpleConfigList(arrayOrigin, values);\n } else {\n throw parseError(addKeyName(\"List should have ended with ] or had a comma, instead had token: \"\n + t\n + \" (if you want \"\n + t\n + \" to be part of a string value, then double-quote it)\"));\n }\n }\n\n // now just after a comma\n consolidateValueTokens();\n\n t = nextTokenIgnoringNewline();\n if (Tokens.isValue(t.token) || t.token == Tokens.OPEN_CURLY\n || t.token == Tokens.OPEN_SQUARE) {\n values.add(parseValue(t));\n } else if (flavor != ConfigSyntax.JSON && t.token == Tokens.CLOSE_SQUARE) {\n // we allow one trailing comma\n putBack(t);\n } else {\n throw parseError(addKeyName(\"List should have had new element after a comma, instead had token: \"\n + t\n + \" (if you want the comma or \"\n + t\n + \" to be part of a string value, then double-quote it)\"));\n }\n }\n }",
"public void setV(List<String> v);",
"public JCardValue(List<JsonValue> values) {\n\t\tthis.values = Collections.unmodifiableList(values);\n\t}",
"public java.util.List<KeyValuePair> getInfoList() {\n return info_;\n }",
"public void setListProperty(List<Integer> t) {\n\n\t\t}",
"public String getType() {\n\t\treturn \"Pair\";\n\t}",
"public void testTagList() throws Exception\n {\n ObjectMapper m = new ObjectMapper();\n TagList list = new TagList();\n list.add(Tag.A);\n list.add(Tag.B);\n String json = m.writeValueAsString(list);\n\n TagList result = m.readValue(json, TagList.class);\n assertEquals(2, result.size());\n assertSame(Tag.A, result.get(0));\n assertSame(Tag.B, result.get(1));\n }",
"public static JCardValue multi(List<?> values) {\n\t\tList<JsonValue> multiValues = new ArrayList<>(values.size());\n\t\tfor (Object value : values) {\n\t\t\tmultiValues.add(new JsonValue(value));\n\t\t}\n\t\treturn new JCardValue(multiValues);\n\t}",
"private static <T> TypeToken<List<T>> getListTypeToken() {\n return new TypeToken<List<T>>() {\n };\n }",
"public Dict(Obj value) {\n this.value = value;\n }",
"public Set<String> asList() {\n\t\treturn this.dictionary;\n\t}",
"ListType createListType();",
"java.util.List<java.lang.String> getValuesList();",
"public static JCardValue structured(List<List<?>> values) {\n\t\tList<JsonValue> array = new ArrayList<>(values.size());\n\n\t\tfor (List<?> list : values) {\n\t\t\tif (list.isEmpty()) {\n\t\t\t\tarray.add(new JsonValue(\"\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (list.size() == 1) {\n\t\t\t\tObject value = list.get(0);\n\t\t\t\tif (value == null) {\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t}\n\t\t\t\tarray.add(new JsonValue(value));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tList<JsonValue> subArray = new ArrayList<>(list.size());\n\t\t\tfor (Object value : list) {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t}\n\t\t\t\tsubArray.add(new JsonValue(value));\n\t\t\t}\n\t\t\tarray.add(new JsonValue(subArray));\n\t\t}\n\n\t\treturn new JCardValue(new JsonValue(array));\n\t}",
"public interface NeonArray extends NeonValue {\n /**\n * Is it a list-like array? i.e. keys are only numeric\n */\n public boolean isList();\n\n /**\n * Is it hash-map-like array? I.e. keys are not-numeric\n */\n public boolean isHashMap();\n\n /**\n * Get all item values (ignore keys)\n */\n public List<NeonValue> getValues();\n\n /**\n * Get keys as nodes\n */\n public List<NeonKey> getKeys();\n\n /**\n * Get all values as a hash-map\n */\n public HashMap<String, NeonValue> getMap();\n\n}",
"public static List<KeyValue<String, String>> getAllKeyValues() {\n return keyValueList;\n }",
"public SortedList(){\n this(\"list\");\n }",
"java.util.List<? extends KeyValuePairOrBuilder>\n getInfoOrBuilderList();",
"public List<T> values();",
"public List(){\n\t\tthis(\"list\", new DefaultComparator());\n\t}",
"public void setItems(List<T> value) {\n getElement().setItems(SerDes.mirror(value).cast());\n }",
"HCollection values();",
"public JsonWriter array() {\n startValue();\n\n stack.push(context);\n context = new JsonContext(JsonContext.Mode.LIST);\n writer.write('[');\n\n return this;\n }",
"List getValues();",
"List<WrappedKeyValue<TKey, TValue>> GetElements() throws IOException;",
"@SuppressWarnings(\"unchecked\")\n public void arrayAddValue(LinkedList<String> keyList, Object array, Object value) throws IOException {\n if (value instanceof JSONParseEngine.ByteBuffer) {\n value = value.toString();\n }\n ((ArrayList) array).add(value);\n }",
"public ListOrdered() {\n\t\tsuper(NotesEtcTypes.DATA_TYPE_LIST_ORDERED);\n\t}",
"public abstract List toNameValueList();",
"public void setUnderlyingValue(List<IGwtSerializableParameter> value)\r\n\t{\r\n\t\tthis.value = value;\r\n\t}",
"public interface ListWithKeys<T> extends List<T> {\n\t/**\n\t * What is the key field for the given index\n\t * @param index to find the key for\n\t * @return key value for that index\n\t */\n\tString getKey(int index);\n}",
"@Test\n\tpublic void createTypedList() {\n\t\tList<String> list = new ArrayList<>();\n\n\t\tlist.add(\"String\");\n\n\t\tassertEquals(list, Collections.singletonList(\"String\"));\n\t}",
"@JsonIgnore\n List<T> getValues();",
"public BlockKeyValueExpression(List<KeyValuePair> keyValuePair) {\n\t\tthis.keyValuePair = Collections.unmodifiableList(keyValuePair);\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"Creating \" + this.getClass().getSimpleName()\n\t\t\t\t\t+ \" with values : \" + toString());\n\t\t}\n\t}",
"public void addStringListValue(int type, String value);",
"void writeEntry(String key, List<String> value, boolean mandatory) throws IOException;",
"@SuppressWarnings(\"unchecked\")\n public void objectAddValue(LinkedList<String> keyList, Object obj, String str, Object value) throws IOException {\n if (value instanceof JSONParseEngine.ByteBuffer) {\n value = value.toString();\n }\n ((HashMap) obj).put(str, value);\n }",
"public List<String> put(String key, List<String> value)\r\n/* 401: */ {\r\n/* 402:568 */ return (List)this.headers.put(key, value);\r\n/* 403: */ }",
"@Override\n List<Value> values();",
"public List()\n\t{\n\t\tthis(null, null);\n\t}",
"@JsonProperty(\"Records\") abstract List<?> getRecords();",
"private static Type getListType() {\n return getListTypeToken().getType();\n }",
"@Override\n\t\tpublic abstract List<T> parse(Object valueToParse, Type elementType);",
"public JCardValue(JsonValue... values) {\n\t\tthis.values = Arrays.asList(values); //unmodifiable\n\t}",
"List<Pair<String, Value>> fields();",
"public List<KeyValuePair<Key, Value>> getData() {\r\n\t\t\tdata.reset();\r\n\t\t\treturn data;\r\n\t\t}",
"PropertyValue<?, ?>[] values();",
"public Pair(Key key, Value value) {\n this.key = key;\n this.value = value;\n }",
"public Pair(K key, V value){\n this.key = key;\n this.value = value;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn \"{\" + Strings.join(\",\", keyValuePair) + \"}\";\n\t}",
"tensorflow.serving.internal.SerializedInputOuterClass.SerializedExampleListOrBuilder getExampleListOrBuilder();",
"public interface Pair<K,V> {\n public K getKey();\n public V getValue();\n}",
"public Iterator<JacksonJrValue> elements() {\n return _values.iterator();\n }",
"interface List extends Follow {\n /**\n * The list of available bookmarks.\n *\n * @author Oved Ourfali <oourfali@redhat.com>\n * @date 12 Dec 2016\n * @status added\n */\n @Out Bookmark[] bookmarks();\n\n /**\n * Sets the maximum number of bookmarks to return. If not specified all the bookmarks are returned.\n */\n @In Integer max();\n }",
"public void setParamList(List<Object[]> paramList) {\n this.paramList = paramList;\n }",
"@Test\n public void testListOfStrings() {\n JsonableTestClassWithList jtc = Jsonable.loadFromFile(\"testFiles/listTest.json\", JsonableTestClassWithList.class);\n assertEquals(4, jtc.stringArray.size());\n String jsonString = jtc.toJSON().toString();\n assertThat(jsonString, Matchers.containsString(\"\\\"abc\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"def\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"123\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"456\\\"\"));\n }",
"public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }",
"public interface ValueSet {\n boolean isEmpty();\n int size();\n boolean contains(Object v);\n void add(Object v);\n void add(ValueSet s);\n Iterator<Object> iterator();\n}",
"com.google.protobuf.ProtocolStringList\n getListList();",
"Collection<V> values();",
"Collection<V> values();",
"private boolean isWrappedListOfValues(FieldAccessor fieldAccessor) {\n\t\treturn false;\n\t}",
"public ArrayJList() {\n this(DEFAULT_CAPACITY);\n }",
"@Test\n public void testGetListWithDelimiter() throws ConfigurationException {\n final DatabaseConfiguration config = setUpConfig();\n config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));\n final List<Object> values = config.getList(\"keyMulti\");\n assertEquals(Arrays.asList(\"a\", \"b\", \"c\"), values);\n }",
"interface List extends Follow {\n @Out Network[] networks();\n\n /**\n * Sets the maximum number of networks to return. If not specified all the networks are returned.\n */\n @In Integer max();\n\n /**\n * A query string used to restrict the returned networks.\n */\n @In String search();\n\n /**\n * Indicates if the search performed using the `search` parameter should be performed taking case into\n * account. The default value is `true`, which means that case is taken into account. If you want to search\n * ignoring case set it to `false`.\n */\n @In Boolean caseSensitive();\n }",
"public boolean isList();",
"public boolean isList();",
"Map<String, List<String>> getFormDataMultivalue();",
"public final List<Object> getResponseValues()\n\t{\n\t\treturn m_responseValues;\n\t}",
"public List<Response> getObjectList(String key) {\n Object value = get(key);\n List<Response> responseList;\n if ((value instanceof List) && !((List)value).isEmpty() && (((List)value).get(0) instanceof JSONObject)) {\n responseList = new ArrayList<>(((List)value).size());\n ((List)value).forEach(obj -> responseList.add(new Response((JSONObject<String, Object>)obj)));\n } else {\n responseList = emptyObjectList;\n }\n return responseList;\n }",
"public ListState(DartObjectImpl[] elements) {\n this.elements = elements;\n }",
"public Collection<List<String>> values()\r\n/* 426: */ {\r\n/* 427:588 */ return this.headers.values();\r\n/* 428: */ }",
"public static <T> List<Map<String, T>> jsonToQt(String str, Class<T> elementType) {\n\t\tif(gson == null) {\n\t\t\tgson = new Gson();\n\t\t}\n\t\t//nei - wai\n\t\tType typeMap = new MyParamType(Map.class, new Class[]{String.class, elementType});\n\t\t\n\t\tType typeList = new MyParamType(List.class, new Type[]{typeMap});\n\t\t\n\t\treturn gson.fromJson(str, typeList);\n\t}",
"public static String toJSONContainingAnything(List<Object> list) {\n StringBuilder sb = new StringBuilder();\n\n sb.append(\"[\");\n for (Iterator<Object> it = list.iterator(); it.hasNext();) {\n sb.append(\"\\n\");\n Object value = it.next();\n\n appendObject(sb, value);\n if (it.hasNext()) {\n sb.append(\",\\n\");\n }\n }\n sb.append(\"]\\n\");\n return sb.toString();\n }",
"public List<String> getValue() {\r\n return value;\r\n }",
"public ValueMap(final String keyValuePairs)\n\t{\n\t\tthis(keyValuePairs, \",\");\n\t}",
"@Override\n\t\t\tpublic void process(String key, int status, List<JSONObject> lst) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void process(String key, int status, List<JSONObject> lst) {\n\n\t\t\t}",
"public abstract void setList(List<T> items);",
"java.util.List<java.lang.String>\n getStrValuesList();",
"public String getJSONfromNamedList(NamedList<?> namedList) {\n\t\tString json = null;\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\n\t\ttry {\n\t\t\tjson = mapper.writeValueAsString(namedList);\n\t\t} catch (JsonProcessingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn json;\n\t}",
"public Builder setExampleList(tensorflow.serving.internal.SerializedInputOuterClass.SerializedExampleList value) {\n if (exampleListBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n kind_ = value;\n onChanged();\n } else {\n exampleListBuilder_.setMessage(value);\n }\n kindCase_ = 1;\n return this;\n }",
"DictionaryPair (K someKey , V someValue) {\n this.key = someKey;\n this.value = someValue;\n }",
"@Override\r\n\tpublic List<KVPair<String, String>> getKVList(List<SubstageDocument> list) {\n\t\treturn null;\r\n\t}",
"public static HashMap<String, ArrayList<String>> parseKeyValueList(String keySpliter,String valueSpliter, String strToParse) {\r\n\t\treturn parseKeyValueList (keySpliter, valueSpliter, \"\\n\", strToParse);\r\n\t}",
"public List()\n {\n list = new Object [10];\n }"
] | [
"0.57549375",
"0.55896884",
"0.55444425",
"0.5534626",
"0.52588314",
"0.5229013",
"0.5168034",
"0.5061518",
"0.5044687",
"0.5033677",
"0.5032322",
"0.5025174",
"0.50138247",
"0.49975932",
"0.49871874",
"0.4977404",
"0.49485594",
"0.49218825",
"0.4916852",
"0.49099118",
"0.4896476",
"0.48887938",
"0.4867686",
"0.48632935",
"0.4855221",
"0.48371336",
"0.4835222",
"0.48302695",
"0.4819462",
"0.481893",
"0.48097077",
"0.47995764",
"0.47993988",
"0.47944406",
"0.47738603",
"0.47701627",
"0.47354275",
"0.47219303",
"0.47201678",
"0.47139224",
"0.4712065",
"0.4699229",
"0.46834695",
"0.4681863",
"0.46695352",
"0.46658388",
"0.46609572",
"0.4659699",
"0.46584105",
"0.46488297",
"0.464873",
"0.46475703",
"0.4645945",
"0.46369788",
"0.46298933",
"0.4628514",
"0.46210554",
"0.46198034",
"0.4614762",
"0.46018812",
"0.45982552",
"0.45848307",
"0.45844582",
"0.45760468",
"0.4569396",
"0.45690188",
"0.45653677",
"0.45561895",
"0.45442218",
"0.45436078",
"0.45393112",
"0.45310184",
"0.45276198",
"0.45246506",
"0.45246506",
"0.45231697",
"0.45209008",
"0.45179793",
"0.45110518",
"0.45092",
"0.45092",
"0.45023492",
"0.4488466",
"0.44842616",
"0.44768983",
"0.44735965",
"0.4472838",
"0.4469129",
"0.44570413",
"0.44561",
"0.44551235",
"0.44551235",
"0.44546267",
"0.4454359",
"0.44509575",
"0.4444964",
"0.44437608",
"0.44381088",
"0.44334695",
"0.44325203"
] | 0.5556173 | 2 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }",
"private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }",
"private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }"
] | [
"0.78847593",
"0.75493765",
"0.74971926",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168"
] | 0.0 | -1 |
Also provide similar transitions for pressing the back button | @Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\toverridePendingTransition(R.anim.in_from__left, R.anim.out_to_right);\n\t}",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(R.anim.trans_left_in, R.anim.trans_left_out);\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(R.anim.enter_from_left, R.anim.exit_to_right);\n }",
"@Override\n public void onBackPressed() {\n finish();\n overridePendingTransition(R.anim.slide_in_from_top, R.anim.slide_out_from_top);\n super.onBackPressed();\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(R.anim.move_left_in_activity, R.anim.move_right_out_activity);\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n\n overridePendingTransition(R.anim.slide_right_exit, R.anim.slide_left_exit);\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(R.anim.activity_lefttoright, R.anim.activity_righttoleft);\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\toverridePendingTransition(R.anim.open_scale, R.anim.close_translate);\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\toverridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);\n\t}",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(0, R.anim.base_slide_right_out);\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t\toverridePendingTransition(R.anim.activity_slide_left_in,\n\t\t\t\tR.anim.activity_slide_right_out);\n\t}",
"void onGoBackButtonClick();",
"private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }",
"@Override\r\n public void onBackPressed(){\r\n if(mLoadingScreen.getVisibility() == View.VISIBLE) return;\r\n super.onBackPressed();\r\n overridePendingTransition(R.anim.slide_stay, R.anim.slide_out_right);\r\n mBackPressed.invoke(null);\r\n }",
"@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}",
"void actionBack();",
"protected void navigateBack() {\n getActivity().finish();\n ActivityTransition transition = ActivityTransition.BACK;\n getActivity().overridePendingTransition(transition.getEnter(), transition.getExit());\n }",
"@Override\n public void backButton() {\n\n\n }",
"@Override\n\tpublic void backButton() {\n\n\t}",
"@Override\n public void onBackPressed() {\n\n Intent homeIntent = new Intent(CustomersActivity.this, MainActivity.class);\n startActivity(homeIntent);\n\n overridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n\n finish();\n\n return;\n }",
"public void onBackPressed() {\n backbutton();\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n Write_data();\n overridePendingTransition(R.anim.open_main, R.anim.close_next);\n }",
"boolean onBackPressed();",
"boolean onBackPressed();",
"@Override\n\tpublic void onBackPressed() {\n\t\tString log_msg = \"Back pressed...\";\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\tthis.finish();\n\t\t\n\t\tthis.overridePendingTransition(0, 0);\n\t\t\n\t}",
"@Override\n public void onBackPressed() {\n exitReveal();\n\n super.onBackPressed();\n }",
"public void goBack() {\n goBackBtn();\n }",
"public abstract boolean onBackPressed();",
"@Override\n\tpublic void onBackPressed()\n\t\t{\n\t\tbackPressed();\n\t\t}",
"@Override\n public void onBackPressed(){\n super.onBackPressed();\n overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);\n Intent i = new Intent(this,MainActivity.class);\n AddContacts.this.finish();\n startActivity(i);\n\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tBack();\n\t}",
"protected void handleBack(ActionEvent event) {\n\t}",
"public void backButtonClicked()\r\n {\n manager = sond.getManager();\r\n AnimatorThread animThread = model.getThread();\r\n\r\n if (button.getPlay() && animThread != null && animThread.isAlive())\r\n {\r\n if (!animThread.getWait())\r\n {\r\n animThread.interrupt();\r\n }\r\n else\r\n {\r\n animThread.wake();\r\n }\r\n }\r\n else if (manager.canUndo())\r\n {\r\n manager.undo();\r\n }\r\n }",
"public void back() {\n Views.goBack();\n }",
"private void backButtonAction() {\n CurrentUI.changeScene(SceneNames.LOGIN);\n }",
"@Override\n public void onBackPressed() {\n closeKeyboard(this);\n setResult(Activity.RESULT_CANCELED);\n finish();\n// overridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n }",
"@Override\n public void backPressed(){\n }",
"@FXML\n public void backButtonClicked(MouseEvent event) {\n toggleBackBtnVisibility(false);\n setMainScene(previousView, null);\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\t\n\t}",
"public void actionPerformedBack(ActionListener back) {\n btnBack.addActionListener(back);\n }",
"@FXML\r\n\t\tpublic void back(ActionEvent event) {\r\n\t\t\tGuiBasedApp.launchHomeScreenScene();\r\n\t\t}",
"@Override\n public void onBackPressed()\n {\n mIsBackButtonPressed = true;\n super.onBackPressed();\n \n }",
"@Override\r\n\tpublic void onBackPressed()\r\n\t{\r\n\t\tif (flipper.getDisplayedChild() != 0)\r\n\t\t{\r\n\t\t\tflipper.showPrevious();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuper.onBackPressed();\r\n\t\t}\r\n\t}",
"public void onBackPressed() {\r\n }",
"@FXML\n void goBack(ActionEvent event) {\n \tWindowManager.goBack();\n }",
"public void onBackPressed() {\n Intent intent=new Intent(SignUpActivity.this,HomeActivity.class);\n startActivity(intent);\n overridePendingTransition(0,0);\n finish();\n }",
"private void setupBack() {\n\t\tmakeButton(\"Back\", (ActionEvent e) -> {\n\t\t\tchangeView(\"login\");\n\t\t});\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tbackButtonHandler();\r\n\t\treturn;\r\n\t}",
"@Override\n \tpublic void onBackPressed() {\n \t}",
"@Override\n public void goBack() {\n\n }",
"@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event)\n\t{\n\t\tif(keyCode==KeyEvent.KEYCODE_BACK){\n\t\t\tonBackPressed();\n\t\t\toverridePendingTransition(0,0);\n\t\t}\n\t\treturn super.onKeyDown(keyCode, event);\n\t}",
"private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {\n backButtonFunction();\n }",
"@Override\n public void onBackPressed() {}",
"void onDismissByBackPressed();",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n Intent intent=new Intent();\n // intent.putExtra(\"image\",path.substring(path.indexOf(\"/\")+1));\n setResult(Activity.RESULT_CANCELED,intent);\n finish();\n\n // overridePendingTransition(R.anim.slide_out, R.anim.slide_in);\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tInputMethodManager imm0 = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\r\n\t\timm0.hideSoftInputFromWindow(ivBack.getWindowToken(), 0);\r\n\t\tsuper.onBackPressed();\r\n\r\n//\t\tActivityManagerUtil.getActivityManager().finishActivity(this);\r\n//\t\tthis.overridePendingTransition(R.anim.back_left_into,\r\n//\t\t\t\tR.anim.back_right_out);\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\n\t\tsuper.onBackPressed();\n\t\tmArrayListData.clear();\n\t\toverridePendingTransition(R.anim.pull_in_right, R.anim.push_out_left);\n\t}",
"public void BackBtn(MouseEvent event) {\n\t}",
"@Override\n public void onBackPressed() {\n backToHome();\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tdoBack();\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"@Override\n // Detect when the back button is pressed\n public void onBackPressed() {\n\n // Let the system handle the back button\n\n super.onBackPressed();\n\n }",
"public void backButtonPressed(View view) {\n onBackPressed();\n }",
"void onUpOrBackClick();",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\r\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() { }",
"@Override\n\tpublic void onBackPressed()\n\t{\n\t}",
"public void onBackPressed()\n {\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\n\t\t\n\t}",
"public abstract boolean onBackPressed(boolean isSystemBackKey);",
"public void back()\r\n\t{\r\n\t\tparentPanel.setState(GameState.Menu);\r\n parentPanel.initScene(GameState.Menu);\r\n\t\t\t\r\n\t}",
"private void navBack() {\n Intent intent = new Intent(this, standard_home.class);\n startActivity(intent);\n }",
"public void backButtonClicked(ActionEvent actionEvent) {\n Stage current = (Stage) locationName.getScene().getWindow();\n\n current.setScene(getPreviousScreen());\n }",
"public void back() {\n\t\tstate.back();\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tgame.getController().undoLastMove();\r\n\t}",
"public static void onBackPressed()\n {\n }",
"@Override\n public void onBackPressed() {\n runExitAnimation(new Runnable() {\n public void run() {\n // *Now* go ahead and exit the activity\n finish();\n }\n });\n }",
"@Override\r\n\tpublic void onBackPressed() {\r\n\t\tif (isMapDisplayed) {\r\n\t\t\tisMapDisplayed=false;\r\n\t\t\tswitcher.showPrevious();\r\n\t\t} else super.onBackPressed();\r\n\t}",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }",
"@Override\n public void onBackPressed() {\n }"
] | [
"0.77672845",
"0.7763808",
"0.7749432",
"0.7719786",
"0.7654188",
"0.7636145",
"0.7628976",
"0.75887096",
"0.7583631",
"0.74626404",
"0.73924726",
"0.737849",
"0.73631054",
"0.72552204",
"0.7245703",
"0.71802086",
"0.7123617",
"0.7119843",
"0.71183383",
"0.7091122",
"0.707399",
"0.70724094",
"0.70198506",
"0.70198506",
"0.7000361",
"0.699625",
"0.6973663",
"0.6970235",
"0.69683444",
"0.69531924",
"0.6903881",
"0.69031775",
"0.68999606",
"0.68958837",
"0.6875824",
"0.6874047",
"0.68686986",
"0.68341017",
"0.68072253",
"0.6806572",
"0.68023455",
"0.67980766",
"0.6787254",
"0.67797875",
"0.6774402",
"0.6754837",
"0.67454934",
"0.6733963",
"0.6728825",
"0.6725291",
"0.67213297",
"0.6719451",
"0.67171794",
"0.67138565",
"0.6712379",
"0.67042947",
"0.6698808",
"0.66918314",
"0.66882485",
"0.66717315",
"0.666981",
"0.66697633",
"0.66697633",
"0.6665328",
"0.6660059",
"0.6653959",
"0.66325235",
"0.66325235",
"0.66325235",
"0.66325235",
"0.66205263",
"0.66177076",
"0.660749",
"0.66054106",
"0.6598427",
"0.659643",
"0.6594311",
"0.6593351",
"0.658457",
"0.6584138",
"0.6569887",
"0.6569887",
"0.6564256",
"0.6562935",
"0.65573883",
"0.6550603",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476",
"0.6547476"
] | 0.7810245 | 0 |
Done, switch views and get ready to save on DB | public void switchActivity_Stockrecord(View view) {
Intent intent = new Intent(this, StockrecordActivity.class);
// Package a bundle of an array to stockrecord activity
Bundle bundle =new Bundle();
String[] finished_foodNameArray = foodNameList.toArray(new String[foodNameList.size()]);
String[] finished_foodlocationArray = foodlocationList.toArray(new String[foodlocationList.size()]);
bundle.putStringArray("foodname array", finished_foodNameArray);
bundle.putStringArray("foodlocation array", finished_foodlocationArray);
intent.putExtras(bundle);
finish();
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveTask (View view) {\n \t\n \tTask task = gatherTaskInfo();\n \t//calls to crowd sourcer only if a task is returned\n \tif(task != null) {\n \t\tnew saveTask().execute(task);\t\t\n \t} \t\n }",
"@Override\n protected void commitView(ViewImpl view)\n {\n boolean oldValue = view.setAllowHiddenEntities( true );\n\n ObjectInstance oi = view.getObjectInstance();\n\n // TODO: implement optimistic locking check.\n\n EntityInstanceImpl lastEntityInstance = oi.getLastEntityInstance();\n\n commitExcludes( view, oi, lastEntityInstance );\n commitDeletes( view, oi, lastEntityInstance );\n commitIncludes( view, oi );\n commitUpdates( view, oi );\n\n view.setAllowHiddenEntities( oldValue );\n }",
"public void triggerSave(View view) {\n toggleSave();\n }",
"private void updateViews() {\n\t\tList<Task> list = null;\n\t\tDBHelper db = new DBHelper();\n\t\ttry {\n\t\t\tlist = db.getTaskList(this, Task.COLUMN_ID, taskID);\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(\"Could not get Single Task\", \"Bam\", e);\n\t\t}\n\n\t\ttask = list.get(0);\n\n\t\tint prioPos = 0;\n\n\t\tfor (int i = 0; i < prioList.size(); i++) {\n\n\t\t\tif (prioList.get(i).getId() == task.getPriority().getId()) {\n\t\t\t\tprioPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tprioSpinner.setSelection(prioPos);\n\n\t\tint catPos = 0;\n\n\t\tfor (int i = 0; i < categoryList.size(); i++) {\n\n\t\t\tif (categoryList.get(i).getId() == task.getCategory().getId()) {\n\t\t\t\tcatPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tcategorySpinner.setSelection(catPos);\n\n\t\ttitle.setText(task.getTitle());\n\t\tdescription.setText(task.getDescription());\n\t\tdatePicker.updateDate(task.getAblaufJahr(), task.getAblaufMonat(),\n\t\t\t\ttask.getAblaufTag());\n\t}",
"public void emitChangeView() {\n \n int view = getCurrentViewNumber();\n Object lpid = getLocalServerID();\n \n JDSUtility.debug(\"[emitChangeView()] s\" + lpid + \", at time \" + getClockValue() + \", is going to emit a change view message for (v + 1 = \" + (view + 1) + \")\");\n\n /* the replica makes sure that no timer is currently working. If the view change was trigged by a suspect of failure of the primary then probably it's \n been already true. */\n revokeSendBatch();\n revokeViewChange();\n\n /* an exponetial timeout has to be considered to guarantee liveness when the end-to-end delay is too long (it's prevent uncessary view-changes)*/\n PBFTTimeoutDetector ttask = (PBFTTimeoutDetector) getViewTimer().getTask();\n long timeout = (Long) ttask.get(\"TIMEOUT\");\n ttask.put(\"TIMEOUT\", 2 * timeout);\n\n /* the replica moves to the next view. After that, this replica isn't accepting any message from view v < v+1. */\n setCurrentViewNumber(view +1);\n \n /* clean-up the sets P (prepare set) and Q (pre-prepare set)*/\n preprepareset.clear();\n prepareset.clear();\n\n long lcwm = getLCWM();\n long hcwm = getHCWM();\n\n /* compute Q (pre-prepare set) and P (prepare set) */\n for(long seqn = lcwm + 1; seqn <=hcwm; seqn++){\n /*If I have a prepare then its digests will be added to pre-prepared and prepared sets */\n PBFTPrepare pr = getPrepareInfo().get(lpid, seqn);\n if(pr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, pr.getSequenceNumber(), null);\n pp.getDigests().addAll(pr.getDigests());\n preprepareset.add(pp);\n \n prepareset.add(new PBFTPrepare(pp, null));\n\n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n\n continue;\n }\n\n /*If I have a pre-prepare then its digests will be added to pre-prepared set*/\n PBFTPrePrepare ppr = getPrePrepareInfo().get(seqn);\n if(ppr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, ppr.getSequenceNumber(), null);\n pp.getDigests().addAll(ppr.getDigests());\n preprepareset.add(pp);\n \n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n } \n }\n\n \n try{\n doRollback();\n }catch(Exception e){\n e.printStackTrace();\n }\n\n /* update the controls for sequence number execution */\n getStateLog().setNextPrePrepareSEQ(lcwm + 1);\n getStateLog().setNextExecuteSEQ (lcwm + 1);\n\n PBFTChangeView cv = createChangeViewMessage();\n \n try {\n /* gets the root of the checkpoint partition tree */\n PartEntry centry = rStateManager.getPart(0, 0);\n\n /* adds the pair (last stable sequence number and state digest) to compose checkpoint set C */\n if(centry != null){\n cv.addCheckpoint(centry.getPartCheckpoint(), centry.getDigest());\n }else{\n cv.addCheckpoint(lcwm, \"\");\n }\n } catch (Exception ex) {\n Logger.getLogger(PBFTServer.class.getName()).log(Level.SEVERE, null, ex);\n cv.getCheckpointSet().clear();\n cv.addCheckpoint(lcwm, \"\");\n }\n\n /* add the pre-prepare set to current change-view message*/\n cv.getPrePrepareSet().clear();\n cv.getPrePrepareSet().addAll(preprepareset);\n\n /* add the prepare set to current change-view message*/\n cv.getPrepareSet().clear();\n cv.getPrepareSet().addAll(prepareset);\n\n /*emit the change view message to group of replicas */\n emit(cv, getLocalGroup().minus(getLocalProcess()));\n\n getChangeViewInfo().setMinimumViewNumber(view);\n getChangeViewInfo().put(cv);\n\n if(isPrimary()){\n getNewViewConstructor().addChangeView(cv);\n }else{\n finalizeNewViewConstructor();\n }\n\n getChangeViewInfo().gc(view);\n getChangeViewACKInfo().gc(view);\n getNewViewConstructor().gc(view);\n getNewViewInfo().gc(view);\n getPrePrepareInfo().gc(view);\n getPrepareInfo().gc(view);\n getPrePreparebackupInfo().gc(view);\n getCommitInfo().gc(view);\n\n\n emitChangeViewACK();\n\n\n uncertanty = true; \n }",
"@Override\n public void updateView() throws Exception{\n Connection conn = null;\n PreparedStatement pr = null;\n ResultSet rs = null;\n try {\n String query = \"Update [view] set viewed = viewed + 1\";\n conn = getConnection();\n pr = conn.prepareStatement(query);\n pr.executeUpdate();\n } catch (Exception ex) {\n throw ex;\n } finally {\n closeResultSet(rs);\n closePreparedStatement(pr);\n closeConnection(conn);\n }\n }",
"@Override\n public void onClick(View view) {\n saveBlocks();\n XmlDataManager.changeProject(model);\n\n Intent i = new Intent(DetailViewActivityEdit.this, MainActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n startActivity(i);\n finish();\n }",
"public void commitChanges(){\n\t\tskipRulesView.updateSkipRule();\n\t\tvalidationRulesView.updateValidationRule();\n\t\tdynamicListsView.updateDynamicLists();\n\t}",
"public void save(View view) {\n }",
"@Override\n public void run() {\n mSaveOnDetach = false;\n\n if (mModification == Utils.MODIFY_UNINITIALIZED) {\n mModification = Utils.MODIFY_ALL;\n }\n boolean isInsert = mEvent.eventType.equals(Intent.ACTION_INSERT);\n if ((mCode & Utils.DONE_SAVE) != 0\n && mModel != null\n && ((mOriginalModel != null && !isInsert)\n || (mOriginalModel == null && isInsert))\n && mView.prepareForSave()) {\n\n int validity = mModel.getValidity();\n if (validity != 0) {\n mView.setValidity(validity);\n return;\n }\n\n if (mHelper.savePlanet(mModel, mOriginalModel)) {\n mView.setViewStates(Utils.MODIFY_UNINITIALIZED);\n mIsEditable = false;\n return;\n }\n }\n\n if ((mCode & Utils.DONE_DELETE) != 0 && mOriginalModel != null) {\n DeletePlanetHelper deleteHelper = new DeletePlanetHelper(mActivity);\n deleteHelper.registerDeleteNotifyListener(deleteNotifyListener);\n deleteHelper.delete(mOriginalModel);\n return;\n }\n\n if ((mCode & Utils.DONE_EXIT) != 0) {\n // This will exit the edit planet screen, should be called\n // when we want to return to the main planet view\n Activity a = EditPlanetFragment.this.getActivity();\n if (a != null) {\n Intent returnIntent = new Intent();\n a.setResult(Activity.RESULT_OK, returnIntent);\n a.finish();\n }\n }\n\n // Hide a software keyboard so that user won't see it even after this Fragment's\n // disappearing.\n/* final View focusedView = mActivity.getCurrentFocus();\n if (focusedView != null) {\n mInputMethodManager.hideSoftInputFromWindow(focusedView.getWindowToken(), 0);\n focusedView.clearFocus();\n }*/\n }",
"public void updateViews() {\n updateViews(null);\n }",
"void save(ViewDefinition viewDefinition);",
"public void afterInit() {\n dbw.execSQL(\"delete from visitTable\");\n for (VisitData tmp : dbData) {\n String dataStr = tmp.getAddSQLString();\n Log.e(\"test : \", String.valueOf(tmp.getId()) + \",,,,\" + dataStr);\n String insertStr = \"insert into visitTable values ( \" + dataStr + \")\";\n Log.e(\"test : \", \"insert successfully\");\n dbw.execSQL(insertStr);\n }\n\n //change model at here.\n// showVisitOverviewFragment();\n getApprovalInfo();\n }",
"@Transactional(readOnly = true)\n\tpublic void refresh() {\n\t\tswitch (actualView) {\n\t\tcase LIST:\n\t\t\trefreshList();\n\t\t\tbreak;\n\t\tcase EDIT:\n\t\t\t// refreshForm(); // TODO\n\t\t\tbreak;\n\t\t}\n\t}",
"public boolean createOrReplaceView(Dataset<Row> resultset) {\n\t\tString[] saveas = param(\"saveas\").split(\"::\");\n\t\tif (saveas.length == 1) {\n\t\t\tresultset.createOrReplaceTempView(saveas[0]);\n\t\t} else if (saveas.length == 2) {\n\t\t\tif (saveas[0].trim().equalsIgnoreCase(\"global\")) {\n\t\t\t\tresultset.createOrReplaceGlobalTempView(saveas[1].trim());\n\t\t\t} else if (saveas[0].trim().equalsIgnoreCase(\"temp\")) {\n\t\t\t\tresultset.createOrReplaceTempView(saveas[1].trim());\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\tLOG().info(\"created/replaced view [\" + param(\"saveas\") + \"]\");\n\t\treturn true;\n\t}",
"private void setUpViews() {\n\n updateFooterCarInfo();\n updateFooterUsrInfo();\n\n\n setResultActionListener(new ResultActionListener() {\n @Override\n public void onResultAction(AppService.ActionType actionType) {\n if (ModelManager.getInstance().getGlobalInfo() != null) {\n GlobalInfo globalInfo = ModelManager.getInstance().getGlobalInfo();\n\n switch (actionType) {\n case CarInfo:\n updateFooterCarInfo();\n break;\n case UsrInfo:\n updateFooterUsrInfo();\n break;\n case Charger:\n updateChargeStationList();\n break;\n }\n }\n }\n });\n }",
"@Override\n protected void done() {\n model.displayErrorMsg(view);\n\n var tableauItems = new ArrayList<TableData>();\n\n try {\n programs = get();\n\n LocalDateTime ldt = LocalDateTime.now();\n String status = \"\";\n\n for (Program p : programs) {\n\n var id = p.getId();\n var title = p.getTitle();\n var startTime = p.getStartTime();\n var formatTime1 = timeFormatter(startTime);\n var endTime = p.getEndTime();\n var formatTime2 = timeFormatter(endTime);\n\n if (startTime.isBefore(ldt) && endTime.isAfter(ldt)) {\n\n status = \"Running\";\n }\n if (endTime.isBefore(ldt)) {\n\n status = \"Finished\";\n }\n if (startTime.isAfter(ldt)) {\n\n status = \"Upcoming\";\n }\n\n tableauItems.add(new TableData(id, title, formatTime1,\n formatTime2, status));\n\n }\n view.updateTable(tableauItems);\n view.setChannelImage(model.getChannelImg());\n\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n\n lastUpdate(LocalDateTime.now());\n view.setLastUpdated(lastUpdated);\n isUpdating.set(false);\n\n }",
"private void connectToNewViews() {\n try {\n\n if (currentSocketTask.isDone()) {\n addNewView(currentSocketTask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n\n try {\n if (currentRMITask.isDone()) {\n addNewView(currentRMITask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }",
"private void setViewStateBasedOnModel() {\n\n\t\t//Log.e(TAG, \"order = \" + order);\n\t\tif (order != null && dossierAftersalesResponse != null) {\n\n\t\t\tList<TravelSegment> travelSegments = dossierAftersalesResponse.getReservationForCurrentTravelSegment(travelSegment);\n\t\t\tif (travelSegments.size() == 0) {\n\t\t\t\ttravelSegments.add(travelSegment);\n\t\t\t}\n\t\t\tif (travelSegments != null) {\n\t\t\t\tseatingInfoList.removeAllViews();\n\t\t\t\tticketsDetailSeatlocationAdapter = new TicketsDetailSeatlocationAdapter(\n\t\t\t\t\t\tthis.getApplicationContext(),\n\t\t\t\t\t\tR.layout.tickets_detail_seatlocation_adapter,\n\t\t\t\t\t\ttravelSegments, dossierAftersalesResponse, assistantService, order);\n\t\t\t\tseatingInfoList.setAdapter(ticketsDetailSeatlocationAdapter);\n\t\t\t}\n\t\t\t// Log.e(TAG, \"title = \"+title);\n\t\t\t// Log.e(TAG,\n\t\t\t// \"myState.dossierAftersalesResponse.getDnrId() = \"+myState.dossierAftersalesResponse.getDnrId());\n\t\t\ttitle.setText(getString(R.string.ticket_detail_title) + \" \" + dossierAftersalesResponse.getDnrId());\n\t\t\tsetDataForBooingDetails();\n\t\t\tsetDataForStationInfo();\n\t\t\tsetDataForDeliveryMethod();\n\t\t\tList<String> barcodes = dossierAftersalesResponse.getBarcodeOfCurrentTravelSegment(travelSegment);\n\t\t\tif (barcodes != null && barcodes.size() > 0) {\n\t\t\t\tqrCodeButton.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\tqrCodeButton.setVisibility(View.GONE);\n\t\t\t}\n\t\t\t// Log.d(TAG,\n\t\t\t// \"myState.dossierAftersalesResponse.getPdfUrl()::::::::::\" +\n\t\t\t// myState.dossierAftersalesResponse.getPdfUrl());\n\t\t\tif (dossierAftersalesResponse.getHomePrintTickets() != null) {\n\t\t\t\t\n\t\t\t\thomePrintTickets = dossierAftersalesResponse.getHomePrintTicketsByTravelSegment(travelSegment);\n\t\t\t\tif (homePrintTickets != null && homePrintTickets.size() > 0) {\n\t\t\t\t\tpdfButton.setVisibility(View.VISIBLE);\n\t\t\t\t}else {\n\t\t\t\t\tpdfButton.setVisibility(View.GONE);\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n\t\t\t\tpdfButton.setVisibility(View.GONE);\n\t\t\t}\n\n/*\t\t\tif (myState.dossierAftersalesResponse\n\t\t\t\t\t.getExchangeStateForCurrentTravelSegment(travelSegment)) {\n\t\t\t\texchangeButton.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\texchangeButton.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tif (myState.dossierAftersalesResponse\n\t\t\t\t\t.getCancellationStateForCurrentTravelSegment(travelSegment)) {\n\t\t\t\tcancelButton.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\tcancelButton.setVisibility(View.GONE);\n\t\t\t}*/\n\t\t\t// Log.e(TAG,\n\t\t\t// myState.dossierAftersalesResponse.getSelectedDeliveryMethod());\n\t\t}\n\t}",
"public void save() {\n if (message == null || currentView == null) {\n return;\n }\n\n if (isEditable) {\n if (currentView.hasChanged()) {\n currentView.save();\n }\n }\n }",
"public void saveAndView() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"saveAndViewButton\").click();\n\t\tVoodooUtils.pause(3000); // Added to handle dual alerts\n\t\tVoodooUtils.waitForAlertExpiration();\n\t}",
"private void initTaskViews(){\n for (Task t : taskManager.getTasksList()){\n submit(t.getName(), t.getIdInView(), t.getTimeForTask(), t.isFinished());\n }\n }",
"@Override\n protected void onViewCreatedFinish(Bundle saveInstanceState) {\n\n addFragments();\n addListener();\n mVpContent.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {\n @Override\n public Fragment getItem(int position) {\n return mFragments.get(position);\n }\n\n @Override\n public int getCount() {\n return mFragments.size();\n }\n });\n mVpContent.setOffscreenPageLimit(4);\n mTbIndexTab.setTabItemSelected(R.id.ti_index_store);\n mVpContent.setCurrentItem(0);\n refreshMeDot(0);\n\n ActivityManager.getInstance().popOtherActivity(MainActivity.class);\n\n createFile();\n }",
"public void saveInfo(View view) {\n saveInfoHelper();\n }",
"void updateViewFromModel();",
"public void enterView() {\n\t\t// Before clearing it; have the browser remember it.\n\t\tif (isVisible()) {\n\t\t\tGenClient.showDebug(\"For view: \" + getClass().toString() + \" was already visible; no change was made.\");\n\t\t\treturn;\n\t\t}\n\t\tString state = getState();\n\t\tif (state == null) {\n\t\t\tGenClient.showError(\"Failed to get state for view\" + getClass().toString() + \"; making no change\");\n\t\t\treturn;\n\t\t}\n//\t\tGenClient.showDebug(\"Added history item for state: \" + state);\n\t\tsetVisible(true);\n\t\tboolean issueEvent = false;\n\t\tHistory.newItem(state, issueEvent);\n\t}",
"private void handleView(View view) throws AppiaEventException {\n \t\tSystem.out.println(\"Received a new View\");\n \n \t\t//Get the parameters\n \t\tVsGroup[] allGroups = VsClientManagement.getAllGroups();\n \n \t\t//Update the view\n \t\tvs = view.vs;\t\t\n \n \t\t//We start from scratch\n \t\tUpdateManager.cleanUpdateViews();\n \n \t\t//We seize the oportunity to put the future clients and future dead clients in the view\n \t\tfor(VsGroup group : allGroups){\n\t\t\tVsClientManagement.setFutureClientsIntoPresent(group.getGroupId());\n\t\t\tVsClientManagement.setFutureDeadsIntoPresent(group.getGroupId());\n\n \t\t\tVsClientManagement.clearFutureClients(group.getGroupId());\n \t\t\tVsClientManagement.clearFutureDead(group.getGroupId());\n \t\t}\n \n \t\t//I have received a new view, must send the other servers my views clients (and me)\n \t\tVsGroup[] allGroupsWithOnlyMyClients = VsClientManagement.getAllGroupsWithOnlyMyClients(listenAddress);\n \n \t\tUpdateProxyEvent updateProxy = new UpdateProxyEvent(allGroupsWithOnlyMyClients, myEndpt);\n \t\tsendToOtherServers(updateProxy);\n \t\tsendToMyself(updateProxy);\t\t\n \t}",
"private void performSave() {\n if (validate()) {\n int taskId = AppUtils.getLatestTaskId() + 1;\n int catId;\n if (category.equals(AppUtils.CREATE_CATEGORY)) {\n catId = saveNewCategory();\n } else {\n catId = AppUtils.getCategoryIdByName(category);\n }\n saveNewTask(taskId, catId);\n clearAll();\n redirectToViewTask();\n }\n\n }",
"public void onWritePersistent(View view) {\n if(view != null) {\n // Create and populate the properites\n ApplikationEinstellungen applikationEinstellungen = new ApplikationEinstellungen(getApplicationContext());\n ArrayList<String> zeiten = new ArrayList<>();\n zeiten.add(this.zeit1Von.getText().toString());\n zeiten.add(this.zeit1Bis.getText().toString());\n zeiten.add(this.zeit2Von.getText().toString());\n zeiten.add(this.zeit2Bis.getText().toString());\n zeiten.add(this.zeit3Von.getText().toString());\n zeiten.add(this.zeit3Bis.getText().toString());\n zeiten.add(this.zeit4Von.getText().toString());\n zeiten.add(this.zeit4Bis.getText().toString());\n applikationEinstellungen.setZeiten(zeiten);\n applikationEinstellungen.setSchwellwertBewegungssensor(this.seekbarSchwellwert.getProgress());\n applikationEinstellungen.setIntervallSmsBenachrichtigung(Integer.parseInt(smsIntervall.getText().toString()) * 60 * 1000);\n applikationEinstellungen.setMonitorAktiv(this.monitorAktiv.isChecked() ? 1 : 0);\n applikationEinstellungen.setBenutzerName(this.benutzerName.getText().toString());\n // Write persistent\n Datenbank.getInstanz(getApplicationContext()).set(applikationEinstellungen);\n finish();\n }\n }",
"public void OnSaveChanges (View View)\n {\n \t\t\n }",
"@Override\n public void whenDone() {\n getDocumentController().setFile(fileToSaveTo);\n getDocumentController().setHasChanged(false);\n getDocumentController().notifyChange();\n }",
"public void viewAccepted(View new_view) {\n this.view=new_view;\n log.trace(\"[Relayer \" + channel.getAddress() + \"] view: \" + new_view);\n\n Map<String,List<Address>> tmp=extract(new_view);\n Set<String> down=new HashSet<>(routes.keySet());\n Set<String> up=new HashSet<>();\n\n down.removeAll(tmp.keySet());\n\n routes.keySet().retainAll(tmp.keySet()); // remove all sites which are not in the view\n\n for(Map.Entry<String,List<Address>> entry: tmp.entrySet()) {\n String key=entry.getKey();\n List<Address> val=entry.getValue();\n\n List<Route> newRoutes;\n if(routes.containsKey(key))\n newRoutes=new ArrayList<>(routes.get(key));\n else {\n newRoutes=new ArrayList<>();\n if(up != null)\n up.add(key);\n }\n\n // Remove routes not in the view anymore:\n newRoutes.removeIf(route -> !val.contains(route.siteMaster()));\n\n // Add routes that aren't yet in the routing table:\n val.stream().filter(addr -> !contains(newRoutes, addr))\n .forEach(addr -> newRoutes.add(new Route(addr, channel, relay, log).stats(stats)));\n\n if(newRoutes.isEmpty()) {\n routes.remove(key);\n down.add(key);\n up.remove(key);\n }\n else\n routes.put(key, Collections.unmodifiableList(newRoutes));\n }\n if(!down.isEmpty())\n relay.sitesChange(true, down.toArray(new String[0]));\n if(!up.isEmpty())\n relay.sitesChange(false, up.toArray(new String[0]));\n }",
"@Override\r\n\tprotected void hookAfterAnalyzeView(final DatabaseView view) throws SQLException {\n\t\tbuildAllKeysOnlyForView(view);\r\n\t\t// Replace the schema object.\r\n\t\tview.setDdlSchemaObject(schema);\r\n\r\n\t\t// Set isMaterialized attribute.\r\n\t\tif (materializedViews != null) {\r\n\t\t\tif (materializedViews.contains(view.getTitle())) {\r\n\t\t\t\tview.setMaterialized(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n protected void commitCreates(ViewImpl view, ObjectInstance oi)\n {\n }",
"public void persistEntry(View view) {\n // TODO: Show progress\n\n TimeTableEntryService timeTableEntryService = BackendClient.getInstance().getTimeTableEntryService();\n Call<Void> call;\n if (mIsEdit) {\n call = timeTableEntryService.updateEntry(mEntry.getId(), mEntry);\n } else {\n call = timeTableEntryService.createEntry(mEntry);\n }\n\n call.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(@NonNull Call<Void> call, @NonNull Response<Void> response) {\n if (!response.isSuccessful()) {\n try {\n String errorString = response.errorBody().string();\n Snackbar.make(findViewById(R.id.activity_coordinator_layout), errorString, Snackbar.LENGTH_INDEFINITE).show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return;\n }\n finish();\n }\n\n @Override\n public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {\n // TODO:STOP SPINNER\n // Alsoproper handling\n Snackbar.make(findViewById(R.id.activity_coordinator_layout), t.getLocalizedMessage(), Snackbar.LENGTH_INDEFINITE).show();\n }\n });\n }",
"protected void onPostExecute(Void v) {\n TimeTableWizardActivity.setDefaultLookedWeek(PreferenceManager.getDefaultSharedPreferences(context));\r\n\r\n Week week = SaveWeekWizard.loadWeek(PreferenceManager.getDefaultSharedPreferences(context));\r\n if(week == null){\r\n //connection fail\r\n if(TimeTableWizardWidget.week == null){\r\n //no save\r\n TimeTableWizardWidget.displayText(context.getResources().getString(R.string.connexionFail));\r\n }\r\n }else{\r\n //apply change in activity\r\n TimeTableWizardWidget.week = week;\r\n TimeTableWizardWidget.displayTable(context);\r\n }\r\n\r\n //update widget\r\n widgetManager.updateAppWidget(new ComponentName(context, WidgetHorizontal.class), TimeTableWizardWidget.remoteViews);\r\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n Main.switchViews();\n }",
"protected void aktualisieren() {\r\n\r\n\t}",
"public void regenView() {\r\n\t\ttry { \r\n\r\n\t\t\tFileInputStream fis = new FileInputStream(Preferences.cacheDataFile);\r\n\t\t\tLoadModelTask task = new LoadModelTask(timeRange.getMinTs(), timeRange.getMaxTs(), timeRange.getIniTs(), timeRange.getEndTs(), true, fis, Preferences.RecursivityLevel, this);\r\n\t\t\ttask.execute();\r\n\t\t\tthis.setEnabled(false);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tCommonForms.showError(this, \"Error reading cache\");\r\n\t\t}\r\n\t}",
"private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }",
"@FXML\n public void saveNotes() {\n try {\n Interview selectedInterview = this.listInterview.getSelectionModel().getSelectedItem();\n selectedInterview.setNotes(txtNote.getText());\n selectedInterview.setRecommended(chkRecommended.isSelected());\n\n AlertHelper.showInformationAlert(\"Interview information have been saved.\");\n\n // Reset view\n this.populateInterviewInfo(selectedInterview);\n } catch (Exception ex) {\n AlertHelper.showErrorAlert(\"Unable to save notes: \" + ex.getLocalizedMessage());\n }\n }",
"@AfterViews\n void syncViews() {\n\n setSupportActionBar(mToolbar);\n\n if (mFragmentNumber == REPOS_FRAGMENT_NUMBER) {\n currentFragment = RepoDataFragment_.instantiate(this, RepoDataFragment_.class.getName());\n }\n\n changeFrament(currentFragment);\n\n //mBottomBar = BottomBar.attachShy(mMainCoordinator, mNestedScrollView, getIntent().getExtras());\n\n mBottomBar = BottomBar.attach(this, getIntent().getExtras());\n\n mBottomBar.setItemsFromMenu(R.menu.main_bottom_menu, this);\n }",
"@Override\n public void onClick(View v) {\n\n DBCreate();\n\n SubmitData2SQLiteDB();\n\n }",
"public void dataUpdated() {\r\n finish = getConfiguration().getTransformTarget() != null;\r\n this.wizardControl.updateView();\r\n }",
"public void saveGameView(NextWindow nextWindow) {\n\t\ttry {\n\t\t\tprimaryStage.setTitle(\"Spiel Speichern\");\n\t\t\tBorderPane root = new BorderPane();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/LoadGame.fxml\"));\n\t\t\troot = loader.load();\n\t\t\tLoadGameViewController loadGameViewController = (LoadGameViewController) loader.getController();\n\t\t\tloadGameViewController.setOnitamaController(onitamaController);\n\t\t\tloadGameViewController.initSave(nextWindow);\n\t\t\tScene scene = new Scene(root);\n\t\t\t//((Stage) outerPane.getScene().getWindow()).setScene(scene);\n\t\t\tPlatform.runLater(() -> { LoadViewController.primaryStage.setScene(scene); });\n\t\t\t//LoadViewController.primaryStage.setScene(scene);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void switchToProgress() {\n FragmentManager fm = getFragmentManager();\n FragmentTransaction transaction = fm.beginTransaction();\n exerciseProgressFragment.setCurrentExercise(currentExercise);\n transaction.replace(R.id.exerciseFragmentLayout, exerciseProgressFragment);\n transaction.commit();\n }",
"public void setupComplete(View view) {\n switch(view.getId()) {\n case R.id.setup_complete:\n updateCurrentFragment(new TrialFragment(), \"trial\");\n break;\n }\n }",
"public void doSaveAs() {\n\t\tif (activePage == 0 && introEditor.isUpdated() || introEditor.isDirty())\n\t\t\tupdateIntroEditor();\n\t\tif (activePage == 1 && (pageMainEditor.isUpdated() || pageMainEditor.isDirty()))\n\t\t\tupdateFile();\n\t\tIEditorPart editor = getTextEditor();\n\t\teditor.doSaveAs();\n\t\tsetPageText(getTextEditorIndex(), editor.getTitle());\n\t\tsetInput(editor.getEditorInput());\n\t}",
"private void changeView(){\r\n\t\t\tm.changeView(Views.GAME, gameType, game);\r\n\t}",
"public void doNewGame(View view) {\n mainHelper.restart();\n }",
"@AfterViews\n void ProcessAfterViews() {\n\n if(miestnost != null && miestnost.getId() > 0){\n\n txt_Miestnost.setText(miestnost.getNazov());\n //boolean aa = jeSklad.isChecked();\n\n //boolean ab = miestnost.isJeSklad();\n\n jeSklad.setChecked(miestnost.isJeSklad());\n // aa = jeSklad.isChecked();\n // aa = miestnost.isJeSklad();\n\n // resultMiestnost.setJeSklad(jeSklad.isChecked());\n\n }\n }",
"@Override\n\tprotected void refreshView() {\n\t\t\n\t}",
"public void verarbeite() {\n\t\t\r\n\t}",
"public void updateTaskViews(){\n for (Task task : taskManager.getTasksList()){\n TextView textToChange = (TextView) root.findViewById(task.getIdInView());\n if (textToChange == null){\n submit(task.getName(), task.getIdInView(), task.getTimeForTask(), task.isFinished());\n } else {\n textToChange.setText(task.getName());\n }\n }\n }",
"@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.settings_buttonSave:\n readGui();\n settings.saveSettings();\n Toast.makeText(getContext(), R.string.string_settings_saved, Toast.LENGTH_SHORT).show();\n getActivatedWeekdays();\n break;\n case R.id.settings_buttonResetDB:\n Toast.makeText(getContext(), \"dodo\", Toast.LENGTH_SHORT).show();\n System.out.println(\"pressed\");\n DatabaseHelper dbHelper = new DatabaseHelperImpl(getContext());\n System.out.println(dbHelper.toString());\n dbHelper.resetDatabase();\n System.out.println(dbHelper.toString());\n break;\n }\n }",
"public void setNextActivateView(OwView nextView_p) throws Exception\r\n {\n\r\n }",
"@Override\n public void saveFile() {\n LOG.fine(\"no.of viewers:\" + viewers.size());\n // assuming the widget that is active is the dirty widget. save it\n for (FileViewer viewer : viewers) {\n if (viewer.isDirty()) {\n saveFile(viewer);\n break;\n }\n }\n }",
"private void refreshFragmentAfterdownloadedData() {\n Fragment fragmentToday = new FragmentToday();\n FragmentTransaction ft = getSupportFragmentManager().beginTransaction();\n ft.replace(R.id.fragmentToday, fragmentToday, \"FragmentToday\");\n ft.commit();\n\n Fragment fragment5days = new Fragment5days();\n FragmentTransaction ft5days = getSupportFragmentManager().beginTransaction();\n ft5days.replace(R.id.fragment5days, fragment5days, \"Fragment5days\");\n ft5days.commit();\n }",
"public void run() {\n\n progressBarLocation.setVisibility(View.VISIBLE);\n scrollView.setVisibility(View.INVISIBLE);\n if(userSession.isIsSwitchIsOn()) // check if switch was on\n {\n progressBarLocation.setVisibility(View.GONE);\n editTextFirstName.setText(userSession.getFirstName());\n editTextLastName.setText(userSession.getLastName());\n editTextCity.setText(userSession.getCityName()); // get info and set them in fields\n editTextState.setText(userSession.getState());\n editTextPhoneNumber.setText(userSession.getPhoneNumber());\n editTextStreetAddress.setText(userSession.getStreetAddress());\n editTextZIPCode.setText(userSession.getZipCode());\n saveAddressSwitch.setChecked(true);\n scrollView.setVisibility(View.VISIBLE);\n }\n else\n {\n scrollView.setVisibility(View.VISIBLE);\n progressBarLocation.setVisibility(View.GONE);\n saveAddressSwitch.setChecked(false);\n userSession.setFirstName(null);\n userSession.setLastName(null);\n userSession.setCityName(null); // set session values to null\n userSession.setState(null);\n userSession.setStreetAddress(null);\n userSession.setZipCode(null);\n userSession.setPhoneNumber(null);\n userSession.setIsSwitchIsOn(false);\n }\n\n }",
"public void updateAllViews()\r\n { for (IView view : this.views)\r\n { view.updateView();\r\n }\r\n }",
"public void goToSeedBoxModeActivity(View view) { //is called by onClick function of Button\n objBlockFactory.RestoreBlockFactory();\n Intent intent = new Intent(this, SeedBoxModeActivity.class);\n startActivity(intent);\n }",
"private void inizialiteViews() {\n tvDirectionStore = findViewById(R.id.tvDirectionStore);\n tvNameOwner = findViewById(R.id.tvNameOwnerView);\n tvNameStore = findViewById(R.id.tvNameStoreView);\n tvPhonestore = findViewById(R.id.tvPhoneNumberOwner);\n editStore = findViewById(R.id.btnEditStore);\n imageViewStore = findViewById(R.id.imageStore);\n }",
"@Override\n protected void commitProperties() {\n if (imageLoadTypeChanged) {\n imageLoadTypeChanged = false;\n frontPageView.setImageLoadType(imageLoadType);\n backPageView.setImageLoadType(imageLoadType);\n }\n }",
"public void volverLobby(View view) {\n finish();\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsave();\n\t\t\t}",
"private void storeViewState()\n\t{\n\t\tCommand lastCmd = project.getLastCommand();\n\t\tif (lastCmd != null)\n\t\t{\n\t\t\tlastCmd.setOptionalState(view.toJSONString(lastCmd.getProjectState()));\n\t\t}\n\t}",
"public void refresh_and_back_to_tourspane() {\n\t\tSceneController.pop();\n\t\tSceneController.pop_title();\n\t\tFadeOutRight anim1 = new FadeOutRight(HomeController.instance.PANE);\n\t\tanim1.play();\n\t\tanim1.setResetOnFinished(true);\n\t\tanim1.setOnFinished(event1 -> {\n\t\t\tSelectedCity_ToursController LookupForm = new SelectedCity_ToursController();\n\n\t\t\ttry {\n\t\t\t\tLookupForm.start(HomeController.instance.PANE);\n\n\t\t\t\tclient.requestHandler.Catalog.getAllTours(GeneralValues.CITY);\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t});\n\t\t\n\t}",
"private void doAfterRestoreView(final PhaseEvent arg0) {\n\t}",
"private void update(LinkedTaskList linkedTaskList){\n dispose();\n new View(linkedTaskList);\n }",
"@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t\tinsertView();\n\t}",
"public void saveState() {\n\t\tsuper.saveState();\n\t}",
"public void onBack(View view){\n Context context = App.getContext();\n LogManager.reportStatus(context, \"INSPECTOR\", \"Back\");\n saveTemplate(filename);\n Intent intent = new Intent(this, FileManager.class);\n startActivity(intent);\n }",
"public void locationPlanner(View view) {\n Intent intent = new Intent(TravelPlanner.this, ScheduleTabSwitch.class);\n\n PlanGenerator planGenerator = new PlanGenerator();\n\n SQLiteHelper db = new SQLiteHelper(this);\n db.getWritableDatabase();\n planGenerator.generatePlan(db.getCurrentPlan(), dp.getYear(), dp.getMonth(), dp.getDayOfMonth());\n Plan currentPlan = planGenerator.getGeneratedPlan();\n\n int year = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR);\n int month = java.util.Calendar.getInstance().get(java.util.Calendar.MONTH);\n int day = java.util.Calendar.getInstance().get(java.util.Calendar.DATE);\n if(db.getPlan(currentPlan.getDate()) == null) {\n if(curDate[0] < year || (curDate[0] == year && curDate[1] < month) ||\n (curDate[0] == year && curDate[1] == month && curDate[2] < day))\n Toast.makeText(TravelPlanner.this, \"Invalid date!\", Toast.LENGTH_SHORT).show();\n else if(currentPlan.getLocationCount() == 0)\n Toast.makeText(TravelPlanner.this, \"Empty Plan!\", Toast.LENGTH_SHORT).show();\n else {\n db.addPlan(currentPlan);\n List<Location> list2 = db.getCurrentPlan();\n for (Location l : list2)\n db.deleteLocationFromCurrentPlan(l);\n db.close();\n int[] date = curDate;\n intent.putExtra(\"locationList\", currentPlan.getlocationList());\n intent.putExtra(\"date\", date);\n startActivity(intent);\n }\n }\n else {\n Toast.makeText(TravelPlanner.this, \"Plan already exists!\", Toast.LENGTH_SHORT).show();\n }\n\n }",
"void assignToView(View view) {\n int pass = mPass - 1;\n // prepare the view for display while rendering\n prepare(view, mParam, pass);\n // update the view with whatever work we have already done\n if (pass >= 0)\n update(view, mRender, pass);\n // check if we have work left to do\n if (mPass < mPasses) {\n // add the view to our set\n mViews.add(view);\n // tag the view so that we can cancel the task later if we need\n // to\n setTask(view, this);\n // all set, queue us up\n enqueue();\n }\n }",
"public void scheduleViewChange(){\n PBFTRequestInfo rinfo = getRequestInfo();\n\n if(!isPrimary() && rinfo.hasSomeWaiting()){\n \n if(!overloaded() || changing()){\n long now = getClockValue();\n\n if(!getViewTimer().workingAt(now)){\n\n long timeout = getPrimaryFaultTimeout();\n PBFTTimeoutDetector ttask = (PBFTTimeoutDetector) getViewTimer().getTask();\n\n if(ttask != null && ttask.get(\"TIMEOUT\") != null){\n timeout = (Long)ttask.get(\"TIMEOUT\");\n JDSUtility.debug(\"[scheduleViewChange()] s\" + getLocalServerID() + \" computed changeview timeout equal to \" + timeout);\n }\n\n long timestamp = now + timeout;\n getViewTimer().schedule(timestamp);\n return;\n }\n return;\n }//end change-view timer is working\n JDSUtility.debug(\"[batch()]s\" + getLocalServerID() + \", at time \" + getClockValue() + \", has been in overloaded state.\");\n }//end if it is not primary\n \n }",
"protected void doCheckView() {\n // check the remotes first\n if (getAnnouncementRegistry() == null) {\n logger.info(\"announcementRegistry is null (will check view again later)\");\n return;\n }\n getAnnouncementRegistry().checkExpiredAnnouncements();\n }",
"void updateModelFromView();",
"private void loadViews(){\n\t}",
"@FXML private void transitionView(ActionEvent event) {\n\t\t// id button caller\n\t\tString btn = ((Button) event.getSource()).getId();\n\t\tNavigationController.PREVIOUS = NavigationController.STARTMENU;\n\t\t// send load request\n\t\tif (btn.equals(\"newgame\"))\n\t\t\tNavigationController.loadView(NavigationController.GAMECREATION);\n\t\tif (btn.equals(\"loadgame\"))\n\t\t\tNavigationController.loadView(NavigationController.SAVELOAD);\n\n\t\t// if this spot is reached: do nothing\n\t}",
"private void refreshView() {\n this.view.updateRobots();\n }",
"public void saveClicked(View actionView)\n {\n \t//If ID is empty it is a new Task\n \tif( taskId.getText().length() > 0 )\n \t{\n \t\tupdateTask();\n \t}\n \t//If ID exists it is updating an existing task\n \telse\n \t{\n \t\tnewTask();\n \t}\n }",
"@Override\n\tpublic void onSaveInstanceState(Bundle savedInstanceState) {\n\t savedInstanceState.putBoolean(HAS_RUN, true);\t \n\t //savedInstanceState.putParcelable(MODEL_DATA, dS);\n\t Log.i(\"MAIN\",\"Saved instances\");\n\t // Always call the superclass so it can save the view hierarchy state\n\t super.onSaveInstanceState(savedInstanceState);\n\t}",
"void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }",
"@Override\n\tpublic void refreshView() {\n\n\t}",
"@FXML private void doSave(ActionEvent event) {\n\t\tmodel.save();\n\t}",
"@Override\r\n\t\t\tprotected void saveContext() {\n\t\t\t\t\r\n\t\t\t}",
"private void jButtonSaveStageplaatsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveStageplaatsActionPerformed\n\n storeDisplayedStageplaats();\n \n this.dbFacade.persist((this.geselecteerdeStageplaats));\n refreshDataCache();\n refreshListbox();\n }",
"@Override\n\t\t\t\t\tpublic void onClick(View view) {\n\t\t\t\t\t\tnew AddInDatabase().execute();\n\t\t\t\t\t}",
"public void run() {\n if (view.getPauseState() && model.getSelectedNote() != null) {\n this.model.removeNote(model.getSelectedNote());\n this.model.setSelectedNote(null);\n }\n\n view.setAllNotes(model.getMusic());\n view.setLength(model.getDuration());\n view.setTone(model.getTone(model.getNotes()));\n view.setTempo(model.getTempo());\n }",
"public void goToSave(TextView text){\n\n if (Validation.validateStartDate(dateTextView, getContext())) {\n\n // Url\n String url = ServiceUrls.KEY_HEALTHBOOK_ALLERGIES.concat(StringConstants.KEY_CREATE);\n\n // Shut off keypad\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(text.getWindowToken(), 0);\n\n // Set data\n final HashMap<String, Object> postData = new HashMap<>();\n postData.put(StringConstants.KEY_PATIENT_ID, SharedPreferenceService.getValue(getActivity(), StringConstants.KEY_PATIENT_ID));\n postData.put(StringConstants.KEY_ALLERGY_ID, mAllergyId);\n postData.put(StringConstants.KEY_ALLERGY_NAME, problemNameTextView.getText().toString());\n postData.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, problemHyperlinkTextView.getText().toString());\n postData.put(StringConstants.KEY_ALLERGY_TYPE, mAllergyTypeName);\n postData.put(StringConstants.KEY_ALLERGY_KIND_OF_REACTION, kindOfReactionSpinner.getSelectedItem().toString());\n postData.put(StringConstants.KEY_START_DATE,\n DateTimeUtils.convertTimestampToUTC(DateTimeUtils.convertDateSimpleToTimestamp(dateTextView.getText().toString())));\n postData.put(StringConstants.KEY_ALLERGY_COMMENTS, commentsTextView.getText().toString());\n\n // Set Headers\n final HashMap<String, String> headers = new HashMap<>();\n headers.put(StaticConstants.KEY_AUTHORIZATION,\n StaticConstants.KEY_BEARER\n .concat(\" \")\n .concat(SharedPreferenceService.getValue(getActivity(), StringConstants.KEY_TOKEN)));\n\n if (Validation.isConnected(getActivity())) {\n\n /**\n * API Call\n */\n APICallService.PostAPICall(getActivity(), getActivity(), url, postData, headers, new APIInterface() {\n\n @Override\n public void onSuccess(JSONObject response) {\n try {\n\n // Create in Local Database\n Allergy mAllergyModel = new Allergy(SharedPreferenceService.getValue(getActivity(), StringConstants.KEY_PATIENT_ID),\n response.getString(StringConstants.KEY_P_ID),\n mAllergyId,\n problemNameTextView.getText().toString(),\n problemHyperlinkTextView.getText().toString(),\n mAllergyTypeName,\n kindOfReactionSpinner.getSelectedItem().toString(),\n dateTextView.getText().toString(),\n commentsTextView.getText().toString());\n\n mAllergyModel.save();\n addMainRelativeLayout.setVisibility(View.GONE);\n fab.setVisibility(View.VISIBLE);\n readAllergyList(getActivity());\n\n } catch (Exception e) {\n\n // Log error\n ErrorHandlers.handleAPIError(getActivity());\n Crashlytics.logException(e);\n }\n }\n\n @Override\n public void onError(VolleyError error) {\n\n }\n });\n } else {\n\n ErrorHandlers.handleInternetConnectionFailure(getActivity());\n }\n\n }\n }",
"public void saveAction (){\n\t \tif(dayNum ==7){\n\t \t\tintPhaseCompletes = intPhaseCompletes +1;\n\t \t\tdb.execSQL(\"UPDATE Phases SET Completions= \"+ intPhaseCompletes + \" WHERE PhaseID = \" + \"'\" + phaseID + \"'\");\n\t \t}\n \tcontent = timerTextView.getText().toString();\n \tstrDate = functions.getDate();\n \tintCompletes = intCompletes +1;\n \tdb.execSQL(\"INSERT INTO results (ExerciseName,time,date) VALUES(\"+ \"'\" + dayName +\"'\" + \",\" \n \t\t\t+ \"'\" + content + \"'\" + \",\"+ \"'\" + strDate +\"'\"+ \")\");\n \tdb.execSQL(\"UPDATE Days SET LastDate= \"+ \"'\" + strDate + \"'\" + \" WHERE _id = \" + \"'\" + dayID + \"'\");\n \tdb.execSQL(\"UPDATE Days SET Completions= \"+ intCompletes + \" WHERE _id = \" + \"'\" + dayID + \"'\");\n \tdb.close();\n \tdialogShare();\n }",
"public void onSave(View view){\n saveTemplate(filename);\n Toast.makeText(this, \"Saved\", Toast.LENGTH_LONG).show();\n }",
"@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"View1Model execute() 호출\");\n\t}",
"public void putDocumentAfterEdit() {\r\n\t\tif(pointer < strategy.getEntireHistory().size()-1) {\r\n\t\t\tstrategy.putVersion(currentDocument);\r\n\t\t}\r\n\t}",
"private void setupViews() {\n ivBack.setVisibility(View.VISIBLE);\n if (isCreateDeal) {\n tvTitle.setText(getString(R.string.create_deal));\n btnDone.setVisibility(View.VISIBLE);\n btnDone.setText(R.string.done);\n etEndTime.setText(appUtils.parseToTimeAndDate(pickUpTime));\n\n } else {\n tvTitle.setText(getString(R.string.deactivated_deal));\n btnDone.setVisibility(View.VISIBLE);\n btnDone.setText(R.string.activate);\n\n if (dealData != null) {\n etTitle.setText(dealData.getDealTitle());\n etTitle.setSelection(etTitle.getText().length());\n etDescription.setText(dealData.getDealDescription());\n etTotalItems.setText(dealData.getTotalItems());\n etOriginalPrice.setText(dealData.getOriginalPrice());\n tvNewPrice.setText(dealData.getNewPrice());\n double discount = (Double.parseDouble(dealData.getOriginalPrice()) -\n Double.parseDouble(dealData.getNewPrice())) / Double.parseDouble(dealData.getOriginalPrice()) * 100;\n String perc = discount + getString(R.string.percent_symbol);\n tvDiscountPerc.setText(perc);\n seekbarNewprice.setProgress((int) discount / 5);\n etBeginTime.setText(appUtils.parseToTimeAndDate(dealData.getStartTime()));\n etEndTime.setText(appUtils.parseToTimeAndDate(dealData.getEndTime()));\n }\n }\n }",
"@Transactional(\"txManager\")\r\n\t@Override\r\n\tpublic void increaseViews(int qnaNum) {\n\t\tQnARepository.increaseViews(qnaNum);\r\n\t}",
"@FXML\n public void viewAll(ActionEvent event) throws IOException {\n ViewDatabaseGUI viewDatabase = new ViewDatabaseGUI();\n viewDatabase.start(new Stage());\n }",
"public void saveState() \n\t{\n\t\tsuper.saveState();\n\t}",
"private void updateViewConfig() {\n boolean newView = false;\n\n // Check if our view is right for the current mode\n int mode = getMode();\n boolean isCurrentViewShortcut = mCurrentView instanceof ShortcutView;\n Set<SliceItem> loadingActions = mCurrentView.getLoadingActions();\n if (mode == MODE_SHORTCUT && !isCurrentViewShortcut) {\n removeView(mCurrentView);\n mCurrentView = new ShortcutView(getContext());\n addView(mCurrentView, getChildLp(mCurrentView));\n newView = true;\n } else if (mode != MODE_SHORTCUT && isCurrentViewShortcut) {\n removeView(mCurrentView);\n mCurrentView = new TemplateView(getContext());\n addView(mCurrentView, getChildLp(mCurrentView));\n newView = true;\n }\n\n // If the view changes we should apply any configurations to it\n if (newView) {\n mCurrentView.setPolicy(mViewPolicy);\n applyConfigurations();\n if (mListContent != null && mListContent.isValid()) {\n mCurrentView.setSliceContent(mListContent);\n }\n mCurrentView.setLoadingActions(loadingActions);\n }\n updateActions();\n }",
"public void onClick(DialogInterface dialog, int which) {\n SharedPreferences.Editor editor = mainClassCall.edit();\n editor.putString(\"mainClassCall\", \"True\"); // Storing string\n editor.commit();\n TaskViewModel taskViewModel = Shared.SelectedTask;\n\n taskViewModel.IsDone = true;\n\n dbHelper.saveTask(taskViewModel, true);\n Toast.makeText(getActivity(), \" Move to Done list\", Toast.LENGTH_LONG).show();\n Intent myIntent = new Intent(getActivity(), MainActivity.class);\n getActivity().startActivity(myIntent);\n }",
"@Override\n public void onClick(View v) {\n SharedPreferences currShared = getContext().getSharedPreferences(MainActivity.CURR_PREFS, Context.MODE_PRIVATE);\n SharedPreferences.Editor currEditor = currShared.edit();\n currEditor.clear();\n currEditor.apply();\n Toast.makeText(getContext(), \"We should build a post trip page\", Toast.LENGTH_LONG).show();\n startActivity(new Intent(getContext(), MainActivity.class));\n\n }"
] | [
"0.6320397",
"0.6268009",
"0.6251904",
"0.61589545",
"0.6074156",
"0.60106957",
"0.60024244",
"0.59746224",
"0.5869821",
"0.5846067",
"0.5842589",
"0.58302915",
"0.5827695",
"0.5802352",
"0.5757083",
"0.57477885",
"0.5720243",
"0.5709057",
"0.5667181",
"0.56596756",
"0.5657878",
"0.565736",
"0.564337",
"0.56292355",
"0.56171155",
"0.56118304",
"0.56075656",
"0.56059295",
"0.55899763",
"0.55792665",
"0.55772376",
"0.55583614",
"0.5540934",
"0.5539917",
"0.5534239",
"0.55244625",
"0.5517031",
"0.5506007",
"0.55059606",
"0.5500502",
"0.5496872",
"0.54830027",
"0.5477789",
"0.54724836",
"0.54701",
"0.5454893",
"0.5448566",
"0.544609",
"0.5444347",
"0.5433507",
"0.5430724",
"0.54246765",
"0.5411778",
"0.5405845",
"0.5403628",
"0.53982204",
"0.5397955",
"0.5396076",
"0.53809446",
"0.53751445",
"0.5366521",
"0.5360372",
"0.5355678",
"0.5349472",
"0.5345849",
"0.53457135",
"0.5344145",
"0.5340446",
"0.5336619",
"0.5331516",
"0.53197217",
"0.5317953",
"0.53168106",
"0.5315332",
"0.53118277",
"0.53107864",
"0.53080416",
"0.53054416",
"0.53034246",
"0.53011215",
"0.52962655",
"0.52769697",
"0.5275143",
"0.5267129",
"0.52658135",
"0.5264365",
"0.52634764",
"0.52596515",
"0.52571523",
"0.52549493",
"0.52543545",
"0.5250347",
"0.52502096",
"0.52456576",
"0.52411485",
"0.52358025",
"0.52352494",
"0.5232494",
"0.52306575",
"0.5228338",
"0.5222229"
] | 0.0 | -1 |
If user wants to go back | public void switchActivity_Main(View view) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected boolean canGoBack() {\n return false;\n }",
"boolean onBackPressed();",
"boolean onBackPressed();",
"public void back() {\n Views.goBack();\n }",
"public boolean goBack() {\n if (historyStack.size() > 0) {\n switchToScreen(historyStack.pop(), true, lastTransition != null ? lastTransition : TransitionAnimation.getTransition(TransitionAnimationType.RIGHT_TO_LEFT));\n return true;\n }\n return false;\n }",
"@Override\n\tpublic boolean onBackPressed() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean onBackPressed() {\n\t\treturn false;\n\t}",
"void onGoBackButtonClick();",
"@Override\n\t\tpublic boolean handleBackPressed() {\n\t\t\treturn false;\n\t\t}",
"public abstract boolean onBackPressed();",
"protected void goBack() {\r\n\t\tfinish();\r\n\t}",
"@Override\n public void goBack() {\n\n }",
"@Override\n\tpublic boolean onNaviBackClick() {\n\t\treturn false;\n\t}",
"@Override\n public void onBackPressed() {\n if(web.canGoBack()){\n web.goBack();\n } else {\n super.onBackPressed();\n }\n }",
"@Override\r\n public void onBackPressed() {\n if(TripPlannerFragment.mCanGoNextState)\r\n {\r\n TripPlannerFragment.mCanGoNextState = false;\r\n finish();\r\n }\r\n }",
"public void back(){\n\t\tswitch(state){\n\t\tcase LOGINID:\n\t\t\tbreak; //do nothing, already at top menu\n\t\tcase LOGINPIN:\n\t\t\tloginMenu();\n\t\t\tbreak;\n\t\tcase TRANSACTION:\n\t\t\tbreak; //do nothing, user must enter the choice to log out\n\t\tcase DEPOSIT:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase DEPOSITNOTIFICATION:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAW:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase BALANCE:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAWALNOTIFICATION:\n\t\t\tbreak; //do onthing, user must press ok\n\t\t}\n\t\t\n\t\tcurrentInput = \"\";\n\t}",
"public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}",
"@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\n\t\tnavigatetoAppointmentsListingScreen(\"false\");\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tBack();\n\t}",
"public void goBack() {\n goBackBtn();\n }",
"private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tfinish();\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tfinish();\r\n\t}",
"@Override\n public void onBackPressed() {\n backToHome();\n }",
"private void onBack(McPlayerInterface player, GuiSessionInterface session, ClickGuiInterface gui)\r\n {\r\n session.setNewPage(this.prevPage);\r\n }",
"public Boolean onBackPressed() {\n\t\n\tif(state==MAIN_MENU || state==RESUME){ ags.ad.pauseMusic(); return true;}\n\t\n\telse if(state==GAME_SCREEN){\n\t\tLog.d(\"GameboyActivity\",\"game screen to main menu\");\n\t\tif(ag.currenttime<1){\n\t\t\tstate=MAIN_MENU; \n\t\t\tif(ag.counter > ag.best){\n\t\t\t\tSharedPreferences.Editor editor =\n\t\t\t\t\t\tag.settings.edit(); \n\t\t\t\t editor.putInt(\"counter\", ag.counter);\n\t\t\t\t\tLog.d(\"GameboyActivity\",Integer.toString(ag.counter));\n\t\t\t\t\t\teditor.commit();\n\t\t\t\t\t\tag.best=ag.counter;\t\t\n\t\t\t\t}\n\t\t//\treinitializegame();\n\t\t}else{\n\tstate=RESUME;\n\tif(ag.counter > ag.best){\n\t\tSharedPreferences.Editor editor =\n\t\t\t\tag.settings.edit(); \n\t\t editor.putInt(\"counter\", ag.counter);\n\t\t\tLog.d(\"GameboyActivity\",Integer.toString(ag.counter));\n\t\t\t\teditor.commit();\n\t\t\t\tag.best=ag.counter;\t\t\n\t\t}\n\t \treturn false;}\n\t}else if(state==CREDITS){\n\t\t\n\tstate=ags.prev_state;\n\t \treturn false;\n\t}\n\treturn false;\n}",
"@Override\n public boolean onSupportNavigateUp() {\n super.onBackPressed();\n\n //Do this to indicate the user is not leaving the quiz, but only leaving the activity..\n //So don't submit the quiz..\n SharedPreferences.Editor e=quizPrefs.edit();\n e.putInt(\"exit\",0);\n e.apply();\n return true;\n }",
"@Override\n\tpublic void onBackPressed() {\n\treturn;\n\t}",
"@Override\n public void onBackPressed() {\n confirmExit();\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return super.onSupportNavigateUp();\n }",
"@Override\n\tpublic void backButton() {\n\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\t\n\t}",
"public void keyBackIsPressed(){}",
"@Override\n\tpublic void onBackPressed()\n\t\t{\n\t\tbackPressed();\n\t\t}",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return false;\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\treturn;\n\t}",
"@Override\n\tpublic void onBackPressed()\n\t{\n\t}",
"public void back() {\n\t\tstate.back();\n\t}",
"static void goback() \r\n\t {\n\t\t\t System.out.println(\"Do you want to conytinue Press - yes and for exit press - No\" );\r\n\t\t\t Scanner sc = new Scanner(System.in);\r\n\t\t\t n = sc.next();\r\n \t\t if(n.equalsIgnoreCase(\"yes\"))\r\n\t\t\t {\r\n\t\t\t\t MainMenu();\r\n\t\t\t }\r\n\t\t\t if(n.equalsIgnoreCase(\"No\"))\r\n\t\t\t {\r\n\t\t\t\t exit();\r\n\t\t\t }\r\n\t\t\t else \r\n\t\t\t {\r\n\t\t\t\t System.out.println(\"please enter a valid input 0 or 1 ! \");\r\n\t\t\t\t goback();\r\n\t\t\t }\r\n\t\t\r\n\t }",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean cancelIfCannotGoBack() {\n return true;\n }",
"@Override\n\tpublic void onBackPressed() {\n\n\t}",
"private void returnBack()\n {\n getActivity().onBackPressed();\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tdoBack();\r\n\t}",
"@Override\n\tpublic void onBackPressed()\n\t{\n\t\tsuper.onBackPressed();\n\t\t// MainActivity.isReSearch = true;\n\t}",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }",
"public void goBack(View view) {\n end();\n }",
"public static void goBack() {\n\t\tif (touchGUI.getTouchModel().getGuiModel().isDialogShown()) {\n\t\t\ttouchGUI.getTouchModel().getGuiModel().closeActiveDialog();\n\t\t} else {\n\t\t\t// else go to last view in history\n\t\t\tif (!appWidget.goBack()) {\n\t\t\t\t// if history is empty -> close app\n\t\t\t\tphoneGap.exitApp();\n\t\t\t}\n\t\t}\n\n\t\tlaf.updateUndoSaveButtons();\n\t\ttouchGUI.updateViewSizes();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tfinish();\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tfinish();\n\t\tsuper.onBackPressed();\n\t}",
"public boolean onBackButtonPressed(MenuItem item){\n Intent goBack = new Intent(getApplicationContext(), MainActivity.class);\n startActivityForResult(goBack, 0);\n return true;\n }",
"@Override\n \tpublic void onBackPressed() {\n \t}",
"@Override\n public void onBackPressed() {\n logBackPressed();\n finishOk();\n }",
"public void onBackPressed() {\r\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tif (cmd == ConstantTool.PAY_SUCCESS) {\r\n\t\t\tIntent intent = new Intent(OrderList.this, Homemenu.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t}\r\n\t}",
"public abstract boolean onBackPressed(boolean isSystemBackKey);",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"public void onBackPressed() {\n backbutton();\n }",
"@Override\n public void backButton() {\n\n\n }",
"public void navigateToBack() {\n WebDriverManager.getDriver().navigate().back();\n }",
"void actionBack();",
"public void GoBack(){\n if (prev_hostgui != null){\n this.setVisible(false);\n prev_hostgui.setVisible(true);\n } else{\n this.setVisible(false);\n prev_guestgui.setVisible(true);\n }\n }",
"@Override\n public void onBackPressed() {}",
"@Override\r\n public void onBackPressed() {\n }",
"@Override\n public boolean onSupportNavigateUp() {\n super.onBackPressed();\n return true;\n }",
"private void checkForBack() {\n if (Gdx.input.isKeyJustPressed(Input.Keys.BACK) || Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE) ||\n BackButton.isPressed()) {\n Gdx.input.vibrate(50);\n dispose();\n game.setScreen(new MainMenuView(game));\n }\n }",
"protected void handleBack(ActionEvent event) {\n\t}",
"@Override\n\tpublic boolean onBackPressedListener() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}",
"private void navBack() {\n Intent intent = new Intent(this, standard_home.class);\n startActivity(intent);\n }",
"@Override\n public void onBackPressed() {\n return;\n }",
"@Override\n public void onBackPressed() {\n return;\n }",
"@Override\n public void onBackPressed() {\n return;\n }",
"@Override\n public void onBackPressed() {\n return;\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\t finish();\n\t}",
"@Override\n public void onBackPressed() {\n\n finish();\n }",
"@Override\n public void backPressed(){\n }",
"@Override\n public void onBackPressed() { }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed() {\n finish();\n }",
"@Override\n public void onBackPressed()\n {\n\n }"
] | [
"0.80102944",
"0.79880154",
"0.79880154",
"0.77794987",
"0.76485294",
"0.75811183",
"0.75811183",
"0.7577976",
"0.7546229",
"0.7539629",
"0.7532181",
"0.75165653",
"0.7468816",
"0.7465272",
"0.7463009",
"0.7416074",
"0.74102736",
"0.7409659",
"0.73987854",
"0.7362818",
"0.7355602",
"0.73312545",
"0.7263323",
"0.7263323",
"0.7259973",
"0.7237392",
"0.7230854",
"0.72276413",
"0.7221522",
"0.721756",
"0.72118616",
"0.7201933",
"0.7201798",
"0.71796125",
"0.71732247",
"0.71719545",
"0.7164032",
"0.71503353",
"0.7130158",
"0.7123953",
"0.71176857",
"0.71176857",
"0.71176857",
"0.71176857",
"0.7114992",
"0.71127075",
"0.71060973",
"0.7102141",
"0.7099111",
"0.7094406",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7089378",
"0.7086831",
"0.70817316",
"0.70808715",
"0.70808715",
"0.70776284",
"0.7077347",
"0.7076266",
"0.70749724",
"0.70729184",
"0.7071679",
"0.7066299",
"0.7066299",
"0.70662194",
"0.70589405",
"0.7054753",
"0.70519984",
"0.70482826",
"0.7047793",
"0.7043897",
"0.7040481",
"0.70320845",
"0.70222694",
"0.70188534",
"0.70173526",
"0.70173526",
"0.70173526",
"0.7014779",
"0.7006718",
"0.7006718",
"0.7006718",
"0.7006718",
"0.7004959",
"0.70049006",
"0.70033175",
"0.7001493",
"0.69923943",
"0.69923943",
"0.69923943",
"0.69923943",
"0.69923943",
"0.69923943",
"0.69923943",
"0.6992112"
] | 0.0 | -1 |
SPEECH TO TEXT MANAGEMENT Called on speak button click | public void speakbutton_clicked(View v) {
startVoiceRecognitionActivity();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void speak() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) ;\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Speak the Item\");\n\n startActivityForResult(intent, SPEECH_REQUEST_CODE);\n\n }",
"@Override\n public void onClick(View v) {\n text_to_speech = set_voice(text_to_speech);\n int len = ar.length;\n for (int i = 0; i < len; i++){\n speak(text_to_speech,ar[i]);\n }\n }",
"public void speak(String text);",
"void playSpeech(String rawText);",
"public String speak(){\n speechOutput.clear();\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Just speak normally into your phone\");\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);\n try {\n startActivityForResult(intent, VOICE_RECOGNITION);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n\n\n return speechResult;\n }",
"private void ConvertTextToSpeech(String voice1) {\n text=voice1;\n //text = et.getText().toString();\n if (text == null || \"\".equals(text)) {\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n } else\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n }",
"private void speak() {\n if(textToSpeech != null && textToSpeech.isSpeaking()) {\n textToSpeech.stop();\n }else{\n textToSpeech = new TextToSpeech(activity, this);\n }\n }",
"public void speakClicked(View v)\n {\n EditText editText = (EditText) findViewById(R.id.inputText);\n\n mTts.speak(editText.getText().toString(),\n TextToSpeech.QUEUE_FLUSH, // Drop all pending entries in the playback queue.\n null,\n null);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n\t\t\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-US\");\n\n\t\t\t\ttry {\n\t\t\t\t\tstartActivityForResult(intent, RESULT_SPEECH);\n\t\t\t\t\tet1.setText(\"\");\n\t\t\t\t} catch (ActivityNotFoundException a) {\n\t\t\t\t\tToast t = Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\"Opps! Your device doesn't support Speech to Text\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t\t\t\t\tt.show();\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}",
"private void convertTextToSpeech(String text) {\n if (null == text || \"\".equals(text)) {\n text = \"Please give some input.\";\n }\n m_tts.speak(text, TextToSpeech.QUEUE_ADD, null);\n }",
"@Override\n\t\t\tpublic void onClick(View v) \n\t\t\t{\n\t\t\t\tISpeechServiceProxy iss = new SpeechServiceProxy() ;\n\t\t\t\tiss.textToSpeech(ServiceAction.TTS_ACTION, ReadTextActivity.this, inputText.getText().toString()) ;\n\t\t\t}",
"private void speak() {\n String s = textArea.getText();\n String s5=\"images\\\\\";\n String s4=\".jpeg\";\n String obj=s5+s+s4;\n ImageIcon ic1=new ImageIcon(obj);\n Image image1=ic1.getImage().getScaledInstance(image.getWidth(),image.getHeight(),Image.SCALE_AREA_AVERAGING);\n ImageIcon icon1=new ImageIcon(image1);\n image.setIcon(icon1);\n int i = textArea.getCaretPosition();\n int k = s.length();\n for (int j = i; j <= k - 1; j++) {\n char c = s.charAt(j);\n String s3 = Character.toString(c);\n s2 = s2 + s3;\n }\n VoiceManager voiceManager = VoiceManager.getInstance();\n helloVoice = voiceManager.getVoice(\"kevin16\");\n helloVoice.allocate();\n helloVoice.speak(s2);\n helloVoice.deallocate();\n playB.setText(\"PLAY\");\n }",
"public void showSpeechInput(View v) {\n\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Say something\");\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(this, \"Speech To Text not supported\", Toast.LENGTH_LONG).show();\n }\n }",
"@Override\n public void onClick(View v) {\n HashMap<String, String> hash = new HashMap<String, String>();\n hash.put(\n TextToSpeech.Engine.KEY_PARAM_STREAM,\n String.valueOf(AudioManager.STREAM_NOTIFICATION));\n textToSpeach.speak(questionText.getText().toString(), TextToSpeech.QUEUE_ADD, hash);\n }",
"private void speakOut() {\n\n tts.speak(\"Hello I am jessie\", TextToSpeech.QUEUE_FLUSH, null);\n tts.setLanguage(Locale.ENGLISH);\n //tts.setPitch(9);\n tts.setSpeechRate(1);\n }",
"private void askSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n \"Hi speak something\");\n speakOut(\"Open Mic\");\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n\n }\n }",
"@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n private void speakWords(String speech) {\n myTTS.speak (speech, TextToSpeech.QUEUE_FLUSH, null,\"1\");\n\n }",
"public void onClick(View v) {\n speechRecognizer.startListening(speechRecognizerIntent);\n Toast.makeText( getActivity(),\"Voice\", Toast.LENGTH_SHORT).show();\n }",
"public void speakButtonClicked(View v)\n {\n startVoiceRecognitionActivity();\n }",
"private void ConvertTextToSpeech() {\n if (properties.get(selectedStateOrCountry) != null) {\n tts.speak(String.format(\"This is %s %s\", selectedStateOrCountry, properties.get(selectedStateOrCountry)),\n TextToSpeech.QUEUE_FLUSH, null);\n\n } else if (countryCapitalMap.get(selectedStateOrCountry) != null) {\n tts.speak(countryCapitalMap.get(selectedStateOrCountry), TextToSpeech.QUEUE_FLUSH, null);\n } else {\n tts.speak(selectedStateOrCountry, TextToSpeech.QUEUE_FLUSH, null);\n }\n }",
"private void display() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n// Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n }",
"private void speakExtractedText(TextToSpeech tts, String fileTextContent){\n Bundle dataMap = new Bundle();\n dataMap.putFloat(TextToSpeech.Engine.KEY_PARAM_PAN, 0f);\n dataMap.putFloat(TextToSpeech.Engine.KEY_PARAM_VOLUME, 1f);\n dataMap.putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_VOICE_CALL);\n\n\n tts.speak(fileTextContent, TextToSpeech.QUEUE_FLUSH, dataMap, FRAGMENT_GENERAL_UTTERANCE_ID);\n }",
"@Override\n public void speak() {\n System.out.println(\"I'm an Aardvark, I make grunting sounds most of the time.\");\n }",
"@Override\n\tpublic void speak() {\n\t\tSystem.out.println(\"tik tik.......\");\n\t}",
"private void displaySpeechRecognizer() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n // Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, Constants.SPEECH_REQUEST_CODE);\n }",
"public void speak(){\n System.out.println(\"Smile and wave boys. Smile and wave.\");\n }",
"public void speakOut(final String text){\n\t\tif (listener != null){\n\t\t\thandler.post(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlistener.speakOut(text.trim());\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"public void speak(String outputSpeak) \n {\n speaker.speaker(outputSpeak);\n }",
"@Override\r\n\tpublic void onClick(View arg0) {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Please Speak Now !\");\r\n\t\tstartActivityForResult(i, check);\r\n\t}",
"@Override\n public void onClick(View v) {\n StringRequest stringRequest = searchNameStringRequest(output.getText().toString(),\"en\",\"ar\");\n\n\n\n // executing the request (adding to queue)\n queue.add(stringRequest);\n\n String toSpeak = output.getText().toString();\n\n t1.speak(toSpeak, TextToSpeech.QUEUE_FLUSH, null);\n }",
"public void speakText(String text) {\n mTTS.setPitch(1);\n mTTS.setSpeechRate(1);\n mTTS.speak(String.format(\"Okay! Searching for %s\", text),\n TextToSpeech.QUEUE_FLUSH, null);\n }",
"@SuppressWarnings(\"unchecked\")\n public void speak(String text) throws JavaLayerException {\n\t\ttry {\n \n //Create a JLayer instance\n AdvancedPlayer player = new AdvancedPlayer(synthesizer.getMP3Data(text));\n player.play();\n \n } catch (IOException e) {\n \n }\n\t\t\n\t}",
"@Override\n public void onInit(int status) {\n\t \n\tif (status == TextToSpeech.SUCCESS) {\n\t\t \n int result = mTts.setLanguage(Locale.US);\n if (result != TextToSpeech.LANG_MISSING_DATA && result != TextToSpeech.LANG_NOT_SUPPORTED) {\n \tspokenText += spokenText+\"\"+spokenText+\"\";\n // mTts.speak(\"Dear sir your class is finished!! Dear sir your class is finished!! Dear sir your class is finished!!\", TextToSpeech.QUEUE_FLUSH, null);\n mTts.speak(spokenText, TextToSpeech.QUEUE_FLUSH, null);\n } \n } \n\t \n}",
"private void sayHello() {\n\n\t\tmTts.speak(translatedText, TextToSpeech.QUEUE_FLUSH, // Drop allpending\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// entries in\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the playback\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// queue.\n\t\t\t\tnull);\n\t}",
"private void speak(String s, String text) {\n if (Utility.getInstance().isOnline(mContext)) {\n try {\n float pitch = (float) 0.62;\n float speed = (float) 0.86;\n textToSpeech.setSpeechRate(speed);\n textToSpeech.setPitch(pitch);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Bundle bundle = new Bundle();\n bundle.putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_MUSIC);\n textToSpeech.speak(s, TextToSpeech.QUEUE_FLUSH, bundle, null);\n textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, bundle, null);\n } else {\n HashMap<String, String> param = new HashMap<>();\n param.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_MUSIC));\n textToSpeech.speak(s, TextToSpeech.QUEUE_FLUSH, param);\n textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, param);\n }\n } catch (Exception ae) {\n ae.printStackTrace();\n }\n } else {\n Toast.makeText(mContext, getString(R.string.please_check_internet), Toast.LENGTH_SHORT).show();\n }\n }",
"private void setTextTospeech() {\n textToSpeech = new TextToSpeech(mContext, new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status == TextToSpeech.SUCCESS) {\n Set<Locale> languages = textToSpeech.getAvailableLanguages();\n if (language.toLowerCase().contains(langaugeCodeEnglish)) {\n int result = textToSpeech.setLanguage(new Locale(\"en\", \"IN\"));\n if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n //Toast.makeText(mContext, result + \" is not supported\", Toast.LENGTH_SHORT).show();\n Log.e(\"Text2SpeechWidget\", result + \" is not supported\");\n }\n } else {\n int result = textToSpeech.setLanguage(new Locale(\"hi\", \"IN\"));\n if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n result = textToSpeech.setLanguage(Locale.forLanguageTag(\"hin\"));\n if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n SharedPreferences sharedPreferences = Utility.getInstance().getSharedPReference(mContext);\n int applicationLoginCount = sharedPreferences.getInt(TTSDIALOGUECOUNT, 1);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n if (!sharedPreferences.getBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true)) {\n editor.putBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true);\n // Utility.getInstance().ttsLanguageDialogue(mContext,getString(R.string.marathi_language_Available_update));\n }\n applicationLoginCount++;\n // editor.putInt(TTSDIALOGUECOUNT, applicationLoginCount);\n editor.commit();\n }\n } else {\n SharedPreferences sharedPreferences = Utility.getInstance().getSharedPReference(mContext);\n int applicationLoginCount = sharedPreferences.getInt(TTSDIALOGUECOUNT, 1);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n if (!sharedPreferences.getBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true)) {\n editor.putBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true);\n // Utility.getInstance().ttsLanguageDialogue(mContext,getString(R.string.marathi_language_Available_update));\n }\n applicationLoginCount++;\n // editor.putInt(TTSDIALOGUECOUNT, applicationLoginCount);\n editor.commit();\n\n // Toast.makeText(mContext, result + \"Language is not supported\", Toast.LENGTH_SHORT).show();\n Log.e(\"Text2SpeechWidget\", result + \"Language is not supported\");\n }\n Log.e(\"Text2SpeechWidget\", result + \" is not supported\");\n } else {\n SharedPreferences sharedPreferences = Utility.getInstance().getSharedPReference(mContext);\n int applicationLoginCount = sharedPreferences.getInt(TTSDIALOGUECOUNT, 1);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n if (!sharedPreferences.getBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true)) {\n editor.putBoolean(LANGUAGEAVAILABILITYFIRSTTIME, true);\n // Utility.getInstance().ttsLanguageDialogue(mContext,getString(R.string.marathi_language_Available_update));\n }\n applicationLoginCount++;\n // editor.putInt(TTSDIALOGUECOUNT, applicationLoginCount);\n editor.commit();\n }\n if (result == TextToSpeech.LANG_NOT_SUPPORTED) {\n showTtsLanuageNSDialog();\n }\n }\n }\n }\n });\n }",
"private void speakOut() {\n\n tts.speak(dialogue, TextToSpeech.QUEUE_FLUSH, null);\n }",
"@Override\n public String speak()\n {\n return \"peep\";\n }",
"private void speakOut(String text) {\n\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode,\n Intent data) {\n if (requestCode == REQ_CODE_SPEECH_INPUT && resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n String spokenText = results.get(0);\n // Do something with spokenText\n convert.setText(spokenText);\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"public void speak(){\n System.out.println(\"Shark bait oooh ha haa!\");\n }",
"private void speakout(String cname) \n{\n\t{t1.speak(cname,TextToSpeech.QUEUE_FLUSH,null);\n\tt1.setLanguage(Locale.ENGLISH);\n\t}\n}",
"public boolean speak(String text) {\n\treturn speak(new FreeTTSSpeakableImpl(text));\n }",
"public void speak() {\r\n\t\tSystem.out.print(\"This Tiger speaks\");\r\n\t}",
"private void listenToSpeech(int returnCode) {\n\t\tIntent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t//indicate package\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());\n\t\t//message to display while listening\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"\");\n\t\t//set speech model\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t//specify number of results to retrieve\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n\t\t//start listening\n\t\tstartActivityForResult(listenIntent, returnCode);\n\n\t}",
"public void sendText(View view)\n {\n String toSay = editText.getText().toString();\n editText.getText().clear();\n findViewById(R.id.main_layout).requestFocus();\n InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n logicController.ConnectToServer(toSay, false);\n //ttsCont.speakThis(toSay);\n //toastWithTimer(toSay, true);\n }",
"@Override\n public void onResult(Hypothesis hypothesis) {\n ((TextView) findViewById(R.id.result_text)).setText(\"\");\n mMicView.setBackgroundResource(R.drawable.background_big_mic);\n if (hypothesis != null) {\n String text = hypothesis.getHypstr();\n makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();\n //mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n\n }\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n txtSpeechInput = (TextView) findViewById(R.id.txtSpeechInput);\n textToSpeech = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status != TextToSpeech.ERROR) {\n textToSpeech.setLanguage(Locale.ENGLISH);\n }\n }\n });\n\n btnSpeak = (ImageButton) findViewById(R.id.btnSpeak);\n btnSpeak.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n promptSpeechInput();\n }\n });\n\n }",
"public void onSpeak(View v)\n\t{\n\t\tstartVoiceRecognitionActivity();\n\t}",
"private void manageSpeechRecognition() {\n\n mRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, Locale.getDefault().getLanguage().trim());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 100);\n\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);\n\n mSongSpeechRecognitionListener = new SongSpeechRecognitionListener(mRippleBackground, mFloatingActionButton);\n\n mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n mSpeechRecognizer.setRecognitionListener(mSongSpeechRecognitionListener);\n\n }",
"@Override\r\n\tpublic void call() {\n\t\tSystem.out.println(\"通过语音打电话\");\r\n\t}",
"private void tts(String str){\n\t\ttxtSpeechInput.setText(str);\n\t\tt1.speak(str , TextToSpeech.QUEUE_FLUSH, null);\n\t\twhile(t1.isSpeaking()){\n\t\t\t;\n\t\t}\n\t}",
"private void initializeTextToSpeech() {\n myTTS = new TextToSpeech(this, new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int i) {\n if(myTTS.getEngines().size() ==0){\n Toast.makeText(MainActivity.this, \"There is no Text to Speech engine on your device\", Toast.LENGTH_LONG).show();\n finish();\n }\n else {\n myTTS.setLanguage(Locale.US);\n speak(\"Hello! Welcome to the workout app\");\n\n }\n }\n });\n }",
"public void speak() {\r\n\t\tSystem.out.print(\"This Goose speaks\");\r\n\t}",
"public void countdown(final int picture_num){\n// t1.speak(\"The background has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please step into the camera view and position yourself so that you are visible fully\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your front view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your front view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your right view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your right view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your back view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your back view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your left view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your left view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"All your images have been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please proceed with confirming your images\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n\n t1.speak(\"Please place your phone at a stable angle to the wall\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please step aside so that the background is captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"The background will be captured in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n t1.speak(\"The background has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please step into the camera view and position yourself so that you are visible fully\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your front view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n //next picture\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your front view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your right view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your right view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your back view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your back view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your left view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your left view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"All your images have been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please proceed with confirming your images\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n\n }\n };\n cdt.start();\n\n }\n };\n cdt.start();\n\n }\n };\n cdt.start();\n\n\n }\n };\n //cdt.start();\n\n\n }\n };\n cdt.start();\n }",
"public void speak() {\r\n\t\tSystem.out.print(\"This animal speaks\");\r\n\t}",
"private void btnSpeaker2ActionPerformed(java.awt.event.ActionEvent evt) {\n txtSpeaker2.setText(Dialog());\n \n }",
"public void makeDecision(String speech , List<WordResult> speechWords) {\r\n\t\tVoiceManager vm =VoiceManager.getInstance();\r\n\t\tVoice voice;\r\n\t\tvoice=vm.getVoice(\"mbrola_us3\");\r\n\t\tvoice.allocate();\r\n\t\tSystem.out.println(speech);\r\n\t\t//System.out.println(speech+\"fdsf\");\r\n\t\t if(speech.equalsIgnoreCase(\"shutdown computer\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\" Shuting down the computer\");\r\n\t\t \tRuntime rm=Runtime.getRuntime();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tProcess proc=rm.exec(\"shutdown -s -t 0\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e)\r\n\t\t\t\t{}\r\n\t\t\t\t\r\n\r\n\t\t \t}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"restart computer\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"restarting the computer\");\r\n\t\t \tRuntime rm=Runtime.getRuntime();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tProcess proc=rm.exec(\"shutdown -r -t 0\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e)\r\n\t\t\t\t{}\r\n\t\t\t\t\r\n\t\t \t}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t }\r\n\t\t \r\n\t\t else if(speech.equalsIgnoreCase(\"who is smart\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"Abhay bhadouriya is smartest person alive in this world\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who is ugly\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"your sister and friends are the most ugliest persons in the world \");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"what is time\"))\r\n\t\t {\r\n\t\t \tDate dm=new Date();\r\n\t\t \tint h=dm.getHours();\r\n\t\t \tint m=dm.getMinutes();\r\n\t\t \tif(h>12)\r\n\t\t \t{\r\n\t\t \t\th=h-12;\r\n\t\t \t}\r\n\t\t \t\r\n\t\t \ttry {voice.speak(\"TIME is\"+h+\"Hour\"+m+\"Minutes\" );}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"say hello \"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"Hello this is your computer\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"please sleep\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"no i don't wont to sleep\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open facebook\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"facebook\");\r\n\t\t \t FUNC.facebook();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open google\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"google\");\r\n\t\t \t FUNC.google();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open youtube\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"youtube\");\r\n\t\t \t FUNC.youtube();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open gmail\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"gmail\");\r\n\t\t \t FUNC.gmail();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"play music\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"music\");\r\n\t\t \t FUNC.pmusic();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"volume up\"))\r\n\t\t {\r\n\t\t \tvoice.speak(\"volume increasing by 10\");\r\n\t\t \t\tvolume.up();\r\n\t\t \t\t\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"volume down\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t\t voice.speak(\"volume decreasing by 10\");\r\n\t \t\tvolume.down();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"show desktop\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"Showing desktop\");\r\n\t\t\t FUNC.desktop();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"how are you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"i'm fine and you \");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"what day is today\"))\r\n\t\t {\r\n\t\t\t Date dd=new Date();\r\n\t\t\t int i=dd.getDay();\r\n\t\t\t\tif(i==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is sunday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is monday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==2)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is tuesday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==3)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is wednesday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==4)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is thursday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==5)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is friday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==6)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is saturday\");\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to right\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.right();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to left\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.left();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to up\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t emotion.up();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to down\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.down();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"select this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.select();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"view its property\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.property();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"view item menu\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.viewmenu();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on mouse by keyboard\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.turnon();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close this window tab\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.close();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"switch window tab\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.switcht();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"ok dude take some rest\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t voice.speak(\"have a nice day\");\r\n\t\t\t voice.speak(\"i'm very lucky to have a master like you sir \");\r\n\t\t\t voice.speak(\"good night my suprier great master\");\r\n\t\t\t System.exit(0);\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn off wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on bluetooth\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t try{\r\n\t \t\t Process p ;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c fsquirt\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the notepad\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start notepad\");\r\n\t \t\t // System.out.println(\"inside\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t } else if(speech.equalsIgnoreCase(\"close the notepad\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im notepad.exe /f\");\r\n\t \t\t // System.out.println(\"inside\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the command\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t\t\tProcess p;\r\n\t \t\t\t\tp = Runtime.getRuntime().exec(\"cmd /c start cmd\");\t\t\t\t\r\n\t \t\t\t\t}catch(Exception er)\r\n\t \t\t\t\t{}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the command\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im cmd.exe /f\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the browser\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start chrome.exe\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the browser\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im chrome.exe /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the control panel\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c control\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the control panel\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c control taskkill /im control /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the paint\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start mspaint\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the paint\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im mspaint.exe /f\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the task manager\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start taskmgr.exe\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the task manager\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t \tp = Runtime.getRuntime().exec(\"cmd /c start taskkill /im taskmgr.exe /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open power option\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c powercfg.cpl\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open windows security center\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c wscui.cpl\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"copy this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok item is copied\");\r\n\t\t\t basiccontrolls.copy();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"paste here selected item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"item is pasted\");\r\n\t\t\t basiccontrolls.paste();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"cut this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok item is cut\");\r\n\t\t\t basiccontrolls.cut();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"go back\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok going to previous page\");\r\n\t\t\t basiccontrolls.back();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"show me my beautiful face\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"you look like a donkey\");\r\n\t\t\t basiccontrolls.camera();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who the hell are you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"hello\");\r\n\t\t\t voice.speak(\"i am computer \");\r\n\t\t\t voice.speak(\"here i'm assist by you \");\r\n\t\t\t voice.speak(\"i will do anything what ever you told me todo and \"+\" \"+\" what instruction are feeded in my dictionary\");\r\n\t\t\t voice.speak(\"Thank you for asking \");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who loves you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"no one loves me \");\r\n\t\t\t voice.speak(\"except my charger \");\r\n\t\t\t voice.speak(\"but more impoertantly i looks far handsome than you \");\r\n\t\t\t voice.speak(\"you peace of shit \");\r\n\t\t\t voice.speak(\"your face is look like a monkey\");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"do you like engineering\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"no\");\r\n\t\t\t voice.speak(\"I hate engineering\");\r\n\t\t\t voice.speak(\"you ruined my life \");\r\n\t\t }\r\n\t\t/* else if(speech.equalsIgnoreCase(\"turn off wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }*/\r\n\r\n\t}",
"public interface Text2Speech {\n\t\n\t/**\n\t * Supported formats.\n\t */\n\tenum OutputFormat {\n\t\t/**\n\t\t * MP3 format.\n\t\t */\n\t\tMP3,\n\t\t/**\n\t\t * Ogg-vorbis format.\n\t\t */\n\t\tOGG\n\t}\n\t\n\t/**\n\t * Produce MP3 with specified phrase.\n\t * \n\t * @param phrase Some sentence.\n\t * @return MP3 stream (may be network bound, close afterwards)\n\t */\n\tInputStream synthesize(String phrase, OutputFormat fmt) throws IOException;\n}",
"private void speak(String text, int queueMode, ArrayList<String> params) {\n if (queueMode == 0) {\n stop();\n }\n mSpeechQueue.add(new SpeechItem(text, params, SpeechItem.TEXT));\n if (!mIsSpeaking) {\n processSpeechQueue();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"us-US\");\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"@FXML\r\n void btnspeechClick(MouseEvent event) {\n \t\r\n \t setService();\r\n setHeader();\r\n \r\n System.out.println(service);\r\n \r\n InputStream stream = service.synthesize(\r\n taContent.getText(), // 변경할 문자열\r\n \tVoice.EN_LISA, // voice 선택\r\n \tAudioFormat.WAV // 출력할 오디오 포멧 형식 \r\n ).execute();\r\n // 음성데이터를 저장하기\r\n try {\r\n InputStream in = WaveUtils.reWriteWaveHeader(stream);\r\n //WaveUtils.\r\n \r\n OutputStream os = new FileOutputStream(\"d:/d_other/AIData/test12.wav\");\r\n \r\n byte[] tmp = new byte[1024];\r\n int len = 0;\r\n \r\n while((len = in.read(tmp)) != -1) {\r\n os.write(tmp, 0, len);\r\n }\r\n os.flush();\r\n \r\n os.close();\r\n in.close();\r\n stream.close();\r\n \r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n \r\n music();\r\n\r\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"public void listen(View v)\r\n {\r\n // set up an intent to ask for speech-to-text, and connect it back to\r\n // this Activity\r\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\r\n intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());\r\n\r\n // Give text to display, and a hint about the language model\r\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Tell the robot what to do!\");\r\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\r\n\r\n // How many results to return? They will be sorted by confidence\r\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);\r\n\r\n // Start the activity\r\n startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);\r\n }",
"@Override\n public String speak()\n {\n return \"Neigh\";\n }",
"public void onTick(long millisUntilFinished) {\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }",
"public void showTextView(String message, int type) {\n\n switch (type) {\n case USER:\n layout = getUserLayout();\n TextView tv = layout.findViewById(R.id.chatMsg);\n\n tv.setText(message);\n\n layout.setFocusableInTouchMode(true);\n chatLayout.addView(layout); // move focus to text view to automatically make it scroll up if softfocus\n layout.requestFocus();\n break;\n case BOT:\n\n\n if (defaultLanguage.equals(\"au\")) {\n\n //languageIdentifier.identifyLanguage(msg).addOnSuccessListener(new OnSuccessListener<String>() {\n\n layout = getBotLayout();\n\n languageIdentifier.identifyLanguage(message).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String languageCode) {\n\n\n if (languageCode != \"und\" && languageCode.equals(\"zh\")) {\n\n\n chineseEnglishTranslator.downloadModelIfNeeded(chineseToEnglishConditions).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n\n chineseEnglishTranslator.translate(message).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String s) {\n\n TextView tv1 = layout.findViewById(R.id.chatMsg);\n tv1.setText(s);\n layout.setFocusableInTouchMode(true);\n chatLayout.addView(layout); // move focus to text view to automatically make it scroll up if softfocus\n layout.requestFocus();\n\n mtts = new TextToSpeech(getActivity(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status == TextToSpeech.SUCCESS) {\n int result = 0;\n result = mtts.setLanguage(Locale.ENGLISH);\n\n float pitch = 1.0f;\n if (pitch < 0.1) pitch = 0.1f;\n float speed = 1.0f;\n mtts.setPitch(pitch);\n mtts.setSpeechRate(speed);\n\n mtts.speak(s, TextToSpeech.QUEUE_FLUSH, null);\n //mtts.speak(\"\",TextToSpeech.QUEUE_FLUSH,null,\"\");\n\n\n }\n }\n });\n\n }\n });\n\n }\n });\n\n\n } else {\n\n TextView tv1 = layout.findViewById(R.id.chatMsg);\n tv1.setText(message);\n layout.setFocusableInTouchMode(true);\n chatLayout.addView(layout); // move focus to text view to automatically make it scroll up if softfocus\n layout.requestFocus();\n\n mtts = new TextToSpeech(getActivity(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status == TextToSpeech.SUCCESS) {\n int result = 0;\n result = mtts.setLanguage(Locale.ENGLISH);\n\n float pitch = 1.0f;\n if (pitch < 0.1) pitch = 0.1f;\n float speed = 1.0f;\n mtts.setPitch(pitch);\n mtts.setSpeechRate(speed);\n\n mtts.speak(message, TextToSpeech.QUEUE_FLUSH, null);\n //mtts.speak(\"\",TextToSpeech.QUEUE_FLUSH,null,\"\");\n\n\n }\n }\n });\n\n }\n }\n });\n }\n else {\n mtts = new TextToSpeech(getActivity(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status == TextToSpeech.SUCCESS) {\n int result = mtts.setLanguage(Locale.CHINA);\n\n if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n Log.e(\"TTs\", \"Language Not supported\");\n } else {\n float pitch = 1.0f;\n if (pitch < 0.1) pitch = 0.1f;\n float speed = 1.0f;\n mtts.setPitch(pitch);\n mtts.setSpeechRate(speed);\n\n if (defaultLanguage.equals(\"cn\")) {\n\n englishChineseTranslator.translate(message).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String s) {\n\n String botResponseArray [] = s.split(\"\\\\|\\\\|\");\n for(int i=0; i<botResponseArray.length;i++){\n\n layout = getBotLayout();\n TextView tv1 = layout.findViewById(R.id.chatMsg);\n tv1.setText(botResponseArray[i]);\n mtts.speak(botResponseArray[i], TextToSpeech.QUEUE_FLUSH, null);\n\n layout.setFocusableInTouchMode(true);\n chatLayout.addView(layout); // move focus to text view to automatically make it scroll up if softfocus\n layout.requestFocus();\n }\n }\n });\n\n }\n\n }\n } else {\n Log.e(\"TTs\", \"Language Not supported\");\n }\n }\n });\n }\n\n\n break;\n default:\n layout = getBotLayout();\n break;\n }\n queryEditText.requestFocus(); // change focus back to edit text to continue typing\n }",
"@Override\n public void onDone(String utteranceId)\n {\n String[] positionString = utteranceId.split(\"_\");\n int paragraph = Integer.parseInt(positionString[0]);\n int sentence = Integer.parseInt(positionString[1]);\n htmlConverter.paragraphs[paragraph].sentences[sentence].speechReady = true;\n }",
"@Override\n public int playTTSText(String speech, int bPreempt) {\n Log.e(\"test_TTS\", \"playTTSText\" + \"_\" + speech + \"_\" + bPreempt);\n\n return 1;\n }",
"@Override\n public int playTTSText(String speech, int bPreempt) {\n Log.e(\"test_TTS\", \"playTTSText\" + \"_\" + speech + \"_\" + bPreempt);\n\n return 1;\n }",
"public void speak(){\n System.out.println(\"Hi my name is \" + name + \".\\n\" +\n \"I am \" + age + \"years old and \" + height + \" feet tall.\");\n }",
"void onTranslation(Sentence sentence);",
"private void promptSpeechInput() {\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tRecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n\t\t\t\tgetString(R.string.speech_prompt));\n\t\ttry {\n\t\t\tstartActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n\t\t} catch (ActivityNotFoundException a) {\n\t\t\tToast.makeText(getActivity(),\n\t\t\t\t\tgetString(R.string.speech_not_supported),\n\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t}\n\t}",
"void speak() {\n\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tSystem.out.println(\"My name is \" + name + \" and I am \" + age + \" years old.\");\n\n\t\t}\n\t}",
"public void soundPressed() {\n // display\n TextLCD.print(SOUND);\n // sound\n Sound.beep();\n }",
"private void speakout(String cname) \n\t\t\t{\n\t\t\t\t{t1.speak(cname,TextToSpeech.QUEUE_FLUSH,null);\n\t\t\t\tt1.setLanguage(Locale.ENGLISH);\n\t\t\t\t}\n\t\t\t}",
"@Override\n public void onBeginningOfSpeech() {\n Log.i(\"SRL\", \"onBeginningOfSpeech\");\n }",
"public void ResultVoiceIn(EventVoice event);",
"public String interact() {\n return sound;\n }",
"@Override\n\tpublic void canSpeak() {\n\t\t\n\t}",
"@Override\n public void speak() {\n System.out.printf(\"i'm %s. I am a DINOSAURRRRR....!\\n\",this.name);\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n switch (requestCode) {\n case RESULT_SPEECH: {\n if (resultCode == RESULT_OK && null != data) {\n\n ArrayList<String> text = data\n .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n\n txtText.setText(text.get(0));\n\n s = text.get(0);\n s = s.toLowerCase();\n\n switch (s) {\n case \"excited\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Fire);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIRE\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"angry\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Canvas);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"CANVAS\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"relax\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Firefly);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIREFLY\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"crazy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Firework);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIREWORK\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"sleepy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Hourglass);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"HOURGLASS\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"thoughtful\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Rain);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"RAIN\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"jazzy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Ripple);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"RIPPLE\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"sparkle\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Star);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"STAR\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"dance\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Traffic);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"TRAFFIC\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"do something\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Wave);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"WAVE\", Toast.LENGTH_SHORT).show();\n break;\n }\n }\n break;\n }\n\n }\n }\n }",
"static void speak(String words) {\n\t\ttry {\n\t\t\tRuntime.getRuntime().exec(\"say \" + words).waitFor();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\r\n public String speak() {\r\n String word = \"\";\r\n Time.getInstance().time += 1;\r\n if (Time.getInstance().time == 1) {\r\n word = \"One day Neznaika decided to become an artist.\";\r\n }\r\n if (Time.getInstance().time == 101) {\r\n word = \"This story happened once day with Neznaika.\";\r\n }\r\n if (Time.getInstance().time == 201) {\r\n word = \"One day Neznaika wanted to become a musician.\";\r\n }\r\n if (Time.getInstance().time == 401) {\r\n word = \"One day Neznaika wanted to become a poet.\";\r\n }\r\n System.out.println(word);\r\n return word;\r\n }",
"@Override\n public void onResults(Bundle results) {\n recognizedSpeech = (TextView) findViewById(R.id.recognizedSpeech);\n Log.i(\"SRL\", \"onResults\");\n ArrayList<String> matches = results\n .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);\n String text = \"\";\n for (String result : matches)\n text += result + \"\\n\";\n recognizedSpeech.setText(text);\n\n if(!(recognizedSpeech.getText().toString().contains(\"yes\")) &&\n !(recognizedSpeech.getText().toString().contains(\"no\"))){\n convertTextToSpeech(\"A valid response was not detected, please try again.\");\n\n while (m_tts.isSpeaking()) {\n speech = null;\n }\n\n speech = SpeechRecognizer.createSpeechRecognizer(this);\n speech.setRecognitionListener(this);\n speech.startListening(getIntent());\n\n } else if(recognizedSpeech.getText().toString().contains(\"yes\") &&\n recognizedSpeech.getText().toString().contains(\"no\")){\n convertTextToSpeech(\"Both yes and no were detected, please only specify one decision\");\n\n while (m_tts.isSpeaking()) {\n speech = null;\n }\n\n speech = SpeechRecognizer.createSpeechRecognizer(this);\n speech.setRecognitionListener(this);\n speech.startListening(getIntent());\n\n } else if (recognizedSpeech.getText().toString().contains(\"yes\")) {\n PropertySquare square = (PropertySquare) (m_board.getSquare(\n players.get(m_currentTurn).getCurrentPosition()));\n square.setOwnedBy(players.get(m_currentTurn).getName());\n convertTextToSpeech(\"You now own\" + square.getName());\n Log.d(\"buyProperty yes\", square.getOwnedBy());\n\n if (m_manageFunds) {\n players.get(m_currentTurn).subtractMoney(square.getPrice());\n Log.d(\"buyProperty yes\", players.get(m_currentTurn).getName() +\n String.valueOf(players.get(m_currentTurn).getMoney()));\n funds.setText(String.valueOf(players.get(m_currentTurn).getMoney()));\n }\n nextTurnRoll();\n } else if (recognizedSpeech.getText().toString().contains(\"no\")) {\n nextTurnRoll();\n }\n }",
"public void startSpeechRecognition() {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-GB\");\n\t\ttry {\n\t\t\tstartActivityForResult(i, REQUEST_OK);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}",
"public void speak()\n\t {\n\t \tSystem.out.printf(\"%s chants: Four legs good, Two legs BETTER\\n\", this.getName());\n\t }",
"void start() {\n\t\t\n\t\ttts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n\t\t\t@Override\n\t\t\tpublic void onInit(int status) {\n\t\t\t\tif (status != TextToSpeech.ERROR) {\n\t\t\t\t\ttts.setLanguage(Locale.KOREAN);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\trecognizerIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"ko-KR\");\n\t\t\n\t\tmRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n\t\tmRecognizer.setRecognitionListener(recognitionListener);\n\t\t\n\t\t\n\t\tV_button.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tif (AL_keywordSelected.size() == 0)\n\t\t\t\t\tstartVoice();\n\t\t\t\telse {\n\t\t\t\t\tString str = \"\";\n\t\t\t\t\t\n\t\t\t\t\tfor (String s : AL_keywordSelected)\n\t\t\t\t\t\tstr += s + \" \";\n\t\t\t\t\t\n\t\t\t\t\tsendMsg(str);\n\t\t\t\t\tinitKeyword();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tfirestore.collection(\"command\")\n\t\t\t.addSnapshotListener(new EventListener<QuerySnapshot>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onEvent(@Nullable QuerySnapshot snapshots, @Nullable FirebaseFirestoreException e) {\n\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\tlog(\"listen:error\" + e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor (DocumentChange dc : snapshots.getDocumentChanges()) {\n\t\t\t\t\t\tQueryDocumentSnapshot document = dc.getDocument();\n\t\t\t\t\t\t\n\t\t\t\t\t\tString key = document.getId();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\tswitch (dc.getType()) {\n\t\t\t\t\t\t\t\tcase ADDED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"New: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase MODIFIED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Modified: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tCommand oldCommand = mapData.get(key);\n\t\t\t\t\t\t\t\t\tif (command.responseTimestamp.getSeconds() != oldCommand.responseTimestamp.getSeconds()) {\n\t\t\t\t\t\t\t\t\t\tfor (String waitingKey : waitingKeys) {\n\t\t\t\t\t\t\t\t\t\t\tif (waitingKey.equals(key)) {\n\t\t\t\t\t\t\t\t\t\t\t\taddOutputMessage(command.response);\n\t\t\t\t\t\t\t\t\t\t\t\twaitingKeys.remove(key);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase REMOVED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Removed: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.remove(key);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\tlog(\"error: \" + key);\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t}",
"@Override\n\tpublic String speak() {\n\t\treturn null;\n\t}",
"public void onBeginningOfSpeech() {\n Log.i(TAG, \"onBeginningOfSpeech\");\n }",
"private void setClickPuchaseElements(ImageView imageviewMic, EditText editext, String textForSpeech, int numberOrString) {\n imageviewMic.setOnClickListener(v -> {\n if (editext != null) {\n editext.setError(null);\n }\n speak(textForSpeech, \"\");\n new Handler().postDelayed(() -> {\n if (editext != null) {\n editext.requestFocus();\n }\n speechToTextFuncVoiceForPurchase(mContext, editext, numberOrString, imageviewMic, 3);\n }, 2000);\n });\n }",
"public void onClick(View v) {\n Toast.makeText( getActivity(),\"Voice Recognition\", Toast.LENGTH_SHORT).show();\n }",
"public void textbutton_clicked(View v) {\n \t\tIntent intent = new Intent(this, TextcraftActivity.class);\n \t\t\n \t\tBundle bundle =new Bundle();\n \t\tbundle.putStringArray(\"test bundle\", new String[]{\"Hello\", \"World\"});\n \t\t\n \t\tintent.putExtras(bundle);\n \t\t\n \t\t// We use startActivityForResult so that when the textcraft activity finishes, we can detect\n \t\t// WHAT finished and get back specialized results\n\t\tstartActivityForResult(intent, TEXTCRAFT_REQCODE);\n\t\toverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n \t}",
"private boolean convert(String text,String directory,String fileName) {\r\n\t\t\r\n\t\tif(!text.isEmpty()) {\t\t\t\r\n\t\t\tFile file = new File(directory,fileName);\r\n\t\t\t\r\n\t\t\t// create mp3 file with this weather announcement\r\n\t\t\tlog.fine(\"text to speech conversion: text=\"+text+\" filename=\"+file);\r\n\t\t\t\r\n\t\t\t// translate into mp3 stream\r\n\t\t\ttry{\r\n\t text=java.net.URLEncoder.encode(text, \"UTF-8\");\r\n\t //URL url = new URL(\"http://translate.google.com/translate_tts?tl=de&ie=UTF-8&q=\"+text+\"&total=1&idx=0&client=alarmpi\");\r\n\t \r\n\t Map<String, String> requestParams = new HashMap<>();\r\n\t requestParams.put(\"key\", \"f5d762f987f34397b350af6563ffb818\");\r\n\t requestParams.put(\"hl\", \"de-de\");\r\n\t requestParams.put(\"c\", \"MP3\");\r\n\t requestParams.put(\"src\", text);\r\n\t \r\n\t\t\t\tString encodedURL = requestParams.keySet().stream()\r\n\t \t .map(key -> key + \"=\" + requestParams.get(key))\r\n\t \t .collect(Collectors.joining(\"&\", \"http://api.voicerss.org?\", \"\"));\r\n\t \r\n\t URL url = new URL(encodedURL);\r\n\t log.fine(\"URL=\"+encodedURL);\r\n\t \r\n\t HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\r\n\t urlConn.addRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36\");\r\n\t InputStream audioSrc = urlConn.getInputStream();\r\n\t DataInputStream read = new DataInputStream(audioSrc);\r\n\t OutputStream outstream = new FileOutputStream(file);\r\n\t byte[] buffer = new byte[1024];\r\n\t int len;\r\n\t int totalLength = 0;\r\n\t while ((len = read.read(buffer)) > 0) {\r\n\t \toutstream.write(buffer, 0, len);\r\n\t \ttotalLength += len;\r\n\t }\r\n\t outstream.close();\r\n\t log.fine(\"text2speech byteount=\"+totalLength);\r\n\t \r\n\t if(totalLength<1024) {\r\n\t \t// this indicates a problem...\r\n\t \tlog.severe(\"text2speech conversion returns less than 1k data\");\r\n\t }\r\n\t \r\n\t \t\t// update mpd database\r\n\t SoundControl.getSoundControl().update();\r\n\t \r\n\t return true;\r\n\t\t\t} catch(IOException e){\r\n\t\t\t\tlog.severe(\"Exception in text to speech conversion: \"+e.getMessage());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlog.warning(\"Text to speech conversion called with empty text\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private void startVoiceRecognitionActivity() {\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"What food are you stocking right now?\");\n\t\tstartActivityForResult(intent, SPEECH_REQCODE);\n\t}",
"public interface TextSpeakLogicInterface {\n\n public void speakOut(String text);\n public void stopSpeak();\n\n}",
"public static void speak(Context context, final String text) {\n Log.d(TAG, \"Speak : \" + text);\n if (mTTSEngine == null) {\n mTTSEngine = new TextToSpeech(context, new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int i) {\n if (i == TextToSpeech.SUCCESS) {\n mTTSEngine.setLanguage(Locale.US);\n mTTSEngine.setPitch(1f);\n mTTSEngine.setSpeechRate(1f);\n\n mTTSEngine.speak(text, TextToSpeech.QUEUE_ADD, null, UTTERANCE_ID);\n } else {\n mTTSEngine = null;\n }\n }\n });\n } else {\n mTTSEngine.speak(text, TextToSpeech.QUEUE_ADD, null, UTTERANCE_ID);\n }\n }"
] | [
"0.7930254",
"0.7766785",
"0.7662368",
"0.76377314",
"0.7530518",
"0.7411059",
"0.74086446",
"0.7322264",
"0.7290422",
"0.7229994",
"0.7174413",
"0.71493006",
"0.7108251",
"0.7071239",
"0.7065831",
"0.70618486",
"0.7060889",
"0.7045034",
"0.7044391",
"0.70091635",
"0.70087236",
"0.68705326",
"0.68137735",
"0.6813756",
"0.6788617",
"0.6786899",
"0.6783896",
"0.67777663",
"0.6753371",
"0.67477643",
"0.67237395",
"0.67196786",
"0.67162097",
"0.6710328",
"0.66990036",
"0.66952646",
"0.66674197",
"0.6652901",
"0.6631115",
"0.6631046",
"0.66001195",
"0.65928394",
"0.65912163",
"0.6587758",
"0.65435225",
"0.6536108",
"0.6524017",
"0.6518502",
"0.65025485",
"0.6459958",
"0.6440083",
"0.6402116",
"0.63993806",
"0.6390205",
"0.6376733",
"0.63651735",
"0.6365144",
"0.63363117",
"0.63338023",
"0.6326258",
"0.6321537",
"0.63171506",
"0.63142604",
"0.63142604",
"0.63142604",
"0.63142604",
"0.62936026",
"0.62935233",
"0.6285187",
"0.62824804",
"0.6278988",
"0.6270607",
"0.6270607",
"0.6265591",
"0.62509704",
"0.62417185",
"0.6238958",
"0.6230972",
"0.6219584",
"0.621953",
"0.6210553",
"0.62090105",
"0.6190189",
"0.619014",
"0.6186062",
"0.6177076",
"0.61687595",
"0.6153611",
"0.61390686",
"0.61230356",
"0.6116003",
"0.6110236",
"0.6107329",
"0.61071736",
"0.61056745",
"0.6093395",
"0.6092629",
"0.6085746",
"0.6084431",
"0.60761774"
] | 0.6612214 | 40 |
Fire intent to start voice recognition | private void startVoiceRecognitionActivity() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "What food are you stocking right now?");
startActivityForResult(intent, SPEECH_REQCODE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void startVoiceRecognitionActivity()\n {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Voice recognition Demo...\");\n startActivityForResult(intent, REQUEST_CODE);\n }",
"private void startVoiceRecognitionActivity()\n\t{\n\t\tSystem.out.println(\"Starting activity lel\");\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tRecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Voice recognition Demo...\");\n\t\tstartActivityForResult(intent, VOICE_REQUEST_CODE);\n\t}",
"private void startVoiceRecognitionActivity() {\n\t\t// Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t// RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n\t\t// \"Diga o valor do produto\");\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, \"pt-BR\");\n\t\t// // intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,\n\t\t// \"en-US\");\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE,\n\t\t// true);\n\t\t// startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);\n\t\tUtils.startVoiceRecognitionActivity(this, Utils.nomeProdutoMessage);\n\t}",
"public void startSpeechRecognition() {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-GB\");\n\t\ttry {\n\t\t\tstartActivityForResult(i, REQUEST_OK);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}",
"public void onClick(View v) {\n speechRecognizer.startListening(speechRecognizerIntent);\n Toast.makeText( getActivity(),\"Voice\", Toast.LENGTH_SHORT).show();\n }",
"public void startVoiceRecognition() {\n startVoiceRecognition(null);\n }",
"public void speakButtonClicked(View v)\n {\n startVoiceRecognitionActivity();\n }",
"private void speak() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) ;\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Speak the Item\");\n\n startActivityForResult(intent, SPEECH_REQUEST_CODE);\n\n }",
"public abstract void startVoiceRecognition(String language);",
"public String speak(){\n speechOutput.clear();\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Just speak normally into your phone\");\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);\n try {\n startActivityForResult(intent, VOICE_RECOGNITION);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n\n\n return speechResult;\n }",
"public void listen(View v)\r\n {\r\n // set up an intent to ask for speech-to-text, and connect it back to\r\n // this Activity\r\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\r\n intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());\r\n\r\n // Give text to display, and a hint about the language model\r\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Tell the robot what to do!\");\r\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\r\n\r\n // How many results to return? They will be sorted by confidence\r\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);\r\n\r\n // Start the activity\r\n startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);\r\n }",
"public void speakbutton_clicked(View v) {\n\t\tstartVoiceRecognitionActivity();\n\t}",
"private void askSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n \"Hi speak something\");\n speakOut(\"Open Mic\");\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n\n }\n }",
"public void onSpeak(View v)\n\t{\n\t\tstartVoiceRecognitionActivity();\n\t}",
"private void listenToSpeech(int returnCode) {\n\t\tIntent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t//indicate package\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());\n\t\t//message to display while listening\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"\");\n\t\t//set speech model\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t//specify number of results to retrieve\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n\t\t//start listening\n\t\tstartActivityForResult(listenIntent, returnCode);\n\n\t}",
"private void loadSpeechActivity() {\n PackageManager pm = getPackageManager();\n List<ResolveInfo> activities = pm.queryIntentActivities(\n new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);\n if (activities.size() == 0)\n {\n voiceSupport=0;\n }\n\t\t\n\t}",
"public void showSpeechInput(View v) {\n\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Say something\");\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(this, \"Speech To Text not supported\", Toast.LENGTH_LONG).show();\n }\n }",
"private void display() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n// Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == SystemData.VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\n final ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n if (matches.size() > 0) {\n text = matches.get(0);\n callContactByName();\n selectFunctionality();\n }\n } else if (requestCode == MY_TTS_CHECK_CODE) {\n if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {\n TextToSpeechUtility.setupTextToSpeech(this);\n } else {\n Intent installIntent = new Intent();\n installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);\n startActivity(installIntent);\n }\n\n }\n }",
"public void enterRealTimeRecognitionMode(View view) {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }",
"@VisibleForTesting\n public boolean startVoiceRecognition(byte[] address) {\n return startVoiceRecognitionNative(address);\n }",
"private void displaySpeechRecognizer() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n // Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, Constants.SPEECH_REQUEST_CODE);\n }",
"public static void launchVoiceSearch(Context context) {\n Intent intent = new Intent(Intent.ACTION_SEARCH_LONG_PRESS);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }",
"public void startVoiceRecognition(String language) {\n if (mTrigger != null) {\n mTrigger.startVoiceRecognition(language);\n }\n }",
"private void manageSpeechRecognition() {\n\n mRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, Locale.getDefault().getLanguage().trim());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 100);\n\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);\n\n mSongSpeechRecognitionListener = new SongSpeechRecognitionListener(mRippleBackground, mFloatingActionButton);\n\n mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n mSpeechRecognizer.setRecognitionListener(mSongSpeechRecognitionListener);\n\n }",
"@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\r\n {\r\n if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\r\n // go through the results, dump them all to a TextView\r\n ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\r\n String res = matches.get(0);\r\n if (res.contains(\"dance\")) {\r\n speak(\"Did you say dance? That robot over there likes to dance... should I play some music for it?\");\r\n }\r\n else if (res.contains(\"your name\")) {\r\n speak(\"My name is \" + prefs.getString(PREFS_NAME, \"Mrs. Robot\"));\r\n }\r\n else if (res.contains(\"do you like first grade\")) {\r\n speak(\"I love first grade. Reading and Writing and Math are some of my favorites!\");\r\n }\r\n else if (res.contains(\"do you like kindergarten\")) {\r\n speak(\"I think kindergarten is great. I especially love kid writing!\");\r\n }\r\n else if (res.contains(\"what do you know\")) {\r\n speak(\"I don't know very much. Robots aren't as smart as kids.\");\r\n }\r\n else {\r\n speak(\"It sounded like you said \" + res + \". I don't know what that means\");\r\n }\r\n }\r\n else if (requestCode == VOICE_RECOGNITION_REQUEST_CODE) {\r\n speak(\"I didn't understand that... please try again\");\r\n }\r\n super.onActivityResult(requestCode, resultCode, data);\r\n }",
"private void broadcastVoiceCommandAction() {\n\t\tVoiceCommandStartIntent.putExtra(\"command\", mApplications.get(CurIndex).title);\r\n\t\tcontext.sendBroadcast(VoiceCommandStartIntent);\r\n\t}",
"@Override\r\n\tpublic void onClick(View arg0) {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Please Speak Now !\");\r\n\t\tstartActivityForResult(i, check);\r\n\t}",
"private void LogRecognitionStart() {\n String recoSource;\n if (this.getUseMicrophone()) {\n recoSource = \"microphone\";\n } else if (this.getMode() == SpeechRecognitionMode.ShortPhrase) {\n recoSource = \"short wav file\";\n } else {\n recoSource = \"long wav file\";\n }\n\n this.WriteLine(\"\\n--- Start speech recognition using \" + recoSource + \" with \" + this.getMode() + \" mode in \" + this.getDefaultLocale() + \" language ----\\n\\n\");\n }",
"void start() {\n\t\t\n\t\ttts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n\t\t\t@Override\n\t\t\tpublic void onInit(int status) {\n\t\t\t\tif (status != TextToSpeech.ERROR) {\n\t\t\t\t\ttts.setLanguage(Locale.KOREAN);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\trecognizerIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"ko-KR\");\n\t\t\n\t\tmRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n\t\tmRecognizer.setRecognitionListener(recognitionListener);\n\t\t\n\t\t\n\t\tV_button.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tif (AL_keywordSelected.size() == 0)\n\t\t\t\t\tstartVoice();\n\t\t\t\telse {\n\t\t\t\t\tString str = \"\";\n\t\t\t\t\t\n\t\t\t\t\tfor (String s : AL_keywordSelected)\n\t\t\t\t\t\tstr += s + \" \";\n\t\t\t\t\t\n\t\t\t\t\tsendMsg(str);\n\t\t\t\t\tinitKeyword();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tfirestore.collection(\"command\")\n\t\t\t.addSnapshotListener(new EventListener<QuerySnapshot>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onEvent(@Nullable QuerySnapshot snapshots, @Nullable FirebaseFirestoreException e) {\n\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\tlog(\"listen:error\" + e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor (DocumentChange dc : snapshots.getDocumentChanges()) {\n\t\t\t\t\t\tQueryDocumentSnapshot document = dc.getDocument();\n\t\t\t\t\t\t\n\t\t\t\t\t\tString key = document.getId();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\tswitch (dc.getType()) {\n\t\t\t\t\t\t\t\tcase ADDED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"New: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase MODIFIED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Modified: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tCommand oldCommand = mapData.get(key);\n\t\t\t\t\t\t\t\t\tif (command.responseTimestamp.getSeconds() != oldCommand.responseTimestamp.getSeconds()) {\n\t\t\t\t\t\t\t\t\t\tfor (String waitingKey : waitingKeys) {\n\t\t\t\t\t\t\t\t\t\t\tif (waitingKey.equals(key)) {\n\t\t\t\t\t\t\t\t\t\t\t\taddOutputMessage(command.response);\n\t\t\t\t\t\t\t\t\t\t\t\twaitingKeys.remove(key);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase REMOVED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Removed: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.remove(key);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\tlog(\"error: \" + key);\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t}",
"public void onClick(View v) {\n\t\tif (v.getId() == R.id.btn_speak) {\n\t\t\tstartVoiceRecognitionActivity();\n\t\t}\n\t}",
"public void recordVoice() {\n\t\t\n\t\t//String command = \"ffmpeg -f alsa -i hw:0 -t 2 -acodec pcm_s16le -ar 16000 -ac 1 foo.wav\"\n\t\tString command = \"arecord -d 2 -r 22050 -c 1 -i -t wav -f s16_LE foo.wav\";\n\t\t\n\t\tProcessBuilder pb = new ProcessBuilder(\"bash\" , \"-c\" , command );\n\t\ttry {\n\t\t\t\n\t\t\tProcess recordProcess = pb.start();\n\t\t\t\n\t\t\trecordProcess.waitFor();\n\t\t\t\n\t\t\trecordProcess.destroy();\n\t\n\t\t\t\n\t\t}catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t\t\n\t\t}catch (InterruptedException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\t\n\t}",
"private void recognize() {\n //Setup our Reco transaction options.\n Transaction.Options options = new Transaction.Options();\n options.setDetection(resourceIDToDetectionType(R.id.long_endpoint));\n options.setLanguage(new Language(\"eng-USA\"));\n options.setEarcons(startEarcon, stopEarcon, errorEarcon, null);\n\n //Add properties to appServerData for use with custom service. Leave empty for use with NLU.\n JSONObject appServerData = new JSONObject();\n //Start listening\n recoTransaction = speechSession.recognizeWithService(\"M10253_A3221\", appServerData, options, recoListener);\n }",
"private View.OnClickListener onVoiceSearchButtonClick() {\n return new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n try {\n if (canRecognizeSpeechInput()) {\n final Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n // Specify the calling package to identify your application\n intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass()\n .getPackage().getName());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n \"Say a Make, Model, Stock Number, or VIN\");\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);\n\n // Specify how many results you want to receive. The results will be sorted\n // where the first result is the one with higher confidence.\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);\n\n getParentFragment().startActivityForResult(intent,\n VOICE_RECOGNITION_REQUEST_CODE);\n }\n }\n catch (final Exception e) {\n showSpeechRecognitionErrorDialog();\n logError(e);\n }\n }\n };\n }",
"public void onVoiceSearchClick(View v) {\n \ttry{\n \t\tAppMeasurementWrapper.getInstance().initialize(\n\t\t\t\t\tgetApplication());\n\t\t\tAppMeasurementWrapper\n\t\t\t\t\t.getInstance()\n\t\t\t\t\t.storeTransitionSrcPoint(\n\t\t\t\t\t\t\tAppEffectClickPointEnum.HOME_VOICESEARCH);\n \t\t\t\tPackageManager pm = getPackageManager();\n\t\t\t\t\t\n\t\t\t\t\tList<ResolveInfo> activities = pm.queryIntentActivities(\n\t\t\t new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);\n\t\t\t\t\t//check if the device supports voice search\n\t\t\t\t\tif (activities.size() != 0) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t\t\t intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\t RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t\t\t intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,\n\t\t\t\t Locale.getDefault());\n\t\t\t\t intent.putExtra(RecognizerIntent.EXTRA_PROMPT, getResources().getString(R.string.voice_search_prompt));\n\t\t\t\t \n\t\t\t\t startActivityForResult(intent,VOICE_RECOGNITION_REQUEST_CODE);\n\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tToast.makeText(RakutenHomeController.this, R.string.no_voice_search, 1).show();\n\t\t\t\t\t}\n\n \t} catch (Exception e) {\n\t\t\tLogUtils.getInstance().d(LOG_TAG, \"[onVoiceSearchClick] error: \", e);\n\t\t}\n }",
"private void addVoiceApp() {\n\t\tApplicationInfo application = new ApplicationInfo();\r\n\t\tapplication.title = \"Camera\";\r\n application.icon = context.getResources().getDrawable(R.drawable.ic_camera_50);\r\n Intent intent=new Intent(context,CameraActivity.class);\r\n application.voiceTag=true;\r\n application.setIntent(intent);\r\n mApplications.add(application);\r\n application.setIndex(mApplications.size()-1); \r\n \r\n\t\tapplication = new ApplicationInfo();\r\n\t\tapplication.title = \"Google\";\r\n\t\tintent=new Intent(\"com.google.glass.action.START_VOICE_SEARCH_ACTIVITY\");\r\n\t\tapplication.setIntent(intent);\r\n\t\tapplication.voiceTag=true;\r\n\t\tapplication.icon = context.getResources().getDrawable(R.drawable.ic_search_50);\r\n mApplications.add(application);\r\n application.setIndex(mApplications.size()-1); \r\n\t}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode,\n Intent data) {\n if (requestCode == Constants.SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n spokenText = results.get(0);\n // Do something with spokenText\n Log.i(TAG, \"Spoken Text = \" + spokenText);\n\n if (spokenText.startsWith(\"home\") || spokenText.startsWith(\"work\")) {\n Log.i(TAG, \"Creating Google Api Client\");\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addApi(Wearable.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n mGoogleApiClient.connect();\n }\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }",
"public void onBeginningOfSpeech() {\n Log.i(TAG, \"onBeginningOfSpeech\");\n }",
"@Override\n public void onBeginningOfSpeech() {\n Log.i(\"SRL\", \"onBeginningOfSpeech\");\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"us-US\");\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onClick(View v) {\n text_to_speech = set_voice(text_to_speech);\n int len = ar.length;\n for (int i = 0; i < len; i++){\n speak(text_to_speech,ar[i]);\n }\n }",
"@Override\n public boolean startVoiceRecognition(BluetoothDevice bluetoothDevice) throws RemoteException {\n Parcel parcel = Parcel.obtain();\n Parcel parcel2 = Parcel.obtain();\n try {\n parcel.writeInterfaceToken(Stub.DESCRIPTOR);\n boolean bl = true;\n if (bluetoothDevice != null) {\n parcel.writeInt(1);\n bluetoothDevice.writeToParcel(parcel, 0);\n } else {\n parcel.writeInt(0);\n }\n if (!this.mRemote.transact(4, parcel, parcel2, 0) && Stub.getDefaultImpl() != null) {\n bl = Stub.getDefaultImpl().startVoiceRecognition(bluetoothDevice);\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n parcel2.readException();\n int n = parcel2.readInt();\n if (n == 0) {\n bl = false;\n }\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n catch (Throwable throwable) {\n parcel2.recycle();\n parcel.recycle();\n throw throwable;\n }\n }",
"private void when_clickButtonVoice() {\n onView(withId(R.id.buttonVoice))\n .perform(click());\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\n // Fill the list view with the strings the recognizer thought it could have heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n String[] match = new String[matches.size()];\n match = matches.toArray(match);\n AsyncTaskRunner runner = new AsyncTaskRunner(); //Creating an async task to handle the RPC request\n runner.execute(match);\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }",
"void start(Intent intent, IntentFilter filter, IIntentCallback callback, IEclipseContext context);",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n\t\t\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-US\");\n\n\t\t\t\ttry {\n\t\t\t\t\tstartActivityForResult(intent, RESULT_SPEECH);\n\t\t\t\t\tet1.setText(\"\");\n\t\t\t\t} catch (ActivityNotFoundException a) {\n\t\t\t\t\tToast t = Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\"Opps! Your device doesn't support Speech to Text\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t\t\t\t\tt.show();\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}",
"public synchronized void startSpeechRecognition() {\r\n\t\t\r\n\t\t//Check lock\r\n\t\tif (speechRecognizerThreadRunning)\r\n\t\t\tlogger.log(Level.INFO, \"Speech Recognition Thread already running...\\n\");\r\n\t\telse\r\n\t\t\t//Submit to ExecutorService\r\n\t\t\teventsExecutorService.submit(() -> {\r\n\t\t\t\t\r\n\t\t\t\t//locks\r\n\t\t\t\tspeechRecognizerThreadRunning = true;\r\n\t\t\t\tignoreSpeechRecognitionResults = false;\r\n\t\t\t\t\r\n\t\t\t\t//Start Recognition\r\n\t\t\t\trecognizer.startRecognition(true);\r\n\t\t\t\t\r\n\t\t\t\t//Information\t\t\t\r\n\t\t\t\tlogger.log(Level.INFO, \"You can start to speak...\\n\");\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\twhile (speechRecognizerThreadRunning) {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * This method will return when the end of speech is reached. Note that the end pointer will determine the end of speech.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tSpeechResult speechResult = recognizer.getResult();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Check if we ignore the speech recognition results\r\n\t\t\t\t\t\tif (!ignoreSpeechRecognitionResults) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Check the result\r\n\t\t\t\t\t\t\tif (speechResult == null)\r\n\t\t\t\t\t\t\t\tlogger.log(Level.INFO, \"I can't understand what you said.\\n\");\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Get the hypothesis\r\n\t\t\t\t\t\t\t\tspeechRecognitionResult = speechResult.getHypothesis();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//You said?\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"You said: [\" + speechRecognitionResult + \"]\\n\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Call the appropriate method \r\n\t\t\t\t\t\t\t\tmakeDecision(speechRecognitionResult, speechResult.getWords());\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\tlogger.log(Level.INFO, \"Ingoring Speech Recognition Results...\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tlogger.log(Level.WARNING, null, ex);\r\n\t\t\t\t\tspeechRecognizerThreadRunning = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlogger.log(Level.INFO, \"SpeechThread has exited...\");\r\n\t\t\t\t\r\n\t\t\t});\r\n\t}",
"protected void start() {\n\t\thellotv.setText(\"\");\n\t\tMap<String, Object> params = new LinkedHashMap<String, Object>();\n\t\tString event = null;\n\t\tevent = SpeechConstant.ASR_START;\n\t\t\n\t\tif (enableOffline) {\n params.put(SpeechConstant.DECODER, 2);\n }\n\t\t\n\t\tparams.put(SpeechConstant.ACCEPT_AUDIO_VOLUME, false);\n\t\t//params.put(SpeechConstant.PID, 1737);//English\n\t\t\n\t\tString json = null;\n\t\tjson = new JSONObject(params).toString();\n\t\tasr.send(event, json, null, 0, 0);\n\t\t\n\t\tprintresult(\"输入参数\"+ json);\n\t}",
"public void recognizeMicrophone() {\n if (recognizer != null) {\n setUiState(STATE_DONE);\n recognizer.cancel();\n recognizer = null;\n } else {\n setUiState(STATE_MIC);\n try {\n recognizer = new SpeechRecognizer(model);\n recognizer.addListener(this);\n recognizer.startListening();\n } catch (IOException e) {\n setErrorState(e.getMessage());\n }\n }\n }",
"private void listenVoiceCall() {\n final String username = MyAccount.getInstance().getName();\n final String topic = String.format(\"voice/%s\", username);\n new Subscriber(topic, username)\n .setNewMessageListener(new SubscribedTopicListener() {\n @Override\n public void onReceive(DataTransfer message) {\n String action = message.data.toString();\n switch (action) {\n case Constants.VOICE_REQUEST:\n onReceiveVoiceRequest(message);\n break;\n\n case Constants.VOICE_ACCEPT:\n hideCallingPane();\n onReceiveVoiceAccept(message);\n break;\n\n case Constants.VOICE_REJECT:\n hideCallingPane();\n onReceiveVoiceReject(message);\n break;\n\n case Constants.VOICE_QUIT:\n onReceiveVoiceQuit(message);\n\n }\n }\n })\n .listen();\n }",
"public void onClick(View v) {\n Toast.makeText( getActivity(),\"Voice Recognition\", Toast.LENGTH_SHORT).show();\n }",
"private void promptSpeechInput() {\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tRecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n\t\t\t\tgetString(R.string.speech_prompt));\n\t\ttry {\n\t\t\tstartActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n\t\t} catch (ActivityNotFoundException a) {\n\t\t\tToast.makeText(getActivity(),\n\t\t\t\t\tgetString(R.string.speech_not_supported),\n\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t}\n\t}",
"public void onVoiceStart(int sampleRates) {\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode,\n Intent data) {\n if (requestCode == REQ_CODE_SPEECH_INPUT && resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n String spokenText = results.get(0);\n // Do something with spokenText\n convert.setText(spokenText);\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"private void startControlRobotActivity(){\n Intent intent = new Intent(this, ControlRobotActivity.class );\n startActivity(intent);\n finish();\n }",
"private void startRecognition() {\n mStatusTextView.setVisibility(View.VISIBLE);\n mStatusTextView.setText(R.string.status_scan_credentials);\n mStatusProgressBar.setVisibility(View.GONE);\n mRescanButton.setVisibility(View.GONE);\n\n mScannerView.setAnimated(true);\n hideMatchView();\n\n mTimeClockBar.setVisibility(View.VISIBLE);\n mTimeClockBar.setProgress(0);\n\n // Start a timeout for the recognition\n startRecognitionTimeout();\n\n mAllPasswords.clear();\n mSSIDMatchCounts.clear();\n mProcessor.setActive(true);\n }",
"private Intent createVoiceAppSearchIntent(Bundle appData)\n\t{\n\t\tComponentName searchActivity = mSearchable.getSearchActivity();\n\t\t// create the necessary intent to set up a search-and-forward operation\n\t\t// in the voice search system. We have to keep the bundle separate,\n\t\t// because it becomes immutable once it enters the PendingIntent\n\t\tIntent queryIntent = new Intent(Intent.ACTION_SEARCH);\n\t\tqueryIntent.setComponent(searchActivity);\n\t\tPendingIntent pending = PendingIntent.getActivity(getContext(), 0,\n\t\t\t\tqueryIntent, PendingIntent.FLAG_ONE_SHOT);\n\t\t// Now set up the bundle that will be inserted into the pending intent\n\t\t// when it's time to do the search. We always build it here (even if\n\t\t// empty)\n\t\t// because the voice search activity will always need to insert \"QUERY\"\n\t\t// into\n\t\t// it anyway.\n\t\tBundle queryExtras = new Bundle();\n\t\tif (appData != null)\n\t\t{\n\t\t\tqueryExtras.putBundle(SearchManager.APP_DATA, appData);\n\t\t}\n\t\t// Now build the intent to launch the voice search. Add all necessary\n\t\t// extras to launch the voice recognizer, and then all the necessary\n\t\t// extras\n\t\t// to forward the results to the searchable activity\n\t\tIntent voiceIntent = new Intent(\n\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tvoiceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t// Add all of the configuration options supplied by the searchable's\n\t\t// metadata\n\t\tString languageModel = getString(mSearchable.getVoiceLanguageModeId());\n\t\tif (languageModel == null)\n\t\t{\n\t\t\tlanguageModel = RecognizerIntent.LANGUAGE_MODEL_FREE_FORM;\n\t\t}\n\t\tString prompt = getString(mSearchable.getVoicePromptTextId());\n\t\tString language = getString(mSearchable.getVoiceLanguageId());\n\t\tint maxResults = mSearchable.getVoiceMaxResults();\n\t\tif (maxResults <= 0)\n\t\t{\n\t\t\tmaxResults = 1;\n\t\t}\n\t\tvoiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tlanguageModel);\n\t\tvoiceIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt);\n\t\tvoiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);\n\t\tvoiceIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, maxResults);\n\t\tvoiceIntent.putExtra(EXTRA_CALLING_PACKAGE,\n\t\t\t\tsearchActivity == null ? null : searchActivity.toShortString());\n\t\t// Add the values that configure forwarding the results\n\t\tvoiceIntent.putExtra(RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT,\n\t\t\t\tpending);\n\t\tvoiceIntent.putExtra(\n\t\t\t\tRecognizerIntent.EXTRA_RESULTS_PENDINGINTENT_BUNDLE,\n\t\t\t\tqueryExtras);\n\t\treturn voiceIntent;\n\t}",
"public void ResultVoiceIn(EventVoice event);",
"public interface VoiceActivityDetectorListener {\n void onVoiceActivityDetected();\n void onNoVoiceActivityDetected();\n}",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (requestCode == VOICE_RECOGNITION_REQUEST_CODE\n\t\t\t\t&& resultCode == RESULT_OK) {\n\t\t\t// Fill the list view with the strings the recognizer thought it\n\t\t\t// could have heard\n\t\t}\n\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t}",
"public void onNewIntent(Intent intent) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~onNewIntent\");\n m6632c(intent);\n }",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n\r\n int thisConversationId = intent.getIntExtra(\"conversation_id\", -1);\r\n Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);\r\n if (remoteInput != null){\r\n CharSequence replyText = remoteInput.getCharSequence(\"voice_reply_key\");\r\n Log.d(\"BasicNotifications\", \"Found voice reply [\" + replyText+ \"] from conversation_id\");\r\n }\r\n }",
"@Override\n public void startCameraIntent() {\n Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(cameraIntent, PICK_FROM_CAMERA_REQUEST_CODE);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_voice_input) {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n startActivityForResult(intent, 0);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"private void startPopup(Context context, Long id) {\n\n //Intent emaIntent = new Intent(context, VoiceRecognitionActivity.class); //The activity you want to start.\n //Intent emaIntent = new Intent(context, PopupActivity.class); //The activity you want to start.\n //Log.d(\"Alarm receiver\", \"received intent\");\n Random random = new Random();\n int value = random.nextInt(1);\n Intent emaIntent = new Intent(context, PopupActivity.class);\n emaIntent.putExtra(\"pos\", id);\n\n\n\n// if (value == 1) {\n// emaIntent = new Intent(context, PopupActivity.class); //The activity you want to start.\n// } else {\n// emaIntent = new Intent(context, VoiceRecognitionActivity.class);\n// }\n\n\n\n emaIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(emaIntent);\n }",
"public void phonesister(View v){\n \tIntent intent =new Intent();//意图\n \tintent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);//设置拍照意图\n \tstartActivity(intent);//开启意图\t\t\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n imageview=(ImageView) findViewById(R.id.imageView);\n Display display=getWindowManager().getDefaultDisplay();\n Point size=new Point();\n display.getSize(size);\n width=size.x;\n height=size.y;\n if(height>width){small=width;check=1;}\n else small=height;\n x=width/2;\n y=height/2;\n Bitmap b = Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);\n imageview.setImageBitmap(b);\n c = new Canvas(b);\n c.drawColor(Color.BLACK);\n paint = new Paint();\n paint.setAntiAlias(false);\n paint.setStyle(Paint.Style.FILL);\n\n paint.setColor(Color.BLUE);\n c.drawCircle(x, y, r, paint);\n\n speak=(Button) findViewById(R.id.speak);\n wordsList=(ListView) findViewById(R.id.listView);\n PackageManager pm =getPackageManager();\n List<ResolveInfo> activities =pm.queryIntentActivities(\n new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),0);\n if(activities.size() == 0)\n {\n speak.setEnabled(false);\n speak.setText(\"Recognizer not present\" );\n }\n }",
"@Override\n public void onConnected(Bundle bundle) {\n Intent gARIntent = new Intent(getApplicationContext(), Algorithm.class);\n PendingIntent gARPending = PendingIntent.getService(getApplicationContext(), 0, gARIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n //do AR per 6 secs\n ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(gARClient, 6000, gARPending);\n\n }",
"@Override\n public void onClick(View v) {\n recorder = new AudioRecord(MediaRecorder.AudioSource.VOICE_COMMUNICATION,\n RECORDER_SAMPLERATE, RECORDER_CHANNELS,\n RECORDER_AUDIO_ENCODING, BufferElements2Rec * BytesPerElement);\n\n recorder.startRecording();\n }",
"public void cameraIntent() {\n startActivityForResult(new Intent(\"android.media.action.IMAGE_CAPTURE\"), 1);\n }",
"public void onClickImgBtnHablar_(View v) {\n Intent intentActionRecognizeSpeech = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n // Establece el idioma, predeterminado Ingles Ussa\n intentActionRecognizeSpeech.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"us-US\");\n\n // Inicia la actividad de reconocimiento de voz\n try {\n startActivityForResult(intentActionRecognizeSpeech, RECOGNIZE_SPEECH_ACTIVITY);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(), \"¡Opps! Su dispositivo no es compatible con el reconocimiento de voz.\", Toast.LENGTH_SHORT).show();\n }\n }",
"void playSpeech(String rawText);",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(getApplicationContext(),AudioService.class);\n intent.putExtra(\"code\",1);\n startService(intent);\n }",
"public boolean checkVoiceRecognition() {\n\t\tPackageManager pm = context.getPackageManager();\n\t\tList<ResolveInfo> activities = pm.queryIntentActivities(new Intent(\n\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);\n\t\tif (activities.size() == 0) {\n\t\t\tToast.makeText(context, \"Voice recognizer not present\",\n\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public void onStart(Intent intent, int startId) {\n \tsuper.onStart(intent, startId);\n \t\n \t//Notification(intent.getStringExtra(\"text\"));\n \tspokenText = \"\";\n \tspokenText += intent.getStringExtra(\"text\")+\"\";\n \n \t\n \tmTts = new TextToSpeech(this, this);\n \tToast.makeText(this, \"MyAlarmService.onStart()\"+spokenText, Toast.LENGTH_LONG).show();\n \t\n \n }",
"public void sendToTrivia() {\n Intent intent = new Intent(getApplicationContext(), TriviaActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"@Override\n\tpublic SpeechletResponse onLaunch(final SpeechletRequestEnvelope<LaunchRequest> requestEnvelope) {\n\t\tLOG.debug(\"onLaunch\");\n\n\t\tfinal SpeechletResponse response = new SpeechletResponse();\n\t\tfinal SsmlOutputSpeech output = new SsmlOutputSpeech();\n\t\tresponse.setOutputSpeech(output);\n\n\t\toutput.setSsml(\"<speak>Hi! Are you looking for something? Or should I note where you've put something?</speak>\");\n\n\t\tresponse.setShouldEndSession(false);\n\t\treturn response;\n\t}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n \tLog.d(\"Activity\", \"Got back activity\");\n \tLog.d(\"Activity arguments\", \"ReqCode:\" + requestCode + \" Result:\"+resultCode);\n \t\n \t// Didn't get anything useful back from either textcraft or speechcraft\n \tif ((requestCode == SPEECHCRAFT_REQCODE || requestCode == TEXTCRAFT_REQCODE) && resultCode == RESULT_CANCELED) {\n \t\tLog.d(\"Activity\", \"Didn't get anything back\");\n \t} else {\n \t// Respond to built in speech recognition activity\n if (requestCode == SPEECH_REQCODE && resultCode == RESULT_OK) {\n // Populate the wordsList with the String values the recognition engine thought it heard\n \t// i.e. \"Milk\" -> matches = [milk, Milk, Mielke]\n ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n Log.d(\"Hearing...\", matches.toString());\n \n // Start the speechcraft activity and passing heard words\n Intent intent = new Intent(this, SpeechcraftActivity.class);\n \t\tBundle bundle =new Bundle();\n \t\tbundle.putStringArray(\"matches\", matches.toArray(new String[matches.size()]));\n \t\tintent.putExtras(bundle);\n \t\tstartActivityForResult(intent, SPEECHCRAFT_REQCODE);\n \t\toverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n }\n // Respond to a successfully finished textcraft or speechcraft activity, we'll get back\n // two strings - the food's name, and the food's location\n if ((requestCode == TEXTCRAFT_REQCODE || requestCode == SPEECHCRAFT_REQCODE) && resultCode == RESULT_OK) {\n \t// Update the two arrays that store values and the one that displays it on this activity\n \tString foodName = data.getExtras().getString(\"foodName\");\n \tfoodNameList.add(foodName);\n \t\n \tString location = data.getExtras().getString(\"location\");\n \tfoodlocationList.add(location);\n\n \tdisplayedFoods.add(foodName + \" | \" + location) ;\n \tArrayAdapter<String> displayedFoodsAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, displayedFoods);\n \tfoodList.setAdapter(displayedFoodsAdapter);\t\n }\n super.onActivityResult(requestCode, resultCode, data);\n \t}\n }",
"@Override\n public void onClick(View v) {\n Intent returnToPressHelp = new Intent(getApplicationContext(), PressHelp.class);\n startActivity(returnToPressHelp);\n\n\n //Tell the phone that the medication was taken.\n\n }",
"public abstract void grantVoice(String nickname);",
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n //Log.v(\"test\", Boolean.toString(data.getStringExtra(EXTRA_NUMBER) != null));\n\n if (requestCode == 1 && resultCode == RESULT_OK && data != null) {\n \tresult = null;\n ArrayList<String> text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n result = text.get(0);\n Log.v(\"CASE1\", result);\n \t//String number = data.getExtras().getString(EXTRA_NUMBER);\n \n \tLog.v(\"CASE1\", \"number is \" + num);\n\n \twhile(tts.isSpeaking()) {\n \ttry {\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n }\n tts.speak(\"Did you say, \" + result + \"?\", TextToSpeech.QUEUE_FLUSH, null);\n while(tts.isSpeaking()) {\n \ttry {\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n }\n recordMessage2(result, num);\n\n }\n if (requestCode == 2 && resultCode == RESULT_OK && data != null) {\n ArrayList<String> text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n String confirmation = text.get(0);\n Log.v(\"CASE2\", \"confirmation in case 2 is \" + confirmation);\n if (confirmation.toLowerCase().equals(\"yes\")) {\n \tLog.v(\"CASE2\", \"message in case 2 is \" + result);\n if (result != null) {\n \tString body = result;\n \n \tString number = num;\n \t\tSmsManager sms = SmsManager.getDefault();\n \t\tsms.sendTextMessage(number, null, body, null, null);\n \t\twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n \t\ttts.speak(\"Message sent\", TextToSpeech.QUEUE_FLUSH, null);\n \t\twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n \t// send message\n }\n } else {\n \twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n tts.speak(\"Please try again.\", TextToSpeech.QUEUE_FLUSH, null);\n while(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n recordMessage(num);\n }\n \n\n \t\n }\n }",
"@Override\n public void run() {\n startActivity(intent);\n }",
"@Override\n\tpublic void onClick(View arg0) {\n\t\tswitch (arg0.getId()) {\n\t\tcase R.id.start_speaking:\n\t\t\tLog.e(\"AudioSession\", \"AudioSession is Going to start\");\n\t\t\t\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tqueuePos.setVisibility(View.VISIBLE);\n\t\t\t\t\tqueuePos.setText(\"AUDIO streaming...\");\n\t\t\t\t\tstartsp.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tas = new AudioSession();\t//THIS OBJECT HANDLES ALL ASPECTS OF COMMUNICATION\n\t\t\tas.onRequestPress();\n\n\t\t\tLog.e(\" AudioSession\", \"AudioSession Started\");//START AUDIO MESSAGE\n\t\t\tbreak;\n\t\t\n\t\t\t\n\t\t}\n\t}",
"public void startInterstitialActivity() {\n Intent activityIntent = getActivityIntent();\n if (activityIntent != null) {\n this.context.startActivity(activityIntent);\n return;\n }\n throw new IllegalArgumentException(\"null intent\");\n }",
"private void m6613a(Intent intent) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<parseIntentFromListFragment>\");\n if (intent != null) {\n String stringExtra = intent.getStringExtra(\"startMode\");\n if (stringExtra != null && stringExtra.contains(\"startFromSelf\")) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"startMode: startFromSelf\");\n if (this.f5435p == 0 && !this.f5427l && !C1413m.m6844f()) {\n this.f5384D.mo6532a(getResources().getString(R.string.pause), R.drawable.btn_play_15);\n }\n this.f5444ta.sendEmptyMessageDelayed(5, 350);\n } else if (!this.f5427l) {\n this.f5444ta.sendEmptyMessageDelayed(6, 350);\n }\n }\n }",
"@Override\r\n\tpublic void OnRandomRecording(String url) {\n\t\tRecordingVoiceIncoming(url);\r\n\t}",
"public void clickStart(View view) {\n // open camera, get image and send to intent\n Intent intent = new Intent(this, PhotoDraw.class);\n String message = \"START\";\n intent.putExtra(msg, message);\n startActivity(intent);\n }",
"@Override\r\n\tpublic void call() {\n\t\tSystem.out.println(\"通过语音打电话\");\r\n\t}",
"public void launchContact(){\n\t\tIntent sendIntent = new Intent(Intent.ACTION_VIEW);\n \tsendIntent.setType(ContactsContract.Contacts.CONTENT_TYPE);\n\n if (sendIntent.resolveActivity(pacman) != null) {\n \tstartActivity(sendIntent);\n \treturn;\n } else {\n \tToast.makeText(context, \"No Texting App Availible\", Toast.LENGTH_SHORT).show();\n \treturn;\n }\n\t}",
"public void ResultVoiceDialog(EventVoice event);",
"@Override\r\n\t\t\tpublic void recognizerStarted() {\n\r\n\t\t\t}",
"@Override\n\tpublic void OnForwardCommand() {\n\t\tsuper.OnForwardCommand();\n\t\tSoundManage.playSound(forwordSound1);\n\t}",
"public void startSurvey(){\n\t\tmRecordTimer.sendMessageDelayed(Message.obtain(null, MESSAGE_TO_START_SURVEY), TIME_TO_START_SURVEY);\n\t}",
"private void speak() {\n if(textToSpeech != null && textToSpeech.isSpeaking()) {\n textToSpeech.stop();\n }else{\n textToSpeech = new TextToSpeech(activity, this);\n }\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n\n getSupportActionBar().hide();\n\n //Adding AdMob to the activity\n MobileAds.initialize(this, \"ca-app-pub-3940256099942544~3347511713\");\n adView = findViewById(R.id.adView);\n AdRequest adRequest = new AdRequest.Builder().build();\n adView.loadAd(adRequest);\n\n //Initializing the buttons in the activity\n pause = findViewById(R.id.pause);\n forward = findViewById(R.id.forward);\n backward = findViewById(R.id.previous);\n textView = findViewById(R.id.textView2);\n textView.setSelected(true);\n home = findViewById(R.id.home);\n FloatingActionButton fab = findViewById(R.id.fab);\n imageView = findViewById(R.id.imageView);\n\n //Enabling runTimePermission() method to initialize the music player\n runTimePermission();\n\n //onlick listener for the mic icon\n fab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n i.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);\n mySpeechRecognizer.startListening(i);\n }\n });\n initializeTextToSpeech();\n initializeSpeechRecognizer();\n\n //onclick listener for home button.\n home.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n startActivity(new Intent(MainActivity.this, MainApp.class));\n }\n });\n }",
"private void callContactByName() {\n final ContactBook cb = ContactBook.getSharedInstance();\n words = text.split(\" \");\n try {\n if (words[0].contains(\"ing\")) {\n intent = new Intent(Intent.ACTION_CALL);\n String searchString = \"\";\n for (int i = 1; i < words.length; i++) {\n searchString += words[i] + \" \";\n }\n contact = cb.getClosestMatch(searchString);\n }\n if (contact != null) {\n if (contact.getDefaultNumber() != null && contact.getName() != null) {\n intent.setData(Uri.parse(\"tel:\" + contact.getDefaultNumber()));\n TextToSpeechUtility.readAloud(\"ringer \" + contact.getName());\n while (TextToSpeechUtility.isSpeaking()) {\n Thread.sleep(100);\n }\n startActivity(intent);\n finish();\n }\n }\n } catch (Throwable t) {\n }\n\n }"
] | [
"0.80876267",
"0.79709214",
"0.7887042",
"0.76647955",
"0.7592345",
"0.75277877",
"0.733252",
"0.7282323",
"0.69415814",
"0.67573303",
"0.675094",
"0.6681091",
"0.6656153",
"0.66396827",
"0.6526141",
"0.651448",
"0.6505937",
"0.646925",
"0.6438722",
"0.6430789",
"0.6401821",
"0.6336232",
"0.6325818",
"0.6301394",
"0.6282679",
"0.62771076",
"0.6249836",
"0.6249733",
"0.6237297",
"0.6221847",
"0.62120664",
"0.6199988",
"0.6185255",
"0.6182104",
"0.6153075",
"0.6075728",
"0.6058064",
"0.6045589",
"0.60426015",
"0.6033177",
"0.60193336",
"0.60193336",
"0.60193336",
"0.60193336",
"0.59794444",
"0.5889032",
"0.5887094",
"0.58613",
"0.58219385",
"0.5816402",
"0.5798973",
"0.5782892",
"0.57817525",
"0.5759953",
"0.5737395",
"0.57234275",
"0.5722033",
"0.5696034",
"0.5663185",
"0.56568396",
"0.56401104",
"0.5604861",
"0.5603209",
"0.5575007",
"0.5568689",
"0.55544865",
"0.55503446",
"0.5529523",
"0.5511445",
"0.5506614",
"0.5482924",
"0.5480009",
"0.54790705",
"0.5469599",
"0.5463538",
"0.545946",
"0.54564345",
"0.5454297",
"0.5428034",
"0.5425791",
"0.5421042",
"0.5414776",
"0.54146373",
"0.5410395",
"0.5408048",
"0.5395148",
"0.53888124",
"0.538832",
"0.5372462",
"0.53580254",
"0.5352088",
"0.5344544",
"0.5340612",
"0.53345114",
"0.5323791",
"0.5316037",
"0.5306845",
"0.5304488",
"0.5277259",
"0.52709574"
] | 0.8067236 | 1 |
TEXT BACKUP MANAGEMENT (alternative to speechtotext) Called on text button click | public void textbutton_clicked(View v) {
Intent intent = new Intent(this, TextcraftActivity.class);
Bundle bundle =new Bundle();
bundle.putStringArray("test bundle", new String[]{"Hello", "World"});
intent.putExtras(bundle);
// We use startActivityForResult so that when the textcraft activity finishes, we can detect
// WHAT finished and get back specialized results
startActivityForResult(intent, TEXTCRAFT_REQCODE);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onTextCopy()\n\t{\n\t}",
"public void pasteText(){\n try{\n CharSequence text = mClipboardManager.getTextFromClipboard();\n if(text != null && mConnection != null){\n mConnection.commitText(text, 0);\n }\n }catch(Exception e){\n e.printStackTrace();\n Toast.makeText(getContext(),e.toString(),Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onClick(View v) {\n String textToSave = textViewScanedCodesToSharWin.getText().toString();\n\n //save text to Windows\n saveDataInWidows(textToSave);\n }",
"private void handleCopyingTextToClipboard(String text){\n Intent intent = new Intent(getContext(), ClipboardEventHandler.class);\n intent.putExtra(\"action\", \"switch\");\n intent.putExtra(\"content\", text);\n\n getContext().startService(intent);\n\n Snackbar.make(getView(), getString(R.string.COPIED_BEGINNIG) + \" \" +\"\\\"\"+ text +\"\\\"\" + \" \" + getString(R.string.COPIED_END), Snackbar.LENGTH_SHORT).show();\n }",
"@SuppressWarnings(\"deprecation\")\n @Override\n public void onClick(View arg0) {\n CopyText3 = copyTxt3.getText().toString();\n if (CopyText3.length() != 0) {\n if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {\n android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n clipboard.setText(CopyText3);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n } else {\n android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n android.content.ClipData clip = android.content.ClipData.newPlainText(\"Clip\", CopyText3);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n clipboard.setPrimaryClip(clip);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Nothing to Copy\", Toast.LENGTH_SHORT).show();\n }\n }",
"private void swapContent(){\n Editable content = WordText.getText();\n WordText.setText(TranText.getText());\n TranText.setText(content);\n\n }",
"public void copyText(){\n try{\n if(mCursor.isSelected()){\n mClipboardManager.setTextToClipboard(getText().subContent(mCursor.getLeftLine(),\n mCursor.getLeftColumn(),\n mCursor.getRightLine(),\n mCursor.getRightColumn()).toString());\n }\n }catch(Exception e){\n e.printStackTrace();\n Toast.makeText(getContext(),e.toString(),Toast.LENGTH_SHORT).show();\n }\n }",
"public void copyText() {\n ((ClipboardManager) getActivity().getSystemService(\"clipboard\")).setPrimaryClip(ClipData.newPlainText(\"textFromCoolapk\", this.mBinding.text.getText()));\n Toast.show(getActivity(), \"结果已复制\");\n }",
"public void saveText() {\n\t\t\tapp.saveStrings(\"./data/exports/ID_Order.txt\", saveIDOrder);\n\t\t\t//Saving the new name text\n\t\t\tapp.saveStrings(\"./data/exports/Name_Order.txt\", saveNameOrder);\n\t\t\t//Saving the new breed text\n\t\t\tapp.saveStrings(\"./data/exports/Breed_Order.txt\", saveBreedOrder);\n\t\t\t//Saving the new date text\n\t\t\tapp.saveStrings(\"./data/exports/Date_Order.txt\", saveDateOrder);\n\t\t\n\t}",
"@SuppressWarnings(\"deprecation\")\n @Override\n public void onClick(View arg0) {\n CopyText4 = copyTxt4.getText().toString();\n if (CopyText4.length() != 0) {\n if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {\n android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n clipboard.setText(CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n } else {\n android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n android.content.ClipData clip = android.content.ClipData.newPlainText(\"Clip\", CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n clipboard.setPrimaryClip(clip);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Text Kosong, Tidak ada apapun yang ter-Copy\", Toast.LENGTH_SHORT).show();\n }\n }",
"private void saveTermText() {\n String jTermText = jTerm.read();\n if (jTermText != null && jTermText.length() > 0) {\n JFileChooser fileChooser = new JFileChooser();\n File path = new File(Settings.get(\"Terminal_SavePath\"));\n if (!path.exists()) {\n path = new File(MobydroidStatic.MOBY_DATA_PATH);\n }\n fileChooser.setCurrentDirectory(path);\n fileChooser.setSelectedFile(new File(\"TerminalText_\" + (new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\")).format(new Date()) + \".txt\"));\n fileChooser.setDialogTitle(\"Save Terminal Text\");\n fileChooser.setFileFilter(new FileNameExtensionFilter(\"*.txt\", \"txt\"));\n File file;\n do {\n if (fileChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {\n return;\n }\n file = fileChooser.getSelectedFile();\n if (!file.exists()) {\n break;\n }\n if (JOptionPane.showConfirmDialog(this, \"Are you sure?\", \"Replace File\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, ResourceLoader.MaterialIcons_WARNING) == JOptionPane.YES_OPTION) {\n break;\n }\n } while (true);\n\n // save file\n try (FileOutputStream fos = new FileOutputStream(file)) {\n fos.write(jTermText.getBytes());\n } catch (IOException ex) {\n }\n // save last directory to settings ..\n Settings.set(\"Terminal_SavePath\", fileChooser.getSelectedFile().getParent());\n Settings.save();\n }\n }",
"protected void updateTextChange() {\n \t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fTextBuffer.setLength(0);\n \t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fPreservedTextBuffer.setLength(0);\n \t\t}",
"public void returnbottomText() {\n\t\trebote = this.getIntent().getStringExtra(\"buttonname\");\n\n\t\ttext.setText(rebote);\n\n\t}",
"private void speak() {\n String s = textArea.getText();\n String s5=\"images\\\\\";\n String s4=\".jpeg\";\n String obj=s5+s+s4;\n ImageIcon ic1=new ImageIcon(obj);\n Image image1=ic1.getImage().getScaledInstance(image.getWidth(),image.getHeight(),Image.SCALE_AREA_AVERAGING);\n ImageIcon icon1=new ImageIcon(image1);\n image.setIcon(icon1);\n int i = textArea.getCaretPosition();\n int k = s.length();\n for (int j = i; j <= k - 1; j++) {\n char c = s.charAt(j);\n String s3 = Character.toString(c);\n s2 = s2 + s3;\n }\n VoiceManager voiceManager = VoiceManager.getInstance();\n helloVoice = voiceManager.getVoice(\"kevin16\");\n helloVoice.allocate();\n helloVoice.speak(s2);\n helloVoice.deallocate();\n playB.setText(\"PLAY\");\n }",
"void setTextButtonBack(String textBtnBack);",
"private void btnSpeaker2ActionPerformed(java.awt.event.ActionEvent evt) {\n txtSpeaker2.setText(Dialog());\n \n }",
"public void save(){\n\tif(currentFile == null){\n\t // TODO: add popup to select where to save file and file name\n\t // currentFile = new TextFile(os, title, null);\n\t}else{\n\t currentFile.setBody(textArea.getText());\n\t}\n }",
"public void doCopy() {\n if (renderPieces.size() == 0) {\n System.out.println(\"Nothing is selected for copy operation.\");\n return;\n }\n StringBuffer sb = new StringBuffer();\n\n textBuffer.renderInit();\n Text text;\n if (!reversed) {\n while ((text = textBuffer.getTextToRender()) != null) {\n sb.append(text.getText());\n }\n } else {\n while ((text = textBuffer.getPreToRender()) != null) {\n sb.append(text);\n }\n String reversedText = sb.toString();\n sb = new StringBuffer();\n for (int i = reversedText.length()-1; i >= 0; i -= 1) {\n sb.append(reversedText.charAt(i));\n }\n }\n Clipboard clipboard = Clipboard.getSystemClipboard();\n ClipboardContent content = new ClipboardContent();\n content.putString(sb.toString());\n clipboard.setContent(content);\n System.out.println(\"Copy succeed.\");\n }",
"void onBottomQDMPasteClicked();",
"public void saveFileAs(String text) {\r\n\r\n\t\tFile tempFile;\r\n\t\ttempFile = fileChooser.showSaveDialog(fileChooserDialog);\r\n\t\tsaveFile(tempFile, text);\r\n\t\t\r\n\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tClipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();\r\n\t\t\t\tString copyString = ta_content.getText().toString();\r\n\t\t\t\tif (copyString != null) {\r\n\t\t\t\t\tStringSelection contents = new StringSelection(copyString);\r\n\t\t\t\t\tclipboard.setContents(contents, null);\r\n\t\t\t\t}\r\n\t\t\t}",
"private void makeTweet(String text) {\n\t\tassertNotNull(activity.findViewById(ca.ualberta.cs.lonelytwitter.R.id.save));\n\t\ttextInput.setText(text);\n\t\t((Button) activity.findViewById(ca.ualberta.cs.lonelytwitter.R.id.save)).performClick();\n\t}",
"public void performCopy() {\n \t\ttext.copy();\n \t}",
"@Override\n public void run() {\n speak(getString(R.string.Data_saved), \"\");\n }",
"private void saveImageAsText() {\n\t\tFile textFile = fileChooser.getOutputFile(this, \"Select Text File Name\", \"textImage.txt\"); \n\t\tif (textFile == null)\n\t\t\treturn;\n\t\ttry {\n\t\t\tPrintWriter write = new PrintWriter(textFile);\n\t\t\twrite.println(\"New textImage\");\n\t\t\twrite.println(canvas.getBackground().getRed());\n\t\t\twrite.println(canvas.getBackground().getGreen());\n\t\t\twrite.println(canvas.getBackground().getBlue());\n\t\t\tif (theString != null)\n\t\t\t\tfor (DrawTextItem s: theString) { \n\t\t\t\t\twrite.println(\"theString:\"); \n\t\t\t\t\twrite.println(s.getString()); \n\t\t\t\t\twrite.println(s.getX());\n\t\t\t\t\twrite.println(s.getY());\n\t\t\t\t\twrite.println(s.getFont().getName());\n\t\t\t\t\twrite.println(s.getFont().getStyle());\n\t\t\t\t\twrite.println(s.getFont().getSize());\n\t\t\t\t\twrite.println(s.getTextColor().getRed()); \n\t\t\t\t\twrite.println(s.getTextColor().getGreen());\n\t\t\t\t\twrite.println(s.getTextColor().getBlue());\n\t\t\t\t\twrite.println(s.getTextTransparency());\n\t\t\t\t\tif (s.getBackground() == null) {\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twrite.println(s.getBackground().getRed()); \n\t\t\t\t\t\twrite.println(s.getBackground().getGreen());\n\t\t\t\t\t\twrite.println(s.getBackground().getBlue());\n\t\t\t\t\t}\n\t\t\t\t\twrite.println(s.getBackgroundTransparency());\n\t\t\t\t\twrite.println(s.getBorder())\n\t\t\t\t\twrite.println(s.getMagnification());\n\t\t\t\t\twrite.println(s.getRotationAngle());\n\t\t\t\t}\n\t\t\twrite.close();\n\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \n\t\t\t\t\t\"Sorry, an error occurred while trying to save this image progress.\\n\" + \"Error message: \" + e);\n\t\t}\n\t}",
"void copyTextToTextBox(String text,boolean isMaxSet);",
"public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (!askSave()) {\n return;\n }\n setSaveTitle(\"*untilted\");\n text.setText(\"\");\n file = null;\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) \r\n\t\t\t{\n\t\t\t\ttry {\r\n\t\t\t\t\t// get input stream for text\r\n\t\t\t\t\tInputStream is = getAssets().open(\"syb12.txt\");\r\n\t\t\t\t\t// check size\r\n\t\t\t\t\tint size = is.available();\r\n\t\t\t\t\t// create buffer for IO\r\n\t\t\t\t\tbyte[] buffer = new byte[size];\r\n\t\t\t\t\t// get data to buffer\r\n\t\t\t\t\tis.read(buffer);\r\n\t\t\t\t\t// close stream\r\n\t\t\t\t\tis.close();\r\n\t\t\t\t\t// set result to TextView\r\n\t\t\t\t\tsyb.setText(new String(buffer));\r\n\t\t\t\t}\r\n\t\t\t\tcatch (IOException ex) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t}",
"protected void ACTION_B_SAVE(ActionEvent arg0) {\n\t\tString capturedata = textArea_1.getText();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tFile DATA = new File(\"capturedata.txt\");\r\n\t\t\tFileOutputStream datastream = new FileOutputStream(DATA);\r\n\t\t\tPrintStream out = new PrintStream(datastream);\r\n\t\t\tout.print(capturedata);\r\n\t\t\tout.close();\r\n\t\t\tdatastream.close();\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Data Saved Successfully\");\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tJOptionPane.showMessageDialog(null, \"File Access Error ! Could not save data\");\r\n\t\t}\r\n\t}",
"private void speakExtractedText(TextToSpeech tts, String fileTextContent){\n Bundle dataMap = new Bundle();\n dataMap.putFloat(TextToSpeech.Engine.KEY_PARAM_PAN, 0f);\n dataMap.putFloat(TextToSpeech.Engine.KEY_PARAM_VOLUME, 1f);\n dataMap.putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_VOICE_CALL);\n\n\n tts.speak(fileTextContent, TextToSpeech.QUEUE_FLUSH, dataMap, FRAGMENT_GENERAL_UTTERANCE_ID);\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==b1){\n\t\t\ttry {\n\t\t\t\tint nLines = text.getLineCount();\n\t\t\t\tint start = text.getLineStartOffset(nLines-1);\n\t\t\t\tint end = text.getLineEndOffset(nLines -1);\n\t\t\t\tString m = text.getText(start, (end - start));\n\t\t\t\tString result = c.send(\"1 \" + m);\n\t\t\t\tSystem.out.println(\"Sending: \" + m);\n\t\t\t\ttext.append(\" \\nMultimedia:\\n\" + result + \"\\n\");\n\t\t\t\ttext.append(\">Introduce name of file: \\n\");\n\t\t\t} catch (BadLocationException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}else if(e.getSource()==b2){\n\t\t\ttry {\n\t\t\t\tint nLines = text.getLineCount();\n\t\t\t\tint start = text.getLineStartOffset(nLines-1);\n\t\t\t\tint end = text.getLineEndOffset(nLines -1);\n\t\t\t\tString m = text.getText(start, (end - start));\n\t\t\t\tc.send(\"2 \" + m);\n\t\t\t\tSystem.out.println(\"Sending: \" + m);\n\t\t\t\ttext.append(\" \\nMultimedia being played on server\\n\" );\n\t\t\t\ttext.append(\">Introduce name of file: \\n\");\n\t\t\t} catch (BadLocationException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}else if(e.getSource()==b3){\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t}",
"public void copyToClipboard(View view) {\n //Get the text from the text view\n TextView resultTextView = findViewById(R.id.result_text_view);\n String resultText = resultTextView.getText().toString();\n\n //Copy the Text to the clipboard\n ClipboardManager clipboardManager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\n ClipData dataClip = ClipData.newPlainText(CLIP_TEXT_KEY, resultText);\n clipboardManager.setPrimaryClip(dataClip);\n\n //Tell the user that the text has been copied to the clipboard\n Toast.makeText(this, \"Copied to Clipboard\", Toast.LENGTH_SHORT).show();\n\n\n }",
"@Override\n public void onClick(View v) {\n text_to_speech = set_voice(text_to_speech);\n int len = ar.length;\n for (int i = 0; i < len; i++){\n speak(text_to_speech,ar[i]);\n }\n }",
"public void onBackupPressed(View view) {\n // Set current time as a string to a variable\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyymmdd_HHmmss\", Locale.US);\n String currentTime = dateFormat.format(date);\n\n Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"text/plain\");\n intent.putExtra(Intent.EXTRA_TITLE, \"ShareLocationBackup_\" + currentTime + \".txt\"); //rename file to date\n startActivityForResult(intent, CREATE_REQUEST_CODE);\n }",
"public void saveFile(){\n\t\t// the files name\n\t\tString fileName = nameOfFile.getText();\n\t\tString folderName = saveTo.getText();\n\t\tString pattern = \"^[a-zA-Z0-9_]*$\";\n\t\tString seperator = System.getProperty(\"file.separator\");\n\t\t\t\t\t\n\t\t//checks if file name is valid\n\t\tif (!fileName.matches(pattern)){\n\t\t\tif (mf != null){\n\t\t\t\tmf.dispose();\n\t\t\t}\n\t\t\tmf = new MessageFrame(getX()+368,getY()-150,\"Error\", \"ERROR 7:\", \"Invalid Name!\");\n\t\t\tmf.setVisible(true);\n\t\t\treturn;\n\t\t}else if (fileName.equals(\"\")){\n\t\t\tif (mf != null){\n\t\t\t\tmf.dispose();\n\t\t\t}\n\t\t\tmf = new MessageFrame(getX()+368,getY()-150,\"Error\", \"ERROR 1:\", \"Please enter name for new file!\");\n\t\t\tmf.setVisible(true);\n\t\t\treturn;\n\t\t}\n\t\t// makes sure the file is a .mp3 file\n\t\tfileName = fileName + \".mp3\";\n\t\t\t\t\t\n\t\tif(!folderName.equals(\"\")){\n\t\t\tfileName = folderName + seperator + fileName;\n\t\t}\n\t\t// used to check if the file exists\n\t\t\t\t\t\n\t\tFile tmpFile = new File(fileName);\n\t\tFile tmpDir = new File(folderName);\n\t\t\t\t\t\n\t\t// checks if file already exists or file is a directory\n\t\tif (tmpFile.exists() && !tmpFile.isDirectory()){\n\t\t\tif(mf != null){\n\t\t\t\tmf.dispose();\n\t\t\t}\n\t\t\tMessageFrame mf = new MessageFrame(getX()+368,getY()-150,\"Error\", \"ERROR 3:\", \"File Already Exists!\");\n\t\t\tmf.setVisible(true);\n\t\t\treturn;\n\t\t}else if (!tmpDir.exists()){\n\t\t\tif(mf != null){\n\t\t\t\tmf.dispose();\n\t\t\t}\n\t\t\tMessageFrame mf = new MessageFrame(getX()+368,getY()-150,\"Error\", \"ERROR 4\", \"Folder does not Exists!\");\n\t\t\tmf.setVisible(true);\n\t\t\treturn;\n\t\t}\n\t\t\t\t\t\n\t\t// Creates the wave file the user requests\n\t\tSaveSpeech ss = new SaveSpeech(message, fileName,statuslbl,progressBar, voice, rate, pitchStart, pitchEnd);\n\t\tss.execute();\n\t\tthisFrame.dispose();\n\t}",
"private void directToClipboard(String text) {\n\t\tthis.systemClipboard.setContents(new StringSelection(text), null);\n\t}",
"public static void putTextDatatoClipBoard(String textData) {\n\t\tLog.d(TAG, \"66666,textData = \" + textData);\n\t\t// ClipData clip = ClipData.newPlainText(\"simple text\",textData);\n\t\tmClipboard.setPrimaryClip(ClipData.newPlainText(\"data\", textData));\n\t\t// getTextDataFromClipBoard();\n\n\t}",
"private void ConvertTextToSpeech() {\n if (properties.get(selectedStateOrCountry) != null) {\n tts.speak(String.format(\"This is %s %s\", selectedStateOrCountry, properties.get(selectedStateOrCountry)),\n TextToSpeech.QUEUE_FLUSH, null);\n\n } else if (countryCapitalMap.get(selectedStateOrCountry) != null) {\n tts.speak(countryCapitalMap.get(selectedStateOrCountry), TextToSpeech.QUEUE_FLUSH, null);\n } else {\n tts.speak(selectedStateOrCountry, TextToSpeech.QUEUE_FLUSH, null);\n }\n }",
"void onTopQDMPasteClicked();",
"public String saveText() {\n\n return \"!Základ!\\n\\n\" + \"Hrubá mzda : \" + wage + \"Kč\\n\" + \"Sleva poplatníka : \" + saveTextChoose + \"\\nSuperhrubá mzda : \" + calc.superGrossWage(wage) + \" Kč\\n\" + \"\\n!Zaměstnavatel odvody z mzdy!\\n\\n\" + \"Socialní pojištění : \" + calc.socialInsuranceEmployer(wage) + \" Kč\\n\" + \"Zdravotní pojištění: \" + calc.healthInsuranceEmployer(wage) + \" Kč\\n\" +\n \"\\n!Zaměstnanec odvody z mzdy!\\n\" + \"\\nSocialní pojištění : \" + calc.socialInsuranceEmployee(wage) + \" Kč\\n\" + \"Zdravotní pojištění : \" + calc.healthInsuranceEmployee(wage) + \" Kč\\n\" +\n \"\\n!Daň ze závislé činnosti!\\n\" + \"\\nZáklad daní :\" + calc.round(wage) + \" Kč\\n\" + \"Daň : \" + calc.tax(wage) + \" Kč \\n\" + \"Daň po odpoču slevy : \" + calc.afterDeductionOfDiscounts(wage, choose) + \" Kč\\n\" +\n \"\\nČistá mzda : \" + calc.netWage(wage, choose) + \" Kč\";\n }",
"private void ConvertTextToSpeech(String voice1) {\n text=voice1;\n //text = et.getText().toString();\n if (text == null || \"\".equals(text)) {\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n } else\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n }",
"private void openTextFile() {\n\t\tFile openTextFile = fileChooser.getInputFile(this, \"Open Saved Text File\"); \n\t\tif (openTextFile == null)\n\t\t\treturn;\n\t\t\n\t\ttry {\n\t\t\tScanner read = new Scanner(openTextFile); \n\t\t\tif (!read.nextLine().equals(\"New textImage\")) {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Sorry, This is not an valid file. \\nPlease try again.\"); \n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tColor savedBg = new Color(read.nextInt(),read.nextInt(),read.nextInt());\n\t\t\tArrayList<DrawTextItem> newStrings = new ArrayList<DrawTextItem>(); \n\t\t\tDrawTextItem newText;\n\t\t\tread.nextLine();\n\t\t\twhile (read.hasNext() && read.nextLine().equals(\"theString:\")) { \n\t\t\t\tnewText = new DrawTextItem(read.nextLine(), read.nextInt(), read.nextInt());\n\t\t\t\tread.nextLine();\n\t\t\t\tnewText.setFont(new Font(read.nextLine(), read.nextInt(), read.nextInt()));\n\t\t\t\tnewText.setTextColor(new Color(read.nextInt(), read.nextInt(), read.nextInt()));\n\t\t\t\tnewText.setTextTransparency(read.nextDouble());\n\t\t\t\t\n\t\t\t\tint r = read.nextInt(); \n\t\t\t\tint g = read.nextInt();\n\t\t\t\tint b = read.nextInt();\n\t\t\t\tif (r == -1)\n\t\t\t\t\tnewText.setBackground(null); \n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tnewText.setBackground(new Color(r, g, b));\n\t\t\t\t\n\t\t\t\tnewText.setBackgroundTransparency(read.nextDouble()); \n\t\t\t\tnewText.setBorder(read.nextBoolean());\n\t\t\t\tnewText.setMagnification(read.nextDouble());\n\t\t\t\tnewText.setRotationAngle(read.nextDouble());\n\t\t\t\tread.nextLine();\n\t\t\t\tnewStrings.add(newText); \n\t\t\t}\n\t\t\t\n\t\t\tcanvas.setBackground(savedBg);\n\t\t\ttheString = newStrings;\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \n\t\t\t\t\t\"Sorry, an error occurred while trying to load the save progress.\\n\" + \"Error message: \" + e);\n\t\t}\n\t}",
"private void convertion(){\n txtBox2.setText(workin.convertText(txtBox1.getText())) ; \n }",
"private void txt() {\n\n\t}",
"@Override\r\n\t\tpublic void focusLost(FocusEvent e) {\n\t\t\tString content = tt.wordTextPane.getText();\r\n\t\t\ttt.setContent(content);\r\n\t\t\ttt.dealWith(content);\r\n\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) \n\t\t\t{\n\t\t\t\tISpeechServiceProxy iss = new SpeechServiceProxy() ;\n\t\t\t\tiss.textToSpeech(ServiceAction.TTS_ACTION, ReadTextActivity.this, inputText.getText().toString()) ;\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n if(!src.isEmpty()) {\n String texto= textArea.getText();\n String[] textArray= texto.split(\"\\n\");\n WriteFile data= new WriteFile(src,true);\n File file= new File(src);\n file.delete();\n for(int i=0;i<textArray.length;i++) {\n //System.out.println(\"lineas\");\n //System.out.println(textArray[i]);\n try {\n data.writeToFile(textArray[i]);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n textSalida.append(\"\\nguardado exitoso\");\n }\n else\n {\n src=guardarGUI();\n if(!src.isEmpty()) {\n\t String texto= textArea.getText();\n\t String[] textArray= texto.split(\"\\n\");\n\t WriteFile data= new WriteFile(src,true);\n\t File file= new File(src);\n\t file.delete();\n\t for(int i=0;i<textArray.length;i++) {\n\t //System.out.println(\"lineas\");\n\t //System.out.println(textArray[i]);\n\t try {\n\t data.writeToFile(textArray[i]);\n\t } catch (IOException e1) {\n\t e1.printStackTrace();\n\t }\n\t }\n\t textSalida.append(\"\\nguardado exitoso\");\n }\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tFile file = new File(FILE_NAME);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFileInputStream fis = openFileInput(FILE_NAME);\n\t\t\t\t\tInputStreamReader isr = new InputStreamReader(fis);\n\t\t\t\t\t\n\t\t\t\t\tchar[] data = new char[fis.available()];\n\t\t\t\t\tisr.read(data);\n\t\t\t\t\t\n\t\t\t\t\tString buf = new String(data);\n\t\t\t\t\ttext.setText(buf);\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"public void speakOut(final String text){\n\t\tif (listener != null){\n\t\t\thandler.post(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlistener.speakOut(text.trim());\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"public boolean save() {\n if (!this.a_text.isEnabled()) {\n JOptionPane.showMessageDialog(null, \"Save not allowed.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n\n boolean res = FileTools.saveTextToFile(this.textFilePath, this.a_text.getText());\n\n if (res)\n JOptionPane.showMessageDialog(null, \"File saved\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Failed to save file\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\n return res;\n }",
"private void createBack() {\n String backString = \"\";\n if(host.locale == host.FINNISH) {\n backString = \"TAKAISIN\";\n } else if(host.locale == host.ENGLISH) {\n backString = \"BACK\";\n }\n back = new FontActor(backString,\n screenWidth * 1 / 8,\n screenHeight * 1 / 8);\n }",
"@FXML\n\tpublic void saveFile() {\n\t\tif (file == null) {\n\t\t\tFileChooser saveFileChooser = new FileChooser();\n\t\t\tsaveFileChooser.setInitialDirectory(userWorkspace);\n\t\t\tsaveFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\t\tfile = saveFileChooser.showSaveDialog(ap.getScene().getWindow());\n\t\t}\n\n\t\tif (file.getName().endsWith(\".txt\")) {\n\t\t\ttry {\n\t\t\t\tfilePath = file.getAbsolutePath();\n\t\t\t\tStage primStage = (Stage) ap.getScene().getWindow();\n\t\t\t\tprimStage.setTitle(filePath);\n\t\t\t\tTab tab = tabPane.getSelectionModel().getSelectedItem();\n\t\t\t\ttab.setId(filePath);\n\t\t\t\ttab.setText(file.getName());\n\n\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\n\t\t\t\tPrintWriter output = new PrintWriter(writer);\n\t\t\t\toutput.write(userText.getText());\n\t\t\t\toutput.flush();\n\t\t\t\toutput.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(file.getName() + \" has no valid file-extenstion.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}",
"public void saveText(String conversation, boolean appendToEnd)\n\t{\n\t\tString fileName = \"/Users/zcon5199/Documents/saved text.txt\";\n\t\tPrintWriter outputWriter;\n\t\t\n\t\tif(appendToEnd)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\toutputWriter = new PrintWriter(new BufferedWriter(new FileWriter(fileName, true)));\n\t\t\t\toutputWriter.append(conversation);\n\t\t\t\toutputWriter.close();\n\t\t\t}\n\t\t\tcatch(FileNotFoundException noExistingFile)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(baseFrame, \"there is no file there :(\");\n\t\t\t\tJOptionPane.showMessageDialog(baseFrame, noExistingFile.getMessage());\n\t\t\t}\n\t\t\tcatch(IOException inputOutputError)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(baseFrame, \"there is no file there :(\");\n\t\t\t\tJOptionPane.showMessageDialog(baseFrame, inputOutputError.getMessage());\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\toutputWriter = new PrintWriter(fileName);\n\t\t\t\toutputWriter.println(conversation);\n\t\t\t\toutputWriter.close();\n\t\t\t}\n\t\t\tcatch(FileNotFoundException noFileIsThere)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(baseFrame, \"there is no file there :(\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void onTextPaste()\n\t{\n\t\tif(onPasteListener != null)\n\t\t\tonPasteListener.onTextPasted(this);\n\t}",
"public void countdown(final int picture_num){\n// t1.speak(\"The background has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please step into the camera view and position yourself so that you are visible fully\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your front view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your front view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your right view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your right view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your back view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your back view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Your left view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n// t1.speak(\"Your left view has been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"All your images have been captured\", TextToSpeech.QUEUE_ADD, null);\n// t1.speak(\"Please proceed with confirming your images\", TextToSpeech.QUEUE_ADD, null);\n// while (t1.isSpeaking());\n\n t1.speak(\"Please place your phone at a stable angle to the wall\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please step aside so that the background is captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"The background will be captured in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n t1.speak(\"The background has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please step into the camera view and position yourself so that you are visible fully\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your front view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n //next picture\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your front view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your right view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your right view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your back view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your back view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please turn slowly to your left\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Your left view image will be taken in 3 seconds\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n\n CountDownTimer cdt = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n\n //try disabling the whole voice thing first, move it to new tts activity, then try old method, then try new method\n\n t1.speak(String.valueOf(millisUntilFinished/1000),TextToSpeech.QUEUE_ADD, null);\n while(t1.isSpeaking());\n }\n\n public void onFinish() {\n mCameraView.takePicture();\n //pictures[picture_num] = true;\n //picture_num++;\n\n //next picture\n\n t1.speak(\"Your left view has been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"All your images have been captured\", TextToSpeech.QUEUE_ADD, null);\n t1.speak(\"Please proceed with confirming your images\", TextToSpeech.QUEUE_ADD, null);\n while (t1.isSpeaking());\n\n\n }\n };\n cdt.start();\n\n }\n };\n cdt.start();\n\n }\n };\n cdt.start();\n\n\n }\n };\n //cdt.start();\n\n\n }\n };\n cdt.start();\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n\t\t\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-US\");\n\n\t\t\t\ttry {\n\t\t\t\t\tstartActivityForResult(intent, RESULT_SPEECH);\n\t\t\t\t\tet1.setText(\"\");\n\t\t\t\t} catch (ActivityNotFoundException a) {\n\t\t\t\t\tToast t = Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\"Opps! Your device doesn't support Speech to Text\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t\t\t\t\tt.show();\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}",
"private void setupSayAgainButton() {\n\t\tImageIcon sayagain_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"sayagain.png\");\n\t\tJButton sayagain_button = new JButton(\"\", sayagain_button_image);\n\t\tsayagain_button.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t\t\n\t\t\t\t//says the word slowly\n\t\t\t\tparent_frame.getFestival().speak(words_to_spell.get(current_word_number),true);\n\n\t\t\t\t//says the sample sentence at user's preferred speed there is one @author Abby S\n\t\t\t\tif(parent_frame.getDataHandler().hasSampleSentences()){\n\t\t\t\t\tint index=parent_frame.getDataHandler().getWordlistWords().get(parent_frame.getDataHandler().getCurrentLevel()).indexOf(words_to_spell.get(current_word_number));\n\t\t\t\t\tString sentence=parent_frame.getDataHandler().getSampleSentences().get(parent_frame.getDataHandler().getCurrentLevel()).get(index);\n\t\t\t\t\tif (!sentence.trim().isEmpty()){\n\t\t\t\t\t\tparent_frame.getFestival().speak(sentence,false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsayagain_button.addMouseListener(new VoxMouseAdapter(sayagain_button,null));\n\t\tadd(sayagain_button);\n\t\tsayagain_button.setBounds(667, 598, 177, 100);\n\t}",
"private void copyToClipboard(String text)\n {\n Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();\n cb.setContents(new StringSelection(text), null);\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tString fileName = \"TEST.txt\";\n\t\t\t\tString message = \"FFFFFFF11111FFFFF\";\n\t\t\t\tfileSave(fileName, message,currentPath);\n\t\t\t\t\n\t\t\t\tgetData(currentPath);\n\t\t\t}",
"public void doSaveAs() {\n\t\tif (activePage == 0 && introEditor.isUpdated() || introEditor.isDirty())\n\t\t\tupdateIntroEditor();\n\t\tif (activePage == 1 && (pageMainEditor.isUpdated() || pageMainEditor.isDirty()))\n\t\t\tupdateFile();\n\t\tIEditorPart editor = getTextEditor();\n\t\teditor.doSaveAs();\n\t\tsetPageText(getTextEditorIndex(), editor.getTitle());\n\t\tsetInput(editor.getEditorInput());\n\t}",
"protected void undoTextChange() {\n \t\t\ttry {\n \t\t\t\tif (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)\n \t\t\t\t\t((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText\n \t\t\t\t\t\t\t.length(), fPreservedText, fUndoModificationStamp);\n \t\t\t\telse\n \t\t\t\t\tfDocumentUndoManager.fDocument.replace(fStart, fText.length(),\n \t\t\t\t\t\t\tfPreservedText);\n \t\t\t} catch (BadLocationException x) {\n \t\t\t}\n \t\t}",
"public static void save(String text) {\n File file = new File(path + \"/savedFile.txt\");\n\n Save(file, text);\n }",
"public void toClipboard(String text) {\n\t\tthis.executor.schedule(new ClearClipBoardTask(), secondsToClearClipboard, TimeUnit.SECONDS);\n\t\tdirectToClipboard(text);\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbtTranslate.setEnabled(false);\r\n\t\t\t\tbtTranslate.setText(\"正在翻译..\");\r\n\t\t\t\tString re = Languages.translate(taResult.getText());\r\n\t\t\t\tif(\"\"==re || null==re){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\ttaTranslate.setText(re);\r\n\t\t\t\tbtTranslate.setEnabled(true);\r\n\t\t\t\tbtTranslate.setText(\"翻译\");\r\n\t\t\t}",
"private void dismissShowText() {\n\t}",
"public void setText(String text){\n String _text = dcode.enCode(new String[] { encodeType, title, passWd, text });\n if(statusKey == ALRIGHT){\n setFileText(/*ccode == null ? */_text/* : ccode.enCrype(_text)*/);\n } else{\n System.err.println(\"You can't writes this file.\");\n System.err.println(\"This file contains unknown encode or is encrypted.\");\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsave_word();\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tTranslater translater = new Translater();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tString data = dataText.getText();\n\t\t\t\t\tString presentes = presentesText.getText();\n\t\t\t\t\tString ausentes = ausentesText.getText();\n\t\t\t\t\tString ausentesJusti = ausentesJustiText.getText();\n\t\t\t\t\tString atrasos = atrasosText.getText();\n\t\t\t\t\tString atrasosJusti = atrasosJustiText.getText();\n\t\t\t\t\tString presidente = presidenteText.getText();\n\t\t\t\t\tString ateiro = ateiroText.getText();\n\t\t\t\t\tString ata = ataMesmo.getText();\n\t\t\t\t\t\n\t\t\t\t\ttranslater.traduzir(data, presentes, ausentes, ausentesJusti, atrasos, atrasosJusti, presidente, ateiro, ata);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}",
"private void convertTextToSpeech(String text) {\n if (null == text || \"\".equals(text)) {\n text = \"Please give some input.\";\n }\n m_tts.speak(text, TextToSpeech.QUEUE_ADD, null);\n }",
"protected void stopEnterText()\n\t{ if (text.getText().length() > 0) text.setText(text.getText().substring(0, text.getText().length() - 1)); }",
"public void onBack(View view){\n Context context = App.getContext();\n LogManager.reportStatus(context, \"INSPECTOR\", \"Back\");\n saveTemplate(filename);\n Intent intent = new Intent(this, FileManager.class);\n startActivity(intent);\n }",
"@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tString buf = edit.getText().toString();\n\t\t\t\t\t\tif (\"\".equals(buf)) {\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"你得先输入点东西\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tFileOutputStream fos = openFileOutput(FILE_NAME, Context.MODE_PRIVATE);//专用写内部存储文件的接口\n\t\t\t\t\t\t\tOutputStreamWriter osw = new OutputStreamWriter(fos);\n\t\t\t\t\t\t\tosw.write(buf);\n\t\t\t\t\t\t\tosw.flush();\n\t\t\t\t\t\t\tosw.close();\n\t\t\t\t\t\t\tfos.close();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"保存成功\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}",
"public void getText(){\n\t\tnoteText.setText(note.getText());\n\t}",
"private static void writeText(FileWriter outputStream, TextArray textArray, TextArray pTextArray) throws IOException {\n if (pTextArray.compareTo(textArray) != 0) {\n textArray.write(outputStream);\n pTextArray.clone(textArray); // Update the previously save word for comparison in next turn\n }\n }",
"public void xuLyLuuHoaHoaDon(){\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".txt\");\n }\n\n @Override\n public String getDescription() {\n return \".txt\";\n }\n });\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".doc\");\n }\n\n @Override\n public String getDescription() {\n return \".doc\";\n }\n });\n int flag = fileChooser.showSaveDialog(null);\n if(flag == JFileChooser.APPROVE_OPTION){\n File file = fileChooser.getSelectedFile();\n try {\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), Charset.forName(\"UTF-8\"));\n PrintWriter printWriter = new PrintWriter(outputStreamWriter);\n String lineTieuDe1 = \"----------------Phiếu Thanh Toán-----------------------\";\n String lineMaPTT = \"+Mã Phiếu Thanh Toán: \" + txtMaPTT.getText();\n String lineMaPDK = \"+Mã Phiếu Đăng Ký: \" + cbbMaPDK.getSelectedItem().toString();\n String lineSoThang = \"+Số Tháng: \" + txtSoThang.getText()+\"|\";\n String lineNgayTT = \"+Ngày Thanh Toán: \" + txtNgayTT.getText();\n String lineTienPhong = \"+Tiền Phòng: \" + txtTongTien.getText();\n String lineTienDV = \"+Tiền Dịch Vụ: \"+txtThanhToanTongCong.getText();\n String lineTieuDe2 = \"--------------------------------------------------------\";\n String lineTienPhaiTra =\"+Tiền Phải Trả: \" + txtTienPhaiTra.getText()+\" \";\n String lineTieuDe3 = \"--------------------------------------------------------\";\n \n printWriter.println(lineTieuDe1);\n printWriter.println(lineMaPTT);\n printWriter.println(lineMaPDK);\n printWriter.println(lineSoThang);\n printWriter.println(lineNgayTT);\n printWriter.println(lineTienPhong);\n printWriter.println(lineTienDV);\n printWriter.println(lineTieuDe2);\n printWriter.println(lineTienPhaiTra);\n printWriter.println(lineTieuDe3);\n \n printWriter.close();\n outputStreamWriter.close();\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Đã lưu\");\n }\n \n }",
"default void setClipboardText(String text) {\n setClipboard(ClipboardContentType.PLAINTEXT, Base64\n .getMimeEncoder()\n .encode(text.getBytes(StandardCharsets.UTF_8)));\n }",
"public void setExportButtonText(String text) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_exportButton_propertyText\");\n/*Generated! Do not modify!*/ if (text == null) {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().remove(\"overviewSmall_exportButton_propertyText\");\n/*Generated! Do not modify!*/ } else {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_exportButton_propertyText\", text);\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setExportButtonText(\" + escapeString(text) + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }",
"public void deliverRawText(String text) {\n \n }",
"private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}",
"private void speakOut(String text) {\n\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n }",
"private void setText(Text text) {\n \t\tthis.text = text;\n \t}",
"private void createSoundButton(String text) {\n sound = new TextButton(text, skin);\n sound.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent event, float x, float y) {\n soundClicked();\n }\n });\n table.add(sound).width(120).height(60).expandX();\n setSoundButtonColor(Sounds.getVolume() == 0, sound);\n }",
"@Override\n\t\tpublic void onEnd(SpeechError arg0) {\n\t\t\t\n\t\t\t\ttextView.setText(text);\n\t\t\t\ttext=\"\";\n\t\t\t\n\t\t\t\n\t\t}",
"public void showCopyMenu() {\n new AlertDialog.Builder(getContext()).setItems(\n R.array.copypaste_menu_items,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n String intentStr = null;\n switch (which) {\n case 0:\n ClipboardManager clip = (ClipboardManager) getContext()\n .getSystemService(\n Context.CLIPBOARD_SERVICE);\n if (clip != null) {\n clip.setText(mSelectedText);\n Toast.makeText(getContext(),\n R.string.text_copied,\n Toast.LENGTH_SHORT).show();\n }\n break;\n case 1:\n try {\n Uri uri = Uri.parse(\"sms:\");\n Intent intent = new Intent(\n Intent.ACTION_SENDTO, uri);\n intent.putExtra(\"sms_body\", mSelectedText);\n intent.putExtra(\"exit_on_send\", true);\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n case 2:\n try {\n Intent intent = new Intent();\n intent.setAction(\"com.motorola.createnote\");\n intent.putExtra(\"CLIPBOARD\", mSelectedText);\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n case 3:\n try {\n String broadcastAddress = String.format(\n \"%s://%s/%s\", \"searchWord\",\n \"powerword\", mSelectedText);\n Intent intent = new Intent(\n Intent.ACTION_VIEW, Uri\n .parse(broadcastAddress));\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n default:\n break;\n }\n\n clearSelection(true);\n\n }\n }).setOnCancelListener(new DialogInterface.OnCancelListener() {\n public void onCancel(DialogInterface dialog) {\n clearSelection(true);\n }\n }).show();\n }",
"@Override\n\tpublic void onSave() {\n\t\tchatFile();\n\t}",
"@Override\n\tpublic void setText(CharSequence text, BufferType type) {\n\t\tString selected_font = StoreUtil.getInstance().selectFrom(\"fonts\");\n\t\tif(selected_font != null){\n\t\t\tif(selected_font.equals(\"myanmar3\")){\n\t\t\t\tif(text != null){\n\t\t\t\t\ttext = FontConverter.zg12uni51(text.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.setText(text, type);\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.layout_aty_test_external);\n\n\t\tfinal EditText edit = (EditText) findViewById(R.id.editText_ext);\n\t\tfinal TextView text = (TextView) findViewById(R.id.textView_ext);\n\n\t\tfindViewById(R.id.button_write_ext).setOnClickListener(\n\t\t\t\tnew OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tString buf = edit.getText().toString();\n\t\t\t\t\t\tif (\"\".equals(buf)) {\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"你得先输入点东西\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tFileOutputStream fos = openFileOutput(FILE_NAME, Context.MODE_PRIVATE);//专用写内部存储文件的接口\n\t\t\t\t\t\t\tOutputStreamWriter osw = new OutputStreamWriter(fos);\n\t\t\t\t\t\t\tosw.write(buf);\n\t\t\t\t\t\t\tosw.flush();\n\t\t\t\t\t\t\tosw.close();\n\t\t\t\t\t\t\tfos.close();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"保存成功\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\tfindViewById(R.id.button_read_ext).setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tFile file = new File(FILE_NAME);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFileInputStream fis = openFileInput(FILE_NAME);\n\t\t\t\t\tInputStreamReader isr = new InputStreamReader(fis);\n\t\t\t\t\t\n\t\t\t\t\tchar[] data = new char[fis.available()];\n\t\t\t\t\tisr.read(data);\n\t\t\t\t\t\n\t\t\t\t\tString buf = new String(data);\n\t\t\t\t\ttext.setText(buf);\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}",
"Text createText();",
"public void save() {\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\ttry {\n\t\t\tFile file = new File(\"fileSave.txt\");\n\t\t\tif(!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tfw = new FileWriter(file);\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t//string to hold text to write on new file\n\t\t\tString text = textArea.getText();\n\t\t\t//write file\n\t\t\tif (text != null) {\n\t\t\t\tbw.write(text);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (bw != null) {\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie2) {\n\t\t\t\tie2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public interface ITextView extends AnimatorView {\n\n\n /**\n * Gives the user a copy of the file output as a string.\n *\n * @return file output as a string\n */\n String getFileOutput();\n\n\n}",
"@Override\r\n\t\t\tpublic void onBackspace() {\n\t\t\t\tEmojiKeyboard.backspace(mEditEmojicon);\r\n\t\t\t}",
"public void performPaste() {\n \t\ttext.paste();\n \t\tcheckSelection();\n \t\tcheckDeleteable();\n \t\tcheckSelectable();\n \t}",
"public void update (String text)\n {\n buttonText = text;\n GreenfootImage tempTextImage = new GreenfootImage (text, 20, Color.RED, Color.WHITE);\n myImage = new GreenfootImage (tempTextImage.getWidth() + 8, tempTextImage.getHeight() + 8);\n myImage.setColor (Color.WHITE);\n myImage.fill();\n myImage.drawImage (tempTextImage, 4, 4);\n\n myImage.setColor (Color.BLACK);\n myImage.drawRect (0,0,tempTextImage.getWidth() + 7, tempTextImage.getHeight() + 7);\n setImage(myImage);\n }",
"private void print2BT(String theString){\n timeDisplay.append(theString);\t\t//append the text into the EditText\n\t\t((ScrollView)timeDisplay.getParent()).fullScroll(View.FOCUS_DOWN);\n\t}",
"@Override\n public void onClick(DialogInterface arg0, int arg1) {\n\n\n switch (arg1) {\n case 0:\n try {\n String str5 = Bluetooth.this.mDumpTextView.getText().toString();\n String str6 = font_Size_10(str5);\n Bluetooth.this.uConn.printData(str6);\n showToast(\"Font changed to 10\");\n }\n catch (Exception localException)\n {\n localException.printStackTrace();\n showToast(\"Font Not cahanged\");\n }\n break;\n case 1:\n try {\n String str7 = Bluetooth.this.mDumpTextView.getText().toString();\n String str8 = font_Sans_Serif_20(str7);\n Bluetooth.this.uConn.printData(str8);\n showToast(\"Font changed to 20\");\n }\n catch (Exception localException)\n {\n localException.printStackTrace();\n showToast(\"Font Not cahanged\");\n }\n break;\n case 2:\n try {\n String str9 = Bluetooth.this.mDumpTextView.getText().toString();\n String str10 = font_Sans_Serif_30(str9);\n Bluetooth.this.uConn.printData(str10);\n showToast(\"Font changed to 30\");\n }\n catch (Exception localException)\n {\n localException.printStackTrace();\n showToast(\"Font Not cahanged\");\n }\n\n default:\n break;\n }\n\n }",
"public void speak(String text);",
"@Override\n public void onCopySuggestion(String text) {\n mUrlInput.setText(text, true);\n }",
"public void addSpeechFile(String text, String filename) {\n mSelf.addSpeech(text, filename);\n }",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\tif (button_BGM.getText().equals(\"배경음 : On\")){\n\t\t\t\tfor (int c1=0; c1<cliplist.size(); c1++){\n\t\t\t\t\tif (cliplist.get(c1).file_url.equals(\"ext/ChmpSlct_DraftMode(8bitS).wav\")){\n\t\t\t\t\t\tcliplist.get(c1).clip.stop();\n\t\t\t\t\t\tcliplist.get(c1).clip.close();\n\t\t\t\t\t\tcliplist.remove(c1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbutton_BGM.setText(\"배경음 : off\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tGameClient.playSound(\"ext/ChmpSlct_DraftMode(8bitS).wav\");\n\t\t\t\tbutton_BGM.setText(\"배경음 : On\");\n\t\t\t}\n\t\t}",
"private void saveFile() {\n if (fileExisted == false) {\n JFileChooser fChoice = new JFileChooser();\n int choice = fChoice.showSaveDialog(this);\n if (choice == JFileChooser.APPROVE_OPTION) {\n File f = fChoice.getSelectedFile();\n //\n if(!f.getName().contains(\".txt\")){\n File fN=new File(f.getParent(), f.getName()+\".txt\");\n FileDAO.writeFile(fN, txtContent);\n fMain = fN;\n fileExisted = true;\n lastSave=true;\n this.setTitle(fN.getName());\n }\n else{\n \n FileDAO.writeFile(f, txtContent);\n fMain = f;\n fileExisted = true;\n lastSave=true;\n this.setTitle(f.getName());\n } \n \n }\n } else if (fileExisted == true) {\n FileDAO.writeFile(fMain, txtContent);\n lastSave=true;\n }\n\n }"
] | [
"0.6499695",
"0.6278949",
"0.6196306",
"0.6178393",
"0.6111003",
"0.6100797",
"0.6056038",
"0.6045453",
"0.6041673",
"0.60128194",
"0.59860635",
"0.59744173",
"0.5957208",
"0.5952905",
"0.592745",
"0.5865551",
"0.5808293",
"0.57695526",
"0.57684314",
"0.573547",
"0.57110155",
"0.5709234",
"0.5702769",
"0.56974036",
"0.56794703",
"0.5630563",
"0.5618182",
"0.5596733",
"0.5594415",
"0.5591784",
"0.55867267",
"0.5583777",
"0.5582805",
"0.5582787",
"0.5551322",
"0.55298555",
"0.55119115",
"0.5506298",
"0.54991525",
"0.54572076",
"0.545442",
"0.54527223",
"0.54368407",
"0.5430066",
"0.5424717",
"0.54168653",
"0.54130787",
"0.5404847",
"0.53977543",
"0.53712916",
"0.5359207",
"0.5356293",
"0.5345277",
"0.5340659",
"0.53370893",
"0.5322126",
"0.5319753",
"0.53106904",
"0.5308095",
"0.53062403",
"0.5302815",
"0.53026164",
"0.52997804",
"0.5298465",
"0.529823",
"0.5285371",
"0.527172",
"0.52635396",
"0.5256605",
"0.5253069",
"0.52496606",
"0.5244239",
"0.5242141",
"0.5238981",
"0.5237587",
"0.52365166",
"0.52310354",
"0.52259004",
"0.5225248",
"0.52211165",
"0.5220896",
"0.5215692",
"0.5209617",
"0.520738",
"0.52020246",
"0.519371",
"0.51917243",
"0.5180355",
"0.51761603",
"0.51752037",
"0.516359",
"0.5158345",
"0.5158325",
"0.515821",
"0.515377",
"0.5149013",
"0.5144837",
"0.51328146",
"0.5129589",
"0.5127595"
] | 0.5676968 | 25 |
This function handles getting back results from the built in speech recognition activity, the textcraft activity, and the speechcraft activity We can respond to each by checking what the requestcode is! | @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d("Activity", "Got back activity");
Log.d("Activity arguments", "ReqCode:" + requestCode + " Result:"+resultCode);
// Didn't get anything useful back from either textcraft or speechcraft
if ((requestCode == SPEECHCRAFT_REQCODE || requestCode == TEXTCRAFT_REQCODE) && resultCode == RESULT_CANCELED) {
Log.d("Activity", "Didn't get anything back");
} else {
// Respond to built in speech recognition activity
if (requestCode == SPEECH_REQCODE && resultCode == RESULT_OK) {
// Populate the wordsList with the String values the recognition engine thought it heard
// i.e. "Milk" -> matches = [milk, Milk, Mielke]
ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
Log.d("Hearing...", matches.toString());
// Start the speechcraft activity and passing heard words
Intent intent = new Intent(this, SpeechcraftActivity.class);
Bundle bundle =new Bundle();
bundle.putStringArray("matches", matches.toArray(new String[matches.size()]));
intent.putExtras(bundle);
startActivityForResult(intent, SPEECHCRAFT_REQCODE);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
// Respond to a successfully finished textcraft or speechcraft activity, we'll get back
// two strings - the food's name, and the food's location
if ((requestCode == TEXTCRAFT_REQCODE || requestCode == SPEECHCRAFT_REQCODE) && resultCode == RESULT_OK) {
// Update the two arrays that store values and the one that displays it on this activity
String foodName = data.getExtras().getString("foodName");
foodNameList.add(foodName);
String location = data.getExtras().getString("location");
foodlocationList.add(location);
displayedFoods.add(foodName + " | " + location) ;
ArrayAdapter<String> displayedFoodsAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, displayedFoods);
foodList.setAdapter(displayedFoodsAdapter);
}
super.onActivityResult(requestCode, resultCode, data);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == SystemData.VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\n final ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n if (matches.size() > 0) {\n text = matches.get(0);\n callContactByName();\n selectFunctionality();\n }\n } else if (requestCode == MY_TTS_CHECK_CODE) {\n if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {\n TextToSpeechUtility.setupTextToSpeech(this);\n } else {\n Intent installIntent = new Intent();\n installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);\n startActivity(installIntent);\n }\n\n }\n }",
"@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\r\n {\r\n if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\r\n // go through the results, dump them all to a TextView\r\n ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\r\n String res = matches.get(0);\r\n if (res.contains(\"dance\")) {\r\n speak(\"Did you say dance? That robot over there likes to dance... should I play some music for it?\");\r\n }\r\n else if (res.contains(\"your name\")) {\r\n speak(\"My name is \" + prefs.getString(PREFS_NAME, \"Mrs. Robot\"));\r\n }\r\n else if (res.contains(\"do you like first grade\")) {\r\n speak(\"I love first grade. Reading and Writing and Math are some of my favorites!\");\r\n }\r\n else if (res.contains(\"do you like kindergarten\")) {\r\n speak(\"I think kindergarten is great. I especially love kid writing!\");\r\n }\r\n else if (res.contains(\"what do you know\")) {\r\n speak(\"I don't know very much. Robots aren't as smart as kids.\");\r\n }\r\n else {\r\n speak(\"It sounded like you said \" + res + \". I don't know what that means\");\r\n }\r\n }\r\n else if (requestCode == VOICE_RECOGNITION_REQUEST_CODE) {\r\n speak(\"I didn't understand that... please try again\");\r\n }\r\n super.onActivityResult(requestCode, resultCode, data);\r\n }",
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n //Log.v(\"test\", Boolean.toString(data.getStringExtra(EXTRA_NUMBER) != null));\n\n if (requestCode == 1 && resultCode == RESULT_OK && data != null) {\n \tresult = null;\n ArrayList<String> text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n result = text.get(0);\n Log.v(\"CASE1\", result);\n \t//String number = data.getExtras().getString(EXTRA_NUMBER);\n \n \tLog.v(\"CASE1\", \"number is \" + num);\n\n \twhile(tts.isSpeaking()) {\n \ttry {\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n }\n tts.speak(\"Did you say, \" + result + \"?\", TextToSpeech.QUEUE_FLUSH, null);\n while(tts.isSpeaking()) {\n \ttry {\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n }\n recordMessage2(result, num);\n\n }\n if (requestCode == 2 && resultCode == RESULT_OK && data != null) {\n ArrayList<String> text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n String confirmation = text.get(0);\n Log.v(\"CASE2\", \"confirmation in case 2 is \" + confirmation);\n if (confirmation.toLowerCase().equals(\"yes\")) {\n \tLog.v(\"CASE2\", \"message in case 2 is \" + result);\n if (result != null) {\n \tString body = result;\n \n \tString number = num;\n \t\tSmsManager sms = SmsManager.getDefault();\n \t\tsms.sendTextMessage(number, null, body, null, null);\n \t\twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n \t\ttts.speak(\"Message sent\", TextToSpeech.QUEUE_FLUSH, null);\n \t\twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n \t// send message\n }\n } else {\n \twhile(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n tts.speak(\"Please try again.\", TextToSpeech.QUEUE_FLUSH, null);\n while(tts.isSpeaking()) {\n \ttry {\n \t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t// TODO Auto-generated catch block\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n }\n recordMessage(num);\n }\n \n\n \t\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {\n // Fill the list view with the strings the recognizer thought it could have heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n String[] match = new String[matches.size()];\n match = matches.toArray(match);\n AsyncTaskRunner runner = new AsyncTaskRunner(); //Creating an async task to handle the RPC request\n runner.execute(match);\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }",
"public String speak(){\n speechOutput.clear();\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Just speak normally into your phone\");\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);\n try {\n startActivityForResult(intent, VOICE_RECOGNITION);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n\n\n return speechResult;\n }",
"private void listenToSpeech(int returnCode) {\n\t\tIntent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t//indicate package\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());\n\t\t//message to display while listening\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"\");\n\t\t//set speech model\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t//specify number of results to retrieve\n\t\tlistenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n\t\t//start listening\n\t\tstartActivityForResult(listenIntent, returnCode);\n\n\t}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode,\n Intent data) {\n if (requestCode == Constants.SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n spokenText = results.get(0);\n // Do something with spokenText\n Log.i(TAG, \"Spoken Text = \" + spokenText);\n\n if (spokenText.startsWith(\"home\") || spokenText.startsWith(\"work\")) {\n Log.i(TAG, \"Creating Google Api Client\");\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addApi(Wearable.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n mGoogleApiClient.connect();\n }\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }",
"@Override\n public void onResults(Bundle results) {\n recognizedSpeech = (TextView) findViewById(R.id.recognizedSpeech);\n Log.i(\"SRL\", \"onResults\");\n ArrayList<String> matches = results\n .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);\n String text = \"\";\n for (String result : matches)\n text += result + \"\\n\";\n recognizedSpeech.setText(text);\n\n if(!(recognizedSpeech.getText().toString().contains(\"yes\")) &&\n !(recognizedSpeech.getText().toString().contains(\"no\"))){\n convertTextToSpeech(\"A valid response was not detected, please try again.\");\n\n while (m_tts.isSpeaking()) {\n speech = null;\n }\n\n speech = SpeechRecognizer.createSpeechRecognizer(this);\n speech.setRecognitionListener(this);\n speech.startListening(getIntent());\n\n } else if(recognizedSpeech.getText().toString().contains(\"yes\") &&\n recognizedSpeech.getText().toString().contains(\"no\")){\n convertTextToSpeech(\"Both yes and no were detected, please only specify one decision\");\n\n while (m_tts.isSpeaking()) {\n speech = null;\n }\n\n speech = SpeechRecognizer.createSpeechRecognizer(this);\n speech.setRecognitionListener(this);\n speech.startListening(getIntent());\n\n } else if (recognizedSpeech.getText().toString().contains(\"yes\")) {\n PropertySquare square = (PropertySquare) (m_board.getSquare(\n players.get(m_currentTurn).getCurrentPosition()));\n square.setOwnedBy(players.get(m_currentTurn).getName());\n convertTextToSpeech(\"You now own\" + square.getName());\n Log.d(\"buyProperty yes\", square.getOwnedBy());\n\n if (m_manageFunds) {\n players.get(m_currentTurn).subtractMoney(square.getPrice());\n Log.d(\"buyProperty yes\", players.get(m_currentTurn).getName() +\n String.valueOf(players.get(m_currentTurn).getMoney()));\n funds.setText(String.valueOf(players.get(m_currentTurn).getMoney()));\n }\n nextTurnRoll();\n } else if (recognizedSpeech.getText().toString().contains(\"no\")) {\n nextTurnRoll();\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\n {\n if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)\n {\n // Populate the wordsList with the String values the recognition engine thought it heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n \n for(int i=0;i<matches.size();i++)\n {\n \tif(counter==0)\n \t{\n \t\t\n\t \tif(matches.get(i).equals(\"moo\") || matches.get(i).equals(\"moore\") ||\n\t \t\t\tmatches.get(i).equals(\"mou\") || matches.get(i).equals(\"moon\") ||\n\t \t\t\tmatches.get(i).equals(\"movie\") || matches.get(i).equals(\"boo\")\n\t \t|| matches.get(i).equals(\"boohoo\") || matches.get(i).equals(\"boom\"))\n\t \t{\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse{\n\t \t\twrong();\n\t \t\t}\n \t}\n \telse if(counter==1){\n \t\t\n\t \tif(matches.get(i).equals(\"name\") || matches.get(i).equals(\"names\") ||\n\t \t\t\tmatches.get(i).equals(\"nay\") || matches.get(i).equals(\"neigh\") ||\n\t \t\t\tmatches.get(i).equals(\"nee\") || matches.get(i).equals(\"nays\")\n\t \t\t\t|| matches.get(i).equals(\"knee\") || matches.get(i).equals(\"nees\")\n\t \t\t\t|| matches.get(i).equals(\"ne\") || matches.get(i).equals(\"ni\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==2){\n\t \tif(matches.get(i).equals(\"oink\") || matches.get(i).equals(\"on\") ||\n\t \t\t\tmatches.get(i).equals(\"oint\") || matches.get(i).equals(\"point\") ||\n\t \t\t\tmatches.get(i).equals(\"online\") || matches.get(i).equals(\"going\")\n\t \t\t\t|| matches.get(i).equals(\"awning\") || matches.get(i).equals(\"wapking\")){\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==3){\n \t\t//TextView tv = (TextView) findViewById(R.id.text);\n \t\t//tv.setText(\"Sheep says?\");\n\t \tif(matches.get(i).equals(\"ba\") || matches.get(i).equals(\"baa\") ||\n\t \t\t\tmatches.get(i).equals(\"bar\") || matches.get(i).equals(\"bah\") ||\n\t \t\t\tmatches.get(i).equals(\"baba\") || matches.get(i).equals(\"bleach\")\n\t \t\t\t|| matches.get(i).equals(\"please\") || matches.get(i).equals(\"plate\")\n\t \t\t\t|| matches.get(i).equals(\"pa\") || matches.get(i).equals(\"paa\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n \telse if(counter==4){\n\t \tif(matches.get(i).equals(\"quack\") || matches.get(i).equals(\"crack\") ||\n\t \t\t\tmatches.get(i).equals(\"kodak\") || matches.get(i).equals(\"back\") ||\n\t \t\t\tmatches.get(i).equals(\"call back\") || matches.get(i).equals(\"quake\")\n\t \t\t\t|| matches.get(i).equals(\"quiet\")|| matches.get(i).equals(\"quiet\")\n\t \t\t\t|| matches.get(i).equals(\"whack\")\n\t \t\t\t|| matches.get(i).equals(\"quack quack\")){\n\t \t\tif(counter<4)\n\t \t\t{\n\t \t\t\tcounter++;\n\t \t\t\tloadActivity();\n\t \t\t}\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"protected void onActivityResult(int requestCode, int resultCode, Intent data){\n if (resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n for (int i = 0; i < results.size(); i++) {\n result = results.get(i).toLowerCase();\n Log.d(\"SpeechResults\", result);\n speechOutput.add(result);\n\n\n\n\n\n\n }\n if(result.contains(\"top\") && result.contains(\"left\") && boardStatus[0][0].equals(\"a\")){\n topLeft.setText(playerToggle);\n boardStatus[0][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if(((result.contains(\"top\") && result.contains(\"mid\")) || (result.contains(\"top\") && result.contains(\"mod\")) ||\n (result.contains(\"talk\") && ((result.contains(\"mid\") || result.contains(\"mod\")))) ||\n result.contains(\"tau\") &&((result.contains(\"mid\") || result.contains(\"mod\"))) )\n && boardStatus[0][1].equals(\"b\")){\n topMiddle.setText(playerToggle);\n boardStatus[0][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if(result.contains(\"top\") && (result.contains(\"right\") || result.contains(\"write\") || result.contains(\"rat\") || result.contains(\"red\"))\n && boardStatus[0][2].equals(\"c\")){\n topRight.setText(playerToggle);\n boardStatus[0][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if((result.contains(\"cent\") && result.contains(\"left\")) ||\n (result.contains(\"sen\") && result.contains(\"left\"))\n && boardStatus[1][0].equals(\"d\")){\n centerLeft.setText(playerToggle);\n boardStatus[1][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if((result.contains(\"cent\") && (result.contains(\"mid\") || result.contains(\"mod\"))) ||\n (result.contains(\"sen\") && (result.contains(\"mid\") || result.contains(\"mod\"))\n && boardStatus[1][1].equals(\"e\"))){\n centerMiddle.setText(playerToggle);\n boardStatus[1][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if((result.contains(\"cent\") && (result.contains(\"right\") || result.contains(\"write\") || result.contains(\"rat\") || result.contains(\"red\")) ||\n (result.contains(\"sen\") && (result.contains(\"right\") || result.contains(\"write\") || result.contains(\"rat\") || result.contains(\"red\"))))\n && boardStatus[1][2].equals(\"f\")){\n centerRight.setText(playerToggle);\n boardStatus[1][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if(((result.contains(\"bot\") && result.contains(\"left\") ) || (result.contains(\"bat\") && result.contains(\"left\"))) && boardStatus[2][0].equals(\"g\")){\n bottomLeft.setText(playerToggle);\n boardStatus[2][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if(result.contains(\"bot\") && (result.contains(\"mid\") || result.contains(\"mod\"))\n && boardStatus[2][1].equals(\"h\")){\n bottomMiddle.setText(playerToggle);\n boardStatus[2][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n else if(result.contains(\"bot\") && (result.contains(\"right\") || result.contains(\"write\") || result.contains(\"rat\") || result.contains(\"red\")) && boardStatus[2][2].equals(\"i\")){\n bottomRight.setText(playerToggle);\n boardStatus[2][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n\n //If the command was not understandable the user will be asked to repeat their command.\n else{\n\n Toast.makeText(this, \"Please repeat your command.\", Toast.LENGTH_SHORT).show();\n\n speechOutput.clear();\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"We couldn't understand your command. Please try again.\");\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);\n try {\n startActivityForResult(intent, VOICE_RECOGNITION);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n }\n\n\n\n }\n }",
"private void askSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n \"Hi speak something\");\n speakOut(\"Open Mic\");\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n\n }\n }",
"private void speak() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) ;\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Speak the Item\");\n\n startActivityForResult(intent, SPEECH_REQUEST_CODE);\n\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode,\n Intent data) {\n if (requestCode == REQ_CODE_SPEECH_INPUT && resultCode == RESULT_OK) {\n List<String> results = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n String spokenText = results.get(0);\n // Do something with spokenText\n convert.setText(spokenText);\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"@Override\n protected Void call() throws InterruptedException {\n _tempVr.SetTimeout(5);\n _tempVr.SetMicDistance(Protocol.Distance.FAR_MIC);\n\n updateMessage(String.format(\"Speak%s\", System.getProperty(\"line.separator\")));\n\n //instruct the module to listen for a built in word from the 1st wordset\n _tempVr.RecognizeWord(1);\n\n //need to wait until HasFinished has completed before collecting results\n while (!_tempVr.HasFinished()) {\n updateMessage(\".\");\n }\n\n // Once HasFinished has returned true, we can ask the module for the index of the word it recognised. If you're new to using the EasyVR module,\n // download the Easy VR Commander (http://www.veear.eu/downloads/) to interrogate the config of your module and see what the indexes correspond to\n // Here is a standard setup at time of writing for an EASYVR 3 module:\n // 0=Action,1=Move,2=Turn,3=Run,4=Look,5=Attack,6=Stop,7=Hello\n int indexOfRecognisedWord = _tempVr.GetWord();\n\n updateMessage(String.format(\"Response: %d%s\", indexOfRecognisedWord, System.getProperty(\"line.separator\")));\n // updateMessage(String.format(\"Recognition finished%s\", System.getProperty(\"line.separator\")));\n\n return null;\n }",
"@Override\n public Optional<Response> handle(HandlerInput input) {\n log(input, \"Starting request\");\n logSlots(input); // NPE\n\n Map<String, Slot> slots = getSlots(input);\n\n // first part of the speechText, blank author & title variables\n String speechText = \"Your reading list has \" ;\n String title;\n String formattedTitle;\n String author;\n String formattedAuthor;\n\n // iterate through the DDB table\n ScanRequest scanRequest = new ScanRequest().withTableName(\"DefaultReadingList\");\n ScanResult result = client.scan(scanRequest);\n\n for (Map<String, AttributeValue> item : result.getItems()){\n // grab title & author from the item we are on\n title = item.get(\"Title\").toString();\n author = item.get(\"Author\").toString();\n\n // remove weird formatting on title and author strings and add to speechText\n formattedTitle = title.substring(4, title.length()-2);\n formattedAuthor = author.substring(4, author.length()-2);\n speechText = String.format((speechText + \"%s by %s, \"), formattedTitle, formattedAuthor);\n }\n\n log(input, \"Speech text response is \" + speechText);\n\n // response object with a card (shown on devices with a screen) and speech (what alexa says)\n return input.getResponseBuilder()\n .withSpeech(speechText) // alexa says this\n .withSimpleCard(\"GetFromReadingList\", speechText) // alexa will show this on a screen\n .build();\n }",
"com.czht.face.recognition.Czhtdev.Response getResponse();",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n switch (requestCode) {\n case RESULT_SPEECH: {\n if (resultCode == RESULT_OK && null != data) {\n\n ArrayList<String> text = data\n .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n\n txtText.setText(text.get(0));\n\n s = text.get(0);\n s = s.toLowerCase();\n\n switch (s) {\n case \"excited\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Fire);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIRE\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"angry\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Canvas);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"CANVAS\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"relax\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Firefly);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIREFLY\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"crazy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Firework);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"FIREWORK\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"sleepy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Hourglass);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"HOURGLASS\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"thoughtful\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Rain);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"RAIN\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"jazzy\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Ripple);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"RIPPLE\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"sparkle\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Star);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"STAR\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"dance\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Traffic);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"TRAFFIC\", Toast.LENGTH_SHORT).show();\n break;\n }\n case \"do something\": {\n pulseHandler.SetLEDPattern(PulseThemePattern.PulseTheme_Wave);\n Toast.makeText(getApplicationContext(), \"LED pattern shuffled successfully to \" + \"WAVE\", Toast.LENGTH_SHORT).show();\n break;\n }\n }\n break;\n }\n\n }\n }\n }",
"public void startSpeechRecognition() {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-GB\");\n\t\ttry {\n\t\t\tstartActivityForResult(i, REQUEST_OK);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n try {\n if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == Activity.RESULT_OK) {\n final ArrayList<String> matches = data\n .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n\n String voiceResult = matches.get(0);\n final String voiceResultNoWhitespace = voiceResult.replace(\" \", \"\");\n\n if (DataHelper.isWordOnlyNumeric(voiceResultNoWhitespace)) {\n voiceResult = voiceResultNoWhitespace;\n }\n\n mSearchField.setText(\"\");\n mSearchField.setText(voiceResult);\n }\n if (requestCode == SCAN_BARCODE_REQUEST_CODE && resultCode == Activity.RESULT_OK) {\n final String contents = data.getStringExtra(\"SCAN_RESULT\");\n\n mSearchField.setText(\"\");\n mSearchField.setText(contents);\n }\n\n super.onActivityResult(requestCode, resultCode, data);\n }\n catch (final Exception e) {\n showSearchErrorDialog();\n logError(e);\n }\n }",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data)\n\t{\n\t\tSystem.out.println(\"Came here\");\n\t\tString matchedWord = null;\n\t\tExerciseEntity fe = null;\n\t\tExerciseDatabase db = new ExerciseDatabase(RExerciseActivity.this);\n\t\tif (requestCode == VOICE_REQUEST_CODE && resultCode == RESULT_OK)\n\t\t{\n\t\t\t// Populate the wordsList with the String values the recognition engine thought it heard\n\t\t\tArrayList<String> matches = data.getStringArrayListExtra(\n\t\t\t\t\tRecognizerIntent.EXTRA_RESULTS);\n\t\t\tSystem.out.println(\"Printing matched words\");\n\t\t\tmatchedWord = matches.get(0);\n\t\t}\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\n\t\tEditText text3 = (EditText) findViewById(R.id.input_workout_type);\n\n\t\tif (matchedWord != null)\n\t\t{\n\t\t\ttext3.setText(matchedWord);\n\t\t\tdb.open();\n\t\t\tfe = db.getOneExercise(matchedWord);\n\t\t\tTextView calt = (TextView) findViewById(R.id.input_calpermin);\n\t\t\tif (fe != null)\n\t\t\t{\n\t\t\t\tcalt.setText(String.valueOf(fe.getCaloriesPerMin()));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcalt.setText(\"Exercise not found\");\n\t\t\t}\n\t\t\tdb.close();\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttext3.setText(\"No Match\");\n\t\t}\n\n\n\t}",
"private void manageSpeechRecognition() {\n\n mRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, Locale.getDefault().getLanguage().trim());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName());\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 100);\n\n mRecognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);\n\n mSongSpeechRecognitionListener = new SongSpeechRecognitionListener(mRippleBackground, mFloatingActionButton);\n\n mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n mSpeechRecognizer.setRecognitionListener(mSongSpeechRecognitionListener);\n\n }",
"void onResult(AIResponse result);",
"private void display() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n// Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n }",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\n\t\t// If REQUEST_ENABLE_BT, then this result is from the\n\t\t// activity that allows the user to enable Bluetooth.\n\t\tif (requestCode == REQUEST_ENABLE_BT) {\n\t\t\tlogger.debug(\"onActivityResult(): Received response for REQUEST_ENABLE_BT\");\n\t\t\tonEnableBluetoothResponse(resultCode);\n\t\t}\n\n\t\t// If REQUEST_DISCOVER_DEVICE, then this result is from the activity that allows\n\t\t// the user to select a Bluetooth device to which to connect.\n\t\telse if (requestCode == REQUEST_DISCOVER_DEVICE) {\n\t\t\tlogger.debug(\"onActivityResult(): Received response for REQUEST_DISCOVER_DEVICE\");\n\t\t\tonDiscoverDeviceResponse(resultCode, data);\n\t\t}\n\n\t\t// If REQUEST_TILE_TYPE, then this result is from the activity that allows the user to change the type of a\n\t\t// tile.\n\t\telse if (requestCode == REQUEST_TILE_TYPE) {\n\t\t\tlogger.debug(\"onActivityResult(): Received response for REQUEST_TILE_TYPE\");\n\t\t\tonChangeTileResponse(resultCode, data);\n\t\t}\n\n\t\t// If REQUEST_GOAL_TYPE, then this result is from the activity that allows the user to change the goal type.\n\t\telse if (requestCode == REQUEST_GOAL_TYPE) {\n\t\t\tlogger.debug(\"onActivityResult(): Received response for REQUEST_GOAL_TYPE\");\n\t\t\tonChangeGoalResponse(resultCode, data);\n\t\t}\n\n\t\t// If REQUEST_SELECT_SYMPTOM, then this result is from the activity that allows the user to add a new symptom.\n\t\telse if (requestCode == REQUEST_SELECT_SYMPTOM) {\n\t\t\tlogger.debug(\"onActivityResult(): Received response for REQUEST_SELECT_SYMPTOM\");\n\t\t\tonSelectSymptomResponse(resultCode, data);\n\t\t}\n\t}",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t\n\t // Make sure the request was successful\n\t if (resultCode == RESULT_OK) {\n\t Bundle resultBundle = data.getExtras();\n\t String decodedData = resultBundle.getString(\"DATA_RESULT\");\n\t String scanAction = resultBundle.getString(\"SCAN_ACTION\");\n\t\t \n\t\t if(scanAction != null && scanAction.equalsIgnoreCase(SCAN_TYPE)){\n\t\t\t // With the decoded data use session.get entity etc... then call server to get entity info\n\t\t\t try{\n\t\t\t\t processData(decodedData);\n\t\t\t }catch(Exception e){\n\t\t\t\t Toast.makeText(this, \"Unknown barcode format: please scan a valid barcode\", Toast.LENGTH_LONG).show();\n\t\t\t\t launchScanner(SCAN_TYPE);\n\t\t\t }\n\t\t\t \n\t\t }else{\n\t\t\t Toast.makeText(this, \"NO SCANNING ACTION\", Toast.LENGTH_LONG).show();\n\t\t\t launchScanner(SCAN_TYPE);\n\t\t }\n\t\t \n\t }else{\n\t\t finish();\t\t \n\t }\t \n\t}",
"private void recognize() {\n //Setup our Reco transaction options.\n Transaction.Options options = new Transaction.Options();\n options.setDetection(resourceIDToDetectionType(R.id.long_endpoint));\n options.setLanguage(new Language(\"eng-USA\"));\n options.setEarcons(startEarcon, stopEarcon, errorEarcon, null);\n\n //Add properties to appServerData for use with custom service. Leave empty for use with NLU.\n JSONObject appServerData = new JSONObject();\n //Start listening\n recoTransaction = speechSession.recognizeWithService(\"M10253_A3221\", appServerData, options, recoListener);\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"us-US\");\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == ACTIVITY_ONE_REQUEST && resultCode == RESULT_OK) {\n if (data.hasExtra(ACTIVITY_ONE_RESULT)) {\n String result = data.getExtras().getString(ACTIVITY_ONE_RESULT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n }\n if (requestCode == ACTIVITY_TWO_REQUEST && resultCode == RESULT_OK) {\n /**\n * Possibly of returning two different results from Activity Two\n */\n if (data.hasExtra(ACTIVITY_TWO_RESULT)) {\n String result = data.getExtras().getString(ACTIVITY_TWO_RESULT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n if (data.hasExtra(ACTIVITY_TWO_RESULT_DIFFERENT)) {\n String result = data.getExtras().getString(ACTIVITY_TWO_RESULT_DIFFERENT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void startVoiceRecognitionActivity() {\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"What food are you stocking right now?\");\n\t\tstartActivityForResult(intent, SPEECH_REQCODE);\n\t}",
"private void handleMessage(Message msg) {\n switch (msg.what) {\n case R.id.clientReady: // 음성인식 준비 가능\n txtResult.setText(\"Connected\");\n writer = new AudioWriterPCM(Environment.getExternalStorageDirectory().getAbsolutePath() + \"/NaverSpeechTest\");\n writer.open(\"Test\");\n break;\n case R.id.audioRecording:\n writer.write((short[]) msg.obj);\n break;\n case R.id.partialResult:\n mResult = (String) (msg.obj);\n mResult += mResult;\n txtResult.setText(mResult);\n break;\n case R.id.finalResult: // 최종 인식 결과\n SpeechRecognitionResult speechRecognitionResult1 = (SpeechRecognitionResult) msg.obj;\n List<String> results1 = speechRecognitionResult1.getResults();\n StringBuilder strBuf1 = new StringBuilder();\n for(String result : results1) {\n strBuf1.append(result);\n //strBuf.append(\"\\n\");\n break;\n }\n mResult = strBuf1.toString();\n txtResult.setText(mResult);\n\n requestChatbot();\n\n break;\n case R.id.recognitionError:\n if (writer != null) {\n writer.close();\n }\n mResult = \"Error code : \" + msg.obj.toString();\n txtResult.setText(mResult);\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n case R.id.clientInactive:\n if (writer != null) {\n writer.close();\n }\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n }\n }",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (requestCode == VOICE_RECOGNITION_REQUEST_CODE\n\t\t\t\t&& resultCode == RESULT_OK) {\n\t\t\t// Fill the list view with the strings the recognizer thought it\n\t\t\t// could have heard\n\t\t}\n\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t}",
"public void makeDecision(String speech , List<WordResult> speechWords) {\r\n\t\tVoiceManager vm =VoiceManager.getInstance();\r\n\t\tVoice voice;\r\n\t\tvoice=vm.getVoice(\"mbrola_us3\");\r\n\t\tvoice.allocate();\r\n\t\tSystem.out.println(speech);\r\n\t\t//System.out.println(speech+\"fdsf\");\r\n\t\t if(speech.equalsIgnoreCase(\"shutdown computer\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\" Shuting down the computer\");\r\n\t\t \tRuntime rm=Runtime.getRuntime();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tProcess proc=rm.exec(\"shutdown -s -t 0\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e)\r\n\t\t\t\t{}\r\n\t\t\t\t\r\n\r\n\t\t \t}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"restart computer\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"restarting the computer\");\r\n\t\t \tRuntime rm=Runtime.getRuntime();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tProcess proc=rm.exec(\"shutdown -r -t 0\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e)\r\n\t\t\t\t{}\r\n\t\t\t\t\r\n\t\t \t}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t }\r\n\t\t \r\n\t\t else if(speech.equalsIgnoreCase(\"who is smart\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"Abhay bhadouriya is smartest person alive in this world\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who is ugly\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"your sister and friends are the most ugliest persons in the world \");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"what is time\"))\r\n\t\t {\r\n\t\t \tDate dm=new Date();\r\n\t\t \tint h=dm.getHours();\r\n\t\t \tint m=dm.getMinutes();\r\n\t\t \tif(h>12)\r\n\t\t \t{\r\n\t\t \t\th=h-12;\r\n\t\t \t}\r\n\t\t \t\r\n\t\t \ttry {voice.speak(\"TIME is\"+h+\"Hour\"+m+\"Minutes\" );}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"say hello \"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"Hello this is your computer\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"please sleep\"))\r\n\t\t {\r\n\t\t \ttry {voice.speak(\"no i don't wont to sleep\");}\r\n\t\t \tcatch(Exception e)\r\n\t\t \t{\r\n\t\t \t\t\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open facebook\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"facebook\");\r\n\t\t \t FUNC.facebook();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open google\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"google\");\r\n\t\t \t FUNC.google();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open youtube\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"youtube\");\r\n\t\t \t FUNC.youtube();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open gmail\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"gmail\");\r\n\t\t \t FUNC.gmail();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"play music\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \t\tvoice.speak(\"music\");\r\n\t\t \t FUNC.pmusic();\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"volume up\"))\r\n\t\t {\r\n\t\t \tvoice.speak(\"volume increasing by 10\");\r\n\t\t \t\tvolume.up();\r\n\t\t \t\t\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"volume down\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t\t voice.speak(\"volume decreasing by 10\");\r\n\t \t\tvolume.down();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"show desktop\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"Showing desktop\");\r\n\t\t\t FUNC.desktop();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"how are you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"i'm fine and you \");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"what day is today\"))\r\n\t\t {\r\n\t\t\t Date dd=new Date();\r\n\t\t\t int i=dd.getDay();\r\n\t\t\t\tif(i==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is sunday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is monday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==2)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is tuesday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==3)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is wednesday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==4)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is thursday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==5)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is friday\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i==6)\r\n\t\t\t\t{\r\n\t\t\t\t\tvoice.speak(\"today is saturday\");\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to right\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.right();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to left\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.left();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to up\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t emotion.up();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"move to down\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.down();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"select this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.select();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"view its property\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.property();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"view item menu\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.viewmenu();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on mouse by keyboard\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.turnon();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close this window tab\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.close();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"switch window tab\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t emotion.switcht();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"ok dude take some rest\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t voice.speak(\"have a nice day\");\r\n\t\t\t voice.speak(\"i'm very lucky to have a master like you sir \");\r\n\t\t\t voice.speak(\"good night my suprier great master\");\r\n\t\t\t System.exit(0);\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn off wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"turn on bluetooth\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t try{\r\n\t \t\t Process p ;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c fsquirt\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the notepad\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start notepad\");\r\n\t \t\t // System.out.println(\"inside\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t } else if(speech.equalsIgnoreCase(\"close the notepad\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t//resultText=\"\";\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im notepad.exe /f\");\r\n\t \t\t // System.out.println(\"inside\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the command\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t\t\tProcess p;\r\n\t \t\t\t\tp = Runtime.getRuntime().exec(\"cmd /c start cmd\");\t\t\t\t\r\n\t \t\t\t\t}catch(Exception er)\r\n\t \t\t\t\t{}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the command\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\t\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im cmd.exe /f\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the browser\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start chrome.exe\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the browser\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im chrome.exe /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the control panel\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c control\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the control panel\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c control taskkill /im control /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the paint\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start mspaint\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"close the paint\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c start taskkill /im mspaint.exe /f\");\r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the task manager\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t p = Runtime.getRuntime().exec(\"cmd /c start taskmgr.exe\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open the task manager\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t\t\t Process p;\r\n\t\t\t \tp = Runtime.getRuntime().exec(\"cmd /c start taskkill /im taskmgr.exe /f\");\r\n\t\t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open power option\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c powercfg.cpl\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"open windows security center\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t try{\r\n\t \t\t Process p;\r\n\t \t\t p = Runtime.getRuntime().exec(\"cmd /c wscui.cpl\");\r\n\t \t\t \r\n\t \t\t }catch(Exception ae){}\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"copy this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok item is copied\");\r\n\t\t\t basiccontrolls.copy();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"paste here selected item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"item is pasted\");\r\n\t\t\t basiccontrolls.paste();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"cut this item\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok item is cut\");\r\n\t\t\t basiccontrolls.cut();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"go back\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok going to previous page\");\r\n\t\t\t basiccontrolls.back();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"show me my beautiful face\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"you look like a donkey\");\r\n\t\t\t basiccontrolls.camera();\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who the hell are you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"hello\");\r\n\t\t\t voice.speak(\"i am computer \");\r\n\t\t\t voice.speak(\"here i'm assist by you \");\r\n\t\t\t voice.speak(\"i will do anything what ever you told me todo and \"+\" \"+\" what instruction are feeded in my dictionary\");\r\n\t\t\t voice.speak(\"Thank you for asking \");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"who loves you\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"no one loves me \");\r\n\t\t\t voice.speak(\"except my charger \");\r\n\t\t\t voice.speak(\"but more impoertantly i looks far handsome than you \");\r\n\t\t\t voice.speak(\"you peace of shit \");\r\n\t\t\t voice.speak(\"your face is look like a monkey\");\r\n\t\t }\r\n\t\t else if(speech.equalsIgnoreCase(\"do you like engineering\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"no\");\r\n\t\t\t voice.speak(\"I hate engineering\");\r\n\t\t\t voice.speak(\"you ruined my life \");\r\n\t\t }\r\n\t\t/* else if(speech.equalsIgnoreCase(\"turn off wifi\"))\r\n\t\t {\r\n\t\t\t voice.speak(\"ok\");\r\n\t\t\t volume.wifi();\r\n\t\t }*/\r\n\r\n\t}",
"private void doSearchTest() {\n Log.d(TAG, \"doSearchTest: called; waiting for user input\");\n\n final String callbackUrl = \"urn:ietf:wg:oauth:2.0:oob\";\n final String applicationId = \"c2b235f2620e362157a40aec609e737fe5a2547784933e00201ff90358e092c5\";\n final String secret = \"bee75fbb20ce6b45b64113b44208d12aeca02121fee8ea40f1bd9f44b491ba1c\";\n final String authorizationCode = \"ad2311b2860d224f89c32b7dfd4cb99550ba358aef412fae9ad11b52957a8930\";\n// final String callbackUrl = \"urn:ietf:wg:oauth:2.0:oob\";\n// final String applicationId = \"ed87cdb095b49b1fab3231f69ea86311365528aa3e8b3a499666a1030ef58c56\";\n// final String secret = \"89ddacc015dab3471b73bbe45ebdb2a57ae44a9cb7ec3f0e08fb4dca0aaa37fa\";\n// final String authorizationCode = \"5dd588086e5decedad948d1def60f8853b494ba14642a2942cc5761bd44ad97c\";\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Audiosearch client = new Audiosearch().setApplicationId(applicationId).setSecret(secret).build();\n// Audiosearch client = new Audiosearch(applicationId, secret).setSignature(authorizationCode).build();\n// .setApplicationId(applicationId)\n// .setSecret(secret)\n// .build();\n\n Call<EpisodeQueryResult> call = client.searchEpisodes(\"Obama\");\n Log.d(TAG, \"run: Call<EpisodeQueryResult> \" + call);\n Response response = call.execute();\n EpisodeQueryResult eqr = (EpisodeQueryResult) response.body();\n Log.d(TAG, \"run: \" + eqr.getQuery());\n Log.d(TAG, \"run: \" + call.isExecuted());\n Log.d(TAG, \"run: \" + response.message());\n Log.d(TAG, \"run: \" + response.isSuccessful());\n List<EpisodeResult> list = eqr.getResults();\n for (EpisodeResult episodeResult : list) {\n for (AudioFile audiofile : episodeResult.getAudioFiles()) {\n// relatedEpisodes += episode.getTitle() + \" \" + audiofile.getMp3() + \" \";\n SearchAudio sa = new SearchAudio(episodeResult, audiofile);\n Log.d(\"searched\", sa.getShow_title());\n // sa.getMp3() gets the mp3 in String format\n Log.d(\"searched\", sa.getMp3());\n }\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.d(\"search test\",\"IOException\");\n } catch (CredentialsNotFoundException e) {\n e.printStackTrace();\n Log.d(\"search test\",\"CredentialsNotFoundException\");\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(\"search test\", \"Exception\");\n }\n }\n });\n thread.start();\n Log.d(\"doSearchTest\", \"initialized thread...\");\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == RESULT_OK && resultCode == RESULT_OK) {\n // Fill the list view with the strings the recognizer thought it could have heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n\n if (matches.size() >= 0) {\n\n CURRENT_1 = 7;\n CURRENT_1_IMAGE = R.drawable.logo_user;\n showDialog(CHOOSE_METHOD_DIALOG);\n } else {\n\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"@Override\n public void onClick(View v) {\n StringRequest stringRequest = searchNameStringRequest(output.getText().toString(),\"en\",\"ar\");\n\n\n\n // executing the request (adding to queue)\n queue.add(stringRequest);\n\n String toSpeak = output.getText().toString();\n\n t1.speak(toSpeak, TextToSpeech.QUEUE_FLUSH, null);\n }",
"@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,\n @NonNull int[] grantResults) {\n if (AUDIO_ECHO_REQUEST != requestCode) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n return;\n }\n\n if (grantResults.length != 1 ||\n grantResults[0] != PackageManager.PERMISSION_GRANTED) {\n /*\n * When user denied the permission, throw a Toast to prompt that RECORD_AUDIO\n * is necessary; on UI, we display the current status as permission was denied so\n * user know what is going on.\n * This application go back to the original state: it behaves as if the button\n * was not clicked. The assumption is that user will re-click the \"start\" button\n * (to retry), or shutdown the app in normal way.\n */\n Toast.makeText(getApplicationContext(),\n getString(R.string.NeedRecordAudioPermission),\n Toast.LENGTH_SHORT)\n .show();\n return;\n }\n\n // The callback runs on app's thread, so we are safe to resume the action\n startApp();\n }",
"public void recordMessage2(String result, String number) {\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-US\");\n\n startActivityForResult(intent, 2);\n }",
"@Override\n public void OnSuccessfullResponse(String result) {\n String resultSet[] = result.split(\":\");\n switch (resultSet[0]){\n case \"topoffers\":\n GetPromotions promotionsTask = (GetPromotions) new GetPromotions(resultSet[1]);\n promotionsTask.setContext(this);\n promotionsTask.setListener(this);\n promotionsTask.execute();\n break;\n case \"aisle\":\n GetAisleRecommendationsTask aisleRecommendationsTask = (GetAisleRecommendationsTask) new GetAisleRecommendationsTask(resultSet[1]);\n aisleRecommendationsTask.setContext(this);\n aisleRecommendationsTask.setListener(this);\n aisleRecommendationsTask.execute();\n break;\n case \"thankyou\":\n default:\n Intent intent = new Intent(getApplicationContext(), ThankYouActivity.class);\n startActivity(intent);\n break;\n }\n\n }",
"void start() {\n\t\t\n\t\ttts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n\t\t\t@Override\n\t\t\tpublic void onInit(int status) {\n\t\t\t\tif (status != TextToSpeech.ERROR) {\n\t\t\t\t\ttts.setLanguage(Locale.KOREAN);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\trecognizerIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());\n\t\trecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"ko-KR\");\n\t\t\n\t\tmRecognizer = SpeechRecognizer.createSpeechRecognizer(this);\n\t\tmRecognizer.setRecognitionListener(recognitionListener);\n\t\t\n\t\t\n\t\tV_button.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tif (AL_keywordSelected.size() == 0)\n\t\t\t\t\tstartVoice();\n\t\t\t\telse {\n\t\t\t\t\tString str = \"\";\n\t\t\t\t\t\n\t\t\t\t\tfor (String s : AL_keywordSelected)\n\t\t\t\t\t\tstr += s + \" \";\n\t\t\t\t\t\n\t\t\t\t\tsendMsg(str);\n\t\t\t\t\tinitKeyword();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tfirestore.collection(\"command\")\n\t\t\t.addSnapshotListener(new EventListener<QuerySnapshot>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onEvent(@Nullable QuerySnapshot snapshots, @Nullable FirebaseFirestoreException e) {\n\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\tlog(\"listen:error\" + e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor (DocumentChange dc : snapshots.getDocumentChanges()) {\n\t\t\t\t\t\tQueryDocumentSnapshot document = dc.getDocument();\n\t\t\t\t\t\t\n\t\t\t\t\t\tString key = document.getId();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\tswitch (dc.getType()) {\n\t\t\t\t\t\t\t\tcase ADDED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"New: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase MODIFIED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Modified: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tCommand oldCommand = mapData.get(key);\n\t\t\t\t\t\t\t\t\tif (command.responseTimestamp.getSeconds() != oldCommand.responseTimestamp.getSeconds()) {\n\t\t\t\t\t\t\t\t\t\tfor (String waitingKey : waitingKeys) {\n\t\t\t\t\t\t\t\t\t\t\tif (waitingKey.equals(key)) {\n\t\t\t\t\t\t\t\t\t\t\t\taddOutputMessage(command.response);\n\t\t\t\t\t\t\t\t\t\t\t\twaitingKeys.remove(key);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.put(key, command);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase REMOVED:\n\t\t\t\t\t\t\t\t\tcommand = new Command(key, document);\n\t\t\t\t\t\t\t\t\tlog(\"Removed: \" + key);\n\t\t\t\t\t\t\t\t\tlog(command.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tmapData.remove(key);\n\t\t\t\t\t\t\t\t\tupdateKeyword();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\tlog(\"error: \" + key);\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t}",
"@Override\n public void run() {\n URL url;\n HttpURLConnection ur1Connection = null; //HttpsURLConnection aiso avaitab1e\n try {\n\n //String service = reqUrl; // call rhymebrain\n String service = \"https://rhymebrain.com/talk?\"; // call rhymebrain\n //String parm = \"getRhymes&word=\" + word;\n //String queryString = URLEncoder.encode(parm, \"UTF-8\");\n String queryString = \"getRhymes&word=\" + word + \"&maxResults=\" + String.valueOf(MAX_RESULTS);\n //try to process url and connect to it\n url = new URL( service + \"function=\" + queryString);\n Log.d(\"which URL: \", String.valueOf(url));\n ur1Connection = (HttpURLConnection)url.openConnection();\n ur1Connection.setRequestMethod(\"GET\");\n\n // Set connection timeout and read timeout value.\n ur1Connection.setConnectTimeout(70000);\n ur1Connection.setReadTimeout(70000);\n\n //create an input stream and stream reader from the connection\n InputStream inputStream = ur1Connection.getInputStream();\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n\n //get some data from the stream\n int data = inputStreamReader.read();\n //string for collecting all output\n output = \"\";\n //if the stream is not empty\n while(data != -1) {\n //turn what we read into a char and print it\n char current = (char) data;\n output += current;\n data = inputStreamReader.read();\n\n //Log.d(\"Network\", output);\n }\n Log.d(\"Network\", output);\n parseJSON(output);\n int i =0;\n }catch (Exception e) {\n Log.d( \"Network\", e.toString());\n }finally {\n if (ur1Connection != null) {\n ur1Connection.disconnect();\n ur1Connection = null;\n }\n }\n }",
"private void loadSpeechActivity() {\n PackageManager pm = getPackageManager();\n List<ResolveInfo> activities = pm.queryIntentActivities(\n new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);\n if (activities.size() == 0)\n {\n voiceSupport=0;\n }\n\t\t\n\t}",
"@Override\n public void processFinish(int response_code, String response_message, JSONObject output) {\n loading--;\n if (loading == 0) {\n loadingbar.setVisibility(View.GONE);\n } else System.out.println(\"INFO: Open web calls \" + loading);\n\n //Server Response\n response.append(response_code + \" \" + response_message + \"\\r\\n\");\n\n if (response_code == 200 && output != null) {\n trigger = TriggerDetails.fromJson(output);\n\n TextView value_id = getView().findViewById(R.id.value_id);\n value_id.setText(trigger.getId());\n\n TextView value_title = getView().findViewById(R.id.value_title);\n value_title.setText(trigger.getTitle());\n\n Switch active = getView().findViewById(R.id.value_active);\n active.setChecked(trigger.getActive());\n\n Switch current = getView().findViewById(R.id.value_state);\n current.setChecked(trigger.getState());\n\n if (trigger.getType() == 0) {\n\n updateStartDate();\n updateStartTime();\n\n updateEndDate();\n updateEndTime();\n\n Spinner interval = getView().findViewById(R.id.value_interval);\n interval.setSelection(trigger.getInterval());\n } else if (trigger.getType() == 1) {\n Button source = getView().findViewById(R.id.value_rule);\n source.setText(trigger.getSource());\n\n Spinner relop = getView().findViewById(R.id.value_relop);\n relop.setSelection(trigger.getRelop());\n\n TextView threshold = getView().findViewById(R.id.value_threshold);\n threshold.setText(Integer.toString(trigger.getThreshold()));\n\n NegativeProgressSeekerBar tolerance = getView().findViewById(R.id.value_tolerance);\n tolerance.setProgress(25 + trigger.getTolerance());\n\n Spinner interval = getView().findViewById(R.id.value_interval);\n interval.setSelection(trigger.getInterval());\n } else if (trigger.getType() == 2) {\n Spinner relop = getView().findViewById(R.id.value_relop);\n relop.setSelection(trigger.getRelop());\n\n TextView threshold = getView().findViewById(R.id.value_threshold);\n threshold.setText(Integer.toString(trigger.getThreshold()));\n\n TextView counter = getView().findViewById(R.id.value_counter);\n counter.setText(trigger.getCount().toString());\n } else if (trigger.getType() == 3) {\n\n }\n }\n }",
"@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t\n\t\tyoutubeFragment = (YouTubeFragment) getChildFragmentManager().findFragmentById(R.id.youtube_fragment);\n\t\t\n\t\tpresentSearchTerm = \"\";\n\t\twordList = \"\";\n\t\t\n if (requestCode==REQUEST_OK && resultCode==-1) {\n \t\tArrayList <String> thingsYouSaid = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n \t\tspokenPhrase = thingsYouSaid.get(0);\n \t\tif (spokenPhrase.length() == 0) {\n \t\t\tToast.makeText(getActivity(), \"You said nothing!\", Toast.LENGTH_SHORT).show();\n \t\t}\n \t\telse {\n\t \t\twords = spokenPhrase.split(\" \");\n\t \t\tindividualWords = new ArrayList<String>(Arrays.asList(words));\n\t \t\t\n\t \t\tif (spokenPhrase.contains(\"youtube\")) {\n\t \t\t\tindividualWords.remove(\"youtube\");\n\t \t\t\tpresentSearchTerm = \"YouTube search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"search youtube for\")) {\n\t \t\t\tindividualWords.remove(\"search\");\n\t \t\t\tindividualWords.remove(\"youtube\");\n\t \t\t\tindividualWords.remove(\"for\");\n\t \t\t\tpresentSearchTerm = \"YouTube search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"on youtube\")) {\n\t \t\t\tindividualWords.remove(\"on\");\n\t \t\t\tindividualWords.remove(\"youtube\");\n\t \t\t\tpresentSearchTerm = \"YouTube search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"from youtube\")) {\n\t \t\t\tindividualWords.remove(\"from\");\n\t \t\t\tindividualWords.remove(\"youtube\");\n\t \t\t\tpresentSearchTerm = \"YouTube search results for: \";\n\t \t\t}\n\t \t\t\n\t \t\tif (spokenPhrase.contains(\"last fm\")) {\n\t \t\t\tindividualWords.remove(\"last\");\n\t \t\t\tindividualWords.remove(\"fm\");\n\t \t\t\tpresentSearchTerm = \"Last.fm search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"search last fm for\")) {\n\t \t\t\tindividualWords.remove(\"search\");\n\t \t\t\tindividualWords.remove(\"last\");\n\t \t\t\tindividualWords.remove(\"fm\");\n\t \t\t\tindividualWords.remove(\"for\");\n\t \t\t\tpresentSearchTerm = \"Last.fm search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"on last fm\")) {\n\t \t\t\tindividualWords.remove(\"on\");\n\t \t\t\tindividualWords.remove(\"last\");\n\t \t\t\tindividualWords.remove(\"fm\");\n\t \t\t\tpresentSearchTerm = \"Last.fm search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"from last fm\")) {\n\t \t\t\tindividualWords.remove(\"from\");\n\t \t\t\tindividualWords.remove(\"last\");\n\t \t\t\tindividualWords.remove(\"fm\");\n\t \t\t\tpresentSearchTerm = \"Last.fm search results for: \";\n\t \t\t}\n\t\n\t \t\tif (spokenPhrase.contains(\"spotify\")) {\n\t \t\t\tindividualWords.remove(\"spotify\");\n\t \t\t\tpresentSearchTerm = \"Spotify search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"search spotify for\")) {\n\t \t\t\tindividualWords.remove(\"search\");\n\t \t\t\tindividualWords.remove(\"spotify\");\n\t \t\t\tindividualWords.remove(\"for\");\n\t \t\t\tpresentSearchTerm = \"Spotify search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"on spotify\")) {\n\t \t\t\tindividualWords.remove(\"on\");\n\t \t\t\tindividualWords.remove(\"spotify\");\n\t \t\t\tpresentSearchTerm = \"Spotify search results for: \";\n\t \t\t}\n\t \t\tif (spokenPhrase.contains(\"from spotify\")) {\n\t \t\t\tindividualWords.remove(\"from\");\n\t \t\t\tindividualWords.remove(\"spotify\");\n\t \t\t\tpresentSearchTerm = \"Spotify search results for: \";\n\t \t\t}\n\t \t\t\t\n\t \t\tfor (int x = 0; x < individualWords.size(); x++) {\n\t \t\t\twordList += individualWords.get(x) + \" \";\n\t \t\t}\n\t \n\t \n\t\t if (presentSearchTerm == \"\") {\n\t\t \tpresentSearchTerm = \"Search results for: \";\n\t\t }\n\t\t \n\t\t presentSearchTerm += wordList;\n\t\t\t\t\n\t\t\t\tnew CommunicateWithYouTubeTask().execute(wordList);\n \t\t}\n\t }\n\t}",
"public void showSpeechInput(View v) {\n\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Say something\");\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(this, \"Speech To Text not supported\", Toast.LENGTH_LONG).show();\n }\n }",
"@Override\n\tpublic void onEvent(String name, String params, byte[] data, int offset,\n\t\t\tint length) {\n\t\tString result = \"name:\" + name;\n\t\t//if(params != null && !params.isEmpty()){\n\t\t//\tresult+=\";params:\"+params;\n\t\t//}\n\t\tif(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_PARTIAL)){\n\t\t\tif(params.contains(\"\\\"final_result\\\"\")){\n\t\t\t\tresult += \"\\n\"+\"语义解析结果:\" + params.substring(45, 47);\n\t\t\t\tif(result.contains(\"前进\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了前进!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_FORWARD);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"后退\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了后退!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_BACKWARD);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"左转\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了左转!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_LEFT);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"右转\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了右转!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_RIGHT);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"停\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了停止!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_STOP);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"避障\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了避障!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_AVOID);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"跟踪\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了跟踪!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_FOLLOW);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"抓取\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了抓取!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\tIntent intent = new Intent();\n\t\t\t\t\tintent.setClass(MainActivity.this, GraspActivity.class);\n\t\t\t\t\tMainActivity.this.startActivity(intent);\n\t\t\t\t\tfinish();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(data != null){\n\t\t\tresult += \";data length=\" + data.length;\n\t\t}\n\t\t\n\t\t\n\t\t/*if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_READY)){\n\t\t\tresult +=\"引擎准备就绪,可以开始说话\";\n\t\t}else if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_BEGIN)){\n\t\t\tresult += \"检测到用户已经开始说话\";\n\t\t}else if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_END)){\n\t\t\tresult += \"检测到用户已经停止说话\";\n\t\t\t\n\t\t}else if (data != null) {\n\t\t\tresult += \" ;data length=\" + data.length;\n }*/\n\t\n\t\t//show the result\n\t\tprintresult(result);\n\t\t\n\t}",
"@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\t\n\n\t\tif(requestCode == QUESTION_DETAIL_START_REQUEST && resultCode == QUESTION_DETAIL_END_REQUEST)\n {\n\t\t\tnew ApacheHttpThread().start();\n }\n\t\t\n\t\tif(requestCode == ADD_QUESTION_START_REQUEST && resultCode == ADD_QUESTION_END_REQUEST)\n {\n\t\t\t//Thread.sleep(6);\n\t\t\t new ApacheHttpThread().start();\n\t\t\t\n }\n\t\t\n\t\tif(requestCode == USER_LOGIN_START_REQUEST && resultCode == USER_LOGIN_END_REQUEST)\n {\n\t\t\tLog.d(\"user login start @@@\", \"666666\");\n\n\t\t\t// Toast.makeText(getActivity(), \"66666\", Toast.LENGTH_SHORT).show();\n\t\t\t// Thread.sleep(6);\n\t\t\t// new ApacheHttpThread().start();\n\t\t\tFragment homeContent = null;\n\t\t\thomeContent = new homeFragment();\n\n\t\t\tTestURLActivity fca = (TestURLActivity) getActivity();\n\t\t\tfca.switchContent(homeContent);\n\n }\n\t\t\n\t\tif(requestCode == QUESTION_DETAIL_START_REQUEST_2 && resultCode == QUESTION_DETAIL_END_REQUEST_2)\n {\n\t\t\tToast.makeText(getActivity(), \"77777\", Toast.LENGTH_SHORT).show();\n\t\t\t// Thread.sleep(6);\n\t\t\t// new ApacheHttpThread().start();\n\t\t\tFragment homeContent = null;\n\t\t\thomeContent = new homeFragment();\n\n\t\t\tTestURLActivity fca = (TestURLActivity) getActivity();\n\t\t\tfca.switchContent(homeContent);\n\t\t\t\n\t\t\t\n\t\t\tLog.d(\"question start @@@\", \"777777\");\n\n }\n\t\n\t\t\n\t}",
"private void promptSpeechInput() {\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tRecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n\t\t\t\tgetString(R.string.speech_prompt));\n\t\ttry {\n\t\t\tstartActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n\t\t} catch (ActivityNotFoundException a) {\n\t\t\tToast.makeText(getActivity(),\n\t\t\t\t\tgetString(R.string.speech_not_supported),\n\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t}\n\t}",
"private void displaySpeechRecognizer() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n // Start the activity, the intent will be populated with the speech text\n startActivityForResult(intent, Constants.SPEECH_REQUEST_CODE);\n }",
"public void sendMessage() {\n\n String msg = queryEditText.getText().toString();\n //String response = translateToEnglish(msg);\n TranslateFragment translateFragment = this;\n if (msg.trim().isEmpty()) {\n Toast.makeText(getActivity(), \"Please enter your query!\", Toast.LENGTH_LONG).show();\n } else {\n //introCardView.setVisibility(View.INVISIBLE);\n fadeOutAndHideView(introCardView);\n languageIdentifier.identifyLanguage(msg).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String languageCode) {\n\n if (languageCode != \"und\" && languageCode.equals(\"zh\")) {\n\n\n chineseEnglishTranslator.downloadModelIfNeeded(chineseToEnglishConditions).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n\n chineseEnglishTranslator.translate(msg).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String s) {\n translatedText=s;\n showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n translateReply = msg;\n aiRequest.setQuery(translatedText);\n\n RequestTask requestTask = new RequestTask(translateFragment,getActivity(), aiDataService, customAIServiceContext);\n requestTask.execute(aiRequest);\n }\n });\n\n }\n });\n\n //translate the text to english and then display\n //Log.i(TAG, \"Language: \" + languageCode);\n //Log.i(TAG, \"Language: translated\" + translatedText);\n\n } else {\n translatedText = msg;\n translateReply = msg;\n\n showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n aiRequest.setQuery(translatedText);\n RequestTask requestTask = new RequestTask(translateFragment,getActivity(), aiDataService, customAIServiceContext);\n\n getActivity().runOnUiThread(new Runnable() {\n public void run() {\n requestTask.execute(aiRequest);\n }\n });\n\n\n\n }\n }\n });\n\n\n/* showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n aiRequest.setQuery(msg);\n ChatFragment chFragment;\n RequestTask requestTask = new RequestTask(this,getActivity(), aiDataService, customAIServiceContext);\n requestTask.execute(aiRequest);*/\n }\n }",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n\r\n int thisConversationId = intent.getIntExtra(\"conversation_id\", -1);\r\n Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);\r\n if (remoteInput != null){\r\n CharSequence replyText = remoteInput.getCharSequence(\"voice_reply_key\");\r\n Log.d(\"BasicNotifications\", \"Found voice reply [\" + replyText+ \"] from conversation_id\");\r\n }\r\n }",
"void bot_check_on_user() { // using Watson Speech-to-Text and text-to-Speech functions\r\n String output;\r\n String input;\r\n output: \"Are you okay?\";\r\n input = get voice input;\r\n if (input = \"Yes I’m okay.\") {} // nothing to do\r\n else if (input = \"A bit unwell.\") {\r\n output = \"Please list your symptoms.\";\r\n String symptoms;\r\n symptoms = get voice input;\r\n CFR_check(symptoms);\r\n }\r\n else if (input = …(no sound)) {\r\n CFR_check(\"No response, might be unconscious.\");\r\n else output : \"Please repeat.\";\r\n }",
"private void startVoiceRecognitionActivity()\n {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Voice recognition Demo...\");\n startActivityForResult(intent, REQUEST_CODE);\n }",
"com.czht.face.recognition.Czhtdev.Request getRequest();",
"private void onRecognizeAsyncTaskComplete(OcrResult result){\n \t\n \tif(result != null){\n \tLog.v(TAG, \"Recognize complete (\" + result + \"): \" + result.getText());\n\t \tLog.v(TAG,\"recognize: (6) Bitmap is \" + result.getBitmap());\n try {\n \tif(currentRequest == MSG_RECOGNIZE_TXT){\n \t\tcurrentClient.get().send(Message.obtain(null, MSG_RESULT_TXT, currentRequest, mState.ordinal(), result.getText()));\t\n \t} else {\n \t\tcurrentClient.get().send(Message.obtain(null, MSG_RESULT, currentRequest, mState.ordinal(), result));\n \t}\n } catch (RemoteException e) {\n // The client is dead. \n \t\tLog.e(TAG,\"sendMessage: The client is dead. Message was: \" + result + \" (\" + MSG_RESULT + \")\");\n } catch (NullPointerException e) {\n // The reply to client is does not exist. \n \t\tLog.e(TAG,\"sendMessage: client was null. Message was: \" + result + \" (\" + MSG_RESULT + \")\");\n }\n \n \t} else {\n \t\t// We did not receive an OCR result\n \tLog.i(TAG, \"Recognize complete: No result\");\n \t\tsendMessage(currentClient, MSG_ERROR, currentRequest, getString(R.string.error_failed_recognition));\n \t}\n\n \t// Go back to IDLE (or if the baseApi no longer exists go to UNINITIALIZED\n \tmState = (baseApi != null) ? State.IDLE : State.UNINITIALIZED;\n\t\t\n \t// We're done with the current client. Remove any references to the object.\n currentClient = null;\n }",
"@Override\n protected Integer doInBackground(String... args) {\n \tLog.d(\"LiveMeshEventControllerActivity SetTextForDeviceTask\", \"\");\n \t//Get the meshDisplayEngine object and set the event ID\n \tMeshDisplayControllerApplictaion appObject = (MeshDisplayControllerApplictaion)LiveMeshEventControllerActivity.this.getApplicationContext();\n \tMeshDisplayControllerEngine meshDisplayEngine = appObject.getAppMeshDisplayControllerEngine();\n \n //Send the POST request to the HTTP server and check that an OK is received\n \tInputStream is = null;\n \tint response = 0;\n StringBuffer receivedMessage = new StringBuffer();\n try {\n URL url = new URL(meshDisplayEngine.getServerBaseURL() + \"/event_client_text\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"POST\");\n conn.setDoInput(true);\n conn.setDoOutput(true);\n \n //Add the POST parameters\n List<NameValuePair> params = new ArrayList<NameValuePair>();\n params.add(new BasicNameValuePair(\"event_id\", meshDisplayEngine.eventID));\n params.add(new BasicNameValuePair(\"client_id\", args[0])); \n params.add(new BasicNameValuePair(\"text\", args[1]));\n Log.d(\"LiveMeshEventControllerActivity getQuery\", \"args[0]: \" + args[0] + \" args[1]: \" + args[1]);\n OutputStream os = conn.getOutputStream();\n BufferedWriter writer = new BufferedWriter(\n new OutputStreamWriter(os, \"UTF-8\"), 8192);\n String paramString = URLEncodedUtils.format(params, \"utf-8\");\n Log.d(\"LiveMeshEventControllerActivity getQuery\", \"paramString: \" + paramString);\n writer.write(paramString);\n writer.close();\n os.close();\n \n // Starts the query\n conn.connect();\n \n //For this case just check the response code - we are not interested in the response itself\n response = conn.getResponseCode();\n is = conn.getInputStream();\n is = conn.getInputStream();\n BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8192);\n String line = \"\";\n while ((line = reader.readLine()) != null) {\n \treceivedMessage = receivedMessage.append(line);\n }\n reader.close();\n \n return response;\n \n } catch (IOException e) {\n\t\t\t\t//Some IO problem occurred - dump stack and inform caller\n \tLog.d(\"LiveMeshEventControllerActivity SetTextForDeviceTask\", \"exception posting join event request - response code: \" \n \t\t\t\t\t\t+ response + \" Response message: \" + receivedMessage);\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn 0;\n\t\t\t} finally {\n\t // Makes sure that the InputStream is closed after the app is\n\t // finished using it.\n if (is != null) {\n \ttry {\n \t\tis.close();\n \t} catch (IOException e) {\n \t\t\t\t//Some IO problem occurred while closing is - just to a stack dump in this case\n \t\tLog.d(\"LiveMeshEventControllerActivity SetTextForDeviceTask\", \"exception closing is file\");\n \t\t\t\te.printStackTrace();\n \t}\n } \n }\n }",
"@Override\n\tpublic String getSpeechResult() {\n\t\treturn null;\n\t}",
"public synchronized void startSpeechRecognition() {\r\n\t\t\r\n\t\t//Check lock\r\n\t\tif (speechRecognizerThreadRunning)\r\n\t\t\tlogger.log(Level.INFO, \"Speech Recognition Thread already running...\\n\");\r\n\t\telse\r\n\t\t\t//Submit to ExecutorService\r\n\t\t\teventsExecutorService.submit(() -> {\r\n\t\t\t\t\r\n\t\t\t\t//locks\r\n\t\t\t\tspeechRecognizerThreadRunning = true;\r\n\t\t\t\tignoreSpeechRecognitionResults = false;\r\n\t\t\t\t\r\n\t\t\t\t//Start Recognition\r\n\t\t\t\trecognizer.startRecognition(true);\r\n\t\t\t\t\r\n\t\t\t\t//Information\t\t\t\r\n\t\t\t\tlogger.log(Level.INFO, \"You can start to speak...\\n\");\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\twhile (speechRecognizerThreadRunning) {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * This method will return when the end of speech is reached. Note that the end pointer will determine the end of speech.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tSpeechResult speechResult = recognizer.getResult();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Check if we ignore the speech recognition results\r\n\t\t\t\t\t\tif (!ignoreSpeechRecognitionResults) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Check the result\r\n\t\t\t\t\t\t\tif (speechResult == null)\r\n\t\t\t\t\t\t\t\tlogger.log(Level.INFO, \"I can't understand what you said.\\n\");\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Get the hypothesis\r\n\t\t\t\t\t\t\t\tspeechRecognitionResult = speechResult.getHypothesis();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//You said?\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"You said: [\" + speechRecognitionResult + \"]\\n\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Call the appropriate method \r\n\t\t\t\t\t\t\t\tmakeDecision(speechRecognitionResult, speechResult.getWords());\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\tlogger.log(Level.INFO, \"Ingoring Speech Recognition Results...\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tlogger.log(Level.WARNING, null, ex);\r\n\t\t\t\t\tspeechRecognizerThreadRunning = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlogger.log(Level.INFO, \"SpeechThread has exited...\");\r\n\t\t\t\t\r\n\t\t\t});\r\n\t}",
"private void getResultsFromApi() {\n if (! isGooglePlayServicesAvailable()) {\n acquireGooglePlayServices();\n } else if (mCredential.getSelectedAccountName() == null) {\n chooseAccount();\n } else if (! isDeviceOnline()) {\n\n Toast.makeText(getApplicationContext(), \"No Network Connection\",\n Toast.LENGTH_SHORT).show();\n mOutputText.setText(\"No network connection available.\");\n } else {\n new MakeRequestTask(mCredential).execute();\n }\n }",
"public void on_code_read(String result){\n Intent intent = new Intent(ScanActivity.this, TargetActivity.class);\n intent.putExtra(\"result\", result);\n startActivity(intent);\n }",
"private void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"void speechToTextFuncVoiceForPurchase(Context context, EditText editText, int dataType, ImageView micImage, int valueforValidate) {\n if (Utility.getInstance().isOnline(mContext)) {\n int value = checkPermission(mContext, Manifest.permission.RECORD_AUDIO, RECORD_AUDIO_PERMISSION_REQUEST_CODE);\n if (value == 1) {\n mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(mContext);\n mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n String languageCode = Utility.getInstance().getLanguage(mContext);\n // Locale current = getResources().getConfiguration().locale;\n if (languageCode.matches(langaugeCodeEnglish)) {\n mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"en_US\");\n } else if (languageCode.matches(languageCodeMarathi)) {\n mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"mr_IN\");\n } else {\n mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"en_US\");\n setError(\"BaseFragmnet : speechToTextFunc Has problem\");\n }\n mSpeechRecognizer.setRecognitionListener(new RecognitionListener() {\n @Override\n public void onReadyForSpeech(Bundle params) {\n if (isVisible()) {\n micImage.setColorFilter(getResources().getColor(android.R.color.holo_green_light), PorterDuff.Mode.SRC_IN);\n if (editText != null) {\n editText.getBackground().setColorFilter(getResources().getColor(android.R.color.holo_green_light),\n PorterDuff.Mode.SRC_ATOP);\n }\n }\n }\n\n @Override\n public void onBeginningOfSpeech() {\n\n }\n\n @Override\n public void onRmsChanged(float rmsdB) {\n\n }\n\n @Override\n public void onBufferReceived(byte[] buffer) {\n\n }\n\n @Override\n public void onEndOfSpeech() {\n if (isVisible()) {\n micImage.setColorFilter(getResources().getColor(android.R.color.black), PorterDuff.Mode.SRC_IN);\n if (editText != null) {\n editText.getBackground().setColorFilter(getResources().getColor(android.R.color.black),\n PorterDuff.Mode.SRC_ATOP);\n }\n }\n }\n\n @Override\n public void onError(int error) {\n\n }\n\n @Override\n public void onResults(Bundle results) {\n if (isVisible()) {\n ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);\n if (matches.get(0).toString().toLowerCase().contains(getString(R.string.save).toString().toLowerCase())) {\n boolean valueStatus = validatePuchase();\n if (valueStatus) {\n createPurchaseRequest(flowpurchaseReceivedOrPaid);\n }\n } else if (matches.get(0).toString().toLowerCase().contains(getString(R.string.cancel_two).toString().toLowerCase())) {\n dialog.dismiss();\n dialog.dismiss();\n dialog.dismiss();\n if (textToSpeech != null) {\n textToSpeech.stop();\n }\n Toast.makeText(mContext, getString(R.string.transaction_cancelled), Toast.LENGTH_SHORT).show();\n speak(getString(R.string.transaction_cancelled), \"\");\n }\n if (editText != null) {\n if (dataType == 1) {\n editText.setText(matches.get(0));\n } else {\n for (int i = 0; i < matches.size(); i++) {\n if (matches.get(i).matches(\"^[0-9]*$\")) {\n editText.setText(matches.get(i));\n }\n }\n }\n\n\n //Ankur\n boolean valueValidate = validatePuchase();\n if (valueValidate) {\n speak(getString(R.string.please_say_save_or_cancel), \"\");\n new Handler().postDelayed(() -> {\n speechToTextFuncVoiceForPurchase(mContext, null, 3, imageviewMicSaveCancel, 2);\n }, 3000);\n }\n\n }\n }\n }\n\n @Override\n public void onPartialResults(Bundle partialResults) {\n\n }\n\n @Override\n public void onEvent(int eventType, Bundle params) {\n\n }\n });\n\n if (dialog.isShowing()) {\n mSpeechRecognizer.startListening(mSpeechRecognizerIntent);\n }\n } else if (value == 2) {\n displayNeverAskAgainDialog(mContext, getString(R.string.We_need_permission_Audio));\n }\n } else {\n Toast.makeText(context, getString(R.string.please_check_internet), Toast.LENGTH_SHORT).show();\n }\n }",
"public OtherResponse sendMT(String mobilenumber, String message, String shortcode, int carrierid, int campaignid, Date sendat, String msgfxn, int priority, String fteu, float tariff) throws PrepException, SQLException, JAXBException, SAXException, MalformedURLException, IOException{\n String response;\n\n if(canSendMT(mobilenumber)){\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" exist!\");\n\n String mt_request_xml = createXml(mobilenumber, message, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n\n\n\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n else{//if user not registerd or opted-in send back message on how to register for GetOnTrack\n String registerMsg = \"Novartis Pharmaceuticals Corp: You have to register for the GetOnTrack BP Tracker to use the service. Didn't mean to? Call 877-577-7726 for more information\";\n String mt_request_xml = createXml(mobilenumber, registerMsg, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n //com.novartis.xmlbinding.mt_response.Response res = getResponse(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><response><mts><mt><mobilenumber>\"+mobilenumber+\"</mobilenumber></mt></mts><status>FAIL</status><statusmessage><exceptions><exception>User not opted in for SMS</exception></exceptions></statusmessage></response>\");\n\n\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" does not exist!\");\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n\n }",
"private void handleDetectedActivities(ActivityRecognitionResult result) {\n boolean serviceRunning;\n DetectedActivity detectedActivity = result.getMostProbableActivity();\n int typeOfActivity = detectedActivity.getType();\n\n Log.d(TAG, \"handleDetectedActivities\");\n Intent intent = new Intent(this, WearableService.class);\n // for (DetectedActivity activity : probableActivities) {\n switch (detectedActivity.getType()) {\n case DetectedActivity.WALKING: {\n\n Log.e(TAG, \"Walking: \" + detectedActivity.getConfidence());\n if (detectedActivity.getConfidence() >= 75) {\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Service already running\");\n } else {\n startService(intent);\n Log.d(TAG, \"Wear service Started\");\n }\n } else {\n stopService(intent);\n break;\n }\n }\n case DetectedActivity.STILL: {\n Log.d(TAG, \"Still: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.UNKNOWN: {\n Log.e(TAG, \"Unknown: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.IN_VEHICLE: {\n Log.e(TAG, \"In Vehicle: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.ON_BICYCLE: {\n Log.e(TAG, \"On Bike: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.RUNNING: {\n Log.e(TAG, \"Running: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.TILTING: {\n Log.e(TAG, \"Tilting: \" + detectedActivity.getConfidence());\n serviceRunning = isMyServiceRunning(WearableService.class);\n\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n case DetectedActivity.ON_FOOT: {\n Log.e(TAG, \"On Foot: \" + detectedActivity.getConfidence());\n DetectedActivity moreSpecific = getMoreSpecific(result.getProbableActivities());\n if (moreSpecific != null) {\n detectedActivity = moreSpecific;\n }\n if (detectedActivity.getType() == DetectedActivity.WALKING) {\n Log.d(TAG, \"On foot and walking\");\n if (detectedActivity.getConfidence() >= 75) {\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.i(TAG, \"Service already running!\");\n } else {\n startService(intent);\n Log.d(TAG, \"Wear service Started.\");\n }\n } else {\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.d(TAG, \"Stopping service.\");\n stopService(intent);\n }\n break;\n }\n } else if (detectedActivity.getType() == DetectedActivity.RUNNING) {\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.i(TAG, \"Stopping service.\");\n } else {\n serviceRunning = isMyServiceRunning(WearableService.class);\n if (serviceRunning) {\n Log.i(TAG, \"Stopping service.\");\n }\n }\n }\n }\n default: {\n break;\n }\n }\n }",
"String getAnswerResponse();",
"private void startVoiceRecognitionActivity() {\n\t\t// Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t// RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n\t\t// \"Diga o valor do produto\");\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, \"pt-BR\");\n\t\t// // intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,\n\t\t// \"en-US\");\n\t\t// intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE,\n\t\t// true);\n\t\t// startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);\n\t\tUtils.startVoiceRecognitionActivity(this, Utils.nomeProdutoMessage);\n\t}",
"com.czht.face.recognition.Czhtdev.ResponseOrBuilder getResponseOrBuilder();",
"static void processResponse(CTPResponse response)\n {\n \tfor(int i=0;i<response.GetNumResponses();i++)\n \t{\n \t\tint type = response.getReponseType(i);\n \t\tswitch (type) {\n\t \t\tcase CTPResponse.ERROR_RSP:{\n\t \t\t\tif(response.getStatus(i)== -1)\n\t \t\t\tSystem.out.println(\"ERROR_RSP Invalid client request\");\t\n\t \t\t\telse\n\t \t\t\tSystem.out.println(\"ERROR_RSP \"+response.getErrorText(i));\t\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase CTPResponse.ACKCONNECT_RSP:{\n\t \t\t\tSystem.out.println(\"ACKCONNECT_RSP received\");\t\n\t \t\t\tbreak;\n\t \t\t}\n\t\t\t\tcase CTPResponse.ACKOPEN_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKOPEN_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.ACKLOCK_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKLOCK_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.ACKEDIT_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKEDIT_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.SERVRELEASE_RSP:{\n\t\t\t\t\tSystem.out.println(\"SERVRELEASE_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.CONTENTS_RSP:{\n\t\t\t\t\tSystem.out.println(\"CONTENTS_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Position in file = \"+response.getPosInfile(i));\n\t\t\t\t\tSystem.out.println(\"file data = \"+response.getFilData(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.MOVE_RSP:{\n\t\t\t\t\tSystem.out.println(\"MOVE_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Cursor position in file= \"+response.getPosInfile(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.STATUS_RSP:{\n\t\t\t\t\tSystem.out.println(\"STATUS_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Checksum = \"+response.getChecksum(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.EDIT_RSP:{\n\t\t\t\t\tSystem.out.println(\"EDIT_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"action = \"+response.getEditAction(i));\n\t\t\t\t\tSystem.out.println(\"Position in file = \"+response.getPosInfile(i));\n\t\t\t\t\tSystem.out.println(\"file data = \"+response.getFilData(i));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.CLOSE_RSP:{\n\t\t\t\t\tSystem.out.println(\"CLOSE_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: \n\t\t\t\t\tSystem.out.println(\"Invalid Response type received\");\t\n \t\t}//end switch\n \t}//end for loop\n }",
"protected void processMyGameResult(int gameNumber, boolean becomesExamined, String gameResultCode, String scoreString, String descriptionString) {\n Game game = tournamentService.findGame(gameNumber);\n if (game == null) {\n return;\n }\n /* Subtract USCL-Bot itself */\n int observerCount = game.observerCountMax - 1;\n boolean adjourned = (descriptionString.indexOf(\"adjourn\") >= 0);\n if (adjourned) {\n game.status = GameState.ADJOURNED;\n } else if (\"0-1\".equals(scoreString)) {\n game.status = GameState.BLACK_WINS;\n } else if (\"1-0\".equals(scoreString)) {\n game.status = GameState.WHITE_WINS;\n } else if (\"1/2-1/2\".equals(scoreString)) {\n game.status = GameState.DRAW;\n } else if (\"aborted\".equals(scoreString)) {\n game.status = GameState.NOT_STARTED;\n } else {\n game.status = GameState.UNKNOWN;\n alertManagers(\"Error: unexpected game status \\\"{0}\\\": {1}\", gameResultCode, scoreString);\n }\n tournamentService.updateGameStatus(game, game.status);\n if (game.status.isFinished()) {\n String whiteName = game.whitePlayer.getPreTitledHandle(USCL_RATING);\n String blackName = game.blackPlayer.getPreTitledHandle(USCL_RATING);\n String libraryHandle = settingsService.getLibraryHandle();\n int librarySlot = settingsService.getAndIncrementNextLibrarySlot();\n String examineCommand = String.format(\"examine %s %%%d\", libraryHandle, librarySlot);\n command.spoof(libraryHandle, \"libsave {0} -1 %{1}\", game.whitePlayer.getHandle(), librarySlot);\n QEvent.event(game.eventSlot)\n .description(\"%-4s %s - %s\", game.status, whiteName, blackName)\n .addJoinCommand(examineCommand)\n .allowGuests(true)\n .send(command);\n tellEventChannelsAndManagers(\"{0} vs {1}: \\\"{2}\\\" : {3} ({4} observers)\", game.whitePlayer,\n game.blackPlayer, examineCommand, descriptionString, observerCount);\n command.spoof(monitorRole, \"-notify {0}\", game.whitePlayer);\n command.spoof(monitorRole, \"-notify {0}\", game.blackPlayer);\n } else {\n tellEventChannels(\"{0} vs {1}: {2} ({3} observers)\", game.whitePlayer, game.blackPlayer, descriptionString, observerCount);\n }\n if (!adjourned) {\n command.sendCommand(\"qset {0} isolated 0\", game.whitePlayer);\n command.sendCommand(\"qset {0} isolated 0\", game.blackPlayer);\n command.sendAdminCommand(\"-kmuzzle {0}\", game.whitePlayer);\n command.sendAdminCommand(\"-kmuzzle {0}\", game.blackPlayer);\n }\n tournamentService.flush();\n }",
"protected SpeechletResponse getAskSpeechletResponse (String speechText) {\n SimpleCard card = new SimpleCard();\r\n card.setTitle(\"Carkak Temperature\");\r\n card.setContent(speechText);\r\n\r\n // Create the plain text output.\r\n PlainTextOutputSpeech speech = new PlainTextOutputSpeech();\r\n speech.setText(speechText);\r\n\r\n Reprompt reprompt = new Reprompt();\r\n reprompt.setOutputSpeech(speech);\r\n\r\n return newAskResponse(card, speech, reprompt);\r\n }",
"public void incomingSearchRequest(APDUEvent e)\n {\n LOGGER.finer(\"Processing incomingSearch_Request\");\n \n SearchRequest_type search_request = (SearchRequest_type) (e.getPDU().o);\n \n // Create a search response\n PDU_type pdu = new PDU_type();\n pdu.which=PDU_type.searchresponse_CID;\n SearchResponse_type response = new SearchResponse_type();\n pdu.o = response;\n \n int ssub = search_request.smallSetUpperBound.intValue();\n int lslb = search_request.largeSetLowerBound.intValue();\n int mspn = search_request.mediumSetPresentNumber.intValue();\n \n LOGGER.finer(\"ssub = \" + ssub + \" lslb = \" + lslb + \" mspn = \" + mspn);\n \n response.referenceId = search_request.referenceId; \n \n // Assume failure unless something below sets to true\n response.searchStatus = Boolean.FALSE;\n \n RootNode rn = null;\n \n try\n {\n switch(search_request.query.which)\n {\n case Query_type.type_0_CID:\n LOGGER.finer(\"Processing Any Query\");\n // Any\n break;\n case Query_type.type_1_CID:\n case Query_type.type_101_CID:\n // RPN query\n LOGGER.finer(\"Processing RPN Query\");\n rn = com.k_int.z3950.util.RPN2Internal.zRPNStructure2RootNode\n \t ((RPNQuery_type)(search_request.query.o));\n break;\n case Query_type.type_2_CID:\n case Query_type.type_100_CID:\n case Query_type.type_102_CID:\n LOGGER.finer(\"Processing OctetString Query\");\n // Octet String\n break;\n }\n \n if ( rn != null )\n {\n LOGGER.finer(\"Got root node\");\n \n IRQuery q = new IRQuery();\n q.collections = search_request.databaseNames;\n q.query = new com.k_int.IR.QueryModels.RPNTree(rn);\n \n // Process the query\n LOGGER.finer(\"Create Search Task with query:\" + q);\n SearchTask st = search_service.createTask\n \t (q, search_request.referenceId);\n \t\n \n // Evaluate the query, waiting 10 seconds for the task to complete. \n \t//We really want to be\n // able to pass in a predicate to wait for here, \n \t//e.g. evaluate(10000, \"NumHits > 100 OR Status=Complete\");\n LOGGER.finer(\"Evaluate Search Task\");\n try\n {\n st.evaluate(10000);\n }\n catch ( TimeoutExceededException tee )\n {\n LOGGER.finer(\"Timeout exceeded waiting for search to complete\");\n }\n \n if ( search_request.resultSetName != null ) {\n \t LOGGER.finer(\"putting st with name \" + \n \t\t\t search_request.resultSetName);\n \t active_searches.put(search_request.resultSetName, st);\n \t}\n \tactive_searches.put(\"Default\", st);\n \t\n // Result records processing\n int result_count = st.getTaskResultSet().getFragmentCount();\n LOGGER.finer(\"result count is \"+result_count);\n \n // Number of hits\n response.resultCount = BigInteger.valueOf(result_count);\n \n // Figure out Search Status\n if ( ( st.getTaskStatusCode() != SearchTask.TASK_FAILURE ) )\n {\n response.searchStatus = Boolean.TRUE;\n }\n else\n {\n // Figure out Result Set Status\n switch ( st.getTaskStatusCode() )\n {\n case SearchTask.TASK_EXECUTING_ASYNC:\n case SearchTask.TASK_EXECUTING_SYNC:\n // resultSetStatus = 2 (interim) Partial results available, \n \t\t//not necessarily valid\n response.resultSetStatus = BigInteger.valueOf(2);\n break;\n case SearchTask.TASK_FAILURE:\n // resultSetStatus = 3 (none) No result set\n response.resultSetStatus = BigInteger.valueOf(3);\n break;\n }\n }\n \n LOGGER.finer(\"Is \"+result_count+\" <= \"+lslb +\" or <= \"+ssub);\n \n if ( ( result_count <= lslb ) || ( result_count <= ssub ) )\n {\n LOGGER.finer(\"Yep\");\n \n int start = 1;\n int count = ( result_count <= ssub ? result_count : mspn );\n \n if ( count > 0 )\n \t {\n \t\t LOGGER.finer(\"Asking for \"+count+\n \t\t\t \" response records from \"+start);\n \t\t LOGGER.finer(\"Search request default = \" \n \t\t\t + search_request.preferredRecordSyntax);\n \t\t response.records = createRecordsFor\n \t\t (st, search_request.preferredRecordSyntax, start, \n \t\t count, GeoProfile.BREIF_SET);\n \t\t \n \n \t\t if (response.records.which == \n \t\t Records_type.responserecords_CID ){\n \t\t LOGGER.finer(\"We have records\");\n \t\t \n \t\t // Looks like we managed to present some records OK..\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(((Vector)\n \t\t\t\t\t (response.records.o)).size());\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(count+1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t\t } else { // Non surrogate diagnostics ( Single or Multiple )\n \t\t \n \t\t LOGGER.finer(\"Diagnostics\");\n \t\t response.presentStatus = BigInteger.valueOf(5);\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(1);\n \t\t }\n \t } else {\n \t\t LOGGER.finer(\"No need to piggyback records....\");\n \t\t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = BigInteger.valueOf(1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t }\n } else {\n \t response.presentStatus = BigInteger.valueOf(5);\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(1); \t\n \t}\n }\n else\n \t LOGGER.finer(\"Unable to process query into root node\");\n }\n catch ( com.k_int.IR.InvalidQueryException iqe )\n \t{\n \t // Need to send a diagnostic\n \t iqe.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3);\n \t // No result set available\n \t response.records = createNSD(null, iqe.toString());\n \t}\n catch ( SearchException se )\n \t{\n \t // We need to populate a diagnostic here\n \t LOGGER.finer(\"Search returning diagnostic. Reason:\"+se.toString());\n \t se.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3); \n \t // No result set available\n \t response.records = createNSD((String)(se.additional), \n \t\t\t\t\t se.toString());\n \t}\n \n LOGGER.finer(\"Send search response : \");\n try\n \t{\n \t assoc.encodeAndSend(pdu);\n \t}\n catch ( java.io.IOException ioe )\n \t{\n \t ioe.printStackTrace();\n \t} \n }",
"public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {\n if (\"getInfo\".equals(action)) {\n JSONObject r = new JSONObject();\n r.put(\"result\", \"all good for now\");\n callbackContext.success(r);\n } else if (\"initialize\".equals(action)) {\n JSONObject r = new JSONObject();\n JSONObject json = new JSONObject(args.getString(0));\n \n\n rs = RadioStream.getInstance(getApplicationContext());\n rs.setActivity(this.cordova.getActivity().getClass());\n\n rs.setAutoStart(json.has(\"autoStart\") ? json.getBoolean(\"autoStart\") : AUTO_PLAYBACK);\n rs.setStreamingUrl(json.has(\"streamingURL\") ? json.getString(\"streamingURL\") : STREAMING_URL);\n rs.setCentovaUser(json.has(\"centovacastUser\") ? json.getString(\"centovacastUser\") : CENTOVACAST_USER);\n rs.setCentovaPass(json.has(\"centovacastPass\") ? json.getString(\"centovacastPass\") : CENTOVACAST_PASS);\n rs.setCentovaURL(json.has(\"centovacastURL\") ? json.getString(\"centovacastURL\") : CENTOVACAST_URL);\n rs.setLastFMApiKey(json.has(\"lastfmApiKey\") ? json.getString(\"lastfmApiKey\") : LASTFM_APIKEY);\n rs.setDefaultArtist(json.has(\"defaultArtist\") ? json.getString(\"defaultArtist\") : DEFAULT_ARTIST);\n rs.addStatusChangeListener(new RadioStream.StatusChangeListener() {\n @Override\n public void onStatusChange(int status) {\n // do nothing right now\n }\n });\n rs.addTrackChangeListener(new RadioStream.TrackChangeListener() {\n @Override\n public void onTrackChange(final RadioStream.TrackInfo trackInfo) {\n // do nothing right now\n }\n });\n\n rs.initialize();\n \n r.put(\"result\", \"ok\");\n callbackContext.success(r);\n\n } else if (\"play\".equals(action)) {\n JSONObject r = new JSONObject();\n rs.startPlaying();\n r.put(\"result\", \"ok\");\n callbackContext.success(r);\n\n } else if (\"stop\".equals(action)) {\n JSONObject r = new JSONObject();\n rs.stopPlaying();\n r.put(\"result\", \"ok\");\n callbackContext.success(r);\n\n } else if (\"getPlayerStatus\".equals(action)) {\n JSONObject r = new JSONObject();\n int status = rs.getPlayerStatus();\n r.put(\"status\", status);\n r.put(\"result\", \"ok\");\n callbackContext.success(r);\n\n } else if (\"getTrackInfo\".equals(action)) {\n JSONObject r = new JSONObject();\n RadioStream.TrackInfo info = rs.getTrackInfo();\n r.put(\"trackId\", info.getTrackId());\n r.put(\"title\", info.getTitle());\n r.put(\"album\", info.getAlbum());\n r.put(\"artist\", info.getArtist());\n r.put(\"cover\", info.getCover());\n r.put(\"duration\", info.getStringDuration());\n r.put(\"result\", \"ok\");\n callbackContext.success(r);\n }\n\n else {\n return false;\n }\n return true;\n }",
"public void onActivityResult(int requestCode, int resultCode, Intent intent) {\n\n // get scan result\n IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);\n\n\n\n if (scanningResult != null)\n {\n String scanContent = scanningResult.getContents();\n String scanFormat = scanningResult.getFormatName();\n\n TextView scan_format = (TextView) findViewById(R.id.scan_format);\n TextView scan_format2 = (TextView) findViewById(R.id.scan_format2);\n TextView scan_content = (TextView) findViewById(R.id.scan_content);\n TextView scan_content2 = (TextView) findViewById(R.id.scan_content2);\n JSONObject obj=null;\n try{\n\n obj= new JSONObject(scanContent);\n\n }catch(Exception e){\n\n }\n String id= null;\n Boolean machineFound = false;\n // scan_format.setText(\"FORMAT: \" + scanFormat);\n // scan_content.setText(\"CONTENT: \" + scanContent);\n\n try\n {\n HttpRequest req = HttpRequest.getInstance();\n Integer i;\n JSONArray allMachines= (JSONArray) req.getMachine(\"all\", \"data\");\n JSONObject machi [] = new JSONObject[allMachines.length()];\n String listMachine [] = new String[allMachines.length()];\n\n for(i=0;i<allMachines.length();i++)\n {\n machi [i] = allMachines.getJSONObject(i);\n listMachine [i] = machi[i].getString(\"id\");\n if(obj.get(\"id\").equals(listMachine[i]))\n {\n machineFound = true;\n id=listMachine[i];\n }\n }\n\n }\n catch(Exception e)\n {\n String b;\n }\n\n if(machineFound==true)\n {\n Intent intent2 = new Intent(QRcode.this, Freestyle_machine.class);\n intent2.putExtra(\"id\", id);\n startActivity(intent2);\n }\n else\n {\n Toast.makeText(getApplicationContext(), R.string.Try_again,\n Toast.LENGTH_SHORT).show();\n scan_format.setText(R.string.Uncorrect_machine);\n scan_format2.setText(R.string.Scan_again);\n }\n\n return;\n\n\n\n }\n else{\n Toast.makeText(getApplicationContext(), R.string.Try_again,\n Toast.LENGTH_SHORT).show();\n\n }\n\n }",
"@Override\r\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tToast.makeText(PlayerActivity.this, result, 1).show();\r\n\t\t\tfindtalk ft=new findtalk();\r\n\t\t\tft.execute();\r\n\t\t}",
"public String getResponse(String statement)\r\n\t{\r\n\t\tstatement.toLowerCase();\r\n\t\tChatBotChen chatbot2 = new ChatBotChen();\r\n\t\tChatBotUsman chatbot3 = new ChatBotUsman();\r\n\t\tChatBotYaroslavsky chatbot4 = new ChatBotYaroslavsky();\r\n\t\t\r\n\t\tString[] animalArray = {\"hamster\",\"guinea pig\",\"tortoise\",\"frog\",\"tarantula\",\"snake\",\"dog\",\"cat\",\"fish\",\"seaweed\"};\r\n\t\tint animalPosArray = -1;\r\n\t\t{\r\n\t\t\tfor (String animal:animalArray)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, animal, 0)>=0)\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tanimalPosArray = Arrays.asList(animalArray).indexOf(animal);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (animalPosArray< 2 && animalPosArray>-1)\r\n\t\t{\r\n\t\t\twhile (statement!=\"Bye\")\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(chatbot2.getResponse(statement));\r\n\t\t\t\tstatement = in.nextLine();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (animalPosArray< 8 && animalPosArray>5)\r\n\t\t{\r\n\t\t\twhile (statement!=\"Bye\")\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(chatbot4.getResponse(statement));\r\n\t\t\t\tstatement = in.nextLine();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (animalPosArray< 10 && animalPosArray>7)\r\n\t\t{\r\n\t\t\twhile (statement!=\"Bye\")\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(chatbot3.getResponse(statement));\r\n\t\t\t\tstatement = in.nextLine();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif (findKeyword(statement, \"tortoise\", 0)>=0)\r\n\t\t{\r\n\t\t\tpatience = patience +3;\r\n\t\t\tconvoTortoise = true;\r\n\t\t\tconvoFrog = false;\r\n\t\t\tconvoTarantula = false;\r\n\t\t\tconvoSnake = false;\r\n\t\t}\r\n\t\telse if (findKeyword(statement, \"frog\", 0)>=0)\r\n\t\t{\r\n\t\t\tpatience--;\r\n\t\t\tconvoTortoise = false;\r\n\t\t\tconvoFrog = true;\r\n\t\t\tconvoTarantula = false;\r\n\t\t\tconvoSnake = false;\r\n\t\t}\r\n\t\telse if (findKeyword(statement, \"tarantula\", 0)>=0)\r\n\t\t{\r\n\t\t\tpatience++;\r\n\t\t\tconvoTortoise = false;\r\n\t\t\tconvoFrog = false;\r\n\t\t\tconvoTarantula = true;\r\n\t\t\tconvoSnake = false;\r\n\t\t}\r\n\t\telse if (findKeyword(statement, \"snake\", 0)>=0)\r\n\t\t{\r\n\t\t\tconvoTortoise = false;\r\n\t\t\tconvoFrog = false;\r\n\t\t\tconvoTarantula = false;\r\n\t\t\tconvoSnake = true;\r\n\t\t}\r\n\t\tif (statement.length()==0)\r\n\t\t{\r\n\t\t\tString[] emptyResponses = {\"You're replying slower than a tortoise!!\",\"I know snakes that type faster than you./nThey don't even have fingers...\",\r\n\t\t\t\t\t\"Please say something.\",\"Hurry up and reply... I have other customers!\"};\r\n\t\t\tint i = (int)Math.random()*(emptyResponses.length);\r\n\t\t\tString answerEmpty = emptyResponses[i];\r\n\t\t\treturn answerEmpty;\r\n\t\t}\r\n\t\telse if (convoTortoise)\r\n\t\t{\r\n\t\t\tif (findKeyword(statement, \"what\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif ((findKeyword(statement, \"food\", 0)>=0)||(findKeyword(statement, \"eat\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Tortoise usually eat a lot of greens but they can feed on some insects and like fruits as a special treat.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (findKeyword(statement, \"habitat\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Tortoise like habitats with a lot of hideaways and in certain places you should look into if you need special lights to regulate heat.\\nVisit this website to look into building the best habitat for your tortoise http://tortoisegroup.org/desert-tortoise-habitat-checklist/\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"What, what? You can ask about what food they eat or what habitat though.\\nYou can use this article to help answer your question! http://www.vetstreet.com/our-pet-experts/tempted-to-get-a-pet-turtle-or-tortoise-read-this-first\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (findKeyword(statement, \"how\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif ((findKeyword(statement, \"live\", 0)>=0)||(findKeyword(statement, \"years\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Depending on living conditions and health issues, tortoises usually live about 70-100 years.\\nThere is a lot of debate on an average life length though.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ((findKeyword(statement, \"buy\", 0)>=0)||(findKeyword(statement, \"get\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"We actually have a few Russian Tortoises that you can look at in our store!\";\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"How, what? You can ask how long they live or how to get one.\\nYou can use this article to help answer your question! http://www.vetstreet.com/our-pet-experts/tempted-to-get-a-pet-turtle-or-tortoise-read-this-first\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (findKeyword(statement, \"tortoise\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\treturn \"I've always wanted to buy a tortoise!!\\nI encourage that you buy one of our Russian Tortoises.\\nIf you want you can ask about how long they live or the food or anything else concerning you and I'll see if I can answer it.\";\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if (convoFrog)\r\n\t\t{\r\n\t\t\tif (findKeyword(statement, \"what\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"food\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Tortoise usually eat a lot of greens but they can feed on some insects and like fruits as a special treat.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (findKeyword(statement, \"habitat\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Tortoise like habitats with a lot of hideaways and in certain places you should look into if you need special lights to regulate heat.\\nVisit this website to look into building the best habitat for your tortoise http://tortoisegroup.org/desert-tortoise-habitat-checklist/\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"What, what? You can ask about what food they eat or what habitat though.\\nYou can use this article to help answer your question! https://www.wikihow.com/Take-Care-of-Frogs\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (findKeyword(statement, \"how\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"live\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"There isn't a good answer for this but the average is in a range from about 4 to 15.\\nThere is a lot of debate on an average life length though.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ((findKeyword(statement, \"buy\", 0)>=0)||(findKeyword(statement, \"get\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"If you do want a frog (I recommend a tortoise), we have some of them available.\";\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"How, what? You can ask how long they live or how to get one.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\telse if (findKeyword(statement, \"frog\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\treturn \"I've never really understood why people want pets as frogs.\\nI think you should buy one of our Russian Tortoises or Tarantulas but we have some frogs available.\\nIf you want you can ask about how long they live or the food or anything else concerning you and I'll see if I can answer it.\";\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if (convoTarantula)\r\n\t\t{\r\n\t\t\tif (findKeyword(statement, \"what\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"food\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Tarantulas are insectivorous so crickets are their favorite meal.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (findKeyword(statement, \"habitat\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"People usually use aquarium-like tanks for habitats of tarantulas.\\nUse this website for help: http://www.tarantulaguide.com/pet-tarantula-cage-and-habitat/\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"What, what? You can ask about what food they eat or what habitat though.\\nYou can use this article to help answer your question! http://www.tarantulaguide.com/\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (findKeyword(statement, \"how\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"live\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Female Tarantulas can live up to 30 years while Male ones can only live up to 7 years.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ((findKeyword(statement, \"buy\", 0)>=0)||(findKeyword(statement, \"get\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"If you do want a tarantula, we only have one available.\";\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"How, what? You can ask how long they live or how to get one.\\nYou can also check out this website to help you: http://www.tarantulaguide.com/\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (findKeyword(statement, \"tarantula\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\treturn \"Tarantulas intimidate so many people but I think they are so cool.\\nIf you want you can ask about how long they live or the food or anything else concerning you and I'll see if I can answer it.\";\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if (convoSnake)\r\n\t\t{\r\n\t\t\tif (findKeyword(statement, \"what\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"food\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"Some species of snakes eat insects and reptiles like frogs, but others eat warm-blooded animals like mice.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (findKeyword(statement, \"habitat\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"People usually use aquarium-like tanks for habitats of snakes.\\nThe size of it can depend on your snake.\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"What, what? You can ask about what food they eat or what habitat though.\\nYou can use this article to help answer your question! http://www.petmd.com/reptile/care/evr_rp_snake_facts\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (findKeyword(statement, \"how\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\tif (findKeyword(statement, \"live\", 0)>=0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"There isn't a good answer for this but the average is in a range from about 4 to 15.\\nThere is a lot of debate on an average life length though.\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ((findKeyword(statement, \"buy\", 0)>=0)||(findKeyword(statement, \"get\", 0)>=0))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"If you want to check out some snakes we have two ball pythons and a corn snake available.\";\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\treturn \"How, what? You can ask how long they live or how to get one.\\nYou can also check out this website to help you: http://www.petmd.com/reptile/care/evr_rp_snake_facts\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (findKeyword(statement, \"snake\", 0)>=0)\r\n\t\t\t{\r\n\t\t\t\treturn \"There have been rumors of pet snakes choking their owners but they are pretty chill pets if you know how to take care of them.\\nIf you want you can ask about how long they live or the food or anything else concerning you and I'll see if I can answer it.\";\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn randomResponse();\r\n\t\t\r\n\t\t\r\n\t}",
"public void run() {\n //Request the HTML\n try {\n HttpClient Client = new DefaultHttpClient();\n //String URL = \"http://10.0.2.2:8888/url\";\n String URL = \"http://\" + ipAddress + \":8888/intent?sentence=\" + URLEncoder.encode(query, \"utf-8\").replace(\"+\", \"%20\");\n String responseJsonString = \"\";\n\n // Create Request to server and get response\n HttpGet httpget = new HttpGet(URL);\n ResponseHandler<String> responseHandler = new BasicResponseHandler();\n responseJsonString = Client.execute(httpget, responseHandler);\n\n JSONObject responseJSON = new JSONObject(responseJsonString);\n // Show response on activity\n speakOut(responseJSON.getString(\"speechText\"));\n\n // Show response on activity\n String response_url = responseJSON.getString(\"url\");\n if(!response_url.equals(new_url))\n {\n new_url = response_url;\n myWebView.post(new Runnable() {\n public void run() {\n myWebView.loadUrl(new_url);\n }\n });\n //myWebView.loadUrl(new_url);\n }\n //System.out.println(responseString);\n\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }",
"@Override\n\tprotected void doAsyncExecute(VoiceMessage requestMessage) {\n\n\t}",
"public void responseSent(DesktopCtrl desktopCtrl, String channel, String reqId, Object resInfo);",
"private void startVoiceRecognitionActivity()\n\t{\n\t\tSystem.out.println(\"Starting activity lel\");\n\t\tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n\t\t\t\tRecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n\t\tintent.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Voice recognition Demo...\");\n\t\tstartActivityForResult(intent, VOICE_REQUEST_CODE);\n\t}",
"private void sendResult(int REQUEST_CODE) {\n Intent intent = new Intent();\n Bundle b = new Bundle();\n b.putString(MESSAGE, msg.getText().toString());\n\n intent.putExtras(b);\n if(REQUEST_CODE == HomeFragment.REQUEST_CODE)\n HomeFragment.onFragmentResult(getTargetRequestCode(), intent);\n if (REQUEST_CODE == HouseMessageComments.REQUEST_CODE)\n HouseMessageComments.onFragmentResult(getTargetRequestCode(), intent);\n if (REQUEST_CODE == EventMessageFragment.REQUEST_CODE)\n EventMessageFragment.onFragmentResult(getTargetRequestCode(), intent);\n\n }",
"public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String msg = request.getParameter(\"Body\");\n msg = msg.toLowerCase();\n System.out.println(\"-->\" + msg);\n\n String cmd = msg.split(\" \")[0];\n msg = msg.substring(msg.indexOf(' ')+1);\n\n String result = \"\";\n\n if (cmd.equals(\"usage\")) {\n System.out.println(\"usage\");\n result = \"Twilio Movie Assistant Usage Guide:\"\n + \"\\nLIST: Returns a list of movies available\"\n + \"\\nSHOW movie_num: Returns the movie's showtimes\";\n } else if (cmd.equals(\"list\")) {\n System.out.println(\"list\");\n Document doc;\n try {\n doc = Jsoup.connect(\"http://www.imdb.com/showtimes/cinema/CA/ci0961718/CA/H2W1G6\").get();\n Elements titles = doc.select(\".info > h3 > span > a\");\n System.out.println(titles.size());\n for (int i = 1; i <= titles.size(); i++) {\n String title = titles.get(i-1).text().split(\"\\\\(\")[0];\n title = title.substring(0, title.length()-1);\n result += \"\\n\" + i + \"-\" + title;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else if (cmd.equals(\"show\")){\n System.out.println(\"showtimes\");\n Document doc;\n try {\n doc = Jsoup.connect(\"http://www.imdb.com/showtimes/cinema/CA/ci0961718/CA/H2W1G6\").get();\n Elements titles = doc.select(\".info > h3 > span > a\");\n Elements showtimes = doc.getElementsByClass(\"showtimes\");\n\n System.out.println(showtimes.size() + \" , \" + titles.size());\n for (int i = 0; i < titles.size(); i++) {\n String title = titles.get(i).text().toLowerCase().split(\"\\\\(\")[0];\n title = title.substring(0, title.length()-1);\n if ((\"\"+(i+1)).equals(msg)) {\n result = (titles.get(i).text() + \" : \" + showtimes.get(i).text());\n }\n }\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n // } else if (cmd.equals(\"review\")) {\n // Document doc;\n // HttpURLConnection con;\n // try {\n // doc = Jsoup.connect(\"http://www.imdb.com/showtimes/cinema/CA/ci0961718/CA/H2W1G6\").get();\n // Elements titles = doc.select(\".info > h3 > span > a\");\n // System.out.println(titles.size());\n // String title = \"\";\n // for (int i = 0; i < titles.size(); i++) {\n // title = titles.get(i).text().split(\"\\\\(\")[0];\n // title = title.substring(0, title.length()-1);\n // if ((\"\"+i).equals(msg)) {\n // result = title;\n // break;\n // }\n // }\n // result = result.replace(' ', '+');\n // String url = \"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=\" + title + \"&page_limit=10&page=1&apikey=69dxhndmtkxf7f8m8bertygz\";\n\n // URL obj = new URL(url);\n // con = (HttpURLConnection) obj.openConnection();\n // con.setRequestMethod(\"GET\");\n // con.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n // BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n // String inputLine;\n // StringBuffer buf = new StringBuffer();\n \n // while ((inputLine = in.readLine()) != null) {\n // buf.append(inputLine);\n // }\n \n // JSONParser parser = new JSONParser(); \n // JSONObject json = (JSONObject) parser.parse(buf.toString());\n // JSONArray jsonArray = ((JSONArray)json.get(\"movies\"));\n // JSONObject movie1 = (JSONObject)jsonArray.get(0);\n // result = (String)movie1.get(\"synopsis\");\n \n // in.close();\n // } catch (IOException e) {\n // e.printStackTrace();\n // } catch (ParseException e) {\n \n // }\n } else {\n result = \"Cannot complete command: \" + msg;\n }\n\n System.out.println(result);\n\n Message message = new Message(result);\n TwiMLResponse twiml = new TwiMLResponse();\n try {\n twiml.append(message);\n } catch (TwiMLException e) {\n e.printStackTrace();\n }\n\n response.setContentType(\"application/xml\");\n response.getWriter().print(twiml.toXML());\n }",
"@Override\r\n\tpublic boolean results()\r\n\t{\r\n\t\treturn this.results(this.getRobot());\r\n\t}",
"@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\t// GameHelper handles some of the cases with sign-in's etc\n\t\t// automatically.\n\t\tgameHelper.onActivityResult(requestCode, resultCode, data);\n\t\tif (requestCode == RC_SELECT_PLAYERS) {\n\t\t\thandleInvitePlayerActivityResult(resultCode, data);\n\t\t} else if (requestCode == RC_INVITATION_BOX) {\n\t\t\thandleGameInboxActivityResult(resultCode, data);\n\t\t}\n\t}",
"@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif(requestCode== check && resultCode== RESULT_OK){\r\n\t\t\tArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\r\n\t\t\tListView_Result.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\t\r\n\t}",
"private View.OnClickListener onVoiceSearchButtonClick() {\n return new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n try {\n if (canRecognizeSpeechInput()) {\n final Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n // Specify the calling package to identify your application\n intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass()\n .getPackage().getName());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n \"Say a Make, Model, Stock Number, or VIN\");\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);\n\n // Specify how many results you want to receive. The results will be sorted\n // where the first result is the one with higher confidence.\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);\n\n getParentFragment().startActivityForResult(intent,\n VOICE_RECOGNITION_REQUEST_CODE);\n }\n }\n catch (final Exception e) {\n showSpeechRecognitionErrorDialog();\n logError(e);\n }\n }\n };\n }",
"protected abstract void askResponse();",
"public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String message = \"Hello. It's me.\";\n\n // Create a TwiML response and add our friendly message.\n Say say = new Say.Builder(message).build();\n\n // Play an MP3 for incoming callers.\n Play play = new Play.Builder(\"http://howtodocs.s3.amazonaws.com/ahoyhoy.mp3\").build();\n\n Say sayInGather = new Say.Builder(\"To speak to a real person, press 1. \"\n + \"Press 2 to record a message for a Twilio educator. \"\n + \"Press any other key to start over.\").build();\n\n Gather gather = new Gather.Builder()\n .action(\"/handle-gather\")\n .numDigits(1)\n .method(Method.POST)\n .say(sayInGather)\n .build();\n\n VoiceResponse twiml = new VoiceResponse.Builder()\n .say(say)\n .play(play)\n .gather(gather)\n .build();\n\n response.setContentType(\"application/xml\");\n try {\n response.getWriter().print(twiml.toXml());\n } catch (TwiMLException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void success(Object o, Response response) {\n Log.d(TAG, \"Phrase: \" + phrase + \" was executed\");\n }",
"@Override\n\tprotected BaseMessageResp doExecute(VoiceMessage voiceMessage)\n\t\t\tthrows Exception {\n\n\t\tTextMessageResp textMessageResp = new TextMessageResp();\n\t\ttextMessageResp.setToUserName(voiceMessage.getFromUserName());\n\t\ttextMessageResp.setFromUserName(voiceMessage.getToUserName());\n\t\tjava.util.Date date = new Date();\n\t\ttextMessageResp.setCreateTime(date.getTime());\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(date); \n\t\tint hour = calendar.get(calendar.HOUR_OF_DAY);\n\t\tString content = Constants.WEIXIN_MESSAGE_DEFAULT_REPLY;\n\t\tint startWorkHour = Integer.parseInt(ResourceUtil.getStartWorkHour());\n\t\tint endWorkHour = Integer.parseInt(ResourceUtil.getEndWorkHour());\n\t\tif(hour<startWorkHour || hour>endWorkHour){\n\t\t\tcontent += Constants.WEIXIN_MESSAGE_DEFAULT_REPLY_TIMING;\n\t\t}\n\t\ttextMessageResp.setContent(content);\n\n\t\t// 保存接收到的信息\n\t\tReceiveMessage receiveMessage = new ReceiveMessage();\n\t\tTimestamp temp = Timestamp.valueOf(DateUtils\n\t\t\t\t.getDate(\"yyyy-MM-dd HH:mm:ss\"));\n\t\treceiveMessage.setCreateTime(temp);\n\t\treceiveMessage.setFromUserName(voiceMessage.getFromUserName());\n\t\treceiveMessage.setToUserName(voiceMessage.getToUserName());\n\t\treceiveMessage.setMsgId(Long.toString(voiceMessage.getMsgId()));\n\t\treceiveMessage.setMsgType(voiceMessage.getMsgType());\n\t\treceiveMessage.setAccount(weixinAccountService\n\t\t\t\t.findByToUsername(voiceMessage.getToUserName()));\n\t\treceiveMessage.setMediaId(voiceMessage.getMediaId());\n\t\treceiveMessage.setContent(voiceMessage.getRecognition());\n\t\tthis.receiveMessageService.save(receiveMessage);\n\t\t\n\t\tWeixinUtil.nonBlockingDownloadMedia(voiceMessage.getMediaId());\n\t\t\n\t\tlogger.info(\"===保存语音信息==receiveMessage.getId()=>\"\n\t\t\t\t+ receiveMessage.getId());\n\t\t// 微理赔处理,按照客户的openid 查询到了客户进入微理赔。\n\t\tif (claimsSessionManagement\n\t\t\t\t.isClaimsDeal(voiceMessage.getFromUserName())) {\n\t\t\tString retMessage = claimsSessionManagement\n\t\t\t\t\t.messageProcessing(receiveMessage);\n\t\t\ttextMessageResp.setContent(retMessage);\n\t\t\treturn textMessageResp;\n\t\t}\n\t\t// TODO Auto-generated method stub\n\t\treturn textMessageResp;\n\t}",
"@Override\n protected void responseAction(){\n global.token = ((first_screen)parent).token;\n global.name = ((first_screen)parent).full_name;\n // intent.putExtra(\"token\", global.tokenList);\n //intent.putExtra(\"userId\", ((first_screen)parent).userId);\n System.out.println(\"firebase:\"+ FirebaseInstanceId.getInstance().getToken());\n //intent.putExtra(\"tokenStr\", ((first_screen)parent).tokenStr);\n System.out.println(\"got response from server: new user entered\");\n System.out.println(\"Refresh ID:\"+FirebaseInstanceId.getInstance().getId());\n int responseCode = this.parent.getCode(jsonResponse);\n System.out.println(\"got response code:\"+this.parent.getCode(jsonResponse));\n if(responseCode<=2) {\n\n //make sure aval is in the stack of pages\n //thus do startActivity twice\n Intent intent = new Intent(this.parent,availability_page.class);\n parent.startActivityForResult(intent, 7);\n }\n\n if(responseCode==2){\n Intent intent = new Intent(this.parent,homepage.class);\n parent.startActivityForResult(intent, 7);\n }\n else if(responseCode<1){\n parent.getPopup(parent.getMsg(jsonResponse));\n }\n // this.parent.finish();\n //this.parent.switchIntentOnResponse(responseCode,parent.getMsg(jsonResponse),intent,true);\n\n }",
"public String requestResponce(String conventional_Grammar);",
"@Override\n protected String doInBackground(URL... params) {\n URL searchUrl = params[0];\n String talk2meSearchResults = null;\n try {\n talk2meSearchResults = NetworkUtils.getResponseFromHttpUrl(searchUrl);\n Log.d(TAG, \"talk2meSearchResults is : \" + talk2meSearchResults.toString());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return talk2meSearchResults;\n }",
"@Override\n public void onResponse(String response) {\n Log.d(TAG, \"onResponse: \" + response);\n parseResponse(response,speech);\n ChatHeadService.chatHead.setImageResource(R.drawable.microphone_standby );\n }",
"public void getResultsFromApi() {\n// if (! isGooglePlayServicesAvailable()) {\n// acquireGooglePlayServices();\n// } else if (mCredential.getSelectedAccountName() == null) {\n// chooseAccount();\n// } else if (! isDeviceOnline()) {\n//// mOutputText.setText(\"No network connection available.\");\n// } else {\n MakeRequestTask req = new MakeRequestTask(mCredential);\n AsyncTaskCompat.executeParallel(req);\n// }\n }",
"public void ResultVoiceIn(EventVoice event);",
"public void txtResponse(String response , Player player);",
"@Override\n public Optional<Response> handle(HandlerInput input) {\n Map<String,Object> sessionAttribute = getSessionAttributes(input);\n Intent requestIntent = ((IntentRequest) input.getRequestEnvelope().getRequest()).getIntent();\n //Frage nach der Anzahl der Spieler\n if((requestIntent.getSlots().get(Parameter.ANZAHL_SPIELER).getValue() == null || requestIntent.getSlots().get(Parameter.ANZAHL_SPIELER).getValue().equals(\"?\")) && sessionAttribute.get(Parameter.ANZAHL_SPIELER) == null){\n //if (requestIntent.getSlots().get(Parameter.ANZAHL_SPIELER).getValue() == null || requestIntent.getSlots().get(Parameter.ANZAHL_SPIELER).getValue().equals(\"?\")) {\n System.out.println(\"Ermittle Anzahl Spieler\");\n return frageAnzahlSpieler(input,requestIntent);\n }\n else {\n System.out.println(\"SessionAttribute Zweig\");\n //Frage nach den Namen der Spieler\n\n //Prüfe das sessionAttribut nicht leer ist\n if(sessionAttribute.get(Parameter.SPIELER_NAMEN) != null){\n System.out.println(\"Session Attribute nicht leer Zweig\");\n //Attribute auslesen\n String neuerSpielerName = requestIntent.getSlots().get(Parameter.NEUER_SPIELER_NAME).getValue();\n String spielerNamen[] = readPlayers(sessionAttribute);\n int players = (int) sessionAttribute.get(Parameter.ANZAHL_SPIELER);\n System.out.println(\"NeuerSpielerName: \"+neuerSpielerName);\n\n //Ermittle die Anzahl der ermittelnden Namen\n int zaehleSpieler = zaehleSpieler(spielerNamen);\n System.out.println(\"ZaehleSpieler = \"+zaehleSpieler);\n System.out.println(\"players = \"+players);\n\n //Prüfe ob es so viele Namen wie Spieler gibt\n if (++zaehleSpieler < players){\n System.out.println(\"ZahleSpieler != Players Zweig\");\n //Nummer des neuen Spielers ermitteln\n int neuerSpieler = platzDesNeuenSpielersErmitteln(spielerNamen);\n System.out.println(\"NeuerSpielerInt: \"+neuerSpieler);\n\n //Neuen Spieler an ersten zu findenden null Stelle hinzufügen\n input = neuenSpielerHinzufuegen(spielerNamen,sessionAttribute,neuerSpielerName,input);\n return frageSpielerNamen(input,neuerSpieler+2,requestIntent);\n }\n else if(zaehleSpieler==players){\n System.out.println(\"ELSE Zweig ZahleSpieler != Players Zweig\");\n input = neuenSpielerHinzufuegen(spielerNamen,sessionAttribute,neuerSpielerName,input);\n }\n }\n else {\n System.out.println(\"Session Attribute leer Zweig\");\n //Wenn sessionAttribute leer sind\n initialSessionAttribute(input,requestIntent,sessionAttribute);\n return frageSpielerNamen(input,1,requestIntent);\n }\n }\n sessionAttribute = setSpielcounter(sessionAttribute);\n input.getAttributesManager().setSessionAttributes(sessionAttribute);\n return ermittleNaechsteAktion(input,sessionAttribute);\n }"
] | [
"0.7092794",
"0.70127636",
"0.66340035",
"0.66071975",
"0.65991986",
"0.65973216",
"0.6497572",
"0.63798374",
"0.6291483",
"0.62913233",
"0.6246942",
"0.6219286",
"0.620104",
"0.61453825",
"0.6029782",
"0.6021426",
"0.5993549",
"0.5955041",
"0.59402883",
"0.59176934",
"0.59109783",
"0.5836173",
"0.5781103",
"0.577647",
"0.57759684",
"0.57238513",
"0.56899273",
"0.5683948",
"0.5669995",
"0.5669995",
"0.5669995",
"0.5669995",
"0.5636962",
"0.5632141",
"0.56124735",
"0.56020784",
"0.5586456",
"0.55832577",
"0.55810183",
"0.55791014",
"0.5558346",
"0.55517393",
"0.5528371",
"0.55230075",
"0.5506048",
"0.5482232",
"0.5482195",
"0.54781616",
"0.54777575",
"0.5470341",
"0.54692465",
"0.5449625",
"0.54409707",
"0.54333",
"0.5424402",
"0.54134357",
"0.5412878",
"0.54094875",
"0.540887",
"0.53988904",
"0.53912395",
"0.5386522",
"0.5377556",
"0.53746593",
"0.5362874",
"0.53511786",
"0.53460014",
"0.5345188",
"0.5344675",
"0.5340992",
"0.53315973",
"0.5322305",
"0.5317332",
"0.53129506",
"0.53057534",
"0.5300719",
"0.52919537",
"0.52839595",
"0.5280391",
"0.52728564",
"0.5267833",
"0.5262127",
"0.52496976",
"0.5240907",
"0.5239159",
"0.5236646",
"0.52305865",
"0.52206045",
"0.5217505",
"0.5213099",
"0.5207724",
"0.52055305",
"0.52042425",
"0.51954806",
"0.51875496",
"0.5185891",
"0.5185529",
"0.51791203",
"0.5178502",
"0.5177272"
] | 0.7275236 | 0 |
Returns current time in ns | long getTime(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getCurrentTimeMs();",
"private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }",
"public long getCurrentSystemTime() {\n return getSystemTime() - startSystemTimeNano;\n }",
"public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}",
"public static String getCurrentTime()\n\t{\n\t\treturn getTime(new Date());\n\t}",
"public long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}",
"public static long now() {\n return System.nanoTime();\n }",
"public static float getCurrentTime(){\n return (float)(System.currentTimeMillis()-t0)/1000.0f;\r\n }",
"public float getCurrentTime () {\n\t\treturn timer;\n\t}",
"public double getTime()\n {\n long l = System.currentTimeMillis()-base;\n return l/1000.0;\n }",
"public long getCurrentTimeMillis() {\n return System.currentTimeMillis();\n }",
"public float getCurrentTime()\r\n\t{\r\n\t\tcurrenttime = Calendar.getInstance();\r\n\t\treturn currenttime.getTimeInMillis();\r\n\t}",
"String getCurTime();",
"public double getCurrentTime() {\n\t\treturn currentTime;\n\t}",
"@SimpleFunction(description = \"Gets the current time.\"\n + \"It is formatted correctly for iSENSE\")\n public String GetTime() {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n return sdf.format(cal.getTime()).toString();\n }",
"public org.ros.message.Time getCurrentTime() {\n return time.getCurrentTime();\n }",
"public static final String CurrentTime() {\n\t\t\n\t\tfinal SimpleDateFormat DF = new SimpleDateFormat(\"HH:mm:ss\");\n\t\treturn DF.format(new Date());\n\t}",
"public static long getTime() \r\n {\r\n return System.nanoTime(); \r\n }",
"long getCurrentTimeMs() {\n return System.currentTimeMillis();\n }",
"public static String getCurrentTime() {\r\n\t\tDate date = new Date();\r\n\t\treturn date.toString();\r\n\t}",
"private long CurrentTime(){\n return (TotalRunTime + System.nanoTime() - StartTime)/1000000;\n }",
"public float getCurrentTime()\n\t{\n\t\treturn currentTime;\n\t}",
"public Date getCurrentTime() {\r\n return currentTime.getTime();\r\n }",
"public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}",
"public static long currentTimeInSecond() {\n return Instant.now().getEpochSecond();\n }",
"protected long getCurrentTime() {\n return System.currentTimeMillis();\n }",
"public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }",
"public long getCurrentUserTime() {\n return getUserTime() - startUserTimeNano;\n }",
"public String getCurrentTime() {\n return currentTime;\n }",
"long getCurrentClockNs() {\n return System.nanoTime();\n }",
"public long getCurrentTime() {\n return currentTime;\n }",
"public double getTime();",
"public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}",
"private static long getCurrentTime() {\n return (new Date()).getTime();\n }",
"Time getTime();",
"double getTime();",
"public static int getTime() {\n\t\treturn time;\n\t}",
"public long now() {\n return System.currentTimeMillis();\n }",
"@Override\n\tpublic long getCurrentTime() {\n\t\treturn 0;\n\t}",
"public int getSystemTime() {\n\t\treturn this.systemTime;\n\t}",
"public static long getTime() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}",
"public static long time() {\n return date().getTime();\n }",
"public static String getCurrentMillisecondTime()\n\t{\n\t\treturn getMillisecondTime(new Date());\n\t}",
"public String getTimeString()\n\t{\n\t\treturn TimeUtils.getTimeString(this.timesCurrentMillis);\n\t}",
"public static long getSystemTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()): 0L;\n }",
"int getTime();",
"int getTime();",
"public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}",
"private String getCurrentTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }",
"public Date getTimeNow() {\r\n return timeNow;\r\n }",
"public static long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n\n }",
"public long getSimTime() {\n\t return now;\n\t}",
"public double time()\n\t{\n\t\treturn _dblTime;\n\t}",
"public double time()\n\t{\n\t\treturn _dblTime;\n\t}",
"public String getTime() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString time = dateFormat.format(cal.getTime());\n\t\t\treturn time;\n\t\t}",
"private long getSystemTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()) : 0L;\n }",
"public int getTime() {\r\n return time;\r\n }",
"public double getUserTimeSec() {\n\treturn getUserTime() / Math.pow(10, 9);\n}",
"@Override\n\tpublic long getTime() {\n\t\treturn System.nanoTime() - startTime;\n\t}",
"public String getCurrentTime() {\r\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy HH:mm:ss\"); //https://www.javatpoint.com/java-get-current-date\r\n LocalDateTime now = LocalDateTime.now();\r\n return dtf.format(now);\r\n }",
"public String getSystemTime() {\n return DateFormat.getDateTimeInstance().format(new Date().getTime());\n }",
"public int getTime() {\n\t\treturn time;\n\t}",
"public int getTime() {\n\t\treturn time;\n\t}",
"public int getTime() {\n return time;\n }",
"public int getTime() {\n return time;\n }",
"public int getTime() {\n return time;\n }",
"public double getCurrentTime() {\n\t\tif (playing)\n\t\t\treturn (System.nanoTime() - startNanoTime) / 1e9 + startTime;\n\t\telse if (currentFile == null)\n\t\t\treturn -1;\n\t\tif (debug)\n\t\t\tSystem.err.println(\"getCurrentTime(): not playing\");\n\t\treturn currentPosition / currentFile.frameSize / currentFile.frameRate;\n\t}",
"public static long getUserTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadUserTime(): 0L;\n }",
"long time() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}",
"public int getTime() {\n\n\t\treturn time;\n\t}",
"private long now() {\n\treturn System.currentTimeMillis();\n }",
"double getFullTime();",
"public final long getTime () {\n return time;\n }",
"public long getTime() {\r\n\t\treturn time;\r\n\t}",
"public long getTime() {\r\n \treturn time;\r\n }",
"public static long getUserTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadUserTime( ) : 0L;\n }",
"public static double getTimeMs(){\n return System.nanoTime()*nanoToMs;\n }",
"String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}",
"public int getTotalTime();",
"public synchronized static int getTime() {\n\t\treturn time;\n\t}",
"@Override\n\tpublic long currentTimeMillis() {\n\t\treturn this.currentTime;\n\t}",
"public String getTime() {\r\n\t\treturn time;\r\n\t}",
"public synchronized String getTime() {\n\t\treturn time;\n\t}",
"double getClientTime();",
"public static LocalTime UTCTimeNow() {\n return TimeService.UTCTimeNow();\n }",
"public long getTime();",
"public double getTime() { return time; }",
"private long getUserTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadUserTime() : 0L;\n }",
"@Override\r\n\tpublic String gettime() {\n\t\treturn user.gettime();\r\n\t}",
"public static int getNowTime() {\n\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HHmmss\");\n\t\treturn Integer.parseInt(timeFormat.format(new Date()));\n\t}",
"public String getTime() {\n\t\treturn time;\n\t}",
"public static LocalTime TAITimeNow() {\n return TimeService.TAITimeNow();\n }",
"public static String getTime()\n {\n Date time = new Date();\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return timeFormat.format(time);\n }",
"public long getTime() {\n return time;\n }",
"public static long CLOCK() {\n return java.lang.System.currentTimeMillis();\n }",
"java.lang.String getTime();",
"public long getEventTime();",
"public static String getCurrentTime(){\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"Asia/Singapore\"));\n Date currentDate = calendar.getTime();\n return currentDate.toString();\n }",
"public java.lang.String getTime () {\n\t\treturn time;\n\t}",
"public long getTime() {\n return time_;\n }",
"public long getTime() {\n return time_;\n }"
] | [
"0.79873234",
"0.76862884",
"0.76518697",
"0.75982165",
"0.7582034",
"0.75649685",
"0.7539368",
"0.7525708",
"0.7480874",
"0.74670887",
"0.7452678",
"0.743383",
"0.7424399",
"0.7414723",
"0.7401352",
"0.7398837",
"0.7394987",
"0.7384995",
"0.73683685",
"0.7348561",
"0.7324135",
"0.73177725",
"0.7312155",
"0.72926855",
"0.72820306",
"0.7281406",
"0.727932",
"0.726398",
"0.7227561",
"0.72273475",
"0.7220099",
"0.719155",
"0.71862924",
"0.7170971",
"0.7169762",
"0.7168189",
"0.7162752",
"0.71437234",
"0.7139516",
"0.7134466",
"0.71218467",
"0.7113732",
"0.7097133",
"0.70651454",
"0.70647585",
"0.7041417",
"0.7041417",
"0.7032676",
"0.70049524",
"0.7000856",
"0.6998005",
"0.69881177",
"0.6985319",
"0.6985319",
"0.69852936",
"0.6982124",
"0.6977817",
"0.6970525",
"0.6967991",
"0.6962938",
"0.6959506",
"0.6953359",
"0.6953359",
"0.6949532",
"0.6949532",
"0.6949532",
"0.6945558",
"0.6938866",
"0.69318455",
"0.6925478",
"0.692401",
"0.68997514",
"0.6894239",
"0.68900776",
"0.6881031",
"0.68619144",
"0.6860682",
"0.6860246",
"0.68563294",
"0.68526626",
"0.6848392",
"0.6839739",
"0.6833463",
"0.6833189",
"0.68308574",
"0.6830029",
"0.68249935",
"0.6821619",
"0.6817137",
"0.68059003",
"0.68034214",
"0.6785597",
"0.6774782",
"0.6774398",
"0.67628473",
"0.6750974",
"0.6738566",
"0.6738487",
"0.67381567",
"0.6736452",
"0.6736452"
] | 0.0 | -1 |
/ renamed from: synchronized reason: not valid java name | public static final <R> R m1583synchronized(Object obj, Function0<? extends R> function0) {
R r;
Intrinsics.checkNotNullParameter(obj, "lock");
Intrinsics.checkNotNullParameter(function0, "block");
synchronized (obj) {
try {
r = (R) function0.invoke();
InlineMarker.finallyStart(1);
} catch (Throwable th) {
InlineMarker.finallyStart(1);
InlineMarker.finallyEnd(1);
throw th;
}
}
InlineMarker.finallyEnd(1);
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static synchronized void foo() {\n\n }",
"public void synchronize(){ \r\n }",
"public void lock() {\n\n }",
"@Override\r\n\tpublic boolean isSynchronized() {\n\t\treturn false;\r\n\t}",
"void lock();",
"public void lock() {\n/* 254 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public String visit(SynchronizedStmt n, Object arg) {\n return null;\n }",
"String getShortString() \t\t{ return \"MUTEX\"; }",
"@Override\n public void sync(){\n }",
"void contentsSynchronized();",
"public LockSync() {\n lock = new ReentrantLock();\n }",
"private SingletonSyncBlock() {}",
"public final void mT__89() throws RecognitionException {\n try {\n int _type = T__89;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalSpeADL.g:87:7: ( 'synchronized' )\n // InternalSpeADL.g:87:9: 'synchronized'\n {\n match(\"synchronized\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"@Override\n public boolean isThreadSafe()\n {\n return false;\n }",
"public boolean synchronize() {\n\t\treturn false;\n\t}",
"protected void synchronizationDone() {\n }",
"Lock getProtocolImportLock();",
"void synchronizationDone();",
"public boolean isSynchronizing() {\n\t\treturn false;\n\t}",
"@Override\n public void callSync() {\n\n }",
"void lock(String resourceName) throws InterruptedException;",
"public void lock() {\r\n super.lock();\r\n }",
"public void func_09_01_basic_02_bad() {\n\t synchronized (Lock) { //not compliant\n\t count++;\n\t // ...\n\t }\n\t}",
"SW_ConcurrencyPackage getSW_ConcurrencyPackage();",
"@Test\n\tpublic void test_synchronization() throws InterruptedException, ExecutionException {\n\t\t\n\t\tIkanowV1SyncService_LibraryJars s1 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\tIkanowV1SyncService_LibraryJars s2 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\tIkanowV1SyncService_LibraryJars s3 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\t\n\t\tint old = IkanowV1SyncService_LibraryJars._num_leader_changes;\n\t\t\n\t\ts1.start(); s2.start(); s3.start();\n\t\tfor (int i = 0; i < 4; ++i) {\n\t\t\ttry { Thread.sleep(1000); } catch (Exception e) {}\n\t\t}\n\t\ts1.stop(); s2.stop(); s3.stop();\n\t\t\n\t\tassertEquals(old + 1, IkanowV1SyncService_LibraryJars._num_leader_changes);\n\t\t\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal ICrudService<JsonNode> v1_config_db = _service_context.getCoreManagementDbService().getUnderlyingPlatformDriver(ICrudService.class, Optional.of(\"social.share\")).get();\t\t\t\t\n\t\t\n\t\tassertTrue(\"Query optimized\", v1_config_db.deregisterOptimizedQuery(Arrays.asList(\"title\")));\n\t\t\n\t}",
"public final void rule__XSynchronizedExpression__Group_0_0__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:14833:1: ( ( 'synchronized' ) )\r\n // InternalDroneScript.g:14834:1: ( 'synchronized' )\r\n {\r\n // InternalDroneScript.g:14834:1: ( 'synchronized' )\r\n // InternalDroneScript.g:14835:2: 'synchronized'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXSynchronizedExpressionAccess().getSynchronizedKeyword_0_0_1()); \r\n }\r\n match(input,91,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXSynchronizedExpressionAccess().getSynchronizedKeyword_0_0_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n super.lock();\n }",
"public void synchronize(int change);",
"void sync()throws IOException;",
"Thread getLocker();",
"@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}",
"@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}",
"void lockReleased(String lock);",
"@Override\n\tpublic void startSync() throws Exception {\n\t}",
"public void forceReasonerReSynchronization();",
"public TestJSR88Concurrency() {\n }",
"Boolean autoSync();",
"@Override\n\tpublic void sync() throws IOException {\n\t\t\n\t}",
"@Test\n public void testSynchronizedSync() throws AuthException, IOException {\n presenter.synchronize();\n try {\n presenter.syncingThread.join();\n } catch (InterruptedException e) {}\n assertEquals(SyncStatusEnum.PREAUTHED, presenter.status);\n presenter.synchronize();\n try {\n presenter.syncingThread.join();\n } catch (InterruptedException e) {}\n assertEquals(SyncStatusEnum.AUTHED, presenter.status);\n presenter.synchronize();\n try {\n presenter.syncingThread.join();\n } catch (InterruptedException e) {}\n assertEquals(SyncStatusEnum.SYNCED, presenter.status);\n }",
"public abstract ReentrantLock getLock();",
"Shared shared();",
"void lock(String name) {\n execute(name, connection -> doLock(name, connection));\n }",
"@Override\n\tpublic void race() {\n\n\t}",
"public static boolean isSynchronized(int mod) {\n\t\treturn Modifier.isSynchronized(mod);\n\t}",
"public Lock() {\r\n }",
"@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f102361i;\n this.f102361i = 0;\n }\n }",
"public final /* bridge */ /* synthetic */ String mo50910a(Object obj) {\n return m62902a((Thread) obj);\n }",
"void beforeContentsSynchronized();",
"static void sm() {\n }",
"public Lock getLock();",
"private static void m200a() {\r\n Object obj = AuthTask.f155a;\r\n synchronized (obj) {\r\n try {\r\n obj.notify();\r\n } catch (Exception e) {\r\n }\r\n }\r\n }",
"static void onSpinWait() {\n }",
"public static void main(String[] str) throws InterruptedException {\n CounterReEntered counter = new CounterReEntered();\r\n Runnable r1 = new Runnable() {\r\n @Override\r\n public void run() {\r\n try {\r\n counter.increment();\r\n System.out.println(\"thread name: \" + Thread.currentThread().getName());\r\n Thread.sleep(2000);\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(LockDemo.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n };\r\n\r\n Thread t1 = new Thread(r1, \"A\");\r\n Thread t2 = new Thread(r1, \"B\");\r\n Thread t3 = new Thread(r1, \"C\");\r\n Thread t4 = new Thread(r1, \"D\");\r\n t1.start();\r\n t2.start();\r\n t3.start();\r\n t4.start();\r\n }",
"@Override\n\tpublic void sync() throws IOException\n\t{\n\n\t}",
"@C_FUNCTION\n public static native void syscall_membarrier();",
"public T caseDefMutex(DefMutex object)\n {\n return null;\n }",
"@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}",
"static int type_of_xchg(String passed){\n\t\treturn 1;\n\t}",
"@Test(timeout = 4000)\n public void test094() throws Throwable {\n StringReader stringReader0 = new StringReader(\"synchronized\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 97, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(11, javaCharStream0.bufpos);\n assertEquals(\"synchronized\", token0.toString());\n }",
"public synchronized void add() {\ncounter += 1;\n}",
"static final void throwIllegalMonitorStateException0X()\n {\n throw new IllegalMonitorStateException();\n }",
"void m2() {\n\n boolean locked = false;\n try {\n locked = lock.tryLock(4, TimeUnit.SECONDS);\n\n //可以设置lock为可打断的\n //可以在主线程中调用interrupt方法打断,然后当做异常处理\n// lock.lockInterruptibly();\n\n System.out.println(locked);\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n if (locked) lock.unlock();\n }\n }",
"public static <K, V> Reference2ObjectMap<K, V> synchronize(Reference2ObjectMap<K, V> m) {\n/* 433 */ return new SynchronizedMap<>(m);\n/* */ }",
"public boolean isSynchronized() {\n return (getAccessFlags() & Constants.ACCESS_SYNCHRONIZED) > 0;\n }",
"@Override\n\tpublic boolean allowMultithreading()\n\t{\n\t\treturn true;\n\t}",
"@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f67002l;\n this.f67002l = 0;\n }\n }",
"public void lock() {\n\t\tlocked = true;\n\t}",
"@Override\n\tpublic boolean tryLock() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean tryLock() {\n\t\treturn false;\n\t}",
"void sync() throws IOException;",
"@Override\n public void threadStarted() {\n }",
"public interface Lock {\n\n boolean acquire();\n\n boolean release();\n}",
"public void visit(SynchronizedStatement n) {\n n.f0.accept(this);\n n.f1.accept(this);\n n.f2.accept(this);\n n.f3.accept(this);\n n.f4.accept(this);\n }",
"@Test\r\n\tvoid testReentrant() throws Exception\r\n\t{\r\n\t\tfinal PageAccessSynchronizer sync = new PageAccessSynchronizer(Duration.ofSeconds(5));\r\n\t\tsync.lockPage(0);\r\n\t\tsync.lockPage(0);\r\n\t}",
"public interface JedisLockSupport {\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key and set its owner\r\n\t * It will try once and will return immediately\r\n\t * @param key the key to set lock against\r\n\t * @param owner lock owner\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean acquire(String key, String owner);\r\n\t\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key\r\n\t * It will try to get lock for timeout passed\r\n\t * @param key\r\n\t * @param owner\r\n\t * @param timeout\r\n\t * @param timeUnit\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);\r\n\t\r\n\t/**\r\n\t * Releases the lock\r\n\t * @param key\r\n\t * @param owner\r\n\t */\r\n\tpublic void release(String key, String owner);\r\n\t\r\n\t/**\r\n\t * Interning the string key. Used internally.\r\n\t * String str1 = new String(\"abc\");\r\n\t * String str2 = new String(\"abc\");\r\n\t * str1 and str2 are two different objects \r\n\t * and we synchronized based on the passed key\r\n\t * \r\n\t * @param key to normalize\r\n\t * @return the normalized key\r\n\t */\r\n\tdefault String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}\r\n}",
"public interface GraphQLMutex {\n GraphQLMutex mo2714a(Set<String> set);\n\n GraphQLResult mo2715a(GraphQLResult graphQLResult);\n\n ImmutableSet<String> mo2716a();\n\n boolean mo2717a(GraphQLRequestLock graphQLRequestLock);\n\n GraphQLResult mo2718b(GraphQLResult graphQLResult);\n}",
"private SingletonThreadSafeExample(){\n this.invoke++;\n }",
"Lock getComponentAccessTokenLock();",
"public Promise<V> sync()\r\n/* 183: */ throws InterruptedException\r\n/* 184: */ {\r\n/* 185:219 */ await();\r\n/* 186:220 */ rethrowIfFailed();\r\n/* 187:221 */ return this;\r\n/* 188: */ }",
"void syncGroup();",
"private SyncState() {}",
"public final void mo34030a() {\n this.f590g.lock();\n }",
"public interface AbstractScheduledFutureC02560jD<V> extends ScheduledFuture<V>, AnonymousClass1XI<V> {\n}",
"protected boolean upgradeLocks() {\n \t\treturn false;\n \t}",
"public void lock(int key);",
"@Override\n\tpublic boolean isLocked() { return true; }",
"private void m33138b() {\n synchronized (this.f26017d) {\n TaskExecutor.m3867a().mo11809a(11);\n }\n }",
"public ChannelProgressivePromise sync()\r\n/* 93: */ throws InterruptedException\r\n/* 94: */ {\r\n/* 95:126 */ super.sync();\r\n/* 96:127 */ return this;\r\n/* 97: */ }",
"final public Lock test_get_lock() {\r\n\t\treturn lock_;\r\n\t}",
"public void method_9396() {\r\n super();\r\n this.field_8914 = Maps.newConcurrentMap();\r\n }",
"@Override\n\tpublic boolean tryLock(long arg0, TimeUnit arg1)\n\t\t\tthrows InterruptedException {\n\t\treturn false;\n\t}",
"@Test\n public void orgApacheFelixEventadminAsyncToSyncThreadRatioTest() {\n // TODO: test orgApacheFelixEventadminAsyncToSyncThreadRatio\n }",
"private ModuleSyncHelper() {\n //Private constructor to avoid instances for this helper.\n }",
"boolean isThreadSafe();",
"public void sync () throws java.io.SyncFailedException, ObjectStoreException\n {\n }",
"ManagementLockObject.Update update();",
"@Override\n public synchronized void start() {\n super.start(); //To change body of generated methods, choose Tools | Templates.\n }",
"SyncObject(int numThreads)\n {\n this.numThreads = numThreads;\n }"
] | [
"0.67852044",
"0.65399396",
"0.6344408",
"0.6214796",
"0.6086501",
"0.6052218",
"0.6026972",
"0.5999473",
"0.5891573",
"0.587674",
"0.57826924",
"0.57103634",
"0.56808215",
"0.5677027",
"0.5652359",
"0.5635027",
"0.5634604",
"0.56251013",
"0.5597569",
"0.5584796",
"0.55824274",
"0.55751693",
"0.55746603",
"0.55651796",
"0.55643755",
"0.5559145",
"0.5503358",
"0.5503358",
"0.5503358",
"0.5497904",
"0.54838085",
"0.547156",
"0.5438616",
"0.5438616",
"0.538449",
"0.5361676",
"0.53445566",
"0.53281295",
"0.5315353",
"0.5310435",
"0.5302016",
"0.5292551",
"0.5285767",
"0.5282952",
"0.5279134",
"0.52720684",
"0.5271998",
"0.526137",
"0.5260695",
"0.5255681",
"0.5252227",
"0.524002",
"0.52372134",
"0.523666",
"0.52322555",
"0.52313423",
"0.52213854",
"0.52187675",
"0.5210334",
"0.5193376",
"0.518309",
"0.5173341",
"0.51625514",
"0.5161408",
"0.5160292",
"0.51495767",
"0.5145397",
"0.514318",
"0.514112",
"0.513297",
"0.513297",
"0.5132295",
"0.51239884",
"0.5114346",
"0.5113425",
"0.5112827",
"0.51097065",
"0.5108685",
"0.51020926",
"0.51004297",
"0.5093258",
"0.50881106",
"0.50829554",
"0.5073409",
"0.5069374",
"0.5067401",
"0.50619817",
"0.5060438",
"0.5053598",
"0.5050424",
"0.504888",
"0.5047913",
"0.50374573",
"0.5036884",
"0.50323004",
"0.5023583",
"0.5020327",
"0.50183594",
"0.50127417",
"0.5012138"
] | 0.50356776 | 94 |
This method is called once with the initial value and again whenever data at this location is updated. | @Override
public void onDataChange(DataSnapshot dataSnapshot) {
Name value = dataSnapshot.getValue(Name.class);
Log.d("Oof", "Value is: " + value.last);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}",
"public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}",
"private void onChange() {\n startTime = -1L;\n endTime = -1L;\n minLat = Double.NaN;\n maxLat = Double.NaN;\n minLon = Double.NaN;\n maxLon = Double.NaN;\n }",
"synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }",
"public void update() {\n\t\tmLast = mNow;\n\t\tmNow = get();\n\t}",
"@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}",
"private void notifyInitialValue() {\r\n if (this.bindingSource != null) {\r\n updateTarget(this.bindingSource.getInitialValue());\r\n }\r\n else {\r\n updateTarget(null);\r\n }\r\n }",
"private void Initialized_Data() {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n public void onRefresh() {\n if(mLatitude == null || mLongitude == null){\n mLatitude = DEFAULT_LAT;\n mLongitude = DEFAULT_LON;\n loadZomatoData(mLatitude, mLongitude);\n } else {\n loadZomatoData(mLatitude,mLongitude);\n }\n }",
"private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }",
"public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"private void initValues() {\n \n }",
"public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }",
"@Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n\n\n }",
"private void updateGeo(Double latitude, Double longitude) {\n latitudeValue = latitude;\n longitudeValue = longitude;\n }",
"private void updateLocationUI() {\n if (mCurrentLocation != null) {\n Log.e(\"UPDATE GEO\", \"LAT \" + mCurrentLocation.getLatitude() + \" LON \" +\n mCurrentLocation.getLongitude() + \" LAST UPDATE \" + mLastUpdateTime);\n }\n }",
"protected void initialize() {\n \tsetSetpoint(0.0);\n }",
"@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}",
"@Override\n\t\tpublic void onLocationChanged(Location args0) {\n\t\t\t mCurrentLocation = args0;\n\t mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n\t updateUI();\n\n\t\t}",
"public void willbeUpdated() {\n\t\t\n\t}",
"protected void storeCurrentValues() {\n }",
"public synchronized void updateData() {\n updateDataFields(this::defaultFetcher);\n }",
"@Override\n\tpublic int update() {\n\t\treturn 0;\n\t}",
"private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }",
"@Override\n protected void initialize() {\n m_oldTime = Timer.getFPGATimestamp();\n m_oldError= m_desiredDistance;\n }",
"private void reset() {\n //todo test it !\n longitude = 0.0;\n latitude = 0.0;\n IDToday = 0L;\n venVolToday = 0L;\n PM25Today = 0;\n PM25Source = 0;\n DBCanRun = true;\n DBRunTime = 0;\n isPMSearchRunning = false;\n isLocationChanged = false;\n isUploadRunning = false;\n refreshAll();\n locationInitial();\n DBInitial();\n sensorInitial();\n }",
"private void initialData() {\n\n }",
"private void updateValues(){\n if (mCelsian != null) {\n mCelsian.readMplTemp();\n mCelsian.readShtTemp();\n mCelsian.readRh();\n mCelsian.readPres();\n mCelsian.readUvaValue();\n mCelsian.readUvbValue();\n mCelsian.readUvdValue();\n mCelsian.readUvcomp1Value();\n mCelsian.readUvcomp2Value();\n }\n }",
"public void updateData() {}",
"@Override\n\tpublic void initValue() {\n\t\t\n\t}",
"@Override\n protected void initLocation() {\n }",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"@Override\n protected void onSetInitialValue(boolean restorePersistedValue,\n Object defaultValue) {\n setLocationString(restorePersistedValue ?\n getPersistedString(loc_string) : (String) defaultValue);\n }",
"@Override\n public void update() {\n \n }",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"public void updateValues() {\r\n\t\tSystem.out.println(\"LastTime: \" + lastTime);\r\n\t\t// System.out.println(\"Rerouted: \" + restoredLSP.toString());\r\n\t\t// System.out.println(\"Crack rerouted success: \" +\r\n\t\t// reroutedLSP.toString());\r\n\t\tSystem.out.println(\"Number of Crack rerouted success: \"\r\n\t\t\t\t+ reroutedLSP.size());\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\r\n\t}",
"@Override\r\n public void update() {\r\n this.total = calculateTotal();\r\n }",
"public void onLocationChange() {\n\t\tupdateWeather();\n\t\tgetLoaderManager().restartLoader(FORECAST_LOADER_ID, null, this);\n\t}",
"public void update() {\n\t\tupdate(1);\n\t}",
"@Override\r\n public void update() {\r\n this.highestRevenueRestaurant = findHighestRevenueRestaurant();\r\n this.total = calculateTotal();\r\n }",
"public void recalibrateData() {\r\n\t\tclicks = random.nextInt(65535); //may need tweaking. the sensor sends 2 bytes worth of data but 65k is probably too big of a range to be reasonable\r\n\t}",
"@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}",
"public void init() {\n\t\tdouble v = MathUtils.toNum(get(\"value\"));\n\t\tlong v100 = (long) MathUtils.toNum(get(\"value100\"));\n\t\tif (v100 != 100*v) {\n\t\t\tv100 = (long) (v*100);\n\t\t\tput(\"value100\", v100);\n\t\t}\n\t}",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"@Override\n\tprotected void onStart() {\n \tElevator.getInstance().setMotorValue(val);\n }",
"@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }",
"public void refresh() {\r\n\t\tinit();\r\n\t}",
"public void reset() {\n _valueLoaded = false;\n _value = null;\n }",
"public void startRefresh() {\n SmartDashboard.putNumber(\"Ele P\", 0.0);\n SmartDashboard.putNumber(\"Ele I\", 0.0);\n SmartDashboard.putNumber(\"Ele D\", 0.0);\n SmartDashboard.putNumber(\"Ele Set\", 0.0);\n }",
"protected void updateLocationUI() {\n if (mCurrentLocation != null) {\n //TrackDataCSVHelper myCSV2 = new TrackDataCSVHelper();\n //mDistanceFromWaypointText.setText(String.valueOf(myCSV2.getLon(track, this))); //<-- used this to test getting proper lat/lon\n //mDistanceFromWaypointText.setText(String.format(\"%s: %f\", \"Dist from WP\", mDistanceFromWaypoint));\n //mZoneStatusText.setText(\"IN THE ZONE? \" + mIsInZone);\n //mNumberUpdates.setText(String.valueOf(mNum));\n }\n }",
"public void dispatch() {\n if (getScrollChild() == null) {\n return;\n }\n\n peer.ignoreSetValue = true;\n adjuster.setValue(value);\n peer.ignoreSetValue = false;\n }",
"public void internalStore() {\r\n\t\tdata = busInt.get();\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {}",
"@Override\n\tpublic void update() {}",
"@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"@Override\n public void update() {\n }",
"private void sample() {\n Number value = gauge.get();\n this.inner.set(value != null ? value.doubleValue() : 0);\n }",
"@Override\n\tpublic void resetLocation() {\n\t\t\n\t}",
"public void reset() {\n firstUpdate = true;\n }",
"private void updateLocationUI() {\n mCurrentLocationStr = mCurrentPlace.getAddress().toString();\n mCurrentLatLng = mCurrentPlace.getLatLng();\n if(mCurrentLocationStr.isEmpty())\n mCurrentLocationStr = String.format(\"(%.2f, %.2f)\",mCurrentLatLng.latitude, mCurrentLatLng.longitude);\n\n mAddLocation.setText(mCurrentLocationStr);\n mAddLocation.setTextColor(mSecondaryTextColor);\n mClearLocation.setVisibility(View.VISIBLE);\n }",
"private void updateLocationUI() {\r\n if (mCurrentLocation != null) {\r\n CityName = mCurrentLocation.getLatitude()+ mCurrentLocation.getLongitude();\r\n }\r\n }",
"@Override\n\tpublic void update() { }",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }",
"@Override\n public String updateLat() {\n return mylat;\n }",
"@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }",
"@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }",
"public void update() {\n if (System.currentTimeMillis() >= currSampleTimeInMillis + sampleDuration) {\n lastSampleTimeInMillis = currSampleTimeInMillis;\n lastPositionInTicks = currPositionInTicks;\n currSampleTimeInMillis = System.currentTimeMillis();\n currPositionInTicks = motor.getCurrentPosition();\n }\n }",
"private void assumeValues() {\n\n if (isDisposed.get()) return;\n\n {// set map values\n MapPosition currentMapPosition = this.map.getMapPosition();\n if (this.mapCenter != null && getCenterGps())\n currentMapPosition.setPosition(this.mapCenter.latitude, this.mapCenter.longitude);\n\n // heading for map must between -180 and 180\n if (mapBearing < -180) mapBearing += 360;\n currentMapPosition.setBearing(mapBearing);\n currentMapPosition.setTilt(this.tilt);\n this.map.setMapPosition(currentMapPosition);\n }\n\n if (this.myPosition != null) {\n if (!ThreadUtils.isMainThread())\n this.map.post(new Runnable() {\n @Override\n public void run() {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n });\n else {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n }\n\n {// set yOffset at dependency of tilt\n if (this.tilt > 0) {\n float offset = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, 0.8f, this.tilt);\n this.map.viewport().setMapScreenCenter(offset);\n } else {\n this.map.viewport().setMapScreenCenter(0);\n }\n }\n\n {// set mapOrientationButton tilt\n if (this.tilt > 0) {\n float buttonTilt = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, -60f, this.tilt);\n this.mapOrientationButton.setTilt(buttonTilt);\n } else {\n this.mapOrientationButton.setTilt(0);\n }\n }\n }",
"@Override\n public void update() {\n }",
"private void updateLocation() {\n myLocationOnScreenRef.set(myComponent.getLocationOnScreen());\n }",
"public void refreshData() {\n\n if (!mUpdatingData) {\n new RefreshStateDataTask().execute((Void) null);\n }\n }",
"private void setData() {\n\n }",
"public void reset(){\n value = 0;\n }",
"public void updateLocation();",
"@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }",
"@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}",
"@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}"
] | [
"0.6856542",
"0.6654883",
"0.6446471",
"0.64045274",
"0.62937367",
"0.62570226",
"0.62508667",
"0.624989",
"0.6217914",
"0.6217914",
"0.6217914",
"0.61913645",
"0.6187112",
"0.61626685",
"0.6160627",
"0.6160627",
"0.61481184",
"0.614558",
"0.6142754",
"0.6118363",
"0.6087983",
"0.60775137",
"0.60732204",
"0.60703427",
"0.6056895",
"0.6055453",
"0.60546345",
"0.6054223",
"0.6051069",
"0.60471123",
"0.6037719",
"0.6017332",
"0.6016473",
"0.6007601",
"0.5990483",
"0.5986395",
"0.59851384",
"0.59689265",
"0.59683985",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.5958242",
"0.594287",
"0.59418666",
"0.5937245",
"0.5934195",
"0.59159356",
"0.59081286",
"0.5906132",
"0.5905515",
"0.5902108",
"0.58980954",
"0.5896514",
"0.58822805",
"0.5881727",
"0.58796126",
"0.5864834",
"0.5840819",
"0.5829503",
"0.58259916",
"0.58239263",
"0.5821117",
"0.5821117",
"0.5820587",
"0.5815942",
"0.58117074",
"0.580967",
"0.5805761",
"0.5799243",
"0.5795482",
"0.57919407",
"0.57892895",
"0.5787571",
"0.5787571",
"0.5786608",
"0.5784424",
"0.5769878",
"0.57665694",
"0.5756872",
"0.57555073",
"0.5750877",
"0.57464033",
"0.5738473",
"0.57328475",
"0.5731573",
"0.5731547",
"0.57271314",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.5723563",
"0.572117",
"0.57182354",
"0.5716495",
"0.5716495"
] | 0.0 | -1 |
Failed to read value | @Override
public void onCancelled(DatabaseError error) {
Log.w("Oof2", "Failed to read value.", error.toException());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean shouldReadValue();",
"Object readValue();",
"private @NotNull ErrorValue finishReadingError()\n throws IOException, JsonFormatException {\n stepOver(JsonToken.VALUE_NUMBER_INT, \"integer value\");\n int errorCode;\n try { errorCode = currentValueAsInt(); } catch (JsonParseException ignored) {\n throw expected(\"integer error code\");\n }\n stepOver(JsonFormat.ERROR_MESSAGE_FIELD);\n stepOver(JsonToken.VALUE_STRING, \"string value\");\n String message = currentText();\n // TODO read custom error properties here (if we decide to support these)\n stepOver(JsonToken.END_OBJECT);\n return new ErrorValue(errorCode, message, null);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\" + databaseError.toString());\n }",
"Text getValue() throws IOException;",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Firebase read \", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\", databaseError.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Test\n void deserialize_test_with_invalid_value() {\n assertThatThrownBy(\n () -> jsonConverter.readValue(\"{\\\"transport\\\": -1}\", TestDTO.class)\n ).isInstanceOf(DataConversionException.class);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"abstract Object getValue (String str, ValidationContext vc) throws DatatypeException;",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}",
"@Override\r\n public Object getValueFromString(String text_p) throws Exception\r\n {\n return null;\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read test value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"public String getValue() {\n/* 99 */ return this.value;\n/* */ }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Jinx\", \"Failed to read value.\", error.toException());\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testFromValueWithException() {\n System.out.println(\"fromValue\");\n String value = \"DELETED\";\n StatusType expResult = StatusType.DELETED;\n StatusType result = StatusType.fromValue(value);\n assertEquals(expResult, result);\n }",
"public ValueOutOfBoundsException(String message){\n super(message);\n //do nothing else\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(null, \"Failed to read value.\", error.toException());\n }",
"private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {\n\n DatumType type = tag.type;\n @NotNull JsonToken token = currentToken();\n // null?\n if (token == JsonToken.VALUE_NULL) return type.createValue(null);\n // error?\n final @Nullable String firstFieldName;\n if (token == JsonToken.START_OBJECT) { // can be a record or an error\n firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)\n if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());\n } else firstFieldName = null;\n // datum\n final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);\n return datum.asValue();\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Payments\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"taches \", \"Failed to read value.\", error.toException());\n }",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"ASDG\", \"Failed to read value.\", error.toException());\n }",
"Object nextValue() throws IOException;",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(\"ERROR TAG\", \"Failed to read value.\", error.toException());\n }",
"private void read() {\n\t\tticketint = preticketint.getInt(\"ticketint\", 0);\r\n\t\tLog.d(\"ticketint\", \"ticketint\" + \"read\" + ticketint);\r\n\t}",
"@BeforeStep\n\tprivate void retriveValue(StepExecution stepExecution) throws PhotoOmniException{\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\" Entering into PMByWICCustomReader.retriveValue() \");\n\t\t}\n\t\ttry {\n\t\t\tJobExecution objJobExecution = stepExecution.getJobExecution();\n\t\t\tExecutionContext objExecutionContext = objJobExecution.getExecutionContext();\n\t\t\tobjPMBYWICReportPrefDataBean = (PMBYWICReportPrefDataBean) objExecutionContext.get(\"refDataKey\");\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\" Error occoured at PMByWICCustomReader.retriveValue() >----> \" + e);\n\t\t\tthrow new PhotoOmniException(e.getMessage());\n\t\t}finally {\n\t\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\t\tLOGGER.debug(\" Exiting From PMByWICCustomReader.retriveValue() >----> \");\n\t\t\t}\n\t\t}\n\t}",
"private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }",
"public InvalidRifValueException(Throwable cause) {\n super(cause);\n }",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }",
"public Address getValue() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;",
"public String getStringValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not a string.\");\n }",
"public static int getValue_from_die()\n {\n return value_from_die;\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.i(\"OnCancelled\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"error\", \"Failed to read value.\", error.toException());\n }",
"protected Object readUnknownData() throws IOException {\r\n byte[] bytesValue;\r\n Byte[] bytesV;\r\n Preferences.debug(\"Unknown data; length is \" + elementLength + \" fp = \" + getFilePointer() + \"\\n\", 2);\r\n\r\n if (elementLength <= 0) {\r\n Preferences.debug(\"Unknown data; Error length is \" + elementLength + \"!!!!!\\n\", 2);\r\n\r\n return null;\r\n }\r\n\r\n bytesValue = new byte[elementLength];\r\n read(bytesValue);\r\n bytesV = new Byte[elementLength];\r\n\r\n for (int k = 0; k < bytesValue.length; k++) {\r\n bytesV[k] = new Byte(bytesValue[k]);\r\n }\r\n\r\n return bytesV;\r\n }",
"@Test\n public void shouldThrowExceptionIfFailsToGetVariableAsIntByOid() throws IOException {\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n\n replayAll();\n final Integer variableAsInt = session.getVariableAsInt(\"1\");\n\n assertNull(variableAsInt);\n verifyAll();\n\n }",
"public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }",
"public abstract String getValue();",
"public abstract String getValue();",
"public abstract String getValue();",
"@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}",
"public void _read(org.omg.CORBA.portable.InputStream istream)\r\n {\r\n value = EtudiantDejaInscritExceptionHelper.read(istream);\r\n }"
] | [
"0.6520245",
"0.644224",
"0.62601036",
"0.6077715",
"0.6027265",
"0.59389204",
"0.5928014",
"0.5897478",
"0.5892562",
"0.5891626",
"0.5821752",
"0.5813256",
"0.5813256",
"0.58093756",
"0.58006567",
"0.5798476",
"0.5776234",
"0.5774579",
"0.57361126",
"0.5728217",
"0.57143444",
"0.5699661",
"0.56832033",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5678807",
"0.5677442",
"0.5675753",
"0.5673998",
"0.5673998",
"0.5639195",
"0.5639195",
"0.5639195",
"0.5639195",
"0.5639195",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.5616912",
"0.56142795",
"0.5613676",
"0.5605406",
"0.5584552",
"0.5570884",
"0.55625266",
"0.5544951",
"0.55435926",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.5525155",
"0.55243915",
"0.55217975",
"0.5517537",
"0.551731",
"0.55162007",
"0.5509505",
"0.5503448",
"0.55026805",
"0.549577",
"0.5493651",
"0.5481864",
"0.547583",
"0.54632115",
"0.54314864",
"0.54267025",
"0.5424288",
"0.5423057",
"0.54224277",
"0.54224277",
"0.54224277",
"0.54200286",
"0.54182553"
] | 0.5567774 | 63 |
This method is called once with the initial value and again whenever data at this location is updated. | @Override
public void onDataChange(DataSnapshot dataSnapshot) {
String value = dataSnapshot.getValue(String.class);
Log.d("Oof", "Value is: " + value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}",
"public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}",
"private void onChange() {\n startTime = -1L;\n endTime = -1L;\n minLat = Double.NaN;\n maxLat = Double.NaN;\n minLon = Double.NaN;\n maxLon = Double.NaN;\n }",
"synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }",
"public void update() {\n\t\tmLast = mNow;\n\t\tmNow = get();\n\t}",
"@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}",
"private void notifyInitialValue() {\r\n if (this.bindingSource != null) {\r\n updateTarget(this.bindingSource.getInitialValue());\r\n }\r\n else {\r\n updateTarget(null);\r\n }\r\n }",
"private void Initialized_Data() {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n public void onRefresh() {\n if(mLatitude == null || mLongitude == null){\n mLatitude = DEFAULT_LAT;\n mLongitude = DEFAULT_LON;\n loadZomatoData(mLatitude, mLongitude);\n } else {\n loadZomatoData(mLatitude,mLongitude);\n }\n }",
"private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }",
"public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"private void initValues() {\n \n }",
"public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }",
"@Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n\n\n }",
"private void updateGeo(Double latitude, Double longitude) {\n latitudeValue = latitude;\n longitudeValue = longitude;\n }",
"private void updateLocationUI() {\n if (mCurrentLocation != null) {\n Log.e(\"UPDATE GEO\", \"LAT \" + mCurrentLocation.getLatitude() + \" LON \" +\n mCurrentLocation.getLongitude() + \" LAST UPDATE \" + mLastUpdateTime);\n }\n }",
"protected void initialize() {\n \tsetSetpoint(0.0);\n }",
"@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}",
"@Override\n\t\tpublic void onLocationChanged(Location args0) {\n\t\t\t mCurrentLocation = args0;\n\t mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n\t updateUI();\n\n\t\t}",
"public void willbeUpdated() {\n\t\t\n\t}",
"protected void storeCurrentValues() {\n }",
"public synchronized void updateData() {\n updateDataFields(this::defaultFetcher);\n }",
"@Override\n\tpublic int update() {\n\t\treturn 0;\n\t}",
"private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }",
"@Override\n protected void initialize() {\n m_oldTime = Timer.getFPGATimestamp();\n m_oldError= m_desiredDistance;\n }",
"private void reset() {\n //todo test it !\n longitude = 0.0;\n latitude = 0.0;\n IDToday = 0L;\n venVolToday = 0L;\n PM25Today = 0;\n PM25Source = 0;\n DBCanRun = true;\n DBRunTime = 0;\n isPMSearchRunning = false;\n isLocationChanged = false;\n isUploadRunning = false;\n refreshAll();\n locationInitial();\n DBInitial();\n sensorInitial();\n }",
"private void initialData() {\n\n }",
"private void updateValues(){\n if (mCelsian != null) {\n mCelsian.readMplTemp();\n mCelsian.readShtTemp();\n mCelsian.readRh();\n mCelsian.readPres();\n mCelsian.readUvaValue();\n mCelsian.readUvbValue();\n mCelsian.readUvdValue();\n mCelsian.readUvcomp1Value();\n mCelsian.readUvcomp2Value();\n }\n }",
"public void updateData() {}",
"@Override\n\tpublic void initValue() {\n\t\t\n\t}",
"@Override\n protected void initLocation() {\n }",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"@Override\n protected void onSetInitialValue(boolean restorePersistedValue,\n Object defaultValue) {\n setLocationString(restorePersistedValue ?\n getPersistedString(loc_string) : (String) defaultValue);\n }",
"@Override\n public void update() {\n \n }",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"public void updateValues() {\r\n\t\tSystem.out.println(\"LastTime: \" + lastTime);\r\n\t\t// System.out.println(\"Rerouted: \" + restoredLSP.toString());\r\n\t\t// System.out.println(\"Crack rerouted success: \" +\r\n\t\t// reroutedLSP.toString());\r\n\t\tSystem.out.println(\"Number of Crack rerouted success: \"\r\n\t\t\t\t+ reroutedLSP.size());\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\r\n\t}",
"@Override\r\n public void update() {\r\n this.total = calculateTotal();\r\n }",
"public void onLocationChange() {\n\t\tupdateWeather();\n\t\tgetLoaderManager().restartLoader(FORECAST_LOADER_ID, null, this);\n\t}",
"public void update() {\n\t\tupdate(1);\n\t}",
"@Override\r\n public void update() {\r\n this.highestRevenueRestaurant = findHighestRevenueRestaurant();\r\n this.total = calculateTotal();\r\n }",
"public void recalibrateData() {\r\n\t\tclicks = random.nextInt(65535); //may need tweaking. the sensor sends 2 bytes worth of data but 65k is probably too big of a range to be reasonable\r\n\t}",
"@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}",
"public void init() {\n\t\tdouble v = MathUtils.toNum(get(\"value\"));\n\t\tlong v100 = (long) MathUtils.toNum(get(\"value100\"));\n\t\tif (v100 != 100*v) {\n\t\t\tv100 = (long) (v*100);\n\t\t\tput(\"value100\", v100);\n\t\t}\n\t}",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"@Override\n\tprotected void onStart() {\n \tElevator.getInstance().setMotorValue(val);\n }",
"@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }",
"public void refresh() {\r\n\t\tinit();\r\n\t}",
"public void reset() {\n _valueLoaded = false;\n _value = null;\n }",
"public void startRefresh() {\n SmartDashboard.putNumber(\"Ele P\", 0.0);\n SmartDashboard.putNumber(\"Ele I\", 0.0);\n SmartDashboard.putNumber(\"Ele D\", 0.0);\n SmartDashboard.putNumber(\"Ele Set\", 0.0);\n }",
"protected void updateLocationUI() {\n if (mCurrentLocation != null) {\n //TrackDataCSVHelper myCSV2 = new TrackDataCSVHelper();\n //mDistanceFromWaypointText.setText(String.valueOf(myCSV2.getLon(track, this))); //<-- used this to test getting proper lat/lon\n //mDistanceFromWaypointText.setText(String.format(\"%s: %f\", \"Dist from WP\", mDistanceFromWaypoint));\n //mZoneStatusText.setText(\"IN THE ZONE? \" + mIsInZone);\n //mNumberUpdates.setText(String.valueOf(mNum));\n }\n }",
"public void dispatch() {\n if (getScrollChild() == null) {\n return;\n }\n\n peer.ignoreSetValue = true;\n adjuster.setValue(value);\n peer.ignoreSetValue = false;\n }",
"public void internalStore() {\r\n\t\tdata = busInt.get();\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {}",
"@Override\n\tpublic void update() {}",
"@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"@Override\n public void update() {\n }",
"private void sample() {\n Number value = gauge.get();\n this.inner.set(value != null ? value.doubleValue() : 0);\n }",
"@Override\n\tpublic void resetLocation() {\n\t\t\n\t}",
"public void reset() {\n firstUpdate = true;\n }",
"private void updateLocationUI() {\n mCurrentLocationStr = mCurrentPlace.getAddress().toString();\n mCurrentLatLng = mCurrentPlace.getLatLng();\n if(mCurrentLocationStr.isEmpty())\n mCurrentLocationStr = String.format(\"(%.2f, %.2f)\",mCurrentLatLng.latitude, mCurrentLatLng.longitude);\n\n mAddLocation.setText(mCurrentLocationStr);\n mAddLocation.setTextColor(mSecondaryTextColor);\n mClearLocation.setVisibility(View.VISIBLE);\n }",
"private void updateLocationUI() {\r\n if (mCurrentLocation != null) {\r\n CityName = mCurrentLocation.getLatitude()+ mCurrentLocation.getLongitude();\r\n }\r\n }",
"@Override\n\tpublic void update() { }",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }",
"@Override\n public String updateLat() {\n return mylat;\n }",
"@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }",
"@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }",
"public void update() {\n if (System.currentTimeMillis() >= currSampleTimeInMillis + sampleDuration) {\n lastSampleTimeInMillis = currSampleTimeInMillis;\n lastPositionInTicks = currPositionInTicks;\n currSampleTimeInMillis = System.currentTimeMillis();\n currPositionInTicks = motor.getCurrentPosition();\n }\n }",
"private void assumeValues() {\n\n if (isDisposed.get()) return;\n\n {// set map values\n MapPosition currentMapPosition = this.map.getMapPosition();\n if (this.mapCenter != null && getCenterGps())\n currentMapPosition.setPosition(this.mapCenter.latitude, this.mapCenter.longitude);\n\n // heading for map must between -180 and 180\n if (mapBearing < -180) mapBearing += 360;\n currentMapPosition.setBearing(mapBearing);\n currentMapPosition.setTilt(this.tilt);\n this.map.setMapPosition(currentMapPosition);\n }\n\n if (this.myPosition != null) {\n if (!ThreadUtils.isMainThread())\n this.map.post(new Runnable() {\n @Override\n public void run() {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n });\n else {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n }\n\n {// set yOffset at dependency of tilt\n if (this.tilt > 0) {\n float offset = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, 0.8f, this.tilt);\n this.map.viewport().setMapScreenCenter(offset);\n } else {\n this.map.viewport().setMapScreenCenter(0);\n }\n }\n\n {// set mapOrientationButton tilt\n if (this.tilt > 0) {\n float buttonTilt = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, -60f, this.tilt);\n this.mapOrientationButton.setTilt(buttonTilt);\n } else {\n this.mapOrientationButton.setTilt(0);\n }\n }\n }",
"@Override\n public void update() {\n }",
"private void updateLocation() {\n myLocationOnScreenRef.set(myComponent.getLocationOnScreen());\n }",
"public void refreshData() {\n\n if (!mUpdatingData) {\n new RefreshStateDataTask().execute((Void) null);\n }\n }",
"private void setData() {\n\n }",
"public void reset(){\n value = 0;\n }",
"public void updateLocation();",
"@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }",
"@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}",
"@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}"
] | [
"0.6856542",
"0.6654883",
"0.6446471",
"0.64045274",
"0.62937367",
"0.62570226",
"0.62508667",
"0.624989",
"0.6217914",
"0.6217914",
"0.6217914",
"0.61913645",
"0.6187112",
"0.61626685",
"0.6160627",
"0.6160627",
"0.61481184",
"0.614558",
"0.6142754",
"0.6118363",
"0.6087983",
"0.60775137",
"0.60732204",
"0.60703427",
"0.6056895",
"0.6055453",
"0.60546345",
"0.6054223",
"0.6051069",
"0.60471123",
"0.6037719",
"0.6017332",
"0.6016473",
"0.6007601",
"0.5990483",
"0.5986395",
"0.59851384",
"0.59689265",
"0.59683985",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.5958242",
"0.594287",
"0.59418666",
"0.5937245",
"0.5934195",
"0.59159356",
"0.59081286",
"0.5906132",
"0.5905515",
"0.5902108",
"0.58980954",
"0.5896514",
"0.58822805",
"0.5881727",
"0.58796126",
"0.5864834",
"0.5840819",
"0.5829503",
"0.58259916",
"0.58239263",
"0.5821117",
"0.5821117",
"0.5820587",
"0.5815942",
"0.58117074",
"0.580967",
"0.5805761",
"0.5799243",
"0.5795482",
"0.57919407",
"0.57892895",
"0.5787571",
"0.5787571",
"0.5786608",
"0.5784424",
"0.5769878",
"0.57665694",
"0.5756872",
"0.57555073",
"0.5750877",
"0.57464033",
"0.5738473",
"0.57328475",
"0.5731573",
"0.5731547",
"0.57271314",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.5723563",
"0.572117",
"0.57182354",
"0.5716495",
"0.5716495"
] | 0.0 | -1 |
Failed to read value | @Override
public void onCancelled(DatabaseError error) {
Log.w("Oof2", "Failed to read value.", error.toException());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean shouldReadValue();",
"Object readValue();",
"private @NotNull ErrorValue finishReadingError()\n throws IOException, JsonFormatException {\n stepOver(JsonToken.VALUE_NUMBER_INT, \"integer value\");\n int errorCode;\n try { errorCode = currentValueAsInt(); } catch (JsonParseException ignored) {\n throw expected(\"integer error code\");\n }\n stepOver(JsonFormat.ERROR_MESSAGE_FIELD);\n stepOver(JsonToken.VALUE_STRING, \"string value\");\n String message = currentText();\n // TODO read custom error properties here (if we decide to support these)\n stepOver(JsonToken.END_OBJECT);\n return new ErrorValue(errorCode, message, null);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\" + databaseError.toString());\n }",
"Text getValue() throws IOException;",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Firebase read \", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\", databaseError.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Test\n void deserialize_test_with_invalid_value() {\n assertThatThrownBy(\n () -> jsonConverter.readValue(\"{\\\"transport\\\": -1}\", TestDTO.class)\n ).isInstanceOf(DataConversionException.class);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"abstract Object getValue (String str, ValidationContext vc) throws DatatypeException;",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}",
"@Override\r\n public Object getValueFromString(String text_p) throws Exception\r\n {\n return null;\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read test value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Jinx\", \"Failed to read value.\", error.toException());\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testFromValueWithException() {\n System.out.println(\"fromValue\");\n String value = \"DELETED\";\n StatusType expResult = StatusType.DELETED;\n StatusType result = StatusType.fromValue(value);\n assertEquals(expResult, result);\n }",
"public String getValue() {\n/* 99 */ return this.value;\n/* */ }",
"public ValueOutOfBoundsException(String message){\n super(message);\n //do nothing else\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(null, \"Failed to read value.\", error.toException());\n }",
"private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {\n\n DatumType type = tag.type;\n @NotNull JsonToken token = currentToken();\n // null?\n if (token == JsonToken.VALUE_NULL) return type.createValue(null);\n // error?\n final @Nullable String firstFieldName;\n if (token == JsonToken.START_OBJECT) { // can be a record or an error\n firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)\n if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());\n } else firstFieldName = null;\n // datum\n final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);\n return datum.asValue();\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Payments\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"taches \", \"Failed to read value.\", error.toException());\n }",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"ASDG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(\"ERROR TAG\", \"Failed to read value.\", error.toException());\n }",
"Object nextValue() throws IOException;",
"private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }",
"private void read() {\n\t\tticketint = preticketint.getInt(\"ticketint\", 0);\r\n\t\tLog.d(\"ticketint\", \"ticketint\" + \"read\" + ticketint);\r\n\t}",
"@BeforeStep\n\tprivate void retriveValue(StepExecution stepExecution) throws PhotoOmniException{\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\" Entering into PMByWICCustomReader.retriveValue() \");\n\t\t}\n\t\ttry {\n\t\t\tJobExecution objJobExecution = stepExecution.getJobExecution();\n\t\t\tExecutionContext objExecutionContext = objJobExecution.getExecutionContext();\n\t\t\tobjPMBYWICReportPrefDataBean = (PMBYWICReportPrefDataBean) objExecutionContext.get(\"refDataKey\");\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\" Error occoured at PMByWICCustomReader.retriveValue() >----> \" + e);\n\t\t\tthrow new PhotoOmniException(e.getMessage());\n\t\t}finally {\n\t\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\t\tLOGGER.debug(\" Exiting From PMByWICCustomReader.retriveValue() >----> \");\n\t\t\t}\n\t\t}\n\t}",
"public InvalidRifValueException(Throwable cause) {\n super(cause);\n }",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }",
"public Address getValue() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;",
"public String getStringValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not a string.\");\n }",
"public static int getValue_from_die()\n {\n return value_from_die;\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.i(\"OnCancelled\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"error\", \"Failed to read value.\", error.toException());\n }",
"protected Object readUnknownData() throws IOException {\r\n byte[] bytesValue;\r\n Byte[] bytesV;\r\n Preferences.debug(\"Unknown data; length is \" + elementLength + \" fp = \" + getFilePointer() + \"\\n\", 2);\r\n\r\n if (elementLength <= 0) {\r\n Preferences.debug(\"Unknown data; Error length is \" + elementLength + \"!!!!!\\n\", 2);\r\n\r\n return null;\r\n }\r\n\r\n bytesValue = new byte[elementLength];\r\n read(bytesValue);\r\n bytesV = new Byte[elementLength];\r\n\r\n for (int k = 0; k < bytesValue.length; k++) {\r\n bytesV[k] = new Byte(bytesValue[k]);\r\n }\r\n\r\n return bytesV;\r\n }",
"@Test\n public void shouldThrowExceptionIfFailsToGetVariableAsIntByOid() throws IOException {\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n\n replayAll();\n final Integer variableAsInt = session.getVariableAsInt(\"1\");\n\n assertNull(variableAsInt);\n verifyAll();\n\n }",
"public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }",
"public void _read(org.omg.CORBA.portable.InputStream istream)\r\n {\r\n value = EtudiantDejaInscritExceptionHelper.read(istream);\r\n }",
"public abstract String getValue();",
"public abstract String getValue();",
"public abstract String getValue();",
"@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}"
] | [
"0.6517161",
"0.6438516",
"0.62602985",
"0.6078665",
"0.60281205",
"0.5936836",
"0.59292346",
"0.58983654",
"0.5893653",
"0.5892309",
"0.5823051",
"0.58145076",
"0.58145076",
"0.5810502",
"0.58019006",
"0.5799575",
"0.57775164",
"0.57718277",
"0.5737445",
"0.5729524",
"0.57107884",
"0.5697406",
"0.5684644",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5680115",
"0.5677318",
"0.5675324",
"0.5675324",
"0.5675093",
"0.56405324",
"0.56405324",
"0.56405324",
"0.56405324",
"0.56405324",
"0.561942",
"0.561942",
"0.561942",
"0.561942",
"0.561942",
"0.561942",
"0.56156427",
"0.5614125",
"0.5613532",
"0.5606934",
"0.55857766",
"0.5567715",
"0.55637616",
"0.5545842",
"0.55450857",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5537012",
"0.5526495",
"0.55232227",
"0.55228627",
"0.5517513",
"0.55170023",
"0.5515216",
"0.5510436",
"0.55049735",
"0.55039304",
"0.5497654",
"0.54922265",
"0.54807246",
"0.5474508",
"0.54643846",
"0.54332024",
"0.5427352",
"0.5424144",
"0.54223406",
"0.5418867",
"0.5418239",
"0.5418239",
"0.5418239",
"0.54178673"
] | 0.55692554 | 63 |
the `shouldFail` argument refers to the operation root, not the source field! the source field will fail always | @Subscription(value = "countToFive")
Multi<DummyWithErrorOrOnFailingSourceField> countToFiveWithFailingSourceFieldInErrorOr(boolean shouldFail); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}",
"@Override\n boolean canFail() {\n return true;\n }",
"@Test\n public void testValidationFailed() {\n fail();\n }",
"@Test\n public void accuseFailTest() throws Exception {\n assertTrue(\"failure - accused status was not set to true\", target.isAccused());\n\n }",
"public abstract void\n fail(ValidationError error);",
"@Override\n boolean isFailed() {\n return false;\n }",
"@Override\n\tpublic void fail(Throwable t) {\n\t}",
"@Test\n public void testFail() {\n fail();\n }",
"public TestCase fail();",
"@Test\n public void testFail(){\n fail(\"This is meant to fail\");\n }",
"public boolean hasFail() {\n return result.hasFail();\n }",
"@Test @SpecAssertion(id = \"432-A1\", section=\"4.3.2\")\n public void testConversion(){\n Assert.fail();\n }",
"private Predicate<Response> shouldErrorFailBuild(boolean skipFailures){\n return x -> skipFailures || x.isSuccessful();\n }",
"boolean isFail();",
"boolean isFailure();",
"@Override\r\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\n\t}",
"@Test\n\tpublic void testSimpleOneRuleFailExecution() {\n\n\t\tSkRuleBase rule = buildThings(ONE_RULE_FAIL_FILE_NAME, SkRuleBase.class, \"rule\");\n\n\t\tSkRuleMaster master = new SkRuleMaster.Builder().addRule(rule)\n\t\t\t\t.build();\n\t\tSkRuleRunner runner = master.getRuleRunner();\n\n\t\ttry {\n\t\t\trunner.setValue(\"THIS_MACRO_DOES_NOT_EXIST\", \"X\");\n\t\t\trule.run(runner);\n\t\t\tAssert.fail(\"We should have thrown an error.\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(String.format(\"We expected this error : '%s'\", e.toString()));\n\t\t}\n\t\trunner.setValue(\"MILK.QTY\", 2);\n\t\trule.run(runner);\n\t}",
"@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }",
"public void fail( String reason );",
"@Override\r\n\tpublic String getFailDescription() {\n\t\treturn null;\r\n\t}",
"@Test\n public void testGetOnFail_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n\n String result = fixture.getOnFail();\n\n assertEquals(\"\", result);\n }",
"@Test (expected = IllegalArgumentException.class)\n public void testExceptionWhenSettingSource() {\n jobEntry.setSourceObject(null);\n\n }",
"public void testImproperUseOfTheCircuit() {\n \t fail(\"testImproperUseOfTheCircuit\");\n }",
"@Override\n\tpublic void setFailureMode(boolean arg0) {\n\n\t}",
"@Test\n void fail_the_test() {\n }",
"@Override\n\tpublic boolean isFailureMode() {\n\t\treturn false;\n\t}",
"public void testGetCleanupOnPutFailure() {\n System.out.println(\"getCleanupOnPutFailure\");\n \n boolean expResult = false;\n boolean result = instance.getCleanupOnPutFailure();\n assertEquals(expResult, result);\n \n }",
"public void fail() {\r\n\t\tcontestantIt.currentC().updatePoints(-FAIL);\r\n\t}",
"public void testFail1() throws Exception {\n helperFail(new String[] {\"j\", \"i\"}\r\n , new String[] {\"I\", \"I\"}\r\n , RefactoringStatus.ERROR);\r\n }",
"@Override\n\tpublic void endFail() {\n\t\t\n\t}",
"public void testSoThatTestsDoNotFail() {\n\n }",
"@Test\n public void tcEditProfileWithInvalidData() {\n\n }",
"@Test\n public void testInvokeEffectorStartFailing_Method() {\n FailingEntity entity = createFailingEntity();\n assertStartMethodFails(entity);\n }",
"@Test\n public void executeWithFailure() {\n new SimpleCommandFailure(\"badRequest\", HystrixRuntimeException.FailureType.COMMAND_EXCEPTION).execute();\n }",
"public void fail(boolean hcf);",
"@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}",
"@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}",
"@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\tSystem.out.println(\"on failure\");\n\t\t\n\t}",
"private static void testFail() throws Throwable {\n Scheduler userInt = SchedulerTHelper.getSchedulerInterface();\n\n for (int i = 0; i < jobs_fail; i++) {\n String job_path = new File(jobs_path.toURI()).getAbsolutePath() + \"/flow_fail_\" + (i + 1) +\n \".xml\";\n\n Exception exc = null;\n JobId job = null;\n try {\n job = userInt.submit(JobFactory.getFactory().createJob(job_path));\n } catch (Exception e) {\n exc = e;\n }\n Assert\n .assertTrue(\"Job \" + job_path + \" was supposed to be rejected but was created\",\n job == null);\n Assert.assertTrue(exc != null);\n }\n SchedulerTHelper.log(jobs_fail + \" invalid jobs successfully rejected\");\n }",
"public void testNonInsertableBlobDoesNotFail() {\n if (!skip) {\n TimestampedEntity pc = new TimestampedEntity();\n pc.setNonInsertableNonNullableDate(null);\n assertCommitSucceeds(pc, NEW);\n }\n // else no-op\n }",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\t\n\t\t\t}",
"@Test @SpecAssertion(id = \"432-A2\", section=\"4.3.2\")\n public void testConversionComparedWithRate(){\n Assert.fail();\n }",
"@Override\n\t\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\t\n\t\t}",
"public void fail(String desc) {\n\t\tfail();\n error = desc;\n\t}",
"private void assertFail(int value) {\n try {\n converter.convertRomanNumber(value);\n fail();\n } catch (Exception e) {\n }\n }",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"@Override\n public void testTaskManagerFailure(\n TestEnvironment testEnv,\n ExternalContext<RowData> externalContext,\n ClusterControllable controller)\n throws Exception {\n }",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}",
"static public void fail() {\n fail(null);\n }",
"public boolean isFailure( ) {\n\t\treturn failed;\n\t}",
"public Boolean getSkipFail() {\r\n\t\treturn this.skipFail;\r\n\t}",
"@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }",
"public void testDetails() {\n\t\tassertEquals(\"Incorrect target\", TARGET, this.aggregate.getTarget());\n\t\tassertEquals(\"Incorrect change description\", CHANGE_DESCRIPTION, this.aggregate.getChangeDescription());\n\t}",
"@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}",
"@Override\n public WorkflowStep fail() {\n this.boardChangeDetected = 0;\n this.missingFutures = 0;\n this.missingTetromino = 0;\n return INITIAL_BOARD.execute(false);\n }",
"private void resourceFailure(ReaderFailureMode mode) throws IOException {\n //Given - multiple resources\n PalisadeRecordReader<String> prr = new PalisadeRecordReader<>();\n //add more data which should succeed\n List<String> returnResources2 = Arrays.asList(\"s5\", \"s6\", \"s7\", \"s8\");\n DataRequestResponse response = new DataRequestResponse().token(\"test\")\n //set up some data which should return an error\n .resource(new StubResource(\"type_a\", \"id1\", \"format1\"),\n new StubConnectionDetail(\"con1\").setServiceToCreate(createMockDS(Collections.emptyList(), true)))\n .resource(new StubResource(\"type_b\", \"id2\", \"format2\"),\n new StubConnectionDetail(\"con2\").setServiceToCreate(createMockDS(returnResources2, false)));\n response.originalRequestId(new RequestId().id(\"test\"));\n //When\n PalisadeInputSplit split = new PalisadeInputSplit(response);\n PalisadeInputFormat.setResourceErrorBehaviour(con, mode);\n prr.initialize(split, con);\n //Then\n readValuesAndValidate(returnResources2.stream(), prr);\n verifyMocksCalled(response);\n }",
"@Override\n\t\tpublic void validate() throws ValidationError {\n\t\t\tif (newValueOfPropertyToChange < 0) {\n\t\t\t\tthrow new TestFailure(\"propertyToChange is not ok\");\n\t\t\t}\n\t\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}",
"@Test\n\tpublic void testReadTicketFail() {\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult Result) {\n\t\t\r\n\t}",
"@Override\r\n\t\t\t\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t\t\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\tSystem.out.println(\"on failed but within success percentage\");\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }",
"@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }",
"@Override\n public void onAnalysisFailed(IntegrationAnalyzer.FailReason failReason) {\n String message = failReason.getMessage();\n Log.d(TAG, \"Fail Reason message is\" + message);\n //..\n\n }",
"@Test\t\t\n\tpublic void TestToFail()\t\t\t\t\n\t{\t\t\n\t System.out.println(\"This method to test fail\");\t\t\t\t\t\n\t // Assert.assertTrue(false);\t\t\t\n\t}",
"protected void failed()\r\n {\r\n //overwrite\r\n }",
"@Override\n\tpublic void notifyFailure(ResourceOperationDescription operationDescription, Task task, OperationResult parentResult) {\n\t\tnotifyAny(operationDescription);\n\t}",
"void shouldThrowForBadServerValue() {\n }",
"@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic boolean validateDrop(Object target, int operation, TransferData transferType) {\n\t\t\treturn true;\r\n\t\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}",
"public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}",
"@Override\npublic void onTestFailure(ITestResult result) {\n\t\n}",
"@Override\n public boolean hasErrorResults() {\n return false;\n }",
"@Test\r\n public void testGetFails() {\r\n System.out.println(\"getFails\");\r\n Course c = null;\r\n Student instance = new Student();\r\n int expResult = 0;\r\n int result = instance.getFails(c);\r\n assertEquals(expResult, result);\r\n \r\n }",
"@SuppressWarnings(\"unchecked\")\n public Q fail() {\n forceFail = true;\n return (Q) this;\n }",
"public boolean isIfTaskFails() {\n return getFlow().isIfTaskFails();\n }"
] | [
"0.6839708",
"0.6709665",
"0.62487096",
"0.6189993",
"0.6121347",
"0.6113241",
"0.6067975",
"0.5977632",
"0.5903224",
"0.586012",
"0.5815068",
"0.58143127",
"0.5810619",
"0.58087504",
"0.57758486",
"0.5725749",
"0.57070786",
"0.5700121",
"0.56819063",
"0.5681804",
"0.5673497",
"0.5656504",
"0.5587844",
"0.55795646",
"0.55785084",
"0.5570488",
"0.5562408",
"0.5540244",
"0.5527444",
"0.55251706",
"0.54948133",
"0.54863644",
"0.5470446",
"0.5464375",
"0.54562026",
"0.54550564",
"0.54542375",
"0.54542375",
"0.54466474",
"0.54362464",
"0.54358035",
"0.5429671",
"0.54073054",
"0.54073054",
"0.54073054",
"0.53937936",
"0.5390085",
"0.5387885",
"0.5384544",
"0.5381688",
"0.5379476",
"0.53736085",
"0.5371048",
"0.5354276",
"0.5354276",
"0.5344158",
"0.53416926",
"0.5335309",
"0.53331584",
"0.5329472",
"0.5324131",
"0.5323914",
"0.532313",
"0.5319971",
"0.53186387",
"0.53186387",
"0.53159297",
"0.53131306",
"0.5310222",
"0.5300517",
"0.52958506",
"0.52958506",
"0.52958506",
"0.52958506",
"0.52958506",
"0.52958506",
"0.52958506",
"0.5294001",
"0.5294001",
"0.5293903",
"0.5293883",
"0.5293883",
"0.52936035",
"0.5291146",
"0.5286635",
"0.52800125",
"0.527668",
"0.52750343",
"0.5257538",
"0.5257538",
"0.5257538",
"0.5257538",
"0.5243334",
"0.52427584",
"0.52427584",
"0.5240285",
"0.5229486",
"0.5226757",
"0.5226336",
"0.5225037"
] | 0.56676394 | 21 |
setting User Basic Details | public void registerNewUser(final FirebaseFirestore db, final User user) {
FirebaseUser FbUser = FirebaseAuth.getInstance().getCurrentUser();
if (FbUser != null) {
UserProfileChangeRequest request = new UserProfileChangeRequest.Builder()
.setDisplayName(user.getName())
.build();
FbUser.updateProfile(request);
}
final DatabaseHelper localDB = new DatabaseHelper(getApplicationContext());
db.collection(collection)
.document(user.getEmail())
.set(user)
.addOnSuccessListener(avoid -> {
Toast.makeText(getApplicationContext(), "Registered", Toast.LENGTH_SHORT).show();
// Send to cache (local db)
addToCache(user, localDB);
// Send intent to dashboard
Intent goToDashboard = new Intent(SignupActivity.this, Dashboard.class);
Bundle myBundle = new Bundle();
myBundle.putString("email", user.getEmail());
// myBundle.putString("name", user.getName());
// myBundle.putString("maxIncome", String.valueOf(user.getMaxIncome()));
myBundle.putBoolean("coming_from_login_signup", true);
goToDashboard.putExtras(myBundle);
startActivity(goToDashboard);
})
.addOnFailureListener(e -> snackbar.showStatus("Not Registered"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }",
"public void populateUserInformation()\n {\n ViewInformationUser viewInformationUser = new ViewFXInformationUser();\n\n viewInformationUser.buildViewProfileInformation(clientToRegisteredClient((Client) user), nameLabel, surnameLabel, phoneLabel, emailLabel, addressVbox);\n }",
"private void updateUserDetails() {\n \tUser user=CurrentSession.getCurrentUser();\n \tjLabel1.setText(\"Name:\");\n jLabel2.setText(user.getFirstName()+\" \"+user.getLastName());\n jLabel3.setText(\"Card Number:\");\n jLabel4.setText(user.getCardNumber());\n jLabel5.setText(\"Daily Calorie Intake\");\n FoodPreference fp=new FoodPreference(user.getCardNumber());\n jLabel6.setText(\"\"+fp.getUserCalories());\n jLabel7.setText(\"Monthly Expenses\");\n jLabel8.setText(\"\"+user.getExpenses());\n\n\t\t\n\t}",
"public static void setUserDetails(UserSetup userSetup) {\n\n }",
"private void updateUserDetailsFromView() {\n\t\tcurrentDetails.setFirstName(detailDisplay.getFirstName().getValue());\n\t\tcurrentDetails.setLastName(detailDisplay.getLastName().getValue());\n\t\tcurrentDetails.setMiddleInitial(detailDisplay.getMiddleInitial().getValue());\n\t\tcurrentDetails.setTitle(detailDisplay.getTitle().getValue());\n\t\tcurrentDetails.setEmailAddress(detailDisplay.getEmailAddress().getValue());\n\t\tcurrentDetails.setPhoneNumber(detailDisplay.getPhoneNumber().getValue());\n\t\tcurrentDetails.setActive(detailDisplay.getIsActive().getValue());\n\t\t//currentDetails.setRootOid(detailDisplay.getRootOid().getValue());\n\t\tcurrentDetails.setRole(detailDisplay.getRole().getValue());\n\t\t\n\t\tcurrentDetails.setOid(detailDisplay.getOid().getValue());\n\t\tString orgId = detailDisplay.getOrganizationListBox().getValue();\n\t\tcurrentDetails.setOrganizationId(orgId);\n\t\tResult organization = detailDisplay.getOrganizationsMap().get(orgId);\n\t\tif (organization != null) {\n\t\t\tcurrentDetails.setOrganization(organization.getOrgName());\n\t\t} else {\n\t\t\tcurrentDetails.setOrganization(\"\");\n\t\t}\n\t}",
"private void setUpUser() {\n Bundle extras = getIntent().getExtras();\n mActiveUser = extras.getString(Helper.USER_NAME);\n mUser = mDbHelper.getUser(mActiveUser, true);\n Log.d(TAG, mUser.toString());\n\n if (mUser == null) {\n Toast.makeText(getBaseContext(), \"Error loading user data\", Toast.LENGTH_SHORT);\n return;\n }\n\n mIsNumPassword = Helper.isNumeric(mUser.getPassword());\n\n mKeyController = new KeyController(getApplicationContext(), mUser);\n }",
"public void setUser_name(String user_name);",
"private void editUser(){\n getDeviceLocation();\n ProxyBuilder.SimpleCallback<User> callback = returnedUser-> responseEdit(returnedUser);\n ServerManager.editUserProfile(userManager,callback);\n }",
"private void getUserInfo() {\n\t}",
"public void setupUser() {\n }",
"public void setUserDetails(){\n name = firebaseUser.getDisplayName();\n username.setText(name);\n\n Glide.with(this).load(firebaseUser.getPhotoUrl()).into(profileIcon);\n }",
"public String _setuser(b4a.HotelAppTP.types._user _u) throws Exception{\n_types._currentuser.username = _u.username;\n //BA.debugLineNum = 168;BA.debugLine=\"Types.currentuser.password = u.password\";\n_types._currentuser.password = _u.password;\n //BA.debugLineNum = 169;BA.debugLine=\"Types.currentuser.available = u.available\";\n_types._currentuser.available = _u.available;\n //BA.debugLineNum = 170;BA.debugLine=\"Types.currentuser.ID = u.ID\";\n_types._currentuser.ID = _u.ID;\n //BA.debugLineNum = 171;BA.debugLine=\"Types.currentuser.TypeOfWorker = u.TypeOfWorker\";\n_types._currentuser.TypeOfWorker = _u.TypeOfWorker;\n //BA.debugLineNum = 172;BA.debugLine=\"Types.currentuser.CurrentTaskID = u.CurrentTaskID\";\n_types._currentuser.CurrentTaskID = _u.CurrentTaskID;\n //BA.debugLineNum = 173;BA.debugLine=\"End Sub\";\nreturn \"\";\n}",
"private void setUserDetailsToView() {\n\t\tdetailDisplay.getFirstName().setValue(currentDetails.getFirstName());\n\t\tdetailDisplay.getLastName().setValue(currentDetails.getLastName());\n\t\tdetailDisplay.getMiddleInitial().setValue(currentDetails.getMiddleInitial());\n\t\tdetailDisplay.getLoginId().setText(currentDetails.getLoginId());\n\t\tdetailDisplay.getTitle().setValue(currentDetails.getTitle());\n\t\tdetailDisplay.getEmailAddress().setValue(currentDetails.getEmailAddress());\n\t\tdetailDisplay.getPhoneNumber().setValue(currentDetails.getPhoneNumber());\n\t\tdetailDisplay.getOrganizationListBox().setValue(currentDetails.getOrganizationId());\n\t\tdetailDisplay.getIsActive().setValue(currentDetails.isActive());\n\t\tif (!currentDetails.isActive()) {\n\t\t\tdetailDisplay.getIsRevoked().setValue(true);\n\t\t} else { // added else to fix default Revoked radio check in Mozilla (User Story 755)\n\t\t\tdetailDisplay.getIsRevoked().setValue(false);\n\t\t}\n\t\t\n\t\tdetailDisplay.setUserLocked(currentDetails.isLocked());\n\t\tif (currentDetails.isExistingUser()) {\n\t\t\tdetailDisplay.setShowRevokedStatus(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\t\t// detailDisplay.setUserIsDeletable(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\t} else {\n\t\t\tdetailDisplay.setShowRevokedStatus(false);\n\t\t\t//detailDisplay.setUserIsDeletable(false);\n\t\t}\n\t\tdetailDisplay.setUserIsActiveEditable(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\tdetailDisplay.setShowUnlockOption(currentDetails.isCurrentUserCanUnlock() && currentDetails.isActive());\n\t\tdetailDisplay.getRole().setValue(currentDetails.getRole());\n\t\tdetailDisplay.getOid().setValue(currentDetails.getOid());\n\t\tdetailDisplay.getOid().setTitle(currentDetails.getOid());\n\t\t//detailDisplay.getRootOid().setValue(currentDetails.getRootOid());\n\t}",
"public void setupUserInfo(Bundle upUserInfo) {\n // Getting Info\n String name = upUserInfo.getString(\"userName\");\n String email = upUserInfo.getString(\"userEmail\");\n\n\n // Setting local Variables\n this.tutorName = name;\n this.tutorEmail = email;\n\n TextView nameField = (TextView) findViewById(R.id.UserNameField);\n nameField.setText(name);\n\n\n }",
"private void userInformation()\n {\n name = eName.getText().toString();\n userName = eUserName.getText().toString();\n email = eEmail.getText().toString();\n password = ePassword.getText().toString();\n password = encryptionAlgo.encryptPass(password);//initialize new encrypt password\n address = eAddress.getText().toString();\n favouriteWord = eFavourite.getText().toString();\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStdSpecificacctsPrepopulatedUserdetails() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the confirmation page of Add new user is getting displayed with prepopulated user details\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUser_Creation()\n\t\t.VerifySpecificAccountsViewNames(userProfile);\t \t \t\t \t \t\t \t \t \t \t\t \t \t\t \t \t\t \t \t\t\n\t}",
"void setUserInfo(UserInfo info);",
"private void setUserCredentials() {\n ((EditText) findViewById(R.id.username)).setText(\"harish\");\n ((EditText) findViewById(R.id.password)).setText(\"11111111\");\n PayPalHereSDK.setServerName(\"stage2pph10\");\n }",
"private void saveUserDetails()\r\n\t{\r\n\t\t/*\r\n\t\t * Retrieve content from form\r\n\t\t */\r\n\t\tContentValues reg = new ContentValues();\r\n\r\n\t\treg.put(UserdataDBAdapter.C_NAME, txtName.getText().toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_USER_EMAIL, txtUserEmail.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_RECIPIENT_EMAIL, lblAddressee.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\tif (rdbKilo.isChecked())\r\n\t\t{\r\n\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 1);\t// , true\r\n\t\t}\r\n\t\telse\r\n\t\t\tif (rdbPound.isChecked())\r\n\t\t\t{\r\n\t\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 0);\t// , false\r\n\t\t\t}\r\n\r\n\t\t/*\r\n\t\t * Save content into database source:\r\n\t\t * http://stackoverflow.com/questions/\r\n\t\t * 9212574/calling-activity-methods-from-fragment\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tActivity parent = getActivity();\r\n\r\n\t\t\tif (parent instanceof LauncherActivity)\r\n\t\t\t{\r\n\t\t\t\tif (arguments == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().insert(\r\n\t\t\t\t\t\t\treg);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treg.put(UserdataDBAdapter.C_ID, arguments.getInt(\"userId\"));\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().update(\r\n\t\t\t\t\t\t\treg);\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).queryForUserDetails();\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(parent, \"User details successfully stored\",\r\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tLog.i(this.getClass().toString(), e.getMessage());\r\n\t\t}\r\n\t}",
"private void setUserData(){\n }",
"void setUserUsername(String username);",
"public void populateUserDetails() {\n\n this.enterprise = system.getOpRegionDirectory().getOperationalRegionList()\n .stream().filter(op -> op.getRegionId() == user.getNetworkId())\n .findFirst()\n .get()\n .getBuDir()\n .getBusinessUnitList()\n .stream()\n .filter(bu -> bu.getUnitType() == BusinessUnitType.CHEMICAL)\n .map(unit -> (ChemicalManufacturingBusiness) unit)\n .filter(chemBusiness -> chemBusiness.getEnterpriseId() == user.getEnterpriseId())\n .findFirst()\n .get();\n\n this.organization = (ChemicalManufacturer) enterprise\n .getOrganizationList().stream()\n .filter(o -> o.getOrgId() == user.getOrganizationId())\n .findFirst()\n .get();\n\n }",
"private void setUser(){\n try{\n if (!mainUser.getUsername().equals(\"\")){\n this.userName.setText(mainUser.getUsername());\n }else{\n this.userName.setText(\"User\");\n }\n\n\n File file = new File(mainUser.getProfileImage());\n if (!file.exists()){\n file = new File(getClass().getResource(\"../images/eren.png\").getFile());\n }\n Image img = new Image(file.toURI().toString());\n profileImage.setImage(img);\n\n setEventLabel(\"Welcome \"+mainUser.getFname()+\" \"+mainUser.getLname()+\".\");\n }catch (NullPointerException e){\n AlertBox.alert(AlertType.ERROR, stackRoot, anchorRoot, \"There was an error while updating UserInfo\");\n }\n }",
"private UserPrefernce(){\r\n\t\t\r\n\t}",
"public void setUser(String businessName) {\n editSharedPrefs().putString(USER_NAME, businessName).apply();\n editSharedPrefs().putBoolean(SHARED_PREFS_SETUP, true);\n }",
"private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }",
"private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }",
"public void updateUserDetails() {\n\t\tSystem.out.println(\"Calling updateUserDetails() Method To Update User Record\");\n\t\tuserDAO.updateUser(user);\n\t}",
"public User details(String user);",
"public void setAuthentication(){\n SharedPreferences settings = mContext.getSharedPreferences(\"UserData\", Context.MODE_PRIVATE);\n SharedPreferences.Editor preferencesEditor = settings.edit();\n preferencesEditor.putString(\"userid\", mUserId);\n preferencesEditor.putString(\"areaid\", mAreaId);\n preferencesEditor.commit();\n }",
"public void editTheirProfile() {\n\t\t\n\t}",
"private void getUserDetailApi() {\n RetrofitService.getOtpData(new Dialog(mContext), retrofitApiClient.getUserDetail(strUserId), new WebResponse() {\n @Override\n public void onResponseSuccess(Response<?> result) {\n UserDataMainModal mainModal = (UserDataMainModal) result.body();\n if (mainModal != null) {\n AppPreference.setBooleanPreference(mContext, Constant.IS_PROFILE_UPDATE, true);\n Gson gson = new GsonBuilder().setLenient().create();\n String data = gson.toJson(mainModal);\n AppPreference.setStringPreference(mContext, Constant.USER_DATA, data);\n User.setUser(mainModal);\n }\n }\n\n @Override\n public void onResponseFailed(String error) {\n Alerts.show(mContext, error);\n }\n });\n }",
"private void initUser() {\n\t}",
"public void getUserProfile() {\n\t\tkeypad.UserProfiles.click();\n\t}",
"public void displayDetails() {\r\n\t\tSystem.out.println(\"*******************Profile Details*********************\");\r\n\t\tSystem.out.println(\"\\tUsername :\\t\" + uName);\r\n\t\tSystem.out.println(\"\\tFull Name :\\t\" + fullName);\r\n\t\tSystem.out.println(\"\\tPhone :\\t\" + phone);\r\n\t\tSystem.out.println(\"\\tE-Mail :\\t\" + email);\r\n\t}",
"public SetupScreen() \r\n { \r\n _userLabel = new LabelField(Ipoki._resources.getString(LBL_USER), DrawStyle.ELLIPSIS);\r\n add(_userLabel);\r\n _userEdit = new EditField(\"\", Ipoki._user, 20, Field.EDITABLE);\r\n add(_userEdit);\r\n _passLabel = new LabelField(Ipoki._resources.getString(LBL_PASSWORD), DrawStyle.ELLIPSIS);\r\n add(_passLabel);\r\n _passEdit = new PasswordEditField(\"\", Ipoki._pass, 20, Field.EDITABLE);\r\n add(_passEdit);\r\n _freqLabel = new LabelField(Ipoki._resources.getString(LBL_FREQ), DrawStyle.ELLIPSIS);\r\n add(_freqLabel);\r\n _freqEdit = new EditField(\"\", String.valueOf(Ipoki._freq), 20, Field.EDITABLE | EditField.FILTER_INTEGER);\r\n add(_freqEdit);\r\n }",
"void setPassedUser(User passedUser);",
"public UserInfo() {\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}",
"private void setupUsernameAndFullNameTextView() {\n usernameTextView.setText(prismUser.getUsername());\n userFullNameText.setText(prismUser.getFullName());\n }",
"private void loadUserDetails(DBUser user) {\n userDetailsLoginText.setText(user.getUserLogin());\n userDetailsNameText.setText(user.getUserName());\n userDetailsLevelSpinner.setValue(user.getUserLevel());\n }",
"private void displayUserInfo(String name) {\n\t\tString username = null;\n\t\tPattern p = Pattern.compile(\"\\\\[(.*?)\\\\]\");\n\t\tMatcher m = p.matcher(name);\n\t\tif (m.find())\n\t\t{\n\t\t username = m.group(1);\n\t\t lastClickedUser = username;\n\t\t}\n\t\tUser u = jdbc.get_user(username);\n\t\ttextFirstName.setText(u.get_firstname());\n\t\ttextLastName.setText(u.get_lastname());\n\t\ttextUsername.setText(u.get_username());\n\t\tif (u.get_usertype() == 1) {\n\t\t\trdbtnAdminDetails.setSelected(true);\n\t\t} else if (u.get_usertype() == 2) {\n\t\t\trdbtnManagerDetails.setSelected(true);\n\t\t} else {\n\t\t\trdbtnWorkerDetails.setSelected(true);\n\t\t}\n\t\tif (u.get_email() != null) {textEmail.setText(u.get_email());} else {textEmail.setText(\"No Email Address in Database.\");}\n\t\tif (u.get_phone() != null) {textPhone.setText(u.get_phone());} else {textPhone.setText(\"No Phone Number in Database.\");}\t\t\t\t\n\t\tcreateQualLists(u.get_userID());\n\t}",
"public void setUserid(java.lang.String value) {\n this.userid = value;\n }",
"public void printUser() {\n\t\tSystem.out.println(\"First name: \" + this.firstname);\n\t\tSystem.out.println(\"Last name: \" + this.lastname);\n\t\tSystem.out.println(\"Age: \" + this.age);\n\t\tSystem.out.println(\"Email: \" + this.email);\n\t\tSystem.out.println(\"Gender: \" + this.gender);\n\t\tSystem.out.println(\"City: \" + this.city);\n\t\tSystem.out.println(\"State: \" + this.state + \"\\n\");\n\t}",
"public static void setString(String usrname) {\n\t\tUserPanel.usrname = usrname;\r\n\t}",
"public static User createBasicUser () {\n User user = new User();\n user.setUsername(\"basicUser\");\n user.setPassword(\"secret\");\n user.setEmail(\"me@example.com\");\n user.setFirstName(\"firstName\");\n user.setLastName(\"lastName\");\n user.setPhoneNumber(\"123456789123\");\n user.setCountry(\"GB\");\n user.setEnabled(true);\n user.setDescription(\"A basic user\");\n user.setProfileImageUrl(\"https://blabla.images.com/basicuser\");\n\n return user;\n }",
"private void contentSet() {\n\t\tmemDTO = new MemberDTO();\n\t\tmemDTO.setId(txtID.getText().toString());\n\t\tmemDTO.setPw(new String(txtPW.getPassword()));\n\t}",
"public void setUser(String user)\n {\n _user = user;\n }",
"private void showPreference(){\r\n if(userPreferencesForm == null) {\r\n userPreferencesForm = new UserPreferencesForm(mdiForm,true);\r\n }\r\n userPreferencesForm.loadUserPreferences(mdiForm.getUserId());\r\n userPreferencesForm.setUserName(mdiForm.getUserName());\r\n userPreferencesForm.display();\r\n }",
"public void setUserId(){\n AdGyde.setClientUserId(\"ADG1045984\");\n Toast.makeText(this, \"UserId = ADG1045984\", Toast.LENGTH_SHORT).show();\n }",
"public void setUser(String paramUser) {\n\tstrUser = paramUser;\n }",
"public void passUserDetails(String userID, String userName, String entityName, String entityID, char type)\n {\n mUserID= userID;\n mUserName=userName;\n mEntityName=entityName;\n mEntityID=entityID;\n mType=type;\n }",
"public void setAD_User_ID (int AD_User_ID);",
"@Test \n\tpublic void testSetBusinessinformation() {\n\t\tBusinessInformation businessInformation = new BusinessInformation();\n\t\tbusinessInformation.setName(INFO_NAME);\n\t\tAdminAccount user = adminAccountService.setBusinessInformation(INFO_NAME, USERNAME1);\n\t\tassertNotNull(user);\n\t\tassertEquals(user.getUsername(), USERNAME1);\n\t}",
"public void viewUser() {\n\t\tsuper.viewUser();\n\t}",
"public void readuserData() {\n\t\t\tSystem.out.println(\"Welcome to the BMI calculator, enter 1 for imperial or 2 for Metric \");\n\t\t\t\n\t\t}",
"public UpdateAccountInfoUI() {\n initComponents();\n userNameLabel.setText(Authentication.online_user.getUserName());\n usernamePlaceholder.setText(Authentication.online_user.getUserName());\n emailPlaceholder.setText(Authentication.online_user.getEmail());\n passwordPLaceholder.setText(Authentication.online_user.getPassword());\n \n }",
"@Override\r\n\tpublic User editdata(User usr) {\n\t\treturn null;\r\n\t}",
"public void askForUserInfo(String type) {\n switch (type) {\n case \"Username\":\n System.out.println(\"Enter username: \");\n break;\n case \"Password\":\n System.out.println(\"Enter password: \");\n break;\n case \"Name\":\n System.out.println(\"Enter Name: \");\n break;\n case \"Type\":\n System.out.println(\"Select the user type:\");\n System.out.println(\"1. Organizer\");\n System.out.println(\"2. Attendee\");\n System.out.println(\"3. VIP\");\n break;\n }\n }",
"public void setUser(String user) \r\n\t{\n\t\tthis.user = user;\r\n\t}",
"public void setEditUser(User editUser)\r\n/* */ {\r\n/* 179 */ this.editUser = editUser;\r\n/* */ }",
"void setUsername(String username);",
"private void loadUserInformation(){\n FirebaseUser user = mAuth.getCurrentUser();\n\n String displayEmail = user.getEmail();\n email.setText(\"Velkommenn \" + displayEmail+\"!\");\n }",
"public void setUserDetails(UserDetails userDetails) {\r\n\t\tthis.userDetails = userDetails;\r\n\t}",
"private void setInfo(String newinfo){\n SFNode textField = (SFNode)getField(\"text\");\n Node textNode = (Node)textField.getValue();\n \n\n // Get the \"string\" exposed field of the Text node\n MFString stringField = (MFString)textNode.getExposedField(\"string\");\n\n // Get the name of the user. This is a privileged method call that\n // will throw an AccessControlException when we do not give this\n // script the right to read that property.\n //String username = System.getProperty(\"user.name\");\n\n // Write the user name into the \"string\" field of the Text node\n //stringField.set1Value(1, username);\n stringField.set1Value(0, newinfo);\n }",
"private void set(String sLogin, String sFirstName, String sLastName, \r\n\t\t\tString sPassword, String sEmail, String sRole, String sLocale, \r\n\t\t\tString sAuthMethod, boolean bActiveFlag)\r\n\t{\r\n\t\tthis.sLogin = sLogin;\r\n\t\tthis.sFirstName = sFirstName;\r\n\t\tthis.sLastName = sLastName;\r\n\t\tthis.sPassword = sPassword;\r\n\t\tthis.sEmail = sEmail;\r\n\t\tthis.sRole = sRole;\r\n\t\tthis.sLocale = sLocale;\r\n\t\tthis.sAuthMethod = sAuthMethod;\r\n\t\tthis.bActiveFlag = bActiveFlag;\t\t\r\n\t}",
"public UserModel(){\n ID = 0; // The user's ID, largely used in conjuction with a database\n firstName = \"fname\"; //User's first name\n lastName = \"lname\"; // User's last name\n password= \"pass\"; ///User password\n username = \"testuser\"; //Valid email for user\n role = 0; //Whether the user is a typical user or administrator\n status = 0; //Whether the user is active or disabled\n }",
"public void setUser1X_ID (int User1X_ID);",
"public void setCreateUser(User createUser)\r\n/* */ {\r\n/* 151 */ this.createUser = createUser;\r\n/* */ }",
"private static void oneUserExample()\t{\n\t}",
"public void setUser(String user) {\r\n this.user = user;\r\n }",
"void setUserInfo(final UserInfo userInfo);",
"public void setName(String name){\r\n gotUserName = true;\r\n this.name = name;\r\n }",
"public void saveUserSettings() {\n\t}",
"public void updateUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk updateUser\");\r\n\t}",
"private void populateUserValue(UserValue uvalue, SessionInfo sessInfo)\r\n\t{\r\n\t\tuvalue.setAmountId(sessInfo.mAmtFormat);\r\n\t\tuvalue.setAuthenticationType(sessInfo.authenticationType);\r\n\t\tuvalue.setChannelId(\"\" + sessInfo.channelId);\r\n\t\tuvalue.setCustomerType(sessInfo.customerType);\r\n\t\tuvalue.setDateId(sessInfo.mDateFormat);\r\n\t\tuvalue.setTimeFormat(sessInfo.timeFormat);\r\n\t\tuvalue.setDeviceBand(sessInfo.deviceType);\r\n\t\tuvalue.setDirection(sessInfo.direction);\r\n\t\tuvalue.setEquivalentCurrency(sessInfo.equivalentCurrency);\r\n\t\tuvalue.setFIRST_NAME(sessInfo.firstName);\r\n\t\tuvalue.setFontsizeId(sessInfo.fontsizeId);\r\n\t\tuvalue.setPrimaryGcif(sessInfo.primaryGcif);\r\n\t\tuvalue.setLangId(sessInfo.mLanguage);\r\n\t\tuvalue.setLAST_NAME(sessInfo.lastName);\r\n\t\tuvalue.setLoginId(sessInfo.loginId);\r\n\t\tuvalue.setMIDDLE_NAME(sessInfo.middleName);\r\n\t\tuvalue.setSeclangId(sessInfo.mSecLang);\r\n\t\tuvalue.setSessionId(sessInfo.sessionId);\r\n\t\tuvalue.setSessionTicket(sessInfo.sessionId);\r\n\t\tuvalue.setThemeId(sessInfo.themeId);\r\n\t\tuvalue.setTimeZoneId(sessInfo.mTimeZoneId);\r\n\t\tuvalue.setUserNo(sessInfo.userNo);\r\n\t\tuvalue.setPreferredWorkspaceId(sessInfo.prefWorkspace);\r\n\t\tuvalue.setTransactionStatus(\"SUCCESS\");\r\n\t}",
"public void setUserProfile(UserProfile userProfile) {this.userProfile = userProfile;}",
"public void initData(Users user){\n \n this.selectedUser = user;\n String idValue = String.valueOf(selectedUser.getId());\n String expiresValue = String.valueOf(selectedUser.getExpires_at());\n String enabledValue = String.valueOf(selectedUser.getEnabled());\n String lastLoginValue = String.valueOf(selectedUser.getLast_login());\n email.setText(selectedUser.getEmail());\n password.setText(selectedUser.getPassword());\n role.setText(selectedUser.getRoles());\n idField.setText(idValue);\n expiresField.setText(expiresValue);\n enabledField.setText(enabledValue);\n lockedTextField.setText(lastLoginValue);\n lastLoginTextField.setText(idValue);\n System.out.println(user.toString());\n }",
"public void personalDetails() throws InterruptedException {\n\t\teditPersonalDetails.click();\n\t\tThread.sleep(2000);\n\t\tmyProfileName.clear();\n\t\tThread.sleep(2000);\n\t\tmyProfileName.sendKeys(\"Maheshwari\");\n\t\tcontinueBtn.click();\n\t\tThread.sleep(3000);\n\t\t\n\t}",
"public void user_details()\n {\n\t boolean userdetpresent =userdetails.size()>0;\n\t if(userdetpresent)\n\t {\n\t\t //System.out.println(\"User details report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"User details report is not present\");\n\t }\n }",
"@Override\n\tpublic String editUser(Map<String, Object> reqs) {\n\t\treturn null;\n\t}",
"private void getValues() {\n session = new UserSession(getApplicationContext());\n\n //validating session\n session.isLoggedIn();\n\n //get User details if logged in\n HashMap<String, String> user = session.getUserDetails();\n\n shopname = user.get(UserSession.KEY_NAME);\n shopemail = user.get(UserSession.KEY_EMAIL);\n shopmobile = user.get(UserSession.KEY_MOBiLE);\n System.out.println(\"nameemailmobile \" + shopname + shopemail + shopmobile);\n }",
"@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}",
"public void setCreateUser(String newVal) {\n if ((newVal != null && this.createUser != null && (newVal.compareTo(this.createUser) == 0)) || \n (newVal == null && this.createUser == null && createUser_is_initialized)) {\n return; \n } \n this.createUser = newVal; \n\n createUser_is_modified = true; \n createUser_is_initialized = true; \n }",
"public void setUser1W_ID (int User1W_ID);",
"public void processUser() {\r\n view.printMessage(View.GEM_POOL + model.getStonePool());\r\n chooseMenuOption(chooseParameters(INTEGER_DELIMITERS, View.INPUT_PARAMETERS, true));\r\n\r\n\r\n }",
"private static void setData() {\n attributeDisplaySeq = new ArrayList<String>();\n attributeDisplaySeq.add(\"email\");\n\n signUpFieldsC2O = new HashMap<String, String>();\n signUpFieldsC2O.put(\"Email\",\"email\");\n\n\n signUpFieldsO2C = new HashMap<String, String>();\n signUpFieldsO2C.put(\"email\", \"Email\");\n\n\n }",
"void setUser(OSecurityUser user);",
"@Override\n\tpublic void doUser(UserInfo ui) {\n\n\t}",
"public void setUser1_ID (int User1_ID);",
"public void setUser1_ID (int User1_ID);",
"private void saveUserDetails() {\n UserModel userModel = new UserModel();\n userModel.setUserName(editUserName.getText().toString());\n userModel.setPassword(editPassword.getText().toString());\n\n /* if (db.insertUserDetils(userModel)) {\n //Toast.makeText(LoginActivity.this, \"Successfully save\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Data not Saved\", Toast.LENGTH_SHORT).show();\n }*/\n }",
"private void getUserNamePwd() {\n\n try {\n // get Application Connection ID\n LogonCoreContext lgCtx = LogonCore.getInstance().getLogonContext();\n userName = lgCtx.getBackendUser();\n pwd = lgCtx.getBackendPassword();\n appConnID = LogonCore.getInstance().getLogonContext()\n .getConnId();\n } catch (LogonCoreException e) {\n LogManager.writeLogError(Constants.device_reg_failed_txt, e);\n }\n }",
"public void setUsername(String username) {this.username = username;}",
"@FXML private void setToNewUser(){\n\t\tshowPassword();\n\t\tclearFields();\n\t\thideLackMessages();\n\t\tchangeCancelButton.setText(\"Anuluj\");\n\t\tnewUser = true;\n\t}",
"private void putDefaultInformation() throws FileNotFoundException, SQLException, IOException {\n staff_name = \"Sin informacion\";\n staff_surname = \"Sin informacion\";\n id_type = \"Sin informacion\";\n id_number = \"Sin informacion\";\n putProfPic(null);\n phone_number = \"Sin informacion\";\n mobile_number = \"Sin informacion\";\n email = \"Sin informacion\";\n birthdate = GBEnvironment.getInstance().serverDate();\n gender = \"Seleccione sexo\";\n }",
"private void getUser(){\n user = new User();\n SharedPreferences preferences = getSharedPreferences(\"account\", MODE_PRIVATE);\n user.setId(preferences.getInt(\"id\", 0));\n user.setPhone(preferences.getString(\"phone\", \"\"));\n user.setType(preferences.getInt(\"type\",0));\n }",
"private void init(){\n this.firstNameTF.setText(user.getFirstName());\n this.nameTF.setText(user.getName());\n this.phoneTF.setText(user.getPhone());\n\n this.mailLabel.setText(user.getMail());\n this.roleLabel.setText(user.getFirstName());\n }",
"UserInfo setName(String name);"
] | [
"0.7206926",
"0.69177043",
"0.68257034",
"0.6788358",
"0.672445",
"0.6708865",
"0.6670138",
"0.6586914",
"0.65806925",
"0.6570741",
"0.65502584",
"0.65364987",
"0.65282184",
"0.6464406",
"0.6447222",
"0.64347166",
"0.64347166",
"0.64347166",
"0.6430074",
"0.6429044",
"0.6406399",
"0.6384344",
"0.6383885",
"0.63823783",
"0.6350163",
"0.6325296",
"0.62644744",
"0.6241205",
"0.62348247",
"0.62252486",
"0.61499584",
"0.6137746",
"0.6125358",
"0.61227626",
"0.61189026",
"0.61058176",
"0.6090506",
"0.6060206",
"0.60594803",
"0.6055447",
"0.605376",
"0.60508937",
"0.60424984",
"0.6041876",
"0.6041733",
"0.60373366",
"0.60367703",
"0.6023386",
"0.60225564",
"0.60166025",
"0.60102975",
"0.599261",
"0.5985675",
"0.5982567",
"0.59692854",
"0.5968655",
"0.5957322",
"0.5952022",
"0.59449637",
"0.59391737",
"0.5937179",
"0.59347856",
"0.59328383",
"0.59256494",
"0.59255487",
"0.5919818",
"0.591885",
"0.59168977",
"0.59128016",
"0.5911321",
"0.59057885",
"0.59004116",
"0.5899258",
"0.5893748",
"0.5891061",
"0.58902186",
"0.5888447",
"0.58879554",
"0.58874744",
"0.5885148",
"0.5881157",
"0.58764225",
"0.58755004",
"0.5867468",
"0.5866162",
"0.5862014",
"0.5858805",
"0.5858137",
"0.58558357",
"0.58557045",
"0.5855392",
"0.58516574",
"0.58516574",
"0.58432317",
"0.58417153",
"0.5841594",
"0.5837372",
"0.58343613",
"0.58274645",
"0.58262527",
"0.58213645"
] | 0.0 | -1 |
Adding the current signed in user to local db | private void addToCache(User user, DatabaseHelper db) {
if (db.insertUser(user)) {
Log.d("Signup Activity", "Added to cache");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}",
"public void addUserToFirestore() {\n if (isSignedIn()) {\n getUserTask().addOnCompleteListener(\n new OnCompleteListener<DocumentSnapshot>()\n {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if (task.isSuccessful() && !task.getResult().exists()) {\n setUser(userMap(false));\n setAnalysis(analysisMap(new ArrayList<String>()));\n setSlouches(slouchMap(new ArrayList<Date>(), new ArrayList<Double>()));\n }\n }\n });\n }\n }",
"public void updateCurrentTrempitUser() {\n\n // create the trempituser object\n TrempitUser currentUser = new TrempitUser();\n currentUser.setFullName(Profile.getCurrentProfile().getName());\n currentUser.setId(Long.valueOf(Profile.getCurrentProfile().getId()));\n\n // update the global variable so all activities can access the user\n globalState.setCurrentUser(currentUser);\n\n // insert the user to the server\n insertTrempitUserToServer(currentUser);\n\n Toast.makeText(this, \"logged in to facebook:\" + globalState.getCurrentUser().getFullName(), Toast.LENGTH_LONG).show();\n }",
"String registerUserWithGetCurrentSession(User user);",
"public void addUser(User user) {\n\t\t\r\n\t}",
"public void addUser(User user);",
"private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }",
"public void insertUser() {}",
"void addUser(User user);",
"void addUser(User user);",
"public void addUser(UserModel user);",
"User getCurrentLoggedInUser();",
"public String addUser() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"public void addLocal(String user, String email, String role){\n //Add user to signed in\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(\"Username\", user);\n editor.putString(\"Email\", email);\n editor.putString(\"Role\", role);\n editor.apply();\n\n //Send to appropriate page\n if(role.equals(\"Child\")) {\n Intent intent = new Intent(this, childView.class);\n startActivity(intent);\n }else if(role.equals(\"Parent\")){\n Intent intent = new Intent(this, parentView.class);\n startActivity(intent);\n }\n }",
"@Override\n\tpublic User addUser(User user) {\n\t\treturn userDatabase.put(user.getEmail(), user);\n\t}",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"public void addUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk addUser\");\r\n\t}",
"@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}",
"private void loggedInUser() {\n\t\t\n\t}",
"void addUser(String uid, String firstname, String lastname, String pseudo);",
"void addUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_utilizador, user.getUser()); // Contact Name\n values.put(KEY_pass, user.getPass()); // Contact Phone\n values.put(KEY_Escola, user.getEscola());\n db.insert(tabela, null, values);\n db.close(); // Closing database connection\n }",
"@Override\n\tpublic Object save(AuthUser authUser) {\n\t\tboolean isLinked = User.existsByAuthUserIdentity(authUser);\n\t\tif (!isLinked) {\n\t\t\treturn User.create(authUser).id;\n\t\t} else {\n\t\t\t// we have this user already, so return null\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\tpublic void insertUser(User user) {\n\t\t\n\t}",
"public Long addUser(User transientUser) throws Exception;",
"User addUser(IDAOSession session, String fullName, String userName,\n\t\t\tString password);",
"private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }",
"@Override\r\n\tpublic void add(User1 user) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tsession.save(user);\r\n\t}",
"public void addUser(User user){\n loginDAO.saveUser(user.getId(),user.getName(),user.getPassword());\n }",
"@Override\r\n\tpublic void add(User user) {\n\r\n\t}",
"public void addNewUser(String email) {\n String userName = email.split(\"@\")[0];\n mUsersRef.child(userName).setValue(userName);\n userRef = db.getReference(\"users/\" + getUsername());\n userRef.child(\"email\").setValue(email);\n userSigns = new HashMap<String, UserSign>();\n }",
"Boolean registerNewUser(User user);",
"public void addUser(User user){\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(USER_NAME,user.getName());\n values.put(USER_PASSWORD,user.getPassword());\n db.insert(TABLE_USER,null,values);\n db.close();\n }",
"public void addAccount(String user, String password);",
"@Override\r\n\tpublic void addAuth(Authorities auth) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(auth);\r\n\t\tsessionFactory.getCurrentSession().flush();\r\n\t\t\r\n\t}",
"public int insertUser(final User user);",
"@Override\n public void saveUser(User user) {\n }",
"void registerUser(User newUser);",
"public static boolean add(Context context, User user){\n SharedPreferences.Editor editor= getSharedPreferences(context)\n .edit();\n if(user !=null){\n editor.putString(USERNAME,user.getUsername());\n editor.putString(PASSWORD,user.getPassword());\n editor.putString(GENDER,user.getGender());\n editor.putString(ADDRESS,user.getAddress());\n editor.commit();\n return true;\n }\n return false;\n }",
"void saveUserData(User user);",
"@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }",
"public Boolean addUser(User user) throws ApplicationException;",
"private void createNewUser() {\n ContentValues contentValues = new ContentValues();\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.GENDER, getSelectedGender());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.PIN, edtConfirmPin.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.LAST_NAME, edtLastName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.FIRST_NAME, edtFirstName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.STATUS, spnStatus.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.DATE_OF_BIRTH, edtDateOfBirth.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.BLOOD_GROUP, spnBloodGroup.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.IS_DELETED, \"N\");\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.MOBILE_NUMBER, edtMobileNumber.getText().toString());\n contentValues.put(DataBaseConstants.Constants_TBL_CATEGORIES.CREATE_DATE, Utils.getCurrentDateTime(Utils.DD_MM_YYYY));\n\n dataBaseHelper.saveToLocalTable(DataBaseConstants.TableNames.TBL_PATIENTS, contentValues);\n context.startActivity(new Intent(CreatePinActivity.this, LoginActivity.class));\n }",
"public void registerNewUser(final FirebaseFirestore db, final User user) {\n FirebaseUser FbUser = FirebaseAuth.getInstance().getCurrentUser();\n if (FbUser != null) {\n UserProfileChangeRequest request = new UserProfileChangeRequest.Builder()\n .setDisplayName(user.getName())\n .build();\n FbUser.updateProfile(request);\n }\n\n final DatabaseHelper localDB = new DatabaseHelper(getApplicationContext());\n db.collection(collection)\n .document(user.getEmail())\n .set(user)\n .addOnSuccessListener(avoid -> {\n Toast.makeText(getApplicationContext(), \"Registered\", Toast.LENGTH_SHORT).show();\n\n // Send to cache (local db)\n addToCache(user, localDB);\n\n // Send intent to dashboard\n Intent goToDashboard = new Intent(SignupActivity.this, Dashboard.class);\n Bundle myBundle = new Bundle();\n myBundle.putString(\"email\", user.getEmail());\n// myBundle.putString(\"name\", user.getName());\n// myBundle.putString(\"maxIncome\", String.valueOf(user.getMaxIncome()));\n myBundle.putBoolean(\"coming_from_login_signup\", true);\n goToDashboard.putExtras(myBundle);\n startActivity(goToDashboard);\n })\n .addOnFailureListener(e -> snackbar.showStatus(\"Not Registered\"));\n }",
"@Override\n public void onClick(View v) {\n\n String Id = FCMdatabase.push().getKey();\n residentUser user = new residentUser(Id.toString(), txtusername.getText().toString(), txtpassword.getText().toString(), \"\");\n FCMdatabase.child(Id).setValue(user);\n Toast.makeText(getContext(), \"user added successfully\", Toast.LENGTH_SHORT).show();\n }",
"public void addUser() {\n\t\tthis.users++;\n\t}",
"private void addUserAsMarker() {\n firestoreService.findUserById(new OnUserDocumentReady() {\n @Override\n public void onReady(UserDocument userDocument) {\n if(userDocument != null && userDocument.getUserid().equals(preferences.get(\"user_id\",0L))) {\n String id = preferences.get(DOCUMENT_ID, \"\");\n //Add current user to ListInBounds\n userDocumentAll.setDocumentid(id);\n userDocumentAll.setUsername(userDocument.getUsername());\n userDocumentAll.setPicture(userDocument.getPicture());\n userDocumentAll.setLocation(userDocument.getLocation());\n userDocumentAll.setFollowers(userDocument.getFollowers());\n userDocumentAll.setIsvisible(userDocument.getIsvisible());\n userDocumentAll.setIsprivate(userDocument.getIsprivate());\n userDocumentAll.setIsverified(userDocument.getIsverified());\n userDocumentAll.setUserid(userDocument.getUserid());\n userDocumentAll.setToken(userDocument.getToken());\n oneTimeAddableList.add(userDocumentAll);\n }\n }\n\n @Override\n public void onFail() {\n\n }\n\n @Override\n public void onFail(Throwable cause) {\n\n }\n });\n\n }",
"private void addUserToDatabase( DatabaseReference postRef) {\n\n // check username, password cannot be null and may not have spaces\n final String usernameChecked = checkNullString(usernameText.getText().toString());\n final String password = checkNullString(passwordText.getText().toString());\n final String confirmPassword = checkNullString(confirmPasswordText.getText().toString());\n\n if (usernameChecked == null || password == null) {\n Toast.makeText(this, \"Entries may not be null, and may not have spaces!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (!password.equals(confirmPassword)){\n Toast.makeText(this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (users.contains(usernameChecked)){\n Toast.makeText(this, \"Username is already taken\", Toast.LENGTH_LONG).show();\n return;\n }\n\n // initialize data for SentCount\n postRef\n .child(\"Users\")\n .child(usernameChecked)\n .runTransaction(new Transaction.Handler() {\n\n @NonNull\n @Override\n public Transaction.Result doTransaction(@NonNull MutableData currentData) {\n User newUser = new User(usernameChecked, password);\n currentData.setValue(newUser);\n return Transaction.success(currentData);\n }\n\n @Override\n public void onComplete(@Nullable DatabaseError error, boolean committed,\n @Nullable DataSnapshot currentData) {\n Log.d(TAG, \"postTransaction:onComplete:\" + currentData);\n Toast.makeText(getApplicationContext(), \"Sign up successful!\", Toast.LENGTH_LONG);\n finish();\n }\n });\n }",
"private void setUpUser() {\n Bundle extras = getIntent().getExtras();\n mActiveUser = extras.getString(Helper.USER_NAME);\n mUser = mDbHelper.getUser(mActiveUser, true);\n Log.d(TAG, mUser.toString());\n\n if (mUser == null) {\n Toast.makeText(getBaseContext(), \"Error loading user data\", Toast.LENGTH_SHORT);\n return;\n }\n\n mIsNumPassword = Helper.isNumeric(mUser.getPassword());\n\n mKeyController = new KeyController(getApplicationContext(), mUser);\n }",
"public void saveUser(User user);",
"void add(User user) throws SQLException;",
"public void createUser(User user);",
"public int insertUser(User newUser) {\r\n\r\n try {\r\n BusTrackerDB = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(\"username\", newUser.getUsername());\r\n values.put(\"password\", newUser.getPassword());\r\n\r\n BusTrackerDB.insert(\"user\", null, values);\r\n } catch (SQLiteException e) { return 0; }\r\n\r\n BusTrackerDB.close();\r\n\r\n return 1;\r\n }",
"private void addNewUser(User user) {\n\t\tSystem.out.println(\"BirdersRepo. Adding new user to DB: \" + user.getUsername());\n\t\tDocument document = Document.parse(gson.toJson(user));\n\t\tcollection.insertOne(document);\n\t}",
"public void newUser(User user);",
"public void addUser() {\r\n PutItemRequest request = new PutItemRequest().withTableName(\"IST440Users\").withReturnConsumedCapacity(\"TOTAL\");\r\n PutItemResult response = client.putItem(request);\r\n }",
"public void insert(User user);",
"@Transactional\r\n\tpublic void addUser(){\r\n\t}",
"public void addAppUser(AppUser appUser) {\n\t\tappUserRepository.save(appUser);\t\t\n\t\t\n\t}",
"public void addUser(Person person){\n \t\n \ttry {\n\t\t\tperson.sethPassword(Base64.getEncoder().encodeToString(MessageDigest.getInstance(\"SHA-256\").digest(person.gethPassword().getBytes(StandardCharsets.UTF_8))));\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \t\n \t\n \tSystem.out.println(\"aanmaken van \" + person.getLogin());\n \tem.persist(person);\n \t\n }",
"public String add() {\r\n\t\tuserAdd = new User();\r\n\t\treturn \"add\";\r\n\t}",
"public void addUser(int id, String name, String email, boolean isAdmin) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_ID, id);\n values.put(KEY_HOST, host);\n values.put(KEY_NAME, name);\n values.put(KEY_EMAIL, email);\n values.put(KEY_IS_ADMIN, isAdmin);\n\n long insertedId = db.insert(TABLE_USER, null, values);\n db.close(); // Closing database connection\n }",
"public void uploadUserDetailsToDatabase(String email, String password){\n User user = new User(email, password);\n FirebaseDatabase.getInstance().getReference(\"Users\").push()\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n Log.i(\"details\", \"uploaded\");\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.i(\"details\", \"upload failed\");\n }\n });\n }",
"@Override\n public boolean addUser(User user) {\n return controller.addUser(user);\n }",
"public void createUser(User user) {\n\n\t}",
"public void createAndAddUser(String fName, String lName){\n ModelPlayer user = new ModelPlayer(fName, lName);\n user.setUserID(this.generateNewId());\n userListCtrl.addUser(user);\n }",
"public Long getAddUser() {\n return addUser;\n }",
"public void newUser(User user) {\n users.add(user);\n }",
"private void insert() {//将数据录入数据库\n\t\tUser eb = new User();\n\t\tUserDao ed = new UserDao();\n\t\teb.setUsername(username.getText().toString().trim());\n\t\tString pass = new String(this.pass.getPassword());\n\t\teb.setPassword(pass);\n\t\teb.setName(name.getText().toString().trim());\n\t\teb.setSex(sex1.isSelected() ? sex1.getText().toString().trim(): sex2.getText().toString().trim());\t\n\t\teb.setAddress(addr.getText().toString().trim());\n\t\teb.setTel(tel.getText().toString().trim());\n\t\teb.setType(role.getSelectedIndex()+\"\");\n\t\teb.setState(\"1\");\n\t\t\n\t\tif (ed.addUser(eb) == 1) {\n\t\t\teb=ed.queryUserone(eb);\n\t\t\tJOptionPane.showMessageDialog(null, \"帐号为\" + eb.getUsername()\n\t\t\t\t\t+ \"的客户信息,录入成功\");\n\t\t\tclear();\n\t\t}\n\n\t}",
"public void addUser(User user) {\n SQLiteDatabase db = dbHelper.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(UserDBHelper.COLUMN_NAME, user.getName());\n values.put(UserDBHelper.COLUMN_SURNAME, user.getSurname());\n values.put(UserDBHelper.COLUMN_EMAIL, user.getEmail());\n values.put(UserDBHelper.COLUMN_PASS, user.getPass());\n db.insert(UserDBHelper.TABLE_NAME, \"\", values); // Prevent from -1 exception\n db.close();\n }",
"public Boolean ins(User user);",
"@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.save_activity);\n\n fullname = (EditText)findViewById(R.id.fullname);\n uni = (EditText)findViewById(R.id.uni);\n save = (Button)findViewById(R.id.save);\n\n mAuth = FirebaseAuth.getInstance();\n database = FirebaseDatabase.getInstance(); // get database\n // db =(TextView) findViewById(R.id.db);\n\n FirebaseUser users = mAuth.getCurrentUser(); // current signed in user\n userId = users.getUid(); // Id of signed in user\n myRef= database.getReference(); //A reference to databse\n\n mAuthListener = new FirebaseAuth.AuthStateListener() { //It is auth listner means user signed in and then quite app and again resumem then he will remain signed in.\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n // User is signed in\n // Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n // toastMessage(\"Successfully signed in with: \" + user.getEmail());\n } else {\n // User is signed out\n // Log.d(TAG, \"onAuthStateChanged:signed_out\");\n // toastMessage(\"Successfully signed out.\");\n }\n // ...\n }\n };\n\n save.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String fname = fullname.getText().toString();\n String Uni = uni.getText().toString();\n User u = new User(fname,Uni);\n if(!fname.equals(\"\") && !Uni.equals(\"\"))\n {\n myRef.child(\"users\").child(userId).setValue(u);\n }\n }\n });\n\n\n }",
"public int addUser(HttpServletRequest request) {\n\t\tHashMap<String, Object> parameters = buildUserInsertCondition(request);\n\n\t\tSimpleJdbcInsert insert = new SimpleJdbcInsert(jt).withTableName(\"sys_user\").usingGeneratedKeyColumns(\"userId\");\n\n\t\tNumber id = insert.executeAndReturnKey(parameters);\n\n\t\tint pk = id.intValue();\n\n\t\treturn pk;\n\t}",
"@Override\r\n\tpublic void save(User user) {\n\t\t\r\n\t}",
"public void newUserAdded(String userID);",
"private boolean addUser(User user) {\r\n\t\tthis.storer.storeUser(user);\r\n\t\tmapping.put(user.getUsername(), user);\r\n\t\treturn true;\r\n\t}",
"private void registerUser() {\n\n // Store values at the time of the login attempt.\n String username = mUsernameView.getText().toString();\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n String firstName = mFirstNameView.getText().toString();\n String lastName = mLastNameView.getText().toString();\n String dob = mDoBView.getText().toString();\n double height = Double.parseDouble(mHeightView.getText().toString());\n double weight = Double.parseDouble(mWeightView.getText().toString());\n String gender = mGenderView.getSelectedItem().toString();\n String role;\n\n //if role switch is in \"on\" position\n if (mRoleView.isChecked())\n {\n role = mRoleView.getTextOn().toString();\n }\n\n //if role switch is in \"off\" position\n else\n {\n role = mRoleView.getTextOff().toString();\n }\n\n\n\n //check if insertion is successful or not\n DatabaseReference.CompletionListener insertListener = new DatabaseReference.CompletionListener()\n {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference usersRef)\n {\n\n\n if (databaseError != null)\n {\n Log.d(\"test\", \"failed insertion\");\n\n //Failed insertion\n }\n\n else\n {\n //Successful insertion, return to main activity\n finish();\n }\n\n }\n };\n\n //create user object, push into database\n\n\n\n if (role.equals(\"Coach\"))\n {\n Coach newUser = new Coach(username, email, password, firstName, lastName, dob, height, weight, gender, role);\n appState.userRef.child(\"coaches\").child(username).setValue(newUser, insertListener);\n\n }\n\n else if (role.equals(\"Athlete\"))\n {\n Athlete newUser = new Athlete(username, email, password, firstName, lastName, dob, height, weight, gender, role);\n appState.userRef.child(\"athletes\").child(username).setValue(newUser, insertListener);\n\n }\n\n\n }",
"@Override\n\tpublic void addNewUser(User user) {\n\t\tusersHashtable.put(user.getAccount(),user);\n\t}",
"@Override\n\tpublic void addItem(User entity) {\n\t\tuserRepository.save(entity);\n\t\t\n\t}",
"public void registerUser(User newUser) {\r\n userRepo.save(newUser);\r\n }",
"private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }",
"private void createLocalStudentUserData(FirebaseUser user){\n\n String name = usernameTextView.getText().toString();\n StudentManager.createStudent(name, user.getUid(), newSchoolID);\n\n }",
"@Override\n\tpublic void addUser(ERSUser user) {\n\t\tuserDao.insertUser(user);\n\t}",
"@Override\n\tpublic boolean addNewUser() {\n\t\treturn false;\n\t}",
"public void addUser(String userId) {\n addUser(new IndividualUser(userId));\n }",
"public static void addUserContext(Map<String, Object> model) {\r\n\t\tUser user = new User();\r\n\t\tuser.setUsername(SecurityContextHolder.getContext().getAuthentication().getName());\r\n\t\tmodel.put(\"user\", user);\r\n\t}",
"@Override\n\tpublic void add(UserEntity theUser, Authentication authentication) {\n\t\t\n\t\temploiDao.findById(theUser.getEmploi().getId()).ifPresent(emploi -> theUser.setEmploi(emploi));\n\t\tif(theUser.getEntite() != null){entityDao.findById(theUser.getEntite().getId()).ifPresent(entite -> theUser.setEntite(entite));}\n\t\tUserEntity author = this.userDao.findByLogin(authentication.getName());\n\t\ttheUser.setCreerpar(author.getId());\n\t\ttheUser.setCreele(new Date());\n\t\ttheUser.setEntite(author.getEntite());\n\t\tuserDao.save(theUser);\n\n\t}",
"public void save(SystemUser user);",
"public static void insertUser(Context context, String userID, String fName,\r\n\t\t\tString lName, String email, String Pass) {\r\n\t\tContentValues cv = new ContentValues();\r\n\r\n\t\tcv.put(EquestDbHelper.USERID, userID);\r\n\t\tcv.put(EquestDbHelper.FIRSTNAME, fName);\r\n\t\tcv.put(EquestDbHelper.LASTNAME, lName);\r\n\t\tcv.put(EquestDbHelper.EMAILID, email);\r\n\t\tcv.put(EquestDbHelper.PASSWORD, Pass);\r\n\r\n\t\tUri contentUri = Uri.withAppendedPath(EquestProvider.CONTENT_URI,\r\n\t\t\t\tEquestDbHelper.USER_TABLE);\r\n\t\tcontext.getContentResolver().insert(contentUri, cv);\r\n\t}",
"private void getUser(){\n mainUser = DatabaseAccess.getUser();\n }",
"void onUserAdded();",
"@Override\n\tpublic User insertNewUser(User User) {\n\t\treturn null;\n\t}",
"@Override\r\n public void onClick(View v) {\n String email = editTextEmail.getText().toString().trim();\r\n String password = editTextPassword.getText().toString().trim();\r\n //predefined users\r\n User admin = new User(\"admin2\",\"admin2\",\"admin2\");\r\n User testuser1 = new User(\"testuser1\",\"testuser1\",\"testuser1\");\r\n db.insert(admin);\r\n db.insert(testuser1);\r\n //getting user from login\r\n User user = db.getUser(email, password);\r\n\r\n //checking if there is a user\r\n if (user != null) {\r\n Intent i = new Intent(MainActivity.this, HomeActivity.class);\r\n i.putExtra(ACTIVE_USER_KEY, user);\r\n startActivity(i);\r\n //finish();\r\n }else{\r\n Toast.makeText(MainActivity.this, \"Unregistered user, or incorrect password\", Toast.LENGTH_SHORT).show();\r\n }\r\n }",
"private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }",
"public void addUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(COLUMN_USER_NAME, user.getName());\n values.put(COLUMN_USER_EMAIL, user.getEmail());\n values.put(COLUMN_USER_IMAGE, \"\");\n values.put(COLUMN_USER_PASSWORD, user.getPassword());\n values.put(COLUMN_USER_CURRMONTH_ID, -16);\n\n // Inserting Row\n db.insert(TABLE_USER, null, values);\n db.close();\n }",
"private void saveUserInformation() {\n String name = editTextName.getText().toString().trim();\n String add = editTextAddress.getText().toString().trim();\n\n //creating a userinformation object\n UserInformation userInformation = new UserInformation(name, add);\n\n //getting the current logged in user\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n //saving data to firebase database\n /*\n * first we are creating a new child in firebase with the\n * unique id of logged in user\n * and then for that user under the unique id we are saving data\n * for saving data we are using setvalue method this method takes a normal java object\n * */\n databaseReference.child(user.getUid()).setValue(userInformation);\n\n //displaying a success toast\n Toast.makeText(this, \"Information Saved...\", Toast.LENGTH_LONG).show();\n }",
"private static void updateUser() {\n\t currentUser = Structure.User(currentUser);\n\t CRUDUsers.compareWithRemote(currentUser).subscribe(new SingleSubscriber<User>() {\n\t\t @Override\n\t\t public void onSuccess(User value) {\n\t\t\t\tConnection.logIn(value);\n\t\t }\n\t\t\n\t\t @Override\n\t\t public void onError(Throwable error) {\n\t\t\t logOff();\n\t\t\t App.showMessage(error.getMessage());\n\t\t }\n\t });\n }",
"@Override\n\tpublic void regist(User user) {\n\t\tdao.addUser(user);\n\t}",
"@Override\n\tpublic void insert(User objetc) {\n\t\tuserDao.insert(objetc);\n\t\t\n\t}",
"private void registerUser(String email, String passwd){\n\n mAuth.createUserWithEmailAndPassword(email, passwd)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n String key = \"\";\n //checking if success\n if(task.isSuccessful()){\n key = task.getResult().getUser().getUid();\n toastMessage(\"seccuss here \"+key);\n String name = \"\";\n String phone = \"\";\n String c = String.valueOf(spinner.getSelectedItem());\n Classe classe = new Classe(c);\n name = nom.getText().toString();\n phone = tel.getText().toString();\n UserInformation U = new UserInformation(name,phone,classe);\n // toastMessage(\"hello uid \"+Useruid);\n myRef.child(\"users\").child(key).setValue(U);\n /* sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(Key, key);\n editor.apply();*/\n\n }else{\n toastMessage(\"Failed\"); }\n\n\n }\n });\n /*sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n uid = sharedPref.getString(Key, null);\n // toastMessage(\"hello thoast \"+uid);\n return uid ;*/\n }",
"@Override\r\n\tpublic boolean addNewUser(User user) {\n\t\treturn false;\r\n\t}"
] | [
"0.6884314",
"0.65970737",
"0.65616274",
"0.6560782",
"0.65551966",
"0.65273964",
"0.6496765",
"0.64817744",
"0.64526975",
"0.64526975",
"0.6416345",
"0.6388635",
"0.63683033",
"0.6366833",
"0.63601893",
"0.6339413",
"0.6327644",
"0.6326564",
"0.63197625",
"0.62982696",
"0.6282831",
"0.62774634",
"0.62753266",
"0.62368006",
"0.62312174",
"0.6231076",
"0.6220894",
"0.6216802",
"0.6210299",
"0.62064767",
"0.61763155",
"0.61685497",
"0.61532944",
"0.6111953",
"0.61059576",
"0.60915947",
"0.6079014",
"0.6071741",
"0.6063995",
"0.605281",
"0.6051759",
"0.6051009",
"0.60426337",
"0.60424966",
"0.6039947",
"0.6024285",
"0.60169727",
"0.60120076",
"0.60087425",
"0.5999944",
"0.59971297",
"0.59968996",
"0.5987403",
"0.59849733",
"0.59721047",
"0.5971173",
"0.5968202",
"0.59656453",
"0.5960201",
"0.59599435",
"0.59520096",
"0.595182",
"0.59508246",
"0.5950469",
"0.59473366",
"0.5947259",
"0.59417003",
"0.5940855",
"0.5934658",
"0.5928166",
"0.59214455",
"0.59195954",
"0.5918907",
"0.5912645",
"0.59120804",
"0.5912026",
"0.5910238",
"0.5908446",
"0.5907922",
"0.5905118",
"0.5902896",
"0.58987784",
"0.58934987",
"0.5891745",
"0.5886991",
"0.5885605",
"0.58788013",
"0.58687586",
"0.5867983",
"0.5862829",
"0.5862742",
"0.5852194",
"0.5844004",
"0.58396626",
"0.583804",
"0.5834043",
"0.5833812",
"0.58324546",
"0.5831389",
"0.5831279"
] | 0.5913338 | 73 |
Find the _Fields constant that matches fieldId, or null if its not found. | public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // COMPANY_NAME_PARTICAL
return COMPANY_NAME_PARTICAL;
case 2: // COMPANY_USER_NAME_PARTICAL
return COMPANY_USER_NAME_PARTICAL;
case 3: // ORDER_TYPE
return ORDER_TYPE;
case 4: // STATE
return STATE;
default:
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // REFERRAL_LOG_IDS\n return REFERRAL_LOG_IDS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // REFERRAL_LOG_ID\n return REFERRAL_LOG_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // RECOM_ID\n return RECOM_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // BINDING_PARAMS\n return BINDING_PARAMS;\n case 2: // BIND_SOURCE\n return BIND_SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // USER_EMPLOYEE_DOS\n return USER_EMPLOYEE_DOS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // RESOURCE_PLAN_NAME\n return RESOURCE_PLAN_NAME;\n case 2: // POOL_PATH\n return POOL_PATH;\n case 3: // ALLOC_FRACTION\n return ALLOC_FRACTION;\n case 4: // QUERY_PARALLELISM\n return QUERY_PARALLELISM;\n case 5: // SCHEDULING_POLICY\n return SCHEDULING_POLICY;\n case 6: // IS_SET_SCHEDULING_POLICY\n return IS_SET_SCHEDULING_POLICY;\n case 7: // NS\n return NS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // PAGE_NUMBER\n return PAGE_NUMBER;\n case 4: // PAGE_SIZE\n return PAGE_SIZE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // TOTAL_FILES_MATERIALIZED_COUNT\n return TOTAL_FILES_MATERIALIZED_COUNT;\n case 2: // FILES_MATERIALIZED_FROM_CASCOUNT\n return FILES_MATERIALIZED_FROM_CASCOUNT;\n case 3: // TOTAL_TIME_SPENT_MATERIALIZING_FILES_FROM_CASMILLIS\n return TOTAL_TIME_SPENT_MATERIALIZING_FILES_FROM_CASMILLIS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // SOURCE\n return SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // TIMESPAN\n return TIMESPAN;\n case 4: // PAGE_NUM\n return PAGE_NUM;\n case 5: // PAGE_SIZE\n return PAGE_SIZE;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMB_INSTRUMENT_ID\n return COMB_INSTRUMENT_ID;\n case 2: // LEG_ID\n return LEG_ID;\n case 3: // LEG_INSTRUMENT_ID\n return LEG_INSTRUMENT_ID;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n default:\r\n return null;\r\n }\r\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ACTIVATION_CODEE\n return ACTIVATION_CODEE;\n case 2: // BIND_EMAIL_SOURCE\n return BIND_EMAIL_SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // DATA\n return DATA;\n case 2: // FILE_ID\n return FILE_ID;\n case 3: // SIZE\n return SIZE;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // FILE_PATH\n return FILE_PATH;\n case 2: // OUTPUT_DIR\n return OUTPUT_DIR;\n case 3: // SUBSET\n return SUBSET;\n case 4: // TYPES\n return TYPES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ID\n return ID;\n case 2: // PROCESS_ID\n return PROCESS_ID;\n case 3: // APPLICATION_INTERFACE_ID\n return APPLICATION_INTERFACE_ID;\n case 4: // COMPUTE_RESOURCE_ID\n return COMPUTE_RESOURCE_ID;\n case 5: // QUEUE_NAME\n return QUEUE_NAME;\n case 6: // NODE_COUNT\n return NODE_COUNT;\n case 7: // CORE_COUNT\n return CORE_COUNT;\n case 8: // WALL_TIME_LIMIT\n return WALL_TIME_LIMIT;\n case 9: // PHYSICAL_MEMORY\n return PHYSICAL_MEMORY;\n case 10: // STATUSES\n return STATUSES;\n case 11: // ERRORS\n return ERRORS;\n case 12: // CREATED_AT\n return CREATED_AT;\n case 13: // UPDATED_AT\n return UPDATED_AT;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // PARAM_MAP\n return PARAM_MAP;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ACCOUNT_IDS\n return ACCOUNT_IDS;\n case 2: // COMMODITY_IDS\n return COMMODITY_IDS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // TYPE\n return TYPE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // M_COMMAND_TYPE\n return M_COMMAND_TYPE;\n case 2: // M_BLOCK_IDS\n return M_BLOCK_IDS;\n case 3: // M_FILE_PATH\n return M_FILE_PATH;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ACCESS_KEY\n return ACCESS_KEY;\n case 2: // ENTITY_IDS\n return ENTITY_IDS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // PID\n return PID;\n case 2: // CUS_PER_BASE\n return CUS_PER_BASE;\n case 3: // TOTAL_ASSETS\n return TOTAL_ASSETS;\n case 4: // TOTAL_LIAB\n return TOTAL_LIAB;\n case 5: // FAMILY_ASSETS\n return FAMILY_ASSETS;\n case 6: // YEAR_PAY\n return YEAR_PAY;\n case 7: // MONTH_WAGE\n return MONTH_WAGE;\n case 8: // FAMILY_INCOME\n return FAMILY_INCOME;\n case 9: // FAMILY_CONTROL\n return FAMILY_CONTROL;\n case 10: // STATUS\n return STATUS;\n case 11: // ASSETS_DETAIL\n return ASSETS_DETAIL;\n case 12: // LIAB_DETAIL\n return LIAB_DETAIL;\n case 13: // MONTHLY_PAYMENT\n return MONTHLY_PAYMENT;\n case 14: // OVERDRAFT\n return OVERDRAFT;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // NOME\n return NOME;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // NOME\n return NOME;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // FILE_PATH\n return FILE_PATH;\n case 2: // DIR_NAME\n return DIR_NAME;\n case 3: // FILE_LENGTH\n return FILE_LENGTH;\n case 4: // DK_FILE_CONF\n return DK_FILE_CONF;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // FILE_PATH\n return FILE_PATH;\n case 2: // DIR_NAME\n return DIR_NAME;\n case 3: // FILE_LENGTH\n return FILE_LENGTH;\n case 4: // DK_FILE_CONF\n return DK_FILE_CONF;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // LOG_INFO\n return LOG_INFO;\n case 2: // PARAMS\n return PARAMS;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // LOG_INFO\n return LOG_INFO;\n case 2: // PARAMS\n return PARAMS;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // LOG_INFO\n return LOG_INFO;\n case 2: // PARAMS\n return PARAMS;\n default:\n return null;\n }\n }"
] | [
"0.7985763",
"0.7913847",
"0.78799325",
"0.78799325",
"0.78799325",
"0.78799325",
"0.78799325",
"0.78799325",
"0.77853835",
"0.7777667",
"0.77284753",
"0.77264684",
"0.7720832",
"0.77120286",
"0.77120286",
"0.77089727",
"0.77075404",
"0.7700446",
"0.76984894",
"0.7694933",
"0.7686043",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7677092",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7670441",
"0.7669027",
"0.7669027",
"0.7662771",
"0.76624566",
"0.76624566",
"0.76624566",
"0.76624566",
"0.76624566",
"0.76624566",
"0.76624566",
"0.7647648",
"0.76431876",
"0.764212",
"0.76339966",
"0.76204747",
"0.76200837",
"0.76176256",
"0.7611189",
"0.7611189",
"0.7610686",
"0.76052886",
"0.76011366",
"0.76011366",
"0.76011366",
"0.76011366",
"0.76011366",
"0.75999355",
"0.7595132",
"0.7595132",
"0.7594617",
"0.7594617",
"0.7591224",
"0.7591224",
"0.7591224"
] | 0.0 | -1 |
Find the _Fields constant that matches fieldId, throwing an exception if it is not found. | public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // REFERRAL_LOG_IDS\n return REFERRAL_LOG_IDS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // REFERRAL_LOG_ID\n return REFERRAL_LOG_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // RECOM_ID\n return RECOM_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ID\n return ID;\n case 2: // PROCESS_ID\n return PROCESS_ID;\n case 3: // APPLICATION_INTERFACE_ID\n return APPLICATION_INTERFACE_ID;\n case 4: // COMPUTE_RESOURCE_ID\n return COMPUTE_RESOURCE_ID;\n case 5: // QUEUE_NAME\n return QUEUE_NAME;\n case 6: // NODE_COUNT\n return NODE_COUNT;\n case 7: // CORE_COUNT\n return CORE_COUNT;\n case 8: // WALL_TIME_LIMIT\n return WALL_TIME_LIMIT;\n case 9: // PHYSICAL_MEMORY\n return PHYSICAL_MEMORY;\n case 10: // STATUSES\n return STATUSES;\n case 11: // ERRORS\n return ERRORS;\n case 12: // CREATED_AT\n return CREATED_AT;\n case 13: // UPDATED_AT\n return UPDATED_AT;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // PID\n return PID;\n case 2: // EXCEPTION_ID\n return EXCEPTION_ID;\n case 3: // USER_ID\n return USER_ID;\n case 4: // REPORT_DATE\n return REPORT_DATE;\n case 5: // UN_ASSURE_CONDITION\n return UN_ASSURE_CONDITION;\n case 6: // HOUSE_PROPERY_CONDITION\n return HOUSE_PROPERY_CONDITION;\n case 7: // REMARK\n return REMARK;\n case 8: // CREATE_DATE\n return CREATE_DATE;\n case 9: // CREATE_ID\n return CREATE_ID;\n case 10: // UPDATE_DATE\n return UPDATE_DATE;\n case 11: // UPDATE_ID\n return UPDATE_ID;\n case 12: // PROJECT_ID\n return PROJECT_ID;\n case 13: // LEGAL_LIST\n return LEGAL_LIST;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // SOURCE\n return SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // USER_EMPLOYEE_DOS\n return USER_EMPLOYEE_DOS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // PAGE_NUMBER\n return PAGE_NUMBER;\n case 4: // PAGE_SIZE\n return PAGE_SIZE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // TIMESPAN\n return TIMESPAN;\n case 4: // PAGE_NUM\n return PAGE_NUM;\n case 5: // PAGE_SIZE\n return PAGE_SIZE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // BINDING_PARAMS\n return BINDING_PARAMS;\n case 2: // BIND_SOURCE\n return BIND_SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // USER_ID\n return USER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // USER_ID\n return USER_ID;\n case 2: // COMPANY_ID\n return COMPANY_ID;\n case 3: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // CUSTOM_VALUES\n return CUSTOM_VALUES;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ACTIVATION_CODEE\n return ACTIVATION_CODEE;\n case 2: // BIND_EMAIL_SOURCE\n return BIND_EMAIL_SOURCE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EMPLOYEE_ID\n return EMPLOYEE_ID;\n case 2: // POSITION_ID\n return POSITION_ID;\n case 3: // TYPE\n return TYPE;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 0: // SUCCESS\n return SUCCESS;\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // APP_CODE\n \treturn APP_CODE;\n case 2: // REQUEST_DATE\n \treturn REQUEST_DATE;\n case 3: // SIGN\n \treturn SIGN;\n case 4: // SP_ID\n \treturn SP_ID;\n case 5: // OUT_ORDER_ID\n \treturn OUT_ORDER_ID;\n case 6: // DEVICE_NO\n \treturn DEVICE_NO;\n case 7: // DEVICE_TYPE\n \treturn DEVICE_TYPE;\n case 8: // PROVINCE_ID\n \treturn PROVINCE_ID;\n case 9: // CUST_ID\n \treturn CUST_ID;\n case 10: // NUM\n \treturn NUM;\n case 11: // REMARK\n \treturn REMARK;\n case 12: // ACTIVE_ID\n \treturn ACTIVE_ID;\n case 13: // EXP_TIME\n \treturn EXP_TIME;\n default:\n \treturn null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // DATA\n return DATA;\n case 2: // FILE_ID\n return FILE_ID;\n case 3: // SIZE\n return SIZE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\r\n public static _Fields findByThriftId(int fieldId) {\r\n switch(fieldId) {\r\n case 1: // ID\r\n return ID;\r\n case 2: // ID_CURSA\r\n return ID_CURSA;\r\n case 3: // NR_LOC\r\n return NR_LOC;\r\n case 4: // CLIENT\r\n return CLIENT;\r\n default:\r\n return null;\r\n }\r\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EXEC_TRADE_ID\n return EXEC_TRADE_ID;\n case 2: // SUB_ACCOUNT_ID\n return SUB_ACCOUNT_ID;\n case 3: // SLED_CONTRACT_ID\n return SLED_CONTRACT_ID;\n case 4: // EXEC_ORDER_ID\n return EXEC_ORDER_ID;\n case 5: // TRADE_PRICE\n return TRADE_PRICE;\n case 6: // TRADE_VOLUME\n return TRADE_VOLUME;\n case 7: // EXEC_TRADE_DIRECTION\n return EXEC_TRADE_DIRECTION;\n case 8: // CREATE_TIMESTAMP_MS\n return CREATE_TIMESTAMP_MS;\n case 9: // LASTMODIFY_TIMESTAMP_MS\n return LASTMODIFY_TIMESTAMP_MS;\n case 10: // SLED_COMMODITY_ID\n return SLED_COMMODITY_ID;\n case 11: // CONFIG\n return CONFIG;\n case 12: // ORDER_TOTAL_VOLUME\n return ORDER_TOTAL_VOLUME;\n case 13: // LIMIT_PRICE\n return LIMIT_PRICE;\n case 14: // SOURCE\n return SOURCE;\n case 15: // TRADE_ACCOUNT_ID\n return TRADE_ACCOUNT_ID;\n case 16: // TRADE_TIMESTAMP_MS\n return TRADE_TIMESTAMP_MS;\n case 17: // ASSET_TRADE_DETAIL_ID\n return ASSET_TRADE_DETAIL_ID;\n case 18: // SUB_USER_ID\n return SUB_USER_ID;\n case 19: // SLED_ORDER_ID\n return SLED_ORDER_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // RESOURCE_PLAN_NAME\n return RESOURCE_PLAN_NAME;\n case 2: // POOL_PATH\n return POOL_PATH;\n case 3: // ALLOC_FRACTION\n return ALLOC_FRACTION;\n case 4: // QUERY_PARALLELISM\n return QUERY_PARALLELISM;\n case 5: // SCHEDULING_POLICY\n return SCHEDULING_POLICY;\n case 6: // IS_SET_SCHEDULING_POLICY\n return IS_SET_SCHEDULING_POLICY;\n case 7: // NS\n return NS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n case 2: // TYPE\n return TYPE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // CONF\n return CONF;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // CONTRACT_ADDRESS\n return CONTRACT_ADDRESS;\n case 2: // OBJECT\n return OBJECT;\n case 3: // STATE_CAN_MODIFY\n return STATE_CAN_MODIFY;\n default:\n return null;\n }\n }",
"public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // EX\n return EX;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ID\n return ID;\n case 2: // TYPE\n return TYPE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // ID\n return ID;\n case 2: // TYPE\n return TYPE;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // COMPANY_ID\n return COMPANY_ID;\n default:\n return null;\n }\n }"
] | [
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7541919",
"0.75344586",
"0.74417484",
"0.74417484",
"0.74417484",
"0.74417484",
"0.74417484",
"0.74417484",
"0.7428648",
"0.7428648",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7427518",
"0.7423571",
"0.7423369",
"0.7403485",
"0.7394984",
"0.7394108",
"0.7391513",
"0.73827726",
"0.73782563",
"0.7376256",
"0.7372693",
"0.73629117",
"0.73629117",
"0.7350967",
"0.7350967",
"0.7342082",
"0.7342082",
"0.7342082",
"0.73345006",
"0.73275083",
"0.7317537",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7315645",
"0.7308824",
"0.7288882",
"0.72863466",
"0.72711205",
"0.72704643",
"0.72680724",
"0.7256801",
"0.72550267",
"0.72543365",
"0.7249658",
"0.7249658",
"0.7247689",
"0.7247689",
"0.7247689",
"0.7247689",
"0.7247689"
] | 0.0 | -1 |
Find the _Fields constant that matches name, or null if its not found. | public static _Fields findByName(String name) {
return byName.get(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"public static _Fields findByName(String name) {\r\n return byName.get(name);\r\n }",
"public static _Fields findByName(String name) {\r\n return byName.get(name);\r\n }",
"@org.apache.thrift.annotation.Nullable\r\n public static _Fields findByName(java.lang.String name) {\r\n return byName.get(name);\r\n }",
"@org.apache.thrift.annotation.Nullable\r\n public static _Fields findByName(java.lang.String name) {\r\n return byName.get(name);\r\n }",
"@org.apache.thrift.annotation.Nullable\n\t\tpublic static _Fields findByName(java.lang.String name) {\n\t\t\treturn byName.get(name);\n\t\t}",
"@org.apache.thrift.annotation.Nullable\n\t\tpublic static _Fields findByName(java.lang.String name) {\n\t\t\treturn byName.get(name);\n\t\t}"
] | [
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.76308644",
"0.7578759",
"0.7578759",
"0.7571673",
"0.7571673",
"0.756394",
"0.756394"
] | 0.0 | -1 |
Performs a deep copy on other. | public ReqWorkingOrderWebInfoOption(ReqWorkingOrderWebInfoOption other) {
if (other.isSetCompanyNamePartical()) {
this.companyNamePartical = other.companyNamePartical;
}
if (other.isSetCompanyUserNamePartical()) {
this.companyUserNamePartical = other.companyUserNamePartical;
}
if (other.isSetOrderType()) {
this.orderType = other.orderType;
}
if (other.isSetState()) {
this.state = other.state;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Prototype makeCopy();",
"public void copy (WorldState other)\n\t{\n\t\tresetProperties();\n\t\t//Iterate through other state and clone it's properties into this states properties\n\t\tCollection<WorldStateProperty> otherProperties = other.properties.values();\n\t\tfor (WorldStateProperty property : otherProperties)\n\t\t{\n\t\t\tproperties.put(property.key, property.clone());\n\t\t}\n\t}",
"public void copyDataFrom(ParamUnit other)\r\n\t{\r\n\t\tif (this.data.row != other.data.row || this.data.col != other.data.col)\r\n\t\t\tthrow new DeepException(\"Cannot copy data from a different dimension.\");\r\n\t\tthis.data.copyFrom(other.data);\r\n\t}",
"private Path(Path other){\n\t\t\n\t\tthis.source = other.source;\n\t\tthis.destination = other.destination;\n\t\tthis.cities = other.cities;\n\t\t\n\t\tthis.cost = other.cost;\n\t\tthis.destination = other.destination;\n\t\t\n\t\tthis.connections = new LinkedList<Connection>();\n\t\t\n\t\tfor (Connection c : other.connections){\n\t\t\tthis.connections.add((Connection) c.clone());\n\t\t}\n\t\t\n\t}",
"@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}",
"public void copy() {\n\n\t}",
"public abstract B copy();",
"public CMObject copyOf();",
"public T cloneDeep();",
"public void copy(BlastGraph<HitVertex, ValueEdge> graphToCopy) {\n\t\t// empty this graph\n\t\tthis.empty();\n\n\t\t// union this empty graph with graphToCopy\n\t\tthis.union(graphToCopy);\n\t}",
"public void mirror(Dataset other) {\n clear();\n this.ntree.addAll(other.ntree);\n }",
"Model copy();",
"public abstract INodo copy();",
"static void setCopying(){isCopying=true;}",
"Nda<V> shallowCopy();",
"public CopyBuilder copy() {\n return new CopyBuilder(this);\n }",
"T copy();",
"@Override\n\t\tpublic ImmutableSequentialGraph copy() {\n\t\t\treturn new ComposedGraph( g0, g1.copy() );\n\t\t}",
"public void copy(DataRequest original){\n\t\t//potential problems with object sharing\n\t\tfilters = \toriginal.get_filters();\n\t\tsort_by = \toriginal.get_sort_by();\n\t\tcount = \toriginal.get_count();\n\t\tstart = \toriginal.get_start();\n\t\tsource = \toriginal.get_source();\n\t\tfieldset =\toriginal.get_fieldset();\n\t\trelation = \toriginal.get_relation();\n\t}",
"Component deepClone();",
"public Data assign(Data other) {\r\n this.setDimension(other.dimension);\r\n this.distanz = other.distanz;\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n this.data[i] = other.data[i];\r\n }\r\n this.id = other.id;\r\n return this;\r\n }",
"@Override\n public int deepCopy(AbstractRecord other)\n {\n return 0;\n }",
"public AST copy()\n {\n return new Implicate(left, right);\n }",
"@Override\n public void copyValues(final fr.jmmc.oiexplorer.core.model.OIBase other) {\n final View view = (View) other;\n\n // copy type, subsetDefinition (reference):\n this.type = view.getType();\n this.subsetDefinition = view.getSubsetDefinition();\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public abstract Node copy();",
"protected void copy(Writable other) {\n\t\tif (other != null) {\n\t\t\ttry {\n\t\t\t\tDataOutputBuffer out = new DataOutputBuffer();\n\t\t\t\tother.write(out);\n\t\t\t\tDataInputBuffer in = new DataInputBuffer();\n\t\t\t\tin.reset(out.getData(), out.getLength());\n\t\t\t\treadFields(in);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new IllegalArgumentException(\"map cannot be copied: \" +\n\t\t\t\t\t\te.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"source map cannot be null\");\n\t\t}\n\t}",
"protected void copyInto(Schedule other) {\r\n\t\tfor(int i = MIN_WEEKDAY; i <= MAX_WEEKDAY; i++)\r\n\t\t\tfor(int j = MIN_SEGMENT; j <= MAX_SEGMENT; j++)\r\n\t\t\t\tother.schedule[i][j] = schedule[i][j];\t\t\r\n\t}",
"public DTO(DTO other) {\n if (other.isSetDatas()) {\n Map<String,String> __this__datas = new HashMap<String,String>(other.datas);\n this.datas = __this__datas;\n }\n }",
"public Tree<K, V> copy() {\n\t\tTree<K, V> copy = EmptyTree.getInstance(), t = this;\n\t\treturn copy(t, copy);\n\t}",
"@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}",
"Object clone();",
"Object clone();",
"@Override\n public FieldEntity copy()\n {\n return state.copy();\n }",
"private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }",
"Nda<V> deepCopy();",
"@Override\n public LocalStore<V> copy() {\n return this;\n }",
"public abstract TreeNode copy();",
"@Override\r\n public NumericObjectArrayList makeDeepCopy() {\r\n NumericObjectArrayList list = new NumericObjectArrayList();\r\n for (int i = 0; i < this.getCount(); i++) {\r\n try {\r\n list.insert(i, this.getValueAt(i));\r\n } catch (IndexRangeException ex) {\r\n //Shouldn't happen\r\n }\r\n }\r\n return list;\r\n }",
"protected Factorization copy(){\n Factorization newFactor = new Factorization(this.mdc);\n //shallow copy\n newFactor.setRecipes(recipes);\n newFactor.setIngredients(ingredients);\n newFactor.setUserMap(userMap);\n newFactor.setUserMapReversed(userMap_r);\n newFactor.setRecipeMap(recipeMap);\n newFactor.setRecipeMapReversed(recipeMap_r);\n newFactor.setIngredientMap(ingredientMap);\n newFactor.setIngredientMapReversed(ingredientMap_r);\n \n //deep copy\n List<User> userCopy = new ArrayList<User>();\n for(User curr: this.users){\n userCopy.add(new User(curr.getId()));\n }\n newFactor.setUsers(userCopy);\n newFactor.setDataset(dataset.copy());\n newFactor.updateInitialSpace();\n return newFactor;\n }",
"@Override\n\tpublic void copyReferences() {\n\t\tlateCopies = new LinkedHashMap<>();\n\n\t\tsuper.copyReferences();\n\n\t\tputAll(lateCopies);\n\t\tlateCopies = null;\n\t}",
"public T copy() {\n T ret = createLike();\n ret.getMatrix().setTo(this.getMatrix());\n return ret;\n }",
"@Test\n\tpublic void testCopy2() {\n\n\t\tint[] arr = { 1, 2, 3, 7, 8 }; // this list\n\t\tSLLSet listObj2 = new SLLSet(arr);\n\t\tSLLSet copied = listObj2.copy();\n\t\tcopied.add(-1);\n\t\tString expectedObj2 = \"1, 2, 3, 7, 8\";\n\t\tString expectedCopied = \"-1, 1, 2, 3, 7, 8\";\n\t\tint expectedObj2Size = 5;\n\t\tint expectedCopiedSize = 6;\n\n\t\tassertEquals(expectedObj2Size, listObj2.getSize());\n\t\tassertEquals(expectedObj2, listObj2.toString());\n\n\t\tassertEquals(expectedCopiedSize, copied.getSize());\n\t\tassertEquals(expectedCopied, copied.toString());\n\n\t}",
"public Data copy(Object value) {\n if (mValue instanceof Data) {\n ((Data) mValue).copy(value);\n } else {\n mValue = value;\n }\n return this;\n }",
"public void\n\tcopy( Vector3 other )\n\t{\n\t\tdata[0] = other.data[0];\n\t\tdata[1] = other.data[1];\n\t\tdata[2] = other.data[2];\n\t}",
"private static void copy(List<? super Number> dest, List<? extends Number> src) {\n for (int i = 0; i < src.size(); i++) {\n dest.set(i, src.get(i));\n //dest.add(src.get(i));\n }\n }",
"private ImmutablePerson(ImmutablePerson other) {\n firstName = other.firstName;\n middleName = other.middleName;\n lastName = other.lastName;\n nickNames = new ArrayList<>(other.nickNames);\n }",
"public abstract void copy(Result result, Object object);",
"protected AbstractChartModel copy(AbstractChartModel aCopy) {\n aCopy.title = title;\n aCopy.xAxisTitle = xAxisTitle;\n aCopy.yAxisTitle = yAxisTitle;\n aCopy.xRangeMax = xRangeMax;\n aCopy.xRangeMin = xRangeMin;\n aCopy.xRangeIncr = xRangeIncr;\n aCopy.yRangeMax = yRangeMax;\n aCopy.yRangeMin = yRangeMin;\n aCopy.yRangeIncr = yRangeIncr;\n aCopy.simModel = simModel;\n ArrayList list = new ArrayList();\n for (int i = 0, n = dataSources.size(); i < n; i++) {\n GuiChartDataSource ds = (GuiChartDataSource) dataSources.get(i);\n list.add(ds.copy());\n }\n aCopy.dataSources = list;\n\n return aCopy;\n }",
"@Override\n public ExpressionNode deepCopy(BsjNodeFactory factory);",
"private Object[] deepCopy()\n {\n Object[] newList = new Object[size];\n\n int newListPosition = 0;\n for (int i =0; i < size; i++)\n {\n if (list[i] != null)\n {\n newList[newListPosition++] = list[i];\n }\n }\n\n return newList;\n }",
"public Game copy();",
"public void pasteFrom(Flow other)\n\t\t{\n\t\tunits.addAll(other.units);\n\t\tconns.addAll(other.conns);\n\t\t}",
"@Override\r\n\tpublic LogicalValue copy() {\r\n\t\treturn new Pointer(target);\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n @Override\n public <T extends JsonNode> T deepCopy() { return (T) this; }",
"public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}",
"public CFExp deepCopy(){\r\n return this;\r\n }",
"DataContext copy();",
"@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }",
"@Override\n\tpublic SecuredRDFList copy();",
"@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}",
"public O copy() {\n return value();\n }",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }",
"public abstract Object clone();",
"public Function clone();",
"public abstract Type treeCopy();",
"public Tree<K, V> copy(Tree<K, V> t, Tree<K, V> copy) {\n\t\tcopy = copy.add(key, value);\n\t\tcopy = left.copy(left, copy);\n\t\tcopy = right.copy(right, copy);\n\t\treturn copy;\n\t}",
"public Results copy()\n {\n Results copy = new Results();\n for(Object object : results) {\n copy.add( object );\n }\n return copy;\n }",
"private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }",
"public Coordinates copy() {\n\t\treturn new Coordinates(this);\n\t}",
"@Override\r\n\tpublic void copy(Property p) {\n\t\t\r\n\t}",
"public directed_weighted_graph deepCopy() {\n DWGraph_DS copyGraph = new DWGraph_DS(this); //create a new graph with the original graph data (only primitives)\n HashMap<Integer, node_data> copyNodesMap = new HashMap<>(); //create a new nodes HashMap for the new graph\n for (node_data node : nodes.values()) { //loop through all nodes in the original graph\n copyNodesMap.put(node.getKey(), new NodeData((NodeData) node)); //makes a duplicate of the original HashMap\n }\n copyGraph.nodes = copyNodesMap; //set the new graph nodes to the new HashMap we made.\n return copyGraph;\n }",
"public Object clone() {\n return this.copy();\n }",
"@Override\n public Operator visitCopy(Copy operator)\n {\n throw new AssertionError();\n }",
"@Test\n\tpublic void copy() {\n\t\tBody b1 = new Body();\n\t\tBodyFixture b1f1 = b1.addFixture(Geometry.createCircle(0.5));\n\t\t\n\t\tCollisionItemAdapter<Body, BodyFixture> c1 = this.item.copy();\n\t\tTestCase.assertNull(c1.getBody());\n\t\tTestCase.assertNull(c1.getFixture());\n\t\t\n\t\tthis.item.set(b1, b1f1);\n\t\tCollisionItemAdapter<Body, BodyFixture> c2 = this.item.copy();\n\t\tTestCase.assertEquals(b1, c2.getBody());\n\t\tTestCase.assertEquals(b1f1, c2.getFixture());\n\t\t\n\t\t// make sure it's a deep copy\n\t\tc1.set(null, null);\n\t\tTestCase.assertNull(c1.getBody());\n\t\tTestCase.assertNull(c1.getFixture());\n\t\tTestCase.assertEquals(b1, c2.getBody());\n\t\tTestCase.assertEquals(b1f1, c2.getFixture());\n\t}",
"public abstract Object clone() ;",
"public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}",
"public PaginationVO(PaginationVO other) {\n __isset_bitfield = other.__isset_bitfield;\n this.pageSize = other.pageSize;\n this.pageNo = other.pageNo;\n this.upPage = other.upPage;\n this.nextPage = other.nextPage;\n this.totalCount = other.totalCount;\n this.totalPage = other.totalPage;\n if (other.isSetPageUrl()) {\n this.pageUrl = other.pageUrl;\n }\n if (other.isSetParams()) {\n this.params = other.params;\n }\n if (other.isSetDatas()) {\n List<BlogPostVO> __this__datas = new ArrayList<BlogPostVO>();\n for (BlogPostVO other_element : other.datas) {\n __this__datas.add(new BlogPostVO(other_element));\n }\n this.datas = __this__datas;\n }\n }",
"public WorldState (WorldState other)\n\t{\n\t\tproperties = new HashMap<String, WorldStateProperty>();\t\t\n\t\tcopy(other);\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}",
"protected void copy(){\n\t\tthis.model.copy(this.color.getBackground());\n\t}",
"@Override\n public MetaprogramTargetNode deepCopy(BsjNodeFactory factory);",
"@Override\n public INDArray copy(INDArray x, INDArray y) {\n //NativeBlas.dcopy(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n JavaBlas.rcopy(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n return y;\n }",
"@Override\n\tpublic function copy() {\n\t\tMonom M=new Monom(this.get_coefficient(),this.get_power());\n\t\t\n\t\treturn M;\n\t}",
"public Object detachCopy(Object po)\n{\n\treturn po;\n}",
"public ConfabulatorObject getCopy() {\n\t\tConfabulatorObject copy = new ConfabulatorObject(getMessenger());\n\t\tlockMe(this);\n\t\tint maxD = maxLinkDistance;\n\t\tint maxC = maxLinkCount;\n\t\tList<Link> linksCopy = new ArrayList<Link>();\n\t\tfor (Link lnk: links) {\n\t\t\tlinksCopy.add(lnk.getCopy());\n\t\t}\n\t\tunlockMe(this);\n\t\tcopy.initialize(maxD,maxC,linksCopy);\n\t\treturn copy;\n\t}",
"@Override\r\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS();\r\n for (node_info curr : this.Graph.getV()) { //The loop passes through all the ver' of the graph\r\n Nodes t = new Nodes(curr); //create new node\r\n copy.addNode(t.key); //copy the the old node to the new node\r\n }\r\n for (node_info curr0 : this.Graph.getV()) {\r\n for (node_info curr1 : this.Graph.getV(curr0.getKey())) { //this loops pass over the all nodes and copy the connection\r\n double i = this.Graph.getEdge(curr0.getKey(), curr1.getKey());\r\n if (i != -1) {\r\n copy.connect(curr0.getKey(), curr1.getKey(), i);\r\n }\r\n }\r\n }\r\n return copy;\r\n\r\n }",
"@Override\n public Object clone() {\n return super.clone();\n }",
"public Query copy() {\r\n\tQuery queryCopy = new Query();\r\n\tqueryCopy.terms = (LinkedList<String>) terms.clone();\r\n\tqueryCopy.weights = (LinkedList<Double>) weights.clone();\r\n\treturn queryCopy;\r\n }",
"public static void main(String[] args) throws CloneNotSupportedException\n {\n ArrayList<String> companies = new ArrayList<String>();\n companies.add(\"Baidu\");\n companies.add(\"Tencent\");\n companies.add(\"Ali\");\n WorkExprience workExprience = new WorkExprience(companies);\n String nameString = new String(\"Tom\");\n String genderString = new String(\"male\");\n Resume resume = new Resume(nameString, 23, genderString, workExprience);\n System.out.println(\"Source Resume\");\n resume.printResum();\n \n ArrayList<String> companies1 = new ArrayList<String>();\n companies1.add(\"Google\");\n companies1.add(\"Microsoft\");\n companies1.add(\"Oracle\");\n Resume copyResume = (Resume)resume.clone();\n String nameString1 = new String(\"Jerry\");\n String genderString1 = new String(\"Fmale\");\n copyResume.setName(nameString1);\n copyResume.setAge(20);\n copyResume.setGender(genderString1);\n copyResume.getWorkExprience().setCompanyArrayList(companies1);\n System.out.println();\n System.out.println(\"Source Resume\");\n resume.printResum();\n System.out.println();\n System.out.println(\"Copy Resume\");\n copyResume.printResum();\n }",
"public MappingInfo copy()\r\n\t{\r\n\t\tArrayList<MappingCell> mappingCells = new ArrayList<MappingCell>();\r\n\t\tfor(MappingCell mappingCell : mappingCellHash.get())\r\n\t\t\tmappingCells.add(mappingCell);\r\n\t\treturn new MappingInfo(mapping.copy(),mappingCells);\r\n\t}",
"protected void deepCloneReferences(uka.transport.DeepClone _helper)\n throws CloneNotSupportedException\n {\n //Cloning the byte array\n\t this.value = _helper.doDeepClone(this.value);\n //byte[] value_clone = new byte[this.value.length]; \n //System.arraycopy(this.value, 0, value_clone, 0, this.value.length);\n //this.value = value_clone;\n }",
"static void setNotCopying(){isCopying=false;}",
"void copy(DependencyRelations deps){\n if (deps == null)\n throw new IllegalArgumentException(\"the source is null.\");\n\n size_ = deps.size_;\n for(int i = 0; i < size_ ; i++){\n if (nodes_[i] == null)\n nodes_[i] = new Node();\n nodes_[i].copy(deps.nodes_[i]);\n }\n }",
"@SuppressWarnings(\"All\")\n public <T> void copy(MyList<? super T> to, MyList<? extends T> from) {\n\n System.out.println(\"from size \" + from.size);\n for (int i = 0; i < from.getSize(); i++) {\n to.add(from.getByIndex(i));\n }\n }",
"public void copy(Posts that) {\r\n\t\tsetId(that.getId());\r\n\t\tsetTitle(that.getTitle());\r\n\t\tsetContent(that.getContent());\r\n\t\tsetShareDate(that.getShareDate());\r\n\t\tsetIsPrivate(that.getIsPrivate());\r\n\t\tsetUsers(that.getUsers());\r\n\t\tsetCommentses(new java.util.LinkedHashSet<com.ira.domain.Comments>(that.getCommentses()));\r\n\t}",
"@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }"
] | [
"0.7214815",
"0.6982586",
"0.6743959",
"0.66792786",
"0.6563397",
"0.6549605",
"0.65230364",
"0.652084",
"0.64842516",
"0.64743775",
"0.6450891",
"0.6438907",
"0.64186275",
"0.640633",
"0.6403375",
"0.63743764",
"0.6373319",
"0.6358263",
"0.6322797",
"0.63214344",
"0.62839",
"0.6270614",
"0.6265534",
"0.6262602",
"0.6245396",
"0.6226707",
"0.62195224",
"0.6199828",
"0.6194176",
"0.61679715",
"0.61505216",
"0.6141201",
"0.6141201",
"0.613657",
"0.61238766",
"0.6113572",
"0.6078777",
"0.6067093",
"0.6051407",
"0.60489607",
"0.60435355",
"0.6034403",
"0.6030665",
"0.603029",
"0.6002317",
"0.5987207",
"0.5984917",
"0.59831345",
"0.5962016",
"0.5931717",
"0.59043086",
"0.58999294",
"0.58940864",
"0.5888768",
"0.5887435",
"0.5887003",
"0.5872753",
"0.58715606",
"0.5867456",
"0.5854781",
"0.5835268",
"0.5833011",
"0.58237326",
"0.58237326",
"0.58237326",
"0.58237326",
"0.5821464",
"0.5818652",
"0.5814066",
"0.57974726",
"0.579667",
"0.5792226",
"0.57900447",
"0.57734174",
"0.57581633",
"0.5751797",
"0.57507133",
"0.5744841",
"0.5744065",
"0.5744024",
"0.5743795",
"0.5740732",
"0.57376605",
"0.5736934",
"0.5736099",
"0.5727886",
"0.5727659",
"0.5714002",
"0.5700601",
"0.56953377",
"0.5689013",
"0.5682943",
"0.5676875",
"0.56736434",
"0.56729144",
"0.567041",
"0.5669635",
"0.56651294",
"0.56643426",
"0.5662451",
"0.5647604"
] | 0.0 | -1 |
Returns true if field companyNamePartical is set (has been assigned a value) and false otherwise | public boolean isSetCompanyNamePartical() {
return this.companyNamePartical != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSetCompanyUserNamePartical() {\n return this.companyUserNamePartical != null;\n }",
"public boolean isSetCompany_name() {\n return this.company_name != null;\n }",
"public boolean isSetAccountNamePartical() {\n return this.accountNamePartical != null;\n }",
"public boolean isSetCompany_abbr() {\n return this.company_abbr != null;\n }",
"public boolean isSetCarprovincename() {\n return this.carprovincename != null;\n }",
"public boolean isSetPhasename() {\n return this.phasename != null;\n }",
"boolean isSetAuditingCompany();",
"public boolean isSetVendorname() {\n return this.vendorname != null;\n }",
"public boolean isSetRealName() {\n\t\treturn this.realName != null;\n\t}",
"boolean hasCompany();",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"public boolean isSetCompanyId() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"boolean isSetHasAuditingCompany();",
"public boolean isSetCompanyId() {\n return EncodingUtils.testBit(__isset_bitfield, __COMPANYID_ISSET_ID);\n }",
"boolean isSetCompanyBaseData();",
"public boolean isSetCompany_logo() {\n return this.company_logo != null;\n }",
"public boolean isSetProduction_companies() {\n return this.production_companies != null;\n }",
"public boolean isSetCarcityname() {\n return this.carcityname != null;\n }",
"boolean hasBusinessName();",
"public boolean isSetFriendlyName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(FRIENDLYNAME$2) != 0;\r\n }\r\n }",
"public boolean isSetEngName() {\n return this.engName != null;\n }",
"public boolean isSetJobtitle() {\n return this.jobtitle != null;\n }",
"public boolean visible_SetupNameField() {\r\n\t\treturn IsElementVisibleStatus(DefineSetup_SetupName_txtBx);\r\n\t}",
"public boolean isSetPartId() {\n return this.partId != null;\n }",
"public boolean isSetPart()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(PART$2) != 0;\n }\n }",
"public boolean isVehicleNameFieldPresent() {\r\n\t\treturn isElementPresent(vehicleNameField, SHORTWAIT);\r\n\t}",
"public boolean externalFilled() {\n return firstName != null && !firstName.isEmpty()\n || lastName != null && !lastName.isEmpty()\n || email != null && !email.isEmpty();\n }",
"public boolean isCountryNameFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Country Name\"), SHORTWAIT);\r\n\t}",
"public boolean isSetCity_ename() {\n return this.city_ename != null;\n }",
"public boolean isSetCnName() {\n return this.cnName != null;\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_NAME_PARTICAL:\n return isSetCompanyNamePartical();\n case COMPANY_USER_NAME_PARTICAL:\n return isSetCompanyUserNamePartical();\n case ORDER_TYPE:\n return isSetOrderType();\n case STATE:\n return isSetState();\n }\n throw new IllegalStateException();\n }",
"public boolean isSetCardistrictname() {\n return this.cardistrictname != null;\n }",
"public boolean isSetProcess_Name() {\r\n return this.Process_Name != null;\r\n }",
"public boolean isSetEmployment_type_name() {\n return this.employment_type_name != null;\n }",
"public boolean isSetFk_name() {\n return this.fk_name != null;\n }",
"public boolean isCompanyNameModified()\n\t{\n\t\treturn companyNameModified;\n\t}",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSetParts() {\n return this.parts != null;\n }",
"public boolean isCompanyShortNameTaken(String shortName);",
"protected boolean checkCompanyEmail() {\n\t\tif (this.getForm().getInteractionManager().getModifiedFieldAttributes().contains(CompanyNaming.EMAIL)) {\r\n\t\t\tMessageManager.getMessageManager().showMessage(this.getForm(), \"W_UNSAVED_EMAIL_MANDATORY\", MessageType.WARNING, new Object[] {});\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tString emailValue = (String) this.emailField.getValue();\r\n\t\tif (StringTools.isEmpty(emailValue) || !UEmailDataField.isValidEmail(emailValue)) {\r\n\t\t\tMessageManager.getMessageManager().showMessage(this.getForm(), \"W_INVALID_EMAIL_MANDATORY\", MessageType.WARNING, new Object[] {});\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"boolean isSetDisplayName();",
"public boolean isSetAccountName() {\n return this.accountName != null;\n }",
"public boolean isSetPk_name() {\n return this.pk_name != null;\n }",
"public boolean isSetTeamName() {\n return this.teamName != null;\n }",
"boolean hasCampaignName();",
"public boolean isSetPlatformName() {\n return this.platformName != null;\n }",
"public boolean isSetCartitle() {\n return this.cartitle != null;\n }",
"private boolean validParams(String name, String company) {\n\t\treturn (name != null && !name.trim().equals(\"\")) \n\t\t\t\t&& (company != null && !company.trim().equals(\"\"));\n\t}",
"public boolean isSetPublisher_name() {\n return this.publisher_name != null;\n }",
"@Override\n public boolean hasCustomName() {\n return this.customName != null && !this.customName.isEmpty();\n }",
"public boolean isSetBusinessUnit() {\n return this.businessUnit != null;\n }",
"public boolean hasCampaignName() {\n return campaignNameBuilder_ != null || campaignName_ != null;\n }",
"public boolean isSetAutoForwardToName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(AUTOFORWARDTONAME$12) != 0;\n }\n }",
"public boolean isSetName() {\r\n return this.name != null;\r\n }",
"public boolean CompanySelect()\n\t{\n\t\t//Click on Add a new Computer on Home Page to Navigate to Creation of Computer Page\n\t\tAddComputer.click();\n\t\t\n\t\t//Wait Time after each transaction\n\t\tWebDriverWait wait = new WebDriverWait(driver,2);\n\t\t\n\t\tboolean Companyselect = CompanySelect.isEnabled();\n\t\treturn Companyselect;\n\t}",
"public boolean isSetName() {\n\t\treturn this.name != null;\n\t}",
"public boolean isSetContact() {\n return this.contact != null;\n }",
"private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }",
"public boolean isSetName() {\n return this.name != null;\n }",
"public boolean isSetCatName() {\n return this.catName != null;\n }",
"public boolean isSetUcarpicwholepath() {\n return this.ucarpicwholepath != null;\n }",
"boolean isSetRegisteredOfficeCity();",
"public boolean isSetName() {\n return this.Name != null;\n }",
"public boolean isSetName() {\n return this.name != null;\n }",
"public boolean isSetName() {\n return this.name != null;\n }",
"public boolean isSetName() {\n return this.name != null;\n }",
"public boolean isSetName() {\n return this.name != null;\n }",
"public boolean isSetParty() {\n\t\treturn this.party != null;\n\t}",
"public boolean isSetClearingPartID() {\n return this.clearingPartID != null;\n }",
"public boolean isSetJobnumber() {\n return this.jobnumber != null;\n }",
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"boolean isSetCapitalPayed();",
"public boolean hasPerson() {\n return dataBodyCase_ == 2;\n }",
"public boolean isSetOriginName() {\n return this.originName != null;\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case COMPANY_ID:\n return isSetCompanyId();\n case USER_EMPLOYEE_DOS:\n return isSetUserEmployeeDOS();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ACCOUNT_IDS:\n return isSetAccountIds();\n case ACCOUNT_NAME:\n return isSetAccountName();\n case ACCOUNT_NAME_PARTICAL:\n return isSetAccountNamePartical();\n }\n throw new IllegalStateException();\n }",
"public boolean isSetPrf()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(PRF$26) != 0;\r\n }\r\n }",
"public boolean isSetApplierName() {\n return this.applierName != null;\n }",
"void xsetHasAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus hasAuditingCompany);",
"public boolean hasPerson() {\n return dataBodyCase_ == 2;\n }"
] | [
"0.79734886",
"0.78177476",
"0.7396799",
"0.6837541",
"0.67199147",
"0.664029",
"0.6634833",
"0.6631017",
"0.65917414",
"0.65905607",
"0.6571416",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6536396",
"0.6513339",
"0.6455629",
"0.644545",
"0.64161515",
"0.64041555",
"0.6375306",
"0.635607",
"0.6351446",
"0.6208201",
"0.6188946",
"0.61713797",
"0.61652476",
"0.61593115",
"0.6148306",
"0.60831594",
"0.60765964",
"0.60531205",
"0.6022819",
"0.6019339",
"0.6015907",
"0.5998437",
"0.59847105",
"0.5975394",
"0.5966141",
"0.5944758",
"0.5944758",
"0.5944758",
"0.5944758",
"0.5944758",
"0.5925303",
"0.5917451",
"0.5913015",
"0.59035325",
"0.58952016",
"0.5884651",
"0.58750325",
"0.5863882",
"0.584974",
"0.5819229",
"0.58069795",
"0.5758175",
"0.57558304",
"0.5734476",
"0.57284117",
"0.5720823",
"0.5718142",
"0.57164943",
"0.5714775",
"0.57104087",
"0.57097566",
"0.5707732",
"0.5695549",
"0.5694842",
"0.5691031",
"0.5687774",
"0.5687508",
"0.5687508",
"0.5687508",
"0.5687508",
"0.5682295",
"0.5676836",
"0.56713766",
"0.56659037",
"0.56659037",
"0.56631297",
"0.5661015",
"0.5659767",
"0.5643259",
"0.56416017",
"0.56402063",
"0.5636884",
"0.5635813",
"0.56334907"
] | 0.87708294 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.