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
Update method needed by superclass
@Override public void update(GameContainer gc, int delta) throws SlickException { // Declaration and initialization of object that will monitor keypresses Input input = gc.getInput(); // camera management camera.keyboardMove(input, delta); // selecting units if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)) { int mouseXTiles = (int)((Mouse.getX() - camera.getX())/tileSize); int mouseYTiles = (int)((600 - Mouse.getY() - camera.getY())/tileSize); int uOneXTiles = (int)(unitOne.getX()/tileSize); int uOneYTiles = (int)(unitOne.getY()/tileSize); if ((uOneXTiles == mouseXTiles) && (uOneYTiles == mouseYTiles)) { u1selected = true; System.out.println("Unit one has been selected"); } int uTwoXTiles = (int)(unitTwo.getX()/tileSize); int uTwoYTiles = (int)(unitTwo.getY()/tileSize); if ((uTwoXTiles == mouseXTiles) && (uTwoYTiles == mouseYTiles)) { u2selected = true; System.out.println("Unit two has been selected"); } } // setting destination if (input.isMousePressed(Input.MOUSE_RIGHT_BUTTON)) { if (u1selected) { System.out.println("Before PathF1"); int playerXTiles = (int)(unitOne.getX()/tileSize); int playerYTiles = (int)(unitOne.getY()/tileSize); int mouseXTiles = (int)((Mouse.getX() - camera.getX())/tileSize); int mouseYTiles = (int)((600 - Mouse.getY() - camera.getY())/tileSize); if ((mouseXTiles < thePTBMap.getWidthInTiles()) && (mouseYTiles < thePTBMap.getHeightInTiles()) && (mouseXTiles >= 0) && (mouseYTiles >= 0)) { path = pathFinder.findPath(null, playerXTiles, playerYTiles, mouseXTiles, mouseYTiles); } playerEtape = 0; u1selected = false; System.out.println("Unit one launched"); } if (u2selected) { System.out.println("Before PathF2"); int playerXTiles = (int)(unitTwo.getX()/tileSize); int playerYTiles = (int)(unitTwo.getY()/tileSize); int mouseXTiles = (int)((Mouse.getX() - camera.getX())/tileSize); int mouseYTiles = (int)((600 - Mouse.getY() - camera.getY())/tileSize); if ((mouseXTiles < thePTBMap.getWidthInTiles()) && (mouseYTiles < thePTBMap.getHeightInTiles()) && (mouseXTiles >= 0) && (mouseYTiles >= 0)) { path2 = pathFinder.findPath(null, playerXTiles, playerYTiles, mouseXTiles, mouseYTiles); } playerEtape2 = 0; u2selected = false; System.out.println("Unit two launched"); } } if (path != null) { if ( (playerEtape != path.getLength())) { // moving player to destination unitOne.goToDest(path.getX(playerEtape)*tileSize, path.getY(playerEtape)*tileSize, delta, movingUp, movingDown, movingLeft, movingRight); //testing if player has arrived at destination if ((unitOne.getX() == path.getX(playerEtape)*tileSize) && (unitOne.getY() == path.getY(playerEtape)*tileSize)) { playerEtape++; } } else { System.out.println("uOne Arrived"); path = null; } } if (path2 != null) { if ( (playerEtape2 != path2.getLength())) { // moving player to destination unitTwo.goToDest(path2.getX(playerEtape2)*tileSize, path2.getY(playerEtape2)*tileSize, delta, movingUp, movingDown, movingLeft, movingRight); //testing if player has arrived at destination if ((unitTwo.getX() == path2.getX(playerEtape2)*tileSize) && (unitTwo.getY() == path2.getY(playerEtape2)*tileSize)) { playerEtape2++; } } else { System.out.println("uTwo Arrived"); path2 = null; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@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\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}", "@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tpublic void update() {\r\n\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}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "public void update()\n\t{\n\t\tsuper.update();\n\t}", "protected abstract void update();", "protected abstract void update();", "@Override\r\n\tpublic void update() {\r\n\t}", "@Override\n\tpublic void update() { }", "@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}", "@Override\n public void update() {\n \n }", "@Override\r\n\tpublic void update() {\n\t}", "@Override\r\n\tpublic void update() {\n\t}", "@Override\n public void update() {\n }", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "protected abstract void update();", "@Override\r\n\tpublic void update() {\n\r\n\t}", "@Override\r\n\tpublic void update() {\n\r\n\t}", "@Override\n public void update() {\n }", "@Override\n public void update()\n {\n\n }", "@Override\n public void update() {\n\n }", "abstract public void update();", "@Override\r\n public void onUpdate() {\n super.onUpdate();\r\n }", "public void update(){}", "public void update(){}", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update();", "public abstract void update ();", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "public void update() {}", "public void update() {\n\t\t\n\t}", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\r\n\t\t\r\n\t}", "public void update() {\n }", "public void update(){\r\n\t\t\r\n\t}", "@Override\n\tpublic void update(UpdateInfo updateInfo) {\n\t\t\n\t}", "public void update() {\n \t\tthrow new UnsupportedOperationException(\"Not implemented at this level\");\n \t}", "public void update() {\n\n }", "public void update() {\n\n }", "public void update(){\r\n }", "public void update() ;", "@Override\n\tpublic void update() {\n\t\tobj.update();\n\t}", "public void willbeUpdated() {\n\t\t\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "@Override\n\tpublic int update() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void update(Instance ins) {\n\t\t\n\t}", "public void update(){\n }", "protected void onUpdate() {\r\n\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 MemberUpdate() {\n\r\n\t}", "@Override\r\n\tpublic void update(Object object) {\n\t\t\r\n\t}", "@Override\n protected void updateProperties() {\n }", "@Override\n\tpublic void onUpdate() {\n\t\t\n\t}", "public void update(){\n \t//NOOP\n }", "public void update();", "public void update();", "public void update();", "public void update();", "public void update();" ]
[ "0.8456304", "0.8456304", "0.8456304", "0.8351222", "0.8351222", "0.82806265", "0.8276913", "0.8276913", "0.824387", "0.8229056", "0.8223673", "0.8223673", "0.8223673", "0.8223673", "0.8223673", "0.8211016", "0.82109904", "0.82109904", "0.81920564", "0.8188131", "0.817442", "0.817442", "0.817442", "0.817442", "0.817442", "0.817442", "0.81513613", "0.8123797", "0.8123797", "0.8098817", "0.8078096", "0.8078096", "0.8078096", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.8013396", "0.80010164", "0.7997336", "0.7997336", "0.7992551", "0.7988918", "0.7944033", "0.782022", "0.7817343", "0.7814596", "0.7814596", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.77803403", "0.7674881", "0.76409745", "0.7633085", "0.7597155", "0.7584858", "0.7584858", "0.7584858", "0.7584858", "0.757943", "0.75156534", "0.74820507", "0.7469007", "0.7461662", "0.7381263", "0.7381263", "0.73791623", "0.7376582", "0.7334975", "0.73314834", "0.7328954", "0.7310496", "0.7300347", "0.7297416", "0.727477", "0.7264246", "0.7264246", "0.7164812", "0.7094226", "0.7091941", "0.70814013", "0.70411897", "0.7029119", "0.7029119", "0.7029119", "0.7029119", "0.7029119" ]
0.0
-1
Render method needed by superclass
@Override public void render(GameContainer gc, Graphics g) throws SlickException { try { Thread.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } // map rendering theMap.render(0 + (int)camera.getX(), 0 + (int)camera.getY()); // player rendering unitOne.getMovement().draw(unitOne.getX() + camera.getX(), unitOne.getY() + camera.getY()); unitTwo.getMovement().draw(unitTwo.getX() + camera.getX(), unitTwo.getY() + camera.getY()); // some indicators g.drawString("playerX = " + (unitOne.getX() + camera.getX()), 600, 20); g.drawString("playerY = " + (unitOne.getY() + camera.getY()), 600, 40); g.drawString("mouseX = " + Mouse.getX(), 600, 60); g.drawString("mouseY = " + (600 - Mouse.getY()), 600, 80); g.drawString("mouseTileX = " + (int)Mouse.getX()/tileSize, 600, 100); g.drawString("mouseTileY = " + (int)(600 - Mouse.getY())/tileSize, 600, 120); if (path != null) { g.drawString("Path length = " + path.getLength(), 600, 160);} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void render(){}", "@Override\n public void render() { super.render(); }", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "@Override\n public void render() {\n super.render();\n }", "@Override\n public void render() {\n super.render();\n }", "@Override\n\tpublic void render() {\n\t\t\n\t}", "@Override\n\tpublic void render () {\n super.render();\n\t}", "@Override\n\tpublic void render () {\n\n\t}", "@Override\r\n\tpublic void render() {\n\r\n\t}", "protected void preRender()\n {\n // subclass\n }", "public void render() {\r\n\r\n }", "protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}", "public void render() {\n }", "public void render()\r\n\t{\n\t}", "public abstract void render(Renderer renderer);", "@Override\n public int getRenderType()\n {\n return 22;\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\r\n\tpublic void simpleRender(RenderManager rm) {\n\t}", "public void render();", "public abstract void renderInterface();", "@Override\n public int getRenderType()\n {\n return 31;\n }", "@Override\n\tpublic void forceRender() {\n\n\t}", "@Override\r\n\tpublic void accept(iRenderVisitor visitor) {\n\t\tvisitor.render(this);\r\n\t\t\r\n\t}", "@Override\n\tpublic void renderSource() {\n\t\t\n\t}", "@Override\n public void beforeRender()\n {\n\n }", "public void render() {\n\t\t// do nothing... as we should\n\t}", "@Override\n\tpublic void render(Graphics g)\n\t{\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "protected abstract Render render(Param param, int pass);", "public cn.bran.japid.template.RenderResult render() {\n\t\ttry {super.layout();} catch (RuntimeException __e) { super.handleException(__e);} // line 0, japidviews/Application/photo/Story.html\n\t\treturn getRenderResult();\n\t}", "protected abstract void render(Graphics g);", "@Override\n \tprotected void controlRender(RenderManager rm, ViewPort vp) {\n \n \t}", "@Override\n protected void controlRender(RenderManager rm, ViewPort vp) {\n }", "public void render(){\n//\t\tsetCards();\n//\t\tsetMurderInfo();\n\t}", "@Override\r\n protected void controlRender(RenderManager rm, ViewPort vp) {\n }", "public int getRenderType()\n {\n return 2;\n }", "@Override\n\tprotected void controlRender(RenderManager rm, ViewPort vp) {\n\t\t\n\t}", "@Override\n\tpublic void render(float delta) {\n\n\t}", "@Override\r\n public void draw() {\n }", "@Override\r\n\tpublic void paint(Graphics g) {\n\t\tsuper.paint(g);\r\n\t\trender(g);\r\n\t}", "@Override\n public void prerender() {\n }", "@Override\n\tpublic int getRenderType()\n\t{\n\t\treturn -1;\n\t}", "@Override\n\tpublic void render() {\n\t\tScreen.render();\n\t}", "@Override\n public void setRenderer(Object arg0)\n {\n \n }", "@Override\n\tpublic void render(float delta) {\n\t}", "@Override\n public abstract String getRendererType();", "public interface Renderable {\r\n}", "@Override\n public void draw() {\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\n\tpublic void render() {\n\t\t// only render it when visible is true\n\t\tif (visible == false) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tsuper.render();\n\t\t}\n\t}", "public abstract void render(Graphics g);", "public abstract String visualizar();", "@Override\n public void draw()\n {\n }", "void dynamicRendering();", "@Override\n public boolean isToBeRendered()\n {\n return true;\n }", "@Override\n\tpublic void render(RenderRequest renderRequest, RenderResponse renderResponse)\n\t\t\tthrows IOException, PortletException {\n\t\tsuper.render(renderRequest, renderResponse);\n\t}", "public int getRenderType()\n {\n return 40;\n }", "@Override\n\tpublic void draw() {\n\t}", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n render(g);\n }", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "public String render()\r\n/* 24: */ {\r\n/* 25:51 */ if (!this.init_flag)\r\n/* 26: */ {\r\n/* 27:52 */ this.init_flag = true;\r\n/* 28:53 */ return \"\";\r\n/* 29: */ }\r\n/* 30: */ try\r\n/* 31: */ {\r\n/* 32:56 */ ConnectorResultSet res = this.sql.get_variants(this.request);\r\n/* 33:57 */ return render_set(res);\r\n/* 34: */ }\r\n/* 35: */ catch (ConnectorOperationException e) {}\r\n/* 36:59 */ return \"\";\r\n/* 37: */ }", "public interface ISpecialRender\n{\n\tvoid render(Stack stack, World world, BlockState state, int x, int y, int z);\n}", "@Override\r\n\tprotected void onDraw(LRenderSystem rs) {\n\r\n\t}", "@Override\n public void render() {\n System.out.println(this.input);\n return;\n }", "public void render() {\n renderHud();\n }", "@Override\n public Object getRenderer()\n {\n return null;\n }", "java.lang.String getRenderer();", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void render(float deltaTime) {\n\t\t\n\t}", "@Override\n\tpublic void Render() {\n\t\t\n\t\tSystem.out.println(\"Chocolater Ice Cream\");\n\t\t\n\t}", "public void render() {\n uiBatch.begin();\n for (int x = 0; x < uiManager.getUIComponents().size();x++) {\n uiManager.getUIComponent(x).render(uiBatch, Assets.patch);\n }\n if (uiManager.dialogue != null) {\n uiManager.dialogue.render(uiBatch, Assets.patch);\n }\n if (!uiManager.notifications.isEmpty()) {\n uiManager.notifications.get(0).render(uiBatch, Assets.patch);\n }\n uiManager.partyMenu.render(uiBatch, Assets.patch);\n uiBatch.end();\n }", "public String render() {\n\t\tresetOutput();\n\t\trenderBorder();\n\t\trenderPlayerWalls();\n\t\trenderTargetTiles();\n\t\trenderPlayers();\n\n\t\treturn this.buildOutput();\n\t}", "public abstract boolean isRendered();", "@Override\n\tpublic void render(SpriteBatch batch) {\n\t}", "void onRender(RenderArguments arguments);", "void render(Object rendererTool);", "protected abstract String display();", "private void renderView() {\r\n\t\tSystem.out.println(this.currentView.render());\r\n\t}", "public interface Renderable {\n\n void render();\n}", "private void render() {\n\n StateManager.getState().render();\n }", "public abstract String getView();", "@Override\r\n\t\t\t\tpublic void render(TwoDimensionBone object, Appendable appendable) throws IOException {\n\t\t\t\t\t\r\n\t\t\t\t}", "public String render() {\n return root.render(0, m_instanceBags);\n }", "@Override\n public void render() {\n if (renderInterrupted) {\n log.debug(\"render()\");\n renderInterrupted = false;\n }\n\n }", "public String render() throws RuntimeException {\n StringBuffer buffer = new StringBuffer();\n\n try {\n buffer.append(String.format(\"Instance of %s:\\n\", toRender.getClass().getName()));\n Field[] fields = toRender.getClass().getDeclaredFields();\n for (Field field : fields) {\n if (!field.isAccessible()) {\n field.setAccessible(true);\n }\n if (field.isAnnotationPresent(RenderMe.class)) {\n RenderMe renderMeAnnotation = field.getAnnotation(RenderMe.class);\n final String with = renderMeAnnotation.with();\n System.out.println(with);\n if (!with.isEmpty()) {\n Class forNameClass = Class.forName(with);\n\n Object newRenderer = forNameClass.newInstance();\n Method method = newRenderer.getClass().getMethod(\"render\", field.getType());\n\n if (!method.isAccessible()) {\n method.setAccessible(true);\n }\n\n Object returnValue = method.invoke(newRenderer, field.get(toRender));\n if (returnValue.getClass() == String.class) {\n final String value = (String) returnValue;\n buffer.append(String.format(\"%s (Type %s): %s\\n\",\n field.getName(),\n field.getType().getCanonicalName(),\n value));\n }\n }\n else {\n if (!field.isAccessible()) {\n field.setAccessible(true);\n }\n buffer.append(String.format(\"%s (Type %s): %s\\n\",\n field.getName(),\n field.getType().getCanonicalName(),\n field.get(toRender).toString()\n ));\n }\n }\n }\n\n Method[] methods = toRender.getClass().getDeclaredMethods();\n for (Method method : methods) {\n if (method.isAnnotationPresent(RenderMe.class)) {\n if (method.getParameterCount() == 0) {\n if (!method.isAccessible()) {\n method.setAccessible(true);\n }\n Object value = method.invoke(toRender);\n\n buffer.append(String.format(\"%s (Return Type %s): %s\\n\",\n method.getName(),\n method.getReturnType().getCanonicalName(),\n value.toString()));\n }\n }\n }\n }\n catch (Exception exception) {\n throw new RuntimeException();\n }\n return buffer.toString();\n }", "public abstract T render(VirtualDocument document)\n\t\t\tthrows RenderingException;", "@Override\n\tpublic void tick() {\n\t\trenderer.render(this);\n\t}", "public void registerRenders() {\n }", "protected void onComponentRendered()\n\t{\n\t}", "@Override\n public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)\n {\n this.renderFish((EntityFish)par1Entity, par2, par4, par6, par8, par9);\n }", "public void render() \r\n\t{\r\n \tE3DRenderTree renderTree = new E3DRenderTree(getEngine());\r\n \trenderTree.getTriangleHandler().add(this);\r\n \trenderTree.render();\r\n\t}", "@Override\r\n public void draw()\r\n {\n\r\n }" ]
[ "0.8446536", "0.8243882", "0.80432594", "0.7999821", "0.7999821", "0.7934723", "0.792083", "0.7918908", "0.781932", "0.754691", "0.74611944", "0.7449538", "0.74168384", "0.74095833", "0.72347534", "0.72296625", "0.7204629", "0.7204629", "0.7204629", "0.7204629", "0.7204629", "0.7204629", "0.70694125", "0.70267373", "0.7004999", "0.70000166", "0.695045", "0.69263756", "0.6923227", "0.6866754", "0.68203026", "0.677113", "0.6765516", "0.6765516", "0.6658168", "0.66472745", "0.66335195", "0.66127235", "0.66112405", "0.6606792", "0.6586679", "0.65269125", "0.65172356", "0.65083385", "0.65005004", "0.64960945", "0.64951646", "0.64906484", "0.64798766", "0.64720863", "0.6470446", "0.6467191", "0.6458933", "0.6452484", "0.64447486", "0.64447486", "0.64338523", "0.6422136", "0.6421938", "0.64167655", "0.64111066", "0.6410986", "0.63846076", "0.63805664", "0.6374481", "0.63576806", "0.6351416", "0.6351416", "0.6347096", "0.63438123", "0.6340763", "0.6323427", "0.63014406", "0.62984645", "0.6294903", "0.62876785", "0.62876785", "0.62586844", "0.6209593", "0.6200145", "0.61836445", "0.61696875", "0.6166168", "0.6151749", "0.613925", "0.61184865", "0.6117954", "0.6115648", "0.610861", "0.6108185", "0.6104487", "0.610424", "0.6100574", "0.60933167", "0.60893255", "0.60893124", "0.60790217", "0.6071144", "0.60440534", "0.6039034", "0.6030109" ]
0.0
-1
/ Update animations by delta
@Override public void update(float delta) { if (player.getState() == PlayerState.JUMPING) { walkingStateTime = 0; jumpingStateTime += delta; } else if (player.getState() == PlayerState.WALKING) { jumpingStateTime = 0; walkingStateTime += delta; } else if (player.getState() == PlayerState.IDLE) { walkingStateTime = 0; jumpingStateTime = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateAnimation() {\n\t\tif (anim < 1000) {\n\t\t\tanim++;\n\t\t} else anim = 0;\n\t}", "public abstract void update(int delta);", "@Override\n\tpublic void update(int delta)\n\t{\n\t\tfade.update(delta);\n\t\tsuper.update(delta);\n\t}", "private void updateDelta() {\n\t\tbulletDelta = Delta.getDelta(\"bullet\");\n\t\tenemyDelta = Delta.getDelta(\"enemy\");\n\t}", "public abstract void update(float delta);", "public abstract void update(float delta);", "private void updateAnimations() {\n // Copy the animation requests to avoid concurrent modifications.\n AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];\n curAnimations = animationRequests.toArray(curAnimations);\n\n // Iterate over the animation requests.\n Duration duration = new Duration();\n for (AnimationHandleImpl requestId : curAnimations) {\n // Remove the current request.\n animationRequests.remove(requestId);\n\n // Execute the callback.\n requestId.getCallback().execute(duration.getStartMillis());\n }\n\n // Reschedule the timer if there are more animation requests.\n if (animationRequests.size() > 0) {\n /*\n * In order to achieve as close to 60fps as possible, we calculate the new\n * delay based on the execution time of this method. The delay will be\n * less than 16ms, assuming this method takes more than 1ms to complete.\n */\n timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));\n }\n }", "void update(float delta);", "public void update(){\n\t\ttime += System.currentTimeMillis() - lastTime;\n\t\tlastTime = System.currentTimeMillis();\n\t\t\n\t\t/*fin quando il tempo Ŕ maggiore della velocita incrementa gli indici*/\n\t\tif(time > velocity){\n\t\t\tindex++;\n\t\t\ttime = 0;\n\t\t\tif(index >= animation_frame.length)\n\t\t\t\t{\n\t\t\t\t\tindex = 0;\n\t\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void update(float delta) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void update(int delta)\n\t\t{\n\t\t\tswitch(fadeState)\n\t\t\t{\n\t\t\t\tcase 1: // Fade out.\n\t\t\t\t\tcolor.setAlpha(color.alpha() + (fadeRate * delta));\n\t\t\t\t\tfading(color.alpha());\n\t\t\t\t\tif(color.alpha() >= 1f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfadeState = 0;\n\t\t\t\t\t\tonCompleteFadeOut();\n\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase -1: // Fade in.\n\t\t\t\t\tcolor.setAlpha(color.alpha() - fadeRate * delta);\n\t\t\t\t\tfading(color.alpha());\n\t\t\t\t\tif(color.alpha() <= 0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfadeState = 0;\n\t\t\t\t\t\tonCompleteFadeIn();\n\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "protected abstract void update(double deltaTime);", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "@Override\n public void update(float delta) {\n\n }", "@Override\n\tpublic void update(float delta) {\n\t\t\n\t}", "public void updateAnimations() {\n for (int i = animationList.size()-1; i >= 0; i--) {\n SpriteAnimationInstance anim = animationList.get(i);\n anim.update();\n if (anim.isFinished()) {\n animationList.remove(anim);\n }\n }\n }", "private void updateTransition(float delta) {\n if (roomTransition || gameTransition && !gameTransitionPause) {\n BLACK_BACKGROUND.setAlpha(Interpolation.pow4.apply(0, 1, animTimer / ANIM_TIME));\n\n if (fadeToBlack) {\n animTimer += delta;\n\n if (animTimer >= ANIM_TIME) {\n \tif (roomTransition) {\n\t game.player.moveRoom();\n\t currentNPCs = game.gameSnapshot.map.getNPCs(game.player.getRoom());\n\t getTileRenderer().setMap(game.player.getRoom().getTiledMap());\n\t getTileRenderer().clearPeople();\n\t getTileRenderer().addPerson((List<AbstractPerson>) ((List<? extends AbstractPerson>) currentNPCs));\n\t getTileRenderer().addPerson(game.player);\n \t} else {\n \tswitchGame();\n gameTransitionPause = true;\n \t}\n fadeToBlack = false;\n }\n } else {\n animTimer -= delta;\n\n if (animTimer <= 0f) {\n finishTransition();\n }\n }\n }\n\n if (game.player.roomChange) {\n initialiseRoomTransition();\n game.player.roomChange = false;\n }\n }", "public void act(float delta) {\n scrollTimer = (scrollTimer + delta / 50) % 1.0f;\n scrollTimer2 = (scrollTimer2 + delta / 19) % 1.0f;\n\n backgroundSprite.setU(scrollTimer);\n backgroundSprite.setU2(scrollTimer + 0.5f);\n \n backgroundSprite2.setU(scrollTimer);\n backgroundSprite2.setU2(scrollTimer + 1.0f);\n }", "protected abstract void animate(int anim);", "public void actualizarFrame(float delta) {\n stateTime += delta;\n switch (estado) {\n case DERECHA:\n aspectoActual = (TextureRegion) animacionDerecha.getKeyFrame(stateTime, false);\n break;\n case IZQUIERDA:\n aspectoActual = (TextureRegion) animacionIzquierda.getKeyFrame(stateTime, false);\n break;\n default:\n aspectoActual = aspectoBasico;\n break;\n }\n }", "@Override\n\tpublic void update(long elapsed_time, LevelData levelData, Rectangle animation_bounds)\n\t{\n\t}", "public void animationTrans() {\n float unitAngle;\n if (type == CIRCLE) {\n unitAngle = (float) 360 / defaultCount;\n } else {\n unitAngle = 45f;\n }\n final float oldAngle = mAngle;\n float nAngle = mAngle % actualAngle;\n float gapAngle = (float) (nAngle / unitAngle) - (int) (nAngle / unitAngle);\n\n final float willAngle;\n if (type == CIRCLE) {\n willAngle = (float) ((0.5 - gapAngle) * unitAngle);\n } else {\n if (gapAngle < 0.5) {\n willAngle = (float) ((0 - gapAngle) * unitAngle);\n } else {\n willAngle = (float) ((1 - gapAngle) * unitAngle);\n }\n }\n Animation a = new Animation() {\n\n @Override\n protected void applyTransformation(float interpolatedTime, Transformation t) {\n\n mAngle = oldAngle + willAngle * interpolatedTime;\n\n requestLayout();\n }\n\n @Override\n public boolean willChangeBounds() {\n return true;\n }\n };\n\n a.setDuration(200);\n startAnimation(a);\n }", "public void update(long frameNanoDelta);", "public void update(final int delta) {\n translate(velocity.scale(delta));\n\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 update(float delta){\n\t\tfor (int i = vibrationList.size() - 1; i >= 0; i--) {\r\n\t\t\tVibration vibration = vibrationList.get(i);\r\n\t\t\tvibration.update(delta);\r\n\t\t\tif(vibration.removeMe()){\r\n\t\t\t\tvibrationList.remove(vibration);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void update(final float delta){\n AbstractGameObject.resetDrawCalls();\n \n //update cameras\n for (Camera camera : cameras) {\n if (camera.togglesChunkSwitch()) {\n //earth to right\n if (camera.getVisibleLeftBorder() <= 0)\n Controller.getMap().setCenter(3);\n else\n if (camera.getVisibleRightBorder() >= Map.getBlocksX()-1) \n Controller.getMap().setCenter(5); //earth to the left\n\n //scroll up, earth down \n if (camera.getVisibleTopBorder() <= 0)\n Controller.getMap().setCenter(1);\n else\n if (camera.getVisibleBottomBorder() >= Map.getBlocksY()-1)\n Controller.getMap().setCenter(7); //scroll down, earth up\n }\n camera.update();\n }\n \n // toggle the dev menu?\n if (keyF5isUp && Gdx.input.isKeyPressed(Keys.F5)) {\n controller.getDevTools().setVisible(!controller.getDevTools().isVisible());\n keyF5isUp = false;\n }\n keyF5isUp = !Gdx.input.isKeyPressed(Keys.F5);\n }", "@Override\r\n\tpublic void update(int delta)\r\n\t{\r\n\t\tcounter += delta;\r\n\t\twhile(counter >= interval)\r\n\t\t{\r\n\t\t\tcounter -= interval;\r\n\t\t\ttarget.act();\r\n\t\t}\r\n\t}", "public void animateMovementDown()\n {\n if(animationCount%frameRate == 0)\n {\n imageNumber = (imageNumber + 1)% (downMvt.length);\n setImage(downMvt[imageNumber]);\n } \n }", "public void update(float delta){\n\t\tposition.add(velocity.cpy().mul(delta));\n\t\tthis.bounds.setPosition(position.x, position.y);\n\t}", "public void update(float delta){\n\t//\tdebugLabel.setText(\"Delta time: \"+delta);\n\t\tfor (Actor actor: this.getActors()){\n\t\t\tif(actor instanceof CubeNod)\n\t\t\t\t((CubeNod)actor).update(delta);\n\t\t\tif(actor instanceof LogicContainer)\n\t\t\t\t((LogicContainer)actor).update(delta);\t\n\t\t}\n\t\t\t\n\t}", "@Override\n\tpublic void update(float timeDelta)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void update(float timeDelta)\n\t{\n\t\t\n\t}", "protected abstract float getFrameTimeNormalAnimation();", "@Override\r\n\tpublic void update(float dt) {\n\r\n\t}", "public void onAnimationUpdate(float fraction, T value);", "@Override\n\tpublic void update(float dt) {\n\t\t\n\t}", "public void update(float delta)\n\t{\n\t\tif (!isStarted() || isPaused() || isKilled()) return;\n\n\t\tdeltaTime = delta * speedMultiplier;\n\n\t\t// initializes once delay has been met\n\t\tif (!isInitialized)\n\t\t{\n\t\t\tinitialize();\n\t\t}\n\n\t\tif (isInitialized)\n\t\t{\n\t\t\ttestRelaunch();\n\t\t\tupdateStep();\n\t\t\ttestCompletion();\n\t\t}\n\n\t\tcurrentTime += deltaTime;\n\t\tdeltaTime = 0;\n\t}", "@Override\n public void delta() {\n \n }", "synchronized void run() {\n \n // add pending animations\n animations.addAll(addedAnims);\n addedAnims.clear();\n \n if (numberOfFrames == timeMeasureInterval) {\n startTime = System.nanoTime();\n TOL = 1.0 / getFps();\n }\n \n if (animations.size() > 0) {\n \n ArrayList<AnimationBase> delList = new ArrayList<AnimationBase>();\n \n try {\n \n for (AnimationBase a : animations) {\n \n if (a.deletionRequested()) {\n delList.add(a);\n } else {\n a.run();\n }\n \n if (a.getTime() == 1.0) {\n \n boolean deleteAnimation = a.deleteAfterExecution()\n && (a.getRepeats() >= a.getNumberOfRepeats());\n \n if (deleteAnimation) {\n delList.add(a);\n } else {\n a.reset();\n }\n }\n }\n \n for (AnimationBase a : delList) {\n removeAnimation(a);\n a.reset();\n // System.out.println(\"DEL Anim: \" + a.getClass().getName());\n }\n \n } catch (java.util.ConcurrentModificationException ex) {\n // we ignore this as the worst that can happen are unomportant\n // visual inconsistencies\n ex.printStackTrace(System.err);\n }\n \n } else {\n if (repaintThread != null) {\n repaintThread.stop();\n }\n }\n \n if (oldTime != 0 && numberOfFrames == timeMeasureInterval) {\n long diff = (startTime - oldTime) / timeMeasureInterval;\n if (diff == 0) {\n setFps(30);\n } else {\n setFps((long) 1e9 / diff);\n }\n }\n \n // don't allow 0 fps\n if (Math.abs(getFps()) < TOL){\n setFps(30);\n numberOfFrames = 0; // retrigger fps measurement\n }\n \n // System.out.println(\">> AnimationManager: Frame: \" +\n // numberOfFrames + \" FPS=\" +\n // getFps());\n \n if (isShowFPS()) {\n System.out.println(\">> AnimationManager: FPS=\" + getFps());\n }\n if (numberOfFrames == timeMeasureInterval) {\n oldTime = startTime;\n numberOfFrames = 0;\n }\n numberOfFrames++;\n }", "public abstract void animation(double seconds);", "public void update(long delta){\n \n if(placement <= -1000){\n placement = zPosition;\n }\n placement -= 5;\n \n \n }", "@Override\n\t\t\t\t\tpublic void update(float delta) {\n\t\t\t\t\t\tUpdateItem(delta);\n\t\t\t\t\t}", "@Override\n\tpublic void draw() {\n\t\tfloat delta = Gdx.graphics.getDeltaTime();\n\t\ti+= delta;\n\t\timage.setRegion(animation.getKeyFrame(i, true));\n\t\t//this.getSpriteBatch().draw(animation.getKeyFrame(i, true), 0, 0);\n\t\t\n\t\tGdx.app.log(\"tag\", \"delta = \" + i);\n\t\t\n\t\tsuper.draw();\n\t}", "public void doAnimateStep () {\n\t\tadvanceSimulation();\n\t\tpaint();\n\t}", "public void animate()\n\t{\n\t\tanimation.read();\n\t}", "public void move(int delta);", "@Override\n\tpublic void update() {\n\t\tif(!canSwoop)\n\t\tif(System.currentTimeMillis() - lastAnim >= 200){\t\n\t\t\tif(currentAnim < 2){\n\t\t\t\tcurrentAnim++;\n\t\t\t} else {\n\t\t\t\tcurrentAnim = 0;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"ANIMATING image: \" + currentAnim);\n\t\t\tlastAnim = System.currentTimeMillis();\t\t\n\t\t\t}\n\t\t\n\t\tthis.texture = Assets.shadowAnim[currentAnim];\n\t}", "public void updateRunning(float delta) {\n\n\n EntityManager.update(delta);\n playerShip.update(delta);\n EnemySpawner.update();\n particleManager.update();\n\n }", "@Override\n public void animate() {\n }", "public abstract void update(float dt);", "public abstract void update(float dt);", "public abstract void update(float dt);", "public void mo5967d() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{-((float) C1413m.f5711i.getHeight()), 0.0f}).setDuration(240);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{0.0f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f}).setDuration(240);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.0f}).setDuration(j).start();\n LinearLayout linearLayout = this.f5438qa;\n ObjectAnimator.ofFloat(linearLayout, \"translationY\", new float[]{0.0f, (float) ((linearLayout.getMeasuredHeight() - this.f5384D.getmImageViewHeight()) - C1413m.m6828a(27, this.f5389I))}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5438qa, \"alpha\", new float[]{1.0f, 0.0f}).setDuration(j).start();\n duration.addListener(new C1304Ya(this));\n }", "@Override\n public synchronized void update(int deltaTime) {\n }", "public void updatePanelWithAnimation() {\n AnimatorSet buildAnimatorSet = buildAnimatorSet(this.mLayoutView, 0.0f, (float) this.mLayoutView.findViewById(C0010R$id.panel_container).getHeight(), 1.0f, 0.0f, 200);\n ValueAnimator valueAnimator = new ValueAnimator();\n valueAnimator.setFloatValues(0.0f, 1.0f);\n buildAnimatorSet.play(valueAnimator);\n buildAnimatorSet.addListener(new AnimatorListenerAdapter() {\n /* class com.android.settings.panel.PanelFragment.AnonymousClass3 */\n\n public void onAnimationEnd(Animator animator) {\n PanelFragment.this.createPanelContent();\n }\n });\n buildAnimatorSet.start();\n }", "@Override\n\tpublic void update(float deltaTime) {\n\t\t\n\t}", "public void animate() {\n // change our angle of view\n mRenderer.setAngle(mRenderer.getAngle() + 1.2f);\n\n if (mCurrentAktieCubeLayer == null) {\n int layerID = mRandom.nextInt(9);\n mCurrentAktieCubeLayer = mAktieCubeLayers[layerID];\n mCurrentLayerPermutation = mLayerPermutations[layerID];\n mCurrentAktieCubeLayer.startAnimation();\n boolean direction = mRandom.nextBoolean();\n int count = mRandom.nextInt(3) + 1;\n\n count = 1;\n direction = false;\n mCurrentAngle = 0;\n if (direction) {\n mAngleIncrement = (float)Math.PI / 50;\n mEndAngle = mCurrentAngle + ((float)Math.PI * count) / 2f;\n } else {\n mAngleIncrement = -(float)Math.PI / 50;\n mEndAngle = mCurrentAngle - ((float)Math.PI * count) / 2f;\n }\n }\n\n mCurrentAngle += mAngleIncrement;\n\n if ((mAngleIncrement > 0f && mCurrentAngle >= mEndAngle) ||\n (mAngleIncrement < 0f && mCurrentAngle <= mEndAngle)) {\n mCurrentAktieCubeLayer.setAngle(mEndAngle);\n mCurrentAktieCubeLayer.endAnimation();\n mCurrentAktieCubeLayer = null;\n\n // adjust mPermutation based on the completed layer rotation\n int[] newPermutation = new int[27];\n for (int i = 0; i < 27; i++) {\n newPermutation[i] = mPermutation[mCurrentLayerPermutation[i]];\n }\n mPermutation = newPermutation;\n updateLayers();\n\n } else {\n mCurrentAktieCubeLayer.setAngle(mCurrentAngle);\n }\n }", "@Override\n\tpublic void update(float deltaTime) {\n\t}", "@Override\n public void act(float delta) {\n }", "public void update(float delta) {\n\t\tposition.add(1*60*delta, 1*60*delta);\r\n\t\tposition.x += 10;\r\n\t\tif(position.x >= 400) {\r\n\t\t\talive = false;\r\n\t\t}\r\n\t}", "@Override\n public void update() {\n// if (anim > 10000) anim = 0;\n// else anim++;\n setMousePossition();\n if (feildIsRightClicked()) {\n renderClicks = true;\n cannon.FireCannon();\n }\n else renderClicks = false;\n for (int i = 0; i < projectiles.size(); i++) {\n if (projectiles.get(i).isRemoved()) projectiles.remove(i);\n else projectiles.get(i).update();\n }\n }", "public void processFrame(float deltaTime);", "private void processStatesAnimation() {\n if(getState() == JUMPING_STATE || getState() == FALLING_STATE) {\n if(getDirection() == DIRECTION_RIGHT)\n setAnim(jumpingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(jumpingLeft);\n }\n\n if(getState() == NORMAL_STATE) {\n if(getDirection() == DIRECTION_STOPPED_RIGHT)\n setAnim(standingRight);\n else if(getDirection() == DIRECTION_STOPPED_LEFT)\n setAnim(standingLeft);\n else if(getDirection() == DIRECTION_RIGHT)\n setAnim(walkingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(walkingLeft);\n }\n\n if(getState() == DYING_STATE) \n setAnim(dying);\n }", "public void mo5964b() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{0.0f, 0.3f, 0.5f, 0.7f, 0.9f, 1.0f}).setDuration(j).start();\n this.f5438qa.getMeasuredHeight();\n this.f5384D.getmImageViewHeight();\n C1413m.m6828a(27, this.f5389I);\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n this.f5384D.getmImageView().setImageResource(R.drawable.iqoo_buttonanimation);\n this.f5393M = (AnimationDrawable) this.f5384D.getmImageView().getDrawable();\n this.f5393M.start();\n duration.addListener(new C1300Wa(this));\n }", "public void render(float delta){\n guiStage.act(delta);\n guiStage.draw();\n }", "protected void updateTime(float deltaTime) {\n }", "public void update(double delta) {\r\n \tVector3f playerDistance = transform.getPosition().sub(Level.getPlayer().getCamera().getPos());\r\n Vector3f orientation = playerDistance.normalized();\r\n\t\tfloat distance = playerDistance.length();\r\n\t\tsetDistance(distance + (int) (POP_IN/PARTICLES_POP_IN));\r\n\t\t\r\n if (state == STATE_FIRE) {\r\n float angle = (float) Math.toDegrees(Math.atan(orientation.getZ() / orientation.getX()));\r\n\r\n if (orientation.getX() > 0)\r\n angle = 180 + angle;\r\n\r\n transform.setRotation(0, angle + 90, 0);\r\n temp = delta;\r\n light.setPosition(transform.getPosition());\r\n light.setPosition(new Vector3f(light.getPosition().getX(), 0.05f * (float)(Math.sin(temp*2.5)+1.0/2.0) + 0.45f, light.getPosition().getZ()));\r\n \r\n double time = Time.getTime();\r\n double timeDecimals = (time - (double) ((int) time));\r\n timeDecimals *= 12.1f;\r\n \r\n if (timeDecimals <= 0.25f) {\r\n material.setDiffuse(animation.get(0));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 0.5f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 0.75f) {\r\n material.setDiffuse(animation.get(2));\r\n } else if (timeDecimals <= 1f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 1.25f) {\r\n material.setDiffuse(animation.get(4));\r\n } else if (timeDecimals <= 1.5f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 1.75f) {\r\n material.setDiffuse(animation.get(6));\r\n } else if (timeDecimals <= 2f) {\r\n material.setDiffuse(animation.get(7));\r\n } else if (timeDecimals <= 2.25f) {\r\n material.setDiffuse(animation.get(6));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 2.5f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 2.75f) {\r\n material.setDiffuse(animation.get(4));\r\n } else if (timeDecimals <= 3f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 3.25f) {\r\n material.setDiffuse(animation.get(2));\r\n } else if (timeDecimals <= 3.5f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 3.75f) {\r\n material.setDiffuse(animation.get(0));\r\n } else if (timeDecimals <= 4f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 4.25f) {\r\n material.setDiffuse(animation.get(2));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 4.5f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 4.75f) {\r\n material.setDiffuse(animation.get(4));\r\n } else if (timeDecimals <= 5f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 5.25f) {\r\n material.setDiffuse(animation.get(6));\r\n } else if (timeDecimals <= 5.5f) {\r\n material.setDiffuse(animation.get(7));\r\n } else if (timeDecimals <= 5.75f) {\r\n material.setDiffuse(animation.get(0));\r\n } else if (timeDecimals <= 6f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 6.25f) {\r\n material.setDiffuse(animation.get(2));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 6.5f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 6.75f) {\r\n material.setDiffuse(animation.get(4));\r\n } else if (timeDecimals <= 7f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 7.25f) {\r\n material.setDiffuse(animation.get(6));\r\n } else if (timeDecimals <= 7.5f) {\r\n material.setDiffuse(animation.get(7));\r\n } else if (timeDecimals <= 7.75f) {\r\n material.setDiffuse(animation.get(6));\r\n } else if (timeDecimals <= 8f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 8.25f) {\r\n material.setDiffuse(animation.get(4));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 8.5f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 8.75f) {\r\n material.setDiffuse(animation.get(2));\r\n } else if (timeDecimals <= 9f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 9.25f) {\r\n material.setDiffuse(animation.get(0));\r\n } else if (timeDecimals <= 9.5f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 9.75f) {\r\n material.setDiffuse(animation.get(2));\r\n } else if (timeDecimals <= 10f) {\r\n material.setDiffuse(animation.get(3));\r\n } else if (timeDecimals <= 10.25f) {\r\n material.setDiffuse(animation.get(4));\r\n if(transform.getPosition().sub(Level.getPlayer().getCamera().getPos()).length() < 1.0f && !Level.getPlayer().isShooting) {\r\n \t\t\tif(Level.getPlayer().isArmor() == false)\r\n \t\t\t\tLevel.getPlayer().addHealth((int) -DAMAGE/2, \"FIRE\");\r\n \telse\r\n \t\tLevel.getPlayer().addArmor((int) -DAMAGE/2);\r\n \t\t}\r\n if(Auschwitz.getLevel().getShootingObjective() != null)\r\n \t if(getTransform().getPosition().sub(Auschwitz.getLevel().getShootingObjective().getTransform().getPosition()).length() < 1.0f)\r\n \t \tAuschwitz.getLevel().getShootingObjective().damage(DAMAGE);\r\n } else if (timeDecimals <= 10.5f) {\r\n material.setDiffuse(animation.get(5));\r\n } else if (timeDecimals <= 10.75f) {\r\n material.setDiffuse(animation.get(6));\r\n } else if (timeDecimals <= 11f) {\r\n material.setDiffuse(animation.get(7));\r\n } else if (timeDecimals <= 11.25f) {\r\n material.setDiffuse(animation.get(0));\r\n } else if (timeDecimals <= 11.5f) {\r\n material.setDiffuse(animation.get(1));\r\n } else if (timeDecimals <= 11.75f) {\r\n material.setDiffuse(animation.get(2));\r\n } else if (timeDecimals <= 12f) {\r\n material.setDiffuse(animation.get(3));\r\n } else {\r\n state = STATE_DONE;\r\n }\r\n }\r\n \r\n if(state == STATE_DONE) {\r\n \tlight.removeToEngine();\r\n \tfireSound.stop();\r\n \tLevel.removeFire(this);\r\n }\r\n\r\n }", "@Override\n public void update(float delta) {\n for (Map.Entry<Integer, IComponent> kv : _affectedComponents.get(0).entrySet()) {\n int id = kv.getKey();\n SpriteComponent sprite = (SpriteComponent) kv.getValue();\n PositionComponent position = (PositionComponent) _affectedComponents.get(1).get(id);\n sprite.setPosition(position.getX(), position.getY());\n }\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n if (e.getSource() instanceof Timer) {\r\n if (animatedPos == canvas.size() - 1)\r\n animatedDir = -1;\r\n if (animatedPos == 0)\r\n animatedDir = 1;\r\n animatedPos += animatedDir;\r\n repaint();\r\n }\r\n }", "public void mo5969f() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n duration.addListener(new C1298Va(this));\n }", "public boolean update(float delta){\n controller.update(delta);\n return false;\n }", "public void animate() {\n\t\t\n\t\t// already exploded\n\t\tif (disabled > explodeTime) {\n\t\t\treturn;\n\t\t} // if\n\n\t\t// exploding now\n\t\tif (disabled > 0) {\n\t\t\tsphere.explode();\n\t\t\tdisabled++;\n\t\t\treturn;\n\t\t} // if\n\t\t\n\t\t// move sphere and this\n\t\tlocation.add(movement);\n\t\tsphere.move(movement);\n\t\t\n\t\t// bounce back if too far out\n\t\tif(location.distance(new Tuple(0, 0, 0)) > FIELD_SIZE) {\n\t\t\tmovement.scale(-1, -1, -1);\n\t\t} // if\n\t}", "public void runAnimations() {\n double currentTime = timeService.currentTime();\n double delta = currentTime - previousTime;\n\n List<Animation> initializeList = new ArrayList<>(animationsToInitialize);\n for (Animation animation : initializeList) {\n animation.initialize();\n animationsToInitialize.remove(animation);\n animations.add(animation);\n }\n\n List<Animation> processList = new ArrayList<>(animations);\n for (Animation animation : processList) {\n if (animationsToRemove.contains(animation)) {\n animationsToRemove.remove(animation);\n animations.remove(animation);\n animationsToDestroy.add(animation);\n } else if (animation.animate(delta)) {\n animations.remove(animation);\n animationsToDestroy.add(animation);\n }\n }\n\n List<Animation> destroyList = new ArrayList<>(animationsToDestroy);\n for (Animation animation : destroyList) {\n animation.destroy();\n animationsToDestroy.remove(animation);\n }\n\n previousTime = currentTime;\n }", "@Override\n public void update() {\n animate();\n if (alive == false) {\n afterKill();\n return;\n }\n if (alive) {\n calculateMove();\n }\n }", "int getDelta();", "public void apply(int time, float delta)\n {\n //Figure out what step we are on based on time\n AnimationStep currentStep = first.nextStep;\n int count = 0;\n while (currentStep != first)\n {\n //Count duration of each step\n count += currentStep.duraction;\n\n //If time is less than count, then step is current step to run\n if (time < count)\n {\n //Get start of step\n int start = count - currentStep.duraction;\n\n //Get amount of time already used\n int progress = time - start;\n\n //Trigger\n currentStep.apply(renderer, progress, delta);\n\n //Exit\n break;\n }\n currentStep = currentStep.nextStep;\n }\n\n //Track previous rotation\n prev_rotateAngleX = renderer.rotateAngleX;\n prev_rotateAngleY = renderer.rotateAngleY;\n prev_rotateAngleZ = renderer.rotateAngleZ;\n }", "public void update() {\r\n\t\tdiffuse();\r\n\t\tdecay();\r\n\t}", "private void updateAndRender(long deltaMillis) {\n currentState.update(deltaMillis / 1000f); \r\n //Double Buffering (reduce tearing)\r\n prepareGameImage();\r\n currentState.render(gameImage.getGraphics(), this.getWidth(), this.getHeight());\r\n renderGameImage(getGraphics());\r\n }", "public void setDelta(float delta) {\n\t\tthis.delta = delta;\n\t}", "@Override public void onAnimationRepeat(Animator arg0) {\n\n }", "@Override\n\tpublic boolean update(Animations obj) {\n\t\treturn false;\n\t}", "public abstract void update(GameContainer gc, float dt);", "public void update(float dt) {\n\t\tIterator<Alien> iter = aliens.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tAlien alien = iter.next();\n\t\t\t\n\t\t\talien.setY(alien.getY() + alien.v * dt);\n\t\t\tif(alien.getY() > 480 - alien_size) iter.remove();\n\t\t}\n\t}", "@Override\n\tpublic void onUpdate(float dt) {\n\t}", "public void update(float delta)\n {\n\n x = acceleration.x;\n y = acceleration.y;\n x = x * delta; //to scale by frame rate to keep things smooth\n y = y * delta;\n\n velocity.add(x, y); //sets new velocity\n\n if(velocity.y >350)\n {\n velocity.y = 350;\n //Gdx.app.log(\"Block\", \"MAX SPEED\");\n }\n\n x = velocity.x;\n y = velocity.y;\n x = x * delta;\n y = y * delta;\n\n position.add(x,y); //sets new position\n\n //position.add(velocity.cpy().scl(delta));\n\n rect.set(position.x, position.y, width,height);\n\n if(position.y > gameHeight) //determine if object is still on screen\n {\n isScrolled = true;\n }\n }", "public void update(float dt){\n\t\tresultSprite.update(dt);\n\t\tnewRound.update(dt);\n\t\tbackMenu.update(dt);\n\t}", "public void move(float deltaTime) {\n }", "private void updateKeyframes() {\n keyframes.clear();\n ArrayList<IMotion> motions = new ArrayList<>(shape.getMotions());\n\n if (motions.size() > 0) {\n IMotion start = motions.get(0);\n keyframes.add(start.getIntermediateState(start.getStartTime()));\n }\n\n for (IMotion motion : motions) {\n IState keyframe = motion.getIntermediateState(motion.getEndTime());\n\n if (!keyframes.contains(keyframe)) {\n keyframes.add(keyframe);\n }\n }\n }", "public void render(float delta){\n states.peek().render(delta);\n }", "public void update(Input input, int delta) {\n\t}", "public int delta()\r\n\t{\r\n\t\treturn smooth ? (resolution / fps) : duration;\r\n\t}", "public void animateMovementUp()\n {\n if(animationCount%frameRate == 0)\n {\n imageNumber = (imageNumber + 1)% (upMvt.length);\n setImage(upMvt[imageNumber]);\n } \n }", "@Override\n public void onAnimationUpdate(ValueAnimator animator)\n {\n\t\tcents = UiController.test * 10.0;\n\n\t\tinvalidate();\n }", "public void update(double delta, Game game){\n\t\tListIterator<Behaviour> bit = behaviour.listIterator(0);\n\t\twhile(bit.hasNext()){Behaviour b = bit.next(); b.update(game, getPos(), delta); if(b.disposable()) bit.remove();}\n\t}", "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 }", "public void run()\n {\n // Remember the starting time\n long tm = System.currentTimeMillis();\n while (Thread.currentThread() == animator)\n {\n // Display the next frame of animation.\n update();\n try\n {\n tm += delay;\n Thread.sleep(Math.max(0, tm - System.currentTimeMillis()));\n }\n catch (InterruptedException e)\n {\n break;\n }\n // Advance the frame\n frame++;\n }\n }", "public void update(double delta){\n \tthis.av.update();\n \t\n \t//checar� a cada update se haver� colis�o\n \tfor(int i=0;i<10;i++){\n \t\t//se houver colis�o entre Avatar e os lixos normais, ser�o acrescidos 10 pontos ao player\n\t\t\tif(this.lixo[i].collision(av, lixo[i])){\n\t\t\t\tScorePanel.score += 10;\n\t\t\t}\n\t\t}\n \t\n \t//Checa se todos os lixos Foram coletados\n<<<<<<< HEAD\n \tif(ScorePanel.getScore() == 100 && telaConcluida == false){\n \t\ttelaConcluida = true;\n \t\t//JOptionPane.showMessageDialog(null, \"Fase 1 conclu�da!!!\");\n \t\t//ScorePanel.setScoreToZero();\n=======\n \tif(Garbage.getScore() == 100){\n \t\tJOptionPane.showMessageDialog(null, \"Fase 1 conclu�da!!!\");\n \t\tGarbage.setScoreToZero();\n>>>>>>> c1516bff6596a16ab28a02b04aa726b8350d9899\n \t}\n \t\n \t//se houver colis�o entre Avatar e o lixo especial, ser�o acrescidos 10 segundos a mais para o player\n \tif(lixoEspecial.collision(av, lixoEspecial)){\n \t\tTimerGameplay.tempo += 10; \n \t}\n }\n \n //atualiza renderização\n public void draw(){\n \tthis.repaint();\n }\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t/*/limites do campo e coordenadas\n\t\tSystem.out.println(\"ACTION EVENT\");\n\t\t\n\t\tif(this.av.x<0){\n\t\t\tthis.av.vx = 0;\n\t\t\tthis.av.x = 0;\n\t\t}\n\t\t\n\t\tif(this.av.x> 800){\n\t\t\tthis.av.vx = 0;\n\t\t\tthis.av.x = 800;\n\t\t}\n\t\t\n\t\tif(this.av.y<0){\n\t\t\tthis.av.vy = 0;\n\t\t\tthis.av.y = 0;\n\t\t}\n\t\t\n\t\tif(this.av.y> 570){\n\t\t\tthis.av.vy = 0;\n\t\t\tthis.av.y = 570;\n\t\t}\n\t\tthis.av.x = this.av.x + this.av.vx;\n\t\tthis.av.y = this.av.y + this.av.vy;\n\t\t\n\t\t//repaint();//*/\n\t}//*/\n\n\t@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tthis.av.keyPressed(e);\n\t}\n\n\t@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tthis.av.keyReleased(e);\n\t}\n\n\t@Override\n\tpublic void keyTyped(KeyEvent e) {}", "public void update(float delta) {\n worldStep += 1;\n performStep(worldStep);\n\n engine.update(delta);\n }" ]
[ "0.7171106", "0.7108185", "0.7026888", "0.7023473", "0.70214504", "0.70214504", "0.6966541", "0.68430793", "0.6772896", "0.67559534", "0.66441005", "0.6637664", "0.6636675", "0.6636675", "0.6636675", "0.6636014", "0.66101664", "0.65592456", "0.6556215", "0.6527714", "0.65218455", "0.6500201", "0.64830834", "0.6433415", "0.6430399", "0.63885933", "0.63657784", "0.6361753", "0.6341559", "0.6333831", "0.632689", "0.63044536", "0.6302436", "0.62951946", "0.62951946", "0.6294513", "0.6277305", "0.6271329", "0.6265992", "0.624072", "0.6235228", "0.62222165", "0.62162167", "0.62087655", "0.6202761", "0.61787665", "0.61741346", "0.6169331", "0.6155149", "0.6153075", "0.6148038", "0.613728", "0.6137255", "0.6137255", "0.6137255", "0.61301166", "0.61054134", "0.60836446", "0.60755557", "0.6074628", "0.60733694", "0.60601497", "0.60380554", "0.6036417", "0.6027713", "0.6025319", "0.60172015", "0.59991264", "0.5998325", "0.5994725", "0.59694856", "0.5966992", "0.5965823", "0.5954493", "0.5938372", "0.5932622", "0.59319586", "0.59271485", "0.59112406", "0.5906338", "0.590212", "0.590168", "0.589606", "0.5891593", "0.5889356", "0.5889221", "0.58849", "0.58776224", "0.5873532", "0.58733964", "0.58697593", "0.5867272", "0.5857174", "0.58567506", "0.5856741", "0.5848386", "0.58478737", "0.58457756", "0.58214176", "0.5820482", "0.58166903" ]
0.0
-1
/ Drawing based on state
@Override public void render(SpriteBatch batch) { if (player.getState() == PlayerState.JUMPING) { playerCurrentFrame = jumpingAnim.getKeyFrame(jumpingStateTime, false); } else if (player.getState() == PlayerState.WALKING) { playerCurrentFrame = walkingAnim.getKeyFrame(walkingStateTime, false); } else { playerCurrentFrame = walkingAnim.getKeyFrame(0, false); } /* Flipping based on direction */ if (player.getDirection() == 0) { playerCurrentFrame.flip(true, false); } batch.draw(playerCurrentFrame, player.getX(), player.getY()); if (playerCurrentFrame.isFlipX()) { playerCurrentFrame.flip(true, false); // Reset flip } /* Drawing collisions */ if (CurrentSettings.getInstance().showCollisions) { batch.end(); shapeRenderer.begin(ShapeType.Line); shapeRenderer.setProjectionMatrix(batch.getProjectionMatrix()); shapeRenderer.setColor(.5f, .5f, .5f, 1f); shapeRenderer.rect(player.getCollisionBounds().x, player.getCollisionBounds().y, player.getCollisionBounds().width, player.getCollisionBounds().height); shapeRenderer.end(); batch.begin(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void draw() {\n \n // TODO\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "public void draw()\r\n {\r\n drawn = true;\r\n }", "public void draw() {\n \n }", "protected abstract void draw();", "public void draw() {\n switch(state) {\n case MENU:\n background(0, 0, 0);\n startMenu();\n break;\n case CREATE_PLAYER:\n frameRate(20);\n createPlayer();\n break;\n case PLAY_GAME:\n frameRate(framerate);\n playGame();\n break;\n }\n}", "public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}", "public void draw() {\n\t\tsuper.repaint();\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "public void draw() {\n }", "void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}", "@Override\r\n public void draw() {\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n public void updateDrawState(TextPaint ds) {\n }", "@Override\n\tprotected void draw() {\n\t\tif(p != null) {\n\t\t\tp.pushStyle();\n\t\t\tp.noStroke();\n\t\t\tp.textAlign(PApplet.CENTER,PApplet.CENTER);\n\t\t\tp.textSize(12);\n\t\t\tif(this.isPressed) {\n\t\t\t\tp.fill(122, 138, 153);\n\t\t\t\tp.rect(x,y,width,height);\n\t\t\t\tp.fill(181, 206, 228);\n\t\t\t\tp.rect(x+2,y+2,width-4,height-4);\n\t\t\t\tp.fill(Color.BLACK.getRGB());\n\t\t\t\tp.text(text, x, y,width,height);\n\t\t\t}else {\n\t\t\t\tif(this.isHovered) {\n\t\t\t\t\tthis.p.fill(122, 138, 153);\n\t\t\t\t\tthis.p.rect(x, y, width, height);\n\t\t\t\t\tsetGradient(x+2,y+2,width-5,height-5,new Color(255,255,255),new Color(190, 211, 231));\n\t\t\t\t\tthis.p.fill(Color.BLACK.getRGB());\n\t\t\t\t\tthis.p.text(text, x, y,width,height);\n\t\t\t\t}else {\n\t\t\t\t\tthis.p.fill(122, 138, 153);\n\t\t\t\t\tthis.p.rect(x, y, width, height);\n\t\t\t\t\tsetGradient(x+1,y+1,width-3,height-3,new Color(255,255,255),new Color(190, 211, 231));\n\t\t\t\t\tthis.p.fill(Color.BLACK.getRGB());\n\t\t\t\t\tthis.p.text(text, x, y,width,height);\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.popStyle();\n\t\t}\n\t}", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "private void draw() {\n gsm.draw(g);\n }", "@Override\n\tpublic void drawPoint(MouseEvent e, int state) {\n\n\t}", "public void draw(){\n }", "@Override\n\tpublic void draw() {\n\t}", "public void draw() {\r\n if(isVisible()) {\r\n Canvas canvas = Canvas.getCanvas();\r\n canvas.draw(this,getColor(),\r\n new Rectangle(\r\n (int)round(getXposition()),\r\n (int)round(getYposition()),\r\n (int)round(size),\r\n (int)round(size)));\r\n canvas.wait(10);\r\n }\r\n }", "public void draw();", "public void draw();", "public void draw();", "@Override\n public void draw()\n {\n }", "public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }", "@Override\n public void draw() {\n }", "public void draw() {\n\n }", "public void render() {\r\n Color geneColor=null;\r\n\r\n if(isChanged) {\r\n this.removeChild(predRect);\r\n predRect = new PPath();\r\n\r\n if(type == SegmentInfo.TYPE_AUTO) predRect.setPathTo(new RoundRectangle2D.Double(startx,0.0,endx - startx,(double)this.PREDICTION_RECT_HEIGHT, 10, 10));\r\n else if(type == SegmentInfo.TYPE_MANUAL) predRect.setPathTo(new RoundRectangle2D.Double(startx,0.0,endx - startx,(double)this.PREDICTION_RECT_HEIGHT, 0, 0));\r\n\r\n if(this.isSelected()) {\r\n if(this.sign < 0) geneColor = this.SELECTED_DOWN_COLOR;\r\n else geneColor = this.SELECTED_UP_COLOR;\r\n }\r\n else {\r\n if(this.sign < 0) geneColor = this.DOWN_COLOR;\r\n else geneColor = this.UP_COLOR;\r\n }\r\n\r\n predRect.setPaint(geneColor);\r\n this.addChild(predRect);\r\n isChanged=false;\r\n }\r\n }", "void updateDrawing() {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n }", "public abstract void draw( );", "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\r\n\t\t\t//door\r\n\t\t\tpen.setColor(Color.blue);\r\n\t\t\tpen.setWidth(10);\r\n\t\t\tpen.move(50,0);\r\n\t\t\tpen.move(50,100);\r\n\t\t\tpen.move(-50,100);\r\n\t\t\tpen.move(-50,0);\r\n\t\t\tpen.move(0,0);\r\n\r\n\t\t\t//windows\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(-150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\r\n\t\t\t//extra\r\n\t\t\tpen.move(-45,120);\r\n\t\t\tpen.down();\r\n\t\t\tpen.setColor(Color.black);\r\n\t\t\tpen.drawString(\"This is a house\");\r\n\t}", "public void draw() {\n\t\t\r\n\t\tSystem.out.println(\"drawing...\");\r\n\t\t\r\n\t}", "public void draw(){\n if (! this.isFinished() ){\n UI.setColor(this.color);\n double left = this.xPos-this.radius;\n double top = GROUND-this.ht-this.radius;\n UI.fillOval(left, top, this.radius*2, this.radius*2);\n }\n }", "protected abstract void saveGraphicsState();", "abstract void draw();", "abstract void draw();", "public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}", "public Shapes draw ( );", "public void draw() \r\n\t{\r\n\t\tdraw(root, new RectHV(0,0,1,1) );\r\n\t}", "void render() {\n\t\tif (!dragLock)\n\t\t\tfucusLocks();\n\n\t\t// display help information\n\t\tString selected = isSelected ? \" [selected]\" : \"\";\n\t\tmyParent.text(id + selected, anchor.x + 10, anchor.y);\n\n\t\t// display points and lines with their colourings\n\t\tfor (int i = 0; i < amount; i++) {\n\n\t\t\tpoint[i].render();\n\n\t\t\tif (state == State.DRAG_AREA)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\n\t\t\tline[i].draw();\n\n\t\t}\n\n\t\t// display rotation ellipse in anchor position\n\t\tif (state == State.ROTATE && isSelected) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.ellipse(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display drag area rectangle in anchor position\n\t\tif (state == State.DRAG_AREA) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.rect(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display anchor point\n\t\tmyParent.rect(anchor.x, anchor.y, 5, 5);\n\n\t\t// display line centres\n\t\tmyParent.noFill();\n\t\tmyParent.stroke(150);\n\t\tmyParent.rectMode(PConstants.CENTER);\n\t\tmyParent.rect(X.x, X.y, 5, 5);\n\t\tmyParent.rect(Y.x, Y.y, 5, 5);\n\t\tmyParent.rect(Z.x, Z.y, 5, 5);\n\t\tmyParent.rect(Q.x, Q.y, 5, 5);\n\t}", "public void draw(){\n\t\tcomponent.draw();\r\n\t}", "public void stateChanged(ChangeEvent e){\n\r\n repaint(); // at the moment we're being pretty crude with this, redrawing all the shapes\r\n\r\n\r\n\r\n if (fDeriverDocument!=null) // if this drawing has a journal, set it for saving\r\n fDeriverDocument.setDirty(true);\r\n\r\n\r\n\r\n }", "public abstract void draw();", "public abstract void draw();", "public abstract void draw();", "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 draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "void draw();", "public void draw() {\n draw(root, true);\n }", "void draw() {\n scsw.draw();\n \n}", "private void drawPanelMouseClicked(java.awt.event.MouseEvent evt) {\n System.out.println(evt.getX() + \", \" + evt.getY());\n \n out:\n for (int i = 0; i < xcount; i++) {\n for (int j = 0; j < ycount; j++) {\n RectangularShape shape = Shapes[i][j];\n if (shape.contains(evt.getPoint())) {\n changeState(Shapes, States, i, j);\n \n shapesList.set(Slidercnt, Shapes);\n statesList.set(Slidercnt, States);\n \n break out;\n }\n }\n }\n \n this.repaint();\n \n }", "boolean isDrawState()\n\t{\n\t\treturn !state.contains(0);\n\t}", "@Override\r\n\tpublic void draw() {\r\n\t\t//Set the background to dark grey\r\n\t\tbackground(50, 50, 50);\t\r\n\t\t//If the current state is processing, display text explaining this\r\n\t\tif (this.currentGameState == DisplayStates.PROCESSING) {\r\n\t\t\ttext(\"Processing, please wait...\", 30, 340); \r\n\t\t} else { //Otherwise, the grid should be drawn in it's current state\r\n\t\t\tthis.zoomer.transform(); //Transform the zoom based on user input\r\n\t\t\t//Get the cells in their current state\r\n\t\t\tthis.gridCells = this.world.getCells(); \r\n\t\t\t//Work out which size images to use.\r\n\t\t\tupdateImageScale();\r\n\t\t\t//Draw the images to the sketch based on the current scale\r\n\t\t\tif (this.currentImageScale == ImageDrawScales.LARGE) {\r\n\t\t\t\tdrawImages(LARGE_IMAGE, this.gridCells);\r\n\t\t\t} else if (this.currentImageScale == ImageDrawScales.MEDIUM) {\r\n\t\t\t\tdrawImages(MEDIUM_IMAGE, this.gridCells);\r\n\t\t\t} else {\r\n\t\t\t\tdrawImages(SMALL_IMAGE, this.gridCells);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawOn(Graphics g);", "public void draw() {\n draw(root, false);\n }", "public void beginDrawing();", "public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}", "void reDraw();", "@Override\n\tpublic void draw(Graphics g) {\n\t\tsuper.draw(g);\n\t\tif(!satillite){\n\t\t\tdrawTrace(g);\n\t\t}\n\t\t\n \t\tmove();\n\t}", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "public void drawSelector(int x) {\n int currentTime = millis() / 100;\n noStroke();\n if (currentTime % 13 == 0) {\n fill(200, 200, 100, 30);\n }\n else if (currentTime % 13 == 1) {\n fill(200, 200, 100, 40);\n }\n else if (currentTime % 13 == 2) {\n fill(200, 200, 100, 50);\n }\n else if (currentTime % 13 == 3) {\n fill(200, 200, 100, 60);\n }\n else if (currentTime % 13 == 4) {\n fill(200, 200, 100, 70);\n }\n else if (currentTime % 13 == 5) {\n fill(200, 200, 100, 80);\n }\n else if (currentTime % 13 == 6) {\n fill(200, 200, 100, 90);\n }\n else if (currentTime % 13 == 7) {\n fill(200, 200, 100, 100);\n }\n else if (currentTime % 13 == 8) {\n fill(200, 200, 100, 110);\n }\n else if (currentTime % 13 == 9) {\n fill(200, 200, 100, 120);\n }\n else if (currentTime % 13 == 10) {\n fill(200, 200, 100, 130);\n }\n else if (currentTime % 13 == 11) {\n fill(200, 200, 100, 140);\n }\n else if (currentTime % 13 == 12) {\n fill(200, 200, 100, 150);\n }\n else {\n fill(255, 200, 100);\n }\n switch(x){\n case 1:\n beginShape();\n vertex(80, 330);\n vertex(50, 360);\n vertex(80, 350);\n vertex(110, 360);\n endShape();\n break;\n case 2:\n beginShape();\n vertex(370, 330);\n vertex(340, 360);\n vertex(370, 350);\n vertex(400, 360);\n endShape();\n break;\n case 3:\n beginShape();\n vertex(80, 600);\n vertex(50, 630);\n vertex(80, 620);\n vertex(110, 630);\n endShape();\n break;\n case 4:\n beginShape();\n vertex(370, 600);\n vertex(340, 630);\n vertex(370, 620);\n vertex(400, 630);\n endShape();\n break;\n }\n\n}", "public void show() {\r\n\t\tif ((polygon.npoints > 1)\r\n\t\t\t\t&& ((polygon.xpoints[0] != polygon.xpoints[1]) || (polygon.ypoints[0] != polygon.ypoints[1]))) {\r\n\t\t\tGraphics2D gr = (Graphics2D) graphics;\r\n\t\t\tgr.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n\t\t\t\t\tRenderingHints.VALUE_ANTIALIAS_ON);\r\n\t\t\tgr.setPaint(colorPar.getDevColor());\r\n\t\t\tgr.setStroke(new BasicStroke((float) lineWidth));\r\n\t\t\tPolygon p = isTransformed ? transformed() : polygon;\r\n\t\t\tGeneralPath gp = new GeneralPath();\r\n\t\t\tgp.moveTo((float) (p.xpoints[0]), (float) (p.ypoints[0]));\r\n\t\t\tfor (int i = 1; i < p.npoints; i++) {\r\n\t\t\t\tgp.lineTo((float) (p.xpoints[i]), (float) (p.ypoints[i]));\r\n\t\t\t}\r\n\t\t\tgr.draw(gp);\r\n\t\t\tif (validBounds) {\r\n\t\t\t\tsetBounds(gp.getBounds());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.BLACK);\n for(int j = 0 ; j < 3 ; j++) {\n \tg.drawRect(0,50*j, 120, 50);\n }\n \n if(super.selected) {\n\t\t\tg.fillRect(super.north_port.x, super.north_port.y, super.connection_port_width ,super.connection_port_width);\n\t g.fillRect(super.east_port.x-super.connection_port_width, super.east_port.y, super.connection_port_width,super.connection_port_width);\n\t g.fillRect(super.south_port.x, super.south_port.y-super.connection_port_width ,super.connection_port_width,super.connection_port_width);\n\t g.fillRect(super.west_port.x, super.west_port.y, super.connection_port_width,super.connection_port_width);\n\t\t}\n \t\n \n }", "public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}", "public void setDrawn(boolean b);", "public void draw()\n {\n myPencil.up();\n myPencil.backward(100);\n myPencil.down();\n myPencil.turnRight(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(400);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n // Roof\n myPencil.up();\n myPencil.move(0,200);\n myPencil.down();\n myPencil.setDirection(333.435);\n myPencil.forward(223.607);\n myPencil.setColor(new Color(2, 0, 0));\n myPencil.up();\n myPencil.move(0,200);\n myPencil.setDirection(206.565);\n myPencil.down();\n myPencil.forward(223.607);\n // Windows\n myPencil.up();\n myPencil.move(-150,0);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(75,0);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(-50,-100);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(100);\n myPencil.turnLeft(90);\n myPencil.forward(50);\n myPencil.turnLeft(90);\n myPencil.forward(100);\n myPencil.up();\n myPencil.move(-50,-100);\n myPencil.setDirection(60);\n myPencil.down();\n myPencil.backward(150);\n myPencil.up();\n myPencil.move(50,-100);\n myPencil.setDirection(120);\n myPencil.down();\n myPencil.backward(150);\n myPencil.up();\n myPencil.move(150,-150);\n myPencil.down();\n myPencil.drawCircle(25);\n myPencil.up();\n myPencil.move(-150,-150);\n myPencil.down();\n myPencil.drawCircle(25);\n myPencil.up();\n myPencil.move(-150,-175);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.backward(20);\n myPencil.up();\n myPencil.move(150,-175);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.backward(20);\n myPencil.up();\n myPencil.move(-150,37.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(75,37.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(-112.5,0);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(112.5,0);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.forward(75);\n // House Sidewalk\n myPencil.up();\n myPencil.move(-250,-112.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(192.5);\n myPencil.up();\n myPencil.move(250,-112.5);\n myPencil.setDirection(180);\n myPencil.down();\n myPencil.forward(192.5);\n myPencil.up();\n myPencil.move(-250,-100);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(90);\n myPencil.forward(193);\n myPencil.up();\n myPencil.move(250,-100);\n myPencil.setDirection(180);\n myPencil.down();\n myPencil.forward(90);\n myPencil.up();\n myPencil.move(-75,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-100,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-125,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-150,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-175,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-200,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-225,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-250,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(75,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(100,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(125,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(150,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(175,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(200,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(225,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(250,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n // Chimney\n myPencil.up();\n myPencil.move(125,190);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(52);\n myPencil.up();\n myPencil.move(100,190);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(40);\n myPencil.up();\n myPencil.move(100,190);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(25);\n // Door window\n myPencil.up();\n myPencil.move(0,-25);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.drawCircle(8);\n myPencil.up();\n myPencil.move(-8,-25);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(16);\n myPencil.up();\n myPencil.move(0,-17);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(16);\n // Door knob\n myPencil.up();\n myPencil.move(14,-55);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.drawCircle(2);\n }", "public void draw() {\n draw(this.root, new RectHV(0.0, 0.0, 1.0, 1.0));\n }", "void draw(IViewShapes shape);", "protected void drawImpl()\n {\n if (mode == 2) {\n // Invader\n background(0);\n noStroke();\n int triangleXDensity = 32;\n int triangleYDensity = 18;\n for (int i = 0; i < triangleXDensity + 100; i++) {\n for (int j = 0; j < triangleYDensity + 100; j++) {\n float value = scaledBandLevels[(i % scaledBandLevels.length)];\n float shapeSize = map(value, 0, 255, 0, 150);\n int currentX = (width/triangleXDensity) * i;\n int currentY = (int)(((height/triangleYDensity) * j));\n\n if (subMode == 1) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 3));\n }\n else if (subMode == 3) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 6));\n }\n\n if (subMode == 4) {\n shapeSize = map(value, 0, 255, 0, 500);\n }\n\n if ((i + j) % (int)random(1,5) == 0) {\n fill(0, 255, 255);\n }\n else {\n fill(234,100,255);\n }\n pushMatrix();\n if (subMode == 2) {\n translate(width/2, height/2);\n rotate(radians(frameCount % value * 2));\n translate(-width/2, -height/2);\n }\n triangle(currentX, currentY - shapeSize/2, currentX - shapeSize/2, currentY + shapeSize/2, currentX + shapeSize/2, currentY + shapeSize/2);\n popMatrix();\n }\n }\n\n }\n else if (mode == 5) {\n // Mirror Ball\n background(0);\n translate(width/2, height/2, 500);\n noStroke();\n if (subMode == 0) {\n rotateY(frameCount * PI/800);\n }\n else if (subMode == 1 || subMode == 2) {\n rotateY(frameCount * PI/800);\n rotateX(frameCount * PI/100);\n }\n else if (subMode == 3) {\n rotateY(frameCount * PI/400);\n }\n\n for (int i = 0; i < 100; i++) {\n for (int j = 0; j < 100; j++) {\n rotateY((2*PI/200) * j);\n pushMatrix();\n rotateX((2*PI/200) * i);\n translate(0,200);\n if (j > 50 && j < 150) {\n rotateX(PI/2);\n }\n else {\n rotateX(-PI/2);\n }\n if (subMode == 2 || subMode == 3) {\n fill(i * 2, 0, j, scaledBandLevels[i % scaledBandLevels.length] * 2);\n }\n else {\n fill(255, scaledBandLevels[i % scaledBandLevels.length]);\n }\n rect(0,200,20,20);\n popMatrix();\n }\n }\n }\n else if (mode == 8) {\n // End To Begin\n background(0);\n\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i] && modSizes[i] < 60) {\n modSizes[i]+=2;\n }\n else if (modSizes[i] > 5) {\n modSizes[i]--;\n }\n }\n \n theta += .2;\n\n if (subMode >=3) {\n theta += .6;\n }\n\n float tempAngle = theta;\n for (int i = 0; i < yvalues.length; i++) {\n yvalues[i] = sin(tempAngle)*amplitude;\n tempAngle+=dx;\n }\n\n noStroke();\n if (subMode >= 4) {\n translate(0, height/2);\n }\n int currentFrameCount = frameCount;\n for (int x = 0; x < yvalues.length; x++) {\n if (subMode >= 4) {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length] * 3);\n rotateX(currentFrameCount * (PI/200));\n }\n else {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length]);\n }\n ellipse(x*xspacing - period/2, height/2+yvalues[x], modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n if (subMode >= 1) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n if (subMode >= 2) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n }\n }\n else if (mode == 1) {\n // Life Support\n background(0);\n noStroke();\n if (trigger) { \n if (subMode == 0) {\n fill(255, 0, 0, triggerHold - (triggerCount * 4));\n }\n else if (subMode == 1) {\n fill(255, triggerHold - (triggerCount * 4));\n }\n rect(0,0,width,height);\n if (triggerCount > triggerHold) {\n trigger = false;\n triggerCount = 1;\n }\n else {\n triggerCount++;\n }\n }\n }\n else if (mode == 6) {\n // Stacking Cards\n background(255);\n if (subMode >= 1) {\n translate(width/2, 0);\n rotateY(frameCount * PI/200);\n }\n imageMode(CENTER);\n\n if (subMode <= 1) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=40;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n else if (subMode == 2) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 4; j++) {\n rotateY(j * (PI/4));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 3) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 4) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int k = 0; k < height; k+= 300) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), k, modSizes[i], modSizes[i]);\n }\n }\n }\n }\n } \n else if (mode == 4) {\n background(0);\n noStroke();\n for (int i = 0; i < letterStrings.length; i++) { \n if (subMode == 0) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), (height/2) + 75);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, (height/2) + 75);\n }\n }\n else if (subMode == 1) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100; j < height + 100; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 2) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100 - (frameCount % 400); j < height + 600; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 3) {\n for (int j = -100; j < height + 100; j+=200) {\n if (random(0,1) < .5) {\n fill(0,250,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n else {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n }\n }\n else if (mode == 9) {\n background(0);\n noStroke();\n fill(234,100,255);\n String bandName = \"ELAPHANT\";\n text(bandName, (width/2) - (textWidth(bandName)/2), (height/2) + 75);\n }\n else {\n background(0);\n }\n }", "public void drawInstruction(Graphics2D g2d)\r\n\t{\r\n\t\tif(state==1)\r\n\t\t{\r\n\t\t\tg2d.fillRect((int)(0.4*size.width),(int)(0.3*size.height),(int)(0.3*size.width) , (int)(0.4*size.width));\r\n\t\t\tg2d.setColor(new Color(255,255,255));\r\n\t\t\tint x=(int)(0.4*size.getWidth());\r\n\t\t\tint y=(int)(0.4*size.getHeight());\r\n\t\t\tg2d.drawString(\"Gra polega na tym, ze gracz ma \", x, y);\r\n\t\t//\tx=(int)(0.4*size.getWidth());\r\n\t\t\ty=(int)(0.5*size.getHeight());\r\n\t\t\tg2d.drawString(\"wyladowac statkiem jak najszybciej przy \", x, y);\r\n\t\t\ty=(int)(0.6*size.getHeight());\r\n\t\t\tg2d.drawString(\"jak najmnejszym zuzyciu paliwa \", x, y);\r\n\t\t}\r\n\t\tif(state==2)\r\n\t\t{\r\n\t\t\tg2d.fillRect((int)(0.4*size.width),(int)(0.3*size.height),(int)(0.3*size.width) , (int)(0.65*size.height));\r\n\t\t\t\r\n\t\t\tint x=(int)(0.4*size.getWidth());\r\n\t\t\tint y=(int)(0.4*size.getHeight());\r\n\t\t\t\r\n\t\t\tg2d.setColor(new Color(255,255,255));\r\n\t\t\tg2d.drawLine(0, (int)(size.height*0.05), x, y);\r\n\t\t\tg2d.drawString(\"to jest parametr polozenia w osi X\", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.5*size.getHeight());\r\n\t\t\tg2d.drawLine(0, (int)(size.height*0.1), x, y);\r\n\t\t\tg2d.drawString(\"to jest parametr polozenia w osi Y\", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.6*size.getHeight());\r\n\t\t\tg2d.drawLine(0, (int)(size.height*0.15), x, y);\r\n\t\t\tg2d.drawString(\"to jest parametr predkosci w osi X\", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.7*size.getHeight());\r\n\t\t\tg2d.drawLine(0, (int)(size.height*0.2), x, y);\r\n\t\t\tg2d.drawString(\"to jest parametr predkosci w osi Y\", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.8*size.getHeight());\r\n\t\t\tg2d.drawLine((int)(size.width*0.9), (int)(size.height*0.05), x+(int)(0.2*size.width), y);\r\n\t\t\tg2d.drawString(\"to jest ile zostalo paliwa\", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.9*size.getHeight());\r\n\t\t\tg2d.drawLine((int)(size.width*0.9), (int)(size.height*0.15), x+(int)(0.2*size.width), y);\r\n\t\t\tg2d.drawString(\"to jest pozostaly czas\", x, y);\t\t\r\n\t\t}\r\n\t\tif(state==3)\r\n\t\t{\r\n\t\t\tg2d.fillRect((int)(0.4*size.width),(int)(0.3*size.height),(int)(0.4*size.height) , (int)(0.4*size.width));\r\n\t\t\tg2d.setColor(new Color(255,255,255));\r\n\t\t\tint x=(int)(0.4*size.getWidth());\r\n\t\t\tint y=(int)(0.4*size.getHeight());\r\n\t\t\tg2d.drawString(\"Punkty rowniez zaleza od wybranego ladowiska \", x, y);\r\n\t\t\t\r\n\t\t\ty=(int)(0.5*size.getHeight());\r\n\t\t\tg2d.drawString(\"systemu gwiazdek-im wiecej gwiazdek tym\", x, y);\r\n\r\n\t\t\ty=(int)(0.6*size.getHeight());\r\n\t\t\tg2d.drawString(\" wiecej punktow \", x, y);\r\n\t\t}\r\n\t\t\r\n\t}", "public void draw(){\n super.repaint();\n }", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "@Override\r\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.PINK);\r\n\t\tg.fillRect(getX(), getY(), getWidth(), getHeight());\r\n\t\t\r\n\t}", "@Override\n public void drawScreen(int n, int n2) {\n void mouseY;\n void mouseX;\n super.drawScreen((int)mouseX, (int)mouseY);\n float[] hsb = Color.RGBtoHSB(this.setting.getValue().getRed(), this.setting.getValue().getGreen(), this.setting.getValue().getBlue(), null);\n Color color = Color.getHSBColor(hsb[0], Float.intBitsToFloat(Float.floatToIntBits(6.4887953f) ^ 0x7F4FA436), Float.intBitsToFloat(Float.floatToIntBits(4.629535f) ^ 0x7F142527));\n Gui.drawRect((int)this.getX(), (int)this.getY(), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 14), (int)new Color(40, 40, 40).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 2), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 12), (int)this.setting.getValue().getRGB());\n RenderUtils.drawOutline(this.getX() + this.getWidth() - 12, this.getY() + 2, this.getX() + this.getWidth() - 2, this.getY() + 12, Float.intBitsToFloat(Float.floatToIntBits(2.7144578f) ^ 0x7F2DB9AD), new Color(20, 20, 20).getRGB());\n if (this.open) {\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 14), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 28), (int)new Color(40, 40, 40).getRGB());\n float i = Float.intBitsToFloat(Float.floatToIntBits(1.3378998E38f) ^ 0x7EC94E07);\n while (i + Float.intBitsToFloat(Float.floatToIntBits(13.8331995f) ^ 0x7EDD54C9) < Float.intBitsToFloat(Float.floatToIntBits(0.07128618f) ^ 0x7F51FE7D)) {\n RenderUtils.drawRecta((float)(this.getX() + 2) + i, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(7.249331f) ^ 0x7F67FA85), Float.intBitsToFloat(Float.floatToIntBits(1.7045807f) ^ 0x7EEA2FB3), Color.getHSBColor(i / Float.intBitsToFloat(Float.floatToIntBits(0.115068644f) ^ 0x7F2BA91C), Float.intBitsToFloat(Float.floatToIntBits(4.3161592f) ^ 0x7F0A1DFA), Float.intBitsToFloat(Float.floatToIntBits(21.075346f) ^ 0x7E289A4F)).getRGB());\n i += Float.intBitsToFloat(Float.floatToIntBits(3.807338f) ^ 0x7E95CD0B);\n }\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 16, this.getX() + 2 + this.getWidth() - 4, this.getY() + 27, Float.intBitsToFloat(Float.floatToIntBits(2.7503529f) ^ 0x7F3005C8), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.hueWidth, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(5.200255f) ^ 0x7F26687D), Float.intBitsToFloat(Float.floatToIntBits(1.2665411f) ^ 0x7E921E05), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 28), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 42), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 29, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.19645536f) ^ 0x7F792B98), new Color(255, 255, 255), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 29, this.getX() + 2 + this.getWidth() - 4, this.getY() + 40, Float.intBitsToFloat(Float.floatToIntBits(103.69628f) ^ 0x7DCF647F), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.satWidth, this.getY() + 29, Float.intBitsToFloat(Float.floatToIntBits(7.3489017f) ^ 0x7F6B2A34), Float.intBitsToFloat(Float.floatToIntBits(0.1948352f) ^ 0x7F7782E1), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 42), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 56), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 42, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(1.5246161f) ^ 0x7EF3269F), new Color(0, 0, 0), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 42, this.getX() + 2 + this.getWidth() - 4, this.getY() + 53, Float.intBitsToFloat(Float.floatToIntBits(3.7803736f) ^ 0x7F71F1A4), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.briWidth, this.getY() + 42, Float.intBitsToFloat(Float.floatToIntBits(8.346171f) ^ 0x7E8589EB), Float.intBitsToFloat(Float.floatToIntBits(0.08925866f) ^ 0x7C86CD3F), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 56), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 70), (int)new Color(40, 40, 40).getRGB());\n this.renderAlphaBG(this.getX() + 2, this.getY() + 55, this.alphaBG);\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 55, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.13166903f) ^ 0x7F36D43F), new Color(0, 0, 0), color, 0, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 55, this.getX() + 2 + this.getWidth() - 4, this.getY() + 66, Float.intBitsToFloat(Float.floatToIntBits(19.69502f) ^ 0x7E9D8F67), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.alphaWidth, this.getY() + 55, Float.intBitsToFloat(Float.floatToIntBits(6.702013f) ^ 0x7F5676E4), Float.intBitsToFloat(Float.floatToIntBits(0.13652846f) ^ 0x7F3BCE1E), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 70), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 84), (int)new Color(40, 40, 40).getRGB());\n Europa.FONT_MANAGER.drawString(\"Rainbow\", this.getX() + 3, (float)(this.getY() + 78) - Europa.FONT_MANAGER.getHeight() / Float.intBitsToFloat(Float.floatToIntBits(0.8730777f) ^ 0x7F5F8205), Color.WHITE);\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 72), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 82), (int)new Color(30, 30, 30).getRGB());\n if (this.setting.getRainbow().booleanValue()) {\n RenderUtils.prepareGL();\n GL11.glShadeModel((int)7425);\n GL11.glEnable((int)2848);\n GL11.glLineWidth((float)Float.intBitsToFloat(Float.floatToIntBits(0.2713932f) ^ 0x7EAAF40D));\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015137452f) ^ 0x7F070313)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(1.1948546f) ^ 0x7CE7F0FF)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.36357376f) ^ 0x7DC52657)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015521388f) ^ 0x7F014D6B)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.01025841f) ^ 0x7F5712E4)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.10675689f) ^ 0x7EA5A35B)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8 + 4), (double)(this.getY() + 74));\n GL11.glEnd();\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.009417259f) ^ 0x7F654AD9)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.07014828f) ^ 0x7EF0A9E7)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.013465701f) ^ 0x7F239F3E)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.0155056f) ^ 0x7F010B33)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.011914493f) ^ 0x7F3C3501)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.012230922f) ^ 0x7F376434)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 10), (double)(this.getY() + 77));\n GL11.glEnd();\n RenderUtils.releaseGL();\n }\n }\n Gui.drawRect((int)(this.getX() - 1), (int)this.getY(), (int)this.getX(), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth()), (int)this.getY(), (int)(this.getX() + this.getWidth() + 1), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Europa.FONT_MANAGER.drawString(this.setting.getName(), this.getX() + 3, this.getY() + 3, Color.WHITE);\n }", "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\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}", "void drawBuilding() {\r\n\t\tgc.setFill(Color.BEIGE);\r\n\t\tgc.fillRect(0, 0, theBuilding.getXSize(), theBuilding.getYSize()); // clear the canvas\r\n\t\ttheBuilding.showBuilding(this); // draw all items\r\n\r\n\t\tString s = theBuilding.toString();\r\n\t\trtPane.getChildren().clear(); // clear rtpane\r\n\t\tLabel l = new Label(s); // turn string to label\r\n\t\trtPane.getChildren().add(l); // add label\r\n\r\n\t}", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n\t //FrameRate should only 5 when there is no activity. Otherwise, 60\n if (!EventQueue.getInstance().isTiccing() && System.currentTimeMillis() - lastActive >= 300) {\n noLoop();\n setFrameRate(5);\n println(\"no draw activity\");\n } else{\n \t setFrameRate(60);\n }\n background(255);\n //Process menu data at the beginning\n // Menu menuSing = Menu.getInstance();\n // if ((boolean) menuSing.getControllerValue(\"Button0\")) {\n // KeyMap.getInstance().run('q');\n // }\n\n pushMatrix();\n //Enable scrolling\n translate(0, verticalScroll);\n StringManager.getInstance().draw();\n\n popMatrix();\n\n //if (frameCount % 10 == 0)System.out.println(frameRate);\n\n //Draw menu after\n Menu.getInstance().draw();\n }", "public void draw(Graphics2D g)\n {\n //g.setColor(Color.black);\n //g.drawString(statusMsg,20,20);\n\n /* only draw when game is not running */\n if(GAME_RUNNING == false && selectedWidget != null)\n {\n if(SELECT_MODE == SelectMode.SELECTED || SELECT_MODE == SelectMode.DRAGGING)\n {\n /* draw boundary of selected widget */\n g.setColor(Color.orange);\n\n Vector2f[] points = selectedWidget.getBoundary();\n for(int i = 0; i <= 3; i++)\n \t\t{\n \n \t\t\tg.drawLine(\n (int)points[i].getX(),\n (int)points[i].getY(),\n (int)points[(i+1)%4].getX(),\n (int)points[(i+1)%4].getY());\n \t\t}\n }\n\n if(SELECT_MODE == SelectMode.DRAGGING || SELECT_MODE == SelectMode.ADDING)\n {\n /* draw boundary of dragged widget */\n if (timWorld.testPlacement(selectedWidget, mouseX + clickOffsetX, mouseY + clickOffsetY))\n {\n /* placement position is safe, draw green boundary */\n g.setColor(Color.green);\n }\n else\n {\n /* placement position unsafe, draw red boundary */\n g.setColor(Color.red);\n }\n \n Vector2f[] points = selectedWidget.getBoundary();\n for(int i = 0; i <= 3; i++)\n \t\t{\n \n if(SELECT_MODE == SelectMode.ADDING)\n {\n \t\t\tg.drawLine(\n (int)(points[i].getX() + mouseX),\n (int)(points[i].getY() + mouseY),\n (int)(points[(i+1)%4].getX() + mouseX),\n (int)(points[(i+1)%4].getY() + mouseY));\n }\n else\n {\n \t\t\t g.drawLine(\n (int)(points[i].getX() + (mouseX - pressX)),\n (int)(points[i].getY() + (mouseY - pressY)),\n (int)(points[(i+1)%4].getX() + (mouseX - pressX)),\n (int)(points[(i+1)%4].getY() + (mouseY - pressY)));\n }\n \t\t}\n }\n }\n }", "public GraphicsState getState(\n )\n {return state;}", "public void draw() { \n\t\tbackground(255); // Clear the screen with a white background\n\t\tfill(0);\n\t\ttextAlign(LEFT);\n\t\ttextSize(12);\n\t\t\n\t\tif (runCount == 0) {\n\t\t\tboard.onClick();\n\t\t} else if (runCount > 0) {\n\t\t\trunCount--;\n\t\t}\n\t\t\n\t\tif (board != null) {\n\t\t\tboard.draw(this, 0, 0, height, height);\n\t\t}\n\t\t\n\t}", "public void draw() \n\t {\n\t\t draw(root,0,0,1,1,true);\n\t }", "void drawMenuState(Graphics g) {\n\t\tnumberOfMenu++;\n\t\tg.setColor(Color.BLUE);\n\t\tg.fillRect(0, 0, QuizWhiz.WIDTH, QuizWhiz.HEIGHT);\n\t\tg.setFont(font);\n\t\tg.setColor(Color.YELLOW);\n\t\tg.drawString(\"Quiz Whiz\", 50, 100);\n\t\tg.drawString(\"Press the button to start\", 50, 200);\n\t\tg.drawString(\"Press SPACE for instructions\", 25, 300);\n\t\tbutton=new JButton();\n\t\tbutton.setText(\"Next\");\n\t\t//button.setBounds(100,700,100,25);\n\t\tbutton.addActionListener(this);\n\t\tif(numberOfMenu<=1) {\n\t\tthis.add(button);\n\t\t}\n\t\tframe.setSize(300,400);\n\t}", "public void paint() {\r\n\t\tBufferStrategy bf = base.frame.getBufferStrategy();\r\n\t\ttry {\r\n\t\t\tg = bf.getDrawGraphics();\r\n\t\t\tg.clearRect(0, 0, 1024, 768);\r\n\t\t\tg.setFont(normal);\r\n\t\t\tif (gameState == 1) {\r\n\t\t\t\tg.drawImage(playButton, playButtonXM, playButtonYM, playButtonWidthM, playButtonHeightM, this);\t\t\t\t\r\n\t\t\t}else if (gameState == 3){\r\n\t\t\t\tint weaponPosX = ((arrow2X-arrowX) /2) + arrowX - 20;\r\n\t\t\t\tint weaponPosY = arrowY - 15;\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY2ndRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY2ndRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY3rdRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY3rdRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY4thRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY4thRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(playButton, playButtonX, playButtonY, playButtonWidth, playButtonHeight, this);\r\n\r\n\t\t\t\t//text boxes above choices\r\n\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\tg.drawString(\"Weapon\", weaponPosX, weaponPosY);\r\n\t\t\t\tg.drawString(\"Difficulty\", weaponPosX, (arrowY2ndRow - 15));\r\n\t\t\t\tg.drawString(\"Number of AI\", weaponPosX - 12, (arrowY3rdRow - 15));\r\n\t\t\t\tg.drawString(\"Number of players\", weaponPosX - 20, (arrowY4thRow - 15));\r\n\r\n\t\t\t\tif (getDifficulty() == 1){\r\n\t\t\t\t\tg.drawImage(Easy, difficultyXPos, arrowY2ndRow, difficultyWidth , arrowHeight, this);\r\n\t\t\t\t}else if (getDifficulty() == 2) {\r\n\t\t\t\t\tg.drawImage(Normal, difficultyXPos, arrowY2ndRow, difficultyWidth, arrowHeight, this);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tg.drawImage(Hard, difficultyXPos, arrowY2ndRow, difficultyWidth, arrowHeight, this);\r\n\t\t\t\t}\r\n\t\t\t\tif (getAttackStyle() == 2) {\r\n\t\t\t\t\tg.drawImage(Arrowr, weaponPosX -85, weaponPosY + 15, (arrow2X - arrowX) - 280, arrowHeight, this);\r\n\t\t\t\t}else {\r\n\t\t\t\t\t//due to the sword using all of the x positions the width is slightly different\r\n\t\t\t\t\tg.drawImage(SwordL, weaponPosX -85, weaponPosY + 15, (arrow2X - arrowX) - 300, arrowHeight, this);\r\n\t\t\t\t}\r\n\t\t\t\tint AIXPos = weaponPosX;\r\n\t\t\t\tif (AINum >= 10 && AINum<100) {\r\n\t\t\t\t\tAIXPos -=25;\r\n\t\t\t\t} else if (AINum >= 100 && AINum < 1000) {\r\n\t\t\t\t\t//the reason why this grows by 40 instead of an additional 20 is because we are not storing the variable\r\n\t\t\t\t\t//of current position anywhere so we just add another 20 onto the decrease\r\n\t\t\t\t\tAIXPos-=50;\r\n\t\t\t\t} else if (AINum >= 1000) {\r\n\t\t\t\t\tAIXPos-=75;\r\n\t\t\t\t}\r\n\t\t\t\tg.setFont(numbers);\r\n\t\t\t\tString currentNum = Integer.toString(AINum);\r\n\t\t\t\tString currentPlayerString = Integer.toString(currentPlayer);\r\n\t\t\t\tg.drawString(currentNum, AIXPos, arrowY3rdRow + 72);\r\n\t\t\t\tg.drawString(currentPlayerString, weaponPosX, arrowY4thRow + 72);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ((!escape) && (!dead) &&(!allAIDead)) {\r\n\t\t\t\t\tg.drawImage(picture, 0, 0, base.frame.getWidth(), base.frame.getHeight(), this);\r\n\t\t\t\t\tfor (int i = 0; i < playerObject.length; i++) {\r\n\t\t\t\t\t\tint playerX = (int) playerObject[i].getX();\r\n\t\t\t\t\t\tint playerY = (int) playerObject[i].getY();\r\n\t\t\t\t\t\tg.setColor(Color.darkGray);\r\n\t\t\t\t\t\t// health bar\r\n\t\t\t\t\t\tg.fillRect(playerX, playerY - 30, 100, healthY);\r\n\t\t\t\t\t\tg.setColor(Color.red);\r\n\t\t\t\t\t\tg.fillOval(playerX, playerY, 20, 20);\r\n\t\t\t\t\t\tg.fillRect(playerX, playerY - 30, (int) (playerObject[i].getHealth()/2) , healthY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//AI\r\n\t\t\t\t\tfor (int i = 0; i < AIObject.length; i++) {\r\n\t\t\t\t\t\tif (!AIObject[i].isDead()) {\r\n\t\t\t\t\t\t\tint AIRoundedX = (int) AIObject[i].getAIX();\r\n\t\t\t\t\t\t\tint AIRoundedY = (int) AIObject[i].getAIY();\r\n\t\t\t\t\t\t\tif (AIObject[i].getColor() == null) {\r\n\t\t\t\t\t\t\t\tint red = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tint green = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tint blue = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tColor newColor = new Color(red,green,blue);\r\n\t\t\t\t\t\t\t\tg.setColor(newColor);\r\n\t\t\t\t\t\t\t\tAIObject[i].setColor(newColor);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tg.setColor(AIObject[i].getColor());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tg.fillOval(AIRoundedX, AIRoundedY, 20, 20);\r\n\t\t\t\t\t\t\tAIDeadCount = 0;\r\n\t\t\t\t\t\t\tg.setColor(Color.darkGray);\r\n\t\t\t\t\t\t\tg.fillRect(AIRoundedX, AIRoundedY - 40, AI_ORIG_HEALTH/AI_HEALTH_WIDTH_SCALE, healthY);\r\n\t\t\t\t\t\t\tg.setColor(AIObject[i].getColor());\r\n\t\t\t\t\t\t\tg.fillRect(AIRoundedX, AIRoundedY - 40, (int) AIObject[i].getAIHealth()/AI_HEALTH_WIDTH_SCALE, healthY);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tAIDeadCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// early access banner\r\n\t\t\t\t\tg.drawImage(earlyAccess, 0, 24, this);\r\n\r\n\t\t\t\t\tif (attackStyle == 2) {\r\n\t\t\t\t\t\tif (drawArrow == true) {\r\n\t\t\t\t\t\t\tinFlight = true;\r\n\t\t\t\t\t\t\tshouldPlaySound = true;\r\n\t\t\t\t\t\t\tif ((fireLeft) && (currentlyDrawingArrow != 2)) {\r\n\t\t\t\t\t\t\t\tgoingLeft = true;\r\n\t\t\t\t\t\t\t\tgoingRight = false;\r\n\t\t\t\t\t\t\t\tcurrentlyDrawingArrow = 1;\r\n\t\t\t\t\t\t\t\tg.drawImage(Arrowl, Math.round(aX), Math.round(aY), this);\r\n\r\n\t\t\t\t\t\t\t} else if ((fireRight) && (currentlyDrawingArrow != 1)) {\r\n\t\t\t\t\t\t\t\tgoingRight = true;\r\n\t\t\t\t\t\t\t\tgoingLeft = false;\r\n\t\t\t\t\t\t\t\tcurrentlyDrawingArrow = 2;\r\n\t\t\t\t\t\t\t\tg.drawImage(Arrowr, Math.round(aX), Math.round(aY), this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((aX >= 1024) || (!drawArrow) || (aX <= 0)) {\r\n\t\t\t\t\t\t\tinFlight = false;\r\n\t\t\t\t\t\t\taX = playerObject[0].getX();\r\n\t\t\t\t\t\t\taY = playerObject[0].getY();\r\n\t\t\t\t\t\t\tcurrentlyDrawingArrow = 0;\r\n\t\t\t\t\t\t\tdrawArrow = false;\r\n\t\t\t\t\t\t\tshouldPlaySound = false;\r\n\t\t\t\t\t\t\tnotPlayingSound = false;\r\n\t\t\t\t\t\t\talreadyShot = false;\r\n\t\t\t\t\t\t\tif (wasReleased) {\r\n\t\t\t\t\t\t\t\tlClick = false;\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\telse {\r\n\t\t\t\t\t\tint roundedX = Math.round(playerObject[0].getX());\r\n\t\t\t\t\t\tint roundedY = Math.round(playerObject[0].getY());\r\n\t\t\t\t\t\tif (drawSword) {\r\n\t\t\t\t\t\t\tswordCount++;\r\n\t\t\t\t\t\t\tif (mouseLeft) {\r\n\t\t\t\t\t\t\t\tif (swordCount < 5) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount > 5 && swordCount <=15) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(Sword45L, roundedX - 45, roundedY - 30, this);\r\n\t\t\t\t\t\t\t\t}else if (swordCount >15 && swordCount<30) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordL, roundedX - 63, roundedY, this);\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount >30 || !drawSword){\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t\t\tswordCount = 0;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\tif (swordCount < 5) {\r\n\t\t\t\t\t\t\t\t\t//image flip g.drawImage(SwordHorizontalL, Math.round(x) - 2, Math.round(y) - 45, -SwordHorizontalL.getWidth(this),SwordHorizontalL.getHeight(this),this);\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t\t-swordHorizontalLWidth,swordHorizontalLWidth,this);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount > 5 && swordCount <=15) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(Sword45L, roundedX + 80, roundedY - 30,\r\n\t\t\t\t\t\t\t\t\t\t\t-sword45LWidth, sword45LHeight, this);\r\n\t\t\t\t\t\t\t\t}else if (swordCount >15 && swordCount<30) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordL, roundedX +90, roundedY, -swordLWidth, swordLHeight, this);\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount >30 || !drawSword){\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t\t-swordHorizontalLWidth, swordHorizontalLHeight, this);\r\n\t\t\t\t\t\t\t\t\tswordCount = 0;\t\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 if (shield) {\r\n\t\t\t\t\t\t\tif (mouseLeft) {\r\n\t\t\t\t\t\t\t\tg.drawImage(shieldImage, roundedX - 5, roundedY - 5, shieldWidth, scaledShieldHeight, this);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tg.drawImage(shieldImage, roundedX + 5, roundedY - 5, shieldWidth, scaledShieldHeight, this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(mouseLeft) {\r\n\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t-SwordHorizontalL.getWidth(this), SwordHorizontalL.getHeight(this), this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tswordCount = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (wasReleased) {\r\n\t\t\t\t\t\t\tlClick = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if (escape) {\r\n\t\t\t\t\tg.setColor(Color.white);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawString(\"PAUSED\", 512, 389);\r\n\t\t\t\t}\r\n\t\t\t\telse if (dead) {\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.drawString(\"Dead\", 512, 389);\r\n\t\t\t\t} else if(allAIDead) {\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.drawString(\"You win\", 512, 389);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tg.dispose();\r\n\t\t}\r\n\t\t// Shows the contents of the backbuffer on the screen.\r\n\t\tbf.show();\r\n\t}", "public void draw() {\n mGameBoard.draw();\n }", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public abstract void drawFill();", "@Override\r\n public void draw()\r\n {\n\r\n }", "@Override\n\t\tprotected void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tGraphics2D ga = (Graphics2D) g; \n\t\t\tif (currentColor == color) {\n\t\t\t\tShape check = factory.getShape(ShapeFactory.CHECK);\n\t\t\t\tcheck.setPosition(new Point2D.Double(point.getX() + getPreferredSize().width/2 - 7, point.getY()+ 25));\n\t\t\t\tga.setColor(currentColor);\n\t\t\t\tcheck.draw(ga);\n\t\t\t}\n\t\t}", "public void draw() {\r\n\t\t// Draw the triangle making up the mountain\r\n\t\tTriangle mountain = new Triangle(this.x, 100,\r\n\t\t\t\tthis.x + mountainSize / 2, 100, this.x + mountainSize / 4,\r\n\t\t\t\t100 - this.y / 4, Color.DARK_GRAY, true);\r\n\t\t// Draw the triangle making up the snow cap\r\n\t\tthis.snow = new Triangle(side1, bottom - this.y / 8, side2, bottom\r\n\t\t\t\t- this.y / 8, this.x + mountainSize / 4, 100 - this.y / 4,\r\n\t\t\t\tColor.WHITE, true);\r\n\t\tthis.window.add(mountain);\r\n\t\tthis.window.add(snow);\r\n\t}", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "public boolean isDrawn();" ]
[ "0.70073617", "0.6863148", "0.6863148", "0.6838233", "0.6810003", "0.67881095", "0.6785117", "0.6763874", "0.674215", "0.6728374", "0.6728374", "0.6726954", "0.6697704", "0.6696781", "0.6696247", "0.6696247", "0.6687886", "0.6675971", "0.66742706", "0.6653901", "0.66518545", "0.6641646", "0.6610172", "0.6604275", "0.66038096", "0.66038096", "0.66038096", "0.6598347", "0.6591112", "0.6585652", "0.6584174", "0.65810037", "0.65803736", "0.657315", "0.6565646", "0.6557628", "0.6554567", "0.6538296", "0.65294063", "0.65294063", "0.6523277", "0.6516554", "0.64985573", "0.6498188", "0.6492155", "0.6485261", "0.64812964", "0.64812964", "0.64812964", "0.64772934", "0.6460297", "0.6459658", "0.6447995", "0.6441461", "0.6436086", "0.6433844", "0.6415257", "0.64043343", "0.64034885", "0.6400651", "0.6390469", "0.6373919", "0.6348825", "0.6348782", "0.6345151", "0.63244396", "0.6323088", "0.63079983", "0.629099", "0.62801516", "0.6276673", "0.6271483", "0.626885", "0.6257726", "0.62573475", "0.6249278", "0.62422407", "0.6237372", "0.6236414", "0.6234249", "0.6228619", "0.62252593", "0.62252593", "0.62252593", "0.62252593", "0.6218353", "0.62121636", "0.6202301", "0.619257", "0.6191522", "0.61818075", "0.6175837", "0.61750424", "0.6165811", "0.61620075", "0.6161745", "0.61511153", "0.61493593", "0.6145312", "0.6144977", "0.61441606" ]
0.0
-1
W W E W W Analyze all row,column or diag based on conditions above and return score of given board state
public int evaluate(PentagoBoardState pbs) { PentagoBoardState.Piece[][] pieces = pbs.getBoard(); int whitescore =0; //keep track of white's total score int blackscore = 0;//keep track of black's total score //Check rows for (int x = 0; x <6 ; x++) { int countWHori = 0; int countBHori = 0; int blacks = 0; int whites = 0; for (int y = 0; y <5 ; y++) { //Count how many black and white pieces if (pieces[x][y].ordinal() == 0 ) { //countBHori = countBHori + countvalue; blacks++; } if (pieces[x][y].ordinal() == 1) { //countWHori = countWHori +countvalue; whites++; } //Check for consecutive if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) { countBHori = countBHori +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) { countBHori = countBHori + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) { countBHori = countBHori + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) { countWHori = countWHori +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) { countWHori = countWHori + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) { countWHori = countWHori + blankspaceconsec; } //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B if (y!=4){ if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){ countBHori = countBHori +disjointset; } else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){ countWHori = countWHori +disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){ countBHori = countBHori +jointset; } else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){ countWHori = countWHori +jointset; } } } //check if unwinnable if (blacks == 4 && whites==2){ countBHori += unwinnable; } if (blacks == 2 && whites==4){ countWHori += unwinnable; } if (blacks == 3 && whites==3){ countWHori += unwinnable; countBHori += unwinnable; } //Run value for row in evaluation scheme and add to total score int valuew = consecutivevalue(countWHori); whitescore = whitescore +valuew; int valueb = consecutivevalue(countBHori); blackscore = blackscore + valueb; //System.out.println("Black consec hori " + valueb + "White consec hori " + valuew); } //Check Verticals for (int y = 0; y <6 ; y++) { int countWvert = 0; int countBvert = 0; int blacks = 0; int whites = 0; for (int x = 0; x <5 ; x++) { if (pieces[x][y].ordinal() == 0) { //countBvert = countBvert +1; blacks++; } if (pieces[x][y].ordinal() == 1) { //countWvert = countWvert +1; whites++; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) { countBvert = countBvert +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) { countBvert = countBvert + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) { countBvert = countBvert + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) { countWvert = countWvert +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) { countWvert = countWvert + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) { countWvert = countWvert + blankspaceconsec; } if (x!=4){ if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){ countBvert = countBvert +disjointset; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){ countWvert = countWvert +disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){ countBvert = countBvert +jointset; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){ countWvert = countWvert +jointset; } } } if (blacks == 4 && whites==2){ countBvert += unwinnable; } if (blacks == 3 && whites==3){ countBvert += unwinnable; countWvert += unwinnable; } if (blacks == 2 && whites==4){ countWvert += unwinnable; } //System.out.println("Black consec vert " + countBvert + "White consec " + countWvert); int valuew = consecutivevalue(countWvert); whitescore = whitescore +valuew; int valueb = consecutivevalue(countBvert); blackscore = blackscore + valueb; //System.out.println("Black consec VERT " + valueb + "White consec hori " + valuew); } //S West N EAST Top for (int a = 1; a <6 ; a++) { //loop through all diagonal lines int countWdiagSoNe = 0; int countBdiagSoNe = 0; int x=0; int blacks = 0; int whites = 0; for (int y = a; y !=0 ; y--) { //loop through one diagonal line int r = pieces[x][y].ordinal(); int s =pieces[x+1][y-1].ordinal(); //System.out.println("x " + x+ " y " +y); //System.out.println("first " + r+ " second " +s); if (pieces[x][y].ordinal() == 0) { //countBdiagSoNe = countBdiagSoNe +2; blacks++; } if (pieces[x][y].ordinal() == 1 ) { //countWdiagSoNe = countWdiagSoNe +2; whites++; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) { countBdiagSoNe = countBdiagSoNe +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) { countBdiagSoNe = countBdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) { countBdiagSoNe = countBdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) { countWdiagSoNe = countWdiagSoNe +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) { countWdiagSoNe = countWdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) { countWdiagSoNe = countWdiagSoNe + blankspaceconsec; } // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead if (x==0 && y==4){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==1 && y==3){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==2 && y==2){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==0 && y==5){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==1 && y==4){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==2 && y==3){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==3 && y==2){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } x++; } if (blacks == 4 && whites==2){ countBdiagSoNe += unwinnable; } if (blacks == 3 && whites==3){ countBdiagSoNe += unwinnable; countWdiagSoNe += unwinnable; } if (blacks == 2 && whites==4){ countWdiagSoNe += unwinnable; } if (a==4 && blacks == 4 && whites==1){ countBdiagSoNe += unwinnable; } if (a==4 && blacks == 1 && whites==4){ countWdiagSoNe += unwinnable; } //System.out.println("Black consec vert " + countBdiagSoNe + "White consec " + countWdiagSoNe); int valuew = consecutivevalue(countWdiagSoNe); whitescore = whitescore +valuew; int valueb = consecutivevalue(countBdiagSoNe); blackscore = blackscore + valueb; //System.out.println("Black consec DIAGOMAAL " + valueb + " " + countBdiagSoNe + "White consec hori " + valuew + " " + countWdiagSoNe); } //S West N EAST Bot for (int a = 1; a <5 ; a++) { int countWdiagSoNe = 0; int countBdiagSoNe = 0; int y=5; int blacks = 0; int whites = 0; for (int x = a; x <5 ; x++) { int r = pieces[x][y].ordinal(); int s =pieces[x+1][y-1].ordinal(); //System.out.println("x " + x+ " y " +y); //System.out.println("first " + r+ " second " +s); if (pieces[x][y].ordinal() == 0) { //countBdiagSoNe = countBdiagSoNe + blacks++; } if (pieces[x][y].ordinal() == 1 ) { //countWdiagSoNe = countWdiagSoNe +2; whites++; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) { countBdiagSoNe = countBdiagSoNe +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) { countBdiagSoNe = countBdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) { countBdiagSoNe = countBdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) { countWdiagSoNe = countWdiagSoNe +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) { countWdiagSoNe = countWdiagSoNe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) { countWdiagSoNe = countWdiagSoNe + blankspaceconsec; } if (x==1 && y==5){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==2 && y==4){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } if (x==3 && y==3){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) { countWdiagSoNe = countWdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) { countBdiagSoNe = countBdiagSoNe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) { countWdiagSoNe = countWdiagSoNe +jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) { countBdiagSoNe = countBdiagSoNe + jointset; } } //System.out.println(x + " y:" + y +" Black consec DIAGOMAAL " + countBdiagSoNe + "White consec hori " + countWdiagSoNe); y--; } if (a==1 && blacks == 4 && whites==1){ countBdiagSoNe += unwinnable; } /*if (blacks == 3 && whites==3){ countBdiagSoNe += unwinnable; countWdiagSoNe += unwinnable; }*/ if (a==1&& blacks == 1 && whites==4){ countWdiagSoNe += unwinnable; } //System.out.println("Black consec vert " + countBdiagSoNe + "White consec " + countWdiagSoNe); int valuew = consecutivevalue(countWdiagSoNe); whitescore = whitescore +valuew; int valueb = consecutivevalue(countBdiagSoNe); blackscore = blackscore + valueb; //System.out.println("Black consec DIAGOMAAL " + valueb + " " + countBdiagSoNe + "White consec hori " + valuew + " " + countWdiagSoNe); } //NorthWest S EAST Left for (int a = 0; a <5 ; a++) { int countWdiagNoSe = 0; int countBdiagNoSe = 0; int y=0; int blacks = 0; int whites = 0; for (int x = a; x <5 ; x++) { //System.out.println(pbs+"x " + x+ " y " +y); int r = pieces[x][y].ordinal(); int s =pieces[x+1][y+1].ordinal(); //System.out.println("x " + x+ " y " +y); //System.out.println("first " + r+ " second " +s); if (pieces[x][y].ordinal() == 0) { blacks++; //countBdiagNoSe = countBdiagNoSe +2; } if (pieces[x][y].ordinal() == 1) { whites++; //countWdiagNoSe = countWdiagNoSe +2; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) { countBdiagNoSe = countBdiagNoSe +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) { countBdiagNoSe = countBdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) { countBdiagNoSe = countBdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) { countWdiagNoSe = countWdiagNoSe +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) { countWdiagNoSe= countWdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) { countWdiagNoSe = countWdiagNoSe + blankspaceconsec; } if (x==0 && y==0){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==1 && y==1){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==2 && y==2){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==3 && y==3){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==1 && y==0){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==2 && y==1){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==3 && y==2){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } y++; } //System.out.println("Black consec vert " + countBdiagSoNe + "White consec " + countWdiagSoNe); if (blacks == 4 && whites==2){ countBdiagNoSe += unwinnable; } if (a==1 && blacks == 4 && whites==1){ countBdiagNoSe += unwinnable; } if (blacks == 3 && whites==3){ countBdiagNoSe += unwinnable; countWdiagNoSe += unwinnable; } if (blacks == 2 && whites==4){ countWdiagNoSe += unwinnable; } if (a==1 && blacks == 1 && whites==4){ countWdiagNoSe += unwinnable; } int valuew = consecutivevalue(countWdiagNoSe); whitescore = whitescore +valuew; int valueb = consecutivevalue( countBdiagNoSe); blackscore = blackscore + valueb; //System.out.println("Black consec DIAGOMAAL " + valueb + " " + countBdiagNoSe + "White consec hori " + valuew + " " + countWdiagNoSe); } //NorthWest S EAST Right for (int a = 1; a <5 ; a++) { int countWdiagNoSe = 0; int countBdiagNoSe = 0; int x=0; int blacks = 0; int whites = 0; for (int y = a; y <5 ; y++) { //System.out.println("x " + x+ " y " +y); int r = pieces[x][y].ordinal(); int s =pieces[x+1][y+1].ordinal(); //System.out.println("x " + x+ " y " +y); //System.out.println("first " + r+ " second " +s); if (pieces[x][y].ordinal() == 0 ) { blacks++; //countBdiagNoSe = countBdiagNoSe +2; } if (pieces[x][y].ordinal() == 1) { whites++; //countWdiagNoSe = countWdiagNoSe +2; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) { countBdiagNoSe = countBdiagNoSe +consecvalue; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) { countBdiagNoSe = countBdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) { countBdiagNoSe = countBdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) { countWdiagNoSe = countWdiagNoSe +consecvalue; } else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) { countWdiagNoSe= countWdiagNoSe + blankspaceconsec; } else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) { countWdiagNoSe = countWdiagNoSe + blankspaceconsec; } if (x==0 && y==1){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==1 && y==2){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } if (x==2 && y==3){ if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) { countWdiagNoSe = countWdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) { countBdiagNoSe = countBdiagNoSe + disjointset; } if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) { countWdiagNoSe = countWdiagNoSe + jointset; } else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) { countBdiagNoSe = countBdiagNoSe + jointset; } } x++; } if (a==1 && blacks == 1 && whites==4){ countWdiagNoSe += unwinnable; } if (a==1 && blacks == 4 && whites==1){ countBdiagNoSe += unwinnable; } //System.out.println("Black consec vert " + countBdiagSoNe + "White consec " + countWdiagSoNe); int valuew = consecutivevalue(countWdiagNoSe); whitescore = whitescore +valuew; int valueb = consecutivevalue( countBdiagNoSe); blackscore = blackscore + valueb; //System.out.println("Black consec DIAGOMAAL " + valueb + " " + countBdiagNoSe + "White consec hori " + valuew + " " + countWdiagNoSe); } //System.out.println("Black consec score " + blackscore +" " + "White consec scpre " + whitescore); //System.out.println("max player is " + maxplayer + "My colour is " + mycolour); int i = -123456789; if (mycolour == 0){ //System.out.println(blackscore-whitescore +" I am black"); i= blackscore-whitescore; return i; } else { //System.out.println(whitescore-blackscore +" I am white"); i= whitescore-blackscore; return i; } /* if(i>0 && i<1000){ return 100; //i*2; } else if(i>=1000 && i<10000){ return 1000; //i*10; } else if(i>=10000 && i<100000){ return 10000; //i*50; } else if(i>=100000){ return 100000;//i*500; } else if(i<=0 && i>-100){ return -100; //i*2; } else if(i<=-100 && i>-1000){ return -1000; //i*10; } else if(i<=-1000 && i>-10000){ return -10000; //i*50; } else if(i<=0 && i>-100000){ return -100000;//i*500; } */ }
{ "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 int AI(){\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==2 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //checks for horizontals (Y-YY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontals (YY-Y)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for horizontals (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i+3==5)||\n (i+2==4&&board[5][j]!=0)||\n (i+1==3&&board[5][j]!=0&&board[4][j]!=0)||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0)||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0)||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==0 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i==2&&board[5][j+1]!=0)||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0)||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==0 && board[i][j+3]==2){\n if((i==2&&board[5][j+2]!=0&&board[4][j+2]!=0)||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0)||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==0){\n if((i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0)||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0)||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==0 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==0 && board[i+3][j+3]==2){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //BLOCK CHECKER\n //columns\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==1 && board[i+2][j]==1 && board[i+3][j]==1){\n return j; \n }\n }\n }\n //Checks for blocks horizontal (R-RR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontal blocks (RR-R)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n \n //checks for horizontals (-RRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (RRR-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+3==5)||\n (i+2==4&&board[i+3][j]!=0)||\n (i+1==3&&board[i+3][j]!=0&&board[i+2][j]!=0)||\n (i==2&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0)||\n (i==1&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0)||\n (i==0&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0&&board[i-1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (R-RR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==0 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+2==4&&board[i+3][j+1]!=0)||\n (i+1==3&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0)||\n (i==2&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0)||\n (i==1&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0)||\n (i==0&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0&&board[i-1][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (RR-R)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==0 && board[i][j+3]==1){\n if((i==2&&board[i+2][j+2]!=0)){//||\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (RRR-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==0){\n if((i==0&&board[1][j+3]!=0)||\n (i==1&&board[2][j+3]!=0)||\n (i==2&&board[3][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal blocks(-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal blocks(Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==0 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==0 && board[i+3][j+3]==1){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //INTERMEDIATE BLOCKING\n //If horizontal (RR--) make it (RRY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--RR) make it (-YRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n //The following attempts to set the computer up for a win, instead of first just generating a random number\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i+1][j]==0 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //If horizontal (-YY-) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //If horizontal (YY--) make it (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--YY) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n boolean sent = false;\n //The following code will simply generate a random number.\n int x = (int)((Math.random())*7);\n if(!wonYet){ \n while(!sent){\n if(board[0][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[1][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[2][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[3][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[4][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[5][x]!=0)\n x = (int)((Math.random())*7);\n sent = true;\n } \n return x;\n }\n return -1; \n }", "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 }", "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 float getStateCost(int[] board) {\r\n\t\tfloat cost = 0;\r\n\t\tfor (int i = 0; i < this.checkBoardSide; i++) {\r\n\t\t\tif (isQueenAttacked(i, board[i], board)) {\r\n\t\t\t\tcost++;\r\n\t\t\t\t// System.out.println(\"row: \" + i + \" attacked\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cost;\r\n\r\n\t}", "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 }", "private static int evaluateBoard(final int[][] givenBoard) {\n final int[][] board = cloneBoard(givenBoard);\n\n final int numRows = givenBoard.length;\n final int numCols = givenBoard[0].length;\n\n \n // If the game is complete\n if (!Utils.hasMove(board)) {\n // Find largest absolute move value for player and opponent\n int playerScore = 0;\n int opponentScore = 0;\n for (final int[] row : board) {\n for (final int val : row) {\n if (val > playerScore) playerScore = val;\n if (val < opponentScore) opponentScore = val;\n } \n }\n // Give a big reward + the ammount we won the game by\n return WIN_REWARD + playerScore + opponentScore;\n }\n boardsEvaluated++;\n\n \n // If the game is incomplete, return the diference between the average \n // distance that the player and opponent are from each empty square\n int[][] playerDistances = distanceGrid(board);\n int[][] opponentDistances = distanceGrid(flipBoard(board));\n \n int totalPlayerDistance = 0;\n int totalOpponentDistance = 0;\n \n int maxPlayerDistance = 0;\n int maxOpponentDistance = 0;\n \n \n int largestPlayerMove = 0;\n int smallestOpponentMove = 0;\n \n int numEmptySpaces = 0;\n \n for (int r = 0; r < numRows; r++) {\n for (int c = 0; c < numCols; c++) {\n if (playerDistances[r][c] > 0) {\n totalPlayerDistance += playerDistances[r][c];\n numEmptySpaces++;\n }\n if (opponentDistances[r][c] > 0) {\n totalOpponentDistance += opponentDistances[r][c];\n }\n \n int boardVal = board[r][c];\n if (largestPlayerMove < boardVal) largestPlayerMove = boardVal;\n if (smallestOpponentMove > boardVal) smallestOpponentMove = boardVal;\n \n } \n }\n int averageDistanceDifference = totalOpponentDistance - totalPlayerDistance;\n\n int largestMoveDifference = largestPlayerMove + smallestOpponentMove;\n\n\n return averageDistanceDifference + largestMoveDifference;\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 static double upLeftScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && col != 0 && state.getGrid()[row-1][col-1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\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}", "int score(OfcHandMatrix matrix);", "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}", "private static double upRightScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && col != state.getGrid()[row].length-1 && state.getGrid()[row-1][col+1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "protected String checkContradictionRaw(BoardState state)\r\n {\r\n \tString error = null;\r\n \tint height = state.getHeight();\r\n \tint width = state.getWidth();\r\n\r\n \tint[][] arrayacross = new int[height][width];\r\n \tint[][] arraydown = new int[height][width];\r\n \tint[][] cellRegions = (int[][])state.getExtraData().get(2);\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tarrayacross[y][x] = arraydown[y][x] = 0;\r\n \t\t}\r\n \t}\r\n \t\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tif(state.getCellContents(x,y) == 1)\r\n \t\t\t{\r\n \t\t\t\tif(x+1 < width)\r\n \t\t\t\t{\r\n \t\t\t\t\tif(state.getCellContents(x+1,y) == 1)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif( cellRegions[y][x] != cellRegions[y][x+1])\r\n \t\t\t\t\t\t\tarrayacross[y][x+1] = arrayacross[y][x] + 1;\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tarrayacross[y][x+1] = arrayacross[y][x];\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif(y+1 < height)\r\n \t\t\t\t{\r\n \t\t\t\t\tif(state.getCellContents(x,y+1) == 1)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif( cellRegions[y][x] != cellRegions[y+1][x])\r\n \t\t\t\t\t\t\tarraydown[y+1][x] = arraydown[y][x] + 1;\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tarraydown[y+1][x] = arraydown[y][x];\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}\r\n \t\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tif(arrayacross[y][x] > 1 || arraydown[y][x] > 1)\r\n \t\t\t\treturn error;\r\n \t\t}\r\n \t}\r\n \t\r\n \terror = \"A line of white cells does not exceed two rooms.\";\r\n\r\n\t\treturn error;\r\n }", "public static Evaluation evaluateBoard(String boardState) {\n final Wrapper wrapper = validateBoard(boardState);\n if (wrapper.evaluation == Evaluation.UnreachableState ||\n wrapper.evaluation == Evaluation.InvalidInput) {\n return wrapper.evaluation;\n }\n final int diagonalSize = wrapper.diagonal;\n final ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());\n final CompletionService<Evaluation> completionService = new ExecutorCompletionService<>(executorService);\n completionService.submit(new Worker(wrapper.string, diagonalSize, CallType.H));\n completionService.submit(new Worker(wrapper.string, diagonalSize, CallType.V));\n completionService.submit(new Worker(wrapper.string, diagonalSize, CallType.LD));\n completionService.submit(new Worker(wrapper.string, diagonalSize, CallType.RD));\n for (int i = 0; i < 4; i++) {\n try {\n Evaluation evaluation = completionService.take().get();\n if (evaluation == Evaluation.Owins || evaluation == Evaluation.Xwins) {\n executorService.shutdownNow();\n return evaluation;\n }\n } catch (Exception ignored) {\n }\n }\n return Evaluation.NoWinner;\n }", "private static double downLeftScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && col != 0 && state.getGrid()[row+1][col-1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "private static int rightScore(char piece, State state, int row, int col) {\n\t\tif(col != state.getGrid().length-1 && state.getGrid()[row][col+1] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "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 static int computeGameSituation(int[][] paraCheckerboard) {\n\t\t// Indicate whether or not the row/column/slope is the same.\n\t\tboolean tempSame = false;\n\n\t\t// Step 1. Horizontal\n\t\tfor (int i = 0; i < SIZE; i++) {\n\t\t\tif (paraCheckerboard[i][0] == EMPTY) {\n\t\t\t\tcontinue;\n\t\t\t} // Of if\n\n\t\t\t// A whole row is the same.\n\t\t\ttempSame = true;\n\t\t\tfor (int j = 1; j < SIZE; j++) {\n\t\t\t\tif (paraCheckerboard[i][j] != paraCheckerboard[i][0]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for j\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[i][0];\n\t\t\t} // Of if\n\t\t} // Of for i\n\n\t\t// Step 2. Vertical\n\t\tfor (int j = 0; j < SIZE; j++) {\n\t\t\tif (paraCheckerboard[0][j] == EMPTY) {\n\t\t\t\tcontinue;\n\t\t\t} // Of if\n\n\t\t\t// A whole column is the same.\n\t\t\ttempSame = true;\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\tif (paraCheckerboard[i][j] != paraCheckerboard[0][j]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][j];\n\t\t\t} // Of if\n\t\t} // Of for i\n\n\t\t// Step 3. Slope: Left-top to right-bottom.\n\t\tif (paraCheckerboard[0][0] != EMPTY) {\n\t\t\ttempSame = true;\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\tif (paraCheckerboard[i][i] != paraCheckerboard[0][0]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][0];\n\t\t\t} // Of if\n\t\t} // Of if\n\n\t\t// Step 4. Slope: Right-top to left-bottom.\n\t\tif (paraCheckerboard[0][SIZE - 1] != EMPTY) {\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\ttempSame = true;\n\t\t\t\tif (paraCheckerboard[i][SIZE - i\n\t\t\t\t\t\t- 1] != paraCheckerboard[0][SIZE - 1]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][SIZE - 1];\n\t\t\t} // Of if\n\t\t} // Of if\n\n\t\t// Step 5. Checkboard full\n\t\tboolean tempHasEmpty = false;\n\t\tfor (int i = 0; i < paraCheckerboard.length; i++) {\n\t\t\tfor (int j = 0; j < paraCheckerboard.length; j++) {\n\t\t\t\tif (paraCheckerboard[i][j] == EMPTY) {\n\t\t\t\t\ttempHasEmpty = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for j\n\n\t\t\tif (tempHasEmpty) {\n\t\t\t\tbreak;\n\t\t\t} // Of if\n\t\t} // Of for i\n\t\tif (!tempHasEmpty) {\n\t\t\treturn TIE;\n\t\t} // Of if\n\n\t\treturn UNFINISHED;\n\t}", "public boolean winCheck(){\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j+3] != 0 && board[i+1][j+2] != 0 && board[i+2][j+1] != 0 && \n board[i+3][j] != 0)\n if(board[i][j+3]==(board[i+1][j+2]))\n if(board[i][j+3]==(board[i+2][j+1]))\n if(board[i][j+3]==(board[i+3][j])){\n GBoard[i][j+3].setIcon(star);\n GBoard[i+1][j+2].setIcon(star);\n GBoard[i+2][j+1].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n //checks for subdiagonals\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i+1][j+1] != 0 && board[i+2][j+2] != 0 &&\n board[i+3][j+3] != 0)\n if(board[i][j] == (board[i+1][j+1]))\n if(board[i][j] == (board[i+2][j+2]))\n if(board[i][j] == (board[i+3][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j+1].setIcon(star);\n GBoard[i+2][j+2].setIcon(star);\n GBoard[i+3][j+3].setIcon(star);\n wonYet=true;\n return true;\n } \n }\n }\n //check horizontals\n for(int i=0; i<6; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i][j+1] != 0 && board[i][j+2] != 0 && \n board[i][j+3] != 0){\n if(board[i][j]==(board[i][j+1]))\n if(board[i][j]==(board[i][j+2]))\n if(board[i][j]==(board[i][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i][j+1].setIcon(star);\n GBoard[i][j+2].setIcon(star);\n GBoard[i][j+3].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n //checks for vertical wins\n for(int i=0; i<3; i++){//checks rows\n for(int j=0; j<7; j++){//checks columns\n if(board[i][j] != 0 && board[i+1][j] != 0 && board[i+2][j] != 0 && \n board[i+3][j] != 0){\n if(board[i][j]==(board[i+1][j]))\n if(board[i][j]==(board[i+2][j]))\n if(board[i][j]==(board[i+3][j])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j].setIcon(star);\n GBoard[i+2][j].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n return false; \n }", "@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}", "public void gameOfLife(int[][] board) {\n int m = board.length;\n int n = ( m > 0 ? board[0].length : 0);\n int[] dx = {-1, -1, -1, 0, 1, 1, 1, 0};\n int[] dy = {-1, 0, 1, 1, 1, 0, -1, -1};\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n int cnt = 0;\n /**\n * Count the neighbors with live status.\n */\n for (int k = 0; k < 8; k++) {\n int x = i + dx[k];\n int y = j + dy[k];\n /**\n * Notice using board[x][y] here, not board[i][j]\n * The next state is created by applying the above rules simultaneously to every cell in the current state,\n * so we concern state==1 and state==2(both states indicate live)\n */\n if (x >= 0 && x < m && y >= 0 && y < n && (board[x][y] == 1 || board[x][y] == 2)) {\n cnt++;\n }\n }\n if (board[i][j] == 1 && (cnt < 2 || cnt > 3)) {\n /**\n * From live to dead.\n */\n board[i][j] = 2;\n }\n if (board[i][j] == 0 && cnt == 3) {\n /**\n * From dead to live\n */\n board[i][j] = 3;\n }\n }\n }\n /**\n * Restore state back to 0 and 1.\n */\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n board[i][j] %= 2;\n }\n }\n }", "public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileScore(i,j);\r\n if(gameBoard.tilePlayer(i,j) == 1)\r\n currentBlueScore = currentBlueScore + gameBoard.tileScore(i,j);\r\n }\r\n }", "private static double downRightScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && col != state.getGrid()[row].length-1 && state.getGrid()[row+1][col+1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "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 static boolean ai_NESW(int[][] gameGrid, int pieceTracker, int colNum) //Minor\n\t{\n\t\tint streakBonus = 0;\n\t\tcounter++; //Used to make variations in the AI move logic\n\t\tint rowNum = 0; //Used to store the row when finding the row we need to check for win condition\n\t\t//The loop below is used to find the row of last piece dropped to find exact position\n\t\tfor (int posTracker = 0; posTracker < ConnectFour.getRows(); posTracker++)\n\t\t{\n\t\t\t\n\t\t\tif (gameGrid[posTracker][colNum] != 0)\n\t\t\t{\n\t\t\t\trowNum = posTracker;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (int rowTracker = rowNum + 1, colTracker = colNum - 1; colTracker >= 0 && rowTracker < ConnectFour.getRows(); rowTracker++ ,colTracker--)\n\t\t{\t\n\t\t\tif (counter %2 == 0) //Used to make the switch in the AI move logic\n\t\t\t\tbreak;\n\t\t\tif (gameGrid[rowTracker][colTracker] == pieceTracker) //Increments the streak if consecutive pieces are found\n\t\t\t{\n\t\t\t\tstreakBonus++; \n\t\t\t\tif (streakBonus >= 2)\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (colTracker - 1 > 0) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(colTracker-1); //###\n\t\t\t\t\t\treturn true;\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 (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (colTracker - 2 > 0) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(colTracker-2); //###\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t\tstreakBonus = 0;\n\t\t}\n\t\tfor (int colTracker = colNum + 1, rowTracker = rowNum - 1; colTracker < ConnectFour.getCols() && rowTracker >= 0; rowTracker--, colTracker++)\n\t\t{\n\t\t\tif (gameGrid[rowTracker][colTracker] == pieceTracker) //Increments the streak if consecutive pieces are found\n\t\t\t{\n\t\t\t\tstreakBonus++;\n\t\t\t\tif (streakBonus >= 2)\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (colTracker + 1 < ConnectFour.getCols()) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(colTracker+1); //###\n\t\t\t\t\t\treturn true;\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 (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (colTracker + 2 < ConnectFour.getCols()) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(colTracker+2); //###\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t\tstreakBonus = 0;\n\t\t}\n\t\treturn false; //if steak is not found\n\t}", "private float getQScore(Stone[][] board, int line, int col,\n int depth, int initialDepth){\n Chain chain = new Chain();\n Stone stone;\n if(depth % 2 == 1) stone = new Stone(color ? \"black\" : \"white\", chain);\n else stone = new Stone(color ? \"white\" : \"black\", chain);\n stone.setPosition(line, col);\n int nrStonesRemoved, chainSize, chainLiberties, score;\n board[line][col] = stone;\n //verific daca am luat pietre detinute de oponent\n nrStonesRemoved = Control.verifyNeighbourStones(board, stone.getColor(),\n line, col, false);\n //efectuez eventualele modificari ale lanturilor proprii ce pot aparea in urma plasarii pietrei\n Control.combineChains(board, stone, stone.getColor(), line, col);\n chainSize = stone.getChain().getStones().size();\n chainLiberties = stone.getChain().getLibertiesNumber();\n //aflu scorul starii\n score = nrStonesRemoved * 10 + chainSize * 30 + chainLiberties * 50;\n\n if(depth == 0){\n return (initialDepth % 2 == 1) ? -score : score;\n }\n\n float currentScore, max = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n chain = new Chain();\n if(depth % 2 == 1) stone = new Stone(color ? \"white\" : \"black\", chain);\n else stone = new Stone(color ? \"black\" : \"white\", chain);\n stone.setPosition(i, j);\n int[] lib = Control.verifyLiberties(board, stone, i, j);\n if(board[i][j] == null && lib[0] + lib[1] != 0){\n currentScore = getQScore(board, i, j, depth - 1, initialDepth);\n if(currentScore > max){\n max = currentScore;\n }\n }\n }\n\n score += max * (depth / initialDepth);\n return (depth % 2 == 1) ? score : -score;\n }", "@Override\n public int getWinner() {\n /*\n * To please the test as well as the game\n * Temporarily change the turn colour\n */\n int temp;\n if (whoseTurn() == RED) {\n temp = YELLOW;\n } else {\n temp = RED;\n }\n\n //test horizontally\n //set x to 1 as the placed counter will always be correct\n int x = 1;\n int i = 1;\n //to check if zero has been found\n boolean leftZeroFound = false;\n boolean rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check to right of last placed\n if (!rightZeroFound && inBounds(0, i)\n && board[lastPlacedRow][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check to left of last placed\n if (!leftZeroFound && inBounds(0, -i)\n && board[lastPlacedRow][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check vertically\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n boolean zeroFound = false;\n while (!zeroFound) {\n //check below last placed\n if (inBounds(-i, 0) && board[lastPlacedRow - i][lastPlacedCol] == temp) {\n x++;\n } else {\n zeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top right diagonal\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top right diagonal\n if (!rightZeroFound && inBounds(i, i)\n && board[lastPlacedRow + i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check bottom left\n if (!leftZeroFound && inBounds(-i, -i)\n && board[lastPlacedRow - i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top left\n //set x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top left\n if (!leftZeroFound && inBounds(i, -i)\n && board[lastPlacedRow + i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n //check bottom right\n if (!rightZeroFound && inBounds(-i, i)\n && board[lastPlacedRow - i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //return Empty if a winner has not been found\n return EMPTY;\n }", "private static int leftScore(char piece, State state, int row, int col) {\n\t\tif(col != 0 && state.getGrid()[row][col-1] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "public int determineWinner() {\n\t\tif(board[1][1] != 0 && (\n\t\t\t(board[1][1] == board[0][0] && board[1][1] == board[2][2]) ||\n\t\t\t(board[1][1] == board[0][2] && board[1][1] == board[2][0]) ||\n\t\t\t(board[1][1] == board[0][1] && board[1][1] == board[2][1]) ||\n\t\t\t(board[1][1] == board[1][0] && board[1][1] == board[1][2]))){\n\t\t\treturn board[1][1];\n\t\t}\n\t\telse if (board[0][0] != 0 &&(\n\t\t\t(board[0][0] == board[0][1] && board[0][0] == board[0][2]) ||\n\t\t\t(board[0][0] == board[1][0] && board[0][0] == board[2][0]))){\n\t\t\treturn board[0][0];\n\t\t}\n\t\telse if (board [2][2] != 0 && (\n\t\t\t(board[2][2] == board[2][0] && board[2][2] == board[2][1]) ||\n\t\t\t(board[2][2] == board[0][2] && board[2][2] == board[1][2]))) {\n\t\t\treturn board[2][2];\n\t\t}\n\t\t\n\t\t//See if every square has been marked, return still in progress if not\n\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] == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return tie\n\t\treturn 3;\n\t}", "private static String gameStatus(char[][] board){\n\t\t\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\t// check horizontal lines && vertical lines for player x\n\t\t\tif ((board[i][0] == 'X' && board[i][1] == 'X' && board[i][2] == 'X') || \n\t\t\t\t\t(board[0][i] == 'X' && board[1][i] == 'X' && board[2][i] == 'X')){\n\t\t\t\twinner = 'X';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for x\n\t\tif ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X') || \n\t\t\t\t(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n\t\t\twinner = 'X';\n\t\t\treturn \"true\";\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 3 ; i++) {\n\t\t\t// check horizontal and vertical lines for player o\n\t\t\tif ((board[i][0] == 'O' && board[i][1] == 'O' && board[i][2] == 'O') || \n\t\t\t\t\t(board[0][i] == 'O' && board[1][i] == 'O' && board[2][i] == 'O')){\n\t\t\t\twinner = 'O';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for o\n\t\tif ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O') || \n\t\t\t\t(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n\t\t\twinner = 'O';\n\t\t\treturn \"true\";\n\t\t}\n\n\t\t// check for tie\n\t\tint emptyCells = 9;\n\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]!='\\0') emptyCells -= 1;\t\t\n\t\t\t}\n\t\t}\n\t\t// if all cells are filled, game is over with a tie\n\t\tif (emptyCells == 0) return \"tie\";\n\n\t\t// otherwise game is not over and return false\n\t\t//printBoard(board);\n\n\t\treturn \"false\";\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}", "private static int upScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && state.getGrid()[row-1][col] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}", "private static int getMaxScore(char[][] board){\n\n\t\tString result = gameStatus(board);\n\n\t\tif (result.equals(\"true\") && winner == 'X') return 1; //if x won\n\t\telse if (result.equals(\"true\") && winner == 'O') return -1;//if O won\n\t\telse if (result.equals(\"tie\")) return 0; //if tie\n\t\telse { \n\n\t\t\tint bestScore = -10;\n\t\t\tHashSet<Integer> possibleMoves = findPossibleMoves(board);\n\n\t\t\tfor (Integer move: possibleMoves){\n\n\t\t\t\tchar[][] modifiedBoard = new char[3][3];\n\n\t\t\t\tfor (int row = 0; row < 3; row++){\n\t\t\t\t\tfor (int col = 0; col < 3; col++){\n\t\t\t\t\t\tmodifiedBoard[row][col] = board[row][col];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmodifiedBoard[move/3][move%3]='X';\n\n\t\t\t\tint currentScore = getMinScore(modifiedBoard);\n\n\t\t\t\tif (currentScore > bestScore){\n\t\t\t\t\tbestScore = currentScore;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn bestScore;\n\t\t}\n\t}", "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 }", "public void testScoreboardForBeingJudgedState () throws Exception {\n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20 (a No before first yes)\n \"2,1,A,3,Yes\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"3,1,A,5,No\", // zero -- after Yes\n \"4,1,A,7,Yes\", // zero -- after Yes\n \"5,1,A,9,No\", // zero -- after Yes\n \"6,1,B,11,No\", // zero -- not solved\n \"7,1,B,13,No\", // zero -- not solved\n \"8,2,A,30,Yes\", // 30 (minute points; no Run points on first Yes)\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n// startExplorer(getOutputDataDirectory());\n \n InternalContest contest = new InternalContest();\n \n int numTeams = 2;\n\n initData(contest, numTeams, 5);\n \n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Run [] runs = contest.getRuns();\n \n for (Run run : runs){\n run.setStatus(RunStates.BEING_JUDGED);\n }\n\n checkOutputXML(contest);\n\n confirmRanks(contest, rankData);\n }", "public int terminalTest(int[][] gameBoard) {\n for (int col = 0; col < gameBoard.length; col++) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col][row + 1] == 1 &&\n gameBoard[col][row + 2] == 1 &&\n gameBoard[col][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col][row + 1] == 2 &&\n gameBoard[col][row + 2] == 2 &&\n gameBoard[col][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n // check for horizontal win (searching to the right)\n for (int row = 0; row < gameBoard[0].length; row++) {\n for (int col = 0; col < gameBoard.length - 3; col++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col + 1][row] == 1 &&\n gameBoard[col + 2][row] == 1 &&\n gameBoard[col + 3][row] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col + 1][row] == 2 &&\n gameBoard[col + 2][row] == 2 &&\n gameBoard[col + 3][row] == 2) {\n return 2;\n }\n }\n }\n\n // check for diagonal win (searching down + right)\n for (int col = 0; col < gameBoard.length - 3; col++) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col + 1][row + 1] == 1 &&\n gameBoard[col + 2][row + 2] == 1 &&\n gameBoard[col + 3][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col + 1][row + 1] == 2 &&\n gameBoard[col + 2][row + 2] == 2 &&\n gameBoard[col + 3][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n // check for diagonal win (searching down + left)\n for (int col = gameBoard.length - 1; col >= 3; col--) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col - 1][row + 1] == 1 &&\n gameBoard[col - 2][row + 2] == 1 &&\n gameBoard[col - 3][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col - 1][row + 1] == 2 &&\n gameBoard[col - 2][row + 2] == 2 &&\n gameBoard[col - 3][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n return 0; // neither player has won\n }", "public void checkBoard(){\n\n //check horizontally for a winner\n for(int i = 0; i < 3; i++) {\n if (boardStatus[i][0].equals(boardStatus[i][1]) && boardStatus[i][1].equals(boardStatus[i][2])) {\n if (boardStatus[i][0].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n break;\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n break;\n\n }\n }\n\n\n }\n\n //check vertically for a winner\n for(int i = 0; i < 3; i++) {\n if (boardStatus[0][i].equals(boardStatus[1][i]) && boardStatus[1][i].equals(boardStatus[2][i])) {\n if (boardStatus[0][i].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n break;\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n break;\n }\n }\n }\n\n //diagonally\n\n if((boardStatus[0][0].equals(boardStatus[1][1])) && (boardStatus[0][0].equals(boardStatus[2][2]))){\n\n if (boardStatus[0][0].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n\n }\n else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n\n }\n\n }\n\n //diagonally\n if (boardStatus[0][2].equals(boardStatus[1][1]) && (boardStatus[0][2].equals(boardStatus[2][0]))) {\n\n if (boardStatus[0][2].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n }\n }\n\n //If all the locations on the board have been played but no win conditions have been met\n //the game will end without a winner\n if(boardStatus[0][0] != \"a\" && boardStatus[0][1] != \"b\" && boardStatus[0][2] != \"c\" &&\n boardStatus[1][0] != \"d\" && boardStatus[1][1] != \"e\" && boardStatus[1][2] != \"f\" &&\n boardStatus[2][0] != \"g\" && boardStatus[2][1] != \"h\" && boardStatus[2][2] != \"i\"){\n NoWinnerDialog dialog = new NoWinnerDialog();\n dialog.show(getSupportFragmentManager(), \"NoWinner\");\n }\n\n\n\n\n }", "private static int downScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && state.getGrid()[row+1][col] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\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}", "INDArray getBoardScores() {\n //creez un vector ce va contine aceste scoruri si va putea fi folosit la antrenare\n INDArray boardScores = Nd4j.zeros(1, size * size);\n\n //creez o copie a tablei pentru a o putea modifica\n Stone[][] boardCopy = Board.getBoard(), board = new Stone[size][size];\n\n //gasesc recursiv scorurile tablei curente\n float[][] boardScoresFloat = new float[size][size];\n //simulez o mutare a jucatorului\n int stonesNr = Board.getStonesNr();\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n Chain chain = new Chain();\n Stone stone = new Stone(color ? \"black\" : \"white\", chain);\n stone.setPosition(i, j);\n for (int k = 0; k < boardCopy.length; k++) {\n board[k] = Arrays.copyOf(boardCopy[k], boardCopy[k].length);\n }\n int[] lib = Control.verifyLiberties(board, stone, i, j);\n if(board[i][j] == null && lib[0] + lib[1] != 0){\n int depth = 0;\n int dif = size / 2;\n boardScoresFloat[i][j] = getQScore(board, i, j, depth, depth)\n + new Random().nextInt(1000 / stonesNr) - (500 / stonesNr)\n - abs(i - dif) - abs(j - dif);\n }\n else{\n boardScoresFloat[i][j] = -5000;\n }\n }\n\n //normalizez vectorul\n //aflu norma vectorului de valori\n double sum = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++)\n sum += boardScoresFloat[i][j] * boardScoresFloat[i][j];\n sum = Math.sqrt(sum);\n //aplic norma\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++)\n boardScoresFloat[i][j] /= sum;\n\n //inserez rezultatele gasite intr-un INDArray\n int poz = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n boardScores.putScalar(new int[]{0, poz}, boardScoresFloat[i][j]);\n poz++;\n }\n //System.out.println(boardScores);\n return boardScores;\n }", "private void checkVertical() {\n\n for(int i = 0; i < 2; i++){ // winning column can be either 0-1-2-(3) or (0)-1-2-3\n for (int j = 0; j < stateArray[3].length; j++) {\n\n if (check3Vertical(i, j)) {\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i+1][j] = 1;\n maskArray[i+2][j] = 1;\n }\n\n }\n }\n\n }", "public static int heuristic(PentagoBoardState boardState) {\n\t\tint value = 0;\n\t\t\n\t\tfor (int i = 0; i<size; i++) {\n\t\t\tfor (int j = 0; j<size; j++) {\n\t\t\t\tif (boardState.getPieceAt(i, j) == PentagoBoardState.Piece.BLACK) {\n\t\t\t\t\tvalue += 10;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}", "boolean findMove(int row, int col, int[][] someStatusBoard) {\n String leftPieces;\n if (_playerOnMove == ORANGE) {\n leftPieces = Game._orangePieces;\n } else {\n leftPieces = Game._violetPieces;\n }\n String trialMove = \"\";\n int numleftPieces = leftPieces.length();\n int l, ori;\n for (l = 0; l < numleftPieces; l++) {\n for (ori = 0; ori < 8; ori++) {\n String piecename = leftPieces.substring(l, l + 1);\n Pieces thispiece = new Pieces();\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n int m, n;\n for (m = 0; m < depth; m++) {\n for (n = 0; n < length; n++) {\n if (finalPositions[m][n] == 1) {\n int newCol = col - 1 - n;\n int newRow = 15 - row - depth;\n if (newCol >= 0 && newRow >= 0) {\n trialMove = piecename + changeBack(newCol) + changeBack(newRow) + ori;\n System.out.println(newCol);\n System.out.println(newRow);\n System.out.println(trialMove);\n if (isLegal(trialMove)) {\n return true;\n }\n }\n }\n }\n }\n }\n }\n return false;\n }", "protected void takeTurn(int[][] boardState)\n {\n \n }", "private int checkWinner(int[] arr) {\n for (int i = 0; i <= 6; i += 3) {\n int sum = arr[i] + arr[i + 1] + arr[i + 2];\n if (sum == 3) {\n return 1;\n } else if (sum == -3) {\n return 2;\n }\n }\n\n // Check verticals\n for (int i = 0; i < 3; i++) {\n int sum = arr[i] + arr[i + 3] + arr[i + 6];\n if (sum == 3) {\n return 1;\n } else if (sum == -3) {\n return 2;\n }\n }\n\n // Check diagonals\n int sum = arr[0] + arr[4] + arr[8];\n if (sum == 3) {\n return 1;\n } else if (sum == -3) {\n return 2;\n }\n\n sum = arr[2] + arr[4] + arr[6];\n if (sum == 3) {\n return 1;\n } else if (sum == -3) {\n return 2;\n }\n\n return 0;\n }", "public int checkWin(){\n //check for horizontal and vertical wins\n for(int i=0; i<3; i++){\n if(gameBoard[i][0].equals(\"O\") && gameBoard[i][1].equals(\"O\") && gameBoard[i][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[i][0].equals(\"X\") && gameBoard[i][1].equals(\"X\") && gameBoard[i][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][i].equals(\"O\") && gameBoard[1][i].equals(\"O\") && gameBoard[2][i].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][i].equals(\"X\") && gameBoard[1][i].equals(\"X\") && gameBoard[2][i].equals(\"X\")){\n return 2;\n }\n }\n //check for both diagonal cases\n if(gameBoard[0][0].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][2].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][0].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][0].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][2].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][0].equals(\"X\")){\n return 2;\n }\n return 0;\n }", "static int[][] identifyPositionsAttackedByRooks(int board[][]) {\n int columns = board[0].length;\n int rows = board.length;\n\n\n\n boolean row0ToBeCleared = false;\n boolean column0ToBeCleared = false;\n\n for (int row = 0; row < rows; row++) {\n for (int column = 0; column < columns; column++) {\n if (board[row][column] == 0) {\n if (row == 0) row0ToBeCleared = true;\n board[0][column] = 0;\n\n if (column == 0) column0ToBeCleared = true;\n board[row][0] = 0;\n }\n }\n }\n\n for (int i = 1; i < rows; i++) {\n if (board[i][0] == 0) {\n for (int k = 0; k < columns; k++) board[i][k] = 0;\n }\n }\n\n for (int i = 1; i < columns; i++) {\n if (board[0][i] == 0) {\n for (int k = 0; k < rows; k++) board[k][i] = 0;\n }\n }\n\n if (row0ToBeCleared) {\n for (int i = 0; i < columns; i++) board[0][i] = 0;\n }\n\n if (column0ToBeCleared) {\n for (int i = 0; i < rows; i++) board[i][0] = 0;\n }\n\n return board;\n }", "private int updataChessBoardScoreBinary(Point x, final int[][] chessData,\r\n\t\t\tint color) {\n\t\tint res = 0;\r\n\t\tint combo = 0;\r\n\t\t// System.out.println(\"\"+x.x+\",\"+x.y);\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tLineState pre = getLineStateBinary(x, chessData, i, color, 2, true);\r\n\t\t\tLineState las = getLineStateBinary(x, chessData, i + 4, color, 2,\r\n\t\t\t\t\tfalse);\r\n\r\n\t\t\tint ax = (pre.line << (las.length)) | las.line;\r\n\t\t\tint buf[] = tanslateStateToScoreBinary(new LineState(ax, las.length\r\n\t\t\t\t\t+ pre.length));\r\n\t\t\tres += calculateScore2(buf);\r\n\t\t\tcombo += buf[0] < 0 ? buf[0] : 0;\r\n\r\n\t\t}\r\n\t\tcombo *= -1;\r\n\t\tres += combo > 600 ? combo : 0;\r\n\t\t// System.out.println(\"res:\"+res);\r\n\t\treturn res;\r\n\r\n\t}", "public static void gameOfLife(int[][] board) {\n int[] neighbors = {0, 1, -1};\n\n int rows = board.length;\n int cols = board[0].length;\n\n // Iterate through board cell by cell.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n\n // For each cell, count the number of live neighbors.\n int liveNeighbors = 0;\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n\n if (!(neighbors[i] == 0 && neighbors[j] == 0)) {\n int r = (row + neighbors[i]);\n int c = (col + neighbors[j]);\n\n // Check the validity of the neighboring cell.\n // and whether it was originally a live cell.\n if ((r < rows && r >= 0) && (c < cols && c >= 0) && (Math.abs(board[r][c]) == 1)) {\n liveNeighbors += 1;\n }\n }\n }\n }\n\n // Rule 1 or Rule 3\n if ((board[row][col] == 1) && (liveNeighbors < 2 || liveNeighbors > 3)) {\n // -1 signifies the cell is now dead but originally was live.\n board[row][col] = -1;\n }\n // Rule 4\n if (board[row][col] == 0 && liveNeighbors == 3) {\n // 2 signifies the cell is now live but was originally dead.\n board[row][col] = 2;\n }\n }\n }\n\n // Get the final representation for the newly updated board.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n if (board[row][col] > 0) {\n board[row][col] = 1;\n } else {\n board[row][col] = 0;\n }\n }\n }\n }", "public double heuristic(Bitboard board) {\n double h = 0;\n\n // mobility\n int p1Mobility = 0;\n int p2Mobility = 0;\n // strength of piece positions\n double p1Position = 0;\n double p2Position = 0;\n // number of pieces\n int p1Pieces = 0;\n int p2Pieces = 0;\n // number of connected components\n int p1CC = 0;\n int p2CC = 0;\n // number of isolated circle pieces\n int p1Isolated = 0;\n int p2Isolated = 0;\n\n double weight;\n\n visited = 0;\n // check p1's pieces\n int posMasks = board.getPieces(0);\n int posMask;\n while (posMasks != 0) {\n posMask = posMasks & ~(posMasks - 1);\n posMasks ^= posMask;\n if ((visited & posMask) == 0) {\n if (exploreCC(board, posMask, 0) == 1)\n if (!board.isSquare(posMask))\n p1Isolated++;\n p1CC++;\n }\n weight = board.isSquare(posMask) ? weights[0] : weights[1];\n if (!boardValues.containsKey(posMask)) {\n System.out.println(\"I don't have \" + (int) (Math.log(posMask) / Math.log(2)));\n board.show();\n }\n p1Position += weight * boardValues.get(posMask);\n p1Pieces++;\n }\n // check p2's pieces\n visited = 0;\n posMasks = board.getPieces(1);\n while (posMasks != 0) {\n posMask = posMasks & ~(posMasks - 1);\n posMasks ^= posMask;\n if ((visited & posMask) == 0) {\n if (exploreCC(board, posMask, 1) == 1)\n if (!board.isSquare(posMask))\n p2Isolated++;\n p2CC++;\n }\n weight = board.isSquare(posMask) ? weights[0] : weights[1];\n p2Position += weight * boardValues.get(posMask);\n p2Pieces++;\n }\n\n // perform connected component analysis on empty spaces\n posToAdjCCID.clear();\n ccIDToOwner.clear();\n ownerToCCs.clear();\n int toCheck = (BitMasks.valid & (~board.getPieces()));\n int check;\n int ccId = 0;\n while (toCheck != 0) {\n check = toCheck & ~(toCheck - 1);\n toCheck ^= SearchUtils.checkSpaces(board, check, ccId++, posToAdjCCID, ccIDToOwner,\n ownerToCCs);\n }\n\n // check how close each player's circles are to an \"owned\" connected component\n int circles, circleMask, searchDistance;\n boolean adjacent;\n for (int turn = 0; turn < 2; turn++) {\n circles = board.getCircles(turn);\n while (circles != 0) {\n adjacent = false;\n circleMask = circles & ~(circles - 1);\n circles ^= circleMask;\n if (posToAdjCCID.containsKey(circleMask)) {\n for (int id : posToAdjCCID.get(circleMask)) {\n if (ccIDToOwner.get(id) == turn) {\n adjacent = true;\n break;\n }\n }\n }\n if (!adjacent) {\n searchDistance = search(board, circleMask, turn);\n if (turn == 0 && searchDistance > GameUtils.NUM_SLIDES) {\n h += -weights[6] * searchDistance;\n } else if (turn == 1 && searchDistance > GameUtils.NUM_SLIDES) {\n h += weights[6] * searchDistance;\n }\n }\n }\n }\n\n // a player missing a piece is the ultimate bad position\n if (p1Pieces != 5) {\n return -10000.0;\n }\n if (p2Pieces != 5) {\n return 10000.0;\n }\n // weight the components of the heuristic\n h += weights[2] * p1Mobility;\n h += -weights[2] * p2Mobility;\n h += weights[3] * p1Position;\n h += -weights[3] * p2Position;\n\n // make it so only > 1 connected components impacts heuristic\n h += -weights[4] * (p1CC - 1);\n h += weights[4] * (p2CC - 1);\n\n h += -weights[5] * p1Isolated;\n h += weights[5] * p2Isolated;\n\n h /= 6200; // normalize\n return h;\n }", "private int[] nextDiagWin(){ \r\n\t\t//left diagonal\r\n\t\tif (board[0][0] == board[1][1] && board[2][2] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[1][1] == board[2][2] && board[0][0] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][0] == board[2][2] && board[1][1] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\t//right diagonal\r\n\t\telse if (board[0][2] == board[2][0] && board[1][1] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][2] == board[1][1] && board[2][0] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\t\t\r\n\t\telse if (board[1][1] == board[2][0] && board[0][2] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\treturn diagWin;\r\n\t}", "public static boolean ai_EW(int[][] gameGrid, int pieceTracker, int colNum)\n\t{\n\t\tcounter++; //Used to make variations in the AI move logic\n\t\tint rowNum = 0; //Used to store the row when finding the row we need to check for win condition\n\t\t//The loop below is used to find the row of last piece dropped to find exact position\n\t\tfor (int posTracker = 0; posTracker < ConnectFour.getRows(); posTracker++)\n\t\t{\n\t\t\t\n\t\t\tif (gameGrid[posTracker][colNum] != 0)\n\t\t\t{\n\t\t\t\trowNum= posTracker;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint streakBonus = 0; \n\t\tfor (int tracker = ConnectFour.getCols()-1; tracker > 0; tracker--) //CHECKS THE LEFT\n\t\t{\n\t\t\tif (counter %2 == 0) //Used to make the switch in the AI move logic\n\t\t\t\tbreak;\n\t\t\tif (gameGrid[rowNum][tracker] == pieceTracker) //Increments the streak if consecutive pieces are found\n\t\t\t{\n\t\t\t\tstreakBonus++;\n\t\t\t\tif (streakBonus >= 2)\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tsetCoords(tracker-1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (tracker + 2 < ConnectFour.getCols()) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(tracker+1); //###\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t\tstreakBonus = 0;\n\t\t}\n\t\tfor (int tracker = 0; tracker < ConnectFour.getCols(); tracker++) //CHECKS THE RIGHT\n\t\t{\n\t\t\t\n\t\t\tif (gameGrid[rowNum][tracker] == pieceTracker) //Increments the streak if consecutive pieces are found\n\t\t\n\t\t\t{\n\t\t\t\tstreakBonus++;\n\t\t\t\tif (streakBonus >= 2)\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tsetCoords(tracker+1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (ConnectFour.getFlag()) //Used to prevent same AI move, causing overflow\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (tracker - 2 > 0) //###\n\t\t\t\t\t{\t\n\t\t\t\t\t\tsetCoords(tracker-1);//###\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t\tstreakBonus = 0;\n\t\t}\n\t\treturn false; //if steak is not found\n\t}", "public boolean isWinner() {\n\t\t//initialize row, column, and depth\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint dep = 0;\n\t\t\n\t\t//Checks for a vertical four in a row\n\t\t//row is restriced from the full size to >=3 to avoid\n\t\t//an out of bounds exception\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size; col ++)\n\t\t\t\tfor(dep = 0; dep < size; dep ++) {\n\t\t\t\t\t//a variable check is made to save lines\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\t//checks if the value is a player, and it\n\t\t\t\t\t//qualifies as a vertical win. If it does,\n\t\t\t\t\t//the for loop returns true.\n\t\t\t\t\tif (check != -1\n\t\t\t\t\t\t && check == board[row - 1][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 2][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 3][col][dep] )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t//check for horizontal four in a row\n\t\t//col is restriced and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row][col + 2][dep] \n\t\t\t\t\t\t\t&& check == board[row][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y upDiagnol four in a row on each depth\n\t\t//row is restricted and decreasing (-)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y downDiagnol four in a row on each depth\n\t\t//row is restricted and increasing (+)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = 0; row < size - 3; row ++)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z horizontal four in a row on each column\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z upDiagnol four in a row on ecah column\n\t\t//row is restricted and decreasing (-)\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row - 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row - 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z downDiagnol four in a row\n\t\t// dep +, row +\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row + 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row + 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top right\n\t\t//row -, col +, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top left\n\t\t//row -, col -, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down left\n\t\t//row -, col -, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down right\n\t\t//row -, col +, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//Same as above, but now row increases rather than decreasing\n\t\t//check for down diagnol from top left to center\n\t\t//row +, col +, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1\n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from top right to center\n\t\t//row + , col -, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom left to center\n\t\t//row +, col -, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom right to center\n\t\t//row +, col +, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//check for diagonals where row stays the same, but x,z change\n\t\t//depth up diagnol, col +, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down diagnol, col +, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t// depth down left diagnol, col -, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down right diagnol, col -, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//returns false if none of the above return true\n\t\treturn false;\n\t}", "public static boolean isBlackWin(char[][] board){\r\n for (int r= 0; r < 6; r++ ){\r\n for (int c = 0; c < 7; c++){\r\n if (r < 3){\r\n if (board [r][c] =='b' && board [r + 1][c] =='b' && board [r + 2][c] =='b' && board [r + 3][c] =='b' ){\r\n return true;\r\n }\r\n }\r\n if (c < 4){\r\n if (board [r][c] =='b' && board [r][c + 1] =='b' && board [r ][c + 2] =='b' && board [r][c + 3] =='b' ){\r\n return true;\r\n }\r\n }\r\n\r\n \r\n }\r\n }\r\n \r\n for (int r = 0; r < 3; r++){\r\n for (int c = 0; c < 4; c++){\r\n if (board [r][c] =='b' && board [r + 1][c +1 ] =='b' && board [r + 2][c +2] =='b' && board [r + 3][c +3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n\r\n for (int r = 0; r < 3 ; r++){\r\n for (int c = 6; c > 2; c--){\r\n if (board [r][c] =='b' && board [r + 1][c - 1 ] =='b' && board [r + 2][c - 2] =='b' && board [r + 3][c - 3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n return false;\r\n }", "public boolean checkForWin()\n {\n //Horizontal win\n for (int r = 0; r <= 5; r++)\n {\n for (int c = 0; c <= 3; c++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r] == player_turn &&\n current_board[c+2][r] == player_turn &&\n current_board[c+3][r] == player_turn)\n return true;\n }\n }\n //Vertical win\n for (int c = 0; c <= 6; c++)\n {\n for (int r = 0; r <= 2; r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c][r+1] == player_turn &&\n current_board[c][r+2] == player_turn &&\n current_board[c][r+3] == player_turn)\n return true;\n }\n }\n //Shortest diagonals/anti diagonals (cell length == 4)\n //postive slope\n if (current_board[0][2] == player_turn && current_board[1][3] == player_turn && current_board[2][4] == player_turn && current_board[3][5] == player_turn)\n return true;\n if (current_board[3][0] == player_turn && current_board[4][1] == player_turn && current_board[5][2] == player_turn && current_board[6][3] == player_turn)\n return true;\n //negative slope\n if (current_board[0][3] == player_turn && current_board[1][2] == player_turn && current_board[2][1] == player_turn && current_board[3][0] == player_turn)\n return true;\n if (current_board[3][5] == player_turn && current_board[4][4] == player_turn && current_board[5][3] == player_turn && current_board[6][2] == player_turn)\n return true;\n\n //Medium-length diagonals/anti diagonals (cell length == 5)\n //positive slope\n if (current_board[0][1] == player_turn && current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn)\n return true;\n if (current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn && current_board[4][5] == player_turn)\n return true;\n if (current_board[2][0] == player_turn && current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn)\n return true;\n if (current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn && current_board[6][4] == player_turn)\n return true;\n //negative slope\n if (current_board[0][4] == player_turn && current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn)\n return true;\n if (current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn && current_board[4][0] == player_turn)\n return true;\n if (current_board[2][5] == player_turn && current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn)\n return true;\n if (current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn && current_board[6][1] == player_turn)\n return true;\n\n //Longest diagonals/anti diagonals (cell length == 6)\n //positive slope\n for (int c=0, r=0; c <= 2 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n for (int c=1, r=0; c <= 3 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n //negative slope\n for (int c=0, r=5; c <= 2 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n for (int c=1, r=5; c <= 3 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n\n return false;\n }", "void analyzeBoard() {\n if (onProcessCompleteListener == null) {\n return;\n }\n\n if ((!isWin(TTTConstants.CIRCLE, true)) && (!isWin(TTTConstants.CROSS, true)) && (depth >= 9)) {\n onProcessCompleteListener.onGameDraw();\n }\n }", "public static double winningChances(final Board b, final MNKCellState p) {\n board = b;\n player = p;\n M = board.M;\n N = board.N;\n K = board.K;\n klog = Math.log(K);\n\n double chance = 0;\n\n // check all columns\n for (int i = 0; i < M && M - i + currStreak >= K; i++) {\n reset();\n for (int j = 0; j < N && N - j + currStreak >= K; j++) chance += checkCell(i, j);\n }\n\n // check all rows\n for (int j = 0; j < N && N - j + currStreak >= K; j++) {\n reset();\n for (int i = 0; i < M && M - i + currStreak >= K; i++) chance += checkCell(i, j);\n }\n\n // iterate over all diagonals\n int nDiagonals = (Math.min(N, M) - K) * 2 + 1;\n for (int x = 0; x < nDiagonals; x++) {\n reset();\n int i = 0, j = 0;\n if (x != 0 && x % 2 == 0) i = x / 2;\n else if (x != 0) j = x;\n\n // TODO: don't check useless cells like in prev loops\n while (i < M && j < N) {\n checkCell(i, j);\n j++;\n i++;\n }\n }\n\n // iterate over all counter diagonals\n for (int x = 0; x < nDiagonals; x++) {\n reset();\n int i = 0, j = N - 1;\n if (x != 0 && x % 2 == 0) i = x / 2;\n else if (x != 0) j = N - 1 - x;\n\n while (i < M && j >= 0) {\n checkCell(i, j);\n j--;\n i++;\n }\n }\n\n return chance;\n }", "static int score(int[] state) {\n int no = 0;\n for (int i = 1; i < 10; i++) {\n if (state[i] == 1) {\n no *= 10; no += i;\n }\n }\n return no;\n }", "public static int checkForWin(BitSet state, BitSet theirBoard) {\n \n BitSet[] myWins = Shifts.doShifts(state, 5, true);\n BitSet[] theirWins = Shifts.doShifts(theirBoard, 5, true);\n\n\n boolean iWon = !myWins[0].isEmpty() || !myWins[1].isEmpty() || !myWins[2].isEmpty() || !myWins[3].isEmpty();\n boolean theyWon = !theirWins[0].isEmpty() || !theirWins[1].isEmpty() || !theirWins[2].isEmpty() || !theirWins[3].isEmpty();\n \n if (iWon && theyWon) {\n //draw, we both have a win\n return 0;\n }\n else if (iWon) {\n return 3000; \n }\n else if (theyWon){\n return -3000;\n }\n else {\n return 13;\n }\n }", "public void checkCellStatus()\r\n {\r\n for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n {\r\n for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n {\r\n checkNeighbours(rows, columns);\r\n } // end of for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n } // end of for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n }", "public int getResult() {\n whiteTotal = 0;\n blackTotal = 0;\n rest = 0;\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int column = 0; column < BOARD_SIZE; column++) {\n if (board[row][column] == BLACK) {\n blackTotal++;\n } else if (board[row][column] == WHITE) {\n whiteTotal++;\n } else {\n rest++;\n }\n }\n }\n int winner = -1;\n if (rest == 0) {\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n\n if (blackTotal == 0 || whiteTotal == 0) {\n\n if (blackTotal != 0) {\n winner = 2;\n } else if (whiteTotal != 0) {\n winner = 1;\n }\n }\n\n if (getValidateMoveList('W', 'B').isEmpty() && getValidateMoveList('B', 'W').isEmpty()) {\n\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n return winner;\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 Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }", "private static boolean updateHoleStates(int holeID, HoleState newState, HoleState state[], boolean rowMatrix[][], boolean colMatrix[][], boolean rowColMatrix[][], HashSet<Integer> visitedRows, HashSet<Integer> visitedCols)\r\n {\n \r\n int ids[];\r\n state[holeID-1]=newState;\r\n if(isHoleInRow(holeID))\r\n {\r\n ids = getHolesInRow(getRowIDFromHoleID(holeID));\r\n } else {\r\n ids = getHolesInColumn(getColumnIDFromHoleID(holeID));\r\n }\r\n \r\n for(int i=0; i<ids.length; i++)\r\n {\r\n state[ids[i]-1]=newState;\r\n }\r\n \r\n if(isHoleInRow(holeID))\r\n {\r\n int rid = getRowIDFromHoleID(holeID);\r\n visitedRows.add(rid);\r\n \r\n //Utility.alert(\"ROWID=\"+rid);\r\n \r\n // scan row-connections\r\n for(int i=0; i<rowMatrix[rid-1].length; i++)\r\n {\r\n if(i==rid-1) continue;\r\n if(rowMatrix[rid-1][i])\r\n {\r\n // has connection to (i+1)-th row \r\n if(!visitedRows.contains(i+1))\r\n {\r\n int frid = getFirstHoleIDInRow(i+1);\r\n updateHoleStates(frid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n \r\n // scan row-col connections\r\n for(int i=0; i<rowColMatrix[rid-1].length; i++)\r\n {\r\n if(rowColMatrix[rid-1][i])\r\n {\r\n //Utility.alert(\"ROW has connection to \"+(i+1)+\" col\");\r\n // has connection to (i+1)-th col\r\n if(!visitedCols.contains(i+1))\r\n {\r\n //Utility.alert(\"NOT VISITED\");\r\n \r\n visitedCols.add(i+1);\r\n int fcid = getFirstHoleIDInColumn(i+1);\r\n updateHoleStates(fcid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n } else {\r\n int cid = getColumnIDFromHoleID(holeID);\r\n visitedCols.add(cid);\r\n \r\n for(int i=0; i<colMatrix[cid-1].length; i++)\r\n {\r\n if(i==cid-1) continue;\r\n if(colMatrix[cid-1][i])\r\n {\r\n // has connection to (i+1)-th column \r\n if(!visitedCols.contains(i+1))\r\n {\r\n int fcid = getFirstHoleIDInColumn(i+1);\r\n updateHoleStates(fcid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n \r\n // scan row-col connections\r\n for(int i=0; i<rowColMatrix.length; i++)\r\n {\r\n if(rowColMatrix[i][cid-1])\r\n {\r\n // has connection to (i+1)-th row \r\n if(!visitedRows.contains(i+1))\r\n {\r\n visitedRows.add(i+1);\r\n int frid = getFirstHoleIDInRow(i+1);\r\n updateHoleStates(frid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n }\r\n \r\n return true;\r\n }", "private static void solve2(Board bd) throws SolutionFoundException {\n\t\tst = new StackImage();\n\n\t\tdepth ++;\n\n\t\tif(depth < -1) {\n\t\t\tbd.checkForSolution();\n\t\t\tthrow new SolutionFoundException();\n\t\t}\n\n\t\tst.cnt = 0;\n\t\tfor( st.r=0;st.r<bd.getBoard_size();++st.r) \n\t\t\tfor( st.c=0;st.c<bd.getBoard_size(); ++st.c) {\n\t\t\t\tif(bd.getPossibilities(st.r, st.c) >= 1) {\n\n\t\t\t\t\tfor(st.p=0;st.p<bd.getBoard_size();++st.p) {\n\t\t\t\t\t\t//System.out.println(\"Status check \" + st.r + \" \" + st.c + \" \" + st.p + \" \" + (bd.check(st.r, st.c, st.p)) + \" \" + (bd.verify(st.r,st.c,st.p)));\n\t\t\t\t\t\tif(bd.check(st.r, st.c, st.p) && bd.verify(st.r,st.c,st.p)) {\n\t\t\t\t\t\t\tst.bi = bd.assign(st.r, st.c, st.p);\n\t\t\t\t\t\t\tSystem.out.println(\"CHoice at \" + st.r + \" \" + st.c + \" \" + st.p);\n\t\t\t\t\t\t\tmoves.add( st );\n\t\t\t\t\t\t\tsolve2(bd);\n\t\t\t\t\t\t\tst = moves.removeLast();\n\t\t\t\t\t\t\tbd.restore(st.r,st.c,st.bi);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t++st.cnt;\n\t\t\t\t\treturn;\n\t\t\t\t} else if(bd.getPossibilities(st.r, st.c) == 0 && !bd.isOnlyOne(st.r, st.c)) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t}\n\n\t\tif(st.cnt == 0) {\n\t\t\tbd.checkForSolution();\n\t\t\tthrow new SolutionFoundException();\n\t\t}\n\t\t--depth;\t\t\n\t\tst = null;\n\t}", "int checkWinner(char mark) {\n\t\tint row, col;\n\t\tint result = 0;\n\n\t\tfor (row = 0; result == 0 && row < 3; row++) {\n\t\t\tint row_result = 1;\n\t\t\tfor (col = 0; row_result == 1 && col < 3; col++)\n\t\t\t\tif (theBoard[row][col] != mark)\n\t\t\t\t\trow_result = 0;\n\t\t\tif (row_result != 0)\n\t\t\t\tresult = 1;\n\t\t}\n\n\t\t\n\t\tfor (col = 0; result == 0 && col < 3; col++) {\n\t\t\tint col_result = 1;\n\t\t\tfor (row = 0; col_result != 0 && row < 3; row++)\n\t\t\t\tif (theBoard[row][col] != mark)\n\t\t\t\t\tcol_result = 0;\n\t\t\tif (col_result != 0)\n\t\t\t\tresult = 1;\n\t\t}\n\n\t\tif (result == 0) {\n\t\t\tint diag1Result = 1;\n\t\t\tfor (row = 0; diag1Result != 0 && row < 3; row++)\n\t\t\t\tif (theBoard[row][row] != mark)\n\t\t\t\t\tdiag1Result = 0;\n\t\t\tif (diag1Result != 0)\n\t\t\t\tresult = 1;\n\t\t}\n\t\tif (result == 0) {\n\t\t\tint diag2Result = 1;\n\t\t\tfor (row = 0; diag2Result != 0 && row < 3; row++)\n\t\t\t\tif (theBoard[row][3 - 1 - row] != mark)\n\t\t\t\t\tdiag2Result = 0;\n\t\t\tif (diag2Result != 0)\n\t\t\t\tresult = 1;\n\t\t}\n\t\treturn result;\n\t}", "private void checkHorizontal() {\n\n for(int i = 0; i < stateArray.length; i++) {\n for (int j = 0; j < 2; j++){ // iterate only twice, because winning row\n \t // can be either 0-1-2-(3) or (0)-1-2-3\n if (check3Horizontal(i, j)){\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i][j+1] = 1;\n maskArray[i][j+2] = 1;\n }\n\n }\n }\n\n }", "public boolean CheckVictory()\n {\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(i, 0),\n getCell(i, 1),\n getCell(i, 2),\n getCell(i, 3),\n getCell(i, 4),\n getCell(i, 5) )){\n Winner=getCell(i, 2);\n return true;\n }\n }\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(0,i),\n getCell(1,i),\n getCell(2,i),\n getCell(3,i),\n getCell(4,i),\n getCell(5,i) )){\n Winner=getCell(2, i);\n return true;\n }\n }\n CellType[] arrTypes={getCell(0, 0),getCell(1, 1),getCell(2, 2),getCell(3, 3),\n getCell(4, 4),getCell(5, 5)};\n\n \n if(isFiveAligned(arrTypes))\n {\n Winner=arrTypes[2];\n return true;\n }\n\n CellType[] REVERSE_arrTypes={getCell(0, 5),getCell(1, 4),getCell(2, 3),getCell(3, 2),\n getCell(4, 1),getCell(5, 0)};\n\n \n\n if(isFiveAligned(REVERSE_arrTypes))\n {\n Winner=REVERSE_arrTypes[2]; \n return true;\n }\n\n\n if(isFiveAligned(new CellType[]{getCell(0, 1),\n getCell(1, 2),\n getCell(2, 3),\n getCell(3, 4),\n getCell(4, 5),\n CellType.None\n })) {\n Winner=getCell(3, 4);\n return true;\n }\n \n if(isFiveAligned(new CellType[]{getCell(1, 0),\n getCell(2, 1),\n getCell(3, 2),\n getCell(4, 3),\n getCell(5, 4),\n CellType.None\n })) {\n Winner=getCell(4, 3);\n return true;\n }\n\n if(isFiveAligned(new CellType[]{\n getCell(4, 0),\n getCell(3, 1),\n getCell(2, 2),\n getCell(1, 3),\n getCell(0, 4),\n CellType.None\n \n })){\n Winner=getCell(2, 2);\n return true;}\n\n if(isFiveAligned(new CellType[]{\n getCell(5, 1),\n getCell(4, 2),\n getCell(3, 3),\n getCell(2, 4),\n getCell(1, 5),\n CellType.None\n \n })){\n Winner=getCell(3, 3);\n return true;}\n\n \n \n\n\n \n\n return false;\n }", "public static int gameOver(Node nd){\n\t\tint win;\n\t\tfor(int i=0; i<6; i++){\n\t\t\tfor(int j=0; j<7; j++){\n\t\t\t\tif((win = utilVert(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilHori(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilRDiag(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilLDiag(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(fullBoard(nd))\n\t\t\treturn 1;\n\n\t\treturn 0;\n\t}", "public int verify() {\n\t\tint incorrect = 0; // Number of incorrect squares.\n\t\tint match = 0; // Number of matches in an array\n\n\t\t// Verify that the nonzero values in initialState\n\t\t// are the same numbers as in currentState.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.initialState[row][col] != 0) {\n\t\t\t\t\tif (this.initialState[row][col] != this.currentState[row][col]) {\n\t\t\t\t\t\tincorrect++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that there are no blank spots in the\n\t\t// sudoku. Blank spots, in this program, are\n\t\t// represented by zeroes. To do that, we'll\n\t\t// simply count the zeroes in the entire sudoku\n\t\t// and add them to 'incorrect'.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.currentState[col][row] == 0) {\n\t\t\t\t\tincorrect++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each row only has unique\n\t\t// numbers and that each number ranges\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[col][i]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each column only has unique\n\t\t// numbers and that each number range\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\tfor (int col = 0; col < 9; col++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[i][row]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each square has only unique\n\t\t// numbers and that each number range\n\t\t// from one through four.\n\t\t// First, I made four temporary 2x2 arrays,\n\t\t// then I basically put each square of the\n\t\t// sudoku into each array, then I checked\n\t\t// the validity of each square, incrementing\n\t\t// the incorrect variable by one for each\n\t\t// duplicate in each square.\n\n\t\t// từng hình vuông nhỏ\n\t\t// cho mục đích xác nhận\n\t\tint[][] tempOne = new int[3][3];\n\t\tint[][] tempTwo = new int[3][3];\n\t\tint[][] tempThree = new int[3][3];\n\t\tint[][] tempFour = new int[3][3];\n\t\tint[][] tempFive = new int[3][3];\n\t\tint[][] tempSix = new int[3][3];\n\t\tint[][] tempSeven = new int[3][3];\n\t\tint[][] tempEight = new int[3][3];\n\t\tint[][] tempNine = new int[3][3];\n\n\t\t// chia Sudoku thành 9 mảng nhỏ\n\t\t// 1 mảng cho 1 hình vuông\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t// chạy từng ô vuông nhỏ\n\t\t\tswitch (row) {\n\t\t\tcase 0:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"You shouldn't be here...\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// xác nhận mỗi hình vuông có duy nhất 1 số nguyên từ 1-9\n\t\tint matchOne = 0;\n\t\tint matchTwo = 0;\n\t\tint matchThree = 0;\n\t\tint matchFour = 0;\n\t\tint matchFive = 0;\n\t\tint matchSix = 0;\n\t\tint matchSeven = 0;\n\t\tint matchEight = 0;\n\t\tint matchNine = 0;\n\n\t\t// The first two for loops fix a number to be compared.\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t// These two for loops cycles through the square,\n\t\t\t\t// counting the number of matches along the way.\n\t\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\t\t\tif (tempOne[row][col] == tempOne[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchOne++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempTwo[row][col] == tempTwo[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchTwo++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempThree[row][col] == tempThree[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchThree++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFour[row][col] == tempFour[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFour++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFive[row][col] == tempFive[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFive++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSix[row][col] == tempSix[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSix++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSeven[row][col] == tempSeven[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSeven++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempEight[row][col] == tempEight[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchEight++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempNine[row][col] == tempNine[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchNine++;\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// If there is more than one match, the match variable\n\t\t\t\t// is decremented by one (so the original number isn't\n\t\t\t\t// counted) and added to the number of incorrect\n\t\t\t\t// squares in the sudoku.\n\t\t\t\tif (matchOne > 1) {\n\t\t\t\t\tincorrect += matchOne;\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t}\n\t\t\t\tif (matchTwo > 1) {\n\t\t\t\t\tincorrect += matchTwo;\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t}\n\t\t\t\tif (matchThree > 1) {\n\t\t\t\t\tincorrect += matchThree;\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t}\n\t\t\t\tif (matchFour > 1) {\n\t\t\t\t\tincorrect += matchFour;\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Returns the number of incorrect numbers in the array.\n\t\treturn incorrect;\n\t}", "private Move produceHeuristicMove(Board board){\n\n\t\tint numRows = board.getNumberOfRows();\n\t\tint[][] bins = new int[numRows][BINARY_LENGTH];\n\t\tint[] binarySum = new int[BINARY_LENGTH];\n\t\tint bitIndex,higherThenOne=0,totalOnes=0,lastRow=0,lastLeft=0,lastSize=0,lastOneRow=0,lastOneLeft=0;\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\tbinarySum[bitIndex] = 0;\n\t\t}\n\t\t\n\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\n\t\t\tint curRowLength = board.getRowLength(k+1);\n\t\t\tint i = 0;\n\t\t\tint numOnes = 0;\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbins[k][bitIndex] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tdo {\n\t\t\t\tif(i<curRowLength && board.isStickUnmarked(k+1,i+1) ){\n\t\t\t\t\tnumOnes++;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tif(numOnes>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString curNum = Integer.toBinaryString(numOnes);\n\t\t\t\t\t\twhile(curNum.length()<BINARY_LENGTH){\n\t\t\t\t\t\t\tcurNum = \"0\" + curNum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\t\t\t\tbins[k][bitIndex] += curNum.charAt(bitIndex)-'0'; //Convert from char to int\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(numOnes>1){\n\t\t\t\t\t\t\thigherThenOne++;\n\t\t\t\t\t\t\tlastRow = k +1;\n\t\t\t\t\t\t\tlastLeft = i - numOnes + 1;\n\t\t\t\t\t\t\tlastSize = numOnes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttotalOnes++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastOneRow = k+1;\n\t\t\t\t\t\tlastOneLeft = i;\n\t\t\t\t\t\t\n\t\t\t\t\t\tnumOnes = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}while(i<=curRowLength);\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbinarySum[bitIndex] = (binarySum[bitIndex]+bins[k][bitIndex])%2;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//We only have single sticks\n\t\tif(higherThenOne==0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//We are at a finishing state\t\t\t\t\n\t\tif(higherThenOne<=1){\n\t\t\t\n\t\t\tif(totalOnes == 0){\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1) - 1);\n\t\t\t} else {\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1)-(1-totalOnes%2));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH-1;bitIndex++){\n\t\t\t\n\t\t\tif(binarySum[bitIndex]>0){\n\t\t\t\t\n\t\t\t\tint finalSum = 0,eraseRow = 0,eraseSize = 0,numRemove = 0;\n\t\t\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\t\t\n\t\t\t\t\tif(bins[k][bitIndex]>0){\n\t\t\t\t\t\teraseRow = k+1;\n\t\t\t\t\t\teraseSize = (int)Math.pow(2,BINARY_LENGTH-bitIndex-1);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int b2 = bitIndex+1;b2<BINARY_LENGTH;b2++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(binarySum[b2]>0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(bins[k][b2]==0){\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum + (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum - (int)Math.pow(2,BINARY_LENGTH-b2-1);\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\t\n\t\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\t\n\t\t\t\tnumRemove = eraseSize - finalSum;\n\t\t\t\t\n\t\t\t\t//Now we find that part and remove from it the required piece\n\t\t\t\tint numOnes=0,i=0;\n\t\t\t\twhile(numOnes<eraseSize){\n\n\t\t\t\t\tif(board.isStickUnmarked(eraseRow,i+1)){\n\t\t\t\t\t\tnumOnes++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnumOnes=0;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn new Move(eraseRow,i-numOnes+1,i-numOnes+numRemove);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we reached here, and the board is not symmetric, then we only need to erase a single stick\n\t\tif(binarySum[BINARY_LENGTH-1]>0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//If we reached here, it means that the board is already symmetric, and then we simply mark one stick from the last sequence we saw:\n\t\treturn new Move(lastRow,lastLeft,lastLeft);\t\t\n\t}", "public static void main(String args[]){\n int count = 1; \n long time1, time2;\n long redSum= 0;\n long blackSum =0;\n char[][] board = {\n {'W','B','W','B','W','B','W','B'},\n {'B','W','B','W','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','E','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','W','B','W','B','X'},\n {'X','B','X','B','X','B','X','B'},\n {'B','X','B','W','B','W','B','W'}\n \n } ;\n \n char[][] oldBoard = board;\n System.out.println(\"WIBB\");\n printBoard(board);\n while(count>0){\n \n time1 = new Date().getTime();\n for(int i =0; i<6; i++){\n \n // AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, i);\n \n //isRedAI.getBestMove();\n \n }\n ArrayList<MoveCoordinates> aThing = new ArrayList<>();\n \n AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, 3, aThing);\n // time1 = new Date().getTime();\n BoardMovesPair best= isRedAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nRed's turn: \" + (count +1) );\n redSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n printBoard(board);\n ArrayList<MoveCoordinates> allMoves = best.getAllMoves();\n if(allMoves == null){\n \n System.out.println(\"IS A NULL!!!\");\n \n }\n for(int i =0; i<allMoves.size(); i++){\n \n \n System.out.println(allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n \n AlphaBetaTree isBlackAI = new AlphaBetaTree(null, false, 0, -1000, 1000, 0, board, 3, aThing);\n \n \n time1 = new Date().getTime();\n best = isBlackAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nBlacks's turn: \" + (count +1) );\n blackSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n \n printBoard(board);\n \n allMoves = best.getAllMoves();\n for(int i =0; i<allMoves.size(); i++){\n \n System.out.println(\"UM!? \" + allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n count--;\n System.out.println(\"Count is: \" +count);\n }\n System.out.println(\"Red pieces: \" + BoardUtilities.countPieces('O', board));\n System.out.println(\"Red Kings: \" + BoardUtilities.countPieces('E', board));\n System.out.println(\"Average move: \" + (redSum/(count+1)) + \"ms\" );\n \n System.out.println(\"Black pieces: \" + BoardUtilities.countPieces('X', board));\n System.out.println(\"Black Kings: \" + BoardUtilities.countPieces('K', board));\n System.out.println(\"Average move: \" + (blackSum/(count+1)) + \"ms\" );\n printBoard(board);\n \n }", "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 }", "void seeIfTrue() {\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"FOUND A SQUARE WITH ONLY ONE POSSIBLE OPTION\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[j][k][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"found a vertical line that had an optional input the number \" + (i + 1) + \" at line: \" + j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[k][j][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"found a horizontal line that had an optional input the number \" + (i + 1) + \" at line: \" + j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public int checkForWin() \r\n {\r\n \twinner = null;\r\n \tint winrole = -1;\r\n \tif(isBoardFull()){\r\n \t\tint white = 0;\r\n \t\tint black = 0;\r\n\t\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\t\tfor(int j = 0; j<boardsize; ++j){\r\n\t\t\t\t\tif(board[i][j] == 0){\r\n\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(board[i][j] == 1){\r\n\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(white > black){\r\n\t\t\t\twinrole = 0;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\t\r\n\t\t\telse if(black > white){\r\n\t\t\t\twinrole = 1;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twinrole=2;\r\n\t\t\t}\r\n\t\t\treturn winrole;\r\n \t}\r\n \treturn -1;\r\n }", "public void testScoreboardCaseFour () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", //20\n \"2,1,A,3,Yes\", //3 (first yes counts Minutes only)\n \"3,1,A,5,No\", //20\n \"4,1,A,7,Yes\", //20 \n \"5,1,A,9,No\", //20\n \n \"6,1,B,11,No\", //20 (all runs count)\n \"7,1,B,13,No\", //20 (all runs count)\n \n \"8,2,A,30,Yes\", //30\n \n \"9,2,B,35,No\", //20 (all runs count)\n \"10,2,B,40,No\", //20 (all runs count)\n \"11,2,B,45,No\", //20 (all runs count)\n \"12,2,B,50,No\", //20 (all runs count)\n \"13,2,B,55,No\", //20 (all runs count)\n\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 4 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// Team 1 -- 123 <-- Team 1 is winning again\n// Team 2 -- 130\n \n// String [] rankData = {\n// \"1,team1,1,123\",\n// \"2,team2,1,130\"\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "public int getScore() {\n\t\tint darkDisks = 0;\r\n\t\tint lightDisks = 0;\r\n\r\n\t\tfor(Character c : board){\r\n\t\t\tif(c == '1'){\r\n\t\t\t\tdarkDisks++;\r\n\t\t\t}\r\n\t\t\telse if(c == '2'){\r\n\t\t\t\tlightDisks++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If dark wins\r\n\t\tif(darkDisks > lightDisks){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//If light wins\r\n\t\telse if(darkDisks < lightDisks){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t//For a tie\r\n\t\telse if(darkDisks == lightDisks){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t//Return 0 on a tie\r\n\t\treturn 0;\r\n\t}", "private int getCost(Game game) {\n\n // Represents the sum of each tile value multiplied by its column index (Gives a tendency to move to the left)\n int weightedSum = 0;\n\n // Represents the number of diagonal pairs of matching value on the board.\n int diagCount = 0;\n\n // The number of tiles on the grid\n int tileCount = 0;\n\n Tile[][] tiles = game.tiles;\n\n for (int x = 0; x < BOARD_X; x++) {\n for (int y = 0; y < BOARD_Y; y++) {\n Tile tile = tiles[x][y];\n\n // Skip empty squares\n if (tile == null) {\n continue;\n }\n\n // Increment the weighted sum with product of the row index and the tile's value\n weightedSum += x * tile.getValue();\n tileCount++;\n\n // If all squares are occupied, return an arbitrarily large value such that this option is not picked.\n if (tileCount == maxTileCount) {\n return 100000;\n }\n\n // Since only up right and down right diagonals are computed, ignore the last row as this would push\n // index's out of range.\n if (x == BOARD_X - 1) {\n continue;\n }\n\n // Retrieve the upper right tile and updates the diagonal counter\n if (y > 0) {\n Tile ur = tiles[x + 1][y - 1];\n if (ur != null) {\n diagCount += (ur.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n\n // Retrieve the lower right tile and updates the diagonal counter\n if (y < BOARD_Y - 1) {\n Tile dr = tiles[x + 1][y + 1];\n if (dr != null) {\n if (dr.getValue() == tile.getValue()) {\n diagCount += (dr.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n }\n }\n }\n\n return weightedSum + diagCount;\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 }", "public static String checkResult() {\n\n int numWinningRows = 0;\n char winner = ' ';\n int numX = 0;\n int numO = 0;\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if(gameBoard[i][j] == 'X'){\n numX++;\n } else if(gameBoard[i][j] == 'O') {\n numO++;\n }\n }\n }\n// System.out.println(line);\n// System.out.println(Arrays.deepToString(board));\n\n char[] topRow = new char[3];\n char[] midRow = new char[3];\n char[] btmRow = new char[3];\n char[] leftCol = new char[3];\n char[] centerCol = new char[3];\n char[] rightCol = new char[3];\n char[] diagLeft = new char[3];\n char[] diagRight = new char[3];\n\n for (int i = 0; i < 3; i++) {\n topRow[i] = gameBoard[0][i];\n midRow[i] = gameBoard[1][i];\n btmRow[i] = gameBoard[2][i];\n leftCol[i] = gameBoard[i][0];\n centerCol[i] = gameBoard[i][1];\n rightCol[i] = gameBoard[i][2];\n diagLeft[i] = gameBoard[i][i];\n diagRight[i] = gameBoard[2-i][i];\n }\n\n\n// for( char s : line.toCharArray()) {\n// if(s == 'X') {\n// numX++;\n// } else if (s == 'O') {\n// numO++;\n// }\n// }\n//\n// if (numO - numX > 1 || numO - numX < -1) {\n// System.out.println(\"Impossible\");\n// return;\n// } else if (numO < 3 && numX < 3) {\n// System.out.println(\"Game not finished\");\n// return;\n// }\n\n if(rowGood(topRow)){\n numWinningRows++;\n winner = topRow[0];\n// System.out.println(\"top\");\n }\n if(rowGood(midRow)){\n numWinningRows++;\n winner = midRow[0];\n// System.out.println(\"mid\");\n }\n if(rowGood(btmRow)){\n numWinningRows++;\n winner = btmRow[0];\n// System.out.println(\"btm\");\n }\n if(rowGood(leftCol)){\n numWinningRows++;\n winner = leftCol[0];\n }\n if(rowGood(centerCol)){\n numWinningRows++;\n winner = centerCol[0];\n }\n if(rowGood(rightCol)){\n numWinningRows++;\n winner = rightCol[0];\n }\n if(rowGood(diagLeft)){\n numWinningRows++;\n winner = diagLeft[0];\n// System.out.println(\"diagl\");\n }\n if(rowGood(diagRight)){\n numWinningRows++;\n winner = diagRight[0];\n// System.out.println(\"diagr\");\n// System.out.println(diagRight);\n }\n\n System.out.println(numWinningRows);\n\n if(numWinningRows >= 1) {\n String win = Character.toString(winner);\n// System.out.println(win + \" wins\");\n return win + \" wins\";\n } else if (numWinningRows == 0 && numX + numO < 9){\n// System.out.println(\"Game not finished\");\n return \"Game not finished\";\n } else if(numWinningRows == 0 && numO + numX == 9){\n System.out.println(\"Draw\");\n return \"Draw\";\n }\n\n return \"Ok\";\n }", "public int numMagicSquaresInside(int[][] grid) {\n //排除不够3X3的数组矩阵\n if (grid.length < 3){\n return 0;\n }\n int sum = 0;\n //找九宫格中间的数字\n for (int i = 1;i < grid.length - 1;i++){\n for (int j = 1;j < grid.length - 1;){\n //上述 条件1&&条件2\n if (grid[i][j] == 5&&isLawfulNum(grid,j,i)){\n sum ++;\n //如果当前九宫格满足条件意味着:\n // 向右移动一位的九宫格中间的数字不是5\n // 自己脑补一下把....\n j += 2;\n }else {\n j ++;\n }\n }\n }\n return sum;\n }", "public static void main(String[] args) {\n boolean[][] board = new boolean[8][8];\n for(int i = 0; i < 8; i++) {\n for(int j = 0; j < 8; j++) {\n board [i][j] = false;\n }\n }\n int row = 3; //can be between -1 and 6 depending where you want first square (row - 2)\n int count = 1;\n int column = 1;\n int addedTrue = 0;\n \n while (count < 9) {\n for(int i = row + 1; i < 8; i++) { \n if(horizontal(board, i) && diagonal(board, column - 1, i)) {\n board[column - 1][i] = true;\n addedTrue++;\n break;\n } \n }\n if(addedTrue == 0) {\n column--;\n count--;\n for(int z = 0; z < 8; z++) {\n if(board[column - 1][z]) {\n row = z;\n board[column - 1][z] = false;\n }\n }\n }\n if(addedTrue == 1) {\n column++;\n count++;\n addedTrue = 0;\n row = -1;\n } \n /*printBoard(board);\n System.out.println(\"\\n\\n\");*/\n }\n printBoard(board);\n }", "public int move_diagonally(Square[][] squares, int [] move, Boolean turn) {\n\n /* going down and right = f4 h2 [4,5,6,7] */\n if (move[2] > move[0] && move[3] > move[1]) {\n ////System.out.println(\"Down right\");\n int x = move[0];\n int y = move[1];\n x++;\n y++;\n while (x < move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y++;\n }\n }\n /* going down and left */\n else if (move[2] > move[0] && move[3] < move[1]){\n ////System.out.println(\"Down Left\");\n int x = move[0];\n int y = move[1];\n x++;\n y--;\n while (x < move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y--;\n }\n }\n /* going up and left */\n else if (move[2] < move[0] && move[3] < move[1]){\n ////System.out.println(\"Up Left\");\n int x = move[0];\n int y = move[1];\n x--;\n y--;\n while (x > move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y--;\n }\n }\n /* going up and right c1 f4 [7,2,4,5] */\n else if (move[2] < move[0] && move[3] > move[1]){\n ////System.out.println(\"Up right\");\n int x = move[0];\n int y = move[1];\n x--;\n y++;\n while (x > move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y++;\n }\n }\n return 0;\n }", "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 checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\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}", "public void testScoreboardCaseThree () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (first Yes counts only Min.Pts)\n \"3,1,A,5,No\", // 20\n \"4,1,A,7,Yes\", // 20 (all runs count!)\n \"5,1,A,9,No\", // 20\n\n \"6,1,B,11,No\", // zero (not solved)\n \"7,1,B,13,No\", // zero (not solved)\n\n \"8,2,A,30,Yes\", // 30\n\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 3 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// String [] rankData = {\n// \"1,team2,1,30\"\n// \"2,team1,1,83\",\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}", "private int[] nextColWin(){ \r\n\t\tfor (int r=0; r<3; r++){ \r\n\t\t\tif (board[0][r] == board[1][r] && board[2][r] == '-' && board[0][r] != '-'){\r\n\t\t\t\tcolWin[0] = 2;\r\n\t\t\t\tcolWin[1] = r;\r\n\t\t\t\treturn colWin;\r\n\t\t\t}\r\n\t\t\telse if (board[1][r] == board[2][r] && board[0][r] == '-' && board[0][r] != '-'){\r\n\t\t\t\tcolWin[0] = 0;\r\n\t\t\t\tcolWin[1] = r;\r\n\t\t\t\treturn colWin;\r\n\t\t\t}\r\n\t\t\telse if (board[0][r] == board[2][r] && board[1][r] == '-' && board[0][r] != '-'){\r\n\t\t\t\tcolWin[0] = 1;\r\n\t\t\t\tcolWin[1] = r;\r\n\t\t\t\treturn colWin;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn colWin;\r\n\t\t\r\n\t}", "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 }", "public static void solution(boolean[][] board, int row, int cols, int ndiag, int rdiag, String asf) {\n if(row == board.length){\n System.out.println(asf);\n return;\n }\n \n for(int col = 0; col < board.length; col++){\n if(\n ((cols & (1 << col)) == 0) &&\n ((ndiag & (1 << col + row)) == 0) &&\n ((rdiag & (1 << row - col + board.length - 1)) == 0)\n ){\n board[row][col] = true;\n cols ^= (1 << col);\n ndiag ^= (1 << (row + col));\n rdiag ^= (1 << (row - col + board.length - 1));\n solution(board, row + 1, cols, ndiag, rdiag, asf + row + \"-\" + col + \", \");\n cols ^= (1 << col);\n ndiag ^= (1 << (row + col));\n rdiag ^= (1 << (row - col + board.length - 1));\n board[row][col] = false;\n }\n }\n \n }", "private boolean winningBoard(char[][] board){\n for(int i = 0; i < boardHeight; i++ ){\n for(int j = 0; j < boardWidth; j++) {\n\n //if white was made it to the other side\n if(board[i][j] == 'P' && i == 0){\n return true;\n }\n\n //if black has made it to the other side\n if(board[i][j] == 'p' && i == boardHeight -1){\n return true;\n }\n }\n }\n //no winners\n return false;\n }", "public State[] getSuccessors(char player) {\n\t\t// TO DO: get all successors and return them in proper order\r\n\t\tchar[][] board = convert2D(this.board);\r\n\r\n\t\tchar opponent;\r\n\t\tif(player == '2')\r\n\t\t\topponent = '1';\r\n\t\telse \r\n\t\t\topponent = '2';\r\n\r\n\t\tArrayList<State> successors = new ArrayList<State>();\r\n\r\n\t\tArrayList<Integer> row = new ArrayList<Integer>();\r\n\r\n\t\tArrayList<Integer> col = new ArrayList<Integer>();\r\n\t\t//ArrayList<Integer[]> indices = new ArrayList<Integer[]>();\r\n\r\n\t\tfor(int i = 0;i < 4; ++i){\r\n\r\n\t\t\tfor(int j = 0;j < 4; ++j){\r\n\r\n\t\t\t\tif(board[i][j] == opponent){\r\n\r\n\t\t\t\t\tint I = i, J = j; \r\n\t\t\t\t\t//upper left diag\r\n\t\t\t\t\tif(i-1 >= 0 && j-1 >= 0 && board[i-1][j-1] == '0'){ \r\n\r\n\t\t\t\t\t\ti = i+1; \r\n\t\t\t\t\t\tj = j+1;\r\n\r\n\t\t\t\t\t\twhile(i < 3 && j < 3 && board[i][j] == opponent)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ti++;j++;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(i <= 3 && j <= 3 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I-1,J-1)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I-1);\r\n\t\t\t\t\t\t\t\tcol.add(J-1);\r\n\r\n\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\ti=I;j=J;\r\n\t\t\t\t\t//left\r\n\t\t\t\t\tif(i-1>=0 && board[i-1][j] == '0'){\r\n\t\t\t\t\t\ti = i+1;\r\n\r\n\t\t\t\t\t\twhile(i < 3 && board[i][j] == opponent) \r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\tif(i<=3 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I-1,J)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I-1);\r\n\t\t\t\t\t\t\t\tcol.add(J);\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\ti=I;\r\n\r\n\t\t\t\t\t//lower left diag\r\n\t\t\t\t\tif(i-1 >= 0 && j+1 <= 3 && board[i-1][j+1] == '0'){\r\n\r\n\t\t\t\t\t\ti = i+1; j = j-1;\r\n\r\n\t\t\t\t\t\twhile(i<3 && j>0 && board[i][j] == opponent)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ti++;j--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(i<=3 && j>=0 && board[i][j] == player) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!exists(row,col,I-1,J+1)) {\r\n\t\t\t\t\t\t\t\trow.add(I-1);\r\n\t\t\t\t\t\t\t\tcol.add(J+1);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\ti=I;\r\n\t\t\t\t\tj=J;\r\n\r\n\t\t\t\t\t//up\r\n\t\t\t\t\tif(j-1>=0 && board[i][j-1] == '0'){\r\n\t\t\t\t\t\tj = j+1;\r\n\r\n\t\t\t\t\t\twhile(j < 3 && board[i][j] == opponent)\r\n\t\t\t\t\t\t\tj++;\r\n\r\n\t\t\t\t\t\tif(j <= 3 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I,J-1)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I);\r\n\t\t\t\t\t\t\t\tcol.add(J-1);\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\r\n\t\t\t\t\tj=J;\r\n\t\t\t\t\t//down\r\n\t\t\t\t\tif(j+1 <= 3 && board[i][j+1] == '0'){\r\n\r\n\t\t\t\t\t\tj=j-1;\r\n\r\n\t\t\t\t\t\twhile(j > 0 && board[i][j] == opponent)\r\n\t\t\t\t\t\t\tj--;\r\n\r\n\t\t\t\t\t\tif(j >= 0 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I,J+1)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I);\r\n\t\t\t\t\t\t\t\tcol.add(J+1);\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\tj=J;\r\n\t\t\t\t\t//upper right\r\n\t\t\t\t\tif(i+1<=3 && j-1>=0 && board[i+1][j-1] == '0'){\r\n\r\n\t\t\t\t\t\ti=i-1;\r\n\t\t\t\t\t\tj=j+1;\r\n\r\n\t\t\t\t\t\twhile(i > 0 && j < 3 && board[i][j] == opponent){\r\n\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(i >= 0 && j <= 3 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I+1,J-1)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I+1);\r\n\t\t\t\t\t\t\t\tcol.add(J-1);\r\n\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\r\n\t\t\t\t\ti=I;\r\n\t\t\t\t\tj=J;\r\n\t\t\t\t\t//right\r\n\t\t\t\t\tif(i+1 <= 3 && board[i+1][j] == '0'){\r\n\t\t\t\t\t\ti=i-1;\r\n\r\n\t\t\t\t\t\twhile(i > 0 && board[i][j] == opponent) \r\n\t\t\t\t\t\t\ti--;\r\n\r\n\t\t\t\t\t\tif(i >= 0 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row,col,I+1,J)) {\r\n\r\n\t\t\t\t\t\t\t\trow.add(I+1);\r\n\t\t\t\t\t\t\t\tcol.add(J);\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\ti=I;\r\n\t\t\t\t\t//lower right diag\r\n\t\t\t\t\tif(i+1 <= 3 && j+1 <=3 && board[i+1][j+1] == '0'){\r\n\r\n\t\t\t\t\t\ti=i-1;\r\n\t\t\t\t\t\tj=j-1;\r\n\r\n\t\t\t\t\t\twhile(i > 0 && j > 0 && board[i][j] == opponent)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(i >= 0 && j >= 0 && board[i][j] == player) {\r\n\r\n\t\t\t\t\t\t\tif(!exists(row, col, I+1, J+1)) {\t\r\n\r\n\t\t\t\t\t\t\t\trow.add(I+1);\r\n\t\t\t\t\t\t\t\tcol.add(J+1);\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\r\n\t\t\t\t\ti=I;\r\n\t\t\t\t\tj=J;\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t} \r\n\t\t//Adding to successors\r\n\t\tfor(int i = 0; i < row.size(); i++) {\r\n\r\n\t\t\tsuccessors.add(move(player, row.get(i), col.get(i)));\r\n\t\t}\r\n\r\n\t\t//Create an array,\r\n\t\tState[] succsArray = new State[successors.size()];\r\n\t\t//get data in array\r\n\t\tsuccsArray = successors.toArray(succsArray);\r\n\r\n\t\treturn succsArray;\t\r\n\t}", "private int threeInNeg(final GameStateModule game, int player) {\n int count = 0;\n if(game.getHeight() == 4){ //if height is 4, no iterations needed\n //counting bottom up\n for(int i = 0; i < 2; i++) { //since rows is always of width 5\n for(int j = 3; j > 2; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n //counting top bottom\n for(int i = 4; i > 2; i--) {\n for(int j = 0; j < 1; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n else { //if height is 5, iterations needed\n for(int i = 0; i < 3; i++) {\n for (int j = 4; j > 1; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n for(int i = 5; i > 2; i--) {\n for (int j = 0; j < 2; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n return count;\n }", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "public static void main(String[] args) {\r\n\t\tint[][] blocks = new int[3][3];\r\n\t\tint k = 0;\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\tblocks[i][j] = k;\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tBoard board = new Board(blocks);\r\n\t\tSystem.out.println(board.isGoal());\r\n\t\tSystem.out.println(board.hamming());\r\n\t\tSystem.out.println(board.manhattan());\r\n\r\n\t\tint[][] blocks2 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 0 } };\r\n\t\tBoard board2 = new Board(blocks2);\r\n\t\tSystem.out.println(board2.isGoal());\r\n\t\tSystem.out.println(board2.hamming());\r\n\t\tSystem.out.println(board2.manhattan());\r\n\r\n\t\tint[][] blocks3 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 0, 8 } };\r\n\t\tBoard board3 = new Board(blocks3);\r\n\t\tSystem.out.println(board3.isGoal());\r\n\t\tSystem.out.println(board3.hamming());\r\n\t\tSystem.out.println(board3.manhattan());\r\n\r\n\t\tint[][] blocks4 = { { 1, 2, 3 }, { 4, 5, 6 }, { 0, 8, 7 } };\r\n\t\tBoard board4 = new Board(blocks4);\r\n\t\tSystem.out.println(board4.isGoal());\r\n\t\tSystem.out.println(board4.hamming());\r\n\t\tSystem.out.println(board4.manhattan());\r\n\r\n\t\tint[][] blocks5 = { { 8, 1, 3 }, { 4, 0, 2 }, { 7, 6, 5 } };\r\n\t\tBoard board5 = new Board(blocks5);\r\n\t\tSystem.out.println(board5.isGoal());\r\n\t\tSystem.out.println(board5.hamming());\r\n\t\tSystem.out.println(board5.manhattan());\r\n\t\tSystem.out.println(board5.toString());\r\n\t\tList<Board> neighborsList = board5.neighborsList();\r\n\t\tfor (Board b : neighborsList) {\r\n\t\t\tSystem.out.println(b.toString());\r\n\t\t}\r\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}", "public void rowChecked(){\n\t\tint numRows = 0;\n\t\tboolean full;\n\t\tint row = well[0].length - 2;\n\t\twhile(!emptyRow(row)){\n\t\t\tfull = true;\n\t\t\tfor(int i = 0; i < well.length; i++){\n\t\t\t\tif(well[i][row] == Color.WHITE)\n\t\t\t\t\tfull = false;\n\t\t\t}\n\t\t\tif(full){\n\t\t\t\tdeleteRow(row);\n\t\t\t\tnumRows++;\n\t\t\t}\n\t\t\telse row--;\n\t\t}\n\t\tswitch(numRows){\n\t\t\tcase 0: break;\n\t\t\tcase 1: score += 100; break;\n\t\t\tcase 2: score += 200; break;\n\t\t\tcase 3: score += 400; break;\n\t\t\tcase 4: score += 800; break;\n\t\t\tcase 5: score += 1600; break;\n\t\t}\n\t}", "private void checkForWin(int x, int y, String s) {\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tif (grid[x][i].getText() != s)\n\t\t\t\tbreak;\n\t\t\tif (i == 3 - 1) {\n\t\t\t\tgameOver = true;\n\n\t\t\t\tif (grid[x][i].getText() == \"X\")\n\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\telse\n\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check row\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tif (grid[i][y].getText() != s)\n\t\t\t\tbreak;\n\t\t\tif (i == 3 - 1) {\n\t\t\t\tgameOver = true;\n\n\t\t\t\tif (grid[i][y].getText() == \"X\")\n\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\telse\n\t\t\t\t\twinner = \"Player 2\";\n\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// check diag\n\t\tif (x == y) {\n\t\t\t// we're on a diagonal\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tif (grid[i][i].getText() != s)\n\t\t\t\t\tbreak;\n\t\t\t\tif (i == 3 - 1) {\n\t\t\t\t\tgameOver = true;\n\n\t\t\t\t\tif (grid[i][i].getText() == \"X\")\n\t\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\t\telse\n\t\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// check anti diag (thanks rampion)\n\t\tif (x + y == 3 - 1) {\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tif (grid[i][(3 - 1) - i].getText() != s)\n\t\t\t\t\tbreak;\n\t\t\t\tif (i == 3 - 1) {\n\t\t\t\t\tgameOver = true;\n\n\t\t\t\t\tif (grid[i][(3 - 1) - i].getText() == \"X\")\n\t\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\t\telse\n\t\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\t\tgrid[r][c].setEnabled(false);\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}" ]
[ "0.68477404", "0.676371", "0.6724497", "0.66124797", "0.65444535", "0.6537883", "0.6461447", "0.6421655", "0.6400802", "0.6382798", "0.636952", "0.63555765", "0.6292394", "0.6291864", "0.62845105", "0.62204146", "0.6205776", "0.61819047", "0.61655855", "0.6152344", "0.6151729", "0.61451954", "0.61347276", "0.61316794", "0.6110153", "0.6099286", "0.60874563", "0.60853314", "0.60730517", "0.6072157", "0.6065944", "0.6062236", "0.6060774", "0.6055264", "0.60509866", "0.6044051", "0.6021362", "0.6015501", "0.6009449", "0.5949234", "0.5943419", "0.59369224", "0.593383", "0.59330827", "0.5927656", "0.5926919", "0.59243697", "0.5923833", "0.5920969", "0.59196746", "0.59194684", "0.5908238", "0.5905131", "0.589241", "0.58839226", "0.587929", "0.5862145", "0.58586454", "0.5854052", "0.5848999", "0.584893", "0.5839664", "0.58186907", "0.5811471", "0.58099145", "0.58091694", "0.58064336", "0.5804328", "0.5802867", "0.5797367", "0.5794854", "0.57915527", "0.57836324", "0.5779571", "0.5771141", "0.5767142", "0.57625085", "0.5760935", "0.5760124", "0.57596374", "0.57556933", "0.5749431", "0.57456475", "0.57448226", "0.5740296", "0.57209724", "0.5720634", "0.5717508", "0.5711162", "0.5700631", "0.5700229", "0.5695657", "0.5682756", "0.56815547", "0.5675454", "0.56721056", "0.5671896", "0.56690323", "0.56664234", "0.5665804" ]
0.7408149
0
alpha beta implementation used by Student Player
public MoveNode ab(PentagoBoardState pbs,int myscore, int alpha, int beta,int amimaxplayer, int depth,int requireddepth){ int bestmovescore; PentagoMove bestmove; ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves(); Collections.shuffle(legalmoves); //helps avoid worst run time if all good moves are at the end of array list MoveNode moveNode =new MoveNode(new PentagoMove(0,0,0,0,0),0); if (depth==requireddepth){ bestmovescore= evaluate(pbs); moveNode.MyMove = null; moveNode.value = evaluate(pbs); return moveNode; } else if (pbs.getWinner() != Board.NOBODY){ //check win since we are at leafnode bestmovescore= evaluate(pbs); moveNode.MyMove = null; int movescore = evaluate(pbs); if (movescore<-1200000){ moveNode.value = -999999999; //assign loss value } //Losing Move else if (movescore>1200000){ moveNode.value = 999999999; //assign win value } // Winning Move return moveNode; } //do max player if (amimaxplayer ==1){ int currentvalue = -999999999; PentagoMove currentmove =legalmoves.get(0); MoveNode currentmovenode = new MoveNode(currentmove,currentvalue); for (int i = 0; i < legalmoves.size(); i++) { PentagoBoardState newboard = (PentagoBoardState) pbs.clone(); PentagoMove movetoprocess = legalmoves.get(i); newboard.processMove(movetoprocess); MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 0, depth + 1, requireddepth); // run recursion till leaf node or depth reached if (scoreAfterMove.value > currentvalue) { //see if current best value is lower than the new value if so replace currentvalue = scoreAfterMove.value; currentmove = movetoprocess; currentmovenode.value = currentvalue; currentmovenode.MyMove = currentmove; //System.out.println("I am max plyaer at depth:" + depth + "\n current move is: " + currentmove + "\ncurrentvalue is: " + currentvalue); } alpha = Math.max(alpha,currentvalue); if (alpha>=beta){ // break loop if alpha more than beta //System.out.println("Get pruned my alpha is " + alpha + " my beta is " + beta ); break; } } //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); return currentmovenode; } //do min player else if (amimaxplayer==0){ int currentvalue = 999999999; PentagoMove currentmove =legalmoves.get(0); MoveNode currentmovenode = new MoveNode(currentmove,currentvalue); for (int i = 0; i < legalmoves.size(); i++) { PentagoBoardState newboard = (PentagoBoardState) pbs.clone(); PentagoMove movetoprocess = legalmoves.get(i); newboard.processMove(movetoprocess); MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 1, depth + 1, requireddepth); if (scoreAfterMove.value < currentvalue) { currentvalue = scoreAfterMove.value; currentmove = movetoprocess; currentmovenode.value = currentvalue; currentmovenode.MyMove = currentmove; //System.out.println("I am min plyaer at depth:" + depth + "\n current move is: " + currentmove + "\ncurrentvalue is: " + currentvalue); } beta = Math.min(beta,currentvalue); if (alpha>=beta){ //System.out.println("Get pruned my alpha is " + alpha + " my beta is " + beta ); break; } } return currentmovenode; } //System.out.println("move val " + moveNode.value); return moveNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getBeta();", "public double getBeta() {\r\n return beta;\r\n }", "public float getBeta() {\n\t\treturn beta;\n\t}", "public void setBeta(double aBeta);", "public void setBeta(float beta) {\n\t\tthis.beta = beta;\n\t}", "public double getBeta()\n\t{\n\t\treturn Math.toRadians(beta);\n\t}", "public void setBeta(double value) {\r\n this.beta = value;\r\n }", "public double getAlpha();", "public double getAlpha();", "public void alpha(int alpha);", "float getAlpha();", "public int getBeta1(int g, int t, int m, int n);", "private float alphaBeta(Node n, int depth, double A, double B, int player) {\n\t\t\n\t\t// Only do a depth check for termination, as this implementation passes nodes that initially have empty\n\t\t// successor moves (so we can't test for terminal node at this step)\n\t\tif(depth == 0) {\n\t\t\tleaves++;\n\t\t\t\n\t\t\tfloat score = g_board.evaluate(player);\n\t\t\tn.setScore(score);\n\t\t\t\n\t\t\treturn score;\n\t\t}\n\t\t\n\t\tif(n.getChildren() == null || n.getChildren().isEmpty()) {\n\t\t\t// Send the parent information to the move generator, which will recursively call A-B with the child information\n\t\t\treturn generateLegalMoves(n, depth, A, B, player);\n\t\t} else {\n\t\t\t// If we have a pre-constructed tree already, we can run normal alphaBeta\n\t\t\tArrayList<Node> moves = n.getChildren();\n\t\t\t\n\t\t\t// White\n\t\t\tif(player == WHITE) {\n\t\t\t\tdouble val = Double.NEGATIVE_INFINITY;\n\t\t\t\t\n\t\t\t\tfor(Node child : moves) {\n\t\t\t\t\tval = Math.max(val, alphaBeta(child, depth - 1, A, B, (BLACK)));\n\t\t\t\t\tA = Math.max(val, A);\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\treturn (float)val;\n\t\t\t// Black\n\t\t\t} else {\n\t\t\t\tdouble val = Double.POSITIVE_INFINITY;\n\t\t\t\t\n\t\t\t\tfor(Node child : moves) {\n\t\t\t\t\tval = Math.min(val, alphaBeta(child, depth - 1, A, B, (WHITE)));\n\t\t\t\t\tB = Math.min(val, B);\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\treturn (float)val;\n\t\t\t}\n\t\t}\t\n\t}", "public abstract void betaReduce();", "public int getBeta2(int g, int t, int m, int n);", "double getAlpha() {\n return alpha;\n }", "double getValue(int alpha, int beta) {\n\tif (alpha <=0 || beta<=0) throw new IllegalArgumentException(\"alpha, beta must be positive\");\n\tif (alpha + beta <= table.length + 1) {\n\t return table[beta - 1][alpha - 1];\n\t} else {\n\t return (double)alpha/(double)(alpha+beta);\n\t}\n }", "abstract public LinkedList<Vertex> betaReduction();", "static public double computeGammaFromBeta(double beta) { \n return 1.0/Math.sqrt(1.0 - beta*beta); \n }", "protected void calcBeta(Sequence seq)\n {\n int T = seq.length();\n int nStates = getNumStates();\n int iLast = nStates - 1;\n beta = Library.allocMatrixDouble(T, nStates, Library.LOG_ZERO);\n calcB(seq);\n\n // end probability according to prior\n for(int i = 0; i < nStates; i++)\n beta[T-1][i] = piEnd[i] + bmat[i][T - 1];\n\n for(int t = T - 2; t >= 0; t--){\n // calc i -> j\n for(int i = 0; i < nStates; i++){\n assert (beta[t][i] == Library.LOG_ZERO);\n for(int j = 0; j < nStates; j++){\n double a = tran[i][j] + bmat[j][t + 1] + beta[t + 1][j];\n if (a == Library.LOG_ZERO) continue;\n beta[t][i] = Library.logadd(beta[t][i], a);\n }\n }\n }\n }", "public double getAlpha()\n {\n return alpha;\n }", "public void setAlphaBetaEnable(boolean alphaBetaEnable) {\n this.alphaBetaEnable = alphaBetaEnable;\n }", "void setAlpha(double alpha) {\n this.alpha = alpha;\n }", "public float getAlpha();", "public float getAlpha();", "abstract public boolean alphaConversion();", "public static double[] outsideAlgorithm(final Hypergraph graph, final Hyperpotential w, final Semiring s, final double[] beta) {\n final int n = graph.getNodes().size();\n final double[] alpha = new double[n];\n // \\alpha_i = 0 \\forall i\n Arrays.fill(alpha, s.zero());\n // \\alpha_{root} = 1\n alpha[graph.getRoot().getId()] = s.one();\n graph.applyRevTopoSort(new HyperedgeFn() {\n \n @Override\n public void apply(Hyperedge e) {\n int i = e.getHeadNode().getId();\n // \\forall j \\in T(e): \n // \\alpha_j += \\alpha_{H(e)} * w_e * \\prod_{k \\in T(e) : k \\neq j} \\beta_k\n for (Hypernode jNode : e.getTailNodes()) {\n int j = jNode.getId();\n double prod = s.one();\n for (Hypernode kNode : e.getTailNodes()) {\n int k = kNode.getId();\n if (k == j) { continue; }\n prod = s.times(prod, beta[k]);\n }\n prod = s.times(prod, alpha[i]);\n prod = s.times(prod, w.getScore(e, s));\n //log.trace(String.format(\"i=%d j=%d prod=%f\", i, j, prod));\n alpha[j] = s.plus(alpha[j], prod);\n }\n }\n \n });\n return alpha;\n }", "public AlphaBeta(int size)\n {\n this.board = new Board(size);\n this.size = size;\n }", "public void setNewAlpha(){\n\n\t\tretrieveAlpha();\n\t\tretrieveReducerOutput();\n\t\t\n\t\tdouble[] alphaVectorUpdate = new double[K];\n\t\tdouble[] alphaGradientVector = new double[K];\n\t\tdouble[] alphaHessianVector = new double[K];\n\n\t\tdouble[] alphaVector = oldAlpha.clone();\n\t\tdouble[] alphaSufficientStatistics = rDelta;\n\n\t\tint alphaUpdateIterationCount = 0;\n\n\t\t// update the alpha vector until converge\n\t\tboolean keepGoing = true;\n\t\ttry {\n\t\t\tint decay = 0;\n\n\t\t\tdouble alphaSum = 0;\n\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\talphaSum += alphaVector[j];\n\t\t\t}\n\n\t\t\twhile (keepGoing) {\n\t\t\t\tdouble sumG_H = 0;\n\t\t\t\tdouble sum1_H = 0;\n\n\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t// compute alphaGradient\n\t\t\t\t\talphaGradientVector[i] = D\n\t\t\t\t\t\t\t* (Gamma.digamma(alphaSum) - Gamma.digamma(alphaVector[i]))\n\t\t\t\t\t\t\t+ alphaSufficientStatistics[i];\n\n\t\t\t\t\t// compute alphaHessian\n\t\t\t\t\talphaHessianVector[i] = -D * Gamma.trigamma(alphaVector[i]);\n\n\t\t\t\t\tif (alphaGradientVector[i] == Double.POSITIVE_INFINITY\n\t\t\t\t\t\t\t|| alphaGradientVector[i] == Double.NEGATIVE_INFINITY) {\n\t\t\t\t\t\tthrow new ArithmeticException(\"Invalid ALPHA gradient matrix...\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsumG_H += alphaGradientVector[i] / alphaHessianVector[i];\n\t\t\t\t\tsum1_H += 1 / alphaHessianVector[i];\n\t\t\t\t}\n\n\t\t\t\tdouble z = D * Gamma.trigamma(alphaSum);\n\t\t\t\tdouble c = sumG_H / (1 / z + sum1_H);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tboolean singularHessian = false;\n\n\t\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t\tdouble stepSize = Math.pow(Parameters.DEFAULT_ALPHA_UPDATE_DECAY_FACTOR, decay)\n\t\t\t\t\t\t\t\t* (alphaGradientVector[i] - c) / alphaHessianVector[i];\n\t\t\t\t\t\tif (alphaVector[i] <= stepSize) {\n\t\t\t\t\t\t\t// the current hessian matrix is singular\n\t\t\t\t\t\t\tsingularHessian = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\talphaVectorUpdate[i] = alphaVector[i] - stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (singularHessian) {\n\t\t\t\t\t\t// we need to further reduce the step size\n\t\t\t\t\t\tdecay++;\n\n\t\t\t\t\t\t// recover the old alpha vector\n\t\t\t\t\t\talphaVectorUpdate = alphaVector;\n\t\t\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// we have successfully update the alpha vector\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// compute the alpha sum and check for alpha converge\n\t\t\t\talphaSum = 0;\n\t\t\t\tkeepGoing = false;\n\t\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\t\talphaSum += alphaVectorUpdate[j];\n\t\t\t\t\tif (Math.abs((alphaVectorUpdate[j] - alphaVector[j]) / alphaVector[j]) >= Parameters.DEFAULT_ALPHA_UPDATE_CONVERGE_THRESHOLD) {\n\t\t\t\t\t\tkeepGoing = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (alphaUpdateIterationCount >= Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_ITERATION) {\n\t\t\t\t\tkeepGoing = false;\n\t\t\t\t}\n\n\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\talphaUpdateIterationCount++;\n\t\t\t\talphaVector = alphaVectorUpdate;\n\t\t\t}\n\t\t} catch (IllegalArgumentException iae) {\n\t\t\tSystem.err.println(iae.getMessage());\n\t\t\tiae.printStackTrace();\n\t\t} catch (ArithmeticException ae) {\n\t\t\tSystem.err.println(ae.getMessage());\n\t\t\tae.printStackTrace();\n\t\t}\n\n\t\tnewAlpha = alphaVector;\n\n\n\t}", "public static String alphaBeta(int depth, int beta, int alpha, String move,\n\t\t\tint player) {\n\t\tString list = posibleMoves();\n\t\tif (depth == 0 || list.length() == 0) {\n\t\t\treturn move\n\t\t\t\t\t+ (Rating.rating(list.length(), depth) * (1 - player * 2));\n\t\t}\n\t\tlist = sortMoves(list);\n\t\tplayer = 1 - player;// either 1 or 0: 0 is computer 1 is human\n\t\tfor (int i = 0; i < list.length(); i += 5) {\n\t\t\tmakeMove(list.substring(i, i + 5));\n\t\t\tflipBoard();\n\t\t\tString returnString = alphaBeta(depth - 1, beta, alpha,\n\t\t\t\t\tlist.substring(i, i + 5), player);\n\t\t\tint value = Integer.valueOf(returnString.substring(5));\n\t\t\tflipBoard();\n\t\t\tundoMove(list.substring(i, i + 5));\n\t\t\tif (player == 0) {\n\t\t\t\tif (value <= beta) {\n\t\t\t\t\tbeta = value;\n\t\t\t\t\tif (depth == globalDepth) {\n\t\t\t\t\t\tmove = returnString.substring(0, 5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (value > alpha) {\n\t\t\t\t\talpha = value;\n\t\t\t\t\tif (depth == globalDepth) {\n\t\t\t\t\t\tmove = returnString.substring(0, 5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (alpha >= beta) {\n\t\t\t\tif (player == 0) {\n\t\t\t\t\treturn move + beta;\n\t\t\t\t} else {\n\t\t\t\t\treturn move + alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (player == 0) {\n\t\t\treturn move + beta;\n\t\t} else {\n\t\t\treturn move + alpha;\n\t\t}\n\t}", "public double getAlpha() {\n return alpha;\n }", "public static double getAlpha()\n\t{\n\t\treturn alpha;\n\t}", "public void setAlpha(double aAlpha);", "public void setAlpha(double alpha);", "private Pair<Double, String> alphaBeta(Othello o, double alpha, double beta, int depth, \n\t\t\tboolean maximisingPlayer) {\n\t \n\t // End if depth is 0 or no more moves\n\t if (depth == 0 || o.getState() != State.NONE) {\n\t return new Pair<Double, String>(eval(o), null);\n\t }\n\t \n\t String bestMove = null;\n\t Pair<String[], Othello[]> children = getChildren(o);\n\t \n\t // Max player\n\t if (maximisingPlayer) {\n\t \tdouble v = -Double.MAX_VALUE;\n\t for (int i = 0; i < children.first.length; i++) {\n\t double childValue = alphaBeta(children.second[i], alpha, beta, depth-1, false).first;\n\t if (v < childValue || (v == childValue && bestMove == null)) {\n\t \tv = childValue;\n\t \tbestMove = children.first[i];\n\t }\n\t alpha = Math.max(alpha, v);\n\t if (beta <= alpha) {\n\t break;\n\t }\n\t }\n\t return new Pair<Double, String>(v, bestMove);\n\t }\n\t \n\t // Min player\n\t else {\n\t \tdouble v = Double.MAX_VALUE;\n\t for (int i = 0; i < children.first.length; i++) {\n\t double childValue = alphaBeta(children.second[i], alpha, beta, depth-1, true).first;\n\t if (v > childValue || (v == childValue && bestMove == null)) {\n\t \tv = childValue;\n\t \tbestMove = children.first[i];\n\t }\n\t beta = Math.min(beta, v);\n\t if (beta <= alpha) {\n\t break;\n\t }\n\t }\n\t return new Pair<Double, String>(v, bestMove);\n\t }\n\t}", "public void alphaBetaNuLambda(){\n double totalAlpha = 0.0;\n for (int k=0 ; k<K ; ++k){\n alpha[k] = alpha0 + N[k];\n totalAlpha = totalAlpha + alpha[k];\n beta[k] = beta0 + N[k];\n nu[k] = nu0 +N[k] + 1.0;\n }\n \n // calculate lambda tilde vector\n for (int k=0 ; k<K ; ++k){\n double sum = 0.0;\n for (int d=1 ; d<=X.getD() ; ++d){\n double v = (nu[k]+1.0-d)/2.0;\n sum = sum + Gamma.digamma(v);\n }\n lnLambdaTilde[k] = sum + Dln2 + Math.log(detW[k]);\n } \n }", "public abstract void alphaConversion(Variable x, Variable y);", "public void SetLearnRate (double alpha) { this.alpha = alpha; }", "protected void calcAlpha(Sequence seq)\n {\n int T = seq.length();\n int nStates = getNumStates();\n alpha = Library.allocMatrixDouble(T, nStates, Library.LOG_ZERO);\n calcB(seq);\n\n // we can start anywhere, according to the prior probs\n for(int i = 0; i < nStates; i++)\n alpha[0][i] = piStart[i] + bmat[i][0];\n\n // fill in the alpha matrix\n for(int t = 1; t < T; t++){\n // calc j -> i\n for(int i = 0; i < nStates; i++){\n for(int j = 0; j < nStates; j++)\n alpha[t][i] = Library.logadd(alpha[t][i], alpha[t - 1][j] + tran[j][i]);\n alpha[t][i] += bmat[i][t];\n }\n }\n }", "public GameStateChild alphaBetaSearch(GameStateChild node, int depth, double alpha, double beta)\n {\n \tList<GameStateChild> children = node.state.getChildren();\n \t\n \tif(depth == 0)\n \t\treturn node;\n \t\n \tchildren = orderChildrenWithHeuristics(children);\n \t\t\n \tdouble max = -99999;\n \tdouble min = 99999;\n \t\n \tfor(int i = 0; i < children.size(); i++) {\n \t\t\n \t\tdouble val = alphaBetaSearch(children.get(i), depth-1, alpha, beta).state.getUtility();\n \t\t\n \t\tif(val > max) \n \t\t\tmax = val;\n \t\t\n \t\tif(val > alpha) \n \t\t\talpha = val;\n \t\t\n \t\tif(val < min) \n \t\t\tmin = val;\n \t\t\n \t\tif(val > beta) \n \t\t\tbeta = val;\n \t\t\n \t\tif(beta <= alpha) \n \t\t\tbreak;\n \t}\n return node; \n }", "public AlphaTable<S, O> getAlpha() {\n return alpha;\n }", "public static int[] alphaBeta(Board b, int depth, int alpha, int beta, int playerNum){\n //if the depth is 0 or the game is over return the last move\n if (depth == 0 || b.isGameOver()){\n return b.getLastMove();\n }\n //If player 1, maximize board score\n if (playerNum == Board.PLAYER_1){\n int[] bestMove = new int[3];\n bestMove[2] = Integer.MIN_VALUE;\n //check nodes of next tree\n for (Board board: Board.getPossibleBoards(b, Board.PLAYER_2)) {\n //calls minimax using next player to determine minimum board score possible\n int[] move = alphaBeta(board, depth - 1, alpha, beta, Board.PLAYER_2);\n if (move[2] > bestMove[2] && !isLosingMove(b, move[1], Board.PLAYER_2))\n bestMove = move;\n else if(move[2] == bestMove[2]){\n if (Math.abs(move[1] - 3) < Math.abs(bestMove[1] - 3)){\n bestMove = move;\n }\n else if (getRandom()){\n bestMove = move;\n }\n }\n //update upper bound\n if(bestMove[2] > alpha){\n alpha = bestMove[2];\n }\n //if bounds cross, node and children can be ignored\n if(beta < alpha)\n break;\n }\n return bestMove;\n }\n //if player 2, minimize board score\n else if(playerNum == 2){\n int[] bestMove = new int[3];\n bestMove[2] = Integer.MAX_VALUE;\n //check next nodes of tree\n for (Board board: Board.getPossibleBoards(b, Board.PLAYER_1)){\n //determine maximum loss using recursion\n int[] move = alphaBeta(board, depth - 1, alpha, beta, Board.PLAYER_1);\n if (move[2] < bestMove[2] && !isLosingMove(b, move[1], Board.PLAYER_2))\n bestMove = move;\n else if (move[2] == bestMove[2]){\n if (Math.abs(move[1] - 3) < Math.abs(bestMove[1] - 3)){\n bestMove = move;\n }\n else if (getRandom()){\n bestMove = move;\n }\n }\n //update lower bound\n if(bestMove[2] < beta){\n beta = bestMove[2];\n }\n //break if bounds intersect\n if(beta < alpha)\n break;\n }\n //minimizes max loss\n return bestMove;\n }\n return null;\n }", "public void setAlpha(int alpha)\n {\n \tthis.alpha=alpha; \n }", "double getValueGeneral(double alpha, double beta) {\n\tif (alpha < 1 || beta < 1) throw new IllegalArgumentException(\"alpha, beta must be at least 1.0\");\n\tint a = (int)alpha, b = (int)beta;\n\tdouble xa = alpha - a, xb = beta - b;\n\treturn (xa==0 && xb==0) ? getValue(a,b) :\n\t (1-xa)*( (1-xb) * getValue(a,b) + xb * getValue(a,b+1)) +\n\t xa * ( (1-xb) * getValue(a+1,b) + xb * getValue(a+1,b+1));\n }", "private double computeSumAlpha()\n\t{\n\t\tdouble sum = 0;\n\t\tdouble[] a = svm.getAlphas();\n\t\tfor(double d : a)\n\t\t\tsum += Math.abs(d);\n\t\treturn sum;\n\t}", "abstract public void updatePositionsAfterBetaReduction();", "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}", "public float getAlpha() {\n \t\treturn alpha;\n\t}", "static public double computeBetaFromGamma(double gamma) {\n double beta = Math.sqrt(1.0 - 1.0/(gamma*gamma));\n\n return beta;\n }", "double getGamma();", "private float calculateAlpha() {\n float alpha = 1.2f*(myCamera.getViewportWidth()/(2*Const.WORLD_WIDTH-myCamera.getViewportWidth()))-0.2f;\n if(alpha < 0) alpha = 0;\n if(alpha > 1) alpha = 1;\n return alpha;\n }", "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}", "@Override\n\t\t\tpublic void setAlpha(int alpha) {\n\t\t\t\t\n\t\t\t}", "protected void o()\r\n/* 156: */ {\r\n/* 157:179 */ int i = 15 - aib.b(this);\r\n/* 158:180 */ float f = 0.98F + i * 0.001F;\r\n/* 159: */ \r\n/* 160:182 */ this.xVelocity *= f;\r\n/* 161:183 */ this.yVelocity *= 0.0D;\r\n/* 162:184 */ this.zVelocity *= f;\r\n/* 163: */ }", "public final double getAlpha() {\n\t\treturn alpha;\n\t}", "public void update(double[] x, double y, double alpha){ \n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t\tdouble wi = weights[i]; \n\t\t\tdouble xi = x[i];\t\t\t\t\t\t\t// Follow the update rule\n\t\t\tweights[i] = wi + alpha*(y - eval(x)) * eval(x)*(1.0 - eval(x)) * xi;\t\n\t\t\t//System.out.printf(\"%.5f\\n\", weights[i]);\n\t\t\t\n\t\t}\n\t}", "@Override\n public int getAlpha() {\n return mAlpha;\n }", "@Override\n\tpublic void computeAlpha() {\n\t\t//Allocate memory for the alphas array\n\t\talpha = new double[training[0].length-1];\n\t\t\n\t\t//Checks every feature\n\t\tfor(int i = 0; i < training[0].length-1; i++) {\n\t\t\t//Sets the position of the array corresponding to itself to NaN and continues the loop\n\t\t\tif(i == node_id) {\n\t\t\t\talpha[i] = Double.NaN;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Allocate memory to keep track of the counts\n\t\t\tint[][][] Nijkc = new int[max_values[i]+1][max_values[node_id]+1][max_values[max_values.length-1]+1];\n\t\t\tint[][] Nikc = new int[max_values[node_id]+1][max_values[max_values.length-1]+1];\n\t\t\tint[][] Nijc = new int[max_values[i]+1][max_values[max_values.length-1]+1];\n\t\t\tint[] Nc = new int[max_values[max_values.length-1]+1];\n\t\t\tint N = training.length;\n\t\t\t\n\t\t\t//Counts the patterns found on the training dataset\n\t\t\tfor(int n = 0; n < training.length; n++) {\n\t\t\t\tNijkc[training[n][i]][training[n][node_id]][training[n][training[n].length-1]]++;\n\t\t\t\tNikc[training[n][node_id]][training[n][training[n].length-1]]++;\n\t\t\t\tNijc[training[n][i]][training[n][training[n].length-1]]++;\n\t\t\t\tNc[training[n][training[n].length-1]]++;\n\t\t\t}\n\t\t\t\n\t\t\t//Computes the values of the alpha for a given node(self)->node(target) using the MDL score\n\t\t\tdouble total = 0;\n\t\t\tfor(int j = 0; j < max_values[i] + 1; j++) {\n\t\t\t\tfor(int k = 0; k < max_values[node_id] + 1; k++) {\n\t\t\t\t\tfor(int l = 0; l < max_values[max_values.length-1] + 1; l++) {\n\t\t\t\t\t\tif(Nijkc[j][k][l] == 0 || Nikc[k][l] == 0 || Nijc[j][l] == 0) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\ttotal += ((double)Nijkc[j][k][l] / (double)N) * (Math.log(((double)Nijkc[j][k][l]*(double)Nc[l])/((double)Nikc[k][l]*(double)Nijc[j][l])) / Math.log(2));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttotal = total - ((((max_values[max_values.length-1]+1)*max_values[node_id]*max_values[i])/(2))*Math.log(N));\n\t\t\t\n\t\t\t//Attribution of the value to the corresponding position on the array\n\t\t\talpha[i] = total;\n\t\t}\n\t\t\n\t\t//System.out.println(Arrays.toString(alpha));\n\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}", "public static Vector4 alpha()\n {\n return new Vector4(0,0,0,1);\n }", "public float getGamma();", "public static PlayerMove alphaBeta(int depth, int alpha, int beta, PossibleMove move, ArrayList<Player> listOfPlayers, int player) {\n PlayerMove newMove;\r\n PlayerMove bestMove = null;\r\n System.out.println(\"Player: \" + player);\r\n Player currentPlayer = listOfPlayers.get(player);\r\n ArrayList<PossibleMove> possibleMoveList = BoardAIBlackController.getPossibleMoves(currentPlayer);\r\n int bestValue;\r\n\r\n if (isMaxDepth(depth)) {\r\n Piece newPiece = move.getPiece();\r\n System.out.println(\"New moveX: \" + move.getNewXPost() + \" New move Y: \" + move.getNewYPost());\r\n int newXPost = move.getNewXPost();\r\n int newYPost = move.getNewYPost();\r\n System.out.println(\"NewXPost: \" + newXPost + \"NewYPost \" + newYPost);\r\n System.out.println(\"OldXPost: \" + move.getPiece().getOldX() + \" OldYPost: \" + move.getPiece().getOldY());\r\n// newPiece.setLayoutX(newXPost * 100);\r\n// newPiece.setLayoutY(newYPost * 100);\r\n System.out.println(newPiece.getLayoutX());\r\n System.out.println(newPiece.getLayoutY());\r\n int fitnessValue = BoardAIBlackController.evaluatePiece(currentPlayer, newPiece, move.getNewXPost(), move.getNewYPost());\r\n System.out.println(\"Fitness value of move is: \" + fitnessValue);\r\n System.out.println(move.getNewXPost() + \" \" + move.getNewYPost());\r\n newMove = new PlayerMove(currentPlayer, move, fitnessValue);\r\n// System.out.println(newMove.toString());\r\n return newMove;\r\n }\r\n\r\n for (int i = 0; i < possibleMoveList.size() - 1; i++) {\r\n //Maximizing player\r\n if (player == 1) {\r\n //Initialize current best move\r\n bestMove = new PlayerMove(currentPlayer, move, MIN);\r\n\r\n System.out.println(\"Who is the player: \" + currentPlayer);\r\n newMove = alphaBeta(depth - 1, alpha, beta, possibleMoveList.get(i), listOfPlayers, Math.abs(player - 1));\r\n bestMove.setFitnessValue(Math.max(bestMove.getFitnessValue(), newMove.getFitnessValue()));\r\n System.out.println(\"Current Alpha: \" + alpha + \" Current BestMove: \" + bestMove.getFitnessValue() + \" Current Beta: \" + beta);\r\n \r\n alpha = Math.max(alpha, bestMove.getFitnessValue());\r\n \r\n //Pruning\r\n if (beta <= alpha) {\r\n System.out.println(\"Prunned\");\r\n break;\r\n }\r\n } //Minimizing player\r\n else {\r\n //Initialize current best move\r\n bestMove = new PlayerMove(currentPlayer, move, MAX);\r\n System.out.println(\"Who is the player: \" + currentPlayer);\r\n newMove = alphaBeta(depth - 1, alpha, beta, possibleMoveList.get(i), listOfPlayers, Math.abs(player + 1));\r\n bestMove.setFitnessValue(Math.max(bestMove.getFitnessValue(), newMove.getFitnessValue()));\r\n beta = Math.max(alpha, bestMove.getFitnessValue());\r\n\r\n //Pruning\r\n if (beta <= alpha) {\r\n break;\r\n }\r\n }\r\n }\r\n return bestMove;\r\n\r\n }", "public void setAlpha(double newAlpha) {\n\t\talpha = newAlpha;\n\t}", "public void setAlpha(float alpha) {\n\t\tthis.alpha = alpha;\n\t}", "public interface LDABetaInitStrategy{\n\t/**\n\t * Given a model and the corpus initialise the model's sufficient statistics\n\t * @param model\n\t * @param corpus\n\t */\n\tpublic void initModel(LDAModel model, Corpus corpus);\n\t\n\t/**\n\t * initialises beta randomly s.t. each each topicWord >= 1 and < 2\n\t * @author Sina Samangooei (ss@ecs.soton.ac.uk)\n\t *\n\t */\n\tpublic static class RandomBetaInit implements LDABetaInitStrategy{\n\t\tprivate MersenneTwister random;\n\t\t\n\t\t/**\n\t\t * unseeded random\n\t\t */\n\t\tpublic RandomBetaInit() {\n\t\t\trandom = new MersenneTwister();\n\t\t}\n\t\t\n\t\t/**\n\t\t * seeded random\n\t\t * @param seed\n\t\t */\n\t\tpublic RandomBetaInit(int seed) {\n\t\t\trandom = new MersenneTwister(seed);\n\t\t}\n\t\t@Override\n\t\tpublic void initModel(LDAModel model, Corpus corpus) {\n\t\t\tfor (int topicIndex = 0; topicIndex < model.ntopics; topicIndex++) {\n\t\t\t\tfor (int wordIndex = 0; wordIndex < corpus.vocabularySize(); wordIndex++) {\n\t\t\t\t\tdouble topicWord = 1 + random.nextDouble();\n\t\t\t\t\tmodel.incTopicWord(topicIndex,wordIndex,topicWord);\n\t\t\t\t\tmodel.incTopicTotal(topicIndex, topicWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public double getAlpha()\n\t{\n\t\treturn Math.toRadians(alpha);\n\t}", "public IncompleteGammaFunctionFraction(double a) {\n alpha = a;\n }", "public void setAlpha(float alpha);", "protected int algo(Node node, int alpha, int beta) {\r\n int children = node.getChildren().size();\r\n // Zeile 0\r\n\r\n mark(0);\r\n if (!failHigh) {\r\n setSeen();\r\n }// Zaehlt fuer die Endauswertung\r\n else {\r\n if (prunedMap.containsKey(node.getId())) {\r\n setSeen();\r\n prunedMap.remove(node.getId());\r\n } else {\r\n failed++;\r\n setFailed(node);\r\n }\r\n }\r\n\r\n lightsOut(0);\r\n updateBorders(node, alpha, beta);\r\n setExplain(0, alpha, beta);\r\n highlightNode(node);\r\n\r\n // Zeile 1\r\n mark(1);\r\n code.highlight(1);\r\n setExplain(1, 0, 0);\r\n if (node.isLeaf()) {\r\n\r\n // Zeile 2\r\n mark(2);\r\n setExplain(2, node.getValue(), 0);\r\n lastT = \"window\" + node.getId();\r\n colorObject(\"tVal\" + node.getId(), nodeValueHighlightColor);\r\n return node.getValue();\r\n\r\n }\r\n\r\n // Zeile 3\r\n int a = alpha;\r\n mark(3);\r\n code.unhighlight(1);\r\n setExplain(3, alpha, 0);\r\n\r\n // Zeile 4\r\n int b = beta;\r\n mark(4);\r\n setExplain(4, beta, 0);\r\n\r\n // Zeile 5\r\n mark(5);\r\n setExplain(5, 0, 0);\r\n colorChildren(node);\r\n for (int j = 0; j < children; j++) {\r\n Node child = node.getChildren().get(j);\r\n\r\n // Zeile 6\r\n mark(6);\r\n lightsOut(6);\r\n uncolorChildren(node);\r\n if (j == 0) {\r\n setExplain(60, 0, 0);\r\n } else {\r\n setExplain(61, 0, 0);\r\n }\r\n\r\n colorLine(child);\r\n int score = -algo(child, -b, -a);\r\n mark(6);\r\n lightsOut(6);\r\n if (child.isLeaf()) {\r\n pMap.get(\"tVal\" + child.getId()).changeColor(\"\", seenNodeValueColor,\r\n null, null);\r\n }\r\n setExplain(62, score, 0);\r\n seenNode(child);\r\n showReturn(child, score);\r\n\r\n // Zeile 7\r\n mark(7);\r\n hideReturn(child);\r\n setExplain(7, 0, 0);\r\n\r\n if (a < score && score < beta && j > 0) {\r\n\r\n // Zeile 8\r\n mark(8);\r\n setFailed(child);\r\n setExplain(8, 0, 0);\r\n drawFailHigh(node, j);\r\n cleanAfterFail(child);\r\n colorLine(child);\r\n failHigh = true;\r\n // Zaehlt FailHighs fuer den Endbericht\r\n score = -algo(child, -beta, -score);\r\n failHigh = false;\r\n\r\n mark(8);\r\n if (child.isLeaf()) {\r\n pMap.get(\"tVal\" + child.getId()).changeColor(\"\", seenNodeValueColor,\r\n null, null);\r\n }\r\n lightsOut(8);\r\n setExplain(62, score, 0);\r\n seenNode(child);\r\n showReturn(child, score);\r\n }\r\n\r\n // Zeile 9\r\n mark(9);\r\n lightsOut(9);\r\n hideReturn(child);\r\n if (a > score) {\r\n setExplain(90, a, score);\r\n } else {\r\n setExplain(91, a, score);\r\n a = score;\r\n }\r\n\r\n // Zeile 10\r\n mark(10);\r\n if (a >= beta) {\r\n setExplain(100, a, beta);\r\n // Zeile 11\r\n mark(11);\r\n setPruned(child);\r\n setPrunedMap(node, j);\r\n if (j == children - 1) {\r\n setExplain(111, 0, 0);\r\n } else {\r\n setExplain(110, 0, 0);\r\n\r\n }\r\n drawCut(node, j);\r\n return a;\r\n } else {\r\n setExplain(101, a, beta);\r\n }\r\n\r\n // Zeile 12\r\n b = a + 1;\r\n mark(12);\r\n setExplain(12, a + 1, 0);\r\n code.unhighlight(10);\r\n\r\n }\r\n // Zeile 14\r\n mark(14);\r\n code.unhighlight(12);\r\n setExplain(14, 0, 0);\r\n return a;\r\n\r\n }", "@Override\n public INDArray gemv(float alpha, INDArray a,\n INDArray x, float beta, INDArray y) {\n if (false) {\n NativeBlas.sgemv('N', a.rows(), a.columns(), alpha, a.data(), 0, a.rows(), x.data(), 0,\n 1, beta, y.data(), 0, 1);\n } else {\n if (beta == 0.0) {\n for (int j = 0; j < a.columns(); j++) {\n double xj = x.get(j);\n if (xj != 0.0) {\n for (int i = 0; i < a.rows(); i++) {\n y.putScalar(i,y.get(i) + a.get(i,j) * xj);\n }\n }\n }\n } else {\n for (int j = 0; j < a.columns(); j++) {\n double byj = beta * y.data()[j];\n double xj = x.get(j);\n for (int i = 0; i < a.rows(); i++) {\n y.putScalar(j,a.get(i,j) * xj + byj);\n }\n }\n }\n }\n return y;\n }", "public void resetAlphaValues();", "public void writeNewAlpha(){\n\t\tFileSystemHandler.writeVector(Parameters.pathToAlphas, this.newAlpha);\n\t}", "private static int min_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('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn alpha;\r\n\t\t}\r\n\r\n\t\treturn beta;\r\n\t}", "public static void main(String[] args) {\n\t\tdouble[] x = new double[SIZE];\r\n\t\tdouble[] y = new double[SIZE];\r\n\t\tdouble[] a = new double[SIZE];\r\n\t\tdouble[] b = new double[SIZE];\r\n\t\tdouble[] c = new double[SIZE];\r\n\t\tdouble[] d = new double[SIZE];\r\n\t\tdouble[] ksi = new double[SIZE];\r\n\t\tdouble[] eta = new double[SIZE];\r\n\t\tdouble hPow2 = Math.pow(h, 2);\r\n\t\tdouble alpha0 = -1.95, alpha1 = 2.0;\r\n\t\tdouble A1 = 0.0, B1 = -6.02;\r\n\t\tdouble beta0 = -1.2, beta1 = 1.0;\r\n\t\tksi[1] = -(alpha1/alpha0);\r\n\t\teta[1] = -(A1/alpha0);\r\n\t\tfor(int k = 1; k < SIZE; k++){\r\n\t\t\ta[k] = 1.0;\r\n\t\t\tx[k] = A + k*h;\r\n\t\t\tb[k] = 2 + hPow2*(x[k]+1);\r\n\t\t\tc[k] = 1.0;\r\n\t\t\td[k] = hPow2*(Math.pow(x[k],5)+Math.pow(x[k],3)-6*x[k]);\r\n\t\t\tif(k!=SIZE-1){\r\n\t\t\t\tksi[k+1] = (c[k])/(b[k]-ksi[k]*c[k]);\r\n\t\t\t\teta[k+1] = (a[k]*eta[k]-d[k])/(b[k]-ksi[k]*c[k]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tint n = SIZE - 1;\r\n\t\ty[n] = (B1-beta0*eta[n])/(beta1+beta0*ksi[n]);\r\n\t\tfor(int k = n-1; k > 0; k--){\r\n\t\t\ty[k] = ksi[k+1]*y[k+1] + eta[k+1];\r\n\t\t\tSystem.out.print(\"ksi: \" + ksi[k] + \" eta: \" + eta[k] + \" y: \"+ y[k]);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void setAlpha(int alpha) {\n\n\t}", "public void combine(Vehicule beta, Vehicule zeta, Graphics2D g2d) {\r\n\t\tif(beta.getTailHeadCoordinate()!=null && zeta.getTailHeadCoordinate()!=null ) {\r\n\t\t\tdouble betaX, betaY, zetaX, zetaY;\r\n\t\t\tbetaX = beta.getTailHeadCoordinate().getX();\r\n\t\t\tbetaY = beta.getTailHeadCoordinate().getY();\r\n\t\t\tzetaX = zeta.getTailHeadCoordinate().getX();\r\n\t\t\tzetaY = zeta.getTailHeadCoordinate().getY();\r\n\t\t\tradBeta = new Vecteur(betaX-reinforce.getCenterX(), betaY-reinforce.getCenterY());\r\n\t\t\tradZeta = new Vecteur(zetaX-reinforce.getCenterX(), zetaY-reinforce.getCenterY());\r\n\t\t\tif(!selfDes && !zetaGotRein && !betaGotRein && sciMode) {\r\n\t\t\t\tdrawLink(betaX,betaY,radBeta,g2d);\r\n\t\t\t\tdrawLink(zetaX,zetaY,radZeta,g2d);\r\n\t\t\t}\r\n\t\t\tif(!selfDes) {\r\n\t\t\t\tif(!betaGotRein && radZeta.module()<radius*1.5 && checkBorder(zetaX,zetaY) && zeta.getSpeed()<zeta.getSpeedMin()+2000) {\r\n\t\t\t\t\treinforce= new Ellipse2D.Double(zeta.getTailHeadCoordinate().getX()-scaleX*radius/2,zeta.getTailHeadCoordinate().getY()-scaleY*radius/2,scaleX*radius,scaleY*radius);\r\n\t\t\t\t\tzetaGotRein = true;\r\n\t\t\t\t}else if(!zetaGotRein && radBeta.module()<radius*1.5 && checkBorder(betaX,betaY) && beta.getSpeed()<beta.getSpeedMin()+2000) {\r\n\t\t\t\t\treinforce= new Ellipse2D.Double(beta.getTailHeadCoordinate().getX()-scaleX*radius/2,beta.getTailHeadCoordinate().getY()-scaleY*radius/2,scaleX*radius,scaleY*radius);\r\n\t\t\t\t\tbetaGotRein = true;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tzetaGotRein = false;\r\n\t\t\t\t\tbetaGotRein = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private void coins_fB(){\n\t\tthis.cube[22] = this.cube[18]; \n\t\tthis.cube[18] = this.cube[24];\n\t\tthis.cube[24] = this.cube[26];\n\t\tthis.cube[26] = this.cube[20];\n\t\tthis.cube[20] = this.cube[22];\n\t}", "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}", "private double probCountVector(double[] alpha) {\n\t\tdouble result = 0.0;\n\t\tdouble sumCountVector = 0.0;\n\t\tdouble sumAlpha = 0;\n\t\tif(countVector.length != alpha.length) {\n\t\t\tthrow new RuntimeException(\"the length of count vector and alpha should be same\");\n\t\t}\n\t\tfor(int i = 0; i < countVector.length; i++) {\n\t\t\tsumCountVector += countVector[i];\n\t\t\tsumAlpha += alpha[i] * scale;\n\t\t}\n\t\tresult = GammaDistrib.lgamma(sumCountVector + 1) + GammaDistrib.lgamma(sumAlpha) - GammaDistrib.lgamma(sumCountVector + sumAlpha);\n\t\tfor(int i = 0; i < countVector.length; i++) {\n\t\t\tresult += GammaDistrib.lgamma(countVector[i] + alpha[i] * scale) - GammaDistrib.lgamma(countVector[i] + 1) - GammaDistrib.lgamma(alpha[i] * scale);\n\t\t}\n\t\treturn result;\n\t}", "T setStartAlpha(Double startAlpha);", "private void blue(){\n\t\tthis.arretes_fB();\n\t\tthis.coins_fB();\n\t\tthis.coins_a1B();\n\t\tthis.coins_a2B();\n\t\tthis.aretes_aB();\n\t\tthis.cube[22] = \"B\";\n\t}", "public void calculate(double alpha, double beta){\n \n this.alpha = alpha;\n this.beta = beta;\n //dimension the results array\n results = new double[data.getOrigin().length][data.getDestination().length];\n //cycle the origins using instance counter\n for(; i < data.getOrigin().length; i++){\n \n //call the calculate balancing factor code as origin changes\n calculateBalancingFactors(true,false);\n \n //cycle the destinations using instance counter\n for(; j < data.getDestination().length; j++){\n \n //call the calculate balancing factor code as destination changes\n calculateBalancingFactors(false,true);\n\n //get the distance value for this i,j pair\n double distance = data.getDistance(i, j);\n \n //test and make sure our distances are valid\n if (distance > -1.0){\n //Calculate model equation\n results[i][j] = ai \n * data.getOrigin()[i] \n * Math.pow(data.getDestination()[j], alpha) \n * Math.exp(distance * beta);\n }else{\n //tell the user about the discrepancy\n System.out.println(\"Data discrepancy between origin, \"\n + \"destination and distance dimensions\");\n }\n \n //end destination cycle\n }\n //reset j\n j = 0;\n\n //end origin cycle\n }\n \n }", "public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);", "public Lambda_phage(double prob_surface, double prob_enzymes) {\n\t\t\n\t\tcurrent_ba = null;\n\t\t\n\t\t/* check for mutation probability */\n\t\tif (mutate_prob >= Sim.randy.nextDouble()) { \n\t\t\tdouble new_prob_surface, new_prob_enzymes;\n\t\t\t\n\t\t\t/* check for helpful mutation probability */\n\t\t\tif (Sim.randy.nextDouble() > mutate_helps) {\n\t\t\t\tnew_prob_surface = prob_surface + Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (1 - prob_surface);\n\t\t\t\tnew_prob_enzymes = prob_enzymes + Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (prob_surface);\n\t\t\t\n\t\t\t/* check for harmful mutation probability */\n\t\t\t} else { // If mutation hurts\n\t\t\t\tnew_prob_surface = prob_surface - Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (1 - prob_enzymes);\n\t\t\t\tnew_prob_enzymes = prob_enzymes - Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (prob_enzymes);\n\t\t\t}\n\t\t\tthis.prob_surface = new_prob_surface;\n\t\t\tthis.prob_enzymes = new_prob_enzymes;\n\t\t\t\n\t\t/* mutation does not occur */\n\t\t} else { \n\t\t\tthis.prob_surface = prob_surface;\n\t\t\tthis.prob_enzymes = prob_enzymes;\n\t\t}\n\n\t\t/* add events */\n\t\tSim.events.add(new Event(this, rate_denature, EVENT_TYPE.DENATURE)); \n\t\tSim.events.add(new Event(this, rate_infection,EVENT_TYPE.INFECT)); \n\n\t\t/* update simulation counters */\n\t\tSim.lps_sum_sr += this.prob_surface;\n\t\tSim.lps_sum_enz += this.prob_enzymes;\n\t}", "public void mo99b(ah ahVar) {\n super.mo99b(ahVar);\n m24192d(ahVar);\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) {\nBeta b=new Beta();\nb.marks();\n\n\n\t}", "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 }", "int getAlphaMod(){\n return getPercentageValue(\"alphaMod\");\n }", "public void update(double[] x, double y, double alpha) {\n\t\tdouble h=eval(x);\n\t\tfor(int i=0; i<x.length; i++) {\n\t\t\tweights[i]= weights[i]+ alpha*(y-h)*x[i];\n\t\t}\n\t}", "public void betaal(double tebetalen) throws TeWeinigGeldException{\n if(saldo+kredietlimiet >= tebetalen){\n saldo = saldo - tebetalen;\n }\n else {\n throw new TeWeinigGeldException(\"U heeft onvoldoende saldo \");\n }\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 static void setAlpha(double alp)\n\t{\n\t\talpha = alp;\t\n\t}", "double [] calcGamma(){\n\t\t\tgamma = new double [N];\n\t\t\tdouble [] gammaParam = new double [noLiveSites];\n\t\t\tint liveSite = 0;\n\t\t\tfor (int i = 0; i < N; i ++){\n\t\t\t\tgamma[i] = 1.0;\n\t\t\t\tif(aliveLattice[i]){\n\t\t\t\t\tdouble phi_i = 1.0 - fracDeadNbors[i];\n\t\t\t\t\tgammaParam[liveSite] = 1-phi_i*(1-alpha[i]);\n\t\t\t\t\tgamma[i] = gammaParam[liveSite];\n\t\t\t\t\tliveSite += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble ave = MathTools.mean(gammaParam);\n\t\t\tdouble var = MathTools.variance(gammaParam);\n\t\t\tdouble [] ret = new double [2];\n\t\t\tret[0] = ave;\n\t\t\tret[1] = var;\n\t\t\treturn ret;\n\t\t}", "private boolean alphas() {\r\n return OPT(GO() && alpha() && alphas());\r\n }", "public void backProp(List<Integer> context, Integer nextWord, double alpha){\n\t\t// TODO: implement backpropagation\n\t}", "private ArrayList[] blxAlpha(ArrayList[] madre, ArrayList[] padre, Random al)\n\t{\n\t\tint numAtributos = madre.length;\n\t\tdouble max = 0;\n\t\tdouble min = 0;\n\t\tdouble I = 0;\n\t\tArrayList[] hijo = new ArrayList[numAtributos];\n\t\t\n\t\t\n\t\tfor (int i = 0; i < numAtributos; i++)\t\t//Para cada atributo\n\t\t{\n\t\t\thijo[i] = new ArrayList();\n\t\t\t\n\t\t\t// El primer y el último valor de cada atributo no cambia\n\t\t\thijo[i].add(madre[i].get(0));\n\t\t\t\n\t\t\tint numParticiones = madre[i].size();\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-1;j++)\n\t\t\t{\n\t\t\t\tif ((Double)(madre[i].get(j)) < (Double)(padre[i].get(j)))\n\t\t\t\t{\t\n\t\t\t\t\tmax = (Double)(padre[i].get(j));\n\t\t\t\t\tmin = (Double)(madre[i].get(j));\n\t\t\t\t}\n\t\t\t\telse\t\t\t\t\t\t\t//Si el gen de la madre es mayor\n\t\t\t\t{\n\t\t\t\t\tmin = (Double)(padre[i].get(j));\n\t\t\t\t\tmax = (Double)(madre[i].get(j));\n\t\t\t\t}\t\t\t\t\t \n\t\t\t\tI = max - min;\t//Obtenemos la diferencia\n\t\t\t\tmin = min - I * 0.15;\t//Calculamos el extremo inferior\n\t\t\t\tmax = max + I * 0.15;\t//Calculamos el extremo superior\n\t\t\t\thijo[i].add(min + al.nextDouble() * (max - min));\t//Calculamos un punto aleatorio dentro del intervalo\n\t\t\t}\n\t\t\t\n\t\t\t// El primer y el último valor de cada atributo no cambia\n\t\t\thijo[i].add(madre[i].get(numParticiones-1));\n\t\t}\n\t\t\n\t\t// Validación del individuo\n\t\t\n\t\t// Ponemos a mínimo los valores menores que el mínimo y al máximo los valores menores que el máximo\n\t\tfor(int i=0;i < numAtributos; i++)\n\t\t{\n\t\t\tint numParticiones = hijo[i].size();\n\t\t\t\n\t\t\tmin = ((Double)(hijo[i].get(0)));\n\t\t\tmax = ((Double)(hijo[i].get(numParticiones-1)));\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-1;j++)\n\t\t\t{\n\t\t\t\tif(((Double)(hijo[i].get(j))) < min)\n\t\t\t\t{\n\t\t\t\t\thijo[i].add(j, min);\n\t\t\t\t}\n\t\t\t\telse if((((Double)(hijo[i].get(j))) > max))\n\t\t\t\t{\n\t\t\t\t\thijo[i].add(j, max);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ordenamos los valores de menor a mayor\n\t\tfor(int i=0;i < numAtributos; i++)\n\t\t{\n\t\t\tint numParticiones = hijo[i].size();\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-2;j++)\n\t\t\t{\n\t\t\t\tfor(int k = 1; k < numParticiones-2; k++)\n\t\t\t\t{\n\t\t\t\t\tdouble temp = ((Double)(hijo[i].get(k)));\n\t\t\t\t\tdouble compara = ((Double)(hijo[i].get(k+1)));\n\t\t\t\t\t\n\t\t\t\t\tif(temp > compara)\n\t\t\t\t\t{\n\t\t\t\t\t\thijo[i].remove(k);\n\t\t\t\t\t\thijo[i].add(k, compara);\n\t\t\t\t\t\thijo[i].remove(k+1);\n\t\t\t\t\t\thijo[i].add(k+1, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn hijo;\t\n\t}", "public DocumentVector multiply(double alpha) {\n\t\tDocumentVector result = new DocumentVector(this.getAttCount(), 0);\n\t\tfor (int i = 0; i < this.getAttCount(); i++) {\n\t\t\tresult.setValue(i, alpha * this.getValueAsReal(i));\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public Eq(final Expression alpha, final Expression beta) {\n\t super(LogicalType.instance, alpha, beta);\n\t}", "public static double[] insideAlgorithm(final Hypergraph graph, final Hyperpotential w, final Semiring s) {\n final int n = graph.getNodes().size();\n final double[] beta = new double[n];\n // \\beta_i = 0 \\forall i\n Arrays.fill(beta, s.zero());\n graph.applyTopoSort(new HyperedgeFn() {\n\n @Override\n public void apply(Hyperedge e) {\n // \\beta_{H(e)} += w_e \\prod_{j \\in T(e)} \\beta_j\n double prod = s.one();\n for (Hypernode jNode : e.getTailNodes()) {\n prod = s.times(prod, beta[jNode.getId()]);\n }\n int i = e.getHeadNode().getId();\n //if (log.isTraceEnabled()) { log.trace(String.format(\"old beta[%d] = %f\", i, s.toReal(beta[i]))); }\n beta[i] = s.plus(beta[i], s.times(w.getScore(e, s), prod));\n //if (log.isTraceEnabled()) { log.trace(String.format(\"%s w_e=%f beta[%d] = %f\", e.getLabel(), s.toReal(w.getScore(e, s)), i, s.toReal(beta[i]))); }\n }\n \n });\n return beta;\n }", "private void aretes_aB(){\n\t\tthis.cube[22] = this.cube[12]; \n\t\tthis.cube[12] = this.cube[48];\n\t\tthis.cube[48] = this.cube[39];\n\t\tthis.cube[39] = this.cube[3];\n\t\tthis.cube[3] = this.cube[22];\n\t}" ]
[ "0.73155475", "0.6855153", "0.6803162", "0.67343616", "0.64507514", "0.6368012", "0.6345838", "0.6296289", "0.6296289", "0.627566", "0.6246005", "0.62376964", "0.6136233", "0.61285424", "0.60872906", "0.60539716", "0.6008371", "0.59817237", "0.5955981", "0.59527475", "0.59477925", "0.5917584", "0.59169275", "0.59132975", "0.59132975", "0.58792245", "0.5872862", "0.5871207", "0.58482975", "0.5830119", "0.5816526", "0.5800823", "0.5792963", "0.57756656", "0.5772461", "0.57658535", "0.57627785", "0.5753941", "0.5716381", "0.5701377", "0.5656123", "0.56461084", "0.56393445", "0.5598011", "0.5580688", "0.5544048", "0.55130565", "0.5497031", "0.5496529", "0.5495164", "0.5469781", "0.5462903", "0.5457372", "0.54521185", "0.54373676", "0.54317373", "0.54126006", "0.54054093", "0.53835136", "0.5360233", "0.5351349", "0.5348274", "0.53470296", "0.5344888", "0.53390694", "0.5336428", "0.5304799", "0.5300697", "0.52993935", "0.52928114", "0.5289495", "0.52872616", "0.528701", "0.5272042", "0.5269443", "0.52509844", "0.5242953", "0.5240881", "0.5226872", "0.52220887", "0.521409", "0.51833856", "0.518069", "0.5168839", "0.51520723", "0.515133", "0.51465505", "0.5144426", "0.51443475", "0.51402515", "0.5138573", "0.5134987", "0.5133843", "0.51323843", "0.5130061", "0.51295626", "0.5121135", "0.5119793", "0.5107549", "0.51034814", "0.51008284" ]
0.0
-1
checks if I can win in one move and returns that move
public PentagoMove quickwin(PentagoBoardState boardState) { PentagoBoardState pbs = (PentagoBoardState) boardState.clone(); ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves(); //ArrayList<Integer> scores = new ArrayList<Integer>(); for (int i = 0; i < legalmoves.size(); i++) { //loop through all my moves and see if they are a winner PentagoBoardState newboard = (PentagoBoardState) pbs.clone(); PentagoMove next = legalmoves.get(i); newboard.processMove(next); int score = evaluate(newboard); if (score > 1200000) { //check if winner if score above 1 200 000 //System.out.println("FOUND A WINNER" + score); return next; } } return null; // if no winner return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "boolean checkWin(Tile initialTile);", "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 boolean getWin() {\n if (targetDistance == 25) {\n if (missDistance <= 1 && missDistance >= -1) { //checks 25m win\n return true;\n }\n else {\n return false;\n }\n }\n else if (targetDistance == 50) { //checks 50m win\n if (missDistance <= 2 && missDistance >= -2) {\n return true;\n }\n else {\n return false;\n }\n }\n else { //checks 100m win\n if (missDistance <= 3 && missDistance >= -3) {\n return true;\n }\n else {\n return false;\n }\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 }", "public int winner(){\n getValidMoves();\n if(check(1)!=0) return 1;\n else if(check(-1)!=0) return -1;\n else if(validX.size()==0) return 2;\n else return 0;\n }", "public Player checkWin ()\n {\n //checks rows\n for (int row = 0; row < 3; row++)\n if (getGridElement(row, 0).getPlayer() == getGridElement(row, 1).getPlayer() &&\n getGridElement(row, 1).getPlayer() == getGridElement(row, 2).getPlayer() &&\n getGridElement(row, 0).getPlayer() != Player.NONE)\n return getGridElement(row, 0).getPlayer();\n\n //checks columns\n for (int column = 0; column < 3; column++)\n if (getGridElement(0, column).getPlayer() == getGridElement(1, column).getPlayer() &&\n getGridElement(1, column).getPlayer() == getGridElement(2, column).getPlayer() &&\n getGridElement(0, column).getPlayer() != Player.NONE)\n return getGridElement(0, column).getPlayer();\n\n //checks diagonals\n if (getGridElement(0, 0).getPlayer() == getGridElement(1, 1).getPlayer() &&\n getGridElement(1, 1).getPlayer() == getGridElement(2, 2).getPlayer() &&\n getGridElement(0, 0).getPlayer() != Player.NONE)\n return getGridElement(0, 0).getPlayer();\n if (getGridElement(2, 0).getPlayer() == getGridElement(1, 1).getPlayer() &&\n getGridElement(1, 1).getPlayer() == getGridElement(0, 2).getPlayer() &&\n getGridElement(0, 0).getPlayer() != Player.NONE)\n return getGridElement(2, 0).getPlayer();\n\n return Player.NONE;\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}", "public int checkForWin() \r\n {\r\n \twinner = null;\r\n \tint winrole = -1;\r\n \tif(isBoardFull()){\r\n \t\tint white = 0;\r\n \t\tint black = 0;\r\n\t\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\t\tfor(int j = 0; j<boardsize; ++j){\r\n\t\t\t\t\tif(board[i][j] == 0){\r\n\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(board[i][j] == 1){\r\n\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(white > black){\r\n\t\t\t\twinrole = 0;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\t\r\n\t\t\telse if(black > white){\r\n\t\t\t\twinrole = 1;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twinrole=2;\r\n\t\t\t}\r\n\t\t\treturn winrole;\r\n \t}\r\n \treturn -1;\r\n }", "private int checkWinner() {\n if (this.turnCount >= 2) {\n int colWin = this.checkColumn();\n if (colWin > 0) {\n return colWin;\n }\n\n int rowWin = this.checkRow();\n if (rowWin > 0) {\n return rowWin;\n }\n\n int diagWin = checkDiagonal();\n if (diagWin > 0) {\n return diagWin;\n }\n }\n return 0;\n }", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "public boolean checkWin(int move)\n\t{\n\t\tif (checkHorizontal(move) || checkVertical(move) || checkDiagonal(move))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean isPlayer1Move(int move) {\n return ((move < 5) || (move == 10));\n }", "public boolean didLastMoveWin(){\n\t\tboolean flag=false;\n\t\tif(horizontalWin()){\n\t\t\tSystem.out.println(\"You Won\");\n\t\t\tflag=true;\n\t\t}\n\t\tif(verticalWin()){\n\t\t\tSystem.out.println(\"You Won\");\n\t\t\tflag=true;\n\t\t}\n\t\tif(diagonalWin()){\n\t\t\tSystem.out.println(\"You Won\");\n\t\t\tflag=true;\n\t\t}\n\t\treturn flag;\n\t}", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\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 }", "private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "protected boolean checkForWin() {\r\n \t\r\n if (squaresRevealed == this.width * this.height - this.mines) {\r\n finishFlags();\r\n finish(GameStateModel.WON);\r\n return true;\r\n } \t\r\n \t\r\n return false;\r\n \t\r\n }", "public final boolean checkForWin() {\r\n boolean result = false;\r\n String player = \"\";\r\n \r\n for (Rail rail : rails) {\r\n if (rail.isWinner()) {\r\n result = true;\r\n for(Tile tile : rail.getTiles()) {\r\n tile.setBackground(Color.GREEN);\r\n player = tile.getText();\r\n }\r\n if (player.equals(\"X\")) {\r\n winningPlayer = \"X\";\r\n this.xWins++;\r\n } else if (player.equals(\"0\")) {\r\n winningPlayer = \"0\";\r\n this.oWins++;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n return result;\r\n }", "public int move(int player, int p, int x, int y) throws Exception{\n if(player != next || player != p)\n throw new Exception(\"Invalid position.\");\n\n //int x = pos & 255;\n //int y = pos>>8 & 255;\n\n if(board[x][y] == 0){\n board[x][y] = player;\n next = next==1?2:1;\n stonesNum++;\n setWinFlag(x, y);\n }else{\n throw new Exception(\"Invalid move.\");\n }\n return winFlag;\n }", "private boolean isThereValidMove() {\n\t\treturn true;\n\t}", "public static boolean checkWinner(){\n \n if(board[0][0] == board[0][1] && board[0][1] == board[0][2] && (board[0][0] == 'x' || board [0][0] == 'o'))\n return true;\n else if(board[1][0] == board[1][1] && board[1][1] == board[1][2] && (board[1][0] == 'x' || board[1][0] == 'o'))\n return true;\n else if(board[2][0] == board[2][1] && board[2][1] == board[2][2] && (board[2][0] == 'x' || board[2][0] == 'o'))\n return true;\n else if(board[0][0] == board[1][0] && board[1][0] == board[2][0] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][1] == board[1][1] && board[1][1] == board[2][1] && (board[0][1] == 'x' || board[0][1] == 'o'))\n return true;\n else if(board[0][2] == board[1][2] && board[1][2] == board[2][2] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else\n return false;\n \n }", "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 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 }", "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 }", "@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}", "public boolean checkForWin()\n {\n //Horizontal win\n for (int r = 0; r <= 5; r++)\n {\n for (int c = 0; c <= 3; c++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r] == player_turn &&\n current_board[c+2][r] == player_turn &&\n current_board[c+3][r] == player_turn)\n return true;\n }\n }\n //Vertical win\n for (int c = 0; c <= 6; c++)\n {\n for (int r = 0; r <= 2; r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c][r+1] == player_turn &&\n current_board[c][r+2] == player_turn &&\n current_board[c][r+3] == player_turn)\n return true;\n }\n }\n //Shortest diagonals/anti diagonals (cell length == 4)\n //postive slope\n if (current_board[0][2] == player_turn && current_board[1][3] == player_turn && current_board[2][4] == player_turn && current_board[3][5] == player_turn)\n return true;\n if (current_board[3][0] == player_turn && current_board[4][1] == player_turn && current_board[5][2] == player_turn && current_board[6][3] == player_turn)\n return true;\n //negative slope\n if (current_board[0][3] == player_turn && current_board[1][2] == player_turn && current_board[2][1] == player_turn && current_board[3][0] == player_turn)\n return true;\n if (current_board[3][5] == player_turn && current_board[4][4] == player_turn && current_board[5][3] == player_turn && current_board[6][2] == player_turn)\n return true;\n\n //Medium-length diagonals/anti diagonals (cell length == 5)\n //positive slope\n if (current_board[0][1] == player_turn && current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn)\n return true;\n if (current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn && current_board[4][5] == player_turn)\n return true;\n if (current_board[2][0] == player_turn && current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn)\n return true;\n if (current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn && current_board[6][4] == player_turn)\n return true;\n //negative slope\n if (current_board[0][4] == player_turn && current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn)\n return true;\n if (current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn && current_board[4][0] == player_turn)\n return true;\n if (current_board[2][5] == player_turn && current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn)\n return true;\n if (current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn && current_board[6][1] == player_turn)\n return true;\n\n //Longest diagonals/anti diagonals (cell length == 6)\n //positive slope\n for (int c=0, r=0; c <= 2 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n for (int c=1, r=0; c <= 3 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n //negative slope\n for (int c=0, r=5; c <= 2 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n for (int c=1, r=5; c <= 3 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n\n return false;\n }", "boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\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}", "int chooseMove();", "public boolean playerOneWin()\n\t{\n\t\tif( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") ) \n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t}// end of if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\treturn false;\n\t}", "private boolean isWinningMove(PlayerNumber thisPlayer, Set<CMNMove> moves) {\n\t\tboolean isWinner = false;\n\t\tIterator<Set<CMNMove>> WINSIterator = WINS.iterator();\n\t\twhile (WINSIterator.hasNext()) {\n\t\t\tSet<CMNMove> WINSbits = WINSIterator.next();\n\t\t\tif (moves.containsAll(WINSbits)) {\n\t\t\t\tisWinner = true;\n\t\t\t\twinningPlayer = thisPlayer;\n\t\t\t}\n\t\t}// end WHILE\n\t\treturn isWinner;\n\t}", "boolean canMove();", "private boolean isNextMoveEnPassentCapture(Move move)\r\n\t{\r\n\t\tif (!(move.capture instanceof Pawn)) return false;\r\n\t\tif (Math.abs(move.from.coordinate.x - move.to.coordinate.x) != 1) return false;\r\n\t\tif (Math.abs(move.from.coordinate.y - move.to.coordinate.y) != 1) return false;\r\n\t\tif (!move.to.isEmpty()) return false;\r\n\t\treturn true;\r\n\t}", "private boolean isValidMove(int pressedHole) {\n return getPlayerHole(pressedHole).getKorgools() != 0;\n }", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "boolean isWinner() {\n boolean win = true;\n // first method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if ((state[i][j] == 'X' && stateGame[i][j] != '*') || (state[i][j] != 'X' && stateGame[i][j] == '*'))\n win = false;\n }\n }\n if (win)\n return true;\n\n win = true;\n // second method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (state[i][j] == '.' && stateGame[i][j] == '.')\n win = false;\n }\n }\n return win;\n }", "private boolean winner() {\n\t\t\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if(gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT] + \n\t\t\t\t gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT] +\n\t\t\t\t gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT] == CAT){\n\t\t\t//cat winner player_1 goes first\n\t\t\twinner = CAT;\n\t\t}else if(gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT] + \n\t\t\t\t gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT] +\n\t\t\t\t gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT] == (CAT + 3)){\n\t\t\t//cat winner player_2 goes first\n\t\t\twinner = CAT;\n\t\t} \n\t\t\n\t\tif(winner > 0){\n\t\t\treturn true;//there is a winner\n\t\t}else{\n\t\t\treturn false;//still no winner yet\n\t\t}\t\n\t}", "public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }", "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}", "boolean makeMove();", "private boolean checkPlayerOneWin()\n {\n boolean playerOneWin = false;\n \n if( board[0][0] == \"X\" && board[0][1] == \"X\" && board[0][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[1][0] == \"X\" && board[1][1] == \"X\" && board[1][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][0] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][1] == \"X\" && board[1][1] == \"X\" && board[2][1] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][2] == \"X\" && board[1][1] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n \n return playerOneWin;\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 }", "public int checkWin(){\n //check for horizontal and vertical wins\n for(int i=0; i<3; i++){\n if(gameBoard[i][0].equals(\"O\") && gameBoard[i][1].equals(\"O\") && gameBoard[i][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[i][0].equals(\"X\") && gameBoard[i][1].equals(\"X\") && gameBoard[i][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][i].equals(\"O\") && gameBoard[1][i].equals(\"O\") && gameBoard[2][i].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][i].equals(\"X\") && gameBoard[1][i].equals(\"X\") && gameBoard[2][i].equals(\"X\")){\n return 2;\n }\n }\n //check for both diagonal cases\n if(gameBoard[0][0].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][2].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][0].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][0].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][2].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][0].equals(\"X\")){\n return 2;\n }\n return 0;\n }", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "private boolean makeMove(Move move) {\n\n // Moving piece from Cell\n Piece sourcePiece = move.getStart().getCurrentPiece();\n\n // Valid Move? Calling Piece actual implementation\n if (!sourcePiece.canMove(board, move.getStart(), move.getEnd())) {\n System.out.println(\"Invalid Move, sourcePiece is \" + sourcePiece);\n }\n\n // Killed other player Piece?\n Piece destPiece = move.getEnd().getCurrentPiece();\n if (destPiece != null) {\n destPiece.setKilled(true);\n move.setPieceKilled(destPiece);\n }\n\n // castling?\n if (sourcePiece instanceof King\n && sourcePiece.isCastlingMove()) {\n move.setCastlingMove(true);\n }\n\n // Store the Move\n movesPlayed.add(move);\n\n // If move is VALID, set piece=null at start cell and new piece at dest cell\n move.getEnd().setCurrentPiece(sourcePiece);\n move.getStart().setCurrentPiece(null);\n\n // Game Win or not\n if (destPiece instanceof King) {\n if (move.getPlayedBy().isWhiteSide()) {\n this.setStatus(GameStatus.WHITE_WIN);\n } else {\n this.setStatus(GameStatus.BLACK_WIN);\n }\n\n }\n\n return true;\n }", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "public boolean isWinningMove(Move move, Player player) {\n int adiagonal = 0, diagonal = 0, horizontal = 0, vertical = 0;\n\n for (int i = 0; i < LENGTH; i++) {\n if (getPlayerFromBoard(i, i) == player) {\n diagonal++;\n }\n if (getPlayerFromBoard(move.x, i) == player) {\n horizontal++;\n }\n if (getPlayerFromBoard(i, move.y) == player) {\n vertical++;\n }\n if (getPlayerFromBoard(i, LENGTH - i - 1) == player) {\n adiagonal++;\n }\n }\n\n return diagonal == LENGTH || horizontal == LENGTH\n || vertical == LENGTH || adiagonal == LENGTH;\n }", "Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }", "private boolean moveExists(int move) {\n \tint[] board = mGame.getBoard();\n \tint piece = board[move & Move.SQUARE_MASK];\n \tint side = piece >> Piece.SIDE_SHIFT & 1;\n \tif (side != mGame.getCurrentSide()) {\n \t\treturn false;\n \t}\n \tif ((piece & Piece.DEAD_FLAG) != 0) {\n \t\treturn false;\n \t}\n \tMoveArray moves = MoveGenerator.generateMoves(mGame);\n \t\n \tint[] mv = moves.getMoves();\n \tint size = moves.size();\n \tfor (int i = 0; i < size; i++) {\n \t\tif(mv[i] == move) {\n \t\t\treturn true;\n \t\t}\n \t}\n \treturn false;\n }", "public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }", "boolean canMove(Tile t);", "public boolean isValidMove(int value){\n if (value == HIT || value == MISS) {\n System.out.println(\"Already shot here\");\n return false;\n }\n return true;\n }", "boolean isValidMove(int move)\n\t{\n\t\treturn move >= 0 && move <= state.size() - 1 && state.get(move) == 0;\n\t}", "public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }", "public boolean GetMove();", "public Board twin() {\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (board[i][j] != 0) {\n\t\t\t\t\tif (i < (n-1) && board[i+1][j] != 0)\n\t\t\t\t\t\treturn move(i, j, i+1, j);\n\t\t\t\t\tif (j < (n-1) && board[i][j+1] != 0)\n\t\t\t\t\t\treturn move(i, j, i, j+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "private boolean checkWinner() {\n\t\tboolean frontDiagWin = !myBoard.isEmpty(0, 0);\n\t\tchar frontDiagToken = myBoard.getCell(0, 0);\n\t\tboolean backDiagWin = !myBoard.isEmpty(0, Board.BOARD_SIZE - 1);\n\t\tchar backDiagToken = myBoard.getCell(0, Board.BOARD_SIZE - 1);\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\t// check Diagonals\n\t\t\tfrontDiagWin = myBoard.getCell(i, i) == frontDiagToken ? frontDiagWin\n\t\t\t\t\t: false;\n\t\t\tbackDiagWin = myBoard.getCell(i, (Board.BOARD_SIZE - 1) - i) == backDiagToken ? backDiagWin\n\t\t\t\t\t: false;\n\t\t\t// check Rows and Columns\n\t\t\tboolean rowWin = !myBoard.isEmpty(i, 0);\n\t\t\tchar startRowToken = myBoard.getCell(i, 0);\n\t\t\tboolean colWin = !myBoard.isEmpty(0, i);\n\t\t\tchar startColToken = myBoard.getCell(0, i);\n\t\t\tfor (int j = 0; j < Board.BOARD_SIZE; j++) {\n\t\t\t\trowWin = myBoard.getCell(i, j) == startRowToken ? rowWin\n\t\t\t\t\t\t: false;\n\t\t\t\tcolWin = myBoard.getCell(j, i) == startColToken ? colWin\n\t\t\t\t\t\t: false;\n\t\t\t}\n\t\t\tif (rowWin || colWin) {\n\t\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t\t+ (rowWin ? startRowToken : startColToken)\n\t\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif (frontDiagWin || backDiagWin) {\n\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t+ (frontDiagWin ? frontDiagToken : backDiagToken)\n\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkWin(Integer playerMove, Location loc)\n\t{\n\t\tboolean isWinAcross = true, isWinDown = true, isWinDiag1 = true, isWinDiag2 = true;\n\t\tfor (int col = 0; col < super.getRows() && isWinAcross; col++) //ends loop after isWinAcross is true\n\t\t\tif (grid[loc.getRow()][col] == null || !grid[loc.getRow()][col].equals(playerMove))\n\t\t\t\tisWinAcross = false;\n\t\tfor (int row = 0; row < super.getCols() && isWinDown; row++) //ends loop after isWinDown is true\n\t\t\tif (grid[row][loc.getCol()] == null || !grid[row][loc.getCol()].equals(playerMove))\n\t\t\t\tisWinDown = false;\n\t\tfor (int diagonal = 0; diagonal < super.getCols() && isWinDiag1; diagonal++) //ends loop after isWinDiag1 is true\n\t\t\tif (grid[diagonal][diagonal] == null || !grid[diagonal][diagonal].equals(playerMove))\n\t\t\t\tisWinDiag1 = false;\n\t\tfor (int diagonal2 = 0; diagonal2 < super.getCols() && isWinDiag2; diagonal2++) //ends loop after isWinDiag2 is true\n\t\t\tif (grid[getCols() - diagonal2 - 1][diagonal2] == null || !grid[getCols() - diagonal2 - 1][diagonal2].equals(playerMove))\n\t\t\t\tisWinDiag2 = false;\n\t\treturn isWinAcross || isWinDown || isWinDiag1 || isWinDiag2;\n\t}", "public int winningPlayerIndex(int[][] board, Move lastMove) {\n int m = board.length;\n int n = board[0].length;\n\n\n int player = lastMove.playerIndex;\n int curRow = lastMove.row;\n int curCol = lastMove.col;\n\n\n int start = Math.max(0, curCol - 3);\n for (int i = start; i + 3 < n; i++) {\n if (board[curRow][i] == player && board[curRow][i + 1] == player\n && board[curRow][i + 2] == player && board[curRow][i + 3] == player) {\n return player;\n }\n }\n\n int startRow = Math.max(0, curRow - 3);\n for (int i = start; i + 3 < m; i++) {\n if (board[i][curCol] == player && board[i + 1][curCol] == player\n && board[i + 2][curCol] == player && board[i + 3][curCol] == player) {\n return player;\n }\n }\n\n int count = 0;\n int x = curRow;\n int y = curCol;\n while (x >= 0 && y >= 0) {\n if (board[x][y] == player) {\n count++;\n x--;\n y--;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x = curRow + 1;\n y = curCol + 1;\n while (x < m && y < n) {\n if (board[x][y] == player) {\n count++;\n x++;\n y++;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n int count1 = 0;\n int x1 = curRow;\n int y1 = curCol;\n while (x1 < m && y1 >= 0) {\n if (board[x1][y1] == player) {\n count1++;\n x1++;\n y1--;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x1 = curRow - 1;\n y1 = curCol + 1;\n while (x1 >= 0 && y1 < n) {\n if (board[x1][y1] == player) {\n count1++;\n x1--;\n y1++;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n\n\n// //horizontal\n// for (int i = 0; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i][j + 1] == player && board[i][j + 2] == player && board[i][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //vertical\n// for (int i = 0; i + 3 < m; i++) {\n// for (int j = 0; j < n; j++) {\n// if (board[i][j] == player && board[i + 1][j] == player && board[i + 2][j] == player && board[i + 3][j] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagonal from upper left to lower right\n// for (int i = 3; i < m; i++) {\n// for (int j = 3; j < n; j++) {\n// if (board[i][j] == player && board[i - 1][j - 1] == player && board[i - 2][j - 2] == player && board[i - 3][j - 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagnoal from lower left to upper right\n// for (int i = 3; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i - 1][j + 1] == player && board[i - 2][j + 2] == player && board[i - 3][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n return -1;\n }", "private int Rand_Move() {\n\t\tRandom r = new Random();\n\t\tint move = NO_MOVE;\n\t\tdo{\n\t\t\tmove = r.nextInt(9);\n\t\t}while(square_empty[move] == false);\n\t\treturn move;\n\t}", "private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\n }", "private void checkWin() {\n // Check if a dialog is already displayed\n if (!this.gameOverDisplayed) {\n // Check left paddle\n if (Objects.equals(this.scoreL.currentScore, this.winCount) && (this.scoreL.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_1_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_LOSE);\n }\n // Right paddle\n } else if (Objects.equals(this.scoreR.currentScore, this.winCount) && (this.scoreR.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_2_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_WIN);\n }\n }\n }\n }", "@Test\n public void moreThanOneCheckerOnToLocation() {\n\n assertTrue(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.R1, Location.R3));\n game.nextTurn();\n // to der gerne skulle vaere lovlige og stemme med terningerne\n assertTrue(game.move(Location.R6, Location.R5));\n assertTrue(game.move(Location.R8, Location.R6));\n game.nextTurn();\n assertTrue(game.move(Location.R2, Location.R5));\n assertTrue(game.move(Location.R3, Location.R7));\n game.nextTurn();\n // der staar nu to sorte paa R4\n assertFalse(game.move(Location.R6, Location.R3));\n }", "public boolean checkForWin(){\n\t\t\n\t\tPlayer p = Game.getCurrPlayer();\n\t\t// if player made it to win area, player won\n\t\tif(p.won()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\t\t// if player is the last player on the board, player won\n\t\tif(numPlayers == 1 && !p.hasBeenKicked()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "boolean hasWin();", "public long possibleNonLosingMoves() {\r\n long possible_mask = possible();\r\n long opponent_win = opponent_winning_position();\r\n long forced_moves = possible_mask & opponent_win;\r\n if(forced_moves != 0) {\r\n if((forced_moves & (forced_moves - 1))!=0) // check if there is more than one forced move\r\n return 0; // the opponnent has two winning moves and you cannot stop him\r\n else possible_mask = forced_moves; // enforce to play the single forced move\r\n }\r\n return possible_mask & ~(opponent_win >> 1); // avoid to play below an opponent winning spot\r\n }", "public void challengeMove(){\n int maxOutcome = -1;\n int returnIndex = -1;\n Hole lastHole;\n Hole selectedHole;\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n for(int i = 0; i < availableHoles.size(); i++){\n selectedHole = availableHoles.get(i);\n lastHole = holes[(selectedHole.getHoleIndex() + selectedHole.getNumberOfKoorgools() - 1) % 18];\n if(lastHole.getOwner() != nextToPlay){\n int numOfKorgools = lastHole.getNumberOfKoorgools() +1;\n if(numOfKorgools == 3 && !nextToPlay.hasTuz()){\n int otherTuzIndex = getPlayerTuz(Side.WHITE);\n if(otherTuzIndex == -1 || ((otherTuzIndex + 9) != lastHole.getHoleIndex())) {\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n if(numOfKorgools % 2 == 0 && numOfKorgools > maxOutcome){\n maxOutcome = numOfKorgools;\n returnIndex = selectedHole.getHoleIndex();\n }\n }\n }\n if(returnIndex <= -1){\n randomMove();\n return;\n }\n redistribute(returnIndex);\n }", "boolean doMove();", "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 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 boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }", "public boolean checkWinner(Cell value) {\n\t\tif(turn >63) {\n\t\t\t//\t\t\tSystem.out.println(\"Game is a draw.\");\n\t\t\treturn true;\n\t\t}\n\n\t\tif(check2DRowWinner(value) || check2DColWinner(value) || check2DDimWinner(value) || check2DDiagnolWinner(value) || check3DRowDiagnol(value) || check3DColDiagnol(value) || check3DDiagnolWinner(value)) {\n\t\t\tif (value.equals(Cell.O)) {\n\t\t\t\twinner = \"O\";\n\t\t\t} else {\n\t\t\t\twinner = \"X\";\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "protected int checkMove(Direction d) {\n Position pos = currentPosition.nextPosition(d); \n if (!pos.inPlayArea()) return -1;\n Station nS = map.nearestStation(pos);\n if (Position.withinRange(nS.pos, pos) && !nS.isPositive) {\n return 0;\n }\n else return 1;\n }", "private boolean isLastMoveRochade()\r\n\t{\r\n\t\tMove lastMove = getLastMove();\r\n\t\tif (lastMove == null) return false;\r\n\t\tPiece king = lastMove.to.piece;\r\n\t\tif (!(king instanceof King)) return false;\r\n\t\t\r\n\t\tint y = king.getColor().equals(Color.WHITE) ? 0 : 7;\r\n\t\tif (lastMove.to.coordinate.y != y) return false;\r\n\t\t\r\n\t\tint xDiffAbs = Math.abs(lastMove.to.coordinate.x - lastMove.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "Move getMove() {\r\n int[] p0 = new int[2];\r\n int[] p1 = new int[3];\r\n\r\n while (_playing) {\r\n while (_playing) {\r\n while (_playing) {\r\n _command.getMouse(p0);\r\n System.out.println(\"_command.getMouse 0\");\r\n if (p0[0] >= 0 && p0[1] >= 0) {\r\n System.out.println(\"We got a mouse move on the board for 0\");\r\n break;\r\n }\r\n try {\r\n Thread.sleep(magic1);\r\n System.out.println(\"This is the thread.sleep.\");\r\n } catch (InterruptedException ex) {\r\n System.out.println(\"This is the interruption.\");\r\n return null;\r\n }\r\n }\r\n if (!_playing) {\r\n return null;\r\n }\r\n if (_board.get(p0[0] + 1, p0[1] + 1) == _board.turn()) {\r\n System.out.print(\"Warning!!!\");\r\n break;\r\n }\r\n }\r\n if (!_playing) {\r\n return null;\r\n }\r\n while (_playing) {\r\n _command.getMouse(p1);\r\n System.out.println(\"_command.getMouse 1\");\r\n if (p1[0] >= 0 && p1[1] >= 0) {\r\n System.out.println(\"We got a mouse move on the board for 1\");\r\n break;\r\n }\r\n try {\r\n Thread.sleep(magic1);\r\n System.out.println(\"This is the thread.sleep.\");\r\n } catch (InterruptedException ex) {\r\n System.out.println(\"This is the interruption.\");\r\n return null;\r\n }\r\n }\r\n if (!_playing) {\r\n return null;\r\n }\r\n if (p0[0] == p1[0] || p0[1] == p1[1]\r\n || Math.abs(p1[0] - p0[0]) == Math.abs(p1[1] - p0[1])) {\r\n Move m = Move.create(p0[0] + 1, p0[1] + 1, p1[0] + 1, p1[1] + 1,\r\n _board);\r\n if (m != null && _board.isLegal(m)) {\r\n return m;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "private String easyMove() {\n int randomHole = evaluate();\n while (!isValidMove(randomHole)) {\n randomHole = evaluate();\n }\n\n return super.makeAMove(randomHole);\n }", "public int determineWinner() {\n\t\tif(board[1][1] != 0 && (\n\t\t\t(board[1][1] == board[0][0] && board[1][1] == board[2][2]) ||\n\t\t\t(board[1][1] == board[0][2] && board[1][1] == board[2][0]) ||\n\t\t\t(board[1][1] == board[0][1] && board[1][1] == board[2][1]) ||\n\t\t\t(board[1][1] == board[1][0] && board[1][1] == board[1][2]))){\n\t\t\treturn board[1][1];\n\t\t}\n\t\telse if (board[0][0] != 0 &&(\n\t\t\t(board[0][0] == board[0][1] && board[0][0] == board[0][2]) ||\n\t\t\t(board[0][0] == board[1][0] && board[0][0] == board[2][0]))){\n\t\t\treturn board[0][0];\n\t\t}\n\t\telse if (board [2][2] != 0 && (\n\t\t\t(board[2][2] == board[2][0] && board[2][2] == board[2][1]) ||\n\t\t\t(board[2][2] == board[0][2] && board[2][2] == board[1][2]))) {\n\t\t\treturn board[2][2];\n\t\t}\n\t\t\n\t\t//See if every square has been marked, return still in progress if not\n\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] == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return tie\n\t\treturn 3;\n\t}", "public final Tile selectComputerMove() {\r\n Tile tile = null;\r\n int count = 0;\r\n String tileName = null;\r\n boolean continueLoop = true;\r\n \r\n // First try to find a winning move\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"0\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0; \r\n }\r\n \r\n // If none found, try to block \"X\"\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"X\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0;\r\n }\r\n \r\n // If no blocking move, try to play the center which gives \"O\"\r\n // a statistical advantage\r\n if (!tiles[R2C2].isSelected()) {\r\n return tiles[R2C2];\r\n }\r\n \r\n \r\n // If center move is not available, try to find an open corner tile, \r\n // which might set up an winning combination\r\n if (!tiles[R1C1].isSelected()) {\r\n return tiles[R1C1];\r\n } else if (!tiles[R3C3].isSelected()) {\r\n return tiles[R3C3];\r\n } else if (!tiles[R3C1].isSelected()) {\r\n return tiles[R3C1];\r\n } else if (!tiles[R1C3].isSelected()) {\r\n return tiles[R1C3];\r\n }\r\n \r\n // If none found just pick an empty tile at random\r\n if(tileName == null) {\r\n int row = rand.nextInt(3) + 1;\r\n int col = rand.nextInt(3) + 1;\r\n tileName = \"r\" + row + \"c\" + col;\r\n for (Tile btn: tiles) {\r\n if (btn.getName().equals(tileName)) {\r\n tile = btn;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n return tile;\r\n }", "@Override\n public void drawValidMove() {\n if(this.getPlayer().getPlayerID() % 2 != 0) {\n //Pawn can move one space forwards if no piece is in front\n if (board.getSquare(x-1, y).getPiece()== null) {\n board.getSquare(x-1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x-2, y).getPiece() == null && board.getSquare(x-1, y).getPiece() == null) {\n board.getSquare(x-2, y).drawOutline();\n }\n \n //If there is an enemy piece in the diagonal forward square of the pawn, the pawn can move (capture the piece)\n if (y-1 > 0) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y-1) != null && board.getSquare(x-1, y-1).getPiece() != null &&\n board.getSquare(x-1, y-1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x-1, y-1).drawOutline();\n }\n }\n \n if(y+1<SIZE) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y+1) != null && board.getSquare(x-1, y+1).getPiece() != null &&\n board.getSquare(x-1, y+1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x-1, y+1).drawOutline();\n }\n }\n \n System.out.println(\"\");\n //En passant\n if (y - 1 > 0) {\n \n System.out.println();\n if (board.getSquare(x, y-1).getPiece() != null) { \n System.out.println(\"the piece's enPassant is: \" + board.getSquare(x, y-1).getPiece().getEnPassant());\n System.out.println(\"The game's turn counter is: \" + board.getTurnCounter());\n }\n else {\n System.out.println(\"Null piece when checking for en passent.\");\n }\n \n if (board.getSquare(x, y-1).getPiece() != null && board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y-1).drawOutline();\n board.getSquare(x-1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y+1).drawOutline();\n board.getSquare(x-1, y+1).setEnPassent(true);\n }\n }\n }\n \n //If this pawn belongs to player 2:\n else {\n \n if (board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x+2, y).getPiece() == null && board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+2, y).drawOutline();\n \n }\n \n if(y-1 > 0) {\n if (board.getSquare(x+1, y-1) != null && board.getSquare(x+1, y-1).getPiece() != null &&\n board.getSquare(x+1, y-1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x+1, y-1).drawOutline();\n }\n }\n \n if(y+1 < SIZE) {\n if (board.getSquare(x+1, y+1) != null && board.getSquare(x+1, y+1).getPiece() != null &&\n board.getSquare(x+1, y+1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x+1, y+1).drawOutline();\n }\n }\n \n //En passant\n if (y - 1 > 0) {\n if (board.getSquare(x, y-1).getPiece() != null &&board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y-1).drawOutline();\n board.getSquare(x+1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y+1).drawOutline();\n board.getSquare(x+1, y+1).setEnPassent(true);\n }\n }\n }\n }", "public boolean checkWin()\n {\n boolean won = false;\n\n // Checks for the wining condition, if true end game. Else keep running.\n if((getPerson(PLAYER).getInventory().getItems().contains(winItem) && getPerson(PLAYER).getLocation().getName().equals(STARTROOM))||(moves > MOVELIMIT)){\n won = true;\n\n // Checks if the player won, then print a player winning statement.\n if (moves > MOVELIMIT){\n System.out.println(\"Princess Peach: \"+ getPerson(PLAYER).getName() + \", you have run out of time, Rover has ran away.\");\n }\n else{\n System.out.println(\"Princess Peach:\"+ getPerson(PLAYER).getName() + \", You've found the \" + winItem.getName() + \"!\");\n printEndingStory();\n }\n\n } \n return won;\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}", "protected boolean move(int m, boolean player)\n { int status = game.move(m, player);\n if ( status == TicGame.NOMOVE )\n return false;\n repaint();\n if ( status == TicGame.WIN_X ||\n status == TicGame.WIN_O )\n winner(); \n return true;\n }", "private boolean anyMove (int x,int y, OthelloPiece colour){\n boolean valid = false;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_1,colour)) valid=true;\n return (valid);\n }", "public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}", "public int move(int player, int pos) throws Exception{\n if(player != next || player != pos>>16)\n throw new Exception(\"Wrong stone.\");\n\n int x = pos & 255;\n int y = pos>>8 & 255;\n\n if(board[x][y] == 0){\n board[x][y] = player;\n\n next = next==1?2:1;\n\n stonesNum++;\n setWinFlag(x, y);\n }else{\n throw new Exception(\"Invalid move.\");\n }\n return winFlag;\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 static boolean isWin()\n {\n boolean win = true;\n for(Ship[] k:map)\n {\n for(Ship o:k)\n {\n if(o.getState()==1)\n win=false;\n }\n }\n return win;\n }", "boolean makeMove(Bouger m) {\n\tlong oldBits[] = { pieceBits[LIGHT], pieceBits[DARK] };\n\n\tint from, to;\n\t/*\n\t* test to see if a castle move is legal and move the rook (the king is\n\t* moved with the usual move code later)\n\t*/\n\tif ((m.bits & 2) != 0) {\n\n\tif (inCheck(side))\n\treturn false;\n\tswitch (m.getTo()) {\n\tcase 62:\n\tif (color[F1] != EMPTY || color[G1] != EMPTY\n\t|| attack(F1, xside) || attack(G1, xside))\n\treturn false;\n\tfrom = H1;\n\tto = F1;\n\tbreak;\n\tcase 58:\n\tif (color[B1] != EMPTY || color[C1] != EMPTY\n\t|| color[D1] != EMPTY || attack(C1, xside)\n\t|| attack(D1, xside))\n\treturn false;\n\tfrom = A1;\n\tto = D1;\n\tbreak;\n\tcase 6:\n\tif (color[F8] != EMPTY || color[G8] != EMPTY\n\t|| attack(F8, xside) || attack(G8, xside))\n\treturn false;\n\tfrom = H8;\n\tto = F8;\n\tbreak;\n\tcase 2:\n\tif (color[B8] != EMPTY || color[C8] != EMPTY\n\t|| color[D8] != EMPTY || attack(C8, xside)\n\t|| attack(D8, xside))\n\treturn false;\n\tfrom = A8;\n\tto = D8;\n\tbreak;\n\tdefault: /* shouldn't get here */\n\tfrom = -1;\n\tto = -1;\n\tbreak;\n\t}\n\tcolor[to] = color[from];\n\tpiece[to] = piece[from];\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tpieceBits[side] ^= (1L << from) | (1L << to);\n\t}\n\t/* back up information so we can take the move back later. */\n\n\tHistoryData h = new HistoryData();\n\th.m = m;\n\tto = m.getTo();\n\tfrom = m.getFrom();\n\th.capture = piece[to];\n\th.castle = castle;\n\th.ep = ep;\n\th.fifty = fifty;\n\th.pawnBits = new long[] { pawnBits[LIGHT], pawnBits[DARK] };\n\th.pieceBits = oldBits;\n\thistDat[hply++] = h;\n\n\t/*\n\t* update the castle, en passant, and fifty-move-draw variables\n\t*/\n\tcastle &= castleMask[from] & castleMask[to];\n\tif ((m.bits & 8) != 0) {\n\tif (side == LIGHT)\n\tep = to + 8;\n\telse\n\tep = to - 8;\n\t} else\n\tep = -1;\n\tif ((m.bits & 17) != 0)\n\tfifty = 0;\n\telse\n\t++fifty;\n\n\t/* move the piece */\n\tint thePiece = piece[from];\n\tif (thePiece == KING)\n\tkingSquare[side] = to;\n\tcolor[to] = side;\n\tif ((m.bits & 32) != 0) {\n\tpiece[to] = m.promote;\n\tpieceMat[side] += pieceValue[m.promote];\n\t} else\n\tpiece[to] = thePiece;\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tlong fromBits = 1L << from;\n\tlong toBits = 1L << to;\n\tpieceBits[side] ^= fromBits | toBits;\n\tif ((m.bits & 16) != 0) {\n\tpawnBits[side] ^= fromBits;\n\tif ((m.bits & 32) == 0)\n\tpawnBits[side] |= toBits;\n\t}\n\tint capture = h.capture;\n\tif (capture != EMPTY) {\n\tpieceBits[xside] ^= toBits;\n\tif (capture == PAWN)\n\tpawnBits[xside] ^= toBits;\n\telse\n\tpieceMat[xside] -= pieceValue[capture];\n\t}\n\n\t/* erase the pawn if this is an en passant move */\n\tif ((m.bits & 4) != 0) {\n\tif (side == LIGHT) {\n\tcolor[to + 8] = EMPTY;\n\tpiece[to + 8] = EMPTY;\n\tpieceBits[DARK] ^= (1L << (to + 8));\n\tpawnBits[DARK] ^= (1L << (to + 8));\n\t} else {\n\tcolor[to - 8] = EMPTY;\n\tpiece[to - 8] = EMPTY;\n\tpieceBits[LIGHT] ^= (1L << (to - 8));\n\tpawnBits[LIGHT] ^= (1L << (to - 8));\n\t}\n\t}\n\n\t/*\n\t* switch sides and test for legality (if we can capture the other guy's\n\t* king, it's an illegal position and we need to take the move back)\n\t*/\n\tside ^= 1;\n\txside ^= 1;\n\tif (inCheck(xside)) {\n\ttakeBack();\n\treturn false;\n\t}\n\treturn true;\n\t}", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "public static void checkWinCondition() {\n\t\twin = false;\n\t\tif (curPlayer == 1 && arrContains(2, 4))\n\t\t\twin = true;\n\t\telse if (curPlayer == 2 && arrContains(1, 3))\n\t\t\twin = true;\n\t\tif (curPlayer == 2 && !gameLogic.Logic.arrContains(2, 4))\n\t\t\tP2P.gameLost = true;\n\t\telse if (gameLogic.Logic.curPlayer == 1 && !gameLogic.Logic.arrContains(1, 3))\n\t\t\tP2P.gameLost = true;\n\t\tif (P2P.gameLost == true) {\n\t\t\tif (gameLogic.Logic.curPlayer == 1)\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\t\telse\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\t\t}\n\t\telse\n\t\t\twin = false;\n\t}", "public boolean isWinTurn() {\n for (int col = 0; col < mColsCount; col++) {\n if (isFourConnected(getCurrentPlayer(), 0, 1, 0, col, 0)\n || isFourConnected(getCurrentPlayer(), 1, 1, 0, col, 0)\n || isFourConnected(getCurrentPlayer(), -1, 1, 0, col, 0)) {\n hasWinner = true;\n return true;\n }\n }\n\n for (int row = 0; row < mRowsCount; row++) {\n if (isFourConnected(getCurrentPlayer(), 1, 0, row, 0, 0)\n || isFourConnected(getCurrentPlayer(), 1, 1, row, 0, 0)\n || isFourConnected(getCurrentPlayer(), -1, 1, row, mColsCount - 1, 0)) {\n hasWinner = true;\n return true;\n }\n }\n\n return false;\n }", "@Override\n public int getWinner() {\n /*\n * To please the test as well as the game\n * Temporarily change the turn colour\n */\n int temp;\n if (whoseTurn() == RED) {\n temp = YELLOW;\n } else {\n temp = RED;\n }\n\n //test horizontally\n //set x to 1 as the placed counter will always be correct\n int x = 1;\n int i = 1;\n //to check if zero has been found\n boolean leftZeroFound = false;\n boolean rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check to right of last placed\n if (!rightZeroFound && inBounds(0, i)\n && board[lastPlacedRow][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check to left of last placed\n if (!leftZeroFound && inBounds(0, -i)\n && board[lastPlacedRow][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check vertically\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n boolean zeroFound = false;\n while (!zeroFound) {\n //check below last placed\n if (inBounds(-i, 0) && board[lastPlacedRow - i][lastPlacedCol] == temp) {\n x++;\n } else {\n zeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top right diagonal\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top right diagonal\n if (!rightZeroFound && inBounds(i, i)\n && board[lastPlacedRow + i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check bottom left\n if (!leftZeroFound && inBounds(-i, -i)\n && board[lastPlacedRow - i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top left\n //set x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top left\n if (!leftZeroFound && inBounds(i, -i)\n && board[lastPlacedRow + i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n //check bottom right\n if (!rightZeroFound && inBounds(-i, i)\n && board[lastPlacedRow - i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //return Empty if a winner has not been found\n return EMPTY;\n }", "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 }", "public boolean makeMove(int x, int y, int move) {\r\n\t\tupdateMoves();\r\n\t\tif (move == -1) {\r\n\t\t\t//cheat code - initiates win sequence if -1 is entered.\r\n\t\t\tsetOpenTiles(0);\r\n\t\t\tsetComplete(true);\r\n\t\t\treturn true;\r\n\t\t}if (checkMove(x,y,move)){\r\n\t\t\t//checkMove was true, so we allow the move to be made.\r\n\t\t\tint[][] temp = getGameBoard();\r\n\t\t\tboolean[][] tempX = getXValues();\r\n\t\t\tboolean[][] tempY = getYValues();\r\n\t\t\tif (temp[y][x] == 0) {\r\n\t\t\t\tupdateOpenTiles();\r\n\t\t\t}temp[y][x] = move;\r\n\t\t\ttempX[x][move] = tempY[y][move] = true;\r\n\t\t\tsetXValues(tempX);\r\n\t\t\tsetYValues(tempY);\r\n\t\t\tsetGameBoard(temp);\r\n\t\t\tif (getOpenTiles() == 0) {\r\n\t\t\t\tsetComplete(true);\r\n\t\t\t}return true;\r\n\t\t} else {\r\n\t\t\t//you can't make this move!\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean checkForObviousMove(char[][] a){\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n //AI obvious to win\r\n for (int i = 0; i<rowNumber; i++){\r\n for (int j = 0; j<colNumber; j++){\r\n //check if on diagnol\r\n if (i == j && countDiag1(a, 'o')== (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n if (i+j == rowNumber-1 && countDiag2(a,'o')==(rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a row\r\n if(countRow(a[i], 'o') == (colNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a column\r\n if(countCol(a,j,'o') == (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n }\r\n }\r\n //when user obvious to win\r\n for (int i = 0; i<rowNumber; i++){\r\n for (int j = 0; j<colNumber; j++){\r\n //check if on diagnol\r\n if (i == j && countDiag1(a, 'x')== (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n if (i+j == rowNumber-1 && countDiag2(a,'x')==(rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a row\r\n if(countRow(a[i], 'x') == (colNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a column\r\n if(countCol(a,j,'x') == (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\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 boolean win() {\r\n\t\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 7; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m] == board[n][m] && board[n + 2][m] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 0; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n][m + 1] == board[n][m] && board[n][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 3].setText(\"X\");\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m + 1] == board[n][m] && board[n + 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 3; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n - 1][m + 1] == board[n][m] && board[n - 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n - 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\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 false;\r\n\r\n\t}", "@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }" ]
[ "0.79775596", "0.72469133", "0.7239628", "0.7149286", "0.711776", "0.71165425", "0.7097059", "0.70759284", "0.70126575", "0.6995287", "0.6961267", "0.69512266", "0.6942464", "0.69035333", "0.68973666", "0.6882476", "0.68789977", "0.68756026", "0.68700695", "0.68674326", "0.68472314", "0.683135", "0.68297225", "0.68281406", "0.6799047", "0.6792783", "0.67904943", "0.6786607", "0.6770724", "0.67603314", "0.6749283", "0.67485183", "0.6741364", "0.6728136", "0.6725234", "0.67211086", "0.67189705", "0.6717435", "0.6714522", "0.6713794", "0.6712566", "0.67099667", "0.67003465", "0.669346", "0.66652924", "0.66619074", "0.66593164", "0.665547", "0.66549206", "0.6652536", "0.66484857", "0.6643834", "0.6643771", "0.66324276", "0.66321385", "0.663198", "0.66249514", "0.6620419", "0.66198325", "0.6612921", "0.66090506", "0.65797704", "0.6578332", "0.6569219", "0.6568344", "0.65674853", "0.6557849", "0.65522206", "0.6541833", "0.6540763", "0.6532008", "0.65284234", "0.6522665", "0.6515937", "0.6509804", "0.6507492", "0.65062374", "0.65042984", "0.64879054", "0.6483369", "0.64794636", "0.6475127", "0.64739984", "0.6469255", "0.64636165", "0.64605486", "0.64558077", "0.64536285", "0.645288", "0.6452214", "0.64490366", "0.6448717", "0.6432563", "0.64294755", "0.6428725", "0.6426889", "0.6415219", "0.64120287", "0.64111483", "0.6407728", "0.6403884" ]
0.0
-1
TESTER Basic alpha beta with depth 2 so I can give this to Randomplayer for autoplay tests
public PentagoMove alphabetaw(PentagoBoardState boardState){ PentagoBoardState pbs = (PentagoBoardState) boardState.clone(); ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves(); PentagoMove bestmove = legalmoves.get(0); PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0); int bestmovescore = -9999999; int bestwhitescore = 0; //ArrayList<Integer> scores = new ArrayList<Integer>(); for(int i = 0;i<legalmoves.size()-1;i++){ PentagoBoardState newboard = (PentagoBoardState) pbs.clone(); //System.out.println( pbs.getTurnPlayer() + "BEFORE PROCESS"); PentagoMove next = legalmoves.get(i); newboard.processMove(next); int score = evaluate(newboard); //scores.add(score); //System.out.println( pbs.getTurnPlayer() + " AFTER PROCES"); if(score > 100000){ newboard.getWinner(); newboard.printBoard(); System.out.println("FOUND A WINNER" + score); return next; } PentagoMove currentopponentmove; ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves(); if (opponentlegalmoves.size()!=0){ currentopponentmove = opponentlegalmoves.get(0); } int minopponentmovescore = 999999; int thismovescore = -9999; ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>(); PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0); for(int a = 0;a<opponentlegalmoves.size()-1;a++){ PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone(); //System.out.println( pbs.getTurnPlayer() + "BEFORE PROCESS"); PentagoMove opponentnext = opponentlegalmoves.get(a); pbsopponent.processMove(opponentnext); //System.out.println( pbs.getTurnPlayer() + " AFTER PROCES"); //pbs.printBoard(); int opponentscore = evaluate(pbsopponent); if (minopponentmovescore>opponentscore){ //currentopponentmove = opponentnext; minopponentmovescore = opponentscore; bestopponentmoves.add(opponentnext); currentbestopponentmove = opponentnext; } } bestopponentmove = currentbestopponentmove; //lvl 3 /* int lvl3minscore =99999; PentagoMove currentmaxmove; for (int r = 0;r<bestopponentmoves.size()-1;r++) { PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone(); pbsopponent.processMove(bestopponentmoves.get(r)); ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves(); if (maxlegalmoves.size() != 0) { currentmaxmove = maxlegalmoves.get(0); } int opponentscore = evaluate(pbsopponent); int findminmaxmovescore = -99999; for (int s = 0; s < maxlegalmoves.size() - 1; s++) { PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone(); //System.out.println( pbs.getTurnPlayer() + "BEFORE PROCESS"); PentagoMove maxnext = maxlegalmoves.get(s); maxboard.processMove(maxnext); //System.out.println( pbs.getTurnPlayer() + " AFTER PROCES"); //pbs.printBoard(); int maxnextscore = evaluate(pbsopponent); if (findminmaxmovescore < maxnextscore) { currentmaxmove = maxnext; findminmaxmovescore = maxnextscore; } } if (thismovescore<findminmaxmovescore){ //currentopponentmove = opponentnext; thismovescore = findminmaxmovescore; } //opponentscore = maxmovescore; } //end experiment if (mycolour ==1){ lvl3minscore =minopponentmovescore; } */ if (minopponentmovescore>bestmovescore){//minopponentmovescore System.out.println("max player move score: "+score + "Min : " + minopponentmovescore); bestmovescore = minopponentmovescore; bestmove = next; bestwhitescore = score; } else if (minopponentmovescore == bestmovescore){ if (score > bestwhitescore){ System.out.println("max player move score: "+score + "Min : " + minopponentmovescore); bestmovescore = minopponentmovescore; bestmove = next; bestwhitescore = score; } } } System.out.println("final max player move score: "+ bestmovescore + "\n My best move: "+bestmove.toPrettyString() + "\n My best move: "+ bestopponentmove.toPrettyString()); return bestmove; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = 4000)\n public void test06() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n AspectRatio aspectRatio0 = AspectRatio.RATIO_3_2;\n homeEnvironment0.setPhotoAspectRatio(aspectRatio0);\n homeEnvironment0.setVideoQuality(1012);\n AspectRatio aspectRatio1 = AspectRatio.VIEW_3D_RATIO;\n homeEnvironment0.setPhotoAspectRatio(aspectRatio1);\n LinkedList<Camera> linkedList0 = new LinkedList<Camera>();\n homeEnvironment0.setVideoCameraPath(linkedList0);\n Camera camera0 = new Camera(22.0F, 22.0F, 22.0F, (-299.4F), 47.0F, 22.0F);\n linkedList0.add(camera0);\n homeEnvironment0.getGroundTexture();\n homeEnvironment0.setVideoCameraPath(linkedList0);\n assertEquals(1012, homeEnvironment0.getVideoQuality());\n }", "static void test2() {\n\n System.out.println( \"Begin test2. ===============================\\n\" );\n\n Thread init = Thread.currentThread(); // init spawns the Mogwais\n\n System.out.println( \"TODO: write a more involved test here.\" );\n //\n // Create a GremlinsBridge of capacity 3.\n // Set an OPTIONAL, test delay to stagger the start of each mogwai.\n // Create the Mogwais and store them in an array.\n // Run them by calling their start() method.\n // Now, the test must give the mogwai time to finish their crossings.\n //\n System.out.println( \"TODO: follow the pattern of the example tests.\" );\n System.out.println( \"\\n=============================== End test2.\" );\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n homeEnvironment0.setVideoQuality(1012);\n AspectRatio aspectRatio0 = AspectRatio.VIEW_3D_RATIO;\n homeEnvironment0.setPhotoAspectRatio(aspectRatio0);\n LinkedList<Camera> linkedList0 = new LinkedList<Camera>();\n Camera.Lens camera_Lens0 = Camera.Lens.NORMAL;\n Camera camera0 = new Camera((-1855.3F), 0.0F, (-1855.3F), (-657.0F), 1012, 0.0F, 1012, camera_Lens0);\n linkedList0.offer(camera0);\n homeEnvironment0.setVideoCameraPath(linkedList0);\n homeEnvironment0.getWallsAlpha();\n homeEnvironment0.getDrawingMode();\n TemporaryURLContent temporaryURLContent0 = new TemporaryURLContent((URL) null);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", \"\", temporaryURLContent0, 400.0F, (-657.0F), \"\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n homeEnvironment0.setGroundTexture(homeTexture0);\n homeEnvironment0.getGroundTexture();\n homeEnvironment0.setGroundColor(5909);\n homeEnvironment0.setCeillingLightColor(5909);\n homeEnvironment0.getVideoQuality();\n homeEnvironment0.setPhotoHeight(13427964);\n homeEnvironment0.setLightColor(1012);\n assertEquals(1012, homeEnvironment0.getLightColor());\n }", "@Test(timeout = 4000)\n public void test12() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n homeEnvironment0.getVideoAspectRatio();\n homeEnvironment0.setWallsAlpha(3308.328F);\n homeEnvironment0.setVideoQuality(11053224);\n homeEnvironment0.setObserverCameraElevationAdjusted(true);\n homeEnvironment0.getDrawingMode();\n assertEquals(3308.328F, homeEnvironment0.getWallsAlpha(), 0.01F);\n }", "@Test\n public void botPlay() {\n Bot.randomBot(0);\n }", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n HomeEnvironment homeEnvironment1 = homeEnvironment0.clone();\n AspectRatio aspectRatio0 = AspectRatio.SQUARE_RATIO;\n homeEnvironment1.setPhotoAspectRatio(aspectRatio0);\n LinkedList<Camera> linkedList0 = new LinkedList<Camera>();\n Camera camera0 = new Camera((-675.9714F), (-675.9714F), (-675.9714F), (-5577.0F), (-675.9714F), (-2333.61F));\n Camera.convertTimeToTimeZone(1L, \"GROUND_COLOR\");\n camera0.setTime(0L);\n linkedList0.add(camera0);\n homeEnvironment0.setVideoWidth(0);\n linkedList0.clear();\n homeEnvironment0.setVideoQuality(0);\n homeEnvironment0.setVideoCameraPath(linkedList0);\n homeEnvironment1.getWallsAlpha();\n homeEnvironment1.getSubpartSizeUnderLight();\n homeEnvironment1.setGroundTexture((HomeTexture) null);\n homeEnvironment1.isAllLevelsVisible();\n assertEquals(AspectRatio.SQUARE_RATIO, homeEnvironment1.getPhotoAspectRatio());\n }", "public static play() {\n\t\t\n\t}", "@Test\n void grab() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n Square s = new Square(0, 4, false, true, false, true, false, 'b');\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(s);\n p.getPh().getPowerupDeck().getPowerups().clear();\n p.setTurn(true);\n AmmoTile a = new AmmoTile();\n PowerupDeck pud = new PowerupDeck();\n int[] cubes = new int[3];\n cubes[0] = 2;\n cubes[2] = 1;\n char[] c1 = {'b', 'b', 'b'};\n char[] c2 = {'r', 'r', 'r'};\n char[] c3 = {'y', 'y', 'y'};\n p.getPb().payAmmo(c1);\n p.getPb().payAmmo(c2);\n p.getPb().payAmmo(c3);\n a.setCubes(cubes);\n a.setPowerup(false);\n s.setAmmo(a);\n try{\n p.grab(p.getPlayerPosition(), pud);\n }catch (WrongSquareException e){}\n }", "@Test\r\n public void ss(){\r\n playGame.play();\r\n }", "public Tournament(){\n simplePlayer = new SimpleFakeGinRummyPlayer(new ParamList(new double[]{}));\n\n knockOnGinPlayer = new EnsembleHandEvalPlayer(ParamList.getRandomParamList(1), new DeadwoodHandEvaluator());\n knockOnGinPlayer.setKnockDecider(new KnockOnGinKnockDecider() );\n knockOnGinPlayer.setDrawDecider(new MeldOnlyDrawDecider());\n\n ExperimentalRuns.fixTwoStageKnockDecider101();\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_EARLY, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_LATE, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_MIDDLE, 6);\n ParamList.setFixedValue(ParamList.TS_DRAW_MIDDLE, 14);\n ParamList paramOfTunedTwoStagePlayer = ParamList.getRandomParamList(1);\n System.out.println(paramOfTunedTwoStagePlayer);\n tunedTwoStagePlayer = new IndexEnsembleHandEvalPlayer(paramOfTunedTwoStagePlayer, new DeadwoodHandEvaluator());\n tunedTwoStagePlayer.setKnockDecider(new TwoStageKnockDecider(paramOfTunedTwoStagePlayer) );\n tunedTwoStagePlayer.setDrawDecider(new MeldOnlyDrawDecider());\n tunedTwoStagePlayer.setDrawDecider(new TwoStageDrawDecider(paramOfTunedTwoStagePlayer));\n\n resultSimpleVsKnockGin = 0;\n resultKnockGinVsTwoStage = 0;\n resultTwoStageVsSimple = 0;\n\n numGamePerPair = 2000;\n\n }", "public static void main(String[] args) {\n inOrbitDestinationControllerTest();\n// inOrbitReplayControllerTest();\n\n }", "public void preGame() {\n\n\t}", "public static void playZWalk()\n {\n playZWalk(0);\n }", "@Test \n public void testDetectPlayer(){\n assertTrue(controller.detect());\n }", "public void initPlayer();", "@Test\n public void partyTour() throws FileNotFoundException, URISyntaxException,\n DisconnectedException {\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this) {\n @Override\n protected boolean isPlayerOffline(Player player) {\n return false;\n }\n\n @Override\n protected void notify(Player nextPlayer) {\n }\n\n };\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n };\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n party.addToParty(UUID.randomUUID(), \"player3\");\n party.addToParty(UUID.randomUUID(), \"player4\");\n party.addToParty(UUID.randomUUID(), \"player5\");\n party.addToParty(UUID.randomUUID(), \"player6\");\n party.addToParty(UUID.randomUUID(), \"player7\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n Player player3 = players.get(2);\n Player player4 = players.get(3);\n Player player5 = players.get(4);\n Player player6 = players.get(5);\n Player player7 = players.get(6);\n player1.setIdentity(alien);\n player2.setIdentity(alien);\n player3.setIdentity(alien);\n player4.setIdentity(alien);\n player5.setIdentity(human);\n player6.setIdentity(human);\n player7.setIdentity(human);\n matchController.initMatch(partyController);\n\n // turno di partenza\n Player startPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 7) {\n startPlayer = nextPlayer;\n }\n }\n Turn turn = new Turn(startPlayer, matchController.getMatch()\n .getTurnCount());\n matchController.getTurnController().setTurn(turn);\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(startPlayer));\n int num = matchController.getMatch().getTurnCount();\n\n // cerco il player successivo\n Player endPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 1) {\n endPlayer = nextPlayer;\n }\n }\n\n // eseguo\n matchController.getTurnController().nextTurn();\n\n // verifico\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(endPlayer));\n assertTrue(matchController.getMatch().getTurnCount() == num + 1);\n }", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", (Content) null, (-5305), (-283.024F));\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(329, homeTexture0, 329, homeTexture0, 76, 329);\n homeEnvironment0.getVideoCameraPath();\n assertEquals(240, homeEnvironment0.getVideoHeight());\n assertEquals(329.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(76, homeEnvironment0.getLightColor());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(329, homeEnvironment0.getSkyColor());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(329, homeEnvironment0.getGroundColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n }", "@Test\n void play_BranchTwo()\n {\n dealer = 22;\n player = 21;\n result = BlackjackSimple.play(dealer, player);\n\n assertEquals(player, result);\n }", "@Test(timeout = 4000)\n public void test000() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(2361, (HomeTexture) null, 2361, (HomeTexture) null, 2361, 2361);\n homeEnvironment0.setVideoFrameRate(2361);\n assertEquals(2361, homeEnvironment0.getVideoFrameRate());\n }", "@Test\n public void run() throws InterruptedException {\n/* Player player = new Player(3);\n player.start();\n logger.debug(\"Called player.start\");\n Thread.sleep(2000);\n player.skip();\n logger.debug(\"Called player.skip\");\n Thread.sleep(2000);\n player.skip();\n logger.debug(\"Called player.skip\");\n Thread.sleep(2000);\n player.previous();\n logger.debug(\"Called player.previous\");\n Thread.sleep(2000);\n player.stop();\n logger.debug(\"Called player.stop\"); */\n }", "@Test\n public void videoidTest() {\n // TODO: test videoid\n }", "private void initPlayMode() {\n initPlayModeView();\n initPlayModeController();\n }", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tplay();\r\n\t\t\r\n\t}", "@Test\n void play_BranchOne()\n {\n dealer = 22;\n player = 22;\n result = BlackjackSimple.play(dealer, player);\n\n assertEquals(0, result);\n }", "@Test\n public void play() {\n System.out.println(client.botBegin());\n }", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n URL uRL0 = MockURL.getFtpExample();\n ResourceURLContent resourceURLContent0 = new ResourceURLContent(uRL0, false);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", \"\", resourceURLContent0, (-1.0F), (-685), \"\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-685), homeTexture0, (-2209), homeTexture0, (-685), (-685));\n homeEnvironment0.getGroundTexture();\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals((-685), homeEnvironment0.getGroundColor());\n assertEquals((-2209), homeEnvironment0.getSkyColor());\n assertEquals((-685), homeEnvironment0.getLightColor());\n assertEquals((-685.0F), homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(240, homeEnvironment0.getVideoHeight());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n }", "public void setup()\n {\t\nint i;\n// Clear screen and depth buffer\n\n\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n Player player0 = new Player();\n player0.setZ(0.0F);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n player0.gangStrength();\n player0.getX();\n player0.setMoney((-291.8F));\n System.setCurrentTimeMillis(3085L);\n }", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n HomeEnvironment homeEnvironment1 = homeEnvironment0.clone();\n homeEnvironment0.setSubpartSizeUnderLight(0.0F);\n AspectRatio aspectRatio0 = AspectRatio.SQUARE_RATIO;\n homeEnvironment1.setVideoQuality(9);\n homeEnvironment1.setVideoAspectRatio(aspectRatio0);\n homeEnvironment0.setGroundColor((-1071));\n homeEnvironment0.setObserverCameraElevationAdjusted(false);\n homeEnvironment0.setLightColor((-1071));\n homeEnvironment0.getWallsAlpha();\n homeEnvironment1.getSkyTexture();\n homeEnvironment1.setLightColor((-646));\n homeEnvironment1.getGroundTexture();\n homeEnvironment0.isObserverCameraElevationAdjusted();\n homeEnvironment0.setLightColor((-1071));\n homeEnvironment0.setWallsAlpha(0.0F);\n homeEnvironment0.setVideoQuality((-1071));\n homeEnvironment0.getDrawingMode();\n homeEnvironment0.setSubpartSizeUnderLight((-1071));\n homeEnvironment0.setSkyColor((-1071));\n assertEquals((-1071), homeEnvironment0.getSkyColor());\n }", "@Override\r\n public int playGameLoop() {\r\n return 0;\r\n }", "public void play(){\n\t\t\n\t}", "@Override\n\tpublic void play() {\n\t\t\n\t}", "public static void main(String[] args) throws IOException, InterruptedException {\r\n\t\r\n TournamentTest();\r\n //humanPlayersTest();\r\n }", "public static void main(String[] args) \r\n {\n new improvedPlayerOne();\r\n }", "@Test\n void play_BranchThree()\n {\n dealer = 21;\n player = 22;\n result = BlackjackSimple.play(dealer, player);\n\n assertEquals(dealer, result);\n }", "@Test\n @MediumTest\n @Feature({\"RenderTest\"})\n public void multiFrameDisplayTest() throws Exception {\n displayTest(true);\n mRenderTestRule.render(mPlayerManager.getView(), \"multi_frame\");\n }", "@Test\n void test() {\n Game g = init(\"gen_2p_02\");\n List<Player> players = g.getData().getPlayers();\n wrappedIllegalCommand(g, players.get(0), \"tool 6\");\n wrappedLegalCommand(g, players.get(0), \"pick 1\");\n assertTrue(g.isUndoAvailable());\n wrappedLegalCommand(g, players.get(0), \"tool 6\");\n assertFalse(g.isUndoAvailable());\n lightestShade(g, players);\n notLightestShade(g, players);\n }", "void initializePlayer();", "@Test\n void testNextPlayerWhenPlayerHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getUser().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotA().getId(), testDealer.getNextPlayer());\n }", "void makePlay(int player) {\n }", "@Test\n\tpublic void setFrameTest2() throws Exception {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\t\t\tstart();\n\t\t\tgui.setFrame();\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tint[][] grid = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 1, 0, 1, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 1, 0, 1, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \n\t { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } \n\t };\n\t\tplay(grid);\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", (Content) null, (-5305), (-283.024F));\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(329, homeTexture0, 329, homeTexture0, 76, 329);\n homeEnvironment0.setVideoQuality(76);\n int int0 = homeEnvironment0.getVideoQuality();\n assertEquals(76, int0);\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n homeEnvironment0.setGroundTexture((HomeTexture) null);\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(13427964, homeEnvironment0.getSkyColor());\n assertEquals(11053224, homeEnvironment0.getGroundColor());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(13684944, homeEnvironment0.getLightColor());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals(0.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n }", "@Test\n void testUserIsNextPlayerWhenBotCHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotC().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getUser().getId(), testDealer.getNextPlayer());\n }", "public void play() {\n\t\t\r\n\t}", "@Test\n public void alienAttacksMultipleTargets() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n party.addToParty(UUID.randomUUID(), \"player3\");\n party.addToParty(UUID.randomUUID(), \"player4\");\n party.addToParty(UUID.randomUUID(), \"player5\");\n party.addToParty(UUID.randomUUID(), \"player6\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n Player player3 = players.get(2);\n Player player4 = players.get(3);\n Player player5 = players.get(4);\n Player player6 = players.get(5);\n player1.setIdentity(alien);// attaccante\n player2.setIdentity(alien);// alieno in loco\n player3.setIdentity(alien);// alieno difeso\n player4.setIdentity(human);// umano indifeso\n player5.setIdentity(human);// umano altrove\n player6.setIdentity(human);// umano difeso\n ItemCard defenseCard1 = new ItemCard(Item.DEFENSE);\n ItemCard defenseCard2 = new ItemCard(Item.DEFENSE);\n ItemCard spotlightCard = new ItemCard(Item.SPOTLIGHT);\n ItemCard card2 = new ItemCard(Item.SEDATIVES);\n ItemCard card3 = new ItemCard(Item.ATTACK);\n player3.getItemsDeck().getCards().add(defenseCard1);\n player4.getItemsDeck().getCards().add(spotlightCard);\n player4.getItemsDeck().getCards().add(card2);\n player4.getItemsDeck().getCards().add(card3);\n player6.getItemsDeck().getCards().add(defenseCard2);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n HexPoint point2 = HexPoint.fromOffset(2, 3);\n Sector sec2 = new Sector(null, point2);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player3, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player4, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player5, sec2);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player6, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 1);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player3) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player4) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player5).equals(sec2));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player6).equals(sec));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player1));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player3));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player4));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player5));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player6));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 3);\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard1));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard2));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(spotlightCard));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(card2));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(card3));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket().size() == 5);\n assertFalse(player3.getItemsDeck().getCards().contains(defenseCard1));\n assertFalse(player4.getItemsDeck().getCards().contains(spotlightCard));\n assertFalse(player4.getItemsDeck().getCards().contains(card2));\n assertFalse(player4.getItemsDeck().getCards().contains(card3));\n assertFalse(player6.getItemsDeck().getCards().contains(defenseCard2));\n }", "boolean InitialisePlayer (String path_name);", "@Test\n public void startPlayTest2() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n int players = 4;\n int current = 0;\n g.startPlay(players, deck);\n for (Card c : deck) {\n assertTrue(g.getPlayers().get(current).contains(c));\n current++;\n if (current == players) {\n current = 0;\n }\n }\n }", "@Test\n public void startPlayTest1() {\n GenericStandardDeckGame g = new GenericStandardDeckGame(3);\n assertEquals(g.getPlayers().size(), 3);\n }", "@Override\n public void setup() {\n\n context = new SimpleOpenNI(this, SimpleOpenNI.RUN_MODE_MULTI_THREADED);\n\n // enable depthMap generation \n context.enableScene();\n context.enableDepth();\n context.enableRGB();\n context.enableUser(1);\n\n\n background(200, 0, 0);\n\n stroke(0, 0, 255);\n strokeWeight(3);\n smooth();\n\n size(context.sceneWidth(), context.sceneHeight());\n\n for (int i = 0; i < 1000; i++) {\n PVector novoFloco = new PVector((float) (context.sceneWidth() * Math.random()), (float) (-100 * Math.random() - 100 * Math.random()));\n flocos.add(i, novoFloco);\n }\n \n \n\n // select the recording channels\n //context.addNodeToRecording(SimpleOpenNI.NODE_DEPTH,\n // SimpleOpenNI.CODEC_16Z_EMB_TABLES);\n //context.addNodeToRecording(SimpleOpenNI.NODE_IMAGE,\n // SimpleOpenNI.CODEC_JPEG);\n }", "boolean play();", "@Override\n\tpublic void play() {\n\n\t}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n URL uRL0 = MockURL.getHttpExample();\n ResourceURLContent resourceURLContent0 = new ResourceURLContent(uRL0, false);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"1Zucc:+\", \"1Zucc:+\", resourceURLContent0, 0, (-1114.1877F), \"1Zucc:+\", false);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 0, 0, 0);\n homeEnvironment0.getVideoWidth();\n homeEnvironment0.getCeillingLightColor();\n HomeEnvironment homeEnvironment1 = homeEnvironment0.clone();\n AspectRatio aspectRatio0 = AspectRatio.FREE_RATIO;\n homeEnvironment1.setPhotoAspectRatio(aspectRatio0);\n homeEnvironment0.getVideoWidth();\n homeEnvironment0.setPhotoAspectRatio(aspectRatio0);\n homeEnvironment0.getGroundColor();\n homeEnvironment1.setVideoFrameRate(0);\n int int0 = homeEnvironment0.getPhotoHeight();\n assertEquals(AspectRatio.FREE_RATIO, homeEnvironment0.getPhotoAspectRatio());\n assertEquals(300, int0);\n }", "@Test\n void initPosition() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.initPlayer();\n\n assertTrue(p.getPh().getPowerupDeck().getSize() == 2);\n\n Powerup pu = p.getPh().getPowerupDeck().getPowerups().get(0);\n p.initPosition(p.getPh().getPowerupDeck().getPowerups().get(0).getName(), p.getPh().getPowerupDeck().getPowerups().get(0).getColor() );\n\n assertTrue(p.getPh().getPowerupDeck().getSize() == 1 && Board.getSpawnpoint(p.getPlayerPosition().getNum()).getColor() == pu.getColor());\n }", "public TestPlayer()\n {\n }", "@Override\n public void runOpMode() {\n commands.init(hardwareMap);\n\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n\n // run until the end of the match (driver presses STOP)\n while (opModeIsActive()) {\n sleep(30000);\n }\n }", "private void getGameState(String version){\n\n }", "static void runTest() {\n dw = DiagnosticsWrapper.getInstance();\n dw.setDebugOutput( true );\n\n // How many ticks? Each one is a week.\n int simulationDurationTicks = (int) Math.floor(Constants.WEEKS_IN_YEAR * 20);\n // print debug-info on all parameters moving between models\n boolean printFrameData = false;\n GameThread one = new GameThread(simulationDurationTicks, printFrameData);\n GameManager gm = one.game;\n \n dw.addGameThread(one); // for debugging purposes\n\n // globalit\n gm.createModel(\"Weather\");\n\n SettingMaster sm;\n \n // kaupungit\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"vehicles\").setValue(\"1000\");\n sm.settings.get(\"initialFood\").setValue(\"1000000\");\n Model town1 = gm.createModel(\"PopCenter\");\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"births%\").setValue(\"0.047492154\");\n Model town2 = gm.createModel(\"PopCenter\");\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"births%\").setValue(\"0.047492154\");\n Model road1 = gm.createModel(\"Road\");\n ((RoadModel)road1).setLengthToDistance(sm);\n sm = one.game.getDefaultSM(\"Field\");\n sm.settings.get(\"content\").setValue(\"maize\");\n sm.settings.get(\"area\").setValue(\"1000000\");\n\n // ruoka x kaupungit\n gm.linkModelsWith(gm.createModel(\"Field\",sm), town1, gm.createModel(\"GenericConnection\"));\n gm.linkModelsWith(town1, town2, road1);\n\n // water\n Model l1 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"1\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l1.onActualUpdateSettings(sm);\n \n Model l2 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"1\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l2.onActualUpdateSettings(sm);\n \n Model r1 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"2\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r1.onActualUpdateSettings(sm);\n \n Model r2 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"2\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r2.onActualUpdateSettings(sm);\n \n Model l3 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"3\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l3.onActualUpdateSettings(sm);\n \n Model r3 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"4\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r3.onActualUpdateSettings(sm);\n \n Model s1 = gm.createModel(\"Sea\");\n sm = gm.getDefaultSM(\"Sea\");\n sm.settings.get(\"order\").setValue(\"5\");\n s1.onActualUpdateSettings(sm);\n \n gm.linkModelsWith(l1, l3, r1);\n gm.linkModelsWith(l2, l3, r2);\n gm.linkModelsWith(l3, s1, r3);\n\n if (!profilingRun) {\n gm.printOnDone = 2;\n }\n\n // Start the gamethread\n one.start();\n \n //Save population to a csv file\n CSVDumper csv = new CSVDumper(\"none\", \"population\");\n csv.add(town1, \"totalPopulation\"); //local\n\n csv.save(gm, true);\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"0dj!E;iRV]\", (Content) null, 0, 0, \"0dj!E;iRV]\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 1624, 0, 1624);\n homeEnvironment0.getWallsAlpha();\n homeEnvironment0.getVideoFrameRate();\n homeEnvironment0.setVideoFrameRate(25);\n homeEnvironment0.setPhotoHeight(1624);\n AspectRatio aspectRatio0 = homeEnvironment0.getPhotoAspectRatio();\n homeEnvironment0.setSubpartSizeUnderLight(0.0F);\n homeEnvironment0.getVideoAspectRatio();\n homeEnvironment0.setWallsAlpha(0.0F);\n HomeEnvironment.Property homeEnvironment_Property0 = HomeEnvironment.Property.LIGHT_COLOR;\n catalogTexture0.getCategory();\n catalogTexture0.setCategory((TexturesCategory) null);\n homeEnvironment0.addPropertyChangeListener(homeEnvironment_Property0, (PropertyChangeListener) null);\n homeEnvironment0.getVideoAspectRatio();\n homeEnvironment0.getLightColor();\n // Undeclared exception!\n try { \n homeEnvironment0.setVideoAspectRatio(aspectRatio0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Unsupported aspect ratio VIEW_3D_RATIO\n //\n verifyException(\"com.eteks.sweethome3d.model.HomeEnvironment\", e);\n }\n }", "@Test\n @MediumTest\n @Feature({\"RenderTest\"})\n public void singleFrameDisplayTest() throws Exception {\n displayTest(false);\n mRenderTestRule.render(mPlayerManager.getView(), \"single_frame\");\n }", "public static void mainDemo(String[] args){\r\n\t\t\t\r\n\t\tDisplayManager.createDisplay();\r\n\t\tAudioMaster.init();\r\n\t\tLoader loader = new Loader();\r\n\t\t\r\n\t\tTextMaster.init(loader);\r\n\t\tFontType font = new FontType(loader.loadTextureWithBias(MyPaths.makeTexturePath(\"font/candara\"), 0.0f),\r\n\t\t\t\tnew File(MyPaths.makeFontPath(\"candara\")));\r\n\t\t\r\n\t\tPage homepage = new Page();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tLoadPage.load(homepage, loader, \"/html/homepage.html\");\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t/* Finished with test fonts */\r\n\t\t\r\n\t\t/* Load fbos */\r\n\t\t\r\n\t\tMinimapFrameBuffer fbos = new MinimapFrameBuffer();\r\n\r\n\t\tLevel level = new Level(loader);\r\n\r\n\t\ttry {\r\n\t\t\tLoadMap.load(\"default-map\", level);\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t/* Load test minimap */\r\n\r\n\t\tGuiTexture minimap = new GuiTexture(fbos.getReflectionTexture(),\r\n\t\t\t\tnew Vector2f(0.83f, 0.78f), new Vector2f(0.14f, 0.18f));\r\n\t\tlevel.getGuis().add(minimap);\r\n\t\t\r\n\t\tFbo main_fbo = new Fbo(Display.getWidth(), Display.getHeight(), Fbo.DEPTH_RENDER_BUFFER);\r\n\t\tPostProcessing.init(loader);\r\n\t\t\r\n\t\t/* Gameloop below */\r\n\t\t\r\n\t\tboolean gameloop = false;\r\n\t\tPage currentPage = homepage;\r\n\t\t\r\n\t\twhile(!Display.isCloseRequested()){\r\n\t\t\t\r\n\t\t\tif(!gameloop){\r\n\t\t\t\trender(level.getmRenderer(), currentPage);\r\n\t\t\t\tcurrentPage = currentPage.update(loader);\r\n\t\t\t\tgameloop = currentPage == null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfloat dt = DisplayManager.getDelta();\r\n\t\t\t\tmandatoryUpdates(level, dt);\r\n\t\t\t\ttestColorFunction(level.getPicker(), font);\r\n\t\t\t\tinteractWithGuis(level);\r\n\t\t\t\trender(level, fbos, main_fbo, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tPostProcessing.cleanUp();\r\n\t\tmain_fbo.cleanUp();\r\n\t\tTextMaster.cleanUp();\r\n\t\tlevel.getmRenderer().cleanUp();\r\n\t\tloader.cleanUP();\r\n\t\tDisplayManager.closeDisplay();\r\n\t\tAudioMaster.cleanUp();\r\n\t}", "@Test\n public void alienAttacksDefendedHuman() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n player1.setIdentity(alien);\n player2.setIdentity(human);\n ItemCard defenseCard = new ItemCard(Item.DEFENSE);\n player2.getItemsDeck().getCards().add(defenseCard);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 0);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2).equals(sec));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 0);\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket().size() == 1);\n assertFalse(player2.getItemsDeck().getCards().contains(defenseCard));\n\n }", "@Test\r\n\tpublic void test()\r\n\t{\n\t\t\r\n\t\tCreatePlungeStrategy frame = new CreatePlungeStrategy(path1, retractPlane); //manda os parametros path e retractplane pra execucao\r\n\r\n\t\tfor(;;);\r\n\t}", "public void prepareTheGame(){\n Thread t=new Thread( () -> {\n System.out.println(\"Preparing the game of lobby number \" + lobbyID);\n Collections.shuffle(nicknames);\n\n Controller controller = new Controller(nicknames, view);\n\n view.setController(controller);\n view.setClientConnectionToController();\n\n controller.play();\n }\n );\n\n t.start();\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n URL uRL0 = MockURL.getHttpExample();\n URLContent uRLContent0 = new URLContent(uRL0);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"+Z)]_\", \"+Z)]_\", uRLContent0, 3273, 828.053F, \"com.eteks.sweethome3d.model.TexturesCategory\", true);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(3273, homeTexture0, (-3467), homeTexture0, (-3467), 1.0F);\n int int0 = homeEnvironment0.getPhotoWidth();\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(400, int0);\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(3273, homeEnvironment0.getGroundColor());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals(1.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals((-3467), homeEnvironment0.getSkyColor());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals((-3467), homeEnvironment0.getLightColor());\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n URL uRL0 = MockURL.getFtpExample();\n ResourceURLContent resourceURLContent0 = new ResourceURLContent(uRL0, true);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"6=];vR`]y%YV(7Ma`Lv\", \"DRAWING_MODE\", resourceURLContent0, 1.3333334F, 0.0F, \">HYd+446`M2q`z*\", true);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-2291), homeTexture0, (-1240), homeTexture0, (-2291), 5);\n homeEnvironment0.getSkyTexture();\n assertEquals((-1240), homeEnvironment0.getSkyColor());\n assertEquals((-2291), homeEnvironment0.getGroundColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(5.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals((-2291), homeEnvironment0.getLightColor());\n }", "void play();", "@Test\n\tpublic void test() {\n\t\t// CHECKSTYPE:OFF\n\n\t\t// Test the addPlayer(Player player) method\n\t\tPlayer player1 = new Player(\"Iris\");\n\t\tPlayer player2 = new Player(\"Emily\");\n\t\tPlayer player3 = new Player(\"Jason\");\n\t\tPlayer player4 = new Player(\"Rain\");\n\t\tPlayer player5 = new Player(\"Mandy\");\n\t\tscrabbleSystem.addPlayer(player1);\n\t\tscrabbleSystem.addPlayer(player2);\n\t\tscrabbleSystem.addPlayer(player3);\n\t\tscrabbleSystem.addPlayer(player4);\n\t\tscrabbleSystem.addPlayer(player5);\n\t\tList<Player> playersList = scrabbleSystem.getPlayers();\n\t\tassertEquals(4, playersList.size());\n\n\t\t// Test the startNewGame() method\n\t\t/**\n\t\t * The first Turn -- place some tiles on the board\n\t\t */\n\t\tscrabbleSystem.startNewGame();\n\t\tPlayer currentPlayer1 = scrabbleSystem.getCurrentPlayer();\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tList<SpecialTile> specialStore = scrabbleSystem.getSpecialStore();\n\t\tassertEquals(5, specialStore.size());\n\t\tassertEquals(\"Boom\", specialStore.get(0).getName());\n\t\tassertEquals(\"NegativePoint\", specialStore.get(1).getName());\n\t\tassertEquals(\"RetrieveOrder\", specialStore.get(2).getName());\n\t\tassertEquals(\"ReverseOrder\", specialStore.get(3).getName());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\t// Test the playMove(Move move) method\n\t\tSquare square1 = scrabbleSystem.getBoard().getSquare(7, 7);\n\t\tSquare square2 = scrabbleSystem.getBoard().getSquare(8, 7);\n\t\tSquare square3 = scrabbleSystem.getBoard().getSquare(9, 7);\n\n\t\tTile tile1 = currentPlayer1.getTileList().get(0);\n\t\tTile tile2 = currentPlayer1.getTileList().get(1);\n\t\tTile tile3 = currentPlayer1.getTileList().get(2);\n\n\t\tint scoreSum1 = tile1.getValue() + tile2.getValue() + tile3.getValue();\n\t\t// The first Player\n\t\tMove move = scrabbleSystem.getMove();\n\t\tmove.addTile(square2, tile2);\n\t\tmove.addTile(square3, tile3);\n\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tmove.addTile(square1, tile1);\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(7, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(8, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(9, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.getBoard().getSquare(10, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.isGameOver());\n\t\t// check player's score\n\t\tassertEquals(scoreSum1, currentPlayer1.getScore());\n\n\t\tPlayer challengePlayer1 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer1 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is no player invoke a challenge\n\t\tscrabbleSystem.updateOrder();\n\n\t\t/**\n\t\t * The secord turn -- place some tiles on the board and challenges by\n\t\t * another player\n\t\t */\n\t\tPlayer currentPlayer2 = scrabbleSystem.getCurrentPlayer();\n\t\tassertNotEquals(currentPlayer1, currentPlayer2);\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tSystem.out.println(currentPlayer2.getName());\n\n\t\tSquare square4 = scrabbleSystem.getBoard().getSquare(8, 6);\n\t\tSquare square5 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square6 = scrabbleSystem.getBoard().getSquare(8, 9);\n\t\tSquare square7 = scrabbleSystem.getBoard().getSquare(7, 8);\n\n\t\tTile tile4 = currentPlayer2.getTileList().get(0);\n\t\tTile tile5 = currentPlayer2.getTileList().get(1);\n\t\tTile tile6 = currentPlayer2.getTileList().get(2);\n\n\t\tMove move2 = scrabbleSystem.getMove();\n\t\tassertEquals(0, move2.getTileMap().size());\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square7, tile6);\n\t\t// check invalid move\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// check invalid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// make valid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\tint scoreSum2 = tile2.getValue() + tile4.getValue() * 2 + tile5.getValue() * 2 + tile6.getValue();\n\t\tassertEquals(scoreSum2, currentPlayer2.getScore());\n\n\t\t// get the challenge player\n\t\tPlayer challengePlayer2 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer2 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tassertEquals(64, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tscrabbleSystem.challenge(challengePlayer2);\n\t\tscrabbleSystem.updateOrder();\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertFalse(square4.isOccuppied());\n\t\tassertFalse(square5.isOccuppied());\n\t\tassertFalse(square6.isOccuppied());\n\n\t\t/**\n\t\t * The third turn -- buy a Boom special tile and pass this turn\n\t\t */\n\n\t\tPlayer currentPlayer3 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move3 = scrabbleSystem.getMove();\n\t\tcurrentPlayer3.addScore(100);\n\t\tscrabbleSystem.buySpecialTile(\"Boom\");\n\t\tassertEquals(80, currentPlayer3.getScore());\n\n\t\tSquare square8 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square9 = scrabbleSystem.getBoard().getSquare(9, 8);\n\t\tSquare square10 = scrabbleSystem.getBoard().getSquare(10, 8);\n\t\tSquare square11 = scrabbleSystem.getBoard().getSquare(10, 7);\n\n\t\tTile tile8 = currentPlayer3.getTileList().get(0);\n\t\tTile tile9 = currentPlayer3.getTileList().get(1);\n\t\tTile tile10 = currentPlayer3.getTileList().get(2);\n\t\tSpecialTile specialTile = currentPlayer3.getSpecialTiles().get(\"Boom\").get(0);\n\t\tmove3.addTile(square8, tile8);\n\t\tmove3.addTile(square9, tile9);\n\t\tmove3.addTile(square10, tile10);\n\t\tmove3.addSpecialTile(specialTile, square11);\n\n\t\tint scoreSum3 = 2 * tile8.getValue() + tile9.getValue() + tile10.getValue() + 2 * tile8.getValue()\n\t\t\t\t+ tile2.getValue() + tile3.getValue() + tile9.getValue() + 80;\n\t\tscrabbleSystem.playMove(move3);\n\t\tassertEquals(scoreSum3, currentPlayer3.getScore());\n\t\tscrabbleSystem.challenge(currentPlayer2);\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertTrue(square11.hasSpecialTile());\n\n\t\t/**\n\t\t * The fourth turn -- buy a NegativePoint special tile and place it on\n\t\t * the board\n\t\t */\n\t\tPlayer currentPlayer4 = scrabbleSystem.getCurrentPlayer();\n\t\tcurrentPlayer4.addScore(10);\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\tcurrentPlayer4.addScore(50);\n\t\tSystem.out.println(currentPlayer4.getScore());\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tint scoreSum4 = currentPlayer4.getScore();\n\n\t\tMove move4 = scrabbleSystem.getMove();\n\t\tSpecialTile specialTile2 = currentPlayer4.getSpecialTiles().get(\"NegativePoint\").get(0);\n\n\t\tSquare square12 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tmove4.addSpecialTile(specialTile2, square12);\n\n\t\tscrabbleSystem.pass(move4);\n\t\tassertEquals(scoreSum4, currentPlayer4.getScore());\n\t\tassertTrue(square12.hasSpecialTile());\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\t/**\n\t\t * The fifth turn -- invork the Boom and NegativePoint special tiles at\n\t\t * the same time\n\t\t */\n\t\tPlayer currentPlayer5 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move5 = scrabbleSystem.getMove();\n\t\tSquare square13 = scrabbleSystem.getBoard().getSquare(10, 7);\n\t\tSquare square14 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tSquare square15 = scrabbleSystem.getBoard().getSquare(12, 7);\n\t\tSquare square16 = scrabbleSystem.getBoard().getSquare(13, 7);\n\t\tSquare square17 = scrabbleSystem.getBoard().getSquare(14, 7);\n\n\t\tTile tile13 = currentPlayer5.getTileList().get(0);\n\t\tTile tile14 = currentPlayer5.getTileList().get(1);\n\t\tTile tile15 = currentPlayer5.getTileList().get(2);\n\t\tTile tile16 = currentPlayer5.getTileList().get(3);\n\t\tTile tile17 = currentPlayer5.getTileList().get(4);\n\n\t\tmove5.addTile(square13, tile13);\n\t\tmove5.addTile(square14, tile14);\n\t\tmove5.addTile(square15, tile15);\n\t\tmove5.addTile(square16, tile16);\n\t\tmove5.addTile(square17, tile17);\n\t\tscrabbleSystem.playMove(move5);\n\t\tassertFalse(square13.isOccuppied());\n\t\tassertFalse(square14.isOccuppied());\n\t\tassertFalse(square15.isOccuppied());\n\t\tassertFalse(square2.isOccuppied());\n\t\tassertFalse(square3.isOccuppied());\n\t\tassertTrue(square1.isOccuppied());\n\t\tscrabbleSystem.updateOrder();\n\n\t\tint scoreSum5 = scoreSum1 - 3 * (tile13.getValue() + tile14.getValue() + tile1.getValue());\n\t\tSystem.out.println(scoreSum5);\n\n\t\t/**\n\t\t * The sixth turn -- The player exchanges some tiles\n\t\t */\n\t\tPlayer currentPlayer6 = scrabbleSystem.getCurrentPlayer();\n\t\tList<Tile> tiles = new ArrayList<>();\n\t\tTile tile18 = currentPlayer6.getTileList().get(0);\n\t\tTile tile19 = currentPlayer6.getTileList().get(1);\n\t\tTile tile20 = currentPlayer6.getTileList().get(2);\n\t\ttiles.add(tile18);\n\t\ttiles.add(tile19);\n\t\ttiles.add(tile20);\n\t\tscrabbleSystem.exchangeTile(tiles);\n\t\tassertEquals(7, currentPlayer6.getTileList().size());\n\n\t\t/**\n\t\t * Get winner\n\t\t */\n\n\t\tList<Player> playersWinner = scrabbleSystem.getWinner();\n\t\tassertEquals(currentPlayer3.getName(), playersWinner.get(0).getName());\n\t}", "@Test\n public void testNextPlayer() {\n\n assertEquals(Color.BLACK, game.getPlayerInTurn());\n game.nextTurn();\n assertEquals(Color.RED, game.getPlayerInTurn());\n game.nextTurn();\n assertEquals(Color.BLACK, game.getPlayerInTurn());\n }", "@Test(timeout = 4000)\n public void test014() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"L\", (Content) null, (-1054.905F), 0, \"c5!DqhIQ,!L'eP\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-98), homeTexture0, (-98), 1624, 905.89F);\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n \n homeEnvironment0.setVideoFrameRate(0);\n int int0 = homeEnvironment0.getVideoFrameRate();\n assertEquals(0, int0);\n }", "public static void main(String[] args) {\n\n WebDriver driver = WebDriverFactory.get(EDriver.CHROME);\n\n driver.get(PlayerStaticData.url);\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\n //version1(driver);\n version2(driver);\n //version3(driver);\n version4(driver);\n }", "@Test(timeout = 4000)\n public void test084() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", (Content) null, (-826), 0.0F);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-3047), homeTexture0, 949, homeTexture0, (-3047), 949);\n homeEnvironment0.setWallsAlpha((-339.0F));\n assertEquals((-339.0F), homeEnvironment0.getWallsAlpha(), 0.01F);\n }", "public void playCvC() {\n isAI[0] = true;\n isAI[1] = true;\n players[0] = new AI();\n players[1] = new AI();\n playerShips[0] = players[0].getShipList();\n playerShips[1] = players[1].getShipList();\n grids[0] = new Grid();\n grids[1] = new Grid();\n currentPlayer = 0;\n playGame();\n }", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"0dj!E;iRV]\", (Content) null, 0, 0, \"0dj!E;iRV]\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 0, 0, 0);\n int int0 = homeEnvironment0.getVideoFrameRate();\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(0, homeEnvironment0.getLightColor());\n assertEquals(0, homeEnvironment0.getSkyColor());\n assertEquals(25, int0);\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals(0.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(0, homeEnvironment0.getGroundColor());\n }", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n Player player0 = new Player();\n Player player1 = new Player();\n player0.add(player1);\n player0.setConnected(true);\n byte[] byteArray0 = player0.pack();\n player0.setX((-170.22772F));\n player1.unpack(byteArray0);\n assertEquals((-170.22772F), player0.getX(), 0.01F);\n assertEquals(0, player1.getPictureId());\n }", "void play ();", "public static void main(String[] args) {\n Random r = new Random();\n int w = 50;\n int h = 40;\n int[][] a = new int[w][h];\n for (int i = 0; i < w; i++)\n {\n for (int j = h/2; j < h; j++)\n {\n a[i][j] = r.nextInt(GameView.colors.length);\n }\n }\n GameView tv = new GameView(a);\n new TestFrame(tv, \"Iulia Petria, 1601159\");\n }", "@Test\n void doEffectrocketlauncher() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"rocket launcher\");\n Weapon w19 = new Weapon(\"rocket launcher\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w19);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w19.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n ArrayList<GenericSquare> s = new ArrayList<>();\n players.add(victim);\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w19.getName()).doEffect(\"base\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim.getPlayerPosition() == Board.getSquare(10));\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(7));\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w19.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim.getPlayerPosition() == Board.getSquare(10) && p.getPlayerPosition() == Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSpawnpoint('y'));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(7));\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w19.getName()).doEffect(\"opt1\", \"base\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && victim.getPlayerPosition() == Board.getSquare(10) && p.getPlayerPosition() == Board.getSquare(7) && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSpawnpoint('y'));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(10));\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w19.getName()).doEffect(\"base\", \"opt2\", \"opt1\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && victim.getPlayerPosition() == Board.getSquare(10) && p.getPlayerPosition() == Board.getSquare(7) && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n }", "@Test\n void testBotBIsNextPlayerWhenBotAHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); //botA is nextPlayer\n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotB().getId(), testDealer.getNextPlayer());\n }", "@Test(timeout = 4000)\n public void test015() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n homeEnvironment0.setVideoFrameRate((-590));\n int int0 = homeEnvironment0.getVideoFrameRate();\n assertEquals((-590), int0);\n }", "@Test\n public void test3LoadingGameScene() throws Exception {\n\n //click on play\n Gdx.app.postRunnable(\n () -> Gdx.input.getInputProcessor().touchUp(389, 160, 0, 0));\n\n SPGameContextTestRunner.waitStage(\"Wait for Game Play Loading\", game, StonePits::isGameMenu);\n\n assertThat(game.isGameStarted()).isTrue();\n }", "@Test(timeout = 4000)\n public void test008() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"L\", (Content) null, (-1054.905F), 0, \"c5!DqhIQ,!L'eP\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-98), homeTexture0, (-98), 1624, 905.89F);\n float float0 = homeEnvironment0.getWallsAlpha();\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(905.89F, float0, 0.01F);\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(1624, homeEnvironment0.getLightColor());\n assertEquals((-98), homeEnvironment0.getSkyColor());\n assertEquals((-98), homeEnvironment0.getGroundColor());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n }", "@Override\n\tpublic void setup() {\n\t\tint videoWidth = 1280/2;\n\t\tint videoHeight = 720/2;\n//\t\tint videoWidth = 640;\n//\t\tint videoHeight = 400;\n\t\tint videoFrameRate = 30;\n\t\tint secondsToRecordInSegment = 5;\n\t\n\t\tsize(videoWidth, videoHeight, P2D);\n\t\tframeRate(60);\n\t\t\n\t\tcam = new Camera(this, videoWidth, videoHeight, videoFrameRate, secondsToRecordInSegment);\n\t\tregionManager = new RegionManager(this, videoWidth, videoHeight);\n\t\twinnerProcessor = new WinnerProcessor(this, cam, regionManager);\n\t\tstartingPistol = new StartingPistol();\n\t\t\n\t\tglobalKeyboardActions = new HashMap<Integer, Runnable>();\n\t\tglobalKeyboardActions.put(Integer.valueOf('D'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"Switching to region definition mode\");\n\t\t\t\tcurrentMode = Mode.DEFINE_REGION;\n\t\t\t}\n\t\t});\n\t\tglobalKeyboardActions.put(Integer.valueOf('R'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"Switching to recording mode\");\n\t\t\t\tcurrentMode = Mode.RECORDING;\n\t\t\t}\n\t\t});\n\t\tglobalKeyboardActions.put(Integer.valueOf('P'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"Switching to playback mode\");\n\t\t\t\tcurrentMode = Mode.PLAYBACK;\n\t\t\t}\n\t\t});\n\t\t\n\t\tmodeKeyboardActions = new HashMap<Mode, Map<Integer,Runnable>>();\n\t\t\n\t\t// Region Actions\n\t\tMap<Integer, Runnable> regionActions = new HashMap<Integer, Runnable>();\n\t\tmodeKeyboardActions.put(Mode.DEFINE_REGION, regionActions);\n\t\t\n\t\tregionActions.put(Integer.valueOf('3'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"In region define mode. Switching to finish line definition\");\n\t\t\t\tregionManager.setRegionToDefine(Region.FINISH_LINE);\n\t\t\t}\n\t\t});\n\t\tregionActions.put(Integer.valueOf('1'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"In region define mode. Switching to lane 1 definition\");\n\t\t\t\tregionManager.setRegionToDefine(Region.LANE1);\n\t\t\t}\n\t\t});\n\t\tregionActions.put(Integer.valueOf('2'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"In region define mode. Switching to lane 2 definition\");\n\t\t\t\tregionManager.setRegionToDefine(Region.LANE2);\n\t\t\t}\n\t\t});\n\t\tregionActions.put(Integer.valueOf('0'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"In region define mode. Clearing current region definition\");\n\t\t\t\tregionManager.setRegionToDefine(null);\n\t\t\t}\n\t\t});\n\t\tregionActions.put(Integer.valueOf('S'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"Saving current regions to disk\");\n\t\t\t\tregionManager.saveRegions();\n\t\t\t}\n\t\t});\n\t\tregionActions.put(Integer.valueOf('L'), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tprintln(\"Loading previous regions from disk\");\n\t\t\t\tregionManager.loadRegions();\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Recording actions\n\t\tMap<Integer, Runnable> recordingActions = new HashMap<Integer, Runnable>();\n\t\tmodeKeyboardActions.put(Mode.RECORDING, recordingActions);\n\t\t\n\t\trecordingActions.put(Integer.valueOf(' '), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\tstartRace();\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Playback actions\n\t\tMap<Integer, Runnable> playbackActions = new HashMap<Integer, Runnable>();\n\t\tmodeKeyboardActions.put(Mode.PLAYBACK, playbackActions);\n\t\t\n\t\t// Left arrow\n\t\tplaybackActions.put(Integer.valueOf(37), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\twinnerProcessor.stepBackward();\n\t\t\t}\n\t\t});\n\t\t// Right arrow\n\t\tplaybackActions.put(Integer.valueOf(39), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\twinnerProcessor.stepForward();\n\t\t\t}\n\t\t});\n\t\tplaybackActions.put(Integer.valueOf(' '), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\twinnerProcessor.toggleManualStep();\n\t\t\t}\n\t\t});\n\t\tplaybackActions.put(Integer.valueOf(38), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\twinnerProcessor.togglePlayOriginal();\n\t\t\t}\n\t\t});\n\t\tplaybackActions.put(Integer.valueOf(40), new Runnable() {\n\t\t\t@Override public void run() {\n\t\t\t\twinnerProcessor.togglePlayOriginal();\n\t\t\t}\n\t\t});\n\t\t\n\t\tcam.start();\n\t\t\n\t\tstartingPistol.listen(this);\n\t}", "public void initialize2() {\n\t\txHero1 = 10;\n\t\tinsecondmode=true;\n\t\tImageIcon bg = new ImageIcon(\"bg for one player.png\");\n\t\tBackground = (bg.getImage().getScaledInstance(bg.getIconWidth(), bg.getIconHeight(), Image.SCALE_DEFAULT));\n\t\tImageIcon[] in1 = new ImageIcon[12];\n\t\tin1[0] = new ImageIcon(\"\");\n\t\tin1[1] = new ImageIcon(\"\");\n\t\tin1[2] = new ImageIcon(\"\");\n\t\tin1[3] = new ImageIcon(\"\");\n\t\tin1[4] = new ImageIcon(\"\");\n\t\tin1[5] = new ImageIcon(\"\");\n\t\tin1[6] = new ImageIcon(\"\");\n\t\tin1[7] = new ImageIcon(\"\");\n\t\tin1[8] = new ImageIcon(\"\");\n\t\tin1[9] = new ImageIcon(\"\");\n\t\tin1[10] = new ImageIcon(\"\");\n\t\tin1[11] = new ImageIcon(\"\");\n\t\tImageIcon[] in2 = new ImageIcon[12];\n\t\tin2[0] = new ImageIcon(\"Hero02.png\");\n\t\tin2[1] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[2] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[3] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[4] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[5] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[6] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[7] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[8] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[9] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[10] = new ImageIcon(\"Hero02 Attack01.png\");\n\t\tin2[11] = new ImageIcon(\"Hero02 Die.png\");\n\t\tImageIcon[] inBullet1 = new ImageIcon[3];\n\t\tinBullet1[0] = new ImageIcon(\"\");\n\t\tinBullet1[1] = new ImageIcon(\"\");\n\t\tinBullet1[2] = new ImageIcon(\"\");\n\t\tImageIcon[] inBullet2 = new ImageIcon[5];\n\t\tinBullet2[0] = new ImageIcon(\"20.png\");\n\t\tinBullet2[1]= new ImageIcon(\"50.png\");\n\t\tinBullet2[2]= new ImageIcon(\"100.png\");\n\t\tinBullet2[3]= new ImageIcon(\"200.png\");\n\t\tinBullet2[4]= new ImageIcon(\"500.png\");\n\t\tcannotdefend(1);\n\t\tHero1.settemplate(in2);\n\t\tHero2.settemplate(in1);\n\t\tBullet1.settemplate(inBullet2);\n\t\tBullet2.settemplate(inBullet1);\n\t\tHero1.setstatus(0);\n\t\tHero2.setstatus(0);\n\t}", "@Override\n public void initTTSPlayer() {\n Log.e(\"test_TTS\", \"initTTSPlayer\");\n }", "@Override\n public void initTTSPlayer() {\n Log.e(\"test_TTS\", \"initTTSPlayer\");\n }", "@Test\n public void alienAttacksAlien() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n\n @Override\n protected void sendTurnViewModel() {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n player1.setIdentity(alien);\n player2.setIdentity(alien);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 0);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getTurnController().getTurn().getCanAttack() == false);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2) == matchController.endingSector);\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 1);\n }", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-2146244786), (HomeTexture) null, (-2146244786), (HomeTexture) null, (-2146244786), (-2146244786));\n LinkedList<Camera> linkedList0 = new LinkedList<Camera>();\n homeEnvironment0.setVideoCameraPath(linkedList0);\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals((-2.14624474E9F), homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals((-2146244786), homeEnvironment0.getGroundColor());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals((-2146244786), homeEnvironment0.getSkyColor());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals((-2146244786), homeEnvironment0.getLightColor());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n }", "@Test(timeout = 4000)\n public void test052() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", \"\", (Content) null, (-826), 0.0F, \"\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(2140976121, homeTexture0, 949, homeTexture0, (-3047), 949);\n Camera camera0 = new Camera(2140976121, 0.0F, (-826), 2140976121, 949, (-138.716F));\n LinkedList<Camera> linkedList0 = new LinkedList<Camera>();\n linkedList0.add(camera0);\n homeEnvironment0.setVideoCameraPath(linkedList0);\n assertEquals(949, homeEnvironment0.getSkyColor());\n assertEquals((-3047), homeEnvironment0.getLightColor());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n assertEquals(2140976121, homeEnvironment0.getGroundColor());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(949.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n }", "@Test\n\tpublic void AC1TestSimple() {\n\t\tGame g1 = Game.createMockGame(createTreasureAndPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.LEFT);\n\t\tg1.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g1.getHasWon());\n\t\t\n\t\t\n\t\tGame g2 = Game.createMockGame(createTreasureAndPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\t\t\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g2.getHasWon());\n\t\t\n\t\t\n\t\tGame g3 = Game.createMockGame(createTreasureOrPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g3.getHasWon());\n\t\t\n\t\tg3.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g3.getHasWon());\n\t\t\n\t\tGame g4 = Game.createMockGame(createTreasureOrPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g4.getHasWon());\n\t\t\n\t\tg4.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g4.getHasWon());\n\t}", "@Test\n public final void testPlayer2Win() {\n checkPlayerWin(player2);\n }", "public static void stageTwo() {\n status.recount();\n if (play) {\n coar_maze1.ending1();\n }\n while (status.getCounter() < 6 && play) {\n coar_maze1.direction();\n if (coar_maze1.china) {\n china_maze.china_orbs();\n china_maze.china_enemies();\n } else if (coar_maze1.amazon_forest) {\n amazon_jungle.amazon_river_orbs();\n amazon_jungle.amazon_river_enemies();\n }\n status.addCounter();\n quit();\n }\n status.recount();\n }", "@Test(timeout = 4000)\n public void test032() throws Throwable {\n URL uRL0 = MockURL.getFileExample();\n URLContent uRLContent0 = new URLContent(uRL0);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", uRLContent0, 0.0F, 2.0F);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-12), homeTexture0, 235, homeTexture0, 3682, 3682);\n homeEnvironment0.getGroundTexture();\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(3682.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(235, homeEnvironment0.getSkyColor());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals((-12), homeEnvironment0.getGroundColor());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(3682, homeEnvironment0.getLightColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n }", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n URL uRL0 = MockURL.getHttpExample();\n URLContent uRLContent0 = new URLContent(uRL0);\n CatalogTexture catalogTexture0 = new CatalogTexture(\"+Z)]_\", \"+Z)]_\", uRLContent0, 3273, 828.053F, \"com.eteks.sweethome3d.model.TexturesCategory\", true);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(3273, homeTexture0, (-3467), homeTexture0, (-3467), 1.0F);\n int int0 = homeEnvironment0.getLightColor();\n assertEquals((-3467), homeEnvironment0.getSkyColor());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals((-3467), int0);\n assertEquals(3273, homeEnvironment0.getGroundColor());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals(1.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"\", (Content) null, (-826), 0.0F);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-3047), homeTexture0, 949, homeTexture0, (-3047), 949);\n homeEnvironment0.getDrawingMode();\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(949.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(320, homeEnvironment0.getVideoWidth());\n assertEquals((-3047), homeEnvironment0.getLightColor());\n assertEquals(949, homeEnvironment0.getSkyColor());\n assertEquals((-3047), homeEnvironment0.getGroundColor());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n }", "@Test(timeout = 4000)\n public void test001() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"=,`t\", \"\", (Content) null, 1392, 1714.44F, \"\", false);\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment((-1567), homeTexture0, 329, homeTexture0, (-1567), 2870.0F);\n homeEnvironment0.setVideoWidth(1411);\n assertEquals(1411, homeEnvironment0.getVideoWidth());\n }", "@Test\n public void testTie() {\n Assert.assertTrue(\n new Game(\n new Grid3x3(),\n new PredefinedPlayer(new int[] {0, 2, 4, 5, 7}),\n new PredefinedPlayer(new int[] {1, 3, 6, 8})\n ).play().winner().empty());\n }", "@Test\n public void alienAttacksUndefendedHuman() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n player1.setIdentity(alien);\n player2.setIdentity(human);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 1);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getTurnController().getTurn().getCanAttack() == false);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2) == matchController.endingSector);\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 1);\n }", "@Test\n\tpublic void test() {\n\t\tGameStart game = new GameStart();\n\t\tnew LwjglApplication(game, \"Unit Test\", 800, 600, false);\n\n\t\tint beginningLives = game.gameScreen.info.lives();\n\t\ttry \n\t\t{\n\t\t\tThread.sleep(11000); // Waiting eleven seconds for ultimate death...\n\t\t} \n\t\tcatch(InterruptedException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"start: \" + beginningLives + \", end: \" + game.gameScreen.info.lives());\n\t\tassertTrue(game.gameScreen.info.lives() < beginningLives);\n\t}", "@Test\n public void testStart()\n {\n assertTrue(theEngine.inStartingState());\n theEngine.start();\n assertTrue(theEngine.inPlayingState()); \n }" ]
[ "0.59458566", "0.5935642", "0.5883654", "0.5841917", "0.5777981", "0.5768488", "0.5706344", "0.5643621", "0.5639784", "0.56278926", "0.56234854", "0.5620414", "0.56153315", "0.561329", "0.5603812", "0.55935115", "0.55805886", "0.55803174", "0.55737317", "0.55406725", "0.5527946", "0.5525267", "0.5514134", "0.5499071", "0.54890853", "0.5474375", "0.54631966", "0.54624814", "0.54589415", "0.54493475", "0.5449282", "0.5445658", "0.54410684", "0.5435943", "0.5434929", "0.5421944", "0.5417028", "0.5407381", "0.54058266", "0.5393658", "0.5388119", "0.5383427", "0.5381881", "0.5379196", "0.5377523", "0.5376964", "0.5370886", "0.53659004", "0.53627914", "0.53616184", "0.53614134", "0.53545815", "0.5351584", "0.5333562", "0.5325396", "0.5315047", "0.53150403", "0.5312612", "0.53064585", "0.5303474", "0.5299075", "0.5295391", "0.52940553", "0.52898276", "0.5289515", "0.52846694", "0.52839506", "0.5283819", "0.5278432", "0.52728903", "0.5272134", "0.52641994", "0.5259664", "0.52575874", "0.5256166", "0.52527505", "0.5232369", "0.52298045", "0.52283406", "0.52277815", "0.52273595", "0.5226122", "0.52248365", "0.522211", "0.5221992", "0.5218079", "0.5218079", "0.5216032", "0.52155787", "0.5211867", "0.5210735", "0.5203854", "0.51949245", "0.51935375", "0.5192032", "0.51879466", "0.51869166", "0.51852465", "0.51839375", "0.5180911", "0.5179818" ]
0.0
-1
Created by rhodges on 06/05/16.
public interface ImageSelectionListener { void selected (ImageActor actor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\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\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "private void poetries() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\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 mo38117a() {\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\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\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 anular() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "public void method_4270() {}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void gravarBd() {\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 }", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "private void init() {\n\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void one() {\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}", "@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 public void init() {}", "@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\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n void init() {\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 init()\r\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "protected void mo6255a() {\n }", "public void mo21877s() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic void debite() {\n\t\t\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 }", "public final void mo91715d() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public abstract void mo70713b();", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n protected void getExras() {\n }", "public void mo12628c() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n public void initialize() { \n }", "public void mo6081a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override public int describeContents() { return 0; }" ]
[ "0.59953314", "0.5858121", "0.582696", "0.5795295", "0.57313335", "0.57169366", "0.57011706", "0.568759", "0.5686743", "0.5686743", "0.56765115", "0.5669458", "0.56586623", "0.5637677", "0.5629274", "0.5622928", "0.56158376", "0.5600943", "0.5586802", "0.5582827", "0.5576962", "0.5576962", "0.5576962", "0.5576962", "0.5576962", "0.55766904", "0.55606437", "0.55569136", "0.55467004", "0.55467004", "0.55460757", "0.5530626", "0.5528632", "0.55267966", "0.54964215", "0.54929394", "0.54912204", "0.5491155", "0.5489695", "0.5468856", "0.5464215", "0.5457784", "0.5451527", "0.5448791", "0.5448791", "0.5448791", "0.5448791", "0.5448791", "0.5448791", "0.54362106", "0.5433321", "0.5431722", "0.54274106", "0.5425651", "0.54202926", "0.5419725", "0.54185224", "0.54185224", "0.54185224", "0.5414763", "0.5414763", "0.5414763", "0.5412144", "0.5400488", "0.5400488", "0.5400488", "0.5399808", "0.5386037", "0.5378054", "0.5378054", "0.53712744", "0.53694665", "0.53670794", "0.53670794", "0.53618795", "0.5351005", "0.53385675", "0.53369695", "0.53369695", "0.533081", "0.53296524", "0.53296524", "0.53296524", "0.53296524", "0.53296524", "0.53296524", "0.53296524", "0.5324423", "0.5321793", "0.5319495", "0.5318531", "0.5307412", "0.5306155", "0.5277808", "0.5273324", "0.52688015", "0.52648175", "0.5264113", "0.52641094", "0.52617097", "0.5257482" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View v) { openMacrosCalculator(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
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, 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\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\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 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}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\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\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_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.layout.menu, menu);\n\t\treturn true;\n\t}", "@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 \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 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\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.724863", "0.7203384", "0.7197011", "0.71784776", "0.71090055", "0.7040796", "0.7039464", "0.7013998", "0.70109546", "0.6982435", "0.6946134", "0.6939684", "0.6935636", "0.69193685", "0.69193685", "0.6892893", "0.6884914", "0.68768066", "0.68763", "0.68635243", "0.68635243", "0.68635243", "0.68635243", "0.6854071", "0.68483156", "0.6820635", "0.6818679", "0.68139905", "0.68138844", "0.68138844", "0.68068254", "0.68019366", "0.67988884", "0.6792257", "0.6791312", "0.67894673", "0.6785093", "0.67605865", "0.67587006", "0.67494637", "0.6745356", "0.6745356", "0.67428446", "0.6741961", "0.6726888", "0.67248803", "0.67236483", "0.67236483", "0.6722583", "0.6712873", "0.6707795", "0.67058164", "0.67011815", "0.669981", "0.66978544", "0.6695866", "0.66877913", "0.66849333", "0.66849333", "0.6684108", "0.66811496", "0.6680523", "0.6678561", "0.6669383", "0.66685265", "0.6664329", "0.6658405", "0.6658405", "0.6658405", "0.66576266", "0.6655998", "0.6655998", "0.6655998", "0.6653282", "0.66530126", "0.6651592", "0.6650151", "0.6648575", "0.6647844", "0.6647643", "0.6647611", "0.66465765", "0.6646401", "0.6644694", "0.6643749", "0.6643608", "0.6640089", "0.66356236", "0.6634635", "0.6633641", "0.6633641", "0.6633641", "0.66333216", "0.6630465", "0.66291285", "0.662822", "0.66277045", "0.6625648", "0.6621995", "0.6620415", "0.6620415" ]
0.0
-1
/ method to call the macrosCalculator
public void openMacrosCalculator(View view) { Intent intent = new Intent(this, MacrosCalculator.class); startActivityForResult(intent, MY_REQUEST_CODE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\topenMacrosCalculator(v);\n\t\t\t\t\n\t\t\t}", "public int exec(GerenciadorPerifericos gerenciadorPerifericos, ParametroMacroOperacao param){\n\r\n\t\tBigDecimal quantidadeNecessaria = (BigDecimal)gerenciadorPerifericos.getCmos().ler(CMOS.QUANTIDADE_ITEM_NECESSARIO_PARA_SEPARACAO);\r\n\t\t\r\n\t\tTelaAVInicial tela = (TelaAVInicial) ServiceLocator.getInstancia().getTela(ConstantesTela.TELA_AV_INICIAL);\r\n\t\ttela.setCampoQuantidade(\"\");\r\n\t\ttela.setCampoDesconto(\"\");\r\n\t\tgerenciadorPerifericos.atualizaTela(tela);\r\n\r\n\t\tProduto produto = (Produto)gerenciadorPerifericos.getCmos().ler(CMOS.PRODUTO_ATUAL);\r\n\r\n\t\tBigDecimal quantidade = BigDecimal.ZERO;\r\n\t\t\r\n\t\tif (produto.getTipo().getId().equals(TipoProduto.UNIDADE_VARIAVEL)) {\r\n\t\t\tgerenciadorPerifericos.getCmos().gravar(CMOS.QUANTIDADE_ITEM, quantidadeNecessaria);\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tEntradaDisplay entrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8);\r\n\t\t\t\twhile (entrada.getTeclaFinalizadora() == Tecla.CODIGO_ENTER) {\r\n\t\t\t\t\tquantidade = new BigDecimal(entrada.getDado());\r\n\t\t\t\t\tif (quantidade.doubleValue() == BigDecimal.ZERO.doubleValue()) {\r\n\t\t\t\t\t\tgerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, \"Quantidade Invalida [ESC]\"));\r\n\t\t\t\t\t\tgerenciadorPerifericos.esperaVolta();\r\n\t\t\t\t\t\tgerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, \"Digite a Quantidade\"));\r\n\t\t\t\t\t\tentrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8);\r\n\t\t\t\t\t} else if (quantidadeNecessaria.doubleValue() < quantidade.doubleValue()) {\r\n\t\t\t\t\t\tgerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, \"Quantidade Superior [ESC]\"));\r\n\t\t\t\t\t\tgerenciadorPerifericos.esperaVolta();\r\n\t\t\t\t\t\tgerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, \"Digite a Quantidade\"));\r\n\t\t\t\t\t\tentrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8);\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (AppException e) {\r\n\t\t\t\treturn ALTERNATIVA_2;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgerenciadorPerifericos.getCmos().gravar(CMOS.QUANTIDADE_ITEM, BigDecimal.ONE);\r\n\t\t\r\n\t\r\n\t\treturn ALTERNATIVA_1;\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\ttestMacro();\r\n\t}", "@Test\r\n\tpublic void macroTest(){\r\n\t\t\r\n\t\trunner = new AutoRunner();\r\n\t\t//runnerSpy = spy(runner);\r\n\t\t//macro = new AutoTranslateRightMacro();\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(0);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(0);\r\n\t\t\r\n\t\tReferenceData.getInstance().getUserInputData().setAutoTranslateLeft(true);\r\n\t\t//runner.setTask(macro);\r\n\t\tReferenceData.getInstance().getUserInputData().setAutoTranslateRight(true);\r\n\t\trunner.teleopPeriodic();\r\n\t\t\r\n\t\tassertTrue(runner.getTask().hasInitalized());\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(100);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(100);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\t//goFoward1\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickLeft(), .0001);\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickRight(), .0001);\r\n\t\tassertEquals(0, ReferenceData.getInstance().getUserInputData().getJoystickX(), .0001);\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickY(), .0001);\r\n\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(1190);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(1190);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\trunner.teleopPeriodic();\r\n\t\t//turnRight\r\n\t\tassertEquals(.5, ReferenceData.getInstance().getUserInputData().getJoystickLeft(), .0001);\r\n\t\tassertEquals(-.5, ReferenceData.getInstance().getUserInputData().getJoystickRight(), .0001);\r\n\t\tassertEquals(.5, ReferenceData.getInstance().getUserInputData().getJoystickX(), .0001);\r\n\t\tassertEquals(0, ReferenceData.getInstance().getUserInputData().getJoystickY(), .0001);\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(1300);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(1060);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\trunner.teleopPeriodic();\r\n\t\t//goFoward2\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickLeft(), .0001);\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickRight(), .0001);\r\n\t\tassertEquals(0, ReferenceData.getInstance().getUserInputData().getJoystickX(), .0001);\r\n\t\tassertEquals(1, ReferenceData.getInstance().getUserInputData().getJoystickY(), .0001);\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(1510);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(1270);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\trunner.teleopPeriodic();\r\n\t\t//turnLeft\r\n\t\tassertEquals(-.5, ReferenceData.getInstance().getUserInputData().getJoystickLeft(), .0001);\r\n\t\tassertEquals(.5, ReferenceData.getInstance().getUserInputData().getJoystickRight(), .0001);\r\n\t\tassertEquals(-.5, ReferenceData.getInstance().getUserInputData().getJoystickX(), .0001);\r\n\t\tassertEquals(0, ReferenceData.getInstance().getUserInputData().getJoystickY(), .0001);\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(1400);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(1400);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\trunner.teleopPeriodic();\r\n\t\t//goBackwards\r\n\t\tassertEquals(-1, ReferenceData.getInstance().getUserInputData().getJoystickLeft(), .0001);\r\n\t\tassertEquals(-1, ReferenceData.getInstance().getUserInputData().getJoystickRight(), .0001);\r\n\t\tassertEquals(0, ReferenceData.getInstance().getUserInputData().getJoystickX(), .0001);\r\n\t\tassertEquals(-1, ReferenceData.getInstance().getUserInputData().getJoystickY(), .0001);\r\n\t\t\r\n\t\tReferenceData.getInstance().getDriveTrainData().setLeftEncoderTicks(130);\r\n\t\tReferenceData.getInstance().getDriveTrainData().setRightEncoderTicks(130);\r\n\t\t\r\n\t\trunner.teleopPeriodic();\r\n\t\trunner.teleopPeriodic();\r\n\t\t//hasFinished\r\n\t\tassertTrue(runner.getTask().hasFinished());\r\n\t\t\r\n\t\t\r\n\t\t//doReturn(mockLeftTalon).when(runnerSpy).getLeftTalon();\r\n\t\t//when(gamePad.getXRight()).thenReturn(val);\r\n\t}", "public static void main(String[] args) {\n Calculator calc=new Calculator();\r\n double operand1,operand2,result=0;\r\n operand1=calc.getOperand1();\r\n operand2=calc.getOperand2();\r\n String op;\r\n op=calc.getOperator();\r\n try\r\n {\r\n \r\n switch(op)\r\n {\r\n case \"+\": Add add=new Add();\r\n result=add.doOperation(operand1, operand2);\r\n break;\r\n case \"-\": Subract sub=new Subract();\r\n result=sub.doOperation(operand1, operand2);\r\n break;\r\n case \"*\": Multiply mul=new Multiply();\r\n result=mul.doOperation(operand1, operand2);\r\n break;\r\n case \"/\": Division div =new Division();\r\n if(operand2==0)\r\n {\r\n \tthrow new ArithmeticException();\r\n }\r\n result=div.doOperation(operand1, operand2);\r\n break;\r\n default: throw new Exception(\"Invalid operation\");\r\n }\r\n \r\n\t }\r\n catch(ArithmeticException e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n }\r\n \r\n catch(Exception e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n } \r\n finally\r\n {\r\n \t System.exit(0);\r\n }\r\n System.out.print(result);\r\n \r\n}", "public void Run() {\n\t\tWorkbook wb = new Workbook();\n\n\t\t// Accesss first worksheet\n\t\tWorksheet ws = wb.getWorksheets().get(0);\n\n\t\t// Add some text in cell A1\n\t\tws.getCells().get(\"A1\").putValue(\"Welcome to \");\n\n\t\t// Create a calculation options with custom engine\n\t\tCalculationOptions opts = new CalculationOptions();\n\t\topts.setCustomEngine(new CustomEngine());\n\n\t\t// This line shows how you can call your own custom function without\n\t\t// a need to write it in any worksheet cell\n\t\t// After the execution of this line, it will return\n\t\t// Welcome to Aspose.Cells.\n\t\tObject ret = ws.calculateFormula(\"=A1 & MyCompany.CustomFunction()\", opts);\n\n\t\t// Print the calculated value on Console\n\t\tSystem.out.println(\"Calculated Value: \" + ret.toString());\n\t}", "public void Calculation(){\n if(Symbol.equals(\"+\"))\n {\n AnswerHalf = AnswerHalf + ButtonValue;\n }\n else if(Symbol.equals(\"-\"))\n {\n AnswerHalf = AnswerHalf - ButtonValue;\n }\n else if(Symbol.equals(\"*\"))\n {\n AnswerHalf = AnswerHalf * ButtonValue;\n }\n else if(Symbol.equals(\"/\"))\n {\n AnswerHalf = AnswerHalf/ButtonValue;\n }\n printAnswer = Double.toString(AnswerHalf);\n AfterEqual = 1;\n SymbolMark = 0;\n c = 0;\n AfterAnswer = 0;\n TFCalcBox.setText(printAnswer);\n }", "GmMacro createGmMacro(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "private void runFormulas() {\r\n // updates all of the formula cells in the excel file to display the\r\n // changes that were made to the parameter values\r\n FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();\r\n for (Row r : currentWorksheet) {\r\n for (Cell c : r) {\r\n if (c.getCellType() == Cell.CELL_TYPE_FORMULA) {\r\n try {\r\n evaluator.evaluateFormulaCell(c);\r\n } catch (Throwable t) {\r\n t.printStackTrace();\r\n }\r\n \r\n }\r\n }\r\n }\r\n }", "public Calculator()\r\n {\r\n //Creating Choice group list\r\n options = new ChoiceGroup(\"Main Form\",Choice.EXCLUSIVE);\r\n options.append(\"ADDITION\",null);\r\n options.append(\"SUBTRACTION\",null);\r\n options.append(\"MULTIPLICATION\",null);\r\n options.append(\"DIVISION\",null);\r\n \r\n display = Display.getDisplay(this);\r\n \r\n //Creating Forms\r\n main = new Form(\"MAIN FORM\");\r\n ChoiceGroupAppend=main.append(options);\r\n operation = new Form(\"OPERATION\");\r\n \r\n //Initializing different command buttons \r\n exit = new Command(\"EXIT\",Command.EXIT,0);\r\n select = new Command(\"SELECT\",Command.OK,0);\r\n back = new Command(\"BACK\",Command.BACK,0);\r\n result = new Command(\"RESULT\",Command.OK,0);\r\n clear = new Command(\"CLEAR\",Command.OK,0);\r\n //Adding command buttons to different forms\r\n main.addCommand(exit);\r\n main.addCommand(select);\r\n operation.addCommand(result);\r\n operation.addCommand(back);\r\n operation.addCommand(clear);\r\n main.setCommandListener(this);\r\n operation.setCommandListener(this);\r\n \r\n display.setCurrent(main);\r\n }", "public static void main(String[] args) {\n\t\tString[] tokens = {\"4\", \"13\", \"5\", \"/\", \"+\"};\n\t\tSystem.out.println(cal(tokens));\n\t}", "public static void main (String args[]){\r\n\t\tCalculator s = new Calculator();\r\n\t\ts.launchFrame();\r\n\t}", "public Calculator()\n {\n \n frame = new JFrame();\n createCalculator(range);\n createCP(range);\n frame.setVisible(true);\n frame.setSize(1200,1000);\n \n\n }", "public mathMethods() {\n initComponents();\n }", "public static void main(String[] args) {\n\t\tMagicCalculator magic = new MagicCalculator();\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Pick a number\");\n\t\tint number = Integer.parseInt(input.nextLine());\n\t\tSystem.out.println(\"Pick another number\");\n\t\tint number2 = Integer.parseInt(input.nextLine());\n\t\tinput.close();\n\t\t\n\t\t//Uses classes inherited from parent class Calculator\n\t\tmagic.Add(number, number2);\n\t\tmagic.Subtract(number, number2);\n\t\tmagic.Multiplication(number, number2);\n\t\tmagic.Division(number, number2);\n\t\t\n\t\tmagic.SquareRoot(number);\n\t\tmagic.SquareRoot(number2);\n\t\t\n\t\t//Uses its own classes\n\t\tmagic.FindSine(number, number2);\n\t\tmagic.FindCosine(number, number2);\n\t\tmagic.FindTangent(number, number2);\n\t\t\n\t\tmagic.FindFactorial(number);\n\t\t//magic.FindFactorial(number2);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Adding: 10+20 = \" + Calculator.add(10, 20));\n\t\tSystem.out.println(\"Subtracting: 20-10 = \" + Calculator.subtract(20, 10));\n\t\tSystem.out.println(\"Multiplying: 2*10 = \"+ Calculator.multiply(2, 10));\n\t\tSystem.out.println(\"Dividing: 10 / 2 = \" + Calculator.divide(10, 2));\n\t\tSystem.out.println(\"Square root of 64 = \" + MagicCalculator.squareRoot(64));\n\t\tSystem.out.println(\"Sine of 0 = \" + MagicCalculator.sin(0));\n\t\tSystem.out.println(\"Cosine of 0 = \" + MagicCalculator.cos(0));\n\t\tSystem.out.println(\"Tangent of 0 = \" + MagicCalculator.tan(0));\n\t\tSystem.out.println(\"5! = \" + MagicCalculator.factorial(5));\n\t}", "public void doCall(){\n CalculatorPayload operation = newContent();\n\n ((PBFTClient)getProtocol()).syncCall(operation);\n }", "public static void main(String[] args) {\n\t\tMyCalculator Mycalculator = new MyCalculator();\n\n added a line in feature 1\n\n\n\n\n\n\t\t// multiply 2 numners\n\t\tint int1 = 5;\n\t\tint int2 = 10;\n\t\tint prod = Mycalculator.Mult(int1, int2);\n\t\tSystem.out.println(\"Product of \" + int1 + \" and \" + int2 + \" is \" + prod);\n\n\t\t// add to numbers\n\t\tint1 = 5;\n\t\tint2 = 10;\n\t\tint sum = Mycalculator.Sum(int1, int2);\n\t\tSystem.out.println(\"Sum of \" + int1 + \" and \" + int2+ \" is \" + sum);\n\n\t\t// calculate quotient\n\t\tdouble d1 = 5;\n\t\tdouble d2 = 10;\n\t\tdouble q = Mycalculator.Quot(d1, d2);\n\t\tSystem.out.println(\"quotient of \" + d1 + \" and \" + d2 + \" is \" + q);\n\n\n\t\t// calculate hypotenuse\n\t\tdouble side1 = 3.0;\n\t\tdouble side2 = 4.0;\n\t\tdouble hypot = Mycalculator.Hypot(side1, side2);\n\t\tSystem.out.println(\"hypot of \" + side1 + \" and \" + side2 + \" is \" + hypot);\n\n\n\t\t// get a random number betewwn 1 and 10\n\t\tint rnd = Mycalculator.Random();\n\t\tSystem.out.println(\"random numner = \" + rnd);\n\n\t\t// calculate square root\n\t\tint1 = 9;\n\t\tdouble sr = Mycalculator.SquareRoot(int1);\n\t\tSystem.out.println(\"square root of \" + int1 +\" is \" + sr);\n\n\t}", "public abstract void execute(InputCalc input, Calculator calculator);", "@Test\n public void fieldMacroButton() throws Exception {\n Document doc = new Document(getMyDir() + \"Macro.docm\");\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n Assert.assertTrue(doc.hasMacros());\n\n // Insert a MACROBUTTON field, and reference one of the document's macros by name in the MacroName property.\n FieldMacroButton field = (FieldMacroButton) builder.insertField(FieldType.FIELD_MACRO_BUTTON, true);\n field.setMacroName(\"MyMacro\");\n field.setDisplayText(\"Double click to run macro: \" + field.getMacroName());\n\n Assert.assertEquals(\" MACROBUTTON MyMacro Double click to run macro: MyMacro\", field.getFieldCode());\n\n // Use the property to reference \"ViewZoom200\", a macro that ships with Microsoft Word.\n // We can find all other macros via View -> Macros (dropdown) -> View Macros.\n // In that menu, select \"Word Commands\" from the \"Macros in:\" drop down.\n // If our document contains a custom macro with the same name as a stock macro,\n // our macro will be the one that the MACROBUTTON field runs.\n builder.insertParagraph();\n field = (FieldMacroButton) builder.insertField(FieldType.FIELD_MACRO_BUTTON, true);\n field.setMacroName(\"ViewZoom200\");\n field.setDisplayText(\"Run \" + field.getMacroName());\n\n Assert.assertEquals(field.getFieldCode(), \" MACROBUTTON ViewZoom200 Run ViewZoom200\");\n\n // Save the document as a macro-enabled document type.\n doc.save(getArtifactsDir() + \"Field.MACROBUTTON.docm\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.MACROBUTTON.docm\");\n\n field = (FieldMacroButton) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_MACRO_BUTTON, \" MACROBUTTON MyMacro Double click to run macro: MyMacro\", \"\", field);\n Assert.assertEquals(\"MyMacro\", field.getMacroName());\n Assert.assertEquals(\"Double click to run macro: MyMacro\", field.getDisplayText());\n\n field = (FieldMacroButton) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_MACRO_BUTTON, \" MACROBUTTON ViewZoom200 Run ViewZoom200\", \"\", field);\n Assert.assertEquals(\"ViewZoom200\", field.getMacroName());\n Assert.assertEquals(\"Run ViewZoom200\", field.getDisplayText());\n }", "public void doMath();", "@Input\n public Map<String, String> getMacros() {\n return macros;\n }", "public OperationMacro() {\n errorList = new ArrayList();\n linkedOpList = new ArrayList();\n }", "public void actionPerformed(ActionEvent a) {\n\n String command = a.getActionCommand();\n if (command.equals(\"e\")) {\n //Log toggle.\n if (consoleDisplayed = !consoleDisplayed) //Show\n splitter.setDividerLocation(defaultSliderPosition);\n else //Hide\n splitter.setDividerLocation(.999);\n } else if (command.equals(\"r\")) {\n //Gets the code into a string.\n String code = text.getText();\n\n //Marks certain areas as \"dirty\".\n //Dirty areas are places that shouldn't be considered for any keywords,\n //including \"import\", \"extend\", and so on.\n ArrayList<Integer> dirtyBounds = getDirty(code);\n\n //Not quite perfect all of the time.\n if (text.getText().contains(\"class\")) {\n //This is a bit more explicit\n //if(text.getText().trim().substring(0, text.getText().trim().indexOf(\"{\")).contains(\"class\")) {\n //This means we should try to compile this as normal.\n\n //Pulls out class name\n int firstPos = code.indexOf(\"class\");\n while(isDirty(dirtyBounds, firstPos)) \n firstPos = code.indexOf(\"class\", firstPos + 1);\n\n int secondPos = code.indexOf(\"{\"); //No checks here because who would possibly put a comment between \"class\" and \"{\"?\n String name = code.substring(firstPos + \"class\".length() + 1, secondPos).trim();\n\n //Just a safety check to make sure you don't try to modify this program while it's running.\n if (name.equals(\"Playground\")) {\n System.out.println(\"I know what you're doing and I don't approve. I won't even compile that.\");\n return;\n //println(\"Self-compiling. You were warned.\", warning); //Allowed users to bootstrap this program. October 26, 2014\n }\n\n compileAndRun(name, code);\n } else {\n //This means we should compile this as a playground.\n\n //TODO: Try to assign every line to a variable, and print it out if it's by itself. IE, saying \"int i = 0\" won't do anything,\n //but then just typing \"i\" or \"i;\" would print out \"0\". Add support for functions, too. So \"factorial(5)\" by itself would \n //print out \"120\" without any fluff.\n\n //TODO: Lazy typing. \"int i = 0\" should be equivilant to \"i = 0\"\n\n //TODO: Less need for casting. If \"int.toString()\" is called, modify in-place to \"(new Integer(int)).toString()\"\n //Similar for calls that need Strings but are passed primitives; \"promote\" them by prepending \"\"+ to them.\n\n //Common import statements built-in\n String importDump = new String();\n importDump+=(\"import java.util.*;\\n\" + \n \"import javax.swing.*;\\n\" + \n \"import javax.swing.event.*;\\n\" +\n \"import java.awt.*;\\n\" + \n \"import java.awt.event.*;\\n\" + \n \"import java.io.*;\\n\");\n\n //User-defined or auto-generated methods\n String methodDump = new String();\n\n //Pulls out any \"import\" statements and appends them to the import dump.\n int i = code.indexOf(\"import\");\n while(i >= 0) {\n //Ignores comments and string literals\n if (isDirty(dirtyBounds, i)) {\n i = code.indexOf(\"import\", i+1);\n continue;\n }\n\n String s = code.substring(i, code.indexOf(\";\", i) + 1); \n //System.out.println(\"Found import: \" + s);\n code = code.replaceFirst(s, \"\");\n importDump+=s+\"\\n\";\n i = code.indexOf(\"import\", i+1);\n }\n\n //Pulls out all methods\n i = code.indexOf(\"(\");\n while(i >= 0) {\n if (isDirty(dirtyBounds,i)) {\n i = code.indexOf(\"(\", i+1); continue;\n }\n\n //Move backwards first\n char temp = 0; int pos = i;\n boolean shouldSkip = false;\n while(--pos > 0) {\n temp = code.charAt(pos);\n if (temp == '.') {shouldSkip = true; break;} //This is a method call, ie String.charAt();\n if (temp == ';') {++pos; break;} //This is most likely a method declaration, since we had no errors\n //If we hit the start of the file, that's probable a method dec. too!\n }\n\n String sub = code.substring(pos, i);\n if (shouldSkip || isDirty(dirtyBounds, pos) || \n sub.contains(\"while\") || sub.contains(\"for\") || sub.contains(\"new\") || sub.contains(\"try\") || sub.contains(\"catch\")) \n {i=code.indexOf(\"(\", i+1); continue;} //If this def. isn't a method or it's in a comment\n\n int start = pos;\n temp = 0; pos = code.indexOf(\"{\", i+1);\n int count = 1; shouldSkip = false;\n if(pos != -1) {\n if (code.indexOf(\";\", i+1) > pos || code.indexOf(\";\", i+1) == -1) {\n while(++pos < code.length()) {\n if (count == 0) \n break;\n\n temp = code.charAt(pos);\n if (temp == '{') \n count++;\n if (temp == '}') \n count--;\n }\n } else {\n //If there's a semicolon between the opening paranthesis and opening curly brace, this isn't a method!\n i = code.indexOf(\"(\", i+1);\n continue;\n }\n } else {\n i = code.indexOf(\"(\", i+1);\n continue;\n }\n\n int end = pos;\n String s = code.substring(start,end);\n code = code.replace(s, \"\"); \n\n //Just to make it look nicer\n s = s.trim();\n\n //println(\"Found method: \" + s);\n\n //This makes using the method intuitive by effectively removing the need for static modifiers\n if (!s.substring(0,s.indexOf(\"(\")).contains(\"static\")) {\n s = \"static \" + s;\n //println(\"Silently adding 'static' modifier\", warning);\n }\n\n methodDump+=(s + \"\\n\");\n i = code.indexOf(\"(\", i+1);\n }\n\n //Inject the class header and main method, imports, and methods\n code = \"//User and auto-imports pre-defined\\n\"\n + importDump\n + \"//Autogenerated class\\n\"\n + \"public class Main {\\n\" \n + \"public static void main(String[] args) {\\n\"\n + code\n + \"\\n}\\n\"\n + methodDump \n + \"}\";\n\n //Run as normal\n compileAndRun(\"Main\", code);\n }\n } else if (command.equals(\"k\")) {\n kill(); \n } else if (command.equals(\"o\")) {\n of = new OptionFrame(frame);\n } else if (command.equals(\"/\")) {\n hf = new HelpFrame(frame);\n }\n }", "public void runProgram() {\n\t\tJTextPane code = ((MinLFile) tabbedPane.getSelectedComponent()).CodeArea;\n\t\tminc.consolearea.setText(\"\");\n\t\tinterpretorMainMethod(code.getText(), 0);\n\t\tdouble_variables.clear();\n\t\tstring_variables.clear();\n\t\tfunctions.clear();\n\t}", "public Calculator() {\n initComponents();\n setResizable(false);\n \n NumListener numListener = new Calculator.NumListener();\n numButton0.addActionListener(numListener);\n numButton1.addActionListener(numListener);\n numButton2.addActionListener(numListener);\n numButton3.addActionListener(numListener);\n numButton4.addActionListener(numListener);\n numButton5.addActionListener(numListener);\n numButton6.addActionListener(numListener);\n numButton7.addActionListener(numListener);\n numButton8.addActionListener(numListener);\n numButton9.addActionListener(numListener);\n pointButton.addActionListener(numListener);\n \n OpListener opListener = new Calculator.OpListener();\n plusButton.addActionListener(opListener);\n minButton.addActionListener(opListener);\n multButton.addActionListener(opListener);\n divButton.addActionListener(opListener);\n sqrtButton.addActionListener(opListener);\n eqButton.addActionListener(opListener);\n signButton.addActionListener(opListener);\n \n ClearListener clearListener = new ClearListener();\n cButton.addActionListener(clearListener);\n ceButton.addActionListener(clearListener);\n }", "public static void main(String[] args) {\n\t\tint num1 = 7;\r\n\t\tint num2 = 6;\r\n\t\t\r\n\t\tmathOps ops1 = new mathOps();\r\n\t\tSystem.out.println(\"sum = \" +ops1.addition(num1, num2));\r\n\t\tSystem.out.println(\"sub = \" +ops1.substraction(num1, num2));\r\n\t\tSystem.out.println(\"mul = \" +ops1.multiply(num1, num2));\r\n\t\tSystem.out.println(\"div = \" +ops1.divide(num1, num2));\r\n\t}", "private boolean macro(Macro m, Token orig)\r\n throws IOException,\r\n LexerException {\r\n Token tok;\r\n List<Argument> args;\r\n\r\n // System.out.println(\"pp: expanding \" + m);\r\n if (m.isFunctionLike()) {\r\n OPEN:\r\n for (;;) {\r\n tok = source_token();\r\n // System.out.println(\"pp: open: token is \" + tok);\r\n switch (tok.getType()) {\r\n case WHITESPACE:\t/* XXX Really? */\r\n\r\n case CCOMMENT:\r\n case CPPCOMMENT:\r\n case NL:\r\n break;\t/* continue */\r\n\r\n case '(':\r\n break OPEN;\r\n default:\r\n source_untoken(tok);\r\n return false;\r\n }\r\n }\r\n\r\n // tok = expanded_token_nonwhite();\r\n tok = source_token_nonwhite();\r\n\r\n /* We either have, or we should have args.\r\n * This deals elegantly with the case that we have\r\n * one empty arg. */\r\n if (tok.getType() != ')' || m.getArgs() > 0) {\r\n args = new ArrayList<Argument>();\r\n\r\n Argument arg = new Argument();\r\n int depth = 0;\r\n boolean space = false;\r\n\r\n ARGS:\r\n for (;;) {\r\n // System.out.println(\"pp: arg: token is \" + tok);\r\n switch (tok.getType()) {\r\n case EOF:\r\n error(tok, \"EOF in macro args\");\r\n return false;\r\n\r\n case ',':\r\n if (depth == 0) {\r\n if (m.isVariadic()\r\n && /* We are building the last arg. */ args.size() == m.getArgs() - 1) {\r\n /* Just add the comma. */\r\n arg.addToken(tok);\r\n } else {\r\n args.add(arg);\r\n arg = new Argument();\r\n }\r\n } else {\r\n arg.addToken(tok);\r\n }\r\n space = false;\r\n break;\r\n case ')':\r\n if (depth == 0) {\r\n args.add(arg);\r\n break ARGS;\r\n } else {\r\n depth--;\r\n arg.addToken(tok);\r\n }\r\n space = false;\r\n break;\r\n case '(':\r\n depth++;\r\n arg.addToken(tok);\r\n space = false;\r\n break;\r\n\r\n case WHITESPACE:\r\n case CCOMMENT:\r\n case CPPCOMMENT:\r\n case NL:\r\n /* Avoid duplicating spaces. */\r\n space = true;\r\n break;\r\n\r\n default:\r\n /* Do not put space on the beginning of\r\n * an argument token. */\r\n if (space && !arg.isEmpty())\r\n arg.addToken(Token.space);\r\n arg.addToken(tok);\r\n space = false;\r\n break;\r\n\r\n }\r\n // tok = expanded_token();\r\n tok = source_token();\r\n }\r\n /* space may still be true here, thus trailing space\r\n * is stripped from arguments. */\r\n\r\n if (args.size() != m.getArgs()) {\r\n if (m.isVariadic()) {\r\n if (args.size() == m.getArgs() - 1) {\r\n args.add(new Argument());\r\n } else {\r\n error(tok,\r\n \"variadic macro \" + m.getName()\r\n + \" has at least \" + (m.getArgs() - 1) + \" parameters \"\r\n + \"but given \" + args.size() + \" args\");\r\n return false;\r\n }\r\n } else {\r\n error(tok,\r\n \"macro \" + m.getName()\r\n + \" has \" + m.getArgs() + \" parameters \"\r\n + \"but given \" + args.size() + \" args\");\r\n /* We could replay the arg tokens, but I \r\n * note that GNU cpp does exactly what we do,\r\n * i.e. output the macro name and chew the args.\r\n */\r\n return false;\r\n }\r\n }\r\n\r\n for (Argument a : args) {\r\n a.expand(this);\r\n }\r\n\r\n // System.out.println(\"Macro \" + m + \" args \" + args);\r\n } else {\r\n /* nargs == 0 and we (correctly) got () */\r\n args = null;\r\n }\r\n\r\n } else {\r\n /* Macro without args. */\r\n args = null;\r\n }\r\n\r\n if (m == __LINE__) {\r\n push_source(new FixedTokenSource(\r\n new Token[]{new Token(NUMBER,\r\n orig.getLine(), orig.getColumn(),\r\n Integer.toString(orig.getLine()),\r\n new NumericValue(10, Integer.toString(orig.getLine())))}\r\n ), true);\r\n } else if (m == __FILE__) {\r\n StringBuilder buf = new StringBuilder(\"\\\"\");\r\n String name = getSource().getName();\r\n if (name == null)\r\n name = \"<no file>\";\r\n for (int i = 0; i < name.length(); i++) {\r\n char c = name.charAt(i);\r\n switch (c) {\r\n case '\\\\':\r\n buf.append(\"\\\\\\\\\");\r\n break;\r\n case '\"':\r\n buf.append(\"\\\\\\\"\");\r\n break;\r\n default:\r\n buf.append(c);\r\n break;\r\n }\r\n }\r\n buf.append(\"\\\"\");\r\n String text = buf.toString();\r\n push_source(new FixedTokenSource(\r\n new Token[]{new Token(STRING,\r\n orig.getLine(), orig.getColumn(),\r\n text, text)}\r\n ), true);\r\n } else if (m == __COUNTER__) {\r\n /* This could equivalently have been done by adding\r\n * a special Macro subclass which overrides getTokens(). */\r\n int value = this.counter++;\r\n push_source(new FixedTokenSource(\r\n new Token[]{new Token(NUMBER,\r\n orig.getLine(), orig.getColumn(),\r\n Integer.toString(value),\r\n new NumericValue(10, Integer.toString(value)))}\r\n ), true);\r\n } else {\r\n push_source(new MacroTokenSource(m, args), true);\r\n }\r\n\r\n return true;\r\n }", "public interface CalculatorService {\n\n\tpublic double add(double arg1, double arg2); \n\tpublic double sub(double arg1, double arg2); \n\tpublic double div(double arg1, double arg2);\n\tpublic double mult(double arg1, double arg2);\n}", "public static void main(String[] args) {\n\t\tCalculatorScanner calculatorScanner = new CalculatorScanner();\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter 2 numbers:- \");\n\t\tint num1 = scanner.nextInt();\n\t\tint num2 = scanner.nextInt();\n\t\tint add = calculatorScanner.addition(num1, num2);\n\t\tint subtraction = calculatorScanner.subtraction(num1, num2);\n\t\tint multiplication = calculatorScanner.multiplication(num1, num2);\n\t\tint division = calculatorScanner.division(num1, num2);\n\t\tcalculatorScanner.printTotalAnswer(add, subtraction, multiplication, division);\n\t\tscanner.close();\n\t}", "@Test\n void shouldExpandTokenMacro() {\n WorkflowJob job = createPipelineWithWorkspaceFilesWithSuffix(\"checkstyle1.xml\", \"checkstyle2.xml\");\n\n configureToken(job, \"checkstyle1\");\n\n AnalysisResult baseline = scheduleBuildAndAssertStatus(job, Result.SUCCESS);\n verifyConsoleLog(baseline, 3, 0, 0);\n\n configureToken(job, \"checkstyle2\");\n\n AnalysisResult result = scheduleBuildAndAssertStatus(job, Result.SUCCESS);\n\n verifyConsoleLog(result, 4, 3, 2);\n }", "public static void main( String[] args )\n {\n Calculator calculator = new Calculator(2.2f);\n// Calculator calculator2 = new Calculator(3f);\n// calculator.name = \"calc\";\n// //System.out.println(Calculator.name);\n// calculator.add(5f);\n// System.out.println(calculator2.name);\n// System.out.println(calculator.getTotal());\n// calculator2.subtract(2f);\n// System.out.println(calculator2.getTotal());\n//\n// calculator.add(5f).subtract(1f).add(2.5f);\n// System.out.println(calculator.getTotal());\n\n for (int i = 0; i < 10; i++) {\n calculator.add(i);\n System.out.println(calculator.getTotal());\n }\n }", "GmMacro createGmMacro(Document doc);", "public static void main(String[] args) {\n Simple_Calculator cf = new Simple_Calculator();\n cf.setVisible(true);\n cf.setTitle(\"Calculator\");\n }", "GmMacro createGmMacro(File file) throws IOException, SAXException, ParserConfigurationException;", "public interface Calculator extends CalculatorEventContainer, HistoryControl<CalculatorHistoryState> {\n\n void init();\n\n /*\n **********************************************************************\n *\n * CALCULATIONS\n *\n **********************************************************************\n */\n\n void evaluate();\n\n void evaluate(@NotNull Long sequenceId);\n\n void simplify();\n\n @NotNull\n CalculatorEventData evaluate(@NotNull JsclOperation operation,\n @NotNull String expression);\n\n @NotNull\n CalculatorEventData evaluate(@NotNull JsclOperation operation,\n @NotNull String expression,\n @NotNull Long sequenceId);\n\n /*\n **********************************************************************\n *\n * CONVERSION\n *\n **********************************************************************\n */\n\n boolean isConversionPossible(@NotNull Generic generic, @NotNull NumeralBase from, @NotNull NumeralBase to);\n\n @NotNull\n CalculatorEventData convert(@NotNull Generic generic, @NotNull NumeralBase to);\n\n /*\n **********************************************************************\n *\n * EVENTS\n *\n **********************************************************************\n */\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data);\n\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Object source);\n\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Long sequenceId);\n\n\t@NotNull\n\tPreparedExpression prepareExpression(@NotNull String expression) throws CalculatorParseException;\n}", "public static void main(String[] args) {\n System.out.print('\\u000C');\n Scanner scan = new Scanner(System.in);\n \n int INITIAL_MIN = 1;\n int INITIAL_MAX = 20;\n double INTERVAL_MIN = 1;\n double INTERVAL_MAX = 5;\n int INCREMENT_MIN = 1;\n int INCREMENT_MAX = 20;\n \n System.out.print(\"\\n========================================\");\n System.out.print(\"\\nSophocles Software Call Center Sim\\n\");\n System.out.print(\"========================================\\n\");\n \n System.out.println(\"How many customer do you want to be in the initial queue ?\");\n System.out.print(\"Enter a integer between \" + INITIAL_MIN + \" and \" + INITIAL_MAX + \" : \");\n int initialQ = getInRangeInt(scan, INITIAL_MIN, INITIAL_MAX);\n \n System.out.println(\"How long you want one call to continue ?\");\n System.out.print(\"Enter a double between \" + INTERVAL_MIN + \" and \" + INTERVAL_MAX + \" : \");\n double callInterval = getInRangeDouble(scan, INTERVAL_MIN, INTERVAL_MAX);\n \n System.out.println(\"How many calls do you want to complete ?\");\n System.out.print(\"Enter a integer between \" + INCREMENT_MIN + \" and \" + INCREMENT_MAX + \" : \");\n int increment = getInRangeInt(scan, INCREMENT_MIN, INCREMENT_MAX);\n \n Simulation sim = new Simulation(initialQ, callInterval, increment);\n }", "@Override\n protected void initializeMacroCommand() {\n \n addSubCommand(new PrepareControllerCommand());\n addSubCommand(new PrepareModelCommand());\n addSubCommand(new PrepareViewCommand());\n \n // Remove the command because it never be called more than once\n // getFacade().removeCommand(ApplicationConstants.STARTUP);\n }", "@Override\n public void addNumbers() {\n calculator.add(2, 2);\n }", "public static void main(String[] args) {\n new Calculator();\n }", "public static void main(String[] args) {\n System.out.println(\"Start of code\");\r\n\t\t\r\n\t\tmyAdd();\r\n\t\tmyAdd();\r\n\t\tmyAdd();\r\n\t\tmyMultiple(15,23);\r\n\t\tmyMultiple(15,22);\r\n\t\t\r\n\t\tint a= myDivision(100,5);\r\n\t\tSystem.out.println(\"Value of s is \"+a);\r\n\t\t\r\n\t\tint b= myDivision(100,15);\r\n\t\tSystem.out.println(\"Value of s is \"+b);\r\n \r\n\t\tSystem.out.println(\"End of code\");\r\n\t}", "private String generateMacro(){\r\n\t\tString code=\"\";\r\n\t\tcode += \"#include <assert.h>\\n\";\r\n\t\tcode += \"#include \\\"osek.h\\\"\\n\";\r\n\t\tcode += \"#include \\\"oil.h\\\"\\n\";\r\n\t\tcode += \"#include \\\"readyQ.h\\\"\\n\";\r\n\t\tcode += \"#include \\\"kernel.h\\\"\\n\";\r\n\t\treturn code;\r\n\t}", "public IAstPreprocessorMacroExpression[] getMacroExpressions();", "public static void main(String[] args) {\n Calculator.add(5,3); //directly prints like this output is 8\n\n //Calculator.multiply(5,3) ---does not work bc it is not static\n //need to create a object for Calculator:\n Calculator cl1= new Calculator();\n cl1.multiply(5,3);//now it prints like this no need to sout.\n\n\n }", "public MacroOperatorService() {\r\n\t\tthis.moCollection = new ArrayList<MacroOperator>();\r\n\t\tthis.macOpDao = new MacroOperatorDao();\r\n\t}", "public static void main(String[] args) {\n\t\n\t\t Calculator myCalculator = new Calculator();\n\t\t\n\t\t System.out.println(myCalculator.add(5, 7));\n\t\t \n\t\t System.out.println(myCalculator.subtract(45, 11));\n\t\t \n\t\t \n\t}", "public static void main(String[] args) {\n\t\tString one = JOptionPane.showInputDialog(\"Pick a number.\");\r\n\t\tint uno = Integer.parseInt(one);\r\n\t\tString two = JOptionPane.showInputDialog(\"Pick another number.\");\r\n\t\tint dos = Integer.parseInt(two);\r\n\t\t// 2. Customize pop-up to support add/subtract/multiply/divide operations.\r\n\t\tint operation = JOptionPane.showOptionDialog(null, \"Pick an operation.\", \"Operations\", 0,\r\n\t\t\t\tJOptionPane.INFORMATION_MESSAGE, null, new String[] { \"add\", \"subtract\", \"multiply\", \"divide\" },\r\n\t\t\t\tnull);\r\n\r\n\t\t// 5. Call the methods created in steps 3 and 4 to perform the appropriate operation.\r\n\t\tif(operation == 0) {\t\r\n\t\t\tadd(uno, dos);\r\n\t\t}\r\n\t\tif(operation == 1) {\t\r\n\t\t\tsubtract(uno, dos);\r\n\t\t}\r\n\t\tif(operation == 2) {\t\r\n\t\t\tmultiply(uno, dos);\r\n\t\t}\r\n\t\tif(operation == 3) {\t\r\n\t\t\tdivide(uno, dos);\r\n\t\t}\r\n\t\t// 6. Wrap steps 1, 2 and 5 in a for loop to repeat calculator operations\r\n\t}", "public static void main(String[] args) {\n MathOp add=new MathOp() {\n \t \n public int operation(int x, int y)\n {\n \t return x+y;\n }\n\t };\n\t System.out.println(add.operation(1, 2));\n \n\t MathOp sub=new MathOp() {\n \t \n\t public int operation(int x, int y)\n\t {\n\t \t return x-y;\n\t }\n\t\t };\n\t\t System.out.println(sub.operation(1, 2));\n\t \n\t\t MathOp mul=new MathOp() {\n\t \t \n\t\t public int operation(int x, int y)\n\t\t {\n\t\t \t return x*y;\n\t\t }\n\t\t\t };\n\t\t\t System.out.println(mul.operation(1, 2));\n\t\t \n\t\t\t MathOp div=new MathOp() {\n\t\t \t \n\t\t\t public int operation(int x, int y)\n\t\t\t { \n\t\t\t \t return x/y;\n\t\t\t }\n\t\t\t\t };\n\t\t\t\t System.out.println(div.operation(1, 2));\n\t\t\t \n}", "public MacroList() {\n\t\tthis.macrosses = new HashMap<Integer, String>(12);\n\t}", "public void CalcMethod1(String S){\n if(AfterEqual == 1)\n {\n //After Pressing the equal button when pressed action button...\n AnswerHalf = AnswerHalf;\n }\n //After Pressing the number button when pressed action button...\n else\n {\n String ButtonNo = Save1[0];\n for(int n = 1;n<c;n++){\n ButtonNo = ButtonNo + Save1[n];\n }\n ButtonValue = Double.parseDouble(ButtonNo);\n if(SymbolMark>0)\n {\n if(Symbol.equals(\"+\"))\n {\n AnswerHalf = AnswerHalf + ButtonValue;\n }\n else if(Symbol.equals(\"-\"))\n {\n AnswerHalf = AnswerHalf - ButtonValue;\n }\n else if(Symbol.equals(\"*\"))\n {\n AnswerHalf = AnswerHalf * ButtonValue;\n }\n else if(Symbol.equals(\"/\"))\n {\n AnswerHalf = AnswerHalf / ButtonValue;\n }\n }\n else\n {\n AnswerHalf = ButtonValue;\n }\n }\n SymbolMark++;\n Symbol = S;\n c = 0;\n }", "private static void populationsMain() {\n Printing.wraptitle( POPULATIONS );\n Printing.makeOptions( GOUP );\n\n msg( \"This portion of the project is not interactive. See Discussion.pdf for population predictions.\" );\n msg( \"You can evaluate the functions used in this portion through selection (4) on the main menu.\" );\n\n int option = requestOption( 0 );\n if ( option == 0 ) {\n main();\n }\n\n }", "public static void main(String[] args) {\n\t\t\t\t\t\t\r\n\t\tint num1 = 100;\r\n\t\tint num2 = 50;\r\n\t\t\r\n\t\tCalcOperation calc = new CalcOperation();\r\n\t\t\r\n\t\tSystem.out.println(\"Addition of \"+num1+\" and \"+num2+\" is: \"+calc.addition(num1, num2));\r\n\t\tSystem.out.println(\"Subraction of \"+num1+\" and \"+num2+\" is: \"+calc.subraction(num1, num2));\r\n\t\tSystem.out.println(\"Multiplication of \"+num1+\" and \"+num2+\" is: \"+calc.multipliation(num1, num2));\r\n\t\tSystem.out.println(\"Division of \"+num1+\" and \"+num2+\" is: \"+calc.division(num1, num2));\r\n\t}", "public Calculator(int width, int height) {\n\t\tbuttons = new JButton[BUTTON_CAPTIONS.length];\n\t\toperand = new StringBuilder(\"0\");\n\t\tinitUI(width, height);\n\t\tfirstOperand = true;\n\t\texpression = null;\n\t}", "@Test(expected = SyntaxErrorException.class)\n public void saveMacro() throws Exception{\n\t macroParser.saveMacro(\"! +\");\n }", "public static void main(String[] args) {\n\t\t \n\t\tCalculator frame = new Calculator();\n\t\tframe.setVisible(true);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n int upperBound = 20;\n int lowerBound = 0;\n int operandCount = 5;\n boolean isHaveAddition = true;\n boolean isHaveSubtraction = true;\n boolean isHaveMultiplication = true;\n boolean isHaveDivision = true;\n int formulaCount = 1;\n int decimalPrecision = 3;\n\n //Store the generated results\n List<String> formulas;\n List<String> results;\n\n Generator generator = new Generator(upperBound, lowerBound,\n operandCount, isHaveAddition, isHaveSubtraction,\n isHaveMultiplication, isHaveDivision, formulaCount, decimalPrecision);\n\n formulas = generator.getFormulas();\n results = generator.getResults();\n\n for (int i = 0; i < formulaCount; i++) {\n System.out.println(formulas.get(i) + \" = \" + results.get(i));\n }\n\n }", "public static void main(String[] args) {\n\t\tCalculator calculator =new Calculator();\n\n\t\tint add=calculator.add(10, 20);\n\t\tint sub=calculator.sub(10, 20);\n\t\tint mul=calculator.mul(10, 20);\n\t\tdouble div=calculator.div(10, 20);\n\t\t\n\t\tcalculator.displaySum(add, sub, mul, div);\n\t}", "IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException;", "private void processMacro( String text, Sink sink )\n throws XmlPullParserException\n {\n String s = text.substring( text.indexOf( '{' ) + 1, text.indexOf( '}' ) );\n s = escapeForMacro( s );\n String[] params = StringUtils.split( s, \"|\" );\n String macroName = params[0];\n\n Map<String, Object> parameters = new HashMap<>();\n for ( int i = 1; i < params.length; i++ )\n {\n String[] param = StringUtils.split( params[i], \"=\" );\n if ( param.length == 1 )\n {\n throw new XmlPullParserException( \"Missing 'key=value' pair for macro parameter: \" + params[i] );\n }\n\n String key = unescapeForMacro( param[0] );\n String value = unescapeForMacro( param[1] );\n parameters.put( key, value );\n }\n\n MacroRequest request = new MacroRequest( sourceContent, new Xhtml5Parser(), parameters, getBasedir() );\n\n try\n {\n executeMacro( macroName, request, sink );\n }\n catch ( MacroExecutionException e )\n {\n throw new XmlPullParserException( \"Unable to execute macro in the document: \" + macroName );\n }\n catch ( MacroNotFoundException me )\n {\n throw new XmlPullParserException( \"Macro not found: \" + macroName );\n }\n }", "private static void equationsTest() {\n }", "Operations operations();", "public void updateOperations() {\n String temp = \"\";\n \n if (chkBoxOperators[0].isSelected()) temp += PLUS;\n if (chkBoxOperators[1].isSelected()) temp += MINUS;\n if (chkBoxOperators[2].isSelected()) temp += TIMES;\n if (chkBoxOperators[3].isSelected()) temp += DIVIDE;\n \n charOperators = temp.toCharArray();\n if (temp.indexOf(currentOperator) == -1) setNewNumbers();\n \n }", "public void actionPerformed (ActionEvent ae){\n \n //displays the digit pressed and sets value needed to modify operand\n if (ae.getActionCommand().equals(\"1\")){\n addDigit(1);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"2\")){\n addDigit(2);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"3\")){\n addDigit(3);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"4\")){\n addDigit(4);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"5\")){\n addDigit(5);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"6\")){\n addDigit(6);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"7\")){\n addDigit(7);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"8\")){\n addDigit(8);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"9\")){\n addDigit(9);\n clearFlag = false;\n }\n else if (ae.getActionCommand().equals(\"0\")){\n addDigit(0);\n clearFlag = false;\n }\n \n //Handles if the user selects an operation:\n //Set the right operand to be modified next, selects operation,\n //sets display to be cleared, adds a tooltip to the display\n if (ae.getActionCommand().equals(\"+\")){\n isLeft = false;\n operation = 0;\n clearFlag = true;\n output.setToolTipText(left + \" +\");\n }\n else if (ae.getActionCommand().equals(\"-\")){\n isLeft = false;\n operation = 1;\n clearFlag = true;\n output.setToolTipText(left + \" -\");\n }\n else if (ae.getActionCommand().equals(\"*\")){\n isLeft = false;\n operation = 2;\n clearFlag = true;\n output.setToolTipText(left + \" *\");\n }\n else if (ae.getActionCommand().equals(\"/\")){\n isLeft = false;\n operation = 3;\n clearFlag = true;\n output.setToolTipText(left + \" /\");\n }\n \n //When \"C\" is pressed the display is cleared and operands are set to zero\n if (ae.getActionCommand().equals(\"C\")){\n //Checks if the control key is pressed and cycles through displays\n if ((ae.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK){\n count ++;\n switch (count % 3){\n case 1:\n dispContents = output.getText();\n output.setText(\"(c) 2011 Alex Mendez\"); break;\n case 2:\n output.setText(\"version 0.1\"); break;\n case 0:\n output.setText(dispContents);\n dispContents = \"\"; break;\n }\n }\n else{\n left = 0;\n right = 0;\n isLeft = true;\n operation = 99;\n clearFlag = true;\n output.setText(\"0\");\n }\n }\n \n //Calls \"Calculate\" method if \"=\" key is pressed, prepares calculator for another operation\n if (ae.getActionCommand().equals(\"=\")){\n left = calculate(left, right, operation);\n right = 0;\n isLeft = false;\n operation = 99;\n output.setText(\"\" + left);\n output.setToolTipText(\"\" + left);\n }\n }", "private void initialize() {\n\t\tframe = new JFrame(\"Simple Calculator By Sakib\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setResizable(false);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"cal.png\")));\n\t\ttextField = new JTextField();\n\t\ttextField.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\ttextField.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\ttextField.setBounds(0, 0, 444, 65);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t\tfinal JButton btn7 = new JButton(\"7\");\n\t\tbtn7.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn7.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\ttextField.setText(btn7.getText()) ;\t\n\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn7.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn7.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn7.setBounds(0, 64, 115, 50);\n\t\tframe.getContentPane().add(btn7);\n\t\t\n\t\tfinal JButton btn8 = new JButton(\"8\");\n\t\tbtn8.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn8.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn8.getText()) ;\t\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn8.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn8.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn8.setBounds(113, 64, 115, 50);\n\t\tframe.getContentPane().add(btn8);\n\t\tfinal JButton btn9 = new JButton(\"9\");\n\t\tbtn9.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn9.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn9.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn9.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn9.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn9.setBounds(227, 64, 104, 50);\n\t\tframe.getContentPane().add(btn9);\n\t\t\n\t\tfinal JButton btnP = new JButton(\"+\");\n\t\tbtnP.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(textField.getText().length()==0)\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\telse {\n\t\t\t\tfirstnum=Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tOperation=\"+\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tbtnP.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnP.setBounds(330, 64, 114, 50);\n\t\tframe.getContentPane().add(btnP);\n\t\t//\n\t\tfinal JButton btn4 = new JButton(\"4\");\n\t\tbtn4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn4.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn4.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn4.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn4.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn4.setBounds(0, 110, 115, 50);\n\t\tframe.getContentPane().add(btn4);\n\t\t\n\t\tfinal JButton btn5 = new JButton(\"5\");\n\t\tbtn5.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn5.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn5.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn5.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn5.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn5.setBounds(113, 110, 115, 50);\n\t\tframe.getContentPane().add(btn5);\n\t\tfinal JButton btn6 = new JButton(\"6\");\n\t\tbtn6.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn6.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn6.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn6.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn6.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn6.setBounds(227, 110, 104, 50);\n\t\tframe.getContentPane().add(btn6);\n\t\t\n\t\tfinal JButton btnS = new JButton(\"-\");\n\t\tbtnS.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(textField.getText().length()==0)\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\telse {\n\t\t\t\tfirstnum=Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tOperation=\"-\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnS.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnS.setBounds(330, 110, 114, 50);\n\t\tframe.getContentPane().add(btnS);\n\t\t//\n\t\tfinal JButton btn1 = new JButton(\"1\");\n\t\tbtn1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn1.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn1.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn1.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn1.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn1.setBounds(0, 158, 115, 50);\n\t\tframe.getContentPane().add(btn1);\n\t\t\n\t\tfinal JButton btn2 = new JButton(\"2\");\n\t\tbtn2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn2.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn2.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn2.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn2.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn2.setBounds(113, 158, 115, 50);\n\t\tframe.getContentPane().add(btn2);\n\t\tfinal JButton btn3 = new JButton(\"3\");\n\t\tbtn3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn3.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn3.getText()) ;\t\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn3.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn3.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn3.setBounds(227, 158, 104, 50);\n\t\tframe.getContentPane().add(btn3);\n\t\t\n\t\tfinal JButton btnM = new JButton(\"*\");\n\t\tbtnM.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(textField.getText().length()==0)\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\telse {\n\t\t\t\tfirstnum=Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tOperation=\"*\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnM.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnM.setBounds(330, 158, 114, 50);\n\t\tframe.getContentPane().add(btnM);\n\t\t//\n\t\tfinal JButton btn0 = new JButton(\"0\");\n\t\tbtn0.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(Flag==false)\n\t\t\t\t{\n\t\t\t\t\ttextField.setText(btn0.getText() );\n\t\t\t\t\tFlag=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString G=textField.getText();\n\t\t\t\t\tif(G.equals(\"0\"))\n\t\t\t\t\t\ttextField.setText(btn0.getText()) ;\t\n\t\t\t\t\telse {\n\t\t\t\tString Number=textField.getText()+ btn0.getText();\n\t\t\t\ttextField.setText(Number );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtn0.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtn0.setBounds(0, 206, 115, 66);\n\t\tframe.getContentPane().add(btn0);\n\t\t\n\t\tfinal JButton btnC = new JButton(\"C\");\n\t\tbtnC.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\ttextField.setText(\"\");\n\t\t\t}\n\t\t});\n\t\tbtnC.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnC.setBounds(113, 206, 115, 66);\n\t\tframe.getContentPane().add(btnC);\n\t\tJButton btnE = new JButton(\"=\");\n\t\tbtnE.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(textField.getText().length()==0) {\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\tsecondnum=Double.parseDouble(textField.getText());\n\t\t\t\tif(Operation==\"+\")\n\t\t\t\t{\n\t\t\t\t\tint Result=(int) (firstnum+secondnum);\n\t\t\t\t\tAnswer=Integer.toString(Result);\n\t\t\t\t\ttextField.setText(Answer);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(Operation==\"-\")\n\t\t\t\t{\n\t\t\t\t\tint Result=(int) (firstnum-secondnum);\n\t\t\t\t\tAnswer=Integer.toString(Result);\n\t\t\t\t\ttextField.setText(Answer);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(Operation==\"*\")\n\t\t\t\t{\n\t\t\t\t\tint Result=(int) (firstnum*secondnum);\n\t\t\t\t\tAnswer=Integer.toString(Result);\n\t\t\t\t\ttextField.setText(Answer);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(Operation==\"/\")\n\t\t\t\t{\n\t\t\t\t\tresult=firstnum/secondnum;\n\t\t\t\t\tAnswer=Double.toString(result);\n\t\t\t\t\ttextField.setText(Answer);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tFlag=false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnE.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnE.setBounds(227, 206, 104, 66);\n\t\tframe.getContentPane().add(btnE);\n\t\t\n\t\tfinal JButton btnD = new JButton(\"/\");\n\t\tbtnD.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(textField.getText().length()==0)\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\telse {\n\t\t\t\tfirstnum=Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tOperation=\"/\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnD.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\n\t\tbtnD.setBounds(330, 206, 114, 66);\n\t\tframe.getContentPane().add(btnD);\n\t}", "GmMacro createGmMacro(String uri) throws IOException, SAXException, ParserConfigurationException;", "public static void main(String[] args) {\n ArithmeticExpression calculation =\n new Operand(\n new Operand(new Number(4), Operation.PLUS, new Number(6)),\n Operation.MULTIPLICATION,\n new Operand(new Number(1), Operation.DIVISION, new Number(2)));\n\n System.out.println(calculation.toString() + \" = \" + calculation.calculate());\n }", "public MacroTotals getMacroTotals() {\n return macroTotals;\n }", "public interface Calculator {\n public int exec(int a, int b);\n}", "Editor mo117962b();", "@Override\r\n\tpublic CalculatorRS getCalculator(CalculatorRQ calculatorRQ) {\n\t\t\r\n\t\tint num_1=calculatorRQ.getValue_1();\r\n\t\tint num_2=calculatorRQ.getValue_2();\r\n\t\t\r\n\t\t\t\t\r\n\t\tCalculatorRS calculatorRS=new CalculatorRS(num_1+num_2,num_1-num_2,num_1*num_2);\r\n\t\treturn calculatorRS;\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Calculator().setVisible(true);\n }\n } \n );\n}", "public static void main(String[] args) {\n CalculatorServiceImplementation someService = new CalculatorServiceImplementation();\n\n Calculator myCalculator = new Calculator(someService);\n\n System.out.println(myCalculator.add(8, 7));\n System.out.println(myCalculator.subtract(8, 7));\n System.out.println(myCalculator.multiply(8, 7));\n\n }", "public static void main(String[] args) {\n int num1 = 5;\r\n int num2 = 10;\r\n NumOperation opr1 = new NumOperation();\r\n NumOperation opr2 = new NumOperation2();\r\n System.out.println(\"Addition of 5 and 10 is : \" + opr1.numCalc(num1, num2));\r\n System.out.println(\"Multiplication of 5 and 10 is : \" + opr2.numCalc(num1, num2));\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString cadena = JOptionPane.showInputDialog(null, \"Escriba un numero para la operacion, \\n\"\n\t\t\t\t+ \"1: Sumar \\n\"\n\t\t\t\t+ \"2: Restar \\n\"\n\t\t\t\t+ \"3: Multiplciar \\n\"\n\t\t\t\t+ \"4: Dividir\");\n\t\tint resp = Integer.parseInt(cadena);\n\t\tCalculadoraImplService servicio = new CalculadoraImplService();\n\t\tCalculadoraImpl calImpl = servicio.getCalculadoraImplPort();\n\t\tJOptionPane.showMessageDialog(null, \"Su respuesta es: \" + calImpl.calcular(resp, 15, 10));\n\t}", "private static int evaluateExpression(String expression, int number1, int number2){\n if(expression.equals(\"plus\")){\n \treturn (number1 + number2);\n }else if(expression.equals(\"minus\")){\n \treturn (number1 - number2);\n }else if(expression.equals(\"times\")){\n \treturn(number1 * number2);\n }else if(expression.equals(\"divide\")){\n \treturn(number1 / number2);\n }\n return 0;\n \n }", "public void operation() {\n\t\t\n\t\tswitch(calculation){\n\t\t\tcase 1:\n\t\t\t\ttotal = num + Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(Double.toString(total));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\ttotal = num - Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(Double.toString(total));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\ttotal = num * Double.parseDouble(textField.getText());\n\t\t\t\ttextField.setText(Double.toString(total));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\ttotal = num / (Double.parseDouble(textField.getText()));\n\t\t\t\ttextField.setText(Double.toString(total));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t}", "public static void callDefinitionOf (String mname,List<MDTrecord> MDT,String[] arguments ,List<ALArecord> ALA) {\n\t\t\n\t\tboolean macroStartFlag = false;\n\n\t\tfor(MDTrecord m : MDT)\n\t\t{\n\n\t\t\n\t\t\tif(m.instruction.startsWith(mname))\n\t\t\t{\t\n\t\t\t\tmacroStartFlag=true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!m.instruction.equals(\"MEND\") && macroStartFlag==true)\n\t\t\t{\n\t\t\t\t//System.out.println(\"adding instr: \"+m.instruction);\n\t\t\t\tString instr = new String();\n\t\t\t\tfor(int j=0 ; j<arguments.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif(m.instruction.contains(\"&ARG\"+(j+1)))\n\t\t\t\t\t{\n//\t\t\t\t\t\tSystem.out.println(\"Replacing &ARG\"+(j+1)+\" by \"+arguments[j]);\n\t\t\t\t\t\tALArecord temp = ALArecord.getRecord(ALA, \"&ARG\"+( j+1 ), mname);\n\t\t\t\t\t\tint indexOfRecord = ALA.indexOf(temp);\n\t\t\t\t\t\tALA.set(indexOfRecord , new ALArecord(temp.index, temp.dummy, arguments[j], temp.macro));\n\t\t\t\t\t\tinstr=m.instruction.replace(\"&ARG\"+(j+1), arguments[j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\toutputProgram.add(instr);\n\t\t\t}\n\t\t\tif(m.instruction.equals(\"MEND\") && m.index+1<=MDT.size())\n\t\t\t{\n\t\t\t\tmacroStartFlag=false;\n\n\t\t\t}\n\n\n\t\t}\n\t}", "void mo67924c();", "public static void main(String[] args) {\n\t\t\r\n\t\tExForMath mathobj = new ExForMath();\r\n\t\t\r\n\t\tScanner userinput=new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Welcome to Java Calculator\");\r\n\t\tSystem.out.println(\"==========================\");\r\n\t\tSystem.out.println(\"Enter first number:\");\r\n\t\t\r\n\t\tint num1=userinput.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"Enter second number:\");\r\n\t\t\r\n\t\tint num2=userinput.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the operation that you want to use(+,-,x,/):\");\r\n\t\t\r\n\t\tString operation = userinput.next();\r\n\t\t\r\n\t\tif (operation.equals(\"+\"))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The answer is \" +mathobj.add(num1, num2));\r\n\t\t}\t\r\n\t\t\r\n\t\tif (operation.equals(\"-\"))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The answer is \" +mathobj.subtract(num1, num2));\r\n\t\t}\r\n\t\t\r\n\t\tif (operation.equals(\"x\"))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The answer is \" +mathobj.multiply(num1, num2));\r\n\t\t}\r\n\t\t\r\n\t\tif (operation.equals(\"/\"))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The answer is \" +mathobj.divide(num1, num2));\r\n\t\t}\r\n\r\n\t}", "public void setMacroTotals(MacroTotals macroTotals) {\n this.macroTotals = macroTotals;\n }", "public static void main (String args[]) {\r\n\t\t\r\n\t\tCalculator calc = new Calculator();\r\n\t\tcalc.add();\r\n\t\tcalc.div();\r\n\t\tcalc.mul();\r\n\t\tcalc.sub();\r\n\t\t\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Testing Calculator\");\r\n\t\ttestConstructors();\r\n\t\ttestSetters();\r\n\t\ttestGetters();\r\n\t\ttestToString();\r\n\t}", "public double computeMacroRecall(){\n\t\tdouble res = 0;\n\t\t//iterate all labels to compute their individual recall values\n\t\tfor(Label l : labels){\n\t\t\tres += this.computeRecall(l);\n\t\t}\n\n\t\t//take the average\n\t\tres = res/((double)labels.size());\n\t\treturn res;\n\n\t}", "GmMacro createGmMacro(Reader reader) throws IOException, SAXException, ParserConfigurationException;", "private Formulas() { }", "public static void main(String[] args) {\n\t Scanner s = new Scanner(System.in);\n \tSystem.out.println(\"Welcome to the Frac Calc Calculator\");\n \tSystem.out.print(\"Enter an expression: \");\n \tString expression = s.nextLine();\n \twhile(!expression.equalsIgnoreCase(\"quit\")) {\n \tSystem.out.println(produceAnswer(expression));\n \tSystem.out.print(\"Enter an expression: \");\n \texpression = s.nextLine();\n \t}\n\n }", "public calculator() {\n JFrame frame = new JFrame(\"Calculator\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n JPanel buttons = new JPanel(new GridLayout(4, 4));\n \n JPanel display = new JPanel();\n //numField.setEnabled(false);\n display.add(numField);\n numField.setHorizontalAlignment(JTextField.RIGHT);\n numField.setFont(new Font(\"Roboto\", Font.PLAIN, 24));\n \n buttonSetup();\n\n // Adds each button into the panel\n for(JButton i:buttonOrder)\n buttons.add(i);\n \n // Adds each component into the frame\n frame.add(buttons, BorderLayout.SOUTH);\n frame.add(display, BorderLayout.NORTH);\n frame.pack();\n \n frame.setSize(300, 180);\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }", "private void makeFrame() {\n\t\tframe = new JFrame(calc.getTitle());\n\n\t\tJPanel contentPane = (JPanel) frame.getContentPane();\n\t\tcontentPane.setLayout(new BorderLayout(8, 8));\n\t\tcontentPane.setBorder(new EmptyBorder(10, 10, 10, 10));\n\n\t\tdisplay = new JTextField();\n\t\tdisplay.setEditable(false);\n\t\tcontentPane.add(display, BorderLayout.NORTH);\n\n\t\tJPanel buttonPanel = new JPanel(new GridLayout(6, 5));\n\n\t\taddButton(buttonPanel, \"A\");\n\t\taddButton(buttonPanel, \"B\");\n\t\taddButton(buttonPanel, \"C\");\n\t\tbuttonPanel.add(new JLabel(\" \"));\n\t\tJCheckBox check = new JCheckBox(\"HEX\");\n\t\tcheck.addActionListener(this);\n\t\tbuttonPanel.add(check);\n\n\t\taddButton(buttonPanel, \"D\");\n\t\taddButton(buttonPanel, \"E\");\n\t\taddButton(buttonPanel, \"F\");\n\t\taddButton(buttonPanel, \"(\");\n\t\taddButton(buttonPanel, \")\");\n\n\t\taddButton(buttonPanel, \"7\");\n\t\taddButton(buttonPanel, \"8\");\n\t\taddButton(buttonPanel, \"9\");\n\t\taddButton(buttonPanel, \"AC\");\n\t\taddButton(buttonPanel, \"^\");\n\n\t\taddButton(buttonPanel, \"4\");\n\t\taddButton(buttonPanel, \"5\");\n\t\taddButton(buttonPanel, \"6\");\n\t\taddButton(buttonPanel, \"*\");\n\t\taddButton(buttonPanel, \"/\");\n\n\t\taddButton(buttonPanel, \"1\");\n\t\taddButton(buttonPanel, \"2\");\n\t\taddButton(buttonPanel, \"3\");\n\t\taddButton(buttonPanel, \"+\");\n\t\taddButton(buttonPanel, \"-\");\n\n\t\tbuttonPanel.add(new JLabel(\" \"));\n\t\taddButton(buttonPanel, \"0\");\n\t\tbuttonPanel.add(new JLabel(\" \"));\n\t\taddButton(buttonPanel, \"=\");\n\n\t\tcontentPane.add(buttonPanel, BorderLayout.CENTER);\n\n\t\tframe.pack();\n\t\thexToggle();\n\n\t}", "public Macro(Object name) {\n super(name);\n }", "private void excelmeth() {\nSystem.out.println(\"my new test method\");\n}", "@Override\n public void actionPerformed(AnActionEvent e) {\n CommandRun cmr = new CommandRun();\n Project currentProject = e.getProject();\n// strProjectPath = currentProject.getBasePath();\n// String[] arrCheckOuts = cmr.ListCheckOuts();\n AddinUI aui = new AddinUI();\n aui.createUI();\n }", "calculatorEngine() {//!\n\t\tdata = new Stack<Integer>();//!\n\t}", "public void doAction()\n {\n if (app.getBuilderEditorPanel().getBoardViewPanel().getBoard().willPopulate())\n {\n app.getBuilderEditorPanel().getBoardViewPanel().getBoard().setPopulate(false);\n app.getBuilderEditorPanel().getBoardViewPanel().getBoard().resetBoard();\n app.getBuilderEditorPanel().getBoardViewPanel().refresh();\n }\n String levelType = app.getBuilderEditorPanel().getLevelTypeSelector().getSelectedItem().toString();\n int timeLimit = 0;\n if (!app.getBuilderEditorPanel().getTimeLimitSelector().getText().equals(\"\"))\n {\n timeLimit = Integer.parseInt(app.getBuilderEditorPanel().getTimeLimitSelector().getText());\n }\n int moveLimit = 0;\n if (!app.getBuilderEditorPanel().getMoveLimitSelector().getText().equals(\"\"))\n {\n moveLimit = Integer.parseInt(app.getBuilderEditorPanel().getMoveLimitSelector().getText());\n }\n boolean specialMoves = app.getBuilderEditorPanel().getSpecialMovesAllowedSelector().isSelected();\n int threeStar = Integer.parseInt(app.getBuilderEditorPanel().getThreeStarSelector().getText());\n int twoStar = Integer.parseInt(app.getBuilderEditorPanel().getTwoStarSelector().getText());\n int freq1 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"1\");\n int freq2 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"2\");\n int freq3 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"3\");\n int freq4 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"4\");\n int freq5 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"5\");\n int freq6 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"6\");\n int freqx1 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"x1\");\n int freqx2 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"x2\");\n int freqx3 = app.getBuilderEditorPanel().getOptionsPanel().getFrequencies().get(\"x3\");\n SquareFactory sf1 = new SquareFactory(freq1, freq2, freq3, freq4, freq5, freq6, freqx1, freqx2, freqx3);\n if (app.getBuilderEditorPanel().getCurrentLevel() != null)\n {\n if (levelType.equals(app.getBuilderEditorPanel().getCurrentLevel().getType()))\n {\n Board board = app.getBuilderEditorPanel().getBoardViewPanel().getBoard();\n board.setSquareFactory(new SquareFactory(freq1, freq2, freq3, freq4, freq5,\n freq6, freqx1, freqx2, freqx3));\n String bd = board.getBoardData();\n app.getBuilderEditorPanel().getCurrentLevel().setBoardData(bd);\n app.getBuilderEditorPanel().getCurrentLevel().saveLevel();\n } else {\n Board board = app.getBuilderEditorPanel().getBoardViewPanel().getBoard();\n board.setSquareFactory(new SquareFactory(freq1, freq2, freq3, freq4, freq5,\n freq6, freqx1, freqx2, freqx3));\n String bd = board.getBoardData();\n Level oldLevel = app.getBuilderEditorPanel().getCurrentLevel();\n int idx = game.getLevels().indexOf(oldLevel);\n if (levelType.equals(\"Release\"))\n {\n ReleaseLevel nl = new ReleaseLevel(oldLevel.getBasicLevel());\n game.replaceLevel(nl, idx);\n } else if (levelType.equals(\"Lightning\"))\n {\n LightningLevel nl = new LightningLevel(oldLevel.getBasicLevel());\n nl.setTimeLimit(timeLimit);\n game.replaceLevel(nl, idx);\n } else if (levelType.equals(\"Elimination\"))\n {\n EliminationLevel nl = new EliminationLevel(oldLevel.getBasicLevel());\n game.replaceLevel(nl, idx);\n } else if (levelType.equals(\"Puzzle\"))\n {\n PuzzleLevel nl = new PuzzleLevel(oldLevel.getBasicLevel());\n nl.setMoveLimit(moveLimit);\n game.replaceLevel(nl, idx);\n }\n app.getBuilderEditorPanel().setCurrentLevel(game.getLevels().get(idx));\n app.getBuilderEditorPanel().getCurrentLevel().setBoardData(bd);\n app.getBuilderEditorPanel().getCurrentLevel().saveLevel();\n }\n } else\n {\n Level l = null;\n File outFile = null;\n try\n {\n outFile = new File(getClass().getClassLoader().getResource(\"levels\").toURI().getPath(),\n \"level\" + (game.getLevels().size() + 1) + \".txt\");\n } catch (URISyntaxException e)\n {\n e.printStackTrace();\n }\n\n SquareFactory sf = new SquareFactory(freq1, freq2, freq3, freq4, freq5, freq6, freqx1, freqx2, freqx3);\n app.getBuilderEditorPanel().getBoardViewPanel().getBoard().setSquareFactory(sf);\n\n if (levelType.equals(\"Puzzle\"))\n {\n l = new PuzzleLevel(\"NewLevel\", game.getLevels().size() + 1, 0, twoStar,\n threeStar, \"\", true, moveLimit, specialMoves, outFile);\n } else if (levelType.equals(\"Elimination\"))\n {\n l = new EliminationLevel(\"NewLevel\", game.getLevels().size() + 1, 0, twoStar,\n threeStar, \"\", true, specialMoves, outFile);\n } else if (levelType.equals(\"Lightning\"))\n {\n l = new LightningLevel(\"NewLevel\", game.getLevels().size() + 1, 0, twoStar,\n threeStar, \"\", true, timeLimit, specialMoves, outFile);\n } else if (levelType.equals(\"Release\"))\n {\n l = new ReleaseLevel(\"NewLevel\", game.getLevels().size() + 1, 0, twoStar,\n threeStar, \"\", true, specialMoves, outFile);\n }\n app.getBuilderEditorPanel().getBoardViewPanel().getBoard().setLevel(l);\n assert l != null;\n l.setBoardData(app.getBuilderEditorPanel().getBoardViewPanel().getBoard().getBoardData());\n l.saveLevel();\n }\n game.reloadFromDisk();\n app.getBuilderLevelSelectPanel().updateLevelList(game);\n }", "public void calculate();", "public void mpgCalculations() {\n\n }", "private Calculator() {\n }", "private void subOperands() {\n\n\t\tif (text_Operand3.getText().isEmpty()) {\n\t\t\ttext_Operand3.setText(\"5\");\n\t\t}\n\t\tif (text_Operand4.getText().isEmpty()) {\n\t\t\ttext_Operand4.setText(\"5\");\n\t\t}\n\n\t\t/*\n\t\t * It will pass the value to the bussiness logic so trhat the further logics can\n\t\t * be performed on them.\n\t\t */\n\n\t\tif (conversionIsRequired(comboBox1.getSelectionModel().getSelectedItem(),\n\t\t\t\tcomboBox2.getSelectionModel().getSelectedItem())) {\n\t\t\tdouble op1 = Double.parseDouble(text_Operand1.getText());\n\t\t\tdouble op1et = Double.parseDouble(text_Operand3.getText());\n\t\t\tperform.setOperand1(String.valueOf(op1 * theFactor));\n\t\t\tperform.setOperand3(String.valueOf(op1et * theFactor));\n\t\t} else {\n\t\t\tAlert a = new Alert(AlertType.WARNING);\n\t\t\ta.setContentText(\"Subtraction Not Possible\");\n\t\t\ta.show();\n\t\t\treturn;\n\t\t}\n\t\tcomboBoxRes.getSelectionModel().select(comboBox2.getSelectionModel().getSelectedItem());\n\t\t// Check to see if both operands are defined and valid\n\t\tif (binaryOperandIssues()) // If there are issues with the operands, return\n\t\t\treturn; // without doing the computation\n\n\t\t// If the operands are defined and valid, request the business logic method to\n\t\t// do the Subtraction and return the\n\t\t// result as a String. If there is a problem with the actual computation, an\n\t\t// empty string is returned\n\t\tString theAnswer = perform.subtraction(); // Call the business logic Subtract method\n\t\tlabel_errResult.setText(\"\"); // Reset any result error messages from before\n\t\tString theAnswer1 = perform.subtraction1(); // Call the business logic Subtract method\n\t\tlabel_errResulterr.setText(\"\"); // Reset any result error messages from before\n\t\tif (theAnswer.length() > 0 || theAnswer1.length() > 0) { // Check the returned String to see if it is okay\n\t\t\ttext_Result.setText(theAnswer); // If okay, display it in the result field and\n\t\t\tlabel_Result.setText(\"Difference\"); // change the title of the field to \"Subtraction\".\n\t\t\ttext_Resulterr.setText(theAnswer1); // If okay, display it in the result field\n\t\t\tlabel_Result.setLayoutX(60);\n\t\t\tlabel_Result.setLayoutY(345);\n\t\t} else { // Some error occurred while doing the Subtraction.\n\t\t\ttext_Result.setText(\"\"); // Do not display a result if there is an error.\n\t\t\tlabel_Result.setText(\"Result\"); // Reset the result label if there is an error.\n\t\t\tlabel_errResult.setText(perform.getResultErrorMessage()); // Display the error message.\n\t\t\ttext_Resulterr.setText(\"\"); // Do not display a result if there is an error.\n\t\t\tlabel_errResulterr.setText(perform.getResulterrErrorMessage()); // Display the error message.\n\t\t}\n\n\t}", "public interface ICalculator\n{\n\tvoid setAction(IAction act);\n\n\tString calc(String[] args);\n}", "public Calculator () {\n\t\ttotal = 0; // not needed - included for clarity\n\t\thistory = \"0\";\n\t}", "private void runRefactoring() {\r\n Refactoring refactoring = createRefactoring();\r\n\r\n // Update the code\r\n try {\r\n refactoring.run();\r\n } catch (RefactoringException re) {\r\n JOptionPane.showMessageDialog(null, re.getMessage(), \"Refactoring Exception\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n\r\n updateSummaries();\r\n\r\n // Update the GUIs\r\n ReloaderSingleton.reload();\r\n }" ]
[ "0.57548714", "0.5706897", "0.57008946", "0.54669744", "0.54377526", "0.5437612", "0.5408059", "0.54049337", "0.5350542", "0.53412616", "0.53128636", "0.53028005", "0.527461", "0.5272885", "0.5268018", "0.5251125", "0.5242489", "0.51978475", "0.5191553", "0.5189697", "0.51331586", "0.5125409", "0.51234", "0.51182324", "0.51141036", "0.5112001", "0.511198", "0.511133", "0.5108195", "0.510394", "0.50952834", "0.508421", "0.5082829", "0.5068592", "0.50660086", "0.506539", "0.50625193", "0.5057023", "0.50461024", "0.50344664", "0.50318706", "0.50298786", "0.5029258", "0.5016368", "0.5013974", "0.5012311", "0.5000909", "0.4999183", "0.49911693", "0.49715042", "0.4967882", "0.49604705", "0.4941336", "0.49200067", "0.4917508", "0.4898276", "0.4887737", "0.48869276", "0.48815462", "0.48728845", "0.48728406", "0.4868288", "0.486423", "0.48631757", "0.48618916", "0.48605824", "0.48590162", "0.485598", "0.48540416", "0.4852652", "0.48483235", "0.48431528", "0.48350462", "0.48332256", "0.4828462", "0.4823031", "0.48217264", "0.48165596", "0.48157787", "0.4811646", "0.48113856", "0.48108912", "0.4810327", "0.48103172", "0.4809244", "0.48084646", "0.48064724", "0.4804272", "0.47983477", "0.47962916", "0.47932062", "0.4792453", "0.4791317", "0.47893268", "0.47820175", "0.47819406", "0.47815055", "0.47771603", "0.4775359", "0.4771617" ]
0.60982215
0
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //app入口,可以修改来测试自己的activity startActivity(new Intent(getApplicationContext(), LoginAty.class)); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "protected void onCreate() {\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "protected void onFirstTimeLaunched() {\n }", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }", "@Override\n public void onCreate() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}", "@Override\n public void onCreate() {\n\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "public void onCreate() {\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}", "@Override\n\tpublic void onCreate() {\n\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }", "@Override\n public void onCreate()\n {\n\n\n }", "@Override\n\tprotected void onCreate() {\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}", "public void onCreate();", "public void onCreate();", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }", "@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}", "@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }", "@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}", "@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }" ]
[ "0.791686", "0.77270156", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7637394", "0.7637394", "0.7629958", "0.76189965", "0.76189965", "0.7543775", "0.7540053", "0.7540053", "0.7539505", "0.75269467", "0.75147736", "0.7509639", "0.7500879", "0.74805456", "0.7475343", "0.7469598", "0.7469598", "0.7455178", "0.743656", "0.74256307", "0.7422192", "0.73934627", "0.7370002", "0.73569906", "0.73569906", "0.7353011", "0.7347353", "0.7347353", "0.7333878", "0.7311508", "0.72663945", "0.72612154", "0.7252271", "0.72419256", "0.72131634", "0.71865886", "0.718271", "0.71728176", "0.7168954", "0.7166841", "0.71481615", "0.7141478", "0.7132933", "0.71174103", "0.7097966", "0.70979583", "0.7093163", "0.7093163", "0.7085773", "0.7075851", "0.7073558", "0.70698684", "0.7049258", "0.704046", "0.70370424", "0.7013127", "0.7005552", "0.7004414", "0.7004136", "0.69996923", "0.6995201", "0.69904065", "0.6988358", "0.69834954", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69783133", "0.6977392", "0.69668365", "0.69660246", "0.69651115", "0.6962911", "0.696241", "0.6961096", "0.69608897", "0.6947069", "0.6940148", "0.69358927", "0.6933102", "0.6927288", "0.69265485", "0.69247025" ]
0.0
-1
we have n^2 possible substring in String s
public int countSubstrings(String s) { int l = s.length(); cache = new int[l][l]; for (int[] is : cache) { Arrays.fill(is, -1); } for (int i = 0; i < l; i++) { cache[i][i] = 1; } for (int i = 0; i < l; i++) { for (int j = i + 1; j < l; j++) { char c1, c2; c1 = s.charAt(i); c2 = s.charAt(j); if (c1 == c2) { if (j == i + 1 && cache[i][j] == -1) { cache[i][j] = 1; } else if (cache[i][j] == -1) { cache[i][j] = solve(s, i + 1, j - 1); } } else { cache[i][j] = 0; } } } int total = 0; for (int[] is : cache) { for (int i : is) { if (i > 0) { total += i; } } } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static long repeatedString(String s, long n) {\n char[] arr=s.toCharArray();\n int i,count=0,cnt=0;\n for(i=0;i<arr.length;i++){\n if(arr[i]=='a'){\n count++;\n }\n }\n long len=(n/arr.length)*count;\n long extra=n%arr.length;\n if(extra==0){\n return len;\n }else{\n for(i=0;i<extra;i++){\n if(arr[i]=='a'){\n cnt++;\n }\n }\n return len+cnt;\n }\n\n\n }", "public static void SubString(String str, int n)\r\n {\r\n\t\tint count = 0;\r\n\t\tStringBuilder sb = new StringBuilder();\r\n for (int i = 0; i < n; i++) { \r\n for (int j = i+1; j <= n; j++) {\r\n \t String subs = str.substring(i, j);\r\n \t \r\n \t if((Integer.valueOf(subs)) <= 26) {\r\n \t\t System.out.println(subs);\r\n \t\t sb.append(subs);\r\n \t\t \r\n \t }\r\n }\r\n }\r\n \r\n for(int i = 0; i < sb.length() - 2; i++) {\r\n \t for(int j = i + 1; j < sb.length() - 1; j++) {\r\n \t\t for(int k = j + 1; k < sb.length(); k++) {\r\n \t\t\t StringBuilder temp = new StringBuilder();\r\n \t\t\t temp.append(sb.charAt(i));\r\n \t\t\t temp.append(sb.charAt(j));\r\n \t\t\t temp.append(sb.charAt(k));\r\n \t\t\t //System.out.println(temp.toString());\r\n \t\t\t if(temp.toString().equals(str)) { // !!! have to use equals!!!!\r\n \t\t\t\t count++;\r\n \t\t\t }\r\n \t\t }\r\n \t } \r\n \t}\r\n System.out.println(\"count \" + count);\r\n }", "static long repeatedString(String s, long n) {\n \t\n \tchar first;\n \tfirst = s.charAt(0);\n \t\n \tint count = 0;\n \tlong[] fill = new long[n];\n \t\n \tfor(int i=1; i<n; i++) {\n \t\tif(first == s.charAt(i)) count++;\n \t}\n \t\n \tlong result = ((n / s.length()) * count) + (n % s.length());\n \treturn result;\n\n }", "static long repeatedString(String s, long n) {\n if (s.contains(\"a\")) {\n StringBuilder stringBuilder = new StringBuilder(s);\n String infiniteString = \"\";\n if (stringBuilder.length() < n) {\n //repeat String if length is less than n\n infiniteString = infiniteString(s, n);\n }\n int count = 0;\n char[] stringArray = infiniteString.toCharArray();\n for (int i = 0; i < n; i++) {\n\n char a = 'a';\n if (stringArray[i] == a) {\n count++;\n }\n }\n return count;\n } else {\n return 0;\n }\n }", "static String findSubString(String str) \n { \n int n = str.length(); \n \n // Count all distinct characters. \n int dist_count = 0; \n \n boolean[] visited = new boolean[MAX_CHARS]; \n Arrays.fill(visited, false); \n for (int i=0; i<n; i++) \n { \n if (visited[str.charAt(i)] == false) \n { \n visited[str.charAt(i)] = true; \n dist_count++; \n } \n } \n \n // We basically maintain a window of characters that contains all characters of given string. \n int start = 0, start_index = -1; \n int min_len = Integer.MAX_VALUE; \n \n int count = 0; \n int[] curr_count = new int[MAX_CHARS]; \n for (int j=0; j<n; j++) \n { \n // Count occurrence of characters of string \n curr_count[str.charAt(j)]++; \n \n // If any distinct character matched, then increment count \n if (curr_count[str.charAt(j)] == 1 ) \n count++; \n \n // if all the characters are matched \n if (count == dist_count) \n { \n // Try to minimize the window i.e., check if \n // any character is occurring more no. of times \n // than its occurrence in pattern, if yes \n // then remove it from starting and also remove \n // the useless characters. \n while (curr_count[str.charAt(start)] > 1) \n { \n if (curr_count[str.charAt(start)] > 1) \n curr_count[str.charAt(start)]--; \n start++; \n } \n \n // Update window size \n int len_window = j - start + 1; \n if (min_len > len_window) \n { \n min_len = len_window; \n start_index = start; \n } \n } \n } \n // Return substring starting from start_index \n // and length min_len \n return str.substring(start_index, start_index+min_len); \n }", "static long repeatedString(String s, long n) {\n\n char[] str = s.toCharArray();\n\n String temp = \"\";\n\n int i=0;\n long count=0;\n\n while(i<str.length){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n long occurance = n/str.length;\n long remainder = n%str.length;\n count = count*occurance;\n\n i=0;\n while(i<remainder){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n return count;\n\n }", "static long repeatedString(String s, long n) {\n long l=s.length();\n long k=n/l;\n long r=n%l;\n long count=0;\n long count1=0;\n char ch[]=s.toCharArray();\n for(int t=0;t<ch.length;t++){\n if(ch[t]=='a')\n count1++;\n }\n for(int t=0;t<r;t++){\n if(ch[t]=='a')\n count++;\n }\n return k*count1+count;\n\n }", "public String findAllSubstring(String s) {\n Set<String> set = new HashSet<>();\n String res = \"\";\n int max = -1;\n\n for (int i = 0; i < s.length(); i++) {\n String cur = \"\";\n for (int j = i; j < s.length(); j++) {\n cur += s.charAt(j);\n if (set.contains(cur) && cur.length() > max) {\n res = cur;\n max = cur.length();\n } else {\n set.add(cur);\n }\n }\n }\n return res;\n }", "public abstract String getLongestRepeatedSubstring();", "static long substrCount(int n, String s) {\n \tlong output=0;\n \t\n \tboolean[][] matrix = new boolean[n][n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tmatrix[i][i] = true;\n \t\toutput++;\n \t}\n \t\n \tfor(int gap=1; gap<n; gap++) {\n \t\tfor(int i=0; i+gap <n; i++) {\n \t\t\tint j = i+gap;\n \t\t\t\n \t\t\tif(gap ==1) {\n \t\t\t\tif(s.charAt(i) == s.charAt(j)) {\n \t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t} else {\n \t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tif(s.charAt(i) == s.charAt(j) && matrix[i+1] [j-1]) {\n \t\t\t\t\t\n \t\t\t\t\tif(j-i >= 4 && s.charAt(i)== s.charAt(i+1)) {\n \t\t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t\t} else if(j-i <4) {\n \t\t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \treturn output;\n }", "public abstract void createLongestRepeatedSubstring();", "public boolean strCopies(String str, String sub, int n) {\n//Solution to problem coming soon\n}", "public int lengthOfLongestSubstringKDistinctImprvd(String s, int k) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n \n int[] map = new int[256];\n int j = 0;\n int distinctCt = 0;\n int maxLen = 0;\n\n for (int i = 0; i < s.length(); i++) {\n while (j < s.length()) {\n map[s.charAt(j)] += 1;\n if (map[s.charAt(j)] == 1) {\n distinctCt++;\n }\n j++;\n if (distinctCt > k) {\n break;\n }\n maxLen = Math.max(j- i, maxLen);\n }\n map[s.charAt(i)] -= 1;\n if (map[s.charAt(i)] == 0) {\n distinctCt--;\n }\n }\n\n return maxLen;\n}", "@Test\n public void repeatedSubstringPattern() {\n assertTrue(new Solution1().repeatedSubstringPattern(\"abcabcabcabc\"));\n }", "static long substrCount(int n, String input) {\n List<String> result = new ArrayList<>();\n if (!isEmpty(input)) {\n for (int index = 0; index <= input.length(); index++) {\n for (int i = index; i <= input.length(); i++) {\n String temp = input.substring(index, i);\n if (valid(temp)) {\n result.add(temp);\n }\n }\n }\n }\n return result.size();\n\n }", "static long repeatedString(String s, long n) {\n long a_count = 0;\n long total_a_count = 0;\n long modulo_s = 0;\n\n if(n>s.length()){\n for (int i=0; i<s.length(); i++)\n if(s.charAt(i)=='a') a_count++;\n\n total_a_count = a_count*(n/s.length());\n modulo_s = n%s.length();\n\n for (int i=0; i<modulo_s; i++)\n if(s.charAt(i)=='a') total_a_count++;\n\n return total_a_count;\n }\n\n else {\n for (int i=0; i<n; i++)\n if(s.charAt(i)=='a') a_count++;\n return a_count;\n }\n }", "private static int solution3(String s) {\r\n int n = s.length();\r\n Set<Character> set = new HashSet<>();\r\n int ans = 0, i = 0, j = 0;\r\n while (i < n && j < n) {\r\n if (!set.contains(s.charAt(j))) {\r\n set.add(s.charAt(j++));\r\n ans = Math.max(ans, j - i);\r\n } else {\r\n set.remove(s.charAt(i++));\r\n }\r\n }\r\n return ans;\r\n }", "public int countSubstrings(String s) {\n int cnt = 0;\n\n char[] str = s.toCharArray();\n\n\n for(int j=0; j<2; j++) {\n for(int i=0; i< str.length; i++) {\n int left = i;\n int right = i+j;\n\n while(left>=0 && right<str.length && str[left] == str[right]) {\n cnt++;\n left--;\n right++;\n }\n\n }\n }\n\n return cnt;\n }", "public int countSubstrings(String S) {\n int N = S.length(), ans = 0;\n for (int center = 0; center <= 2*N-1; ++center) {\n int left = center / 2;\n int right = left + center % 2;\n while (left >= 0 && right < N && S.charAt(left) == S.charAt(right)) {\n ans++;\n left--;\n right++;\n }\n }\n return ans;\n }", "public static int maxSubStringSizeKDistinctChars(String str, int k) {\n int start = 0;\n int maxLen = 0;\n int localSum = 0;\n HashMap<Character, Integer> hm = new HashMap<>();\n\n for(int end = 0; end < str.length(); end++) {\n\n localSum++;\n if (hm.containsKey(str.charAt(end))) {\n hm.put(str.charAt(end), hm.get(str.charAt(end)) + 1);\n } else {\n hm.put(str.charAt(end), 1);\n }\n\n while(hm.size() > k) {\n // maxLen = Math.max(maxLen, end - start);\n maxLen = Math.max(maxLen, localSum - 1);\n hm.put(str.charAt(start), hm.get(str.charAt(start)) - 1);\n if(hm.get(str.charAt(start)) == 0) {\n hm.remove(str.charAt(start));\n }\n start++;\n localSum--;\n }\n }\n\n return Math.max(maxLen, localSum);\n\n }", "public static void main(String [] args) {\n\t\tString str = \"ccacacabccacabaaaabbcbccbabcbbcaccabaababcbcacabcabacbbbccccabcbcabbaaaaabacbcbbbcababaabcbbaa\"\n\t\t\t\t+ \"ababababbabcaabcaacacbbaccbbabbcbbcbacbacabaaaaccacbaabccabbacabaabaaaabbccbaaaab\"\n\t\t\t\t+ \"acabcacbbabbacbcbccbbbaaabaaacaabacccaacbcccaacbbcaabcbbccbccacbbcbcaaabbaababacccbaca\"\n\t\t\t\t+ \"cbcbcbbccaacbbacbcbaaaacaccbcaaacbbcbbabaaacbaccaccbbabbcccbcbcbcbcabbccbacccbacabcaacbcac\"\n\t\t\t\t+ \"cabbacbbccccaabbacccaacbbbacbccbcaaaaaabaacaaabccbbcccaacbacbccaaacaacaaaacbbaaccacbcbaaaccaab\"\n\t\t\t\t+ \"cbccacaaccccacaacbcacccbcababcabacaabbcacccbacbbaaaccabbabaaccabbcbbcaabbcabaacabacbcabbaaabccab\"\n\t\t\t\t+ \"cacbcbabcbccbabcabbbcbacaaacaabb\"\n\t\t\t\t+ \"babbaacbbacaccccabbabcbcabababbcbaaacbaacbacacbabbcacccbccbbbcbcabcabbbcaabbaccccabaa\"\n\t\t\t\t+ \"bbcbcccabaacccccaaacbbbcbcacacbabaccccbcbabacaaaabcccaaccacbcbbcccaacccbbcaaaccccaabacabc\"\n\t\t\t\t+ \"abbccaababbcabccbcaccccbaaabbbcbabaccacaabcabcbacaccbaccbbaabccbbbccaccabccbabbbccbaabcaab\"\n\t\t\t\t+ \"cabcbbabccbaaccabaacbbaaaabcbcabaacacbcaabbaaabaaccacbaacababcbacbaacacccacaacbacbbaacbcbbbabc\"\n\t\t\t\t+ \"cbababcbcccbccbcacccbababbcacaaaaacbabcabcacaccabaabcaaaacacbccccaaccbcbccaccacbcaaaba\";\n\t\tSystem.out.println(substrCount2(1017, str));\n\t}", "public static String getLongestSubStringNonRepeatingChars(String str){\r\n\t\t\t\r\n\t\tif(str == null){\r\n\t\t\treturn null;\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint n = str.length();\r\n\t\t\r\n\t\tif(n < 2){\r\n\t\t\treturn str;\r\n\t\t}\r\n\t\t\r\n\t\tint[] charIndexes = new int[256];\r\n\t\t//array to store last index of string characters seen in string, initialized to -1\r\n\t\tfor(int i = 0;i < 256;i++){\r\n\t\t\tcharIndexes[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\t//set index of first character\r\n\t\tcharIndexes[str.charAt(0)] = 0;\r\n\t\t\r\n\t\tint currLength = 1; //Length of current non-repecting substring\r\n\t\tint maxLength = 1;\t//Length of longest substring with non repeating characters found\r\n\t\tint prevIdx = 0;\t//Previous index of current charactor\r\n\t\tint startIdx = 0;\t//Starting index of longest substring with non repeating characters found\t\t\r\n\t\t\r\n\t\tfor(int i = 1;i < n;i++){\r\n\t\t\tprevIdx = charIndexes[str.charAt(i)];\r\n\t\t\tif(prevIdx == -1 || i - currLength > prevIdx){\r\n\t\t\t\tcurrLength ++;\r\n\t\t\t}else{\r\n\t\t\t\tif(currLength > maxLength){\r\n\t\t\t\t\tmaxLength = currLength;\r\n\t\t\t\t\tstartIdx = i - maxLength;\r\n\t\t\t\t}\r\n\t\t\t\tcurrLength = i -prevIdx;\r\n\t\t\t}\r\n\t\t\tcharIndexes[str.charAt(i)] = i;\r\n\t\t}\r\n\t\t\r\n\t\t//Check if longest substring with non repeating characters ends at ends of the string\r\n\t\tif(currLength > maxLength){\r\n\t\t\tmaxLength = currLength;\r\n\t\t\tstartIdx = n - maxLength;\r\n\t\t}\r\n\t\treturn str.substring(startIdx, startIdx+maxLength);\r\n\t}", "public int lengthOfLongestSubstringTwoDistinct(String s) {\n if(s == null || s.length() == 0)\n return 0;\n \n //corner case\n int n = s.length();\n if(n < 3)\n return n;\n \n int left = 0;\n int right = 0;\n HashMap<Character,Integer> sMap = new HashMap<>(); // HashMap storing Character, rightmost position\n int maxLen = 2;\n \n while(right < n) {\n // when the slidewindow contains less than three characters\n sMap.put(s.charAt(right), right++);\n \n // when the slidewindow contains three characters\n if(sMap.size() == 3) {\n int i = Collections.min(sMap.values());\n sMap.remove(s.charAt(i)); // remove leftmost character\n left = i+1;\n }\n maxLen = Math.max(maxLen, right - left);\n }\n return maxLen;\n }", "public int countSubstrings_dp(String s) {\n\t\tint n = s.length();\n\t\tint res = 0;\n\t\tboolean[][] dp = new boolean[n][n];\n\t\tfor (int i = n - 1; i >= 0; i--) {\n\t\t\tfor (int j = i; j < n; j++) {\n\t\t\t\tdp[i][j] = s.charAt(i) == s.charAt(j) \n\t\t\t\t\t\t&& (j - i + 1 < 3 || dp[i + 1][j - 1]);\n\t\t\t\t\n\t\t\t\tif (dp[i][j])\n\t\t\t\t\t++res;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "static void subsequence(String str)\n {\n // iterate over the entire string\n for (int i = 0; i < str.length(); i++) {\n \n // iterate from the end of the string\n // to generate substrings\n for (int j = str.length(); j > i; j--) {\n String sub_str = str.substring(i, j);\n \n if (!st.contains(sub_str))\n st.add(sub_str);\n \n // drop kth character in the substring\n // and if its not in the set then recur\n for (int k = 0; k < sub_str.length(); k++) {\n StringBuffer sb = new StringBuffer(sub_str);\n \n // drop character from the string\n sb.deleteCharAt(k);\n if (!st.contains(sb)) {\n \tsubsequence(sb.toString());\n }\n }\n }\n }\n }", "public int countBinarySubstrings(String s) {\n \tint prevRunLen = 0;\n \tint currRunLen = 1;\n \tint cnt = 0;\n\n \tfor (int i = 1; i < s.length(); i++) {\n \t\tif (s.charAt(i) == s.charAt(i - 1)) {\n \t\t\tcurrRunLen += 1;\n \t\t} else {\n \t\t\tprevRunLen = currRunLen;\n \t\t\tcurrRunLen = 1;\n \t\t}\n \t\t// one qualifying substring\n \t\tif (prevRunLen >= currRunLen) {\n \t\t\tcnt++;\n \t\t}\n \t}\n\n \treturn cnt;\n }", "public int lengthOfLongestSubstringKDistinct(String s, int k) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n\n int j = 0;\n int max = 0;\n int[] map = new int[256];\n int distinctCt = 0;\n\n for (int i = 0; i < s.length(); i++) {\n while( j < s.length()) {\n int ch = s.charAt(j);\n if (map[ch] == 0) {\n if (distinctCt + 1 > k) {\n break;\n }\n map[ch] = 1;\n distinctCt++;\n j++;\n } else {\n map[ch] += 1;\n j++;\n }\n }\n max = Math.max(max, j - i);\n map[s.charAt(i)] -= 1;\n if (map[s.charAt(i)] == 0) {\n distinctCt--;\n }\n }\n return max;\n }", "private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }", "public int lengthOfLongestSubstring2(String s) {\n int n = s.length(), ans = 0;\n int[] index = new int[128]; // current index of character\n // try to extend the range [i, j]\n for (int j = 0, i = 0; j < n; j++) {\n i = Math.max(index[s.charAt(j)], i);\n ans = Math.max(ans, j - i + 1);\n index[s.charAt(j)] = j + 1;\n }\n return ans;\n }", "public static String nCopies(String s, int n) {\n\t\tif (s == null) {\n\t\t\treturn null;\n\t\t}\n\t\tStringBuilder sb = new StringBuilder(s.length() * n + 8);\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tsb.append(s);\n\t\t}\n\t\treturn sb.toString();\n\t}", "private static String findSubString(int index, int len, String s2) {\n\t\tif ((s2.length() - index) >= len) {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index, index+len);\n\t\t} else {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index);\n\t\t}\n\t}", "public String solution(String s) {\n\t\tStream<Character> tmp = s.chars().mapToObj(value -> (char)value);\n\t\treturn tmp.collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().filter(characterLongEntry -> characterLongEntry.getValue() == 2).findFirst().get().getKey().toString();\n\t}", "private static String findSubString2(int index, int len, String s2) {\n\t\tint wLen = len - 1;\n\t\tint remLen = s2.length() - index;\n\t\tif (remLen <= wLen) {\n\t\t\treturn s2.substring(0, index) + s2.substring(index, index+remLen);\n\t\t} else {\n\t\t\tif (index == 0) {\n\t\t\t\treturn s2.substring(0, index) + s2.substring(index, len);\n\t\t\t}\n\t\t\treturn s2.substring(0, index) + s2.substring(index, len+1);\n\t\t}\n\t}", "public int minCut2(String s) {\n boolean[][] dp = new boolean[s.length()][s.length()];\n for (int len = 1; len <= s.length(); len++) {\n for (int i = 0; i <= s.length() - len; i++) {\n int j = i + len - 1;\n dp[i][j] = s.charAt(i) == s.charAt(j) && (len < 3 || dp[i + 1][j - 1]);\n }\n }\n\n int[] cut = new int[1];\n cut[0] = Integer.MAX_VALUE;\n // List<List<String>> res = new ArrayList<>();\n helper2(s, 0, cut, dp, 0);\n // System.out.format(\"res: %s\\n\", res);\n return cut[0];\n }", "public int countSubstrings_expand2(String s) {\n\t\tint count = 0;\n\t\t\n\t\t// Loop across different middle points.\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tcount += extractPalindrome_expand2(s, i, i); // odd length mid i\n\t\t\tcount += extractPalindrome_expand2(s, i, i + 1); // even length mid i, i+1\n\t\t}\n\t\treturn count;\n\t}", "public int longestRepeatingSubsequenceII(String str, int k) {\n HashMap<String, Integer> cache = new HashMap<>();\n\n int max = 0;\n for (int i = str.length(); 0<=i; i--) {\n for (int j = 0; j+i < str.length(); j++) {\n String sub = str.substring(j, j+i);\n int count = repeat(str, sub, k , cache);\n if (count>=k) {\n return sub.length();\n }\n }\n }\n\n return max;\n\n }", "public static int lengthOfLongestSubstringUsingSet(String s) {\n\t\tif (s == null || s.length() == 0)\n\t\t\treturn 0;\n\n\t\tint n = s.length();\n\t\tSet<Character> set = new HashSet<>();\n\t\tint ans = 0, start = 0, end = 0;\n\t\twhile (start <= end && end < n) {\n\t\t\t// try to extend the range [i, j]\n\t\t\tif (!set.contains(s.charAt(end))) {\n\t\t\t\tset.add(s.charAt(end));\n\t\t\t\tend++;\n\n\t\t\t\tans = Math.max(ans, end - start); // Update ans\n\t\t\t} else {\n\t\t\t\tset.remove(s.charAt(start++));\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public int lengthOfLongestSubstringKDistinct(String s, int k) {\n Map<Character, Integer> map = new HashMap<>();\n int maxLenght = 0;\n\n int i = 0;\n int j = 0;\n int n = s.length();\n\n while (j < s.length()) {\n\n char c = s.charAt(j);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n\n if (map.size() <= k) {\n maxLenght = Math.max(maxLenght, j - i + 1);\n }\n\n if (map.size() > k) {\n\n while (map.size() > k && i < j) {\n char cx = s.charAt(i);\n map.put(cx, map.get(cx) - 1);\n if (map.get(cx) == 0) {\n map.remove(cx);\n }\n i++;\n }\n }\n\n j++;\n }\n\n return maxLenght;\n }", "public static Set<String> getAllSubSeq(String s) {\n if (s == null || s.isEmpty()) {\n return null;\n }\n\n int n = s.length();\n if (n > 31) {\n throw new IllegalArgumentException(\"max str length is 31\");\n }\n int total = (int) Math.pow(2, n) - 1;\n Set<String> set = new HashSet<String>(total);\n\n boolean[] mask = new boolean[n];\n set.add(s);\n\n // let get all other combinations except of \"all false and all true\" masks\n for (int i = 1; i < total; i++) {\n nextMask(mask);\n String subSeq = getSubseq(s, mask);\n set.add(subSeq);\n }\n return set;\n }", "static int isSubstring(String s1, String s2) {\n int m = s1.length();\n int n = s2.length();\n\n // A loop to slide pat[] one by one\n for (int i = 0; i <= n - m; i++) {\n int j;\n\n // For current index i, check for pattern match\n for (j = 0; j < m; j++) {\n if (s2.charAt(i + j) != s1.charAt(j)) {\n break;\n }\n }\n\n if (j == m) {\n return i;\n }\n }\n return -1;\n }", "public int countBinarySubstrings(String s) {\n\n int pre = 0, cur = 1, res = 0;\n for (int i = 1; i < s.length(); i++) {\n if (s.charAt(i) == s.charAt(i - 1)) {\n cur++;\n } else {\n res += Math.min(cur, pre);\n pre = cur;\n cur = 1;\n }\n }\n res += Math.min(cur, pre);\n return res;\n }", "private static void subStringNonrepchars(String input) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString s =\"\";\n\n\t\tint j=0,max=0,len=0, i=0;\n\t\tboolean[] flag = new boolean[256];\n\t\tfor(i=0;i<input.length();i++){\n\t\t\tif(!flag[input.charAt(i)]){\n\t\t\t\tSystem.out.println(\"char: \"+input.charAt(i)+\" bool: \"+!flag[input.charAt(i)]);\n\t\t\t\tlen++;\n\t\t\t}else{\n\t\t\t\t//System.out.println(\"coming to else\");\n\t\t\t\tif(len>max){\n\t\t\t\t\tmax= len;len=1;\n\t\t\t\t\tSystem.out.println(j+\" j \"+max +\" :max substring: \"+input.substring(j,i));\n\t\t\t\t}\n\t\t\t\tj = i;\n\t\t\t\tSystem.out.println(\"max len is: \"+max+\" j: \"+j);\n\t\t\t\tflag = new boolean[256];\n\t\t\t}\n\t\t\tflag[input.charAt(i)] = true;\n\n\t\t}\n\t\tif(len>max){\n\t\t\tmax=len;\n\t\t\tj=i;\n\t\t}\n\t\tif(max>j)\n\t\t\tSystem.out.println(input.substring(max-j,max+1));\n\t\telse{\n\t\t\tSystem.out.println(input.substring(j-max,max+1));\n\t\t}\n\n\n\n\t}", "public long distinctSubstring() {\n long ans = 1;\n int n = rank.length;\n for (int i = 0; i < n; i++) {\n long len = n - i;\n if (rank[i] < n - 1) {\n len -= lcp[rank[i]];\n }\n ans += len;\n }\n return ans;\n }", "public int lengthOfLongestSubstring(String s) {\n\n int res = 0;\n int len = s.length();\n int i = 0, j = 0;\n Set<Character> set = new HashSet<>();\n while (i < len && j < len) {\n if (!set.contains(s.charAt(j))) {\n set.add(s.charAt(j++)); // here s.set an ele then j already plus\n res = Math.max(res, j - i); // so use j-i\n } else {\n set.remove(s.charAt(i++));\n }\n }\n\n return res;\n }", "static long substrCount(int n, String s) {\n ArrayList<Point> points = new ArrayList<>();\n\n char current = s.charAt(0);\n int count = 1;\n\n for (int i = 1; i < s.length(); i++) {\n char ch = s.charAt(i);\n if (current == ch) {\n count++;\n } else {\n points.add(new Point(current, count));\n current = ch;\n count = 1;\n }\n }\n points.add(new Point(current, count));\n\n count = 0;\n if (points.size() > 2) {\n\n count += addup(points.get(0).count);\n\n for (int i = 1; i < points.size() - 1; i++) {\n Point prev = points.get(i - 1);\n Point curr = points.get(i);\n Point next = points.get(i + 1);\n\n\n count += addup(curr.count);\n\n if (prev.ch == next.ch && curr.count == 1) {\n int min = Math.min(prev.count, next.count);\n count += min;\n }\n }\n\n count += addup(points.get(points.size() - 1).count);\n\n } else if (points.size() == 1) {\n Point curr = points.get(0);\n count += addup(curr.count);\n } else if (points.size() == 2) {\n Point prev = points.get(0);\n count += addup(prev.count);\n Point next = points.get(1);\n count += addup(next.count);\n }\n\n\n System.out.println(points);\n\n return count;\n\n }", "public static String ntimes(String s,int n){\n\t\tStringBuffer buf = new StringBuffer();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tbuf.append(s);\n\t\t}\n\t\treturn buf.toString();\n\t}", "public static String getSubstring(String s, int i, int j){\n if(i>j){\n throw new IllegalArgumentException(\"The second integer cannot be smaller than the first integer\");\n }\n else{\n String subString = \"\";\n for(int n = i; n<=j; n++){\n subString += s.charAt(n);\n }\n return subString; \n }\n }", "public int countSubstrings_brute_force(String s) {\n\t\tint ans = 0;\n\n for (int start = 0; start < s.length(); ++start)\n for (int end = start; end < s.length(); ++end) \n ans += isPal_brute_force(s, start, end) ? 1 : 0;\n\n return ans;\n\t}", "public int lengthOfLongestSubstring2(String s) {\n\n int res = 0;\n int len = s.length();\n Map<Character, Integer> map = new HashMap<Character, Integer>();\n\n for (int i = 0, j = 0; j < len; j++) {\n if (map.containsKey(s.charAt(j))) {\n i = Math.max(map.get(s.charAt(j)), i);// use Max mesas never looking back\n }\n res = Math.max(res, j - i + 1); // j not plus yet, need add 1 to get a real length ( indicate j itself)\n map.put(s.charAt(j), j + 1); // (j+1) means skip duplicate\n System.out.println(map.toString()); // will update the value of key ( union key)\n }\n\n\n return res;\n }", "public static int getMaxSubstr(String str, int k) {\n int[] freqArr = new int[256];\n int uniqCount = 0;\n\n int cStart = 0;\n int cEnd = 0;\n\n int resStart = -1;\n int resLen = -1;\n\n for(int i = 0; i < str.length(); i++) {\n int ch = str.charAt(i);\n\n if(freqArr[ch] == 0) {\n uniqCount++;\n }\n\n freqArr[ch]++;\n cEnd++;\n\n while(uniqCount > k) {\n cStart++;\n int c = str.charAt(cStart);\n\n if(freqArr[c] == 1) {\n uniqCount--;\n }\n\n freqArr[c]--;\n }\n\n\n if(uniqCount == k && (cEnd - cStart > resLen) ) {\n resLen = cEnd - cStart;\n resStart = cStart;\n }\n\n }\n\n //print \"resLen\" characters starting from \"resStart\"\n for(int i = resStart; i < resStart + resLen; i++) {\n System.out.print(str.charAt(i));\n }\n\n\n //returning the length\n return resLen;\n }", "static long substrCount(int n, String s) {\nchar arr[]=s.toCharArray();\nint round=0;\nlong count=0;\nwhile(round<=arr.length/2)\n{\nfor(int i=0;i<arr.length;i++)\n{\n\t\n\t\tif(round==0)\n\t\t{\n\t\t//System.out.println(arr[round+i]);\n\t\tcount++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(i-round>=0&&i+round<arr.length)\n\t\t\t{\n\t\t\t\tboolean flag=true;\n\t\t\t\tchar prev1=arr[i-round];\n\t\t\t\tchar prev2=arr[i+round];\n\t\t\t\t\n\t\t\t\tfor(int j=1;j<=round;j++)\n\t\t\t\t{\n\t\t\t\t\tif(prev1!=arr[i+j]||prev1!=arr[i-j])\n\t\t\t\t\t{\n\t\t\t\t\t\tflag=false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\tif(arr[i+j]!=arr[i-j])\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tflag=false;\n\t\t\t\t\t\tbreak;\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\tif(flag)\n\t\t\t\t{\n\t\t\t\t\t//System.out.print(arr[i-round]);\n\t\t\t\t\t//System.out.print(arr[round+i]);\n\t\t\t\t\t//System.out.println(round);\n\t\t\t\t\t//System.out.println();\n\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n}\nround++;\n}\nreturn count;\n }", "public long numberOfSubstrings(String s) {\n int[] letterCounts = new int[26];\n long substringCount = 0;\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n int letterCount = ++letterCounts[c - 'a'];\n substringCount += letterCount;\n }\n return substringCount;\n }", "public int findSubstringInWraproundString1(String p) {\n if(p == null || p.length() == 0) {\n return 0;\n }\n int pLength = p.length();\n // keep track of the number of consecutive letters for each substrings which starts from a...z\n int[] consecutiveNumberFrom = new int[26]; \n consecutiveNumberFrom[p.charAt(0) - 'a'] = 1;\n // keep track of the number of legacy consecutive letters\n int[] consecutiveCount = new int[pLength];\n consecutiveCount[0] = 1;\n int result = 1;\n for(int i = 1; i < pLength; i++) {\n consecutiveCount[i] = isConsecutive(p.charAt(i - 1), p.charAt(i))\n ? consecutiveCount[i - 1] + 1\n : 1;\n for(int j = i - consecutiveCount[i] + 1; j <= i; j++) {\n if(consecutiveNumberFrom[p.charAt(j) - 'a'] < i - j + 1) {\n result++;\n consecutiveNumberFrom[p.charAt(j) - 'a']++;\n } else {\n break;\n }\n }\n }\n return result;\n }", "public boolean repeatedSubstringPattern(String s) {\n int len = s.length();\n for (int i = len / 2; i >= 1; i--) {\n if (len % i == 0) {\n int num = len / i;\n String substr = s.substring(0, i);\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < num; j++) {\n sb.append(substr);\n }\n if (sb.toString().equals(s)) {\n return true;\n }\n }\n }\n\n return false;\n }", "public static String longestRepeatedSubstring(String s){\r\n int N = s.length();\r\n String[] suffixes = new String[N];\r\n \r\n for (int i = 0; i < N; i++)\r\n suffixes[i] = s.substring(i, N);\r\n \r\n /* bring subffixes with common prefix together. */\r\n Arrays.sort(suffixes);\r\n \r\n /* compare the adjacent suffixes. */\r\n String longest = \"\";\r\n for (int i = 0; i < suffixes.length - 1; i++){\r\n String common = longestCommonPrefix(suffixes[i], suffixes[i+1]);\r\n if (common.length() > longest.length())\r\n longest = common;\r\n }\r\n \r\n return longest;\r\n }", "public static int lengthOfLongestSubstring2(String s) {\n if(s.length()==1)\n return 1;\n\n int sum = 0;\n\n Map<Character, Integer> map = new HashMap<>();\n int i=0;\n\n while(i<s.length()){\n char c = s.charAt(i);\n\n // map exists char c\n if(map.containsKey(c)){\n if(map.keySet().size() > sum) // replace sum\n sum = map.keySet().size();\n i = map.get(c);\n map = new HashMap<>(); // clear map\n }\n // map doesn't exist char c\n else\n map.put(c, i);\n i++;\n }\n\n if(map.keySet().size() > sum)\n return map.keySet().size();\n return sum;\n }", "private static int getLongestSemiAlternatingSubString(String s) {\n int max = 0, count = 1, len = s.length(), p1 = 0;\n for (int p2 = 1; p2 < len; p2++) {\n if (s.charAt(p2 - 1) == s.charAt(p2)) {\n count++;\n } else {\n count = 1;\n }\n if (count < 3) {\n max = Math.max(max, p2 - p1 + 1);\n } else {\n p1 = p2 - 1;\n count = 2;\n }\n }\n return max;\n }", "private static void longestSubstringAllUnique(String s) {\n\t\tif(s == null || s.length() == 0) {\n\t\t\tSystem.out.println(\"\");\n\t\t\treturn;\n\t\t}\n\t\t//sliding window : 2 pointers (one is use for traverse)\n\t\tint l = 0;\n\t\tSet<Character> set = new HashSet<>();//keep track of current window char\n\t\tint longest = 0;\n\t\t\n\t\tfor(int r = 0; r < s.length(); r++) {\n//\t\t\tif(set.contains(s.charAt(r))) {\n//\t\t\t\twhile(set.contains(s.charAt(r))) {\n//\t\t\t\t\tset.remove(s.charAt(l));\n//\t\t\t\t\tl++;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t\n\t\t\twhile(set.contains(s.charAt(r))) {//set == itself give distinct key: our requirement is all distinct \n\t\t\t\tset.remove(s.charAt(l));\n\t\t\t\tl++;\n\t\t\t}\n\t\t\t\n\t\t\tset.add(s.charAt(r));\n\t\t\tint currentWindowSize = r - l + 1;\n\t\t\tlongest = Math.max(longest, currentWindowSize);\n\t\t}\n\t\tSystem.out.println(longest);\n\t}", "public int countSubstrings_Memo(String s) {\n\t\tint n = s.length(), count = n;\n\t\t\n\t\tBoolean[][] mem = new Boolean[n][n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tfor (int j = i + 1; j < n; j++)\n\t\t\t\tif (isPal_Memo(i, j, s, mem))\n\t\t\t\t\tcount++;\n\t\treturn count;\n\t}", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n String test = \"abcabcbb\";\n int result = LongestSubStringWithoutRepeatingCharacters.solution(test);\n System.out.println(result);\n }", "private static void longestRepeatingSubsequence(String string) {\n\t\t\n\t}", "public static String lrs(String s) {\n\n // form the N suffixes\n int N = s.length();\n String[] suffixes = new String[N];\n for (int i = 0; i < N; i++) {\n suffixes[i] = s.substring(i, N);\n }\n\n // sort them\n Arrays.sort(suffixes);\n\n // find longest repeated substring by comparing adjacent sorted suffixes\n String lrs = \"\";\n for (int i = 0; i < N - 1; i++) {\n String x = lcp(suffixes[i], suffixes[i+1]);\n if (x.length() > lrs.length())\n lrs = x;\n }\n return lrs;\n }", "public int distinctSubseqII(String S) {\n int[] end = new int[26]; // 本字符添加之前的长度\n int res = 0;\n int added; // 当前额外增加的数量\n int mod = (int) 1e9 + 7;\n\n System.out.println('\\n' + S);\n for (char c : S.toCharArray()) {\n // 额外增加的数量等于前面的数量加上1(当前字符串)减去最后一次相同字符添加之前的数量\n added = (res + 1 - end[c - 'a']) % mod;\n\n end[c - 'a'] = (res + 1) % mod; // 影响的为前一个字符的数量加上单字符的数量\n\n res = (res + added) % mod;\n System.out.printf(\"%2c, %2d, %2d\\n\", c, res, end[c - 'a']);\n }\n return (res + mod) % mod;\n }", "public int findSubstringInWraproundString(String p) {\n if(p == null || p.length() == 0) {\n return 0;\n }\n // count[i] is the maximum unique substring that ends with a...z\n int[] count = new int[26];\n // keep track of the number of consecutive letters ended with current letter\n int consecutiveCount = 1;\n for(int i = 0; i < p.length(); i++) {\n if(i > 0 && isConsecutive(p.charAt(i - 1), p.charAt(i))) {\n consecutiveCount++;\n } else {\n consecutiveCount = 1;\n }\n int index = p.charAt(i) - 'a';\n count[index] = Math.max(count[index], consecutiveCount);\n }\n int result = 0;\n for(int singleCount : count) {\n result += singleCount;\n }\n return result;\n }", "public int countBinarySubstrings(String s) {\n int result = 0;\n int[] count = new int[2];\n int cur = s.charAt(0) - '0';\n count[cur]++;\n for (int i = 1; i < s.length(); i++) {\n \tchar c = s.charAt(i);\n \tif (c - '0' == cur) count[cur]++;\n \telse {\n \t\tresult += Math.min(count[0], count[1]);\n \t\tcur = c - '0';\n \t\tcount[cur] = 1;\n \t}\n }\n result += Math.min(count[0], count[1]);\n return result;\n }", "public List<String> uniqueSubstring(String s, int k) {\n List<String> result = new ArrayList<>();\n Set<String> set = new HashSet<>();\n for (int i=0;i<=s.length()-k;i++) {\n set.add(s.substring(i, i+k));\n }\n for (String str: set) {\n result.add(str);\n }\n Collections.sort(result);\n return result;\n }", "public static void main(String[] args) {\n\n String str = \"abXYabc\"; //abXYabc //prefix means first couple of letters\n int n = 2; // 3\n // abX Yabc // rest of the string means word after the prefix\n\n String prefix = str.substring(0,n); // 0, 2 //here we need multiple characters\n String remaining = str.substring(n); //XYabc\n\n System.out.println(remaining.contains(prefix));\n\n\n }", "public static int longestRepeatingSubstringUsingSuffixArray(String s) {\n\t\tint n = s.length();\n\t\tSuffixArray sa = new SuffixArray(s);\n\t\tint ans = 0;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tint len = sa.lcp(i);\n\t\t\tans = Math.max(ans, len);\n\t\t}\n\t\treturn ans;\n\t}", "public int lengthOfLongestSubstringTwoDistinct(String s) {\n int firstC = 0, secondC = 0;\n int start = 0, end = 0, len = s.length();\n int res = 0;\n char first =' ', second = ' ';\n while(end < len) {\n char cur = s.charAt(end);\n if(cur == first) {\n firstC++;\n }\n else if(cur == second) {\n secondC++;\n }\n else {\n while(firstC != 0 && secondC != 0) {\n if(s.charAt(start) == first) firstC--;\n else secondC--;\n start++;\n }\n if(firstC == 0) {\n first = cur;\n firstC = 1;\n }\n else {\n second = cur;\n secondC = 1;\n }\n }\n res = Math.max(res, end - start + 1);\n end++;\n }\n return res;\n }", "public int lengthOfLongestSubstring(String s) {\n int i = 0, j = 0, max = 0;\n Set<Character> set = new HashSet<>();\n \n while (j < s.length()) {\n if (!set.contains(s.charAt(j))) {\n set.add(s.charAt(j++));\n max = Math.max(max, set.size());\n } else {\n set.remove(s.charAt(i++));\n }\n }\n \n return max;\n}", "static int twoCharaters(String s) {\n\t\tList<String> list = Arrays.asList(s.split(\"\"));\n\t\tHashSet<String> uniqueValues = new HashSet<>(list);\n\t\tSystem.out.println(uniqueValues);\n\t\tString result;\n\t\twhile(check(list,1,list.get(0))) {\n\t\t\tresult = replace(list,1,list.get(0));\n\t\t\tif(result != null) {\n\t\t\t\tSystem.out.println(result);\n\t\t\t\ts = s.replaceAll(result,\"\");\n\t\t\t\tlist = Arrays.asList(s.split(\"\"));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t\treturn 5;\n }", "public static int lengthOfLongestSubstring(String s) \r\n {\r\n \tif (s.length()==0) \r\n \t\treturn 0;\r\n \t\r\n HashMap<Character, Integer> map = new HashMap<Character, Integer>();\r\n int length = 0;\r\n int start = 0;\r\n \r\n for (int end=0; end < s.length(); end++)\r\n {\r\n \t// When we have reached a repeated character, then the currently held string is potentially the largest string.\r\n \t// If the character is there in the map, start needs to be changed. \r\n \t// If it is not there, start remains the same so that it can increase the count\r\n if (map.containsKey(s.charAt(end)))\r\n {\r\n \t// Consider input as abba. For b[2], start < map.get(s.charAt(end)) + 1 \r\n \t// For b[3], start > map.get(s.charAt(end)) + 1. It means, if the character has occured towards the beginning, we dont want the start to be modified.\r\n \tstart = Math.max(start, map.get(s.charAt(end)) + 1);\r\n } \r\n \r\n map.put(s.charAt(end), end);\r\n \r\n // Why +1? Lets say start=2, end=5. Then the length will be 5-2=3. And, 3+1 = 4.\r\n length = Math.max(length, end-start+1);\r\n \r\n }\r\n return length;\r\n }", "private static int lengthOfLongestSubstring2(String s) {\n int maxLength = 0;\n int currentlength = 0;\n int startIndex = -1;\n Map<Character, Integer> charMap = new HashMap<>();\n \n for(int index = 0; index < s.length(); index++){\n Character c = s.charAt(index);\n Integer currentIndex = charMap.get(c);\n if(currentIndex != null){\n \tcurrentlength = index - startIndex -1 ;\n if(maxLength < currentlength){\n maxLength = currentlength;\n }\n if(currentIndex > startIndex) {\n startIndex = currentIndex;\n }\n }\n charMap.put(c, index);\n }\n currentlength = s.length() - startIndex -1 ;\n if(maxLength < currentlength){\n maxLength = currentlength;\n }\n return maxLength;\n }", "public static int subStr(String str)\n\t{\n\t\tif(str.isEmpty()) return 0;\n\t\tint len=0;\n\t\t\n\t\t\n\t\tfor (int i = 0; i < str.length(); i++) \n\t\t{\n\t\t\tboolean visited[]=new boolean[256];\n\t\t\t\n\t\t\tfor (int j = i; j < str.length(); j++) \n\t\t\t{\n\t\t\t\t//if current jth character is already visited, break loop and move to next ith \n\t\t\t\tif(visited[str.charAt(j)])\n\t\t\t\t\tbreak;\n\t\t\t\t//take the len and compare with global len and make current char as true\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlen=Math.max(len, j-i+1);\n\t\t\t\t\tvisited[str.charAt(j)]=true;\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\t//when element is removed from window, mark it as false\n\t\t\tvisited[str.charAt(i)]=false;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn len;\n\t}", "public int lengthOfLongestSubstring2(String s) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n\n int start=0;\n int max = 0;\n int[] map = new int[256];\n\n for (int i = 0; i < s.length(); i++) {\n int c = (int)s.charAt(i);\n start = Math.max(map[c], start);\n map[c] = i + 1;\n max = Math.max(max, i + 1 - start);\n }\n\n return max;\n }", "int max_cut_2(String s)\n {\n\n if(s==null || s.length()<2)\n {\n return 0;\n }\n int n = s.length();\n boolean[][] dp = new boolean[n][n];\n int[] cut = new int[n];\n for(int i = n-1;i>=0;i++) {\n\n //i represents the 左大段和右小段的左边界\n //j represents the 右小段的右边界\n cut[i] = n - 1 - i;\n\n for (int j = i; j < n; j++) {\n if (s.charAt(i) == s.charAt(j) && (j - i < 2 || dp[i + 1][j - 1]))\n {\n dp[i][j] = true;\n if(j == n-1)\n {\n cut[i]=0;\n }\n else{\n cut[i] = Math.min(cut[i],cut[j+1]+1);\n }\n }\n }\n }\n\n return cut[0];\n }", "public int countSubstrings(String s) {\n int count =0;\n int n = s.length();\n boolean[][] isPall = new boolean[n][n];\n \n for(int len =0;len<n;len++){\n \n for(int i=0,j=len;j<n;i++,j++){\n if(len == 0){\n isPall[i][j] = true;\n }\n else if(len == 1){\n isPall[i][j] = s.charAt(i) == s.charAt(j);\n }\n else{\n isPall[i][j] = (s.charAt(i) == s.charAt(j) &&\n isPall[i+1][j-1]);\n }\n \n if(isPall[i][j]){\n count++;\n }\n }\n \n } \n return count;\n }", "public String nTwice(String str, int n) {\r\n String result = str;\r\n\r\n if (str.length() > n - 1) {\r\n String frontChars = str.substring(0, n);\r\n String backChars = str.substring(str.length() - n, str.length());\r\n\r\n result = frontChars + backChars;\r\n }\r\n\r\n return result;\r\n }", "public int minCut1(String s) {\n boolean[][] dp = new boolean[s.length()][s.length()];\n for (int len = 1; len <= s.length(); len++) {\n for (int i = 0; i <= s.length() - len; i++) {\n int j = i + len - 1;\n dp[i][j] = s.charAt(i) == s.charAt(j) && (len < 3 || dp[i + 1][j - 1]);\n }\n }\n\n int[] cut = new int[1];\n cut[0] = Integer.MAX_VALUE;\n List<List<String>> res = new ArrayList<>();\n helper1(s, 0, cut, dp, res, new ArrayList<>());\n // System.out.format(\"res: %s\\n\", res);\n return cut[0];\n }", "public int lengthOfLongestSubstring1(String s) {\n\t\tint i = 0, j = 0, max = 0;\n\t\tSet<Character> set = new HashSet<>();\n\n\t\twhile (j < s.length()) {\n\t\t\tif (!set.contains(s.charAt(j))) {\n\t\t\t\tset.add(s.charAt(j++));\n\t\t\t\tmax = Math.max(max, set.size());\n\t\t\t} else {\n\t\t\t\tset.remove(s.charAt(i++));\n\t\t\t}\n\t\t}\n\n\t\treturn max;\n\t}", "public int minCut3(String s) {\n boolean[][] dp = new boolean[s.length()][s.length()];\n for (int len = 1; len <= s.length(); len++) {\n for (int i = 0; i <= s.length() - len; i++) {\n int j = i + len - 1;\n dp[i][j] = s.charAt(i) == s.charAt(j) && (len < 3 || dp[i + 1][j - 1]);\n }\n }\n\n int[] memo = new int[s.length() + 1];\n Arrays.fill(memo, -1);\n\n int[] res = new int[1];\n res[0] = Integer.MAX_VALUE;\n\n helper3(s, 0, res, 0, dp, memo);\n return res[0];\n }", "public static void main(String[] args) {\n String str = \"aabacbebebe\";\n int k = 3;\n\n int maxLength = getMaxSubstr(str, k);\n System.out.println(maxLength);\n }", "public static void main(String[] args){\n\t\tSystem.out.println(makeThreeSubstr(\"hello\",0,2)); //should be hehehe\n\t\tSystem.out.println(makeThreeSubstr(\"shenanigans\",3,7)); //should be naninaninani\n\t}", "public String countAndSay(int n) {\n if(n == 1){\n return \"1\";\n }else{\n StringBuilder sb = new StringBuilder();\n int k = 0;\n String s = countAndSay(n-1);\n int l = s.length();\n for(int i = 0; i < l; i++){\n if(i == 0){\n k ++;\n }else{\n if(s.charAt(i) == s.charAt(i-1)){\n k ++;\n }else{\n sb.append(k);\n sb.append(s.charAt(i-1));\n k = 1;\n }\n }\n }\n sb.append(k);\n sb.append(s.charAt(l-1));\n return sb.toString();\n }\n }", "static int countingValleys(int n, String s) {\n int valleyCounter =0;\n byte vorm = 0;\n int curLevel=0;\n for(int i=0;i<s.length();i++){\n String cur = s.substring(i,i+1);\n int posNeg = cur.equals(\"U\")?1:-1;\n curLevel+=posNeg;\n if(curLevel == -1 && posNeg == -1){\n valleyCounter++;\n }\n }\n return valleyCounter;\n }", "public List<String> findRepeatedDnaSequences(String s) {\n if(s.length() < 10) return new ArrayList<String>();\n \n int[] map = new int[256];\n map['A'] = 0;\n map['T'] = 1;\n map['C'] = 2;\n map['G'] = 3;\n \n List<String> result = new ArrayList<String>();\n \n //this set contains string that occurs before\n Set<Integer> visited = new HashSet<Integer>();\n //this set contains string that we have inserted into result\n Set<Integer> inResult = new HashSet<Integer>();\n \n int key = 0;\n \n //Since we only partially modify the key, we need to firstly initialize it\n for(int i = 0; i < 9; i++){\n key <<= 2;\n key |= map[s.charAt(i)];\n }\n \n for(int i = 9; i < s.length(); i++){\n key <<= 2;\n key |= map[s.charAt(i)];\n //our valid key has 20 digits, we use 0xFFFFF to remove digits that beyong this range\n key &= 0xFFFFF;\n \n String temp = s.substring(i - 9, i+1);\n \n //if this is not the first time we visit this substring\n if(!visited.add(key)){\n //if this is the first time we add this substring into result\n if(inResult.add(key)){\n result.add(temp);\n }\n }\n }\n \n return result;\n }", "public int numDistinct2(String s, String t)\n {\n return findSubS(s.length()-1, t.length()-1, s, t);\n }", "public boolean repeatedSubstringPattern(String s) {\n char[] ch = s.toCharArray();\n int[] pi = new int[ch.length];\n pi[0] = 0;\n int matched = 0;\n for (int i = 1; i < pi.length; i++) {\n while (matched > 0 && ch[matched] != ch[i])\n matched = pi[matched-1];\n if (ch[matched] == ch[i])\n matched++;\n pi[i] = matched;\n }\n return pi[pi.length-1] != 0 && pi.length % (pi.length - pi[pi.length-1]) == 0;\n }", "public int strCount(String str, String sub) {\n//Solution to problem coming soon\n}", "public static int lengthOfLongestSubstring(String s) {\n if(s.length()==1)\n return 1;\n\n int sum=0;\n int left = 0, right = 0;\n boolean[] used = new boolean[128];\n\n while(right < s.length()){\n if(used[s.charAt(right)] == false){\n used[s.charAt(right)] = true;\n right++;\n }else{\n sum = Math.max(sum, right-left);\n while(left<right && s.charAt(right) != s.charAt(left)){\n used[s.charAt(left)] = false;\n left++;\n }\n left++;\n right++;\n }\n }\n sum = Math.max(sum, right - left);\n\n return sum;\n }", "public static int lengthOfLongestSubstring(String s) {\n int[] dp=new int[256];\n for(int i=0;i<dp.length;i++){\n dp[i]=-1;\n }\n int start=0,result=0;\n for(int i=0;i<s.length();i++){\n start=Math.max(dp[s.charAt(i)]+1,start);\n dp[s.charAt(i)]=i;\n result=Math.max(result,i-start+1);\n }\n return result;\n }", "public int lengthOfLongestSubstring(String s){\n\t\tif(s == null || s.length() == 0){\n\t\t\treturn 0;\n\t\t}\n\n\t\tchar[] ch = s.toCharArray();\n\t\tint[] map = new int[128];\n\t\tint start = 0, end = 0, count = 0, maxLen = 0;\n\n\t\twhile(end < s.length()){\n\t\t\t// If map[ch[end]] > 0, it means ch[end] is duplicated now.\n\t\t\tif(map[ch[end]] > 0){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tmap[ch[end]]++;\n\t\t\tend++;\n\n\t\t\t// deal with the duplicated cases\n\t\t\twhile(count > 0){\n\t\t\t\tif(map[ch[start]] > 1){\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tmap[ch[start]]--;\n\t\t\t\tstart++;\n\t\t\t}\n\n\t\t\tmaxLen = Math.max(maxLen, end - start);\n\t\t}\n\t\treturn maxLen;\n\t}", "public int minInsertions(String s) {\n int n = s.length();\n //Initialising dp array. It will represent the longest common subsequence between first i characters of first string and first j characters of second string\n int[][] dp = new int[n+1][n+1];\n \n //Looping through start and end of the string. Thus dp will consider the string from start and string from end and then store the ans\n for (int i = 0; i < n; ++i){\n for (int j = 0; j < n; ++j){\n \n //If both the characters are equal, then we increment the previous dp value otherwise we take max of the next character considered for both strings\n dp[i + 1][j + 1] = s.charAt(i) == s.charAt(n - 1 - j) ? dp[i][j] + 1 : Math.max(dp[i][j + 1], dp[i + 1][j]);\n } \n }\n //Returning ans\n return n - dp[n][n];\n }", "private boolean detectRepeat(String substring) {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tchar actual=substring.charAt(i);\n\t\t\t\n\t\t\tint j=i+1;\n\t\t\t//Los anteriores ya se han comprobado\n\t\t\tfor (; j < substring.length() && actual!=substring.charAt(j) ; j++);\n\t\t\t\n\t\t\tif (j<substring.length()) return true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public int minCut4(String s) {\n boolean[][] dp = new boolean[s.length()][s.length()];\n for (int len = 1; len <= s.length(); len++) {\n for (int i = 0; i <= s.length() - len; i++) {\n int j = i + len - 1;\n dp[i][j] = s.charAt(i) == s.charAt(j) && (len < 3 || dp[i + 1][j - 1]);\n }\n }\n\n Map<Integer, Integer> memo = new HashMap<>();\n\n int[] res = new int[1];\n res[0] = Integer.MAX_VALUE;\n\n helper3(s, 0, res, 0, dp, memo);\n return res[0];\n }", "boolean isSubStr(String s, String t) {\n\t\tint k = 0;\n\t\tfor (int i = 0; i < s.length(); ++i) {\n\t\t\tboolean found = false;\n\t\t\tfor (; k < t.length(); ++k) if (found = (t.charAt(k) == s.charAt(i))) break;\n\t\t\tif (!found) return false;\n\t\t\t++k;\n\t\t}\n\t\treturn true;\n\t}", "public int countPalindromicSubsequences(String s) {\n \n Integer[][][] memo = new Integer[s.length()][s.length()][4];\n \n int ans = 0;\n for (int i = 0; i < 4; i++) {\n ans = (ans + distinct(s, memo, 0, s.length() - 1, i)) % MOD;\n }\n \n return ans;\n }", "static String repeat(String s, int n)\n {\n // Copying given string to temparory string.\n String s1 = s;\n\n for (int i = 1; i < n; i++)\n s = s + s1; // Concatenating strings\n\n return s;\n }", "private static int solution4(String s) {\r\n int n = s.length(), ans = 0;\r\n Map<Character, Integer> map = new HashMap<>();\r\n for (int j = 0, i = 0; j < n; j++) {\r\n if (map.containsKey(s.charAt(j)))\r\n i = Math.max(map.get(s.charAt(j)), i);\r\n ans = Math.max(ans, j - i + 1);\r\n map.put(s.charAt(j), j + 1);\r\n }\r\n return ans;\r\n }", "public static String findRepetitivePattern(String s) {\n if (s.isEmpty()) {\n return s;\n }\n int n = 0;\n int pLength = 1;\n\n int i = 1;\n char[] arr = s.toCharArray();\n while (i < arr.length) {\n\n boolean patternMatched = true;\n for (int j = 0; j < pLength && i + j < arr.length; ++j) {\n int k = i + j;\n if (k >= arr.length || arr[j] != arr[k]) {\n patternMatched = false;\n break;\n }\n }\n if (patternMatched) {\n n++;\n i += pLength;\n } else {\n i += 1;\n pLength = i;\n n = 0;\n }\n }\n return String.copyValueOf(arr, 0, pLength);\n }" ]
[ "0.71704537", "0.7083379", "0.7058046", "0.70555305", "0.70498514", "0.69665885", "0.69652015", "0.69543386", "0.6895479", "0.6866714", "0.6861215", "0.67622995", "0.6762007", "0.67218053", "0.6713364", "0.66968286", "0.6634107", "0.6600069", "0.6534979", "0.6533949", "0.6464347", "0.64537853", "0.6447496", "0.64421874", "0.6437693", "0.6420544", "0.6390806", "0.6383691", "0.6378389", "0.63545215", "0.63526106", "0.630764", "0.63075745", "0.6299292", "0.6279746", "0.62727153", "0.6271413", "0.6271316", "0.6266176", "0.6249193", "0.62444556", "0.6232699", "0.6224659", "0.6222873", "0.62226933", "0.62176496", "0.62140065", "0.62137294", "0.61828613", "0.61801296", "0.6179741", "0.6165078", "0.6161806", "0.61522335", "0.6151846", "0.6135495", "0.613038", "0.6126343", "0.61255425", "0.6125465", "0.61250025", "0.61232966", "0.611007", "0.6099018", "0.6091536", "0.6091163", "0.60819334", "0.6074468", "0.6065948", "0.6063526", "0.60627776", "0.6057527", "0.60475445", "0.60411626", "0.60247", "0.60217905", "0.6008465", "0.60036397", "0.60032177", "0.59683573", "0.59585094", "0.5957208", "0.5956555", "0.5953068", "0.59445626", "0.5940201", "0.5940006", "0.59360623", "0.5925415", "0.5925124", "0.5921301", "0.5899988", "0.5899447", "0.5899259", "0.5893696", "0.5890168", "0.5884786", "0.58836573", "0.58806217", "0.5878762" ]
0.6092538
64
TODO: need a better way to handle C build system with adding components
@Override public List<FileObject> createBuildSystem(Space s, List<FileObject> files) { TemplatePair tmpl_extra = new TemplatePair("linker_script", s.getName()); TemplatePair tmpl_extra1 = new TemplatePair("sdk_config", "sdk_config"); List<TemplatePair> make_addons = new ArrayList<>(); make_addons.add(tmpl_extra); //make_addons.add(tmpl_extra1); List<FileObject> all_files = new ArrayList<>(super.createBuildSystem(s,files, NrfPlatformOptions.getInstance(), make_addons)); all_files.add(makeLinkerScript(tmpl_extra)); //all_files.add(makeConfigFile(tmpl_extra1, build_nrf_config_file(s))); return all_files; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addBuildables(){\n this.allBuildables.add(new Nexus());\n this.allBuildables.add(new Pylon());\n this.allBuildables.add(new Assimilator());\n this.allBuildables.add(new Gateway());\n this.allBuildables.add(new CyberneticsCore());\n this.allBuildables.add(new RoboticsFacility());\n this.allBuildables.add(new Stargate());\n this.allBuildables.add(new TwilightCouncil());\n this.allBuildables.add(new TemplarArchives());\n this.allBuildables.add(new DarkShrine());\n this.allBuildables.add(new RoboticsBay());\n this.allBuildables.add(new FleetBeacon());\n this.allBuildables.add(new Probe());\n this.allBuildables.add(new Zealot());\n this.allBuildables.add(new Stalker());\n this.allBuildables.add(new Sentry());\n this.allBuildables.add(new Observer());\n this.allBuildables.add(new Immortal());\n this.allBuildables.add(new Phoenix());\n this.allBuildables.add(new VoidRay());\n this.allBuildables.add(new Colossus());\n this.allBuildables.add(new HighTemplar());\n this.allBuildables.add(new DarkTemplar());\n this.allBuildables.add(new Carrier());\n }", "protected void installComponents() {\n\t}", "protected void installComponents() {\n }", "String constructComponentName() {\n return base + nameCounter++;\n }", "@Override\n protected TsArtifact composeApplication() {\n final TsQuarkusExt extH = new TsQuarkusExt(\"ext-h\");\n install(extH);\n final TsQuarkusExt extIConditional = new TsQuarkusExt(\"ext-i-conditional\");\n extIConditional.setDependencyCondition(extH);\n install(extIConditional);\n\n final TsQuarkusExt extGConditional = new TsQuarkusExt(\"ext-g-conditional\");\n\n final TsQuarkusExt extA = new TsQuarkusExt(\"ext-a\");\n extA.setConditionalDeps(extGConditional);\n\n final TsQuarkusExt extB = new TsQuarkusExt(\"ext-b\");\n extB.addDependency(extA);\n\n final TsQuarkusExt extC = new TsQuarkusExt(\"ext-c\");\n extC.addDependency(extB);\n\n final TsQuarkusExt extD = new TsQuarkusExt(\"ext-d\");\n extD.addDependency(extB);\n\n final TsQuarkusExt extEConditional = new TsQuarkusExt(\"ext-e-conditional\");\n extEConditional.setDependencyCondition(extB);\n install(extEConditional);\n\n final TsQuarkusExt extF = new TsQuarkusExt(\"ext-f\");\n extF.setConditionalDeps(extEConditional, extIConditional);\n\n extGConditional.setDependencyCondition(extC);\n extGConditional.addDependency(extF);\n install(extGConditional);\n\n addToExpectedLib(extA.getRuntime());\n addToExpectedLib(extB.getRuntime());\n addToExpectedLib(extC.getRuntime());\n addToExpectedLib(extD.getRuntime());\n addToExpectedLib(extEConditional.getRuntime());\n addToExpectedLib(extF.getRuntime());\n addToExpectedLib(extGConditional.getRuntime());\n\n return TsArtifact.jar(\"app\")\n .addManagedDependency(platformDescriptor())\n .addManagedDependency(platformProperties())\n .addDependency(extC)\n .addDependency(extD);\n }", "private ArrayList<String> javaCommadBuilder(StringBuilder currentFile)\n\t{\n\t\tArrayList<String> command = new ArrayList<String>(Arrays.asList(\"java\", \"-cp\", \"Class\", \"CCLRun\"));\n\t\tcommand.add(currentFile.toString().substring(0, currentFile.toString().indexOf(\".\")));\n\t\treturn command;\n\t}", "private void addComponents() {\n LOOGER.info(\"Get add Components Entry\");\n // Adding loadButton to first row.\n this.add(loadButton);\n\n // Adding fillButton to first row.\n this.add(fillButton);\n\n // Adding deleteButton to first row.\n this.add(deleteButton);\n LOOGER.info(\"add Components exit\");\n }", "default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }", "@Override\n public void addComponent(String name, AbstractProcess component)\n {\n components.add(name, component);\n addProcessToExec(name, component);\n }", "public abstract void compile();", "void addComponents();", "@Override\n\tpublic void buildComponent(StructureComponent structurecomponent, List list, Random random) {\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 void add(Component c){}", "protected void buildBlockBuildFunction(String block) {\n\t\toutputList.add(new OutputLine(indentLvl, \"\")); \t\n\t\toutputList.add(new OutputLine(indentLvl++, \"virtual function void build();\"));\n\t\t\n\t\t// add subcomponent build statements\n\t\tList<SpecialLine> buildList = subcompBuildList.getStatements(block);\n\t\tif (buildList != null) {\n\t\t\tIterator<SpecialLine> iter = buildList.iterator();\n\t\t\t// traverse subcomponent list\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tSpecialLine line = iter.next();\n\t\t\t\tline.setIndent(indentLvl);\n\t\t\t\toutputList.add(line);\n\t\t\t} \n\t\t}\t\t\t\t\t\n\t\toutputList.add(new OutputLine(--indentLvl, \"endfunction: build\"));\n\t}", "public synchronized void addBuildDirectoryCP(File f) { buildCP.add(f); }", "boolean includeLibsComponent();", "public void addComponent(Component c);", "default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }", "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 }", "private void startComponents(){\n\n if(isAllowed(sentinel)){\n SentinelComponent sentinelComponent = new SentinelComponent(getInstance());\n sentinelComponent.getCanonicalName();\n }\n\n if(isAllowed(\"fileserver\")){\n FileServer fileServer = new FileServer(getInstance());\n fileServer.getCanonicalName();\n }\n\n if(isAllowed(\"manager\")){\n ManagerComponent Manager = new ManagerComponent(getInstance());\n Manager.getCanonicalName();\n }\n\n// if(isAllowed(\"sdk\")){\n// SDK sdk = new SDK(getInstance());\n// sdk.getCanonicalName();\n// }\n\n if(isAllowed(\"centrum\")){\n CentrumComponent centrum1 = new CentrumComponent(getInstance(), null);\n centrum1.getCanonicalName();\n }\n\n }", "private void addMultiJobBuildCommand() {\r\n \tString html_text = \"\";\r\n String report_format=\"\";\r\n\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n report_format = \"HTML\";\r\n } else {\r\n html_text = \".txt\";\r\n report_format = \"TEXT\";\r\n }\r\n\r\n String win =\r\n\"set VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupWin() + \"\\n\";\r\n if (isUsingSCM()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\extract_build_dir.py\\\"\\n\";\r\n }\r\n if (getOptionUseReporting()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\incremental_build_report_aggregator.py\\\" --rptfmt \" + report_format + \"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status=@PROJECT_BASE@_full_report.html\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status > @PROJECT_BASE@_full_report.txt\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=aggregate --output=\\\\\\\"@PROJECT_BASE@_aggregate_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=metrics --output=\\\\\\\"@PROJECT_BASE@_metrics_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=environment --output=\\\\\\\"@PROJECT_BASE@_environment_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\gen-combined-cov.py\\\" \\\"@PROJECT_BASE@_aggregate_report.html\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\getTotals.py\\\" @PROJECT_BASE@_full_report.txt\\n\";\r\n }\r\n win +=\r\ngetEnvironmentTeardownWin() + \"\\n\";\r\n win = StringUtils.replace(win, \"@PROJECT@\", getManageProjectName());\r\n win = StringUtils.replace(win, \"@PROJECT_BASE@\", getBaseName());\r\n\r\n String unix =\r\n\"export VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupUnix() + \"\\n\";\r\n if (isUsingSCM()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/extract_build_dir.py\\\"\\n\";\r\n }\r\n if (getOptionUseReporting()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/incremental_build_report_aggregator.py\\\" --rptfmt \" + report_format + \"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status=@PROJECT_BASE@_full_report.html\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status > @PROJECT_BASE@_full_report.txt\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=aggregate --output=\\\\\\\"@PROJECT_BASE@_aggregate_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=metrics --output=\\\\\\\"@PROJECT_BASE@_metrics_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=environment --output=\\\\\\\"@PROJECT_BASE@_environment_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/gen-combined-cov.py\\\" \\\"@PROJECT_BASE@_aggregate_report.html\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/getTotals.py\\\" @PROJECT_BASE@_full_report.txt\\n\" +\r\n\"\\n\";\r\n }\r\n unix +=\r\ngetEnvironmentTeardownUnix() + \"\\n\";\r\n unix = StringUtils.replace(unix, \"@PROJECT@\", getManageProjectName());\r\n unix = StringUtils.replace(unix, \"@PROJECT_BASE@\", getBaseName());\r\n \r\n VectorCASTCommand command = new VectorCASTCommand(win, unix);\r\n getTopProject().getBuildersList().add(command);\r\n }", "private void addBuildCommands(Project project, MultiJobDetail detail, String baseName, String name) {\r\n String report_format=\"\";\r\n String html_text=\"\";\r\n\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n report_format = \"HTML\";\r\n } else {\r\n html_text = \".txt\";\r\n report_format = \"TEXT\";\r\n }\r\n\r\n String win =\r\n\"set VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupWin() + \"\\n\";\r\n win +=\r\ngetExecutePreambleWin() +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=\" + report_format + \"\\\"\\n\" +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --level @LEVEL@ -e @ENV@ --build-execute --incremental --output @NAME@_rebuild\" + html_text + \"\\\"\\n\" +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=HTML\\\"\\n\";\r\n\r\n if (isUsingSCM()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\copy_build_dir.py\\\" \\\"@PROJECT@\\\" @LEVEL@ @BASENAME@ @ENV@\\n\";\r\n }\r\n win +=\r\ngetEnvironmentTeardownWin() + \"\\n\" +\r\n\"\\n\";\r\n win = StringUtils.replace(win, \"@PROJECT@\", getManageProjectName());\r\n win = StringUtils.replace(win, \"@LEVEL@\", detail.getLevel());\r\n win = StringUtils.replace(win, \"@ENV@\", detail.getEnvironment());\r\n win = StringUtils.replace(win, \"@BASENAME@\", baseName);\r\n win = StringUtils.replace(win, \"@NAME@\", name);\r\n \r\n String unix = \r\n\"export VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupUnix() + \"\\n\";\r\n unix +=\r\ngetExecutePreambleUnix() +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=\" + report_format + \"\\\"\\n\" +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --level @LEVEL@ -e @ENV@ --build-execute --incremental --output @NAME@_rebuild\" + html_text + \"\\\"\\n\" +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=HTML\\\"\\n\";\r\n if (isUsingSCM()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/copy_build_dir.py\\\" \\\"@PROJECT@\\\" @LEVEL@ @BASENAME@ @ENV@\\n\";\r\n }\r\n unix +=\r\ngetEnvironmentTeardownUnix() + \"\\n\" +\r\n\"\\n\";\r\n unix = StringUtils.replace(unix, \"@PROJECT@\", getManageProjectName());\r\n unix = StringUtils.replace(unix, \"@LEVEL@\", detail.getLevel());\r\n unix = StringUtils.replace(unix, \"@ENV@\", detail.getEnvironment());\r\n unix = StringUtils.replace(unix, \"@BASENAME@\", baseName);\r\n unix = StringUtils.replace(unix, \"@NAME@\", name);\r\n\r\n VectorCASTCommand command = new VectorCASTCommand(win, unix);\r\n project.getBuildersList().add(command);\r\n }", "ComponentType createComponentType();", "@Override\n\tpublic void buildComponent(StructureComponent structurecomponent, List list, Random random) {\n\t\t;\n\t}", "private void addComponents()\n\t{\n\t\tint x = 10;\n\t\tint y = 10;\n\t\tint stepY = 25;\n\t\taddFrequencyRouter(x,y);\n\t\ty = y + stepY;\n\t\taddFrequencyIpInput(x,y);\n\t\ty = y + stepY;\n\t\taddFrequencyIpOutput(x,y);\n\t\ty = y + stepY;\n\t\taddOk(x+80,y);\n\t}", "private void addComponents() {\n\t\tthis.add(btn_pause);\n\t\tthis.add(btn_continue);\n\t\tthis.add(btn_restart);\n\t\tthis.add(btn_rank);\n\t\tif(Config.user.getUsername().equals(\"root\")) {\n\t\t\tthis.add(btn_admin);\n\t\t}\n\t\n\t\t\n\t}", "private void createComponentFramework(\n\t\t\tint numberOfComponentNames,\n\t\t\tint depthOfComponentTree,\n\t\t\tint maxOutDegreeOfComponents) {\n\t\tObject root = \"root\";\n\t\tthis.myComponentFramework.getComponentTree().addVertex(root);\n\t\tthis.myComponentFramework.getComponentTree().setRoot(root);\n\t\tthis.myComponentFramework.extractInformationFor(root, \"N\"+ThreadLocalRandom.current().nextInt(0, numberOfComponentNames));\n\t\ttry{\n\t\t\trecurseAndCreateComponentTree(root,numberOfComponentNames,depthOfComponentTree-1,maxOutDegreeOfComponents);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t}", "public interface ComponentBuilder {\n interface CommonComponent {\n\n /**\n * The name of the component\n *\n * @return the name of the component\n */\n ComponentBuilder named(String label);\n }\n\n interface Command extends CommonComponent {\n\n /**\n * Used to handle the execution of the command\n * @param commandExecute execution handler\n */\n Command handleExecute(CommandExecute commandExecute);\n\n Command addCommand(Consumer<Command> commandBuilder);\n\n <T extends Argument> Command addArg(T argument, Consumer<T> argumentBuilderConsumer);\n\n Command addArg(Consumer<Argument> consumer);\n }\n\n interface Argument<T> extends CommonComponent {\n\n /**\n * Handle tab completion at the place of the argument\n *\n * @param complete handler for the completion\n */\n Argument<T> handleTabComplete(@NonNull TabComplete complete);\n\n /**\n * Parse input into object\n *\n * @param parser function which parses string into object\n */\n Argument<T> parse(Function<String, ParseResult<T>> parser);\n\n /**\n * Should the argument be optional? Remember that optional arguments should be last\n *\n * @param optional if the argument should be optional\n */\n Argument<T> optional(boolean optional);\n }\n}", "private void addComponents()\n\t{\n\t\tPrinter currentPrinter;\n\t\tadd(m_ResultHeader);\n\t\tfor(int i = 2; i <= m_PrinterList.getNumberOfPrinters()+1; i++)\n\t\t{\n\t\t\t// Convert values to Strings\n\t\t\tcurrentPrinter = m_PrinterList.getPrinter(i-2);\n\t\t\tadd(new PrinterLabel(i,MenuWindow.FRAME_WIDTH , MenuWindow.FRAME_HEIGHT,\n\t\t\t\t\tcurrentPrinter.getPrinterName()+ \"\",\n\t\t\t\t\tcurrentPrinter.getVendor(),\n\t\t\t\t\tcurrentPrinter.getTension()+ \"\",\n\t\t\t\t\tcurrentPrinter.getCompression()+ \"\",\n\t\t\t\t\tcurrentPrinter.getImpact()+ \"\",\n\t\t\t\t\tcurrentPrinter.materialsString(),\n\t\t\t\t\tcurrentPrinter.getTolerance()+ \"\",\n\t\t\t\t\tcurrentPrinter.getFinish()+ \"\", true));\n\t\t}\n\t}", "private void initcomponent() {\n\r\n\t}", "public void addToComponent(String objective, OpSystem system);", "private void writeComponents(HttpServletRequest request,\n HttpServletResponse response) throws ServletException, IOException, QuickFixException {\n AuraContext context = Aura.getContextService().getCurrentContext();\n List<String> namespaces = Lists.newArrayList(context.getPreloads());\n Set<BaseComponentDef> defs = Sets.newLinkedHashSet();\n \n for(Class<? extends BaseComponentDef> preloadType : preloadTypes) {\n addDefinitions(\"markup\", preloadType, namespaces, \":\", defs);\n }\n \n context.setPreloading(true);\n preloadSerialize(defs, BaseComponentDef.class, response.getWriter());\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "protected void addBuildFunction(S source) {\n Function build =\n FunctionBuilder.of(source, \"build\", Purpose.build())\n .setReturnValue(new DataObject(new ObjectName(\"Widget\"), new PackageName(\"com.dummy\")))\n .addArgument(\n new DataObject(\n new ObjectName(\"BuildContext\"),\n new PackageName(\"com.dummy\"),\n new VariableName(\"context\")))\n .build();\n\n source.addFunction(build);\n }", "private void createUIComponents() {\n }", "@Override\npublic void childComponentsAdditionStarted() {\n\t\n}", "private List<String> buildCommandLine()\n {\n List<String> commandLine = new ArrayList<String>();\n\n if (executable == null)\n {\n throw new CargoException(\"Java executable not set\");\n }\n commandLine.add(executable);\n\n commandLine.addAll(jvmArguments);\n commandLine.addAll(systemProperties);\n\n if (classpath != null && jarPath == null)\n {\n commandLine.add(\"-classpath\");\n commandLine.add(classpath);\n }\n\n if (jarPath != null)\n {\n commandLine.add(\"-jar\");\n commandLine.add(jarPath);\n }\n\n if (jarPath == null)\n {\n commandLine.add(mainClass);\n }\n commandLine.addAll(applicationArguments);\n\n return commandLine;\n }", "public void build() {\r\n\tfDoingBatchBuild = true;\r\n\tfNotifier = new BuildNotifier(fDC, true);\r\n\tgetBuilderEnvironment().setNotifier(fNotifier);\r\n\tfNotifier.begin();\r\n\ttry {\r\n\t\tfNewState.readClassPath();\r\n\t\tfNotifier.subTask(Util.bind(\"build.scrubbingOutput\"/*nonNLS*/));\r\n\t\tfNewState.getBinaryOutput().scrubOutput();\r\n\t\tfNotifier.updateProgressDelta(0.05f);\r\n\t\tfNotifier.subTask(Util.bind(\"build.analyzingPackages\"/*nonNLS*/));\r\n\t\tfNewState.buildInitialPackageMap();\r\n\t\tfNotifier.updateProgressDelta(0.05f);\r\n\r\n\t\t/* Force build all in build context */\r\n\t\tfNotifier.subTask(Util.bind(\"build.analyzingSources\"/*nonNLS*/));\r\n\t\tIPackage[] pkgs = fNewState.getPackageMap().getAllPackagesAsArray();\r\n\t\tfor (int i = 0; i < pkgs.length; ++i) {\r\n\t\t\tfNotifier.checkCancel();\r\n\t\t\tSourceEntry[] entries = fNewState.getSourceEntries(pkgs[i]);\r\n\t\t\tif (entries != null) {\r\n\t\t\t\tfor (int j = 0; j < entries.length; ++j) {\r\n\t\t\t\t\tSourceEntry sEntry = entries[j];\r\n\t\t\t\t\tif (sEntry.isSource()) {\r\n\t\t\t\t\t\tPackageElement element = fNewState.packageElementFromSourceEntry(sEntry);\r\n\t\t\t\t\t\tfWorkQueue.add(element);\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\tfNotifier.updateProgressDelta(0.05f);\r\n\t\tVector vToCompile = fWorkQueue.getElementsToCompile();\r\n\t\tif (vToCompile.size() > 0) {\r\n\t\t\tfNotifier.setProgressPerCompilationUnit(0.75f / vToCompile.size());\r\n\t\t\tcompile(vToCompile);\r\n\t\t}\r\n\t\t/* Copy resources to binary output */\r\n\t\tnew ProjectResourceCopier(fNewState.getJavaProject(), fDC, fNotifier, 0.10f).copyAllResourcesOnClasspath();\r\n\t\t\r\n\t\tfNotifier.done();\r\n\t} finally {\r\n\t\tcleanUp();\r\n\t}\r\n}", "private static void addComponent() throws Exception {\n\t\tList<Component> list_components = componentManager.showComponents();\n\t\tfor (Component components : list_components) {\n\t\t\tSystem.out.println(components);\n\t\t}\n\t\tInteger id = new Integer(0);\n\t\tboolean wrongtext = false;\n\t\tdo {\n\t\t\tSystem.out.println(\"Introduce the selected component's id\");\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tid = Integer.parseInt(reader.readLine());\n\t\t\t\t\twrongtext = false;\n\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\twrongtext = true;\n\t\t\t\t\tSystem.out.println(\"It's not a int, please enter a int.\");\n\t\t\t\t}\n\t\t\t} while (wrongtext);\n\t\t} while (componentManager.getComponent(id) == null);\n\t\tComponent toBeModified = componentManager.getComponent(id);\n\t\tSystem.out.println(toBeModified);\n\t\tint preexistingNumber = toBeModified.getNumberComponents();\n\t\tSystem.out.println(\"The number of components that are now avaiable are: \" + preexistingNumber);\n\t\t// System.out.println(\"Introduce the number of components you want to add: \");\n\t\tInteger numbercomponents = new Integer(0);\n\t\tboolean wrongtext1 = false;\n\t\tdo {\n\t\t\tSystem.out.println(\"Introduce the number of components you want to add: \");\n\t\t\ttry {\n\t\t\t\tnumbercomponents = Integer.parseInt(reader.readLine());\n\t\t\t\twrongtext1 = false;\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\twrongtext1 = true;\n\t\t\t\tSystem.out.println(\"It's not a int, please enter a int.\");\n\t\t\t}\n\t\t} while (wrongtext1);\n\t\tint updatedNumber = preexistingNumber + numbercomponents;\n\t\t// Component updateComponent=new Component(updatedNumber);\n\t\ttoBeModified.setNumberComponents(updatedNumber);\n\t\tcomponentManager.update(toBeModified);\n\t}", "protected void buildBootstrap() {\n String command = \"-prod -mac -o2 rom -strip:d j2me imp\";\n if (includeDebugger) {\n command += \" debugger\";\n }\n command += \" -- translator\";\n builder(command);\n }", "public void addComponents(){\n add(spelerIDLabel);\n add(typeLabel);\n add(codeLabel);\n add(heeftBetaaldLabel);\n\n add(spelerIDField);\n add(typeField);\n add(codeField);\n add(heeftBetaaldField);\n\n add(klaarButton);\n add(terugButton);\n\n }", "@Override\n\tpublic void addComponent(Component c) {\n\t\troot.addComponent(c);\n\t}", "String constructComponentName() {\n synchronized (Button.class) {\n return base + nameCounter++;\n }\n }", "public Boolean buildChassisAndThenComponents(BuildInstructions instructions, MapLocation location) {\n Chassis chassis = instructions.getBaseChassis();\n if (compHandler.buildChassis(chassis, location)) {\n startBuildingComponents(instructions, location, chassis.level);\n return true;\n } else {\n return false;\n }\n }", "public void addComponent(String name, Component newComp);", "public void build() {\r\n // TODO\r\n }", "public void addComponents(Component... components);", "public void addComponents()\r\n\t{\n\t\tSteveTechFarming.fruit = new BlockFruit(SteveTechFarming.config.getBlockID(1202, \"Fruit\", null)).setBlockName(\"WiduX-SteveTech-Farm-Fruit\");\r\n\t\tSteveTechFarming.crops = new BlockCrops(SteveTechFarming.config.getBlockID(1203, \"Crops\", null)).setBlockName(\"WiduX-SteveTech-Farm-Crops\");\r\n\t\t\r\n\t\tSteveTechFarming.seeds = new ItemSeeds(SteveTechFarming.config.getItemID(11000, \"Seeds\", null)).setItemName(\"WiduX-SteveTech-Farm-Seeds\");\r\n\t\tSteveTechFarming.harvestedItems = new ItemHarvest(SteveTechFarming.config.getItemID(11002, \"Harvest\", null)).setItemName(\"WiduX-SteveTech-Farm-Harvest\");\r\n\t\tSteveTechFarming.creativeTools = new ItemCreativeTools(SteveTechFarming.config.getItemID(11001, \"Creative Tools\", null)).setItemName(\"WiduX-SteveTech-Farm-CTools\");\r\n\t\tSteveTechFarming.foods = new Item[EnumFood.getNumberFoods()];\r\n\t\tint firstFoodItemID = SteveTechFarming.config.getItemID(11003, \"Foods Array\", \"This is the first item ID in the list of foods. Item IDs used will start here, and use the next \" + EnumFood.getNumberFoods() + \" IDs. Make sure they are all available.\");\r\n\t\tfor(int idOffset = 0; idOffset < SteveTechFarming.foods.length; idOffset++)\r\n\t\t{\r\n\t\t\tEnumFood food = EnumFood.getFood(idOffset);\r\n\t\t\tSteveTechFarming.foods[idOffset] = new ItemSTFood(firstFoodItemID + idOffset, food).setItemName(\"WiduX-SteveTech-Farm-Foods-Food\" + idOffset);\r\n\t\t}\r\n\t}", "public abstract void updateMainComponents(String component);", "private void addComponents() {\n\t\tadd(newGame);\n\t\tadd(nameLabel);\n\t\tadd(nameField);\n\t\tadd(addPlayer);\n\t\tadd(gameTextPane);\n\t\tadd(playGame);\t\n\t\tadd(takeTurn);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//v0.1.1 change\n\t}", "void addComponent(Component component);", "private synchronized void addBuildWrapperPath(ProcessBuilder pb){\r\n \t\tif (needPath==null || needPath.booleanValue() && bwPath!=null){\r\n \t\t\tneedPath=false;\r\n \t\t\tString path=new File(bwPath).getParent();\r\n \t\t\tif (path!=null){\r\n \t\t\t\tMap<String,String> env=pb.environment();\r\n \t\t\t\tString pathValue=env.get(\"PATH\");\r\n \t\t\t\tif (Boolean.TRUE.equals(needPath) || pathValue==null || pathValue.length()==0 || !pathValue.contains(path)){\r\n \t\t\t\t\tif (pathValue==null || pathValue.length()==0){\r\n \t\t\t\t\t\tpathValue=path;\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tpathValue+=File.pathSeparator+path;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tenv.put(\"PATH\",pathValue);\r\n \t\t\t\t\tneedPath=true;\r\n \t\t\t\t} \r\n \t\t\t}\r\n \t\t}\r\n \t}", "@Override\npublic void add(VirtualContainer parent, VirtualComponent comp, int pos) {\n\t\n}", "private static void buildFramework() {\n \tLOG.info(\"Begin building of shared framework.\");\n \t\n \tLOG.debug(\"Create a IterativeFileReader.\");\n \tIterativeFileReader iterativeFileReader = (IterativeFileReader) ReaderFactory.instance().getIterativeFileReader();\n \tLOG.debug(\"Create a TextFileLineReader.\");\n \tTextFileLineReader textFileLineReader = (TextFileLineReader) ReaderFactory.instance().getTextFileLineReader();\n \t\n \t// Setup IterativeFileReader\n \tFile dir = new File(clArgs.buildFrameworkInDir);\n \titerativeFileReader.setFile(dir);\n \titerativeFileReader.setFileFilter(FileUtil.acceptOnlyClusterFilesFilter());\n \titerativeFileReader.setReader(textFileLineReader);\n \t\n \t// Setup processor\n \tLOG.debug(\"Create a SharedFrameworkProcessor.\");\n \tSharedFrameworkProcessor sharedFrameworkProcessor = new SharedFrameworkProcessor();\n \ttextFileLineReader.setProcessor(sharedFrameworkProcessor);\n \t// Get informed about the finishing of each cluster (file) to reset the processor's status\n \ttextFileLineReader.attach(sharedFrameworkProcessor, Interests.HasFinished);\n \t// Get informed about the finishing of all clusters to give each cluster in the generated graph a pretty id\n \titerativeFileReader.attach(sharedFrameworkProcessor, Interests.HasFinished);\n \t\n \titerativeFileReader.read();\n \t\n \tLOG.info(\"Finished building shared framework.\");\n }", "public interface BuildMainSpaceAPI extends API {\n\n /**\n * Build all assets of the main code space.\n *\n * <ul>\n * <li>Compile sources and jar generated classes\n * <li>Check modules\n * <li>Generate API documentation\n * <li>Generate custom runtime image\n * </ul>\n *\n * @see #buildMainBuildModules()\n * @see #buildMainCheckModules()\n * @see #buildMainGenerateAPIDocumentation()\n * @see #buildMainGenerateCustomRuntimeImage()\n */\n default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }\n\n /** Compile and jar main modules. */\n default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }\n\n /** Check main modules. */\n default void buildMainCheckModules() {\n if (!bach().project().settings().tools().enabled(\"jdeps\")) return;\n say(\"Check main modules\");\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n var jdeps = new ArrayList<JDeps>();\n for (var declaration : modules.map().values()) {\n jdeps.add(buildMainJDeps(declaration));\n }\n bach().run(jdeps.stream()).requireSuccessful();\n }\n\n /** Generate HTML pages of API documentation from main modules' source files. */\n default void buildMainGenerateAPIDocumentation() {\n if (!bach().project().settings().tools().enabled(\"javadoc\")) return;\n say(\"Generate API documentation\");\n var api = bach().folders().workspace(\"documentation\", \"api\");\n bach().run(buildMainJavadoc(api)).requireSuccessful();\n bach().run(buildMainJavadocJar(api)).requireSuccessful();\n }\n\n /** Assemble and optimize main modules and their dependencies into a custom runtime image. */\n default void buildMainGenerateCustomRuntimeImage() {\n if (!bach().project().settings().tools().enabled(\"jlink\")) return;\n say(\"Assemble custom runtime image\");\n var image = bach().folders().workspace(\"image\");\n Paths.deleteDirectories(image);\n bach().run(buildMainJLink(image));\n }\n\n default void buildMainSpaceClassesForJava8(Path classes) {\n var project = bach().project();\n var folders = project.settings().folders();\n var main = project.spaces().main();\n var classPaths = new ArrayList<Path>();\n main.declarations().toNames().forEach(name -> classPaths.add(classes.resolve(name)));\n classPaths.addAll(Paths.list(bach().folders().externalModules(), Paths::isJarFile));\n var javacs = new ArrayList<Javac>();\n for (var declaration : main.declarations().map().values()) {\n var name = declaration.name();\n var sources = declaration.sources();\n var root = sources.list().isEmpty() ? folders.root() : sources.first().path();\n var java8Files = Paths.find(root, 99, BuildMainSpaceAPI::isJava8File);\n if (java8Files.isEmpty()) continue; // skip aggregator module\n var compileSources =\n Command.javac()\n .with(\"--release\", main.release()) // 8\n .with(\"--class-path\", classPaths)\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes.resolve(name))\n .withAll(java8Files);\n javacs.add(compileSources);\n }\n if (javacs.isEmpty()) return; // no javac command collected\n bach().run(javacs.stream()).requireSuccessful();\n }\n\n /** Test supplied path for pointing to a Java 8 compilation unit. */\n private static boolean isJava8File(Path path) {\n var name = Paths.name(path);\n return !path.startsWith(\".bach\") // ignore all files in `.bach` directory\n && name.endsWith(\".java\")\n && !name.equals(\"module-info.java\") // ignore module declaration compilation units\n && Files.isRegularFile(path);\n }\n\n /**\n * {@return the {@code javac} call to compile all configured modules of the main space}\n *\n * @param release the Java feature release number to compile modules for\n */\n default Javac buildMainJavac(int release, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javac()\n .ifTrue(release != 0, javac -> javac.with(\"--release\", release))\n .with(\"--module\", main.declarations().toNames(\",\"))\n .with(\"--module-version\", project.version())\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javac, path) -> javac.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes);\n }\n\n /** {@return the {@code javac} call to compile a specific version of a multi-release module} */\n default Javac buildMainJavac(LocalModule local, SourceFolder folder, Path classes) {\n var name = local.name();\n var project = bach().project();\n var main = project.spaces().main();\n var release = folder.release();\n var javaSourceFiles = Paths.find(folder.path(), 99, Paths::isJavaFile);\n return Command.javac()\n .with(\"--release\", release)\n .with(\"--module-version\", project.version())\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .with(\"--class-path\", classes.resolve(name))\n .with(\"-implicit:none\") // generate classes for explicitly referenced source files\n .withAll(main.tweaks().arguments(\"javac\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + release + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \"@\" + release + \")\"))\n .with(\"-d\", buildMultiReleaseClassesDirectory(name, release))\n .withAll(javaSourceFiles);\n }\n\n private Path buildMultiReleaseClassesDirectory(String module, int release) {\n return bach().folders().workspace(\"classes-mr-\" + release, module);\n }\n\n default Jar buildMainJar(LocalModule local, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n var name = local.name();\n var file = bach().folders().workspace(\"modules\", buildMainJarFileName(name));\n var mainClass = local.reference().descriptor().mainClass();\n var jar =\n Command.jar()\n .ifTrue(bach().is(Flag.VERBOSE), command -> command.with(\"--verbose\"))\n .with(\"--create\")\n .with(\"--file\", file)\n .ifPresent(mainClass, (args, value) -> args.with(\"--main-class\", value))\n .withAll(main.tweaks().arguments(\"jar\"))\n .withAll(main.tweaks().arguments(\"jar(\" + name + \")\"));\n var baseClasses = classes.resolve(name);\n if (Files.isDirectory(baseClasses)) jar = jar.with(\"-C\", baseClasses, \".\");\n // include base resources\n for (var folder : local.resources().list()) {\n if (folder.isTargeted()) continue; // handled later\n jar = jar.with(\"-C\", folder.path(), \".\");\n }\n // add (future) targeted classes and targeted resources in ascending order\n for (int release = 9; release <= Runtime.version().feature(); release++) {\n var paths = new ArrayList<Path>();\n var isSourceTargeted = local.sources().stream(release).findAny().isPresent();\n if (isSourceTargeted) paths.add(buildMultiReleaseClassesDirectory(name, release));\n local.resources().stream(release).map(SourceFolder::path).forEach(paths::add);\n if (paths.isEmpty()) continue;\n jar = jar.with(\"--release\", release);\n for (var path : paths) jar = jar.with(\"-C\", path, \".\");\n }\n return jar;\n }\n\n default String buildMainJarFileName(String module) {\n return module + '@' + bach().project().versionNumberAndPreRelease() + \".jar\";\n }\n\n default JDeps buildMainJDeps(LocalModule local) {\n var folders = bach().folders();\n return Command.jdeps()\n .with(\"--check\", local.name())\n .with(\"--multi-release\", \"BASE\")\n .with(\"--module-path\", List.of(folders.workspace(\"modules\"), folders.externalModules()));\n }\n\n default Javadoc buildMainJavadoc(Path destination) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javadoc()\n .with(\"--module\", main.declarations().toNames(\",\"))\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javadoc, path) -> javadoc.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javadoc, paths) -> javadoc.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javadoc -> javadoc.with(\"-Xdoclint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javadoc\"))\n .with(\"-d\", destination);\n }\n\n /** {@return the jar call generating the API documentation archive} */\n default Jar buildMainJavadocJar(Path api) {\n var project = bach().project();\n var file = project.name() + \"-api-\" + project.version() + \".zip\";\n return Command.jar()\n .with(\"--create\")\n .with(\"--file\", api.getParent().resolve(file))\n .with(\"--no-manifest\")\n .with(\"-C\", api, \".\");\n }\n\n default JLink buildMainJLink(Path image) {\n var project = bach().project();\n var main = project.spaces().main();\n var test = project.spaces().test();\n return Command.jlink()\n .ifPresent(main.launcher(), (jlink, launcher) -> jlink.with(\"--launcher\", launcher.value()))\n .with(\"--add-modules\", main.declarations().toNames(\",\"))\n .ifPresent(\n test.modulePaths().pruned(), (jlink, paths) -> jlink.with(\"--module-path\", paths))\n .withAll(main.tweaks().arguments(\"jlink\"))\n .with(\"--output\", image);\n }\n}", "public abstract void setupComponent();", "ComponentsType createComponentsType();", "public void addCompatibleComponent(Component c){\n compatibleComponents.add(c);\n }", "public abstract void add(KitComponent component);", "private ArrayList<String> javacCommandBuilder(StringBuilder currentProject, StringBuilder currentFile)\n\t{\n\t\tFile folder = new File(currentProject.toString());\n\t\tString[] files = folder.list();\n\t\tArrayList<String> command = new ArrayList<String>(Arrays.asList(\"javac\", \"-d\", \"Class\"));\n\t\t\n\t\tfor(String file : files)\n\t\t{\n\t\t\tcommand.add(currentProject.toString()+\"\\\\\"+file);\n\t\t}\n\t\treturn command;\n\t}", "abstract void depComponent(DepComponent depComponent);", "Lighter build();", "public void addComponents(){\r\n\r\n\t\t\tfor(int i=0; i < fieldNum ; i++){ \r\n\t\t\t\tadd(labels[i]);\r\n\t\t\t\tif(i==3){\r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t\t\tfor(int k=1;k<ingredientFields.size();k++)\r\n\t\t\t\t\t\tadd(ingredientFields.get(k));\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t}\r\n\r\n\t\t}", "java.lang.Object setupBuild(java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;", "@Test\n\tpublic void addNewOuterComponentTest2()\n\t{\n\t\tString methodName = new Object()\n\t\t{}.getClass().getEnclosingMethod().getName();\n\t\t\n\t\tDate startDate = DateUtils.rightNowDate();\n\t\t\n\t\tTestUtils.logTestStart(methodName, watcher.getLogger());\n\n\t\tString fileName = \"smallBom.xml\";\n\t\ttry (InputStream stream = getClass().getResourceAsStream(\"/\" + fileName))\n\t\t{\n\t\t\tBom sbom = SBomFileUtils.processInputStream(stream);\n\t\t\t\n\t\t\tList<Tool> orgTools = sbom.getMetadata().getTools();\n\t\t\t\n\t\t\tString toolName = \"testTool\";\n\t\t\tString toolVersion = \"1.1.2\";\n\t\t\t\n\t\t\tString compName = \"newComponent\";\n\t\t\tString compGroup = \"com.lmco.efoss\";\n\t\t\tString compVersion = \"1.5.1\";\n\t\t\tType compType = Component.Type.CONTAINER;\n\n\t\t\tComponent expectedComponent = new Component();\n\t\t\texpectedComponent.setName(compName);\n\t\t\texpectedComponent.setGroup(compGroup);\n\t\t\texpectedComponent.setVersion(compVersion);\n\t\t\texpectedComponent.setType(compType);\n\t\t\t\n\t\t\tComponentUtilities.addNewOuterComponent(sbom, toolName, toolVersion, compName, \n\t\t\t\t\tcompGroup, compVersion, compType.toString());\n\t\t\t\n\t\t\tMetadata metadata = sbom.getMetadata();\n\t\t\tComponent actualComponent = metadata.getComponent();\n\t\t\t\n\t\t\tComponentComparator comparator = new ComponentComparator();\n\t\t\t\n\t\t\tif (comparator.equals(expectedComponent, actualComponent))\n\t\t\t\twatcher.getLogger().info(\"Successfuly created a new Metadata Component!\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Failed to create the new Metadata Component:\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + ComponentUtilities.toString(expectedComponent, \"\t\t\") +\n\t\t\t\t\t\t\"\\n\tActual: \" + ComponentUtilities.toString(actualComponent, \"\t\t\"));\n\t\t\t\n\t\t\tAssert.assertTrue(comparator.equals(expectedComponent, actualComponent));\n\t\t\t\n\t\t\tList<Tool> tools = metadata.getTools();\n\t\t\tif ((orgTools.size() + 1) == tools.size())\n\t\t\t\twatcher.getLogger().info(\"Got the correct number of Tools (original plus one).\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Did NOT get the expected number of Tools.\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + (orgTools.size() + 1) +\n\t\t\t\t\t\t\"\\n\tGot: \" + tools.size());\n\t\t\t\n\t\t\tAssert.assertEquals((orgTools.size() + 1), tools.size());\n\t\t\t\n\t\t\tTool expectedTool = new Tool();\n\t\t\texpectedTool.setName(toolName);\n\t\t\texpectedTool.setVendor(\"Lockheed Martin\");\n\t\t\texpectedTool.setVersion(toolVersion);\n\t\t\t\n\t\t\tTool actualTool = tools.get(0);\n\t\t\tToolsCustomComparator toolComparator = new ToolsCustomComparator();\n\t\t\t\n\t\t\tif (toolComparator.equals(expectedTool, actualTool))\n\t\t\t\twatcher.getLogger().info(\"Created Expected Tool!\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Did NOT create the expected tool.\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + ToolsUtils.toString(expectedTool, \"\t\t\") + \"\\n\" +\n\t\t\t\t\t\t\"\\n\tGot: \" + ToolsUtils.toString(actualTool, \"\t\t\"));\n\t\t\t\n\t\t\tAssert.assertTrue(toolComparator.equals(expectedTool, actualTool));\n\t\t}\n\t\tcatch (SBomCommonsException sbomE)\n\t\t{\n\t\t\tString error = \"Unexpected error occurred while attempting to read SWBom from \" +\n\t\t\t\t\t\"input stream!\";\n\t\t\twatcher.getLogger().error(error, sbomE);\n\t\t\tAssert.fail(error);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tString error = \"Unexpected error occurred while attempting create a new Outer \" +\n\t\t\t\t\t\"empty component (with tool).\";\n\t\t\twatcher.getLogger().error(error, e);\n\t\t\tAssert.fail(error);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tTestUtils.logTestFinish(methodName, startDate, watcher.getLogger());\n\t\t}\n\t}", "public Component build(){\n\t\tif(children!=null)\n\t\t\tnew CollectionHelper.Iterator.Adapter.Default<Component>(children.getElements()){\n\t\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t\t@Override\n\t\t\t\tprotected void __executeForEach__(Component component) {\n\t\t\t\t\tcomponent.build();\n\t\t\t\t}\n\t\t\t}.execute();\n\t\t//built = ListenerHelper.getInstance()\n\t\t//\t\t.listenObject(Listener.COLLECTION, Listener.METHOD_NAME_BUILD, MethodHelper.Method.Parameter.buildArray(Component.class,this));\n\t\tbuilt = ClassHelper.getInstance().instanciateOne(Listener.class).build(this);\n\t\thasBeenBuilt = Boolean.TRUE;\n\t\treturn this;\n\t}", "@Test\n\tpublic void addNewOuterComponentTest3()\n\t{\n\t\tString methodName = new Object()\n\t\t{}.getClass().getEnclosingMethod().getName();\n\t\t\n\t\tDate startDate = DateUtils.rightNowDate();\n\t\t\n\t\tTestUtils.logTestStart(methodName, watcher.getLogger());\n\t\t\n\t\tString fileName = \"smallBom.xml\";\n\t\ttry (InputStream stream = getClass().getResourceAsStream(\"/\" + fileName))\n\t\t{\n\t\t\tBom sbom = SBomFileUtils.processInputStream(stream);\n\t\t\t\n\t\t\tList<Tool> orgTools = sbom.getMetadata().getTools();\n\t\t\t\n\t\t\tString toolName = \"testTool\";\n\t\t\tString toolVersion = \"1.1.2\";\n\t\t\t\n\t\t\tString compName = \"newComponent\";\n\t\t\tString compGroup = \"com.lmco.efoss\";\n\t\t\tString compVersion = \"1.5.1\";\n\t\t\tType compType = Component.Type.CONTAINER;\n\t\t\t\n\t\t\tComponent expectedComponent = new Component();\n\t\t\texpectedComponent.setName(compName);\n\t\t\texpectedComponent.setGroup(compGroup);\n\t\t\texpectedComponent.setVersion(compVersion);\n\t\t\texpectedComponent.setType(compType);\n\t\t\t\n\t\t\tComponentUtilities.addNewOuterComponent(sbom, toolName, toolVersion, compName,\n\t\t\t\t\tcompGroup, compVersion, null);\n\t\t\t\n\t\t\tMetadata metadata = sbom.getMetadata();\n\t\t\tComponent actualComponent = metadata.getComponent();\n\t\t\t\n\t\t\tComponentComparator comparator = new ComponentComparator();\n\t\t\t\n\t\t\tif (comparator.equals(expectedComponent, actualComponent))\n\t\t\t\twatcher.getLogger().info(\"Successfuly created a new Metadata Component!\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Failed to create the new Metadata Component:\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + ComponentUtilities.toString(expectedComponent, \"\t\t\") +\n\t\t\t\t\t\t\"\\n\tActual: \" + ComponentUtilities.toString(actualComponent, \"\t\t\"));\n\t\t\t\n\t\t\tAssert.assertTrue(comparator.equals(expectedComponent, actualComponent));\n\t\t\t\n\t\t\tList<Tool> tools = metadata.getTools();\n\t\t\tif ((orgTools.size() + 1) == tools.size())\n\t\t\t\twatcher.getLogger().info(\"Got the correct number of Tools (original plus one).\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Did NOT get the expected number of Tools.\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + (orgTools.size() + 1) +\n\t\t\t\t\t\t\"\\n\tGot: \" + tools.size());\n\t\t\t\n\t\t\tAssert.assertEquals((orgTools.size() + 1), tools.size());\n\t\t\t\n\t\t\tTool expectedTool = new Tool();\n\t\t\texpectedTool.setName(toolName);\n\t\t\texpectedTool.setVendor(\"Lockheed Martin\");\n\t\t\texpectedTool.setVersion(toolVersion);\n\t\t\t\n\t\t\tTool actualTool = tools.get(0);\n\t\t\tToolsCustomComparator toolComparator = new ToolsCustomComparator();\n\t\t\t\n\t\t\tif (toolComparator.equals(expectedTool, actualTool))\n\t\t\t\twatcher.getLogger().info(\"Created Expected Tool!\");\n\t\t\telse\n\t\t\t\twatcher.getLogger().warn(\"Did NOT create the expected tool.\" +\n\t\t\t\t\t\t\"\\n\tExpected: \" + ToolsUtils.toString(expectedTool, \"\t\t\") + \"\\n\" +\n\t\t\t\t\t\t\"\\n\tGot: \" + ToolsUtils.toString(actualTool, \"\t\t\"));\n\t\t\t\n\t\t\tAssert.assertTrue(toolComparator.equals(expectedTool, actualTool));\n\t\t}\n\t\tcatch (SBomCommonsException sbomE)\n\t\t{\n\t\t\tString error = \"Unexpected error occurred while attempting to read SWBom from \" +\n\t\t\t\t\t\"input stream!\";\n\t\t\twatcher.getLogger().error(error, sbomE);\n\t\t\tAssert.fail(error);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tString error = \"Unexpected error occured while attempting create a new Outer \" +\n\t\t\t\t\t\"empty component (with tool).\";\n\t\t\twatcher.getLogger().error(error, e);\n\t\t\tAssert.fail(error);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tTestUtils.logTestFinish(methodName, startDate, watcher.getLogger());\n\t\t}\n\t}", "public void addComponent(ComponentBase cdc) {\r\n// if (cdc instanceof ClassComponent) {\r\n// cdc = (ClassDiagramComponent) cdc;\r\n// }\r\n classDiagramComponents.add(cdc);\r\n }", "private void buildComponent() {\n\t\tStoreItemCell cell = new StoreItemCell(\"Turret\");\n\t\tcell.initialize(mySize);\n\t\tmyContainer.getChildren().add(cell.getNode());\n\t}", "private void generateMetadataFile(LinkedHashMap<?, ?> components) {\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(KIND, image.isCompositeImage() ? \"Composite\" : \"Cell\");\n jsonObject.put(ORG, image.getOrgName());\n jsonObject.put(NAME, image.getCellName());\n jsonObject.put(VERSION, image.getCellVersion());\n jsonObject.put(\"zeroScalingRequired\", image.isZeroScaling());\n jsonObject.put(\"autoScalingRequired\", image.isAutoScaling());\n\n JSONObject componentsJsonObject = new JSONObject();\n components.forEach((key, componentValue) -> {\n LinkedHashMap attributeMap = ((BMap) componentValue).getMap();\n String componentName = ((BString) attributeMap.get(\"name\")).stringValue();\n JSONObject componentJson = new JSONObject();\n\n JSONObject labelsJsonObject = new JSONObject();\n if (attributeMap.containsKey(LABELS)) {\n ((BMap<?, ?>) attributeMap.get(LABELS)).getMap().forEach((labelKey, labelValue) ->\n labelsJsonObject.put(labelKey.toString(), labelValue.toString()));\n }\n componentJson.put(\"labels\", labelsJsonObject);\n\n JSONObject cellDependenciesJsonObject = new JSONObject();\n JSONObject compositeDependenciesJsonObject = new JSONObject();\n JSONArray componentDependenciesJsonArray = new JSONArray();\n if (attributeMap.containsKey(DEPENDENCIES)) {\n LinkedHashMap<?, ?> dependencies = ((BMap<?, ?>) attributeMap.get(DEPENDENCIES)).getMap();\n if (dependencies.containsKey(CELLS)) {\n LinkedHashMap<?, ?> cellDependencies = ((BMap) dependencies.get(CELLS)).getMap();\n extractDependencies(cellDependenciesJsonObject, cellDependencies, CELL);\n }\n if (dependencies.containsKey(COMPOSITES)) {\n LinkedHashMap<?, ?> compositeDependencies = ((BMap) dependencies.get(COMPOSITES)).getMap();\n extractDependencies(compositeDependenciesJsonObject, compositeDependencies, COMPOSITE);\n }\n if (dependencies.containsKey(COMPONENTS)) {\n BValueArray componentsArray = ((BValueArray) dependencies.get(COMPONENTS));\n IntStream.range(0, (int) componentsArray.size()).forEach(componentIndex -> {\n LinkedHashMap component = ((BMap) componentsArray.getBValue(componentIndex)).getMap();\n componentDependenciesJsonArray.put(((BString) component.get(\"name\")).stringValue());\n });\n }\n }\n JSONObject dependenciesJsonObject = new JSONObject();\n dependenciesJsonObject.put(CELLS, cellDependenciesJsonObject);\n dependenciesJsonObject.put(COMPOSITES, compositeDependenciesJsonObject);\n dependenciesJsonObject.put(COMPONENTS, componentDependenciesJsonArray);\n componentJson.put(\"dependencies\", dependenciesJsonObject);\n\n componentsJsonObject.put(componentName, componentJson);\n });\n image.getComponentNameToComponentMap().forEach((componentName, component) -> {\n JSONObject componentJsonObject = componentsJsonObject.getJSONObject(componentName);\n componentJsonObject.put(\"dockerImage\", component.getSource());\n componentJsonObject.put(\"isDockerPushRequired\", component.isDockerPushRequired());\n });\n jsonObject.put(\"components\", componentsJsonObject);\n\n String targetFileNameWithPath =\n OUTPUT_DIRECTORY + File.separator + CELLERY + File.separator + METADATA_FILE_NAME;\n try {\n writeToFile(jsonObject.toString(), targetFileNameWithPath);\n } catch (IOException e) {\n String errMsg = \"Error occurred while generating metadata file \" + targetFileNameWithPath;\n log.error(errMsg, e);\n throw new BallerinaException(errMsg);\n }\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "Component createComponent();", "Component createComponent();", "public interface ExecService {\n /**\n * Parse an XML file into a build model.\n *\n * @param xmlBuildFile\n * \t\tThe file containing the XML build description.\n * @return A Project model for the build.\n * @exception ExecutionException\n * \t\tif the build cannot be parsed\n */\n org.apache.ant.common.model.Project parseXMLBuildFile(java.io.File xmlBuildFile) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Create a project reference.\n *\n * @param referenceName\n * \t\tthe name under which the project will be\n * \t\treferenced.\n * @param model\n * \t\tthe project model.\n * @exception ExecutionException\n * \t\tif the project cannot be referenced.\n */\n void createProjectReference(java.lang.String referenceName, org.apache.ant.common.model.Project model) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Setup a sub-build.\n *\n * @param model\n * \t\tthe project model to be used for the build\n * @param properties\n * \t\tthe initiali properties to be used in the build\n * @return a key to the build allowing it to be executed and managed\n * @exception ExecutionException\n * \t\tif the subbuild cannot be setup\n */\n java.lang.Object setupBuild(org.apache.ant.common.model.Project model, java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Setup a sub-build using the current frame's project model\n *\n * @param properties\n * \t\tthe initiali properties to be used in the build\n * @return a key to the build allowing it to be executed and managed\n * @exception ExecutionException\n * \t\tif the subbuild cannot be setup\n */\n java.lang.Object setupBuild(java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Run a build which have been previously setup\n *\n * @param buildKey\n * \t\tthe buildKey returned previously when the build was\n * \t\tsetup\n * @param targets\n * \t\tA list of targets to be run\n * @exception ExecutionException\n * \t\tif the build cannot be run\n */\n void runBuild(java.lang.Object buildKey, java.util.List targets) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * execute a task. The task should have already been initialised by the\n * core\n *\n * @param task\n * \t\tthe task to be executed.\n * @exception ExecutionException\n * \t\tif there is a problem in execution.\n */\n void executeTask(org.apache.ant.common.antlib.Task task) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * get the name of the project associated with this execution.\n *\n * @return the project's name\n */\n java.lang.String getProjectName();\n\n /**\n * Get the basedir for the current execution\n *\n * @return the base directory for this execution of Ant\n */\n java.io.File getBaseDir();\n\n /**\n * Handle subbuild output.\n *\n * @param subbuildKey\n * \t\tthe core's key for managing the subbuild.\n * @param line\n * \t\tthe content produce by the current thread.\n * @param isErr\n * \t\ttrue if this content is from the thread's error stream.\n * @exception ExecutionException\n * \t\tif the subbuild cannot be found.\n */\n void handleBuildOutput(java.lang.Object subbuildKey, java.lang.String line, boolean isErr) throws org.apache.ant.common.util.ExecutionException;\n}", "Compleja createCompleja();", "public Engine build() {\n this.extensions.add(new CoreExtension());\n \n // load extensions\n this.extensions.forEach(extension -> {\n this.renderers.putAll(extension.getRenderers());\n this.directives.putAll(extension.getDirectives());\n this.nodeParsers.putAll(extension.getNodeParsers());\n this.filters.putAll(extension.getFilters());\n this.tests.putAll(extension.getTests());\n this.unaryOperators.putAll(extension.getUnaryOperators());\n this.binaryOperators.putAll(extension.getBinaryOperators());\n this.factories.addAll(extension.getNodeVisitorFactories());\n this.safeNodes.addAll(extension.getSafeNodes());\n });\n \n // create an operator token parser\n TokenParser unaryOperatorParser = TokenParser.in(TokenType.OPERATOR, this.unaryOperators.keySet().toArray(new String[]{}));\n TokenParser binaryOperatorParser = TokenParser.in(TokenType.OPERATOR, this.binaryOperators.keySet().toArray(new String[]{}));\n TokenParser operatorParser = unaryOperatorParser.or(binaryOperatorParser);\n \n // create a execute token parser\n TokenParser executeOpenParser = TokenParser.from(TokenType.EXECUTE_OPEN, compile(quote(this.executeOpen)), false);\n TokenParser executeCloseParser = TokenParser.from(TokenType.EXECUTE_CLOSE, compile(quote(this.executeClose)), false);\n TokenParser executeParser = executeOpenParser.then(NAME).then(operatorParser.or(EXPRESSION).until(executeCloseParser));\n this.starts.add(this.executeOpen);\n \n // create a print token parser\n TokenParser printOpenParser = TokenParser.from(TokenType.PRINT_OPEN, compile(quote(this.printOpen)), false);\n TokenParser printCloseParser = TokenParser.from(TokenType.PRINT_CLOSE, compile(quote(this.printClose)), false);\n TokenParser printParser = printOpenParser.then(operatorParser.or(EXPRESSION).until(printCloseParser));\n this.starts.add(this.printOpen);\n \n // create a comment token parser\n TokenParser commentOpenParser = TokenParser.from(TokenType.COMMENT_OPEN, compile(quote(this.commentOpen)), false);\n TokenParser commentCloseParser = TokenParser.from(TokenType.COMMENT_CLOSE, compile(quote(this.commentClose)), false);\n TokenParser commentInner = TokenParser.until(TokenType.TEXT, this.commentClose);\n TokenParser commentParser = commentOpenParser.then(commentInner.optional()).then(commentCloseParser);\n this.starts.add(this.commentOpen);\n \n // create a text token parser\n TokenParser leadingText = TokenParser.until(TokenType.TEXT, this.starts);\n TokenParser text = TokenParser.from(TokenType.TEXT, Pattern.compile(\"^.*\", Pattern.DOTALL | Pattern.MULTILINE), false);\n \n TokenParser principal = commentParser.or(executeParser).or(printParser).or(leadingText).zeroOrMore().then(text.optional()).then(EOF);\n this.tokenizerBuilder.parser(principal);\n Tokenizer tokenizer = this.tokenizerBuilder.build();\n \n ExpressionParser expressionParser = new ExpressionParser(this.unaryOperators, this.binaryOperators);\n \n Engine engine = new Engine(this.environment, expressionParser,\n renderers, directives, nodeParsers, \n filters, tests, factories, safeNodes,\n tokenizer);\n return engine;\n }", "private void addComponentsToLayout() {\n//\t\tAdd the \"Add project\" button to the list\n\t\taddComponent(addProject);\n\t\t\n//\t\tIf the user don't have any projects, add the \"No projects\" label instead of the list\n\t\tif(projectRows.size() == 0){\n\t\t\taddComponent(new Label(T.get(\"LABEL_NO_PROJECTS_EXISTS\")));\n\t\t}\n//\t\tOtherwise add all project rows to the list\n\t\telse{\n\t\t\tfor (ProjectRow projectRow : projectRows) {\n\t\t\t\taddComponent(projectRow);\n\t\t\t}\n\t\t}\n\t\t\n\t\tmainView.selectProject();\n\t}", "protected Component generateComp(String compName) {\n\t\treturn null;\n\t}", "public void buildGui() {\n\t}", "private void createComponents(String label) {\n itsCombo = createComboBox();\n JScrollPane scroll = new JScrollPane(itsCombo);\n scroll.setPreferredSize(new Dimension(WIDTH, HEIGHT));\n\n LabeledComponent c = new LabeledComponent(\"Symbol\", itsCombo);\n itsComp = c;\n }", "private static Bom combineCommonSBoms(List<?> files)\n\t\t\tthrows SBomCombinerException, SBomCommonsException\n\t{\n\t\tBom combinedSBom = new Bom();\n\t\t\n\t\tList<Component> components = new ArrayList<>();\n\t\tList<Dependency> dependencies = new ArrayList<>();\n\t\t\n\t\tList<Component> outerComps = new ArrayList<>();\n\t\tList<Tool> toolsUsed = new ArrayList<>();\n\t\t\n\t\tBom bom = null;\n\t\tList<Component> bomComps;\n\t\tList<Dependency> bomDeps;\n\t\tList<Dependency> innerDeps;\n\t\tboolean dependencyFound = false;\n\t\tfor (Object file : files)\n\t\t{\n\t\t\tif (file instanceof String)\n\t\t\t\tbom = getBomFile((String) file);\n\t\t\telse if (file instanceof InputStreamSource)\n\t\t\t\tbom = getBomFile((InputStreamSource) file);\n\t\t\t\n\t\t\tif (bom != null)\n\t\t\t{\n\t\t\t\tif ((bom.getMetadata() != null) && (bom.getMetadata().getTools() != null) &&\n\t\t\t\t\t\t(!bom.getMetadata().getTools().isEmpty()))\n\t\t\t\t{\n\t\t\t\t\ttoolsUsed = ToolsUtils.addUniqueTools(toolsUsed, bom.getMetadata().getTools());\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif ((bom.getMetadata() != null) && (bom.getMetadata().getComponent() != null))\n\t\t\t\t\touterComps.add(bom.getMetadata().getComponent());\n\t\t\t\n\t\t\t\tbomComps = bom.getComponents();\n\t\t\t\t// Process Components.\n\t\t\t\tfor (Component bomComp : bomComps)\n\t\t\t\t{\n\t\t\t\t\tif (!componentsContain(bomComp, components))\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckReferenceTypes(bomComp);\n\t\t\t\t\t\tcomponents.add(bomComp);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tlogger.debug(\"We already have component(\" + bomComp.getName() + \", \" +\n\t\t\t\t\t\t\t\tbomComp.getGroup() + \", \" + bomComp.getVersion() + \")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Process Dependencies.\n\t\t\t\tbomDeps = bom.getDependencies();\n\t\t\t\tif ((bomDeps != null) && (!bomDeps.isEmpty()))\n\t\t\t\t{\n\t\t\t\t\tfor (Dependency bomDep : bomDeps)\n\t\t\t\t\t{\n\t\t\t\t\t\tdependencyFound = false;\n\t\t\t\t\t\tfor (Dependency dep : dependencies)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (dep.equals(bomDep))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdependencyFound = true;\n\t\t\t\t\t\t\t\tlogger.debug(\"Dependency (\" + dep.getRef() +\n\t\t\t\t\t\t\t\t\t\t\") found. Adding inner depenencies.\");\n\t\t\t\t\t\t\t\tinnerDeps = bomDep.getDependencies();\n\t\t\t\t\t\t\t\tif (innerDeps != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor (Dependency innerDep : innerDeps)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdep.addDependency(innerDep);\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\tif (!dependencyFound)\n\t\t\t\t\t\t\tdependencies.add(bomDep);\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 in outer Components if they are not already there.\n\t\tfor (Component bomComp : outerComps)\n\t\t{\n\t\t\tif (!componentsContain(bomComp, components))\n\t\t\t{\n\t\t\t\tcheckReferenceTypes(bomComp);\n\t\t\t\tcomponents.add(bomComp);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlogger.debug(\"We already have component(\" + bomComp.getName() + \", \" +\n\t\t\t\t\t\tbomComp.getGroup() + \", \" + bomComp.getVersion() + \")\");\n\t\t}\n\t\tif (combinedSBom.getMetadata() == null)\n\t\t{\n\t\t\tMetadata combinedSBomMetadata = new Metadata();\n\t\t\tcombinedSBomMetadata.setTools(toolsUsed);\n\t\t\tcombinedSBom.setMetadata(combinedSBomMetadata);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcombinedSBom.getMetadata().setTools(toolsUsed);\n\t\t}\n\t\tcombinedSBom.setComponents(components);\n\t\tcombinedSBom.setDependencies(dependencies);\n\t\treturn combinedSBom;\n\t}" ]
[ "0.6046893", "0.6042812", "0.601476", "0.5803788", "0.56805086", "0.55818164", "0.5568344", "0.5518941", "0.55173075", "0.55032253", "0.5487179", "0.5476758", "0.54760754", "0.5455873", "0.5453693", "0.5440566", "0.5433662", "0.54234445", "0.5423427", "0.5417195", "0.5413701", "0.5410151", "0.5401759", "0.53972536", "0.5377395", "0.5367929", "0.5349646", "0.5341078", "0.5336476", "0.532126", "0.53208995", "0.5313554", "0.52944833", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5292197", "0.5284688", "0.52842665", "0.5278924", "0.52649826", "0.5257087", "0.5254857", "0.5243523", "0.5243155", "0.5239009", "0.52232265", "0.52150345", "0.52128935", "0.52122116", "0.5211827", "0.5205793", "0.5200659", "0.5163637", "0.5161076", "0.5155355", "0.5142081", "0.512935", "0.5120141", "0.51176155", "0.5107612", "0.5107553", "0.5106969", "0.5106204", "0.5079586", "0.5078803", "0.506589", "0.5062239", "0.50619555", "0.505675", "0.50554025", "0.5054857", "0.5030427", "0.5029628", "0.50220895", "0.50220895", "0.50148845", "0.50148845", "0.5014643", "0.49971494", "0.49957767", "0.49907357", "0.4987437", "0.4987014", "0.49822864", "0.49743405" ]
0.5418156
19
TODO: these could come from config
private FileObject makeConfigFile(TemplatePair p, NrfConfig configObj){ ST tmpl_sd = getConfigGroup().getInstanceOf("sdk_config"); tmpl_sd.add("config", configObj); FileObject sdk_config_file = new FileObject(); sdk_config_file.setSubPath("config/"); sdk_config_file.setFileName( p.getValue()+".h"); sdk_config_file.setContent(tmpl_sd.render()); return sdk_config_file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void config() {\n\t}", "@Override\n public boolean hasAdditionalConfig() { return true; }", "public abstract String getConfig();", "private void getExternalConfig()\n {\n String PREFIX = \"getExternalConfig override name [{}] value [{}]\";\n // Check to see if the ldap host has been overridden by a system property:\n String szValue = System.getProperty( EXT_LDAP_HOST );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_HOST, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_HOST, szValue );\n }\n // Check to see if the ldap port has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_PORT );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_PORT, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_PORT, szValue );\n }\n\n // Check to see if the admin pool uid has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_UID );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_ADMIN_POOL_UID, szValue );\n // never display ldap admin userid name to log:\n LOG.info( \"getExternalConfig override name [{}]\", GlobalIds.LDAP_ADMIN_POOL_UID );\n }\n\n // Check to see if the admin pool pw has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_PW );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_ADMIN_POOL_PW, szValue );\n // never display password of any type to log:\n LOG.info( \"getExternalConfig override name [{}]\", GlobalIds.LDAP_ADMIN_POOL_PW );\n }\n\n // Check to see if the admin pool min connections has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_MIN );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_ADMIN_POOL_MIN, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_ADMIN_POOL_MIN, szValue );\n }\n\n // Check to see if the admin pool max connections has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_MAX );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_ADMIN_POOL_MAX, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_ADMIN_POOL_MAX, szValue );\n }\n\n // Check to see if the log pool uid has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_LOG_POOL_UID );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_LOG_POOL_UID, szValue );\n // never display ldap admin userid name to log:\n LOG.info( \"getExternalConfig override name [{}]\", GlobalIds.LDAP_LOG_POOL_UID );\n }\n\n // Check to see if the log pool pw has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_LOG_POOL_PW );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_LOG_POOL_PW, szValue );\n // never display password of any type to log:\n LOG.info( \"getExternalConfig override name [{}]\", GlobalIds.LDAP_LOG_POOL_PW );\n }\n\n // Check to see if the log pool min connections has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_LOG_POOL_MIN );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_LOG_POOL_MIN, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_LOG_POOL_MIN, szValue );\n }\n\n // Check to see if the log pool max connections has been overridden by a system property:\n szValue = System.getProperty( EXT_LDAP_LOG_POOL_MAX );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.LDAP_LOG_POOL_MAX, szValue );\n LOG.info( PREFIX, GlobalIds.LDAP_LOG_POOL_MAX, szValue );\n }\n\n // Check to see if ssl enabled parameter has been overridden by a system property:\n szValue = System.getProperty( EXT_ENABLE_LDAP_SSL );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.ENABLE_LDAP_SSL, szValue );\n LOG.info( PREFIX, GlobalIds.ENABLE_LDAP_SSL, szValue );\n }\n \n // Check to see if start tls enabled parameter has been overridden by a system property:\n szValue = System.getProperty( EXT_ENABLE_LDAP_STARTTLS );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.ENABLE_LDAP_STARTTLS, szValue );\n LOG.info( PREFIX, GlobalIds.ENABLE_LDAP_STARTTLS, szValue );\n }\n\n // Check to see if the ssl debug enabled parameter has been overridden by a system property:\n szValue = System.getProperty( EXT_ENABLE_LDAP_SSL_DEBUG );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.ENABLE_LDAP_SSL_DEBUG, szValue );\n LOG.info( PREFIX, GlobalIds.ENABLE_LDAP_SSL_DEBUG, szValue );\n }\n\n // Check to see if the trust store location has been overridden by a system property:\n szValue = System.getProperty( EXT_TRUST_STORE );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.TRUST_STORE, szValue );\n LOG.info( PREFIX, GlobalIds.TRUST_STORE, szValue );\n }\n\n // Check to see if the trust store password has been overridden by a system property:\n szValue = System.getProperty( EXT_TRUST_STORE_PW );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.TRUST_STORE_PW, szValue );\n // never display password value to log:\n LOG.info( \"getExternalConfig override name [{}]\", GlobalIds.TRUST_STORE_PW );\n }\n\n // Check to see if the trust store onclasspath parameter has been overridden by a system property:\n szValue = System.getProperty( EXT_TRUST_STORE_ONCLASSPATH );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.TRUST_STORE_ON_CLASSPATH, szValue );\n LOG.info( PREFIX, GlobalIds.TRUST_STORE_ON_CLASSPATH, szValue );\n }\n\n // Check to see if the suffix has been overridden by a system property:\n szValue = System.getProperty( EXT_CONFIG_SUFFIX );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.SUFFIX, szValue );\n LOG.info( PREFIX, GlobalIds.SUFFIX, szValue );\n\n }\n\n // Check to see if the config realm name has been overridden by a system property:\n szValue = System.getProperty( EXT_CONFIG_REALM );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.CONFIG_REALM, szValue );\n LOG.info( PREFIX, GlobalIds.CONFIG_REALM, szValue );\n }\n\n // Check to see if the config node dn has been overridden by a system property:\n szValue = System.getProperty( EXT_CONFIG_ROOT_DN );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.CONFIG_ROOT_PARAM, szValue );\n LOG.info( PREFIX, GlobalIds.CONFIG_ROOT_PARAM, szValue );\n }\n\n // Check to see if the ldap server type has been overridden by a system property:\n szValue = System.getProperty( EXT_SERVER_TYPE );\n if( StringUtils.isNotEmpty( szValue ))\n {\n config.setProperty( GlobalIds.SERVER_TYPE, szValue );\n LOG.info( PREFIX, GlobalIds.SERVER_TYPE, szValue );\n }\n\n // Check to see if ARBAC02 checking enforced in service layer:\n szValue = System.getProperty( EXT_IS_ARBAC02 );\n if( StringUtils.isNotEmpty( szValue ))\n {\n Boolean isArbac02 = Boolean. valueOf( szValue );\n config.setProperty( GlobalIds.IS_ARBAC02, isArbac02.booleanValue() );\n LOG.info( PREFIX, GlobalIds.IS_ARBAC02, isArbac02.booleanValue() );\n }\n }", "private Config() {\n }", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "public class_config(){\n\t\t\n\t\tformat_date=\"dd/MM/yyyy\";\n\t\tcurrency='€';\n\t\tdecimals=2;\n\t\tlanguage=\"eng\";\n\t\ttheme=\"Metal\";\n\t\tfile_format=\"json\";\n\t\t\n\t}", "@Override\n\tpublic Map<String, String> getConfig() {\n\t\treturn null;\n\t}", "public String configurationInfo();", "protected void setupParameters() {\n \n \n\n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "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}", "@Override\r\n\tprotected void configure() {\n\t\t\r\n\t}", "@Override\n\tpublic void initSettings() {\n\n\t}", "private PSConfigDeNormalizer()\n {\n\n }", "@Override\n\tprotected void configure() {\n\n\t}", "public String getConfig();", "public interface Config {\n String SUCCESS = \"success\";\n String SUCCESS_CODE = \"10000\";\n String ERROR = \"error\";\n String ERROR_CODE = \"20000\";\n\n String ROLE_ADMIN = \"SYS_ADMIN\";\n String ROLE_GUEST = \"SYS_GUEST\";\n String IMG_FILE_PATH = \"upload/image\";\n String IMG_BANNER_TYPE = \"BANNER\";\n String IMG_ALBUM_TYPE = \"ALBUM\";\n String IMG_GLOBAL_TYPE = \"GLOBAL\";\n String GLOBAL_ABOUT_CODE=\"ABOUT\";\n String GLOBAL_REASON_CODE=\"REASON\";\n String AES_KEY = \"harlanking021109\";\n String HMAC_KEY = \"harlanking021109\";\n\n String CURRENT_USER_KEY = \"user\";\n}", "private static void loadConfig() {\n\t\trxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Receiver.ID\", Integer.class,\n\t\t\t\tnew Integer(rxID));\n\t\ttxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Transmitter.ID\", Integer.class,\n\t\t\t\tnew Integer(txID));\n\t}", "private OptimoveConfig() {\n }", "@Override\n\tpublic Map<String, String> getConf() {\n\t\treturn null;\n\t}", "protected static void dumpConfig() {\n try {\n logger.info( Configuration.CN_WKBOTANICA_API_CONTEXT_PATH + getContextPath());\n logger.info( Configuration.CN_DNS + \" \" + Configuration.CN_DNS_ADD_LOCALS + shouldAddLocalDns());\n logger.info( Configuration.CN_HTTP + \" \" + Configuration.CN_HTTP_PORT + getHttpPort());\n logger.info( Configuration.CN_FLICKR_API_KEY + \" \" + getFlickrApiKey());\n logger.info( Configuration.CN_FLICKR_USER_ID + \" \" + getFlickrUserId());\n logger.info( Configuration.CN_FLICKR_PHOTOSET_ID + \" \" + getFickrPhotosetId());\n }\n catch (Exception e) {\n logger.info(\"GRAVE:\" + e.getMessage());\n }\n }", "@Override\n public Map<String, Object> getConfigParams() {\n return null;\n }", "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }", "protected abstract String getXmppConfigResources();", "public interface Config {\n\t\t/**\n\t\t * the IdentityX policy which should be used for authentication\n\t\t *\n\t\t * @return the policy name\n\t\t */\n\t\t@Attribute(order = 100, validators = { RequiredValueValidator.class })\n\t\tString policyName();\n\n\t\t/**\n\t\t * the IdentityX application to be used\n\t\t *\n\t\t * @return the application Id\n\t\t */\n\t\t@Attribute(order = 200, validators = { RequiredValueValidator.class })\n\t\tString applicationId();\n\t\t\n\t\t\n\t\t/**\n\t\t * the IdentityX Description to be used\n\t\t *\n\t\t * @return the transactionDescription\n\t\t */\n\t\t@Attribute(order = 300, validators = { RequiredValueValidator.class })\n\t\tdefault String transactionDescription() {\n\t\t\treturn \"OpenAM has Requested an Authentication\";\n\t\t}\n\t}", "String getConfigName();", "private OspfConfigUtil() {\n\n }", "@Override\n\tprotected void getExras() {\n\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 }", "public Config() {\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t}", "private static HashMap<String, String> settings() {\n HashMap<String, String> settings = new HashMap<String, String>();\n settings.put(\"db.default.url\", \"jdbc:mysql://api.template-java.com:3306/play_test\");\n settings.put(\"db.default.username\", \"root\");\n settings.put(\"db.default.password\", \"\");\n settings.put(\"db.default.jndiName\", \"DefaultDS\");\n settings.put(\"jpa.default\", \"mySqlPersistenceUnit\");\n return(settings);\n }", "public interface Configuration {\n// /**\n// * 获取主分词器词库\n// * @return\n// */\n// public String getMainDic();\n// /**\n// * 获取城市词路径\n// * @return String 城市词路径\n// */\n// public String getCityDicionary();\n\n /**\n * 获取城区词路径\n *\n * @return String 获取城区词路径\n */\n public String getRegionDicionary();\n\n /**\n * 获取\"工程师\"类词库路径\n *\n * @return String \"工程师\"类词库路径\n */\n public String getTheoremDicionary();\n\n /**\n * 获取\"总工程师\"类词库路径\n *\n * @return String \"总工程师\"类词库路径\n */\n public String getEngineerDicionary();\n\n /**\n * 获取垃圾类词库路径\n *\n * @return String 垃圾类词库路径\n */\n public String getConjunctionDicionary();\n\n /**\n * 获取多义类词库路径\n *\n * @return String 多义词库路径\n */\n public String getPolysemyDicionary();\n\n /**\n * 获取多职位前词库路径\n *\n * @return String 多职位前词库路径\n */\n public String getManagerDicionary();\n\n /**\n * 获取多职位后词库路径\n *\n * @return String 多职位后词库路径\n */\n public String getAssistantDicionary();\n\n /**\n * 获取数字词库路径\n *\n * @return String 数字词库路径\n */\n public String getNumberDicionary();\n\n /**\n * 获取无用词词库路径\n *\n * @return String 无用词词库路径\n */\n public String getWorthlessDicionary();\n\n /**\n * 获取标签词词库路径\n *\n * @return String 标签词词库路径\n */\n public String getTagDicionary();\n\n /**\n * 获取公司性质词词库路径\n *\n * @return String 公司性质词词库路径\n */\n public String getCorporationDicionary();\n// /**\n// * 获取ik分词器的主路径\n// * @return\n// */\n// public String getIkMainFilePath();\n\n}", "protected DiscoveryVOSConfig() {\n\t\tsuper(BRANCH_ROOT + \".DiscoveryVOS.com.discoveryVOS.\".replace('.', File.separatorChar));\n\t}", "private void logConfigLocations() {\n\t\tlogger.info(\"XD config location: \" + environment.resolvePlaceholders(XD_CONFIG_LOCATION));\n\t\tlogger.info(\"XD config names: \" + environment.resolvePlaceholders(XD_CONFIG_NAME));\n\t\tlogger.info(\"XD module config location: \" + environment.resolvePlaceholders(XD_MODULE_CONFIG_LOCATION));\n\t\tlogger.info(\"XD module config name: \" + environment.resolvePlaceholders(XD_MODULE_CONFIG_NAME));\n\t}", "@Override\n protected void configure() {\n }", "@Override\n protected void init() {\n }", "private void initList() {\n long now = System.nanoTime();\n loadConfig();\n SlogEx.d(TAG, \"load config use:\" + (System.nanoTime() - now));\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void configure() {\n\t\t\n\t}", "private RelayConfig () {}", "protected void additionalConfig(ConfigType config){}", "HashMap getRequestingHosts()\n {\n return configfile.requesting_hosts;\n }", "public interface Config {\n int MAX_IP_RECORD = 10;\n String ADB_PATH = \"adb_path\";\n String IP_HISTORY = \"ip_history\";\n String TITLE = \"Wifi Adb Ultimate\";\n String HELP = \"https://github.com/Sausure/WIFIADB/tree/master/WIFIADBIntelliJPlugin\";\n String DEFAULT_PORT = \"5555\";\n String EMPTY = \"\";\n String SPACE = \" \";\n String ANY_SPACES = \"\\\\s{1,}\";\n String ENTER = \"\\\\n\";\n String TAB = \"\\\\t\";\n String DEFAULT_PROGRESS_TIP = \"Wait a moment\";\n String DAEMON_FLAG = Utils.concat(SPACE,\"daemon\",SPACE);\n String IP_PATTERN = \"\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}:\\\\d{1,5}\";\n}", "Map<String, List<String>> getElementBaseConfigurationOptions();", "private stendhal() {\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n protected boolean validateSystemSettings() {\n return true;\r\n }", "private ConfigReader() {\r\n\t\tsuper();\r\n\t}", "private static void initConfig() {\n /*\n * Human IO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Joysticks\n */\n {\n addToConstants(\"joysticks.left\", 0);\n addToConstants(\"joysticks.right\", 1);\n addToConstants(\"joysticks.operator\", 2);\n }\n\n /*\n * Buttons and axis\n */\n {\n }\n }\n }\n\n /*\n * RobotIO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Kicker\n */\n addToConstantsA(\"kicker.encoder.distPerPulse\", 360.0 / 1024.0);\n }\n }\n\n /*\n * Chassis\n */\n {\n /*\n * Constants\n */\n {\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Kicker\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"kicker.kick.normal\", 1.75);\n addToConstants(\"kicker.kick.timeout\", 0.75);\n\n addToConstants(\"kicker.shaken.voltage\", -0.3316);\n addToConstants(\"kicker.shaken.tolerance\", 3.0);\n\n addToConstants(\"kicker.zero.voltage\", 0.8);\n addToConstants(\"kicker.zero.duration\", 0.75);\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Gripper\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"gripper.collection.voltage\", 0.82);\n addToConstants(\"gripper.ejection.voltage\", -0.45);\n }\n }\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public interface HubConfig {\n\n String HUB_MODULES_DEPLOY_TIMESTAMPS_PROPERTIES = \"hub-modules-deploy-timestamps.properties\";\n String USER_MODULES_DEPLOY_TIMESTAMPS_PROPERTIES = \"user-modules-deploy-timestamps.properties\";\n String USER_CONTENT_DEPLOY_TIMESTAMPS_PROPERTIES = \"user-content-deploy-timestamps.properties\";\n\n String HUB_CONFIG_DIR = \"hub-internal-config\";\n String USER_CONFIG_DIR = \"user-config\";\n String ENTITY_CONFIG_DIR = \"entity-config\";\n String STAGING_ENTITY_SEARCH_OPTIONS_FILE = \"staging-entity-options.xml\";\n String FINAL_ENTITY_SEARCH_OPTIONS_FILE = \"final-entity-options.xml\";\n\n String DEFAULT_STAGING_NAME = \"data-hub-STAGING\";\n String DEFAULT_FINAL_NAME = \"data-hub-FINAL\";\n String DEFAULT_TRACE_NAME = \"data-hub-TRACING\";\n String DEFAULT_JOB_NAME = \"data-hub-JOBS\";\n String DEFAULT_MODULES_DB_NAME = \"data-hub-MODULES\";\n String DEFAULT_TRIGGERS_DB_NAME = \"data-hub-TRIGGERS\";\n String DEFAULT_SCHEMAS_DB_NAME = \"data-hub-SCHEMAS\";\n\n String DEFAULT_ROLE_NAME = \"data-hub-role\";\n String DEFAULT_USER_NAME = \"data-hub-user\";\n\n Integer DEFAULT_STAGING_PORT = 8010;\n Integer DEFAULT_FINAL_PORT = 8011;\n Integer DEFAULT_TRACE_PORT = 8012;\n Integer DEFAULT_JOB_PORT = 8013;\n\n String DEFAULT_AUTH_METHOD = \"digest\";\n\n String DEFAULT_SCHEME = \"http\";\n\n Integer DEFAULT_FORESTS_PER_HOST = 4;\n\n String DEFAULT_CUSTOM_FOREST_PATH = \"forests\";\n\n String getHost();\n\n // staging\n String getStagingDbName();\n void setStagingDbName(String stagingDbName);\n\n String getStagingHttpName();\n void setStagingHttpName(String stagingHttpName);\n\n Integer getStagingForestsPerHost();\n void setStagingForestsPerHost(Integer stagingForestsPerHost);\n\n Integer getStagingPort();\n void setStagingPort(Integer stagingPort);\n\n String getStagingAuthMethod();\n void setStagingAuthMethod(String stagingAuthMethod);\n\n String getStagingScheme();\n void setStagingScheme(String stagingScheme);\n\n boolean getStagingSimpleSsl();\n void setStagingSimpleSsl(boolean stagingSimpleSsl);\n\n @JsonIgnore\n SSLContext getStagingSslContext();\n void setStagingSslContext(SSLContext stagingSslContext);\n\n @JsonIgnore\n DatabaseClientFactory.SSLHostnameVerifier getStagingSslHostnameVerifier();\n void setStagingSslHostnameVerifier(DatabaseClientFactory.SSLHostnameVerifier stagingSslHostnameVerifier);\n\n String getStagingCertFile();\n void setStagingCertFile(String stagingCertFile);\n\n String getStagingCertPassword();\n void setStagingCertPassword(String stagingCertPassword);\n\n String getStagingExternalName();\n void setStagingExternalName(String stagingExternalName);\n\n // final\n String getFinalDbName();\n void setFinalDbName(String finalDbName);\n\n String getFinalHttpName();\n void setFinalHttpName(String finalHttpName);\n\n Integer getFinalForestsPerHost();\n void setFinalForestsPerHost(Integer finalForestsPerHost);\n\n Integer getFinalPort();\n void setFinalPort(Integer finalPort);\n\n String getFinalAuthMethod();\n void setFinalAuthMethod(String finalAuthMethod);\n\n String getFinalScheme();\n void setFinalScheme(String finalScheme);\n\n @JsonIgnore\n boolean getFinalSimpleSsl();\n void setFinalSimpleSsl(boolean finalSimpleSsl);\n\n @JsonIgnore\n SSLContext getFinalSslContext();\n void setFinalSslContext(SSLContext finalSslContext);\n\n DatabaseClientFactory.SSLHostnameVerifier getFinalSslHostnameVerifier();\n void setFinalSslHostnameVerifier(DatabaseClientFactory.SSLHostnameVerifier finalSslHostnameVerifier);\n\n String getFinalCertFile();\n void setFinalCertFile(String finalCertFile);\n\n String getFinalCertPassword();\n void setFinalCertPassword(String finalCertPassword);\n\n String getFinalExternalName();\n void setFinalExternalName(String finalExternalName);\n\n // traces\n String getTraceDbName();\n void setTraceDbName(String traceDbName);\n\n String getTraceHttpName();\n void setTraceHttpName(String traceHttpName);\n\n Integer getTraceForestsPerHost();\n void setTraceForestsPerHost(Integer traceForestsPerHost);\n\n Integer getTracePort();\n void setTracePort(Integer tracePort);\n\n String getTraceAuthMethod();\n void setTraceAuthMethod(String traceAuthMethod);\n\n String getTraceScheme();\n void setTraceScheme(String traceScheme);\n\n @JsonIgnore\n boolean getTraceSimpleSsl();\n void setTraceSimpleSsl(boolean traceSimpleSsl);\n\n @JsonIgnore\n SSLContext getTraceSslContext();\n void setTraceSslContext(SSLContext traceSslContext);\n\n DatabaseClientFactory.SSLHostnameVerifier getTraceSslHostnameVerifier();\n void setTraceSslHostnameVerifier(DatabaseClientFactory.SSLHostnameVerifier traceSslHostnameVerifier);\n\n String getTraceCertFile();\n void setTraceCertFile(String traceCertFile);\n\n String getTraceCertPassword();\n void setTraceCertPassword(String traceCertPassword);\n\n String getTraceExternalName();\n void setTraceExternalName(String traceExternalName);\n\n // jobs\n String getJobDbName();\n void setJobDbName(String jobDbName);\n\n String getJobHttpName();\n void setJobHttpName(String jobHttpName);\n\n Integer getJobForestsPerHost();\n void setJobForestsPerHost(Integer jobForestsPerHost);\n\n Integer getJobPort();\n void setJobPort(Integer jobPort);\n\n String getJobAuthMethod();\n void setJobAuthMethod(String jobAuthMethod);\n\n String getJobScheme();\n void setJobScheme(String jobScheme);\n\n boolean getJobSimpleSsl();\n void setJobSimpleSsl(boolean jobSimpleSsl);\n\n @JsonIgnore\n SSLContext getJobSslContext();\n void setJobSslContext(SSLContext jobSslContext);\n\n @JsonIgnore\n DatabaseClientFactory.SSLHostnameVerifier getJobSslHostnameVerifier();\n void setJobSslHostnameVerifier(DatabaseClientFactory.SSLHostnameVerifier jobSslHostnameVerifier);\n\n String getJobCertFile();\n void setJobCertFile(String jobCertFile);\n\n String getJobCertPassword();\n void setJobCertPassword(String jobCertPassword);\n\n String getJobExternalName();\n void setJobExternalName(String jobExternalName);\n\n String getModulesDbName();\n void setModulesDbName(String modulesDbName);\n\n Integer getModulesForestsPerHost();\n void setModulesForestsPerHost(Integer modulesForestsPerHost);\n\n\n // triggers\n String getTriggersDbName();\n void setTriggersDbName(String triggersDbName);\n\n Integer getTriggersForestsPerHost();\n void setTriggersForestsPerHost(Integer triggersForestsPerHost);\n\n // schemas\n String getSchemasDbName();\n void setSchemasDbName(String schemasDbName);\n\n Integer getSchemasForestsPerHost();\n void setSchemasForestsPerHost(Integer schemasForestsPerHost);\n\n // roles and users\n String getHubRoleName();\n void setHubRoleName(String hubRoleName);\n\n String getHubUserName();\n void setHubUserName(String hubUserName);\n\n\n String[] getLoadBalancerHosts();\n void setLoadBalancerHosts(String[] loadBalancerHosts);\n\n String getCustomForestPath();\n void setCustomForestPath(String customForestPath);\n\n String getModulePermissions();\n void setModulePermissions(String modulePermissions);\n\n String getProjectDir();\n void setProjectDir(String projectDir);\n\n @JsonIgnore\n HubProject getHubProject();\n\n void initHubProject();\n\n @JsonIgnore\n String getHubModulesDeployTimestampFile();\n @JsonIgnore\n String getUserModulesDeployTimestampFile();\n @JsonIgnore\n File getUserContentDeployTimestampFile();\n\n @JsonIgnore\n ManageConfig getManageConfig();\n void setManageConfig(ManageConfig manageConfig);\n @JsonIgnore\n ManageClient getManageClient();\n void setManageClient(ManageClient manageClient);\n\n @JsonIgnore\n AdminConfig getAdminConfig();\n void setAdminConfig(AdminConfig adminConfig);\n @JsonIgnore\n AdminManager getAdminManager();\n void setAdminManager(AdminManager adminManager);\n\n DatabaseClient newAppServicesClient();\n\n /**\n * Creates a new DatabaseClient for accessing the Staging database\n * @return - a DatabaseClient\n */\n DatabaseClient newStagingClient();\n\n DatabaseClient newStagingClient(String databaseName);\n\n /**\n * Creates a new DatabaseClient for accessing the Final database\n * @return - a DatabaseClient\n */\n DatabaseClient newFinalClient();\n\n /**\n * Creates a new DatabaseClient for accessing the Job database\n * @return - a DatabaseClient\n */\n DatabaseClient newJobDbClient();\n\n /**\n * Creates a new DatabaseClient for accessing the Trace database\n * @return - a DatabaseClient\n */\n DatabaseClient newTraceDbClient();\n\n /**\n * Creates a new DatabaseClient for accessing the Hub Modules database\n * @return - a DatabaseClient\n */\n DatabaseClient newModulesDbClient();\n\n @JsonIgnore\n Path getHubPluginsDir();\n @JsonIgnore\n Path getHubEntitiesDir();\n\n @JsonIgnore\n Path getHubConfigDir();\n @JsonIgnore\n Path getHubDatabaseDir();\n @JsonIgnore\n Path getHubServersDir();\n @JsonIgnore\n Path getHubSecurityDir();\n @JsonIgnore\n Path getUserSecurityDir();\n @JsonIgnore\n Path getUserConfigDir();\n @JsonIgnore\n Path getUserDatabaseDir();\n @JsonIgnore\n Path getEntityDatabaseDir();\n @JsonIgnore\n Path getUserServersDir();\n @JsonIgnore\n Path getHubMimetypesDir();\n\n @JsonIgnore\n AppConfig getAppConfig();\n void setAppConfig(AppConfig config);\n\n void setAppConfig(AppConfig config, boolean skipUpdate);\n\n String getJarVersion() throws IOException;\n}", "public synchronized static void initConfig() {\n\t\tMap<CatPawConfigProperty, String> initialValues = new HashMap<CatPawConfigProperty, String>();\n\t\tinitConfig(initialValues);\n\t}", "private void parseConfigurations() {\n\t\ttry {\n\t\t\tJsonNode propertiesNode = rawConfig.getProperties();\n\t\t\t\n\t\t\tif(propertiesNode != null && propertiesNode.size() > 0) {\n\t\t\t\tBeanInfoWrapper wrapper = new BeanInfoWrapper(this.beanClazz);\n\t\t\t\tIterator<Map.Entry<String, JsonNode>> it = propertiesNode.fields();\n\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tMap.Entry<String, JsonNode> entry = it.next();\n\t\t\t\t\tString propName = entry.getKey();\n\t\t\t\t\tPropertyDescriptor propDesc = wrapper.getPropertyDesc(propName);\n\t\t\t\t\tif(propDesc == null) {\n\t\t\t\t\t\tthrow new ConfigException(\"Failed to found the property name='\" + propName + \", in class '\" + beanClazz + \"'\");\n\t\t\t\t\t}\n\t\t\t\t\tProperty prop = new Property(this.beanClazz, propDesc);\n\t\t\t\t\tValueNode valueNode = getNodeValue(prop.getType(), entry.getValue(), prop.getContentParamType(), prop.getKeyParamType());\n\t\t\t\t\t\n\t\t\t\t\tproperties.put(prop, valueNode);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(ValueUtils.notEmpty(rawConfig.getDestroyMethod())) {\n\t\t\t\tdestroyMethod = beanClazz.getMethod(rawConfig.getDestroyMethod());\n\t\t\t}\n\t\t\t\n\t\t\tif(ValueUtils.notEmpty(rawConfig.getInitMethod())) {\n\t\t\t\tinitMethod = beanClazz.getMethod( rawConfig.getInitMethod());\n\t\t\t}\n\t\t} catch (NoSuchMethodException e) {\n\t\t\tthrow new ConfigException(\"Failed to found the method in the class '\" + beanClazz.getClass() + \"'\", e);\n\t\t\t\n\t\t} catch (SecurityException e) {\n\t\t\tthrow new ConfigException(\"Failed to access the method in the class '\" + beanClazz.getClass() + \"'\", e);\n\t\t}\n\t\t\n\t}", "private void init() {\n\n\t}", "public void setupProperties() {\n // left empty for subclass to override\n }", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "private AppConfigContent() {}", "String findConfigInfoAggrIsOrdered();", "@Override\n protected void initialize() \n {\n \n }", "@Test\n public void configReturnsCorrectValuesForValidKeys() throws Exception\n {\n assertEquals(\"simple_value\", config.getValue(\"simple.key\"));\n assertEquals(\"spaces value\", config.getValue(\"spaces.key\"));\n }", "interface Config {\n\n String DB_USERS = \"USERS\";\n String DB_USERS_DATA = \"DATA\";\n String DB_EQUIPMENTS = \"EQUIPMENTS\";\n String DB_MEMBERS = \"MEMBERS\";\n String DB_ORDERS = \"ORDERS\";\n}", "private static ConfigSource config()\n {\n return CONFIG_MAPPER_FACTORY.newConfigSource()\n .set(\"type\", \"mailchimp\")\n .set(\"auth_method\", \"api_key\")\n .set(\"apikey\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"access_token\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"list_id\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"email_column\", \"email\")\n .set(\"fname_column\", \"fname\")\n .set(\"lname_column\", \"lname\");\n }", "public void printConfig() {\n\t\tProperty props = Property.getInstance();\n\t\tSystem.out.println(\"You are using the following settings. If this is correct, \"\n\t\t\t\t+ \"you do not have to do anything. If they are not correct, please alter \" + \"your config files.\");\n\t\tString[] importantSettings = new String[] { \"apkname\", \"alphabetFile\", \"learningAlgorithm\", \"EquivMethod\",\"deviceName\" };\n\t\tfor (int i = 0; i < importantSettings.length; i++) {\n\t\t\tSystem.out.printf(\"%-25s%s%n\", importantSettings[i], \" = \" + props.get(importantSettings[i]));\n\t\t}\n\t}", "public static void initConfig()\r\n {\r\n try\r\n {\r\n ip = ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_IP\");\r\n localIP = ConfigProperties.getKey(ConfigList.BASIC, \"Local_IP\");\r\n port = Integer.parseInt(ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_PORT\"));\r\n }\r\n catch (NumberFormatException e)\r\n {\r\n log.error(\"read properties failed --\", e);\r\n }\r\n }", "@Override\n\tpublic void configure() {\n\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn \"Incorrect Configuration: \"+super.toString();\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public interface BasicConfig {\n\n public static final String CONFIG_RREFIX = \"atencn.netty\";\n public static final int PINGPONG_CMD = -16705;\n public static final int PINGPONG_SUB = -50761;\n}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\n public void checkConfiguration() {\n }", "Map<String, String> getConfigProperties();", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "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 abstract String globalInfo();", "protected void init() {\n // to override and use this method\n }", "@Override\n public void configure() {\n }", "private void initConfigVar() {\n\t\tConfigUtils configUtils = new ConfigUtils();\n\t\tmenuColor = configUtils.readConfig(\"MENU_COLOR\");\n\t\taboutTitle = configUtils.readConfig(\"ABOUT_TITLE\");\n\t\taboutHeader = configUtils.readConfig(\"ABOUT_HEADER\");\n\t\taboutDetails = configUtils.readConfig(\"ABOUT_DETAILS\");\n\t\tgsTitle = configUtils.readConfig(\"GS_TITLE\");\n\t\tgsHeader = configUtils.readConfig(\"GS_HEADER\");\n\t\tgsDetailsFiles = configUtils.readConfig(\"GS_DETAILS_FILES\");\n\t\tgsDetailsCases = configUtils.readConfig(\"GS_DETAILS_CASES\");\n\t}", "private final void configureKeys() {\n\t\t// SecretServer's public key\n\t\tString line = ComMethods.getValueFor(\"SecretServer\", pubkeysfn);\n\t\tint x = line.indexOf(',');\n\t\tmy_n = new BigInteger(line.substring(0,x));\n\t\tmy_e = new Integer(line.substring(x+1,line.length()));\n\n\t\t// SecretServer's private key\n\t\tline = ComMethods.getValueFor(\"SecretServer\", privkeysfn);\n\t\tx = line.indexOf(',');\n\t\tmy_d = new BigInteger(line.substring(x+1,line.length()));\n\n\t\t// Public keys for all registered Users\n\t\tusersPubKeys1 = new BigInteger[validUsers.length];\n\t\tusersPubKeys2 = new int[validUsers.length];\n\t\tfor (int i=0; i<validUsers.length; i++) {\n\t\t\tline = ComMethods.getValueFor(validUsers[i], pubkeysfn);\n\t\t\tx = line.indexOf(',');\n\t\t\tusersPubKeys1[i] = new BigInteger(line.substring(0,x));\n\t\t\tusersPubKeys2[i] = new Integer(line.substring(x+1,line.length()));\n\t\t}\n\t}", "public void initialConfig() {\n }", "private void checkConfig() {\n\t\t\n\t\tif (config.getDouble(\"configversion\", 0.0) - configVersion > .001) {\n\t\t\tString name = config.getString(QuestConfigurationField.NAME.getKey(), \"NO NAME\");\n\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"The quest [\" + name + \"] has an invalid version!\\n\"\n\t\t\t\t\t+ \"QuestManager Configuration Version: \" + configVersion + \" doesn't match quest's: \" \n\t\t\t\t\t+ config.getDouble(\"configversion\", 0.0));\n\t\t\t\n\t\t}\n\t\t\n\t\t//Check each field and put in defaults if they aren't there (niave approach)\n\t\tfor (QuestConfigurationField field : QuestConfigurationField.values()) {\n\t\t\tif (!config.contains(field.getKey())) {\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"[\" + getName() + \"] \"\n\t\t\t\t\t\t+ \"Failed to find field information: \" + field.name());\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().info(\"Adding default value...\");\n\t\t\t\tconfig.set(field.getKey(), field.getDefault());\n\t\t\t}\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}", "protected void initialize() {}", "protected void initialize() {}", "Map getOptions();", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\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}" ]
[ "0.58501524", "0.56615955", "0.5648513", "0.5611986", "0.55553514", "0.55545557", "0.54622024", "0.54432315", "0.54206073", "0.539729", "0.53674024", "0.53428835", "0.5323397", "0.53228396", "0.5311487", "0.5291188", "0.52779615", "0.526905", "0.5266268", "0.52648234", "0.52639353", "0.5254109", "0.5252906", "0.5202471", "0.51714057", "0.51652586", "0.5153627", "0.5150584", "0.51461005", "0.5144984", "0.5143394", "0.5143394", "0.5143394", "0.5143394", "0.5143394", "0.5143394", "0.5136088", "0.5122695", "0.5122539", "0.5116329", "0.5115787", "0.5112242", "0.51085836", "0.51017445", "0.50920045", "0.50820297", "0.507684", "0.5074888", "0.50725585", "0.5070156", "0.50671405", "0.5066045", "0.5061064", "0.50498533", "0.5040936", "0.5040704", "0.5040121", "0.50373197", "0.50373197", "0.5036681", "0.50339997", "0.5032327", "0.5026928", "0.50247663", "0.50237507", "0.5020646", "0.5014856", "0.50138533", "0.5007527", "0.5005997", "0.50051224", "0.50004864", "0.49948382", "0.49945438", "0.4991531", "0.49866813", "0.49763426", "0.49692723", "0.49655816", "0.49515763", "0.49491414", "0.49459025", "0.49425262", "0.493696", "0.49357787", "0.4934739", "0.49311137", "0.49300662", "0.4927934", "0.49258038", "0.49221653", "0.49221653", "0.49221653", "0.49220815", "0.49220815", "0.49188894", "0.49174973", "0.49174973", "0.49119252", "0.49119252", "0.49119252" ]
0.0
-1
Creates new form Reports
public Reports() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"/report.create\", method = RequestMethod.GET)\n @ResponseBody public ModelAndView newreportForm(HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports report = new reports();\n \n mav.addObject(\"btnValue\", \"Create\");\n mav.addObject(\"reportdetails\", report);\n\n return mav;\n }", "Report createReport();", "void createReport(Report report);", "public static void CreateReport() {\n\t\tString fileName = new SimpleDateFormat(\"'Rest_Country_Report_'YYYYMMddHHmm'.html'\").format(new Date());\n\t\tString path = \"Report/\" + fileName;\n\t\treport = new ExtentReports(path);\n\t}", "public FormFieldsReport() {}", "@RequestMapping(value = \"/create_report\", method = RequestMethod.POST)\n public @ResponseBody\n ModelAndView createreport(@Valid @ModelAttribute(value = \"reportdetails\") reports reportdetails, BindingResult result, HttpSession session) throws Exception {\n\n if (result.hasErrors()) {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n mav.addObject(\"btnValue\", \"Create\");\n return mav;\n }\n \n reportmanager.createReport(reportdetails);\n\n ModelAndView mav = new ModelAndView(\"/sysAdmin/reports/details\");\n mav.addObject(\"success\", \"reportCreated\");\n return mav;\n }", "private void saveForm() {\n\n if (reportWithCurrentDateExists()) {\n // Can't save this case\n return;\n }\n\n boolean isNewReport = (mRowId == null);\n\n // Get field values from the form elements\n\n // Date\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = df.format(mCalendar.getTime());\n\n // Value\n Double value;\n try {\n value = Double.valueOf(mValueText.getText().toString());\n } catch (NumberFormatException e) {\n value = 0.0;\n }\n\n // Create/update report\n boolean isSaved;\n if (isNewReport) {\n mRowId = mDbHelper.getReportPeer().createReport(mTaskId, date, value);\n isSaved = (mRowId != 0);\n } else {\n isSaved = mDbHelper.getReportPeer().updateReport(mRowId, date, value);\n }\n\n // Show toast notification\n if (isSaved) {\n int toastMessageId = isNewReport ?\n R.string.message_report_created :\n R.string.message_report_updated;\n Toast toast = Toast.makeText(getApplicationContext(), toastMessageId, Toast.LENGTH_SHORT);\n toast.show();\n }\n }", "public void createReport(Report report) {\n view.onProgress(true);\n apiInterface.newReport(report.getNumber(), report.isNo_telp(), report.isNo_rek())\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new SingleObserver<ReportItem>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onSuccess(ReportItem reportItem) {\n if (reportItem != null) {\n view.onReportResult(reportItem.toReportparcel(), true);\n }\n view.onProgress(false);\n }\n\n @Override\n public void onError(Throwable e) {\n view.onError(e.getMessage());\n view.onProgress(false);\n }\n });\n }", "private void crearReporte() {\n medirTiempoDeEnvio();\n SimpleDateFormat variableFecha = new SimpleDateFormat(\"dd-MM-yyyy\");\n Calendar cal = Calendar.getInstance();\n String dia = String.valueOf(cal.get(cal.DATE));\n String mes = String.valueOf(cal.get(cal.MONTH) + 1);\n String año = String.valueOf(cal.get(cal.YEAR));\n String fechainicio;\n String fechafin;\n Map parametro = new HashMap();\n cargando.setVisible(true);\n try {\n JasperViewer v;\n switch (listaTipoReporte.getSelectedIndex()) {\n case 0:\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"fecha\",fechainicio+\" al \"+fechafin);\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha\",\" dia \"+fechainicio);\n }\n \n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_diarias\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_diario\", parametro);\n v.setTitle(\"Reporte de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n if (rb_mensual.isSelected()) {\n int dia2 = u.numero(mess);\n String fechanueva1 = año + \"-\" + mess + \"-\" + \"01\";\n String fechai1 = año + \"-\" + mess + \"-\" + \"15\";\n String fechai2 = año + \"-\" + mess + \"-\" + \"16\";\n String fechaf1 = año + \"-\" + mess + \"-\" + dia2;\n //----------------------------- ojo son 4 fechas finico-ffinal1 y fechafinal2 -a fechafinal2\n // String fechainicio = u.fechaCorrecta(variableFecha.format(jDateChooser1.getDate()));\n // String f = u.fechaCorrecta(variableFecha.format(jDateChooser2.getDate()));\n // String fechafin =fechainicio;\n String p = \"('\" + fechanueva1 + \"','\" + fechai1 + \"','\" + fechai2 + \"','\" + fechaf1 + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_mensual\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_mensual\", parametro);\n v.setTitle(\"Reporte mensual de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n Reporte r = new Reporte();\n String nombreReporte = \"\";\n if (this.primera.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 1);\n parametro.put(\"periodo\", \"De la primera quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincena\";\n } else {\n if (this.segunda.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 2);\n parametro.put(\"periodo\", \"De la segunda quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincenaSegunda\";\n }\n }\n v = u.runReporte(nombreReporte, parametro);\n v.setTitle(\"Reporte quincenal de ordenes procesadas\");\n v.setVisible(true);\n u.ejecutarSQL(\"DROP TABLE IF EXISTS temporal1\");\n }\n }\n break;\n case 1:\n //RordeAuditada\n if (rb_mensual.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n int dia2 = u.numero(mess);\n String fechanueva = año + \"-\" + mess + \"-\" + \"01\"; //calcular el anho\n String fechai = año + \"-\" + mess + \"-\" + \"15\";\n String fechaf = año + \"-\" + mess + \"-\" + dia2;\n String p1 = \"('\" + fechanueva + \"','\" + fechai + \"','\" + fechaf + \"')\";\n if (u.ejecutarSP(p1, \"Raudita_mensual\")) {\n parametro.put(\"fecha\", fechanueva);\n parametro.put(\"fecha_p\", fechai);\n parametro.put(\"fecha_s\", fechaf);\n parametro.put(\"año\", año);\n parametro.put(\"mes\", mes);\n v = u.runReporte(\"report7\", parametro);\n v.setTitle(\"Reporte mensual de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha1\", \"Del dia \" + fechainicio);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"reporteJoel\")) {\n v = u.runReporte(\"RordeAuditada\", parametro);\n v.setTitle(\"Reporte diario de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n }\n if (rb_quincenal.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n String ms = u.obtenerMes(mess);\n if (this.primera.isSelected()) {\n q = \"Primera\";\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"02\") + \"','\" + (año + \"-\" + mess + \"-\" + \"03\") + \"','\" + (año + \"-\" + mess + \"-\" + \"04\") + \"','\" + (año + \"-\" + mess + \"-\" + \"05\") + \"','\" + (año + \"-\" + mess + \"-\" + \"06\") + \"','\" + (año + \"-\" + mess + \"-\" + \"07\") + \"','\" + (año + \"-\" + mess + \"-\" + \"08\") + \"','\" + (año + \"-\" + mess + \"-\" + \"09\") + \"','\" + (año + \"-\" + mess + \"-\" + \"10\") + \"','\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"11\") + \"','\" + (año + \"-\" + mess + \"-\" + \"12\") + \"','\" + (año + \"-\" + mess + \"-\" + \"13\") + \"','\" + (año + \"-\" + mess + \"-\" + \"14\") + \"','\" + (año + \"-\" + mess + \"-\" + \"15\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n if (this.segunda.isSelected()) {\n q = \"Segunda\";\n if (mess == 2) {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"29\") + \"','\" + (año + \"-\" + mess + \"-\" + \"30\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n }\n }\n }\n break;\n case 2:\n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fechaInicio\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporte_errores_diarios\", parametro);\n v.setTitle(\"Reporte de Errores\");\n v.setVisible(true);\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n ErroresSiapo.agregar(ex, \"codigo 39\");\n }\n break;\n case 3:\n \n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"PERIODO\", \"Del \" + u.fechaReves(fechainicio) + \" al \" + u.fechaReves(fechafin));\n } else {\n String m = Integer.toString(this.cb_mes.getSelectedIndex() + 1);\n fechafin = año + \"-\" + m + \"-\" + u.numero(this.cb_mes.getSelectedIndex() + 1);\n fechainicio = año + \"-\" + m + \"-01\";\n parametro.put(\"PERIODO\", \"Del mes de \" + u.obtenerMes(this.cb_mes.getSelectedIndex() + 1) + \" del año \" + año);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ERRORES\")) {\n v = u.runReporte(\"analisisDeEficiencia\", parametro);\n v.setTitle(\"Reporte de Analisis de Eficiencia\");\n v.setVisible(true);\n } else {\n ErroresSiapo.agregar(null, \"codigo 39\");\n System.out.println(\"mal\");\n }\n break;\n case 4: \n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fecha\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporteDiarioOrdenesRegreso\", parametro);\n v.setTitle(\"Reporte de Razones\");\n v.setVisible(true);\n } catch (Exception e) {\n ErroresSiapo.agregar(e, \"codigo 38\");\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n }\n break;\n }\n } catch (Exception e) {\n }\n\n }", "boolean createReport(String lang, String reportId, String fileName, Object... params) throws Exception;", "public Report() {\r\n }", "@Test(priority = 12, dataProvider = \"AddReport\", dataProviderClass = PIMData.class)\n public void addReportPage(String name, String criteria, String criteriaInclude, String fieldGroup,\n String field) {\n softAssert = new SoftAssert();\n LoginPage.login(Constants.OrgUserName, Constants.OrgPassword);\n\n PIMPage.clickPIM();\n softAssert.assertTrue(PIMPage.isPIMPageDisplay(), \"PIM page is not displayed\");\n ReportPage.clickReportPage();\n softAssert.assertTrue(ReportPage.isReportPageDisplayed(), \"Report page is not displayed\");\n ReportPage.clickAddBtn();\n\n ReportPage.addReportForm(name, criteria, criteriaInclude, fieldGroup, field);\n\n softAssert.assertAll();\n\n\n }", "protected Report()\n {\n super();\n }", "public Report() {\n\t\tsuper();\n\t}", "@Override\n public ResponseEntity<?> createReport(OutputReport report) throws IOException, MessagingException {\n Date endDate = midnight();\n Date startDate = midnight();\n if (report.getReportType() == 0) {\n endDate = midnight();\n startDate = setDateBefore(1);\n } else if (report.getReportType() == 1) {\n endDate = midnight();\n startDate = setDateBefore(7);\n } else if (report.getReportType() == 2) {\n endDate = midnight();\n startDate = setDateBefore(30);\n } else if (report.getReportType() == 3) {\n endDate = new Date(report.getEndDate());\n startDate = new Date(report.getStartDate());\n }\n ExcelHelper.writeExcel(report.getReportItemList(), \"NiceJavaBooks.xls\", report.getTotalRevenue());\n Place place = placeRepository.findById(report.getPlaceId()).get();\n String content = \"\";\n if(report.getReportType() == 0){\n content = \"Daily sales report\";\n }else if(report.getReportType() == 1){\n content = \"Weekly sales report\";\n }else if(report.getReportType() == 2){\n content = \"Monthly sales report\";\n }else if(report.getReportType() == 3){\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd/MM/yyyy\");\n content = \"Sales report from \"+formatter.format(startDate)+\" to \"+formatter.format(endDate);\n }\n sendEmail(new File(\"NiceJavaBooks.xls\"), place.getMail(), content);\n return ResponseEntity.ok(\"OK\");\n }", "public void create(Employee employee, Company company, IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "@RequestMapping(value = \"/report.edit\", method = RequestMethod.GET)\n public @ResponseBody ModelAndView reportForm(@RequestParam Integer reportId, HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports reportDetails = reportmanager.getReportById(reportId);\n \n mav.addObject(\"btnValue\", \"Update\");\n mav.addObject(\"reportdetails\", reportDetails);\n\n return mav;\n }", "public GenerateReport() {\n initComponents();\n displayLogs();\n }", "@POST\n @Path(\"/report\")\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n public String createReport(ReportVo reportVo) throws Exception {\n\n log.info(\"Creating report \" + reportVo);\n\n Report report = reportService.createReport(reportVo);\n\n // Send an email\n try {\n reportService.sendReportEmail(report, reportVo.isSendEmail());\n } catch (Exception e) {\n log.warn(\"Failed sending email for report \" + report.getId(), e);\n }\n\n return \"OK\";\n }", "public void generateReport() {\n ReportGenerator rg = ui.getReportGenerator();\n if (rg == null || !rg.isVisible()) {\n ui.openReportGenerator();\n rg = ui.getReportGenerator();\n }\n Image img = getImage();\n if (img == null) {\n return;\n }\n rg.addImage(img, \"Plot\");\n }", "@Override\n\tpublic void createForm(ERForm form) {\n\t\t\tString sql = \"insert into project1.reimbursementInfo (userName, fullName, thedate, eventstartdate, thelocation, description, thecost, gradingformat, passingpercentage, eventtype, filename,status,reason) values (?,?,?,?,?,?,?,?,?,?,?,?,?);\";\n\t\t\ttry {PreparedStatement stmt = conn.prepareCall(sql);\n\t\t\t//RID should auto increment, so this isnt necessary\n\t\t\t\n\t\t\tstmt.setString(1, form.getUserName());\n\t\t\tstmt.setString(2, form.getFullName());\n\t\t\tstmt.setDate(3, Date.valueOf(form.getTheDate()));\n\t\t\tstmt.setDate(4, Date.valueOf(form.getEventStartDate()));\n\t\t\tstmt.setString(5, form.getTheLocation());\n\t\t\tstmt.setString(6, form.getDescription());\n\t\t\tstmt.setDouble(7, form.getTheCost());\n\t\t\tstmt.setString(8, form.getGradingFormat());\n\t\t\tstmt.setString(9, form.getPassingPercentage());\n\t\t\tstmt.setString(10, form.getEventType());\n\t\t\tstmt.setString(11, form.getFileName());\n\t\t\tstmt.setString(12, \"pending\");\n\t\t\tstmt.setString(13, \"\");\n\t\t\tstmt.executeUpdate();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@GET\n @Path(\"/new-report-template\")\n @Produces(\"application/json;charset=UTF-8\")\n @NoCache\n public ReportVo newTemplateReport() {\n return reportService.newTemplateReport();\n }", "public void generateReport()\r\n {\r\n ProfilerGUI reportGUI = new ProfilerGUI(map,mapCountTracker);\r\n //reportGUI.\r\n }", "public void addSubReport(SubReportForm reportForm) throws SubReportDAOSysException\r\n {\r\n String sqlStr = \"insert into R_CustomSubReport_Tab values(\" +\r\n reportForm.getReportID() + \",\" +\r\n reportForm.getMReportID() + \",'\" +\r\n reportForm.getReportName() + \"','\" +\r\n reportForm.getState() + \"')\";\r\n\r\n OperateDB operateDB = new OperateDB();\r\n try\r\n {\r\n LogUtil.debug(\"system\", \"[SubReportDAOOracle]====================the sql string is : \" + sqlStr);\r\n operateDB.exeupdate(sqlStr);\r\n\r\n }\r\n catch (ULMSSysException se)\r\n {\r\n throw new SubReportDAOSysException(\"SQLException while addSubReport: sql = \" + sqlStr + \" :\\n\" + se);\r\n }\r\n\r\n }", "public Reportes() {\n initComponents();\n }", "public Report(Employee employee, int numberOfReports){\n this.employee=employee;\n this.numberOfReports=numberOfReports;\n }", "public static Result postAddPaper() {\n Form<PaperFormData> formData = Form.form(PaperFormData.class).bindFromRequest();\n Paper info1 = new Paper(formData.get().title, formData.get().authors, formData.get().pages,\n formData.get().channel);\n info1.save();\n return redirect(routes.PaperController.listProject());\n }", "private void reportesButtonActionPerformed(java.awt.event.ActionEvent evt) {\n reportesView = null;\n reportesView = new ReportesView();\n \n this.contenedorPanel.removeAll();\n this.contenedorPanel.setVisible(false);\n reportesView.initializeControl(control);\n this.contenedorPanel.add(reportesView);\n this.contenedorPanel.setVisible(true); \n }", "public void crearReporte() {\r\n\t\tJFileChooser chooser = new JFileChooser(\"reporte.doc\");\r\n\t\tchooser.addChoosableFileFilter(new FileFilter() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic String getDescription() {\r\n\t\t\t\treturn \"*.doc\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic boolean accept(File f) {\r\n\t\t\t\t if (f.isDirectory())\r\n\t\t {\r\n\t\t return false;\r\n\t\t }\r\n\r\n\t\t String s = f.getName();\r\n\r\n\t\t return s.endsWith(\".doc\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tint res = chooser.showSaveDialog(this);\r\n\t\tif(res == JFileChooser.APPROVE_OPTION)\r\n\t\t{\r\n\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\r\n\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\tJava2Word word = new Java2Word(this, file);\r\n\t\t}\r\n\t\t\r\n\t}", "private void btnReporteActionPerformed(java.awt.event.ActionEvent evt) {\n HashMap parametros = new HashMap();\n parametros.put(\"Logo\", \".//src//Imagenes//BuscarComputadora.png\");\n parametros.put(\"Titulo\", \"Resultado de Análisis\");\n parametros.put(\"Subtitulo\", \"Documentos\");\n JasperPrint jprint = EvaluacionBL.generaReporte(\"rptReporteAnalisis\", parametros, null);\n\n try {\n JRViewer jrv = new JRViewer(jprint);\n JFrame frmReporteAnalisis = new JFrame();\n frmReporteAnalisis.getContentPane().add(jrv,BorderLayout.CENTER);\n frmReporteAnalisis.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frmReporteAnalisis.setSize(706, 478);\n\n frmReporteAnalisis.setTitle(\"Pre - View de Resultado de Análisis\");\n frmReporteAnalisis.setVisible(true);\n\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n\n }", "private void createReportForm(Composite aParent) {\n\t\tSashForm reportSashForm = new SashForm(aParent, SWT.HORIZONTAL);\n\n\t\tComposite comp = new Composite(reportSashForm, SWT.CENTER | SWT.BORDER);\n\t\tGridLayout compLayout = new GridLayout();\n\t\tcompLayout.numColumns = 1;\n\t\tcomp.setLayout(compLayout);\n\n\t\tCLabel label = new CLabel(comp, SWT.NONE);\n\t\tlabel.setText(\"HTML results:\");\n\t\tGridData gd = new GridData();\n\t\tgd.horizontalSpan = 1;\n\t\tlabel.setLayoutData(gd);\n\n\t\t// create a browser widget\n\t\tthis.iBrowser = new Browser(comp, SWT.BORDER);\n\n\t\tGridData brLayout = new GridData();\n\t\tbrLayout.grabExcessHorizontalSpace = true;\n\t\tbrLayout.grabExcessVerticalSpace = true;\n\t\tbrLayout.horizontalAlignment = GridData.FILL;\n\t\tbrLayout.verticalAlignment = GridData.FILL;\n\t\tthis.iBrowser.setLayoutData(brLayout);\n\n\t\tComposite comp2 = new Composite(reportSashForm, SWT.CENTER | SWT.BORDER);\n\t\tGridLayout compLayout2 = new GridLayout();\n\t\tcompLayout2.numColumns = 1;\n\t\tcomp2.setLayout(compLayout2);\n\n\t\tCLabel label2 = new CLabel(comp2, SWT.NONE);\n\t\tlabel2.setText(\"Exceptions:\");\n\t\tGridData gd2 = new GridData();\n\t\tgd2.horizontalSpan = 1;\n\t\tlabel2.setLayoutData(gd2);\n\n\t\t// create non editable Text widget for exceptions\n\t\tthis.iException = new Text(comp2, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);\n\t\tthis.iException.setEditable(false);\n\t\tGridData brLayout2 = new GridData();\n\t\tbrLayout2.grabExcessHorizontalSpace = true;\n\t\tbrLayout2.grabExcessVerticalSpace = true;\n\t\tbrLayout2.horizontalAlignment = GridData.FILL;\n\t\tbrLayout2.verticalAlignment = GridData.FILL;\n\t\tthis.iException.setLayoutData(brLayout2);\n\n\t}", "public DefaultValidationReport()\r\n {\r\n factory = new DefaultReportFactory();\r\n }", "void onReportResult(Report report, boolean isNew);", "public reporteController() {\n }", "public GenreateReportView(WhatsUpUI ui) {\n\t\tthis.ui = ui;\n\t\tuser = (AdminVO) ui.getSession().getAttribute(StringConstants.USER);\n\t\taddComponent(buildLayout());\n\t}", "@RequestMapping(value=\"/selectedReport.pdf\",method=RequestMethod.POST)\n\tpublic ModelAndView getSelectedReport(HttpServletRequest request,Model model)throws Exception {\n\n\t\t\n\t\tString reportname = request.getParameter(\"report_selection\");\n\t\tString date=request.getParameter(\"date\");\n\t\tDate d1=DateUtil.convertDateFromStringtoDate(date);\n\t\tdate=DateUtil.convertInDashedFormat(d1);\n\t\t\n\t\tif(reportname.equals(\"apt_schedule\")){\n\t\t\tList<AppointmentMaster> appointMasterList = new ArrayList<>();\n\t\t\tappointMasterList = appointmentMasterService.selectAllAppointments(d1);\n\t\t\tString message = \"There are no records available\" ;\n\t\t\tif(appointMasterList.size() > 0)\n\t\t\treturn new ModelAndView(\"appointmentMastersRpt\", \"appointmentList\", appointMasterList);\n\t\t\telse{\n\n\t\t\t\tmodel.addAttribute(\"message\",message);\n\t\t\t\treturn new ModelAndView(\"appointmentMastersRpt\", \"appointmentList\", appointMasterList);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"apt_reschedule\")){\n\t\t\tList<AppointmentMasterHistory> appointmentHistoryList = appointmentMasterHistoryService.selectAllAppointmentsHistory();\n\t\t\tList<AppointmentMaster> appointmentMasterList = new ArrayList<>(); \n\t\t\tappointmentMasterList = appointmentMasterService.selectAllAppointments(d1);\n\t\t\t\n\t\t\tList<RescheduledReport> reschduledReportList = new ArrayList<>() ;\n\t\t\treschduledReportList = rescheduledReportService.selectRescheduledAppointments(appointmentHistoryList,appointmentMasterList);\n\t\t\tString message = \"There are no records available\" ;\n\t\t\tif(reschduledReportList.size() >0)\n\t\t\t\treturn new ModelAndView(\"AppointmentrescheRpt\" , \"rescheduledReportList\" , reschduledReportList );\n\t\t\telse\n\t\t\t\tmodel.addAttribute(\"message\",message);\n\t\t\t\treturn new ModelAndView(\"AppointmentrescheRpt\" , \"rescheduledReportList\" , reschduledReportList );\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"apt_cancelled\")){\n\t\t\tList<AppointmentMaster> cancelledAppointmentMasterList = new ArrayList<>();\n\t\t\tcancelledAppointmentMasterList =appointmentMasterService.selectcancelledAppointments(d1);\n\t\t\tString message = \"There are no records available\" ;\n\t\t\tif(cancelledAppointmentMasterList.size() >0)\n\t\t\treturn new ModelAndView(\"appointmentMastercRpt\" , \"cancelledAppointmentMasterList\" , cancelledAppointmentMasterList);\n\t\t\telse{\n\t\t\t\tmodel.addAttribute(\"message\",message);\n\t\t\t\treturn new ModelAndView(\"appointmentMastercRpt\" , \"cancelledAppointmentMasterList\" , cancelledAppointmentMasterList);\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"waiting_time_rpt\")){\n\t\t\tList<WaitingTimeModel> listWaitingTime = new ArrayList<>();\n\t\t\t\tlistWaitingTime = \tappointmentMasterService.getWaitingTime(date);\n\t\t\t\tString message = \"There are no records available\";\n\t\t\t\tif(listWaitingTime.size() > 0)\n\t\t\t\t\treturn new ModelAndView(\"waitingTimeRpt\",\"listWaitingTime\",listWaitingTime);\n\t\t\t\telse {\n\t\t\t\t\tmodel.addAttribute(\"message\" , message);\n\t\t\t\t\treturn new ModelAndView(\"waitingTimeRpt\" , \"listWaitingTime\" ,listWaitingTime );\n\t\t\t\t}\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"service_time_rpt\")){\n\t\t\t\n\t\t\tList<ServiceTimeModel> listServiceTime = new ArrayList<>();\n\t\t\tlistServiceTime =\tappointmentMasterService.getServiceTime(date);\n\t\t\tString message = \"There are no records available\";\n\t\t\tif(listServiceTime.size() > 0)\n\t\t\treturn new ModelAndView(\"serviceTimeRpt\",\"listServiceTime\",listServiceTime);\n\t\t\telse\n\t\t\t{\n\t\t\t\tmodel.addAttribute(\"message\" , message);\n\t\t\t\treturn new ModelAndView(\"serviceTimeRpt\" , \"listServiceTime\" , listServiceTime);\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"apt_late\")){\n\t\t\t\n\t\t\tList<AppointmentMaster> lateAppointmentMasterList = new ArrayList<>();\n\t\t\tlateAppointmentMasterList = appointmentMasterService.selectLateAppointments(d1);\n\t\t\tString message = \"There are no records available\" ;\n\t\t\tif(lateAppointmentMasterList.size() >0)\n\t\t\treturn new ModelAndView(\"appointmentMasterlRpt\" , \"lateAppointmentMasterList\" , lateAppointmentMasterList);\n\t\t\telse\n\t\t\t\tmodel.addAttribute(\"message\",message);\n\t\t\treturn new ModelAndView(\"appointmentMasterlRpt\" , \"lateAppointmentMasterList\" , lateAppointmentMasterList);\n\t\t}\n\t\t\n\t\telse if(reportname.equals(\"apt_no_show\")){\n\t\t\t\n\t\t\tList<AppointmentMaster> noShowAppointmentMasterList = new ArrayList<>();\n\t\t\tnoShowAppointmentMasterList =appointmentMasterService.selectNoShowAppointments(d1);\n\t\t\tString message = \"There are no records available\" ;\n\t\t\tif(noShowAppointmentMasterList.size() > 0)\n\t\t\treturn new ModelAndView(\"appointmentMasternsRpt\" , \"noShowAppointmentMasterList\" , noShowAppointmentMasterList);\n\t\t\telse{\n\t\t\t\tmodel.addAttribute(\"message\",message);\n\t\t\t\treturn new ModelAndView(\"appointmentMasternsRpt\" , \"noShowAppointmentMasterList\" , noShowAppointmentMasterList);\n\t\t\t}\n\t\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public ReportGUI() {\n // Adding GUI components\n JFrame reportF = new JFrame();\n reportF.setTitle(\"Game Results\");\n reportF.setSize(500,110);\n reportF.setLocation(200,150);\n\n reportDisplay = new JTextArea();\n dbConnection = new DatabaseConnection();\n\n // Calls the method to build the report content\n buildReport();\n\n // Adds the text area to the report frame and makes it visible\n reportDisplay.setEditable(false);\n reportDisplay.setText(reportContent);\n saveTxtReport = new JButton(\"Save Report\");\n\n JPanel reportPan = new JPanel();\n JPanel buttonPan = new JPanel();\n\n reportPan.add(reportDisplay);\n buttonPan.add(saveTxtReport);\n\n reportF.add(reportPan, \"North\");\n reportF.add(buttonPan, \"South\");\n\n saveTxtReport.addActionListener(this);\n reportF.setVisible(true);\n }", "public void setReport(Report report);", "public void registerReports() throws Exception{\n \tGenericPatientSummary ps = new GenericPatientSummary();\n \tps.delete();\n \tps.setup();\n }", "@RequestMapping(value = \"/posNegResults/init\", method = RequestMethod.GET)\n public ModelAndView initReportForm(HttpServletRequest request) throws Exception {\n logger.debug(\"Iniciando Reporte de Resultados Positivos y Negativos\");\n String urlValidacion;\n try {\n urlValidacion = seguridadService.validarLogin(request);\n //si la url esta vacia significa que la validaci?n del login fue exitosa\n if (urlValidacion.isEmpty())\n urlValidacion = seguridadService.validarAutorizacionUsuario(request, ConstantsSecurity.SYSTEM_CODE, false);\n } catch (Exception e) {\n e.printStackTrace();\n urlValidacion = \"404\";\n }\n ModelAndView mav = new ModelAndView();\n if (urlValidacion.isEmpty()) {\n long idUsuario = seguridadService.obtenerIdUsuario(request);\n List<EntidadesAdtvas> entidades = new ArrayList<EntidadesAdtvas>();\n if (seguridadService.esUsuarioNivelCentral(idUsuario, ConstantsSecurity.SYSTEM_CODE)){\n entidades = entidadAdmonService.getAllEntidadesAdtvas();\n }else {\n entidades = seguridadService.obtenerEntidadesPorUsuario((int) idUsuario, ConstantsSecurity.SYSTEM_CODE);\n }\n mav.addObject(\"entidades\", entidades);\n mav.setViewName(\"reportes/residencia/positiveNegativeResults\");\n } else\n mav.setViewName(urlValidacion);\n\n return mav;\n }", "public ControllerReporteHistorialClinico() {\n }", "@Override\n void createReport(final Format reportFormat,\n final long start, final long end) {\n makeBriefReport(reportFormat, \"Informe breu\", start, end);\n writeToFile();\n getFormat().finishPrinting();\n }", "@RequestMapping(value = \"sinResultado\", method = RequestMethod.GET)\n public ModelAndView initCreateFormSR(HttpServletRequest request) throws Exception {\n logger.debug(\"Crear reporte general de notificaciones\");\n String urlValidacion=\"\";\n try {\n urlValidacion = seguridadService.validarLogin(request);\n //si la url esta vacia significa que la validación del login fue exitosa\n if (urlValidacion.isEmpty())\n urlValidacion = seguridadService.validarAutorizacionUsuario(request, ConstantsSecurity.SYSTEM_CODE, false);\n }catch (Exception e){\n e.printStackTrace();\n urlValidacion = \"404\";\n }\n ModelAndView mav = new ModelAndView();\n if (urlValidacion.isEmpty()) {\n mav.setViewName(\"reportes/residencia/sinResultado\");\n long idUsuario = seguridadService.obtenerIdUsuario(request);\n List<EntidadesAdtvas> entidades = new ArrayList<EntidadesAdtvas>();\n if (seguridadService.esUsuarioNivelCentral(idUsuario, ConstantsSecurity.SYSTEM_CODE)){\n entidades = entidadAdmonService.getAllEntidadesAdtvas();\n }else {\n entidades = seguridadService.obtenerEntidadesPorUsuario((int) idUsuario, ConstantsSecurity.SYSTEM_CODE);\n }\n List<TipoNotificacion> tiposNotificacion = new ArrayList<TipoNotificacion>();// = catalogosService.getTipoNotificacion();\n TipoNotificacion tipoNotificacionSF = catalogosService.getTipoNotificacion(\"TPNOTI|SINFEB\");\n TipoNotificacion tipoNotificacionIRA = catalogosService.getTipoNotificacion(\"TPNOTI|IRAG\");\n tiposNotificacion.add(tipoNotificacionSF);\n tiposNotificacion.add(tipoNotificacionIRA);\n List<Divisionpolitica> departamentos = divisionPoliticaService.getAllDepartamentos();\n List<AreaRep> areas = seguridadService.getAreasUsuario((int)idUsuario,4);\n mav.addObject(\"areas\", areas);\n mav.addObject(\"departamentos\", departamentos);\n mav.addObject(\"entidades\",entidades);\n mav.addObject(\"tiposNotificacion\", tiposNotificacion);\n\n }else{\n mav.setViewName(urlValidacion);\n }\n return mav;\n }", "private boolean addNewReport(HttpServletRequest request){\n\t\ttry {\n\t\t\tint totalTime = 0;\n\t\t\tString[] act_sub_values = new String[ReportGenerator.act_sub_names.length];\n\t\t\tString[] lower_activity_values = new String[ReportGenerator.lower_activities.length];\n\t\t\tfor (int i = 0; i<ReportGenerator.act_sub_names.length; i++) {\n\t\t\t\tString value = request.getParameter(ReportGenerator.act_sub_names[i]);\n\t\t\t\tif (!value.equals(\"\")) {\n\t\t\t\t\tact_sub_values[i] = value;\n\t\t\t\t\tif(!checkInt(value)){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ttotalTime += Integer.parseInt(value);\n\t\t\t\t}else {\n\t\t\t\t\tact_sub_values[i] = \"0\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i<ReportGenerator.lower_activities.length; i++) {\n\t\t\t\tString value = request.getParameter(ReportGenerator.lower_activities_names[i]);\n\t\t\t\tif (!value.equals(\"\")) {\n\t\t\t\t\tlower_activity_values[i] = value;\n\t\t\t\t\tif(!checkInt(value)){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ttotalTime += Integer.parseInt(value);\n\t\t\t\t} else {\n\t\t\t\t\tlower_activity_values[i] = \"0\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tDate date = new Date(cal.getTimeInMillis()); \n\t\t\tString week = request.getParameter(\"week\");\n\t\t\tint userGroupID = (int) session.getAttribute(\"userGroupID\");\n\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tstmt.executeUpdate(\"INSERT INTO reports (user_group_id, date, week, total_time, signed) VALUES (\"+userGroupID+\",'\"+date.toString()+\"',\"+week+\",\"+totalTime+\",\"+0+\")\");\n\n\t\t\tStatement stmt1 = conn.createStatement();\n\t\t\tResultSet rs = stmt1.executeQuery(\"select * from reports where user_group_id = \"+userGroupID+\" and week = \"+week); \n\t\t\tint reportID = -1;\n\t\t\tif (rs.first()) {\n\t\t\t\treportID = rs.getInt(\"id\");\n\t\t\t}\n\t\t\tstmt.close();\n\n\t\t\tString q = \"INSERT INTO report_times (report_id, \";\n\t\t\tfor (int i = 0; i<ReportGenerator.act_sub_names.length; i++) {\n\t\t\t\tString valueStr = ReportGenerator.act_sub_names[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\n\t\t\tfor (int i = 0; i<ReportGenerator.lower_activities.length-1; i++) {\n\t\t\t\tString valueStr = ReportGenerator.lower_activities[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\t\t\tq += ReportGenerator.lower_activities[ReportGenerator.lower_activities.length-1];\n\n\t\t\tq += \") VALUES (\"+reportID+\",\";\n\t\t\tfor (int i = 0; i<ReportGenerator.act_sub_names.length; i++) {\n\t\t\t\tString valueStr = act_sub_values[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\n\t\t\tfor (int i = 0; i<ReportGenerator.lower_activities.length-1; i++) {\n\t\t\t\tString valueStr = lower_activity_values[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\t\t\tq += lower_activity_values[lower_activity_values.length-1]+\");\";\n\t\t\tStatement stmt2 = conn.createStatement();\n\t\t\tstmt2.executeUpdate(q);\n\t\t\tstmt2.close();\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"SQLException: \" + e.getMessage());\n\t\t\tSystem.out.println(\"SQLState: \" + e.getSQLState());\n\t\t\tSystem.out.println(\"VendorError: \" + e.getErrorCode());\n\t\t}\n\t\treturn true;\n\t}", "public static AssessmentCreationForm openFillCreationForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Create);\n\n Logger.getInstance().info(\"Fill out the required fields with valid data\");\n AssessmentCreationForm creationForm = new AssessmentCreationForm();\n creationForm.fillAssessmentInformation(new User(Roles.STAFF), assm);\n\n return new AssessmentCreationForm();\n }", "void verifyOrCreateReport(String reportId);", "public static void generateReport()\n\t{\n\t\tlong time=System.currentTimeMillis();\n\t\tString reportPath=System.getProperty(\"user.dir\")+\"//automationReport//Report\"+time+\".html\";\n\t\t\n\t\thtmlreporter=new ExtentHtmlReporter(reportPath);\n\t\textent=new ExtentReports();\n\t\textent.attachReporter(htmlreporter);\n\t\t\n\t\tString username=System.getProperty(\"user.name\");\n\t\tString osname=System.getProperty(\"os.name\");\n\t\tString browsername=CommonFunction.readPropertyFile(\"Browser\");\n\t\tString env=CommonFunction.readPropertyFile(\"Enviornment\");\n\t\t\n\t\t\n\t\textent.setSystemInfo(\"User Name\", username);\n\t\textent.setSystemInfo(\"OS Name\", osname);\n\t\textent.setSystemInfo(\"Browser Name\", browsername);\n\t\textent.setSystemInfo(\"Enviornment\", env);\n\t\t\n\t\t\n\t\thtmlreporter.config().setDocumentTitle(\"Automation Report\");\n\t\thtmlreporter.config().setTheme(Theme.STANDARD);\n\t\thtmlreporter.config().setChartVisibilityOnOpen(true);\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "FORM createFORM();", "public void generarReporteGanancia(String destino,String fechainicial,String fechafinal)\n {\n \n if(destino.equals(\"Todos\"))\n {\n try\n {\n //File miDir = new File (Crear.class.getResource(\"/Reportes/ticket.jasper\").getFile());\n //File miDir=new File(\"/Reportes/ticket.jasper\");\n URL entrada=this.getClass().getResource(\"/Reportes/GananciaVentasGeneral.jasper\");\n JasperReport jasperReport;\n jasperReport=(JasperReport)JRLoader.loadObject(entrada);\n \n HashMap parametros = new HashMap<>();\n\n \n \n parametros.put(\"destino\", destino);\n parametros.put(\"fechainicial\", fechainicial);\n parametros.put(\"fechafinal\", fechafinal);\n \n \n \t\tJasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, parametros, Conexion.obtenerConexion());\n\t\t JasperViewer viewer = new JasperViewer(jasperPrint,false);\n viewer.setTitle(\"Movimientos de Ventas Credito/Contado\");\n viewer.setVisible(true);\n \n }\n catch(Exception er)\n {\n JOptionPane.showMessageDialog(null,\"Error al generar reporte\"+er.getCause()+\"\"+er.getLocalizedMessage());\n }\n }\n else\n { \n \n try\n {\n //File miDir = new File (Crear.class.getResource(\"/Reportes/ticket.jasper\").getFile());\n //File miDir=new File(\"/Reportes/ticket.jasper\");\n URL entrada=this.getClass().getResource(\"/Reportes/GananciaVentas.jasper\");\n JasperReport jasperReport;\n jasperReport=(JasperReport)JRLoader.loadObject(entrada);\n \n HashMap parametros = new HashMap<>();\n\n \n \n parametros.put(\"destino\", destino);\n parametros.put(\"fechainicial\", fechainicial);\n parametros.put(\"fechafinal\", fechafinal);\n \n \n \t\tJasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, parametros, Conexion.obtenerConexion());\n\t\t JasperViewer viewer = new JasperViewer(jasperPrint,false);\n viewer.setTitle(\"Movimientos de Insumos\");\n viewer.setVisible(true);\n \n }\n catch(Exception er)\n {\n JOptionPane.showMessageDialog(null,\"Error al generar reporte\"+er.getCause()+\"\"+er.getLocalizedMessage());\n }\n } \n }", "public Prof_Report() {\r\n initComponents();\r\n }", "Dashboard createDashboard();", "public static IReport createReport(File f) throws ArfException {\r\n \treturn new Report(Report.getAssetReportCollection(f));\r\n }", "public void verReporte(){\n //Guardamos en variables los valores de los parametros que pasaremos al reporte\n int cc = this.clienteTMP.getCodCliente();\n int cv = this.vendedor.getCodVendedor();\n int cf = this.facturaTMP.getCodFactura();\n \n System.out.println(\"Codigo cliente: \"+cc);\n System.out.println(\"Codigo vendedor: \"+cv);\n System.out.println(\"Codigo factura: \"+cf);\n \n //obtenemos la ruta en el sistema de archivos del archivo .jasper a\n //partir de la ruta relativa en el proyecto\n //Obtenemos el contexto de la aplicacion y lo depositamos en una variable\n //ServletContext\n ServletContext servletContext = \n (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();\n \n String rutaReporte = servletContext.getRealPath(\"/reportes/factura503.jasper\");\n System.out.println(\"Ruta del reporte: \"+rutaReporte);\n //Limpiamos la variables Temporales\n clienteTMP = new Cliente();\n facturaTMP = new Factura();\n \n //Creamos el reporte\n ReporteFactura.createReport(rutaReporte, cc, cv, cf);\n //exportamos el reporte a PDF\n ReporteFactura.exportReportToPdfWeb();\n \n //Cerramos el contexto\n FacesContext.getCurrentInstance().responseComplete();\n \n }", "@RequestMapping(method = RequestMethod.POST, value = \"/fileReport\")\r\n public void addReport(@RequestBody Map<String, Object> reportSent) {\r\n\r\n logger.info(reportSent.toString());\r\n String filedby = reportSent.get(\"filedby\").toString();\r\n String lot = reportSent.get(\"lot\").toString();\r\n Integer spot = Integer.parseInt(reportSent.get(\"spot\").toString());\r\n String description = reportSent.get(\"description\").toString();\r\n Long filetime = Long.parseLong(reportSent.get(\"filetime\").toString());\r\n\r\n\r\n\r\n logger.info(filedby);\r\n logger.info(lot);\r\n logger.info(Integer.toString(spot));\r\n logger.info(description);\r\n logger.info(Long.toString(filetime));\r\n\r\n reportsRepository.fileReport(filedby, lot, spot, description, filetime);\r\n\r\n }", "public static boolean createForm(CompanyList companyList, String companyIdToBeGenerated){\t\r\n\t\t\r\n\t\tboolean isComplete = true;\r\n\t\t// generate report for each company\r\n\t\tfor(Company company : companyList){\t\t\r\n\t\t\tif(company.getEmployeeList().size() == 0){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString companyId = company.getCompanyId();\t\t\t\r\n\t\t\tif(!companyIdToBeGenerated.equalsIgnoreCase(companyId) & !companyIdToBeGenerated.equalsIgnoreCase(ReportCons.ALL_COMPANY)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Creating thirteenth month pay report for company with ID \"+company.getCompanyId()+\".\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t// making employee bean\t\t\t\r\n\t\t\tEmployeeBean employeeBean = new EmployeeBean();\t\r\n\t\t\temployeeBean.addAll(company.getEmployeeList());\r\n\t\t\t\r\n\t\t\t// creating new form\r\n\t\t\tString year = ReportUtil.getFormattedDate(companyList.getRunDate(), \"yyyy\");\r\n\t\t\tThirteenthMonthPayForm form = new ThirteenthMonthPayForm(employeeBean);\t\r\n\t\t\tform.setYear(year);\r\n\t\t\t\r\n\t\t\t//setting directory path\r\n\t\t\tString directoryName = ReportUtil.getOutputDirectory(year, company.getCompanyId(),\"Thirteenth Month Pay\", \"pdf\",\"annual\");\t\t\t\r\n\t\t\t\r\n\t\t\tFile file = new File(directoryName);\r\n\t\t\t\r\n\t\t\t// creating the form \t\r\n\t\t\ttry {\t\t\t\t\t\t\t\r\n\t\t\t\tform.createFormStream(new FileOutputStream(file));\t\r\n\t\t\t} catch (JRException | IOException e) {\t\t\r\n\t\t\t\tisComplete = false;\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} \t\t\t\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn isComplete;\t\t\r\n\t}", "public static IReport createReport(InputStream in) throws ArfException {\r\n \treturn new Report(Report.getAssetReportCollection(in));\r\n }", "private void openUserReporttWindow() {\r\n\t\tnew JFrameReport();\r\n\t}", "public void actionPerformed(ActionEvent ae) {\n\n //\n // Process the action command\n //\n // \"create report\" - Create the report\n // \"done\" - All done\n //\n try {\n switch (ae.getActionCommand()) {\n case \"create report\":\n AccountRecord account;\n SecurityRecord security;\n int index = accountField.getSelectedIndex();\n if (index < 0) {\n JOptionPane.showMessageDialog(this, \"You must specify an investment account\",\n \"Error\", JOptionPane.ERROR_MESSAGE);\n } else {\n account = (AccountRecord)accountModel.getDBElementAt(index);\n index = securityField.getSelectedIndex();\n if (index >= 0)\n security = (SecurityRecord)securityModel.getDBElementAt(index);\n else\n security = null;\n\n securityField.setSelectedIndex(-1);\n generateReport(account, security);\n }\n break;\n \n case \"done\":\n setVisible(false);\n dispose();\n break;\n }\n } catch (ReportException exc) {\n Main.logException(\"Exception while generating report\", exc);\n } catch (Exception exc) {\n Main.logException(\"Exception while processing action event\", exc);\n }\n }", "private void todayReport() {\n\t\tListSeries dollarEarning = new ListSeries();\n\t\tString[] dates = new String[1];\n\t\t/* Create a DateField with the default style. */\n Calendar calendar=Calendar.getInstance();\n\t\t\n\t\tvReportDisplayLayout.removeAllComponents();\n\t\tdates[0] = String.valueOf(calendar.get(Calendar.MONTH)+1) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.DATE)) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.YEAR));\n\t\tdollarEarning = getTodayData();\n\t\t\n\t\tdisplayChart chart = new displayChart();\n\t\t\n\t\tdReportPanel.setContent(chart.getDisplayChart(dates, dollarEarning));\n\t\tvReportDisplayLayout.addComponent(dReportPanel);\n\t}", "boolean generateReport();", "public void setActionReport(ActionReport newReport);", "public static Report createEntity() {\n\t\tReport report = new Report()\n\t\t\t\t.fromIsoCode(DEFAULT_FROM_ISO_CODE)\n\t\t\t\t.toIsoCode(DEFAULT_TO_ISO_CODE)\n\t\t\t\t.total(DEFAULT_TOTAL)\n\t\t\t\t.lastUpdated(DEFAULT_LAST_UPDATED);\n\t\treturn report;\n\t}", "private void generateReports() {\r\n\t\tLOGGER.debug(\"Report generation trigerred\");\r\n\t\tgenerateIncomingReport();\r\n\t\tgenerateOutgoingReport();\r\n\t\tgenerateIncomingRankingReport();\r\n\t\tgenerateOutgoingRankingReport();\r\n\t\tLOGGER.debug(\"Report generation completed\");\r\n\t}", "public ActionForward LocomotorReport(ActionMapping mapping, ActionForm form,\r\n HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n\r\n String ur = \"/LocomotorReport.do?LocomotorReport=LocomotorReport\";\r\n request.setAttribute(\"ur\", ur);\r\n\r\n String target = \"success\";\r\n String subquery = null, columns = null;\r\n String districtId = null;\r\n String mandalId = null;\r\n String villageId = null;\r\n String rationcard = null, agee = null;\r\n DataSource ds = null;\r\n FunctionalReportDAO funDao = new FunctionalReportDAO();\r\n int cou = 1;\r\n String edu = null, em = null, ma = null, caste = null, religion = null, disability = null, gender = null, total = null, pmarige = null;\r\n FunctionalNeedReportForm functionalNeedForm = (FunctionalNeedReportForm) form;\r\n FunctionalNeedReportDAO dao = new FunctionalNeedReportDAO();\r\n ArrayList habitationlist = new ArrayList();\r\n try {\r\n String fdate = (String) request.getParameter(\"fromdate\");\r\n String tdate = (String) request.getParameter(\"todate\");\r\n functionalNeedForm.setFromdate(fdate);\r\n functionalNeedForm.setTodate(tdate);\r\n Iterator itr = null;\r\n ds = getDataSource(request);\r\n if (ds == null || \"null\".equals(ds)) {\r\n ds = JNDIDataSource.getConnection();\r\n }\r\n FunctionalNeedReportService functionalNeedService =\r\n FunctionalNeedServiceFactory.getFunctionalNeedServiceImpl();\r\n TerritoryService territoryService = TerritoryServiceFactory.getTerritoryServiceImpl();\r\n ArrayList ohWiseDetails = new ArrayList();\r\n ArrayList empWiseSingleDetails = new ArrayList();\r\n ArrayList districtList = new ArrayList();\r\n ArrayList mandallist = new ArrayList();\r\n ArrayList villagelist = new ArrayList();\r\n ReportDAO rdao = new ReportDAO();\r\n\r\n // Get District list\r\n\r\n districtList = territoryService.getDistricts(ds);\r\n if (districtList != null && districtList.size() > 0) {\r\n functionalNeedForm.setDistrictList(districtList);\r\n }\r\n\r\n if (request.getParameter(\"district_id\") != null && !request.getParameter(\"district_id\").equals(\"\")) {\r\n mandallist = functionalNeedService.getMandals(ds, request.getParameter(\"district_id\"), functionalNeedForm.getUrban_id());\r\n functionalNeedForm.setMandallist(mandallist);\r\n }\r\n if (request.getParameter(\"mandal_id\") != null && !request.getParameter(\"mandal_id\").equals(\"\")) {\r\n habitationlist = functionalNeedService.getVillageAll(ds, request.getParameter(\"district_id\"), request.getParameter(\"mandal_id\"));\r\n functionalNeedForm.setVillagelist(habitationlist);\r\n }\r\n if (request.getParameter(\"district_id\") == null) {\r\n districtId = \"0\";\r\n } else {\r\n districtId = request.getParameter(\"district_id\");\r\n }\r\n if (request.getParameter(\"mandal_id\") == null) {\r\n mandalId = \"0\";\r\n } else {\r\n mandalId = request.getParameter(\"mandal_id\");\r\n }\r\n if (request.getParameter(\"village_id\") == null) {\r\n villageId = \"0\";\r\n } else {\r\n villageId = request.getParameter(\"village_id\");\r\n }\r\n if (\"getDetails\".equalsIgnoreCase(request.getParameter(\"mode\"))) {\r\n\r\n String name = dao.getDistMandVilHabname(ds, districtId, mandalId, villageId, \"0\");\r\n request.setAttribute(\"names\", name);\r\n // ohWiseDetails=rdao.getVisiualDisabilityCount(ds, districtId, mandalId, villageId,fdate,tdate);\r\n ohWiseDetails = funDao.getDisabilityCount(ds, districtId, mandalId, villageId, fdate, tdate, \"1\");\r\n if (ohWiseDetails.size() == 0) {\r\n request.setAttribute(\"msg\", \"No Data Found\");\r\n } else {\r\n\r\n request.setAttribute(\"ohWiseDetails\", ohWiseDetails);\r\n }\r\n\r\n } else if (\"getempWiseReport\".equalsIgnoreCase(request.getParameter(\"status\"))) {\r\n String dist = null;\r\n String mandal = null;\r\n String village = null;\r\n String vi = request.getParameter(\"villagesId\");\r\n if (request.getParameter(\"districtId\") == null) {\r\n dist = \"0\";\r\n } else {\r\n dist = request.getParameter(\"districtId\");\r\n }\r\n if (request.getParameter(\"mandalId\") == null) {\r\n mandal = \"0\";\r\n } else {\r\n mandal = request.getParameter(\"mandalId\");\r\n }\r\n if (!mandal.equals(\"0\") && !dist.equals(\"0\")) {\r\n if (request.getParameter(\"villagesId\") == null) {\r\n village = \"0\";\r\n } else {\r\n village = request.getParameter(\"villagesId\");\r\n }\r\n } else {\r\n village = \"0\";\r\n }\r\n\r\n String name = dao.getDistMandVilHabname(ds, dist, mandal, village, \"0\");\r\n request.setAttribute(\"names\", name);\r\n // ohWiseDetails=rdao.getVisiualDisabilityCount(ds, dist, mandal, village,fdate,tdate);\r\n ohWiseDetails = funDao.getDisabilityCount(ds, dist, mandal, village, fdate, tdate, \"1\");\r\n if (ohWiseDetails.size() == 0) {\r\n\r\n request.setAttribute(\"msg\", \"No Data Found\");\r\n\r\n } else {\r\n request.setAttribute(\"ohWiseDetails\", ohWiseDetails);\r\n\r\n }\r\n target = \"excel\";\r\n\r\n } else if (\"getempWiseReportPrint\".equalsIgnoreCase(request.getParameter(\"status\"))) {\r\n String dist = null;\r\n String mandal = null;\r\n String village = null;\r\n String cast = null;\r\n String hab = null;\r\n if (request.getParameter(\"hid\") == null) {\r\n hab = \"0\";\r\n } else {\r\n hab = request.getParameter(\"hid\");\r\n }\r\n\r\n if (request.getParameter(\"districtId\") == null) {\r\n dist = \"0\";\r\n } else {\r\n dist = request.getParameter(\"districtId\");\r\n }\r\n if (request.getParameter(\"mandalId\") == null) {\r\n mandal = \"0\";\r\n } else {\r\n mandal = request.getParameter(\"mandalId\");\r\n }\r\n if (!mandal.equals(\"0\") && !dist.equals(\"0\")) {\r\n if (request.getParameter(\"villagesId\") == null) {\r\n village = \"0\";\r\n } else {\r\n village = request.getParameter(\"villagesId\");\r\n }\r\n } else {\r\n village = \"0\";\r\n }\r\n String name = dao.getDistMandVilHabname(ds, dist, mandal, village, \"0\");\r\n request.setAttribute(\"names\", name);\r\n ohWiseDetails = funDao.getDisabilityCount(ds, dist, mandal, village, fdate, tdate, \"1\");\r\n // ohWiseDetails=rdao.getVisiualDisabilityCount(ds, dist, mandal, village,fdate,tdate);\r\n if (ohWiseDetails.size() == 0) {\r\n request.setAttribute(\"msg\", \"No Data Found\");\r\n } else {\r\n request.setAttribute(\"ohWiseDetails\", ohWiseDetails);\r\n }\r\n target = \"print\";\r\n } else if (\"getDetails\".equalsIgnoreCase(request.getParameter(\"details\"))) {\r\n String dist = null;\r\n String mandal = null;\r\n String village = null;\r\n String refId = null;\r\n if (request.getParameter(\"dID\") == null) {\r\n dist = \"0\";\r\n } else {\r\n dist = request.getParameter(\"dID\");\r\n }\r\n if (request.getParameter(\"mID\") == null || request.getParameter(\"mID\") == \"\") {\r\n mandal = \"0\";\r\n } else {\r\n mandal = request.getParameter(\"mID\");\r\n }\r\n if (!mandal.equals(\"0\") && !dist.equals(\"0\")) {\r\n if (request.getParameter(\"vID\") == null || request.getParameter(\"vID\") == \"\") {\r\n village = \"0\";\r\n } else {\r\n village = request.getParameter(\"vID\");\r\n }\r\n } else {\r\n village = \"0\";\r\n }\r\n\r\n String hab = null;\r\n if (request.getParameter(\"hid\") == null || request.getParameter(\"hid\") == \"\") {\r\n hab = \"0\";\r\n } else {\r\n hab = request.getParameter(\"hid\");\r\n }\r\n String name = dao.getDistMandVilHabname(ds, dist, mandal, village, \"0\");\r\n request.setAttribute(\"names\", name);\r\n subquery = (String) request.getParameter(\"tablee\");\r\n columns = (String) request.getParameter(\"colu\");\r\n String selectmethod = request.getParameter(\"query\");\r\n String co = columns, type = null;\r\n type = (String) request.getParameter(\"type\");\r\n request.setAttribute(\"type\", type);\r\n co = co.replace(\"'\", \"%27\");\r\n co = co.replace(\"(\", \"%28\");\r\n co = co.replace(\")\", \"%29\");\r\n co = co.replace(\"+\", \"%2B\");\r\n co = co.replace(\",\", \"%2C\");\r\n//co=co.replace(\"%\", \"%25\");\r\n co = co.replace(\"%%\", \"%25%\");\r\n request.setAttribute(\"tablee\", subquery);\r\n request.setAttribute(\"colu\", co);\r\n request.setAttribute(\"query\", selectmethod);\r\n if (selectmethod != null && selectmethod.equalsIgnoreCase(\"query\")) {\r\n ohWiseDetails = dao.getPersonalDetailsAllQuery(ds, dist, mandal, village, hab, fdate, tdate, \"1\", subquery, columns);\r\n } else {\r\n ohWiseDetails = dao.getPersonalDetailsAll(ds, dist, mandal, village, hab, fdate, tdate, \"1\", subquery, columns);\r\n }\r\n request.setAttribute(\"ohWiseDetails\", ohWiseDetails);\r\n if (ohWiseDetails.size() == 0) {\r\n request.setAttribute(\"msg\", \"No Data \");\r\n }\r\n target = \"personal\";\r\n } else if (\"getempDetailsAction\".equalsIgnoreCase(request.getParameter(\"empStatus\"))) {\r\n String dist = null;\r\n String mandal = null;\r\n String village = null;\r\n String refId = null;\r\n if (request.getParameter(\"dID\") == null) {\r\n dist = \"0\";\r\n } else {\r\n dist = request.getParameter(\"dID\");\r\n }\r\n if (request.getParameter(\"mID\") == null || request.getParameter(\"mID\") == \"\") {\r\n mandal = \"0\";\r\n } else {\r\n mandal = request.getParameter(\"mID\");\r\n }\r\n if (!mandal.equals(\"0\") && !dist.equals(\"0\")) {\r\n if (request.getParameter(\"vID\") == null || request.getParameter(\"vID\") == \"\") {\r\n village = \"0\";\r\n } else {\r\n village = request.getParameter(\"vID\");\r\n }\r\n } else {\r\n village = \"0\";\r\n }\r\n\r\n String hab = null;\r\n if (request.getParameter(\"hid\") == null || request.getParameter(\"hid\") == \"\") {\r\n hab = \"0\";\r\n } else {\r\n hab = request.getParameter(\"hid\");\r\n }\r\n String name = dao.getDistMandVilHabname(ds, dist, mandal, village, \"0\");\r\n request.setAttribute(\"names\", name);\r\n subquery = (String) request.getParameter(\"tablee\");\r\n columns = (String) request.getParameter(\"colu\");\r\n String selectmethod = request.getParameter(\"query\");\r\n if (selectmethod != null && selectmethod.equalsIgnoreCase(\"query\")) {\r\n ohWiseDetails = dao.getPersonalDetailsAllQuery(ds, dist, mandal, village, hab, fdate, tdate, \"1\", subquery, columns);\r\n } else {\r\n\r\n ohWiseDetails = dao.getPersonalDetailsAll(ds, dist, mandal, village, hab, fdate, tdate, \"1\", subquery, columns);\r\n }\r\n request.setAttribute(\"ohWiseDetails\", ohWiseDetails);\r\n target = \"EmpWisePersonalDetailsExcel\";\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return mapping.findForward(target);\r\n }", "Paper addNewPaper(PaperForm form, Long courseId)throws Exception;", "public ReportSheet createReport(RepletRequest req) throws RepletException\n {\n ss = (StyleSheet) theReport;\n try\n {\n bindMessages(req);\n bindData(req);\n }\n catch (Exception e)\n {\n ReportsPackage.logError(\"Problem creating report\", e);\n throw new RepletException(e.getMessage());\n }\n return theReport;\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel2 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jComboBoxRpt = new javax.swing.JComboBox();\n jLabel3 = new javax.swing.JLabel();\n jDateChooser1 = new com.toedter.calendar.JDateChooser();\n jDateChooser2 = new com.toedter.calendar.JDateChooser();\n jLabel4 = new javax.swing.JLabel();\n jButtonReports = new javax.swing.JButton();\n jTextFieldgroupid = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Report Control\");\n\n jPanel1.setBackground(new java.awt.Color(0, 204, 204));\n jPanel1.setForeground(new java.awt.Color(0, 204, 153));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/mfbtrans/imagesreport.png\"))); // NOI18N\n\n jLabel2.setText(\"Select Report Type\");\n\n jComboBoxRpt.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Select\", \"Balance\", \"Loan Balance By LoanOfficer\", \"Loan Balance\", \"Members and Borrowers\", \"Full Loan Payment\", \"Savings Balance by LoanOfficer\", \"Savings Balance by Product\", \"New and Closed Clients Detail\", \"New and Closed Clients Summary\", \"DailyTransaction\", \"DailyTransaction-Summary\", \"Defaulters\", \"Disbursement-Summary\", \"Disbursement-Detail\", \"Cash Balance\", \"Client not assigned to union\", \"Client Without Accounts Details\", \"Receipt\", \"Repayment Tracker\", \"TrialBalance\", \"Income and Expenditure\", \"Bank Withdrawal\", \"FieldPrint\", \"FieldPrintnew\", \"FieldPrint2\", \"FieldPrintDaily\", \"Suspicious Disbursement\", \"FieldPrintSimple\", \"Bank Deposit\", \"Union By Loan Officer\", \"Income Report\", \"Expense Report\", \"Loan Classification Report\", \"Loan Aging Report\" }));\n jComboBoxRpt.setAutoscrolls(true);\n jComboBoxRpt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jComboBoxRptActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Start Date\");\n\n jDateChooser1.setDateFormatString(\"yyyy-MM-dd\");\n jDateChooser1.setEnabled(false);\n\n jDateChooser2.setDateFormatString(\"yyyy-MM-dd\");\n jDateChooser2.setEnabled(false);\n\n jLabel4.setText(\"End Date\");\n\n jButtonReports.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jButtonReports.setText(\"Display\");\n jButtonReports.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonReportsActionPerformed(evt);\n }\n });\n\n jTextFieldgroupid.setEnabled(false);\n jTextFieldgroupid.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextFieldgroupidActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"GroupID\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jDateChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextFieldgroupid, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(143, Short.MAX_VALUE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jComboBoxRpt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(150, 150, 150)\n .addComponent(jButtonReports, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jComboBoxRpt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextFieldgroupid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)\n .addComponent(jButtonReports, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(62, 62, 62))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(38, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 2, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "public void actionPerformed(ActionEvent ae) {\n\n //\n // Process the action command\n //\n // \"create report\" - Create the report\n // \"cancel\" - All done\n //\n try {\n switch (ae.getActionCommand()) {\n case \"create report\":\n Date startDate, endDate;\n CategoryRecord category;\n int sortMode;\n if (!startField.isEditValid() || !endField.isEditValid()) {\n JOptionPane.showMessageDialog(this, \"You must specify start and end dates\",\n \"Error\", JOptionPane.ERROR_MESSAGE);\n } else {\n startDate = (Date)startField.getValue();\n endDate = (Date)endField.getValue();\n if (endDate.compareTo(startDate) < 0) {\n JOptionPane.showMessageDialog(this, \"The end date is before the start date\",\n \"Error\", JOptionPane.ERROR_MESSAGE);\n } else {\n int index = categoryField.getSelectedIndex();\n if (index > 0)\n category = (CategoryRecord)categoryModel.getDBElementAt(index);\n else\n category = null;\n\n if (sortAccountField.isSelected())\n sortMode = SORT_BY_ACCOUNT;\n else if (sortNameField.isSelected())\n sortMode = SORT_BY_NAME;\n else if (sortCategoryField.isSelected())\n sortMode = SORT_BY_CATEGORY;\n else\n sortMode = SORT_BY_DATE;\n\n generateReport(startDate, endDate, category, sortMode);\n }\n }\n break;\n \n case \"cancel\":\n setVisible(false);\n dispose();\n break;\n }\n } catch (ReportException exc) {\n Main.logException(\"Exception while generating transaction report\", exc);\n } catch (Exception exc) {\n Main.logException(\"Exception while processing action event\", exc);\n }\n }", "@SneakyThrows\n private void pdfReport() {\n NotificationUtil.warningAlert(\"Warning\", \"Nothing to export\", NotificationUtil.SHORT);\n ServiceFactory.getPdfService().projectReport(table.getItems());\n }", "public static void generateReport() {\n PrintImpl printer = new PrintImpl(realtorLogImpl, propertyLogImpl);\n printer.generateReport(REQUESTS_FILE);\n }", "public Report getReport();", "@And ( \"^The obstetrics patient has a documented labor and delivery report$\" )\n public void existingReportNoTwins () {\n waitForAngular();\n\n final LaborDeliveryReportForm form = new LaborDeliveryReportForm();\n form.setDatetimeOfLabor( ZonedDateTime.of( 2019, 3, 22, 5, 2, 20, 2, ZoneId.of( \"-05:00\" ) ).toString() );\n form.setDatetimeOfDelivery( ZonedDateTime.of( 2019, 3, 22, 10, 2, 20, 2, ZoneId.of( \"-05:00\" ) ).toString() );\n form.setWeight( 1.1 );\n form.setLength( 12.34 );\n form.setHeartRate( 7 );\n form.setBloodPressure( 70 );\n form.setFirstName( \"Madhura\" );\n form.setLastName( \"Waghmare\" );\n\n final ObstetricsRecord record = new ObstetricsRecord();\n final LocalDate lmp = LocalDate.parse( \"2019-03-02\" );\n record.setLmp( lmp );\n record.setConception( 2019 );\n record.setWeeksPreg( 1 );\n record.setHoursInLabor( 25 );\n record.setDeliveryMethod( DeliveryMethod.Cesarean );\n record.setCurrentRecord( true );\n record.setTwins( false );\n record.setPatient( \"JillBob\" );\n record.save();\n form.setObstetricsRecord( record );\n form.setDeliveryMethod( record.getDeliveryMethod() );\n LaborDeliveryReport ldRecord;\n try {\n ldRecord = new LaborDeliveryReport( form );\n ldRecord.setPatient( \"JillBob\" );\n ldRecord.save();\n }\n catch ( final ParseException e ) {\n fail();\n }\n }", "@Test\n\tpublic void generateLineItemReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Line Item Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "@Test\n public void testAddingReport() {\n Assert.assertEquals(\"Incorrect initial water report list size\", 0,\n theModel.getReportList().size());\n try {\n Account holder = new Account(1, \"bills\", \"bills\", Credential.ADMIN);\n WaterReport a = new WaterReport(holder, \"Bottled\", \"Waste\",\n \"Today\", new Location(45, 50));\n WaterReport b = new WaterReport(holder, \"Well\",\n \"Potable\", \"Today\", new Location(30, 25));\n WaterReport c = new WaterReport(holder, \"Stream\",\n \"Treatable - Muddy\", \"Today\", new Location(20, 65));\n theModel.addReport(a);\n theModel.addReport(b);\n theModel.addReport(c);\n Assert.assertEquals(\"WaterReport list size incorrect after adding\", 3,\n theModel.getReportList().size());\n } catch (Exception e) {\n Assert.fail(\"adding water reports should not have failed here\");\n e.printStackTrace();\n }\n }", "public reportScreen(String reportType) {\n this.reportType = reportType;\n\n }", "public void saveAndCreateNew() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"saveAndCreateNewButton\").click();\n\t}", "public void generateReport(ReportGenerationData data)throws ChangeApplicationException;", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "public ActionForward bookingsReportExport(\n\t\t\tActionMapping mapping,\n\t\t\tActionForm form,\n\t\t\tHttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t\tString path = getServlet().getServletContext().getInitParameter(\"mypath\");\n\t\t\tString filename = \"\";\n\n\t\t\tSatbookDailyForm dailyForm = (SatbookDailyForm)form;\n\t\t\tActionMessages messages = new ActionMessages();\n\t\t\tSatbookBookingDAO db1 = new SatbookBookingDAO();\n\t\t\tSatbookOracleDAO db2 = new SatbookOracleDAO();\n\t\t\t\n\t\t\trequest.setAttribute(\"reportTypeList\",dailyForm.getReportTypeList());\n\t\t\trequest.setAttribute(\"possibleReports\",dailyForm.getPossibleReports());\n\t\t\tString fileHeading = \"\";\n\n\t\t\t//** REPORT TYPE\n\t\t\t// Was type of report selected, for which bookings, confirmed/not confirmed/both\n\t\t\t//*\n\t\t\tif ((null == dailyForm.getSelectedReportType())||(dailyForm.getSelectedReportType().length() == 0)) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Please choose which bookings must be displayed from drop down list.\"));\n\t\t\t\taddMessages(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\trequest.setAttribute(\"reportTypeList\",dailyForm.getReportTypeList());\n\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\t//** VALIDATE FROM DATE *//*\n\t\t\t// from date is mandatory\n\t\t\tif ((dailyForm.getFromDateDD() == null)||(dailyForm.getFromDateDD().length() == 0)||\n\t\t\t\t\t(dailyForm.getFromDateMM() == null)||(dailyForm.getFromDateMM().length() == 0)||\n\t\t\t\t\t(dailyForm.getFromDateYYYY() == null)||(dailyForm.getFromDateYYYY().length() == 0)) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Please enter the from date for the report.\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\t// validate start year\n\t\t\tif ((dailyForm.getFromDateYYYY() == null)||(dailyForm.getFromDateYYYY().length() < 4)) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid year entered for the from date (must be 4 characters).\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\t// validate start date (valid month, year, day)\n\t\t\tint startDayInt = Integer.parseInt(dailyForm.getFromDateDD());\n\t\t\tint startYearInt = Integer.parseInt(dailyForm.getFromDateYYYY());\n\t\t\tint startMonthInt = Integer.parseInt(dailyForm.getFromDateMM());\n\t\t\t\n\n\t\t\t// validate to month\n\t\t\tif (startMonthInt > 12) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid month entered for the from date.\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\tif ((startMonthInt == 1)||(startMonthInt == 3)\n\t\t\t\t\t||(startMonthInt == 5)||(startMonthInt == 7)\n\t\t\t\t\t||(startMonthInt == 8)||(startMonthInt == 10)\n\t\t\t\t\t||(startMonthInt == 12)) {\n\t\t\t\tif (startDayInt > 31) {\n\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for from date.\"));\n\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t}\n\t\t\t} else if ((startMonthInt == 4)||(startMonthInt == 6)\n\t\t\t\t\t||(startMonthInt == 9)||(startMonthInt == 11)) {\n\t\t\t\tif (startDayInt > 30) {\n\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for from date.\"));\n\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t}\n\t\t\t} else if ((startMonthInt == 2)) {\n\t\t\t\tif (startYearInt % 4 == 0) {\n\t\t\t\t\tif (startDayInt > 29) {\n\t\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for from date.\"));\n\t\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (startDayInt > 28) {\n\t\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for start date.\"));\n\t\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// set from date:\n\t\t\tif (startDayInt <= 9) {\n\t\t\t\tdailyForm.setFromDateDD(\"0\"+startDayInt);\n\t\t\t}\n\t\t\tif (startMonthInt <= 9) {\n\t\t\t\tdailyForm.setFromDateMM(\"0\"+startMonthInt);\n\t\t\t}\n\t\t\tdailyForm.setFromDate(dailyForm.getFromDateYYYY()+\"-\"+dailyForm.getFromDateMM()+\"-\"+dailyForm.getFromDateDD());\n\n\t\t\t//** VALIDATE TO DATE *//*\n\t\t\t// to date is mandatory\n\t\t\tif ((dailyForm.getToDateDD() == null)||(dailyForm.getToDateDD().length() == 0)||\n\t\t\t\t\t(dailyForm.getToDateMM() == null)||(dailyForm.getToDateMM().length() == 0)||\n\t\t\t\t\t(dailyForm.getToDateYYYY() == null)||(dailyForm.getToDateYYYY().length() == 0)) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Please enter the to date for the report.\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\t// validate to year\n\t\t\tif ((dailyForm.getToDateYYYY() == null)||(dailyForm.getToDateYYYY().length() < 4)) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid year entered for the to date (must be 4 characters).\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\t// validate to date (valid month, year, day)\n\t\t\tint toDayInt = Integer.parseInt(dailyForm.getToDateDD());\n\t\t\tint toYearInt = Integer.parseInt(dailyForm.getToDateYYYY());\n\t\t\tint toMonthInt = Integer.parseInt(dailyForm.getToDateMM());\n\n\t\t\t// validate to month\n\t\t\tif (toMonthInt > 12) {\n\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid month entered for the to date.\"));\n\t\t\t\taddErrors(request, messages);\n\n\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t}\n\n\t\t\tif ((toMonthInt == 1)||(startMonthInt == 3)\n\t\t\t\t\t||(toMonthInt == 5)||(toMonthInt == 7)\n\t\t\t\t\t||(toMonthInt == 8)||(toMonthInt == 10)\n\t\t\t\t\t||(toMonthInt == 12)) {\n\t\t\t\tif (toDayInt > 31) {\n\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for to date.\"));\n\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t}\n\t\t\t} else if ((toMonthInt == 4)||(toMonthInt == 6)\n\t\t\t\t\t||(toMonthInt == 9)||(toMonthInt == 11)) {\n\t\t\t\tif (toDayInt > 30) {\n\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for to date.\"));\n\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t}\n\t\t\t} else if ((toMonthInt == 2)) {\n\t\t\t\tif (toYearInt % 4 == 0) {\n\t\t\t\t\tif (toDayInt > 29) {\n\t\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for to date.\"));\n\t\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (toDayInt > 28) {\n\t\t\t\t\t\tmessages.add(ActionMessages.GLOBAL_MESSAGE,\n\t\t\t\t\t\t\t\tnew ActionMessage(\"message.generalmessage\", \"Invalid day entered for to date.\"));\n\t\t\t\t\t\taddErrors(request, messages);\n\n\t\t\t\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\t\t\t\treturn mapping.findForward(\"bookingsreport\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// set to date:\n\t\t\tif (toDayInt <= 9) {\n\t\t\t\tdailyForm.setToDateDD(\"0\"+toDayInt);\n\t\t\t}\n\t\t\tif (toMonthInt <= 9) {\n\t\t\t\tdailyForm.setToDateMM(\"0\"+toMonthInt);\n\t\t\t}\n\t\t\tdailyForm.setToDate(dailyForm.getToDateYYYY()+\"-\"+dailyForm.getToDateMM()+\"-\"+dailyForm.getToDateDD());\n\n\t\t\tif (dailyForm.getSelectedReport().equals(\"DetailedReport\")) {\n\t\t\t\t//** SELECT BOOKINGS *//*\n\t\t\t\t//** =========== select bookings between from and to dates *//*\n\t\t\t\ttry {\n\t\t\t\t\tdailyForm.setBookingList(db1.selectBookingList(dailyForm.getFromDate(),dailyForm.getToDate(),dailyForm.getSelectedReportType(),dailyForm.getSystemID()));\n\t\t\t\t} catch (Exception 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\n\t\t\t\tif (dailyForm.getSystemID().equals(dailyForm.getSatbook())) {\n\t\t\t\t\tfor (int i=0; i < dailyForm.getBookingList().size(); i++) {\n\t\t\t\t\t\t// get booking subjects\n\t\t\n\t\t\t\t\t\tBookingForm booking = (BookingForm) dailyForm.getBookingList().get(i);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdb1.selectBkngSubjectDetial(booking);\n\t\t\t\t\t\t} catch (Exception 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\t\ttry {\n\t\t\t\t\t\t\tdb2.selectSelectedSubject(booking);\n\t\t\t\t\t\t} catch (Exception 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\t}\n\t\t\t\t}\n\t\t\t} else if (dailyForm.getSelectedReport().equals(\"DaysReport\")) {\n\t\t\t\t//** SELECT BOOKINGS *//*\n\t\t\t\t//** =========== select bookings between from and to dates *//*\n\t\t\t\ttry {\n\t\t\t\t\tdailyForm.setVenueList(db1.selectBookingListXtypePerVenue(dailyForm.getFromDate(),dailyForm.getToDate(),dailyForm.getSelectedReportType(),dailyForm.getSystemID(),\"DAYS\"));\n\t\t\t\t} catch (Exception 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} else if (dailyForm.getSelectedReport().equals(\"HoursReport\")) {\n\t\t\t\t//** SELECT BOOKINGS *//*\n\t\t\t\t//** =========== select bookings between from and to dates *//*\n\t\t\t\ttry {\n\t\t\t\t\tdailyForm.setVenueList(db1.selectBookingListXtypePerVenue(dailyForm.getFromDate(),dailyForm.getToDate(),dailyForm.getSelectedReportType(),dailyForm.getSystemID(),\"HOURS\"));\n\t\t\t\t} catch (Exception 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}\n \n \n\t\t\trequest.setAttribute(\"dailyForm\", dailyForm);\n\t\t\trequest.setAttribute(\"bookingList\",dailyForm.getBookingList());\n\t\t\trequest.setAttribute(\"venueList\",dailyForm.getVenueList());\n\n\n\n\n\tif(dailyForm.getToDate() != null) {\n\t\tfilename = \"booking report \"+dailyForm.getToDate() + \".csv\";\n\t\n\t}else {\n\t\tfilename = \"satbook_list.csv\";\n\t}\n\n\t\n\ttry {\n\t\tsaveToServer(path,filename,request,dailyForm);\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\tFile file = new File(path + filename);\n\tDataInputStream in = null;\n\ttry {\n\t\tin = new DataInputStream(new FileInputStream(file));\n\t} catch (FileNotFoundException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\tServletOutputStream out = null;\n\ttry {\n\t\tout = response.getOutputStream();\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\tresponse.setDateHeader(\"Expires\", 0);\n\tresponse.setHeader( \"Pragma\", \"public\" );\n\tresponse.setContentType(\"application/octet-stream\");\n\tresponse.setContentLength((int)file.length());\n\tresponse.addHeader(\"Content-Disposition\", \"attachment;filename=\" + filename );\n\n\ttry {\n\t\tsaveToClient(in, out);\n\t} catch (Exception e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\n\t\n\t\n\treturn null;\n}", "public void addReport(Report reportToAdd){\n\t\tif (reportToAdd != null)\n\t\t\tthis.reports.add((reportToAdd));\n\t}", "private void submitReport() throws ERTRestApiException, JSONException {\n Cursor cursor = getReportStatusCursor(SyncStatus.REPORT_PENDING);\n\n if(cursor.getCount() != 0) {\n cursor.moveToFirst();\n\n\n do {\n final Long reportBaseId = cursor.getLong(\n cursor.getColumnIndex(ReportEntry._ID)\n );\n ExpenseReport expenseReport = Utility.createExpenseReportFromCursor(cursor);\n\n ERTRestApi.apiSubmitReport(expenseReport,\n new ERTRestApi\n .ERTRestApiListener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n Log.d(LOG_TAG, \"Report \" + reportBaseId + \" submitted\");\n updateReportSyncStatus(reportBaseId, SyncStatus.SYNCED);\n }\n },\n new ERTRestApi.ERTRestApiErrorListener() {\n @Override\n public void onErrorResponse(ERTRestApi\n .ERTRestApiError error) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(ReportEntry.COLUMN_STATUS, Status.SAVED.getValue());\n\n getContext().getContentResolver().update(\n ReportEntry.buildReportUriNoNetworkSync(reportBaseId),\n contentValues,\n null,\n null\n );\n updateReportSyncStatus(reportBaseId, SyncStatus.SYNCED);\n }\n }\n\n );\n\n updateReportSyncStatus(reportBaseId, SyncStatus.SYNC_IN_PROGRESS);\n\n } while (cursor.moveToNext());\n }\n cursor.close();\n }", "public void onReportClick(){\r\n\t\tmyView.advanceToReport();\r\n\t}", "public void makeReport() throws IOException{\n File report = new File(\"Report.txt\");\n BufferedWriter reportWriter = new BufferedWriter(new FileWriter(report));\n BufferedReader bookReader = new BufferedReader(new FileReader(\"E-Books.txt\"));\n String current;\n while((current = bookReader.readLine()) != null ){\n String[] tokens = current.split(\",\");\n reportWriter.write(tokens[0].trim()+\" for \"+tokens[1].trim()+\" with redemption Code \"+tokens[2].trim()+\n \" is assigned to \"+tokens[4].trim()+\" who is in \"+tokens[5].trim()+\" grade.\");\n reportWriter.write(System.lineSeparator());\n reportWriter.flush();\n }\n reportWriter.close();\n bookReader.close();\n new reportWindow();\n }", "@RequestMapping(method = RequestMethod.GET)\n public ModelAndView getReportPage() {\n ModelAndView modelAndView = new ModelAndView();\n modelAndView.setViewName(\"report\");\n modelAndView.addObject(\"performers\", reportService.getAllPerformers());\n return modelAndView;\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}", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "public edu.hm.hafner.analysis.parser.jcreport.Report createReport(final ReaderFactory readerFactory)\n throws ParsingException {\n SecureDigester digester = new SecureDigester(JcReportParser.class);\n\n String report = \"report\";\n digester.addObjectCreate(report, edu.hm.hafner.analysis.parser.jcreport.Report.class);\n digester.addSetProperties(report);\n\n String file = \"report/file\";\n digester.addObjectCreate(file, File.class);\n digester.addSetProperties(file, \"package\", \"packageName\");\n digester.addSetProperties(file, \"src-dir\", \"srcdir\");\n digester.addSetProperties(file);\n digester.addSetNext(file, \"addFile\", File.class.getName());\n\n String item = \"report/file/item\";\n digester.addObjectCreate(item, Item.class);\n digester.addSetProperties(item);\n digester.addSetProperties(item, \"finding-type\", \"findingtype\");\n digester.addSetProperties(item, \"end-line\", \"endline\");\n digester.addSetProperties(item, \"end-column\", \"endcolumn\");\n digester.addSetNext(item, \"addItem\", Item.class.getName());\n\n try (Reader reader = readerFactory.create()) {\n return digester.parse(reader);\n }\n catch (IOException | SAXException e) {\n throw new ParsingException(e);\n }\n }", "public void btnGenerarReporteDestruccionPDF() {\n try {\n byte[] bytesFile;\n bytesFile = null;\n Map parameters = new HashMap();\n\n parameters.put(\"rfc\", produccionCigarrosHelper.getTabacalera().getRfc());\n parameters.put(\"incidencia\", \"Desperdicios y destrucción\");\n parameters.put(\"fecha\", new Date());\n parameters.put(\"folio\", desperdiciosHelper.getIdAcuseRecibo());\n parameters.put(\"cadenaOriginal\", firmaFormHelper.getCadenaOriginal());\n parameters.put(\"selloDigital\", selloDigital.generaSelloDigital(firmaFormHelper.getCadenaOriginal()));\n parameters.put(\"codigo_qr\", QRCodeUtil.getQr(desperdiciosHelper.getIdAcuseRecibo(), produccionCigarrosHelper.getTabacalera().getRfc(), Constantes.CINCUENTA, Constantes.CINCUENTA, Constantes.ARCHIVO_PNG));\n\n if (reporterService != null) {\n bytesFile = reporterService.makeReport(ReportesTabacosEnum.REPORTE_ACUSE_DESPERDICIO_DESTRUCCION, ARCHIVO_PDF, parameters, null);\n if (bytesFile != null) {\n generaDocumento(bytesFile, MIMETypesEnum.PDF, \"AcuseDescargapDesperdiciosDestruccion_\" + desperdiciosHelper.getIdAcuseRecibo(), FileExtensionEnum.PDF);\n }\n }\n } catch (ReporterJasperException e) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + e.getMessage());\n } catch (QRCodeUtilException ex) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + ex.getMessage());\n } catch (SelloDigitalException ex) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + ex.getMessage());\n }\n\n }", "@Test\n\tpublic void generateBatchReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t//Generate Batch report\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Batch Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\t\t\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.report_page, container, false);\n ListView ReportLists = (ListView) view.findViewById(R.id.report_items);\n Reports = new ArrayList<ReportItem>();\n ReportLists.setAdapter(new ReportItems_Adapter(getActivity(), Reports));\n Button btn_Report = (Button) view.findViewById(R.id.btn_send_report);\n btn_Report.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Save_Report();\n Toast.makeText(getActivity(), \"Saved to database\", Toast.LENGTH_SHORT).show();\n }\n });\n\n return view;\n }", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "@Test\n\tpublic void generateTicketsReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Tickets Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "public void registrarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.create(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaCreateDialog').hide()\");\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se registró con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "void exportarLog() {\n try {\n JasperPrint rU = null;\n HashMap map = new HashMap();\n\n String arquivoJasper = \"/Sistema/relatorios/relatorioAcessos.jasper\";\n try{\n rU = JasperFillManager.fillReport(arquivoJasper, map, parametrosNS.con);\n }catch(Exception e){ \n JOptionPane.showMessageDialog(null, \"visualizar relatorio \" + e);\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n JasperViewer.viewReport(rU, false); \n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"o erro foi ao gerar relatorio \" + e);\n }\n }", "@FXML\n void saveBtnClicked(ActionEvent event) {\n reportSettingsDAO = new ReportSettingsDAO();\n reportSettings = new ReportSettings();\n\n if (weeklyRadioBtn.isSelected()) {\n reportSettings.setFrequency(\"WEEKLY\");\n } else {\n reportSettings.setFrequency(\"MONTHLY\");\n }\n\n LocalDate tmpDate = nextDate.getValue();\n reportSettings.setNextDate(Date.valueOf(tmpDate));\n\n reportSettingsDAO.updateDate(reportSettings);\n\n }", "public static void create(Formulario form){\n daoFormulario.create(form);\n }" ]
[ "0.7652356", "0.6970646", "0.6961848", "0.66061825", "0.6592914", "0.65280664", "0.64831555", "0.62952423", "0.60939103", "0.604789", "0.59983575", "0.59082985", "0.5905805", "0.5898131", "0.5890548", "0.58471406", "0.5838314", "0.5832773", "0.5828125", "0.58135706", "0.57964706", "0.57820463", "0.5776382", "0.57182354", "0.5717365", "0.57027096", "0.5699964", "0.5681227", "0.5636121", "0.5621521", "0.5573544", "0.55656046", "0.55416626", "0.55355144", "0.55302376", "0.55073327", "0.54956824", "0.5469826", "0.5464516", "0.5454585", "0.54447496", "0.5442461", "0.5437231", "0.54316366", "0.54243785", "0.5418464", "0.5404122", "0.5399152", "0.53975344", "0.5373531", "0.5371028", "0.5370933", "0.5369502", "0.5367237", "0.5359258", "0.5338395", "0.53287244", "0.5311838", "0.53014624", "0.52972436", "0.5294247", "0.5292836", "0.52913606", "0.52865326", "0.5286485", "0.5285437", "0.5284094", "0.5281221", "0.5275584", "0.5273437", "0.5268895", "0.52600306", "0.5259209", "0.52532685", "0.5251701", "0.5251445", "0.52476376", "0.524755", "0.52443606", "0.5239672", "0.52395123", "0.5233727", "0.5220347", "0.5219211", "0.52128285", "0.5209295", "0.519646", "0.5189268", "0.518793", "0.5176231", "0.5173844", "0.51699257", "0.51681906", "0.5165412", "0.5155084", "0.51528144", "0.51498187", "0.5146844" ]
0.6379192
7
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { rankings = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); city = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); from = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); to = new javax.swing.JTextField(); submitReport1 = new javax.swing.JButton(); jLabel9 = new javax.swing.JLabel(); jScrollPane6 = new javax.swing.JScrollPane(); display1 = new javax.swing.JTextArea(); jPanel2 = new javax.swing.JPanel(); city2 = new javax.swing.JTextField(); label2 = new javax.swing.JLabel(); zipCode = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); zipCode2 = new javax.swing.JTextField(); report2 = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); dateFrom = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); dateTo = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); jScrollPane7 = new javax.swing.JScrollPane(); display2 = new javax.swing.JTextArea(); jPanel3 = new javax.swing.JPanel(); country = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); countrySubmit = new javax.swing.JButton(); jScrollPane8 = new javax.swing.JScrollPane(); display3 = new javax.swing.JTextArea(); jPanel4 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); country1 = new javax.swing.JTextField(); city1 = new javax.swing.JTextField(); submitCountryCity = new javax.swing.JButton(); jScrollPane9 = new javax.swing.JScrollPane(); display4 = new javax.swing.JTextArea(); jPanel5 = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); country3 = new javax.swing.JTextField(); city3 = new javax.swing.JTextField(); postalCode3 = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); submitCountry3 = new javax.swing.JButton(); jScrollPane11 = new javax.swing.JScrollPane(); display5 = new javax.swing.JTextArea(); jPanel6 = new javax.swing.JPanel(); jLabel19 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); rankTable = new javax.swing.JTable(); countryRank = new javax.swing.JTextField(); jLabel20 = new javax.swing.JLabel(); rankButton = new javax.swing.JButton(); jPanel7 = new javax.swing.JPanel(); jLabel21 = new javax.swing.JLabel(); cityRank = new javax.swing.JTextField(); cityRankButton = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); cityRankTable = new javax.swing.JTable(); City = new javax.swing.JLabel(); jPanel8 = new javax.swing.JPanel(); jLabel22 = new javax.swing.JLabel(); showCommercial = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); commercialTable = new javax.swing.JTable(); jPanel9 = new javax.swing.JPanel(); rankRenter = new javax.swing.JButton(); dateBefore = new javax.swing.JTextField(); dateAfter = new javax.swing.JTextField(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); numBookTable = new javax.swing.JTable(); cityy = new javax.swing.JTextField(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jPanel10 = new javax.swing.JPanel(); rankRenterCountry = new javax.swing.JButton(); jLabel27 = new javax.swing.JLabel(); countryy = new javax.swing.JTextField(); beforeDay = new javax.swing.JTextField(); afterDay = new javax.swing.JTextField(); jLabel28 = new javax.swing.JLabel(); jLabel29 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); jScrollPane5 = new javax.swing.JScrollPane(); countryBookTable = new javax.swing.JTable(); jPanel11 = new javax.swing.JPanel(); jLabel31 = new javax.swing.JLabel(); biggestHost = new javax.swing.JButton(); biggestRenter = new javax.swing.JButton(); bigHostField = new javax.swing.JTextField(); bigCancelField = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); rankings.setToolTipText(""); city.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cityActionPerformed(evt); } }); jLabel1.setText("City"); from.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fromActionPerformed(evt); } }); jLabel2.setText("Date Range (YYYY-MM-DD)"); jLabel3.setText("To"); to.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toActionPerformed(evt); } }); submitReport1.setText("Submit"); submitReport1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { submitReport1ActionPerformed(evt); } }); jLabel9.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel9.setText("Number of Bookings In City Between Time Range"); display1.setColumns(20); display1.setRows(5); jScrollPane6.setViewportView(display1); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(16, 16, 16) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(city, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(from, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(to, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(55, 55, 55) .addComponent(submitReport1))))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(68, 68, 68) .addComponent(jLabel9) .addGap(54, 54, 54) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(city, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addGap(41, 41, 41) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(from, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2) .addComponent(jLabel3) .addComponent(to, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(submitReport1)) .addGap(97, 97, 97) .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(223, Short.MAX_VALUE)) ); rankings.addTab("Number of Bookings In City Between Time Range", jPanel1); city2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { city2ActionPerformed(evt); } }); label2.setText("City"); jLabel4.setText("Zip Code"); jLabel5.setText("to"); zipCode2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zipCode2ActionPerformed(evt); } }); report2.setText("Submit"); report2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { report2ActionPerformed(evt); } }); jLabel6.setText("Date Range (YYYY-MM-DD)"); jLabel7.setText("to"); jLabel10.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel10.setText("Number of Bookings In City Between Time Range and Postal Codes"); display2.setColumns(20); display2.setRows(5); jScrollPane7.setViewportView(display2); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(report2) .addGap(80, 80, 80)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(36, 36, 36) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel4) .addComponent(jLabel6) .addComponent(label2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(city2, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(dateFrom, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE) .addComponent(zipCode, javax.swing.GroupLayout.Alignment.LEADING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(zipCode2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dateTo))))))) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel10))) .addContainerGap(121, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(49, 49, 49) .addComponent(jLabel10) .addGap(81, 81, 81) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(city2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(label2)) .addGap(35, 35, 35) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(zipCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(zipCode2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(33, 33, 33) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(dateFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6) .addComponent(jLabel7) .addComponent(dateTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(31, 31, 31) .addComponent(report2) .addGap(18, 18, 18) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(196, Short.MAX_VALUE)) ); rankings.addTab("Number of Bookings in City Between Time Range and Postal Codes", jPanel2); jLabel8.setText("Country"); jLabel11.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel11.setText("Total Number of Listings for Specific Country"); countrySubmit.setText("submit"); countrySubmit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { countrySubmitActionPerformed(evt); } }); display3.setColumns(20); display3.setRows(5); jScrollPane8.setViewportView(display3); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(105, 105, 105) .addComponent(jLabel11)) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(country, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(112, 112, 112) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(countrySubmit))) .addContainerGap(206, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(75, 75, 75) .addComponent(jLabel11) .addGap(63, 63, 63) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(country, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8) .addComponent(countrySubmit)) .addGap(76, 76, 76) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(289, Short.MAX_VALUE)) ); rankings.addTab("Total Number of Listings for Specific Countries", jPanel3); jLabel12.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel12.setText("Number of Listings for Specific Country and City"); jLabel13.setText("Country"); jLabel14.setText("City"); country1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { country1ActionPerformed(evt); } }); submitCountryCity.setText("Submit"); submitCountryCity.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { submitCountryCityActionPerformed(evt); } }); display4.setColumns(20); display4.setRows(5); jScrollPane9.setViewportView(display4); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(87, 87, 87) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel12) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel14) .addComponent(jLabel13)) .addGap(43, 43, 43) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(country1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(city1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(83, 83, 83) .addComponent(submitCountryCity)))) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(209, 209, 209) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(193, Short.MAX_VALUE)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(57, 57, 57) .addComponent(jLabel12) .addGap(64, 64, 64) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13) .addComponent(country1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(39, 39, 39) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14) .addComponent(city1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(submitCountryCity)) .addGap(71, 71, 71) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(252, Short.MAX_VALUE)) ); rankings.addTab("Number of Listings for Specific Country and City", jPanel4); jLabel15.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel15.setText("Number of Listings for Specific Country and City and Postal Code"); jLabel16.setText("Country"); jLabel17.setText("City"); jLabel18.setText("Postal Code"); submitCountry3.setText("Submit"); submitCountry3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { submitCountry3ActionPerformed(evt); } }); display5.setColumns(20); display5.setRows(5); jScrollPane11.setViewportView(display5); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addGap(61, 61, 61) .addComponent(jLabel15)) .addGroup(jPanel5Layout.createSequentialGroup() .addGap(134, 134, 134) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel16) .addComponent(jLabel17) .addComponent(jLabel18)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(country3, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE) .addComponent(city3) .addComponent(postalCode3)))) .addGap(64, 64, 64) .addComponent(submitCountry3))) .addContainerGap(91, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(jLabel15) .addGap(72, 72, 72) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(country3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16)) .addGap(45, 45, 45) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(city3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel17)) .addGap(50, 50, 50) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(postalCode3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18) .addComponent(submitCountry3)) .addGap(57, 57, 57) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(205, Short.MAX_VALUE)) ); rankings.addTab("Number of Listings for Specific Country and City and Postal Code", jPanel5); jLabel19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel19.setText("Host Rankings (# of Listings) by Country"); rankTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Ranking", "Host ID", "# of Listings" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); rankTable.setCellSelectionEnabled(true); jScrollPane1.setViewportView(rankTable); countryRank.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { countryRankActionPerformed(evt); } }); jLabel20.setText("Country"); rankButton.setText("Search"); rankButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rankButtonActionPerformed(evt); } }); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addGap(190, 190, 190) .addComponent(jLabel20) .addGap(18, 18, 18) .addComponent(countryRank, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rankButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addGap(0, 112, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(103, 103, 103)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel19) .addGap(169, 169, 169)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addGap(66, 66, 66) .addComponent(jLabel19) .addGap(67, 67, 67) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel20) .addComponent(countryRank, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rankButton)) .addGap(38, 38, 38) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(275, Short.MAX_VALUE)) ); rankings.addTab("Host Ranking (# of Listings) by Country", jPanel6); jLabel21.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel21.setText("Host Rankings (# of Listings) by City"); cityRankButton.setText("Submit"); cityRankButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cityRankButtonActionPerformed(evt); } }); cityRankTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Rank", "Host ID", "# of Listings" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane2.setViewportView(cityRankTable); City.setText("City"); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGap(180, 180, 180) .addComponent(jLabel21)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() .addContainerGap() .addComponent(City) .addGap(26, 26, 26) .addComponent(cityRank, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(cityRankButton))) .addGroup(jPanel7Layout.createSequentialGroup() .addGap(105, 105, 105) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(110, Short.MAX_VALUE)) ); jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGap(78, 78, 78) .addComponent(jLabel21) .addGap(53, 53, 53) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cityRank, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cityRankButton) .addComponent(City)) .addGap(30, 30, 30) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(288, Short.MAX_VALUE)) ); rankings.addTab("Host Ranking (# of Listings) by City", jPanel7); jLabel22.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel22.setText("Popular Hosts "); showCommercial.setText("Show Possible Commercial Hosts"); showCommercial.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { showCommercialActionPerformed(evt); } }); commercialTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "#", "Host ID", "# of Listings", "Country" } )); jScrollPane3.setViewportView(commercialTable); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addContainerGap(120, Short.MAX_VALUE) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup() .addComponent(showCommercial) .addGap(238, 238, 238)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(95, 95, 95)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup() .addComponent(jLabel22) .addGap(274, 274, 274)))) ); jPanel8Layout.setVerticalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(55, 55, 55) .addComponent(jLabel22) .addGap(42, 42, 42) .addComponent(showCommercial) .addGap(29, 29, 29) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(46, Short.MAX_VALUE)) ); rankings.addTab("Popular Hosts", jPanel8); rankRenter.setText("Rank Renters by Booking"); rankRenter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rankRenterActionPerformed(evt); } }); jLabel23.setText("From Date (YYYY-MM-DD)"); jLabel24.setText("to"); numBookTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Rank", "Renter ID", "# of Bookings" } )); jScrollPane4.setViewportView(numBookTable); jLabel25.setText("City"); jLabel26.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel26.setText("Renter Booking Ranking by City and Date"); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup() .addGap(253, 253, 253) .addComponent(rankRenter)) .addGroup(jPanel9Layout.createSequentialGroup() .addGap(99, 99, 99) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel9Layout.createSequentialGroup() .addGap(63, 63, 63) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel23) .addComponent(jLabel25)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(cityy, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE) .addComponent(dateBefore)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel24) .addGap(12, 12, 12) .addComponent(dateAfter, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel9Layout.createSequentialGroup() .addGap(104, 104, 104) .addComponent(jLabel26))))) .addContainerGap(116, Short.MAX_VALUE)) ); jPanel9Layout.setVerticalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup() .addGap(45, 45, 45) .addComponent(jLabel26) .addGap(36, 36, 36) .addComponent(rankRenter) .addGap(16, 16, 16) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cityy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel25)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(dateBefore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(dateAfter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel24) .addComponent(jLabel23)) .addGap(32, 32, 32) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(195, Short.MAX_VALUE)) ); rankings.addTab("Renter Booking Ranking by City and Date", jPanel9); rankRenterCountry.setText("Rank Renters by Booking"); rankRenterCountry.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rankRenterCountryActionPerformed(evt); } }); jLabel27.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel27.setText("Renter Bookings Ranking by Country and Date"); jLabel28.setText("Country"); jLabel29.setText("From Date (YYYY-MM-DD)"); jLabel30.setText("to"); countryBookTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Rank", "Renter ID", "# of Bookings" } )); jScrollPane5.setViewportView(countryBookTable); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jLabel27)) .addGroup(jPanel10Layout.createSequentialGroup() .addGap(70, 70, 70) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel28) .addComponent(jLabel29)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(countryy, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel10Layout.createSequentialGroup() .addComponent(beforeDay, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel30) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(afterDay, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup() .addContainerGap(114, Short.MAX_VALUE) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup() .addComponent(rankRenterCountry) .addGap(251, 251, 251)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup() .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(101, 101, 101)))) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addGap(59, 59, 59) .addComponent(jLabel27) .addGap(53, 53, 53) .addComponent(rankRenterCountry) .addGap(31, 31, 31) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel28) .addComponent(countryy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(31, 31, 31) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(beforeDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29) .addComponent(afterDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel30)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(210, Short.MAX_VALUE)) ); rankings.addTab("Renter Booking Ranking by Country and Date", jPanel10); jLabel31.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel31.setText("Biggest Cancellations Hosts and Renters"); biggestHost.setText("Biggest Cancelling Host"); biggestHost.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { biggestHostActionPerformed(evt); } }); biggestRenter.setText("Biggest Cancelling Renter"); biggestRenter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { biggestRenterActionPerformed(evt); } }); bigCancelField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bigCancelFieldActionPerformed(evt); } }); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() .addGap(184, 184, 184) .addComponent(jLabel31)) .addGroup(jPanel11Layout.createSequentialGroup() .addGap(162, 162, 162) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() .addComponent(biggestRenter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bigCancelField, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel11Layout.createSequentialGroup() .addComponent(biggestHost) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(bigHostField, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap(231, Short.MAX_VALUE)) ); jPanel11Layout.setVerticalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() .addGap(37, 37, 37) .addComponent(jLabel31) .addGap(92, 92, 92) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(biggestHost) .addComponent(bigHostField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(78, 78, 78) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(biggestRenter) .addComponent(bigCancelField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(385, Short.MAX_VALUE)) ); rankings.addTab("Biggest Cancellations Host and Renters", jPanel11); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rankings) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rankings) ); rankings.getAccessibleContext().setAccessibleName("Bookings in Date Range by City"); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public kunde() {\n initComponents();\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\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.createParallelGroup(\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\tAlignment.LEADING)\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.addComponent(label22,\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\tGroupLayout.PREFERRED_SIZE,\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\tGroupLayout.DEFAULT_SIZE,\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\tGroupLayout.PREFERRED_SIZE)\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.addGroup(\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\tlayout.createSequentialGroup()\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.addGap(3)\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.addComponent(\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\t\tlabel23,\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\t\tGroupLayout.PREFERRED_SIZE,\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\t\tGroupLayout.DEFAULT_SIZE,\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\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.732017", "0.7291279", "0.7291279", "0.7291279", "0.7286003", "0.7249014", "0.721411", "0.720819", "0.7196242", "0.7190395", "0.71849346", "0.7159721", "0.7148069", "0.70934445", "0.7079763", "0.7056577", "0.6987638", "0.6978011", "0.69549644", "0.69530493", "0.6945049", "0.6942394", "0.6935541", "0.693223", "0.6928088", "0.6924428", "0.69241494", "0.691142", "0.69106644", "0.6893475", "0.68921363", "0.68898267", "0.6889822", "0.6888889", "0.68830574", "0.68813944", "0.6881165", "0.6877479", "0.68752235", "0.68747437", "0.6871299", "0.6859591", "0.6856115", "0.6855173", "0.6855125", "0.6854962", "0.68530196", "0.6852737", "0.6852737", "0.6843147", "0.68370813", "0.68366593", "0.68283623", "0.68281215", "0.6825811", "0.6823924", "0.6823443", "0.68169594", "0.68156785", "0.6809513", "0.68092215", "0.68091464", "0.68080777", "0.6806839", "0.6802871", "0.6795172", "0.67944115", "0.67920417", "0.6790103", "0.6789442", "0.67882615", "0.67874336", "0.6782333", "0.67663395", "0.67655057", "0.6765026", "0.6756117", "0.6755023", "0.67517287", "0.6751031", "0.6743606", "0.6738867", "0.6737393", "0.6735563", "0.67327684", "0.67275465", "0.67266476", "0.6719547", "0.67160183", "0.6713876", "0.6713717", "0.67084426", "0.6706528", "0.670407", "0.67005676", "0.670017", "0.66990566", "0.6697206", "0.6694092", "0.6691282", "0.6689802" ]
0.0
-1
/ Get data through productCode
@RequestMapping(value="/products/NTB",method = RequestMethod.GET) public Optional<Products> getNTB(){ return repository.findById(4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getProductCode();", "public String getProductCode() {\r\n/* 211 */ return this._productCode;\r\n/* */ }", "public String getProductCode() {\n return this.productCode;\n }", "public String getProductCode() {\n return productCode;\n }", "java.lang.String getProductNumberCode();", "String getProduct();", "public static Product selectProduct(String productCode) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n ResultSet rs = null;\n\n String query = \"SELECT * FROM Product \"\n + \"WHERE productCode = ?\";\n \n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, productCode);\n rs = ps.executeQuery();\n Product p = null;\n if (rs.next()) {\n p = new Product();\n p.setProductCode(rs.getString(\"productCode\"));\n p.setProductName(rs.getString(\"productName\"));\n p.setCatalogCategory(rs.getString(\"catalogCategory\"));\n p.setDescription(rs.getString(\"description\"));\n p.setPrice(Float.parseFloat(rs.getString(\"price\")));\n p.setImageURL(rs.getString(\"imageURL\"));\n ///For test purposes only //System.out.println(\"DBSetup @ line 323 \" + p.getProductCode());\n }\n return p;\n } catch (SQLException e) {\n System.out.println(e);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "public Product getProductDetails(String barCode) throws RetailException {\n\t\tProduct product = null;\n\t\tProduct clonedProduct = null;\n\t\tif (Objects.isNull(barCode)) {\n\t\t\tlogger.error(\"Product code to be looked up cannot be null..\");\n\t\t\tthrow new RetailException(ErrorCodes.ERR_PRODUCT_INVALID_PRODUCT_CODE_ERROR);\n\t\t}\n\t\tif (Objects.nonNull(productData) && !productData.isEmpty()) {\n\t\t\tproduct = productData.get(barCode);\n\t\t\tif (Objects.nonNull(product)) {\n\t\t\t\tclonedProduct = product.getClonedProduct();\n\t\t\t} else {\n\t\t\t\tthrow new RetailException(ErrorCodes.ERR_PRODUCT_INVALID_PRODUCT_CODE_ERROR);\n\t\t\t}\n\t\t}\n\t\treturn clonedProduct;\n\t}", "public com.mozu.api.contracts.productadmin.Product getProduct(String productCode) throws Exception\r\n\t{\r\n\t\treturn getProduct( productCode, null);\r\n\t}", "public Product getProduct(int productCode){\n\t\t/*\n\t\t * Il prodotto da restituire\n\t\t */\n\t\tProduct product = new Product();\n\t\t\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella PRODOTTO.\n\t\t */\n\t\tPreparedStatement productStm = null;\n\t\tResultSet productRs = null;\n\t\t\n\t\tString sql = \"SELECT * FROM PRODOTTO WHERE CODICE = ?;\";\n\t\t\n\t\ttry{\n\t\t\tproductStm = connection.prepareStatement(sql);\n\t\t\tproductStm.setInt(1, productCode);\n\t\t\tproductRs = productStm.executeQuery();\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tList<Product> productList = this.getProductListFromRs(productRs);\n\t\t\tproduct = productList.get(0);\n\t\t\t\n\t\t\tproductStm.close(); // Chiude anche il ResultSet productRs\n\t\t\tConnector.releaseConnection(connection);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue 2: failed to retrive data from ResultSet.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\treturn product;\n\t}", "Object getProduct();", "Map<String, CsticParameterWithValues> retrieveProductCsticsAndValuesParameters(final String productCode);", "public static Product getProduct(String productCode) {\n\t\tProduct product2 = new Product(productCode, \"Murach's Java Servlets and JSP\", 57.50);\r\n\t\tProduct product3 = new Product(productCode, \"Murach's MySQL\", 54.50);\r\n\t\tProduct product4 = new Product(productCode, \"Murach's python\", 57.50);\r\n\t\tProduct product5 = new Product(productCode, \"Murach's Java Programming\", 57.50);\r\n\r\n\t\t// you can also call product, and then pass in like so\r\n\t\tProduct product6;\r\n\t\tif (productCode.equalsIgnoreCase(\"java\")) {\r\n\t\t\tproduct6 = new Product(productCode, \"Murach's Java Servlets and JSP\", 57.50);\r\n\t\t}\r\n\r\n\t\t// create the Product object\r\n\t\t// then with your product instance you can call the methods to set your values\r\n\t\tProduct product = new Product();\r\n\t\t// fill the Product object with data\r\n\t\tproduct.setCode(productCode);\r\n\t\tif (productCode.equalsIgnoreCase(\"java\")) {\r\n\t\t\tproduct.setDescription(\"Murach's Java Programming\");\r\n\t\t\tproduct.setPrice(57.50);\r\n\t\t} else if (productCode.equalsIgnoreCase(\"jsp\")) {\r\n\t\t\tproduct.setDescription(\"Murach's Java Servlets and JSP\");\r\n\t\t\tproduct.setPrice(57.50);\r\n\t\t} else if (productCode.equalsIgnoreCase(\"mysql\")) {\r\n\t\t\tproduct.setDescription(\"Murach's MySQL\");\r\n\t\t\tproduct.setPrice(54.50);\r\n\t\t} else if (productCode.equalsIgnoreCase(\"python\")) {\r\n\t\t\tproduct.setDescription(\"Murach's python\");\r\n\t\t\tproduct.setPrice(66.60);\r\n\t\t} else {\r\n\t\t\tproduct.setDescription(\"Unknown\");\r\n\t\t}\r\n\t\treturn product;\r\n\t}", "void setProductCode(java.lang.String productCode);", "Product getProductDetails(int idproduct) throws DataBaseException;", "public Product getProductInfo(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.product;\n}\n}\nreturn null;\n}", "public Integer getProductCode() {\n\t\treturn productCode;\n\t}", "public Product getProduct(String productCode) {\n\t\t\n Product p = null;\n\t\t\n\t\tif(productCode.equalsIgnoreCase(\"RTLove\") || productCode.equalsIgnoreCase(\"FoWork\") || productCode.equalsIgnoreCase(\"WinFs\") ) {\n\t\t// create Product object \n\t\t\n\t\tBook b = new Book();\n\t\t\n\t\tif(productCode.equalsIgnoreCase(\"RTLove\"))\n\t\t{\n\t\t\tp.setDescription(\"Return to Love\");\n\t\t\tp.setCode(productCode);\n\t\t\tp.setPrice(49.50);\n\t\t} \n\t\telse if (productCode.equalsIgnoreCase(\"FoWork\"))\n\t\t{\n\t\t\tp.setDescription(\"Focused Work\");\n\t\t\tp.setCode(productCode);\n\t\t\tp.setPrice(30.50);\n\t\t\t\n\t\t}\n\t\t\n\t\telse if (productCode.equalsIgnoreCase(\"WinFs\"))\n\t\t{\n\t\t\tp.setDescription(\"Win over Friends\");\n\t\t\tp.setCode(productCode);\n\t\t\tp.setPrice(25.50);\n\t\t}\n\t\telse \n\t\t{\n\t\t\tp = b;\n\t\t}\n\t\t\n\t\t\n\t}\n\t\treturn p;\n\t\t\n\t}", "void getPersonQrData(String storeCode);", "public String getProduct() {\r\n return this.product;\r\n }", "String getTheirProductId();", "public void retrieveProductFromDatabase(){\r\n // retrieve product from the database here\r\n System.out.println(\"Product Retrieved using ID --> \" + this.productId);\r\n \r\n }", "public void setProductCode(String productCode) {\n this.productCode = productCode;\n }", "public static Product getProductViaCode(int prodCode) {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tfinal String GET_PRODUCT = \"SELECT * FROM product WHERE product_code = \" + prodCode;\r\n\t\tProduct product = null;\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCT);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productId = rs.getInt(1);\r\n\t\t\t\tint productCode = rs.getInt(2);\r\n\t\t\t\tString productName = rs.getString(3);\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tdouble stockQuantity = rs.getDouble(8);\r\n\r\n\t\t\t\tproduct = new Product(productCode, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity);\r\n\t\t\t\tproduct.setProductId(productId);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn product;\r\n\t}", "public String getProduct()\n {\n return product;\n }", "public String getProduct() {\n return this.product;\n }", "Product getPProducts();", "String getProductId();", "void onProductClick(Product product, int code);", "public String getProductId() ;", "public String getProduct() {\n return product;\n }", "public String getProduct() {\n return product;\n }", "@Override\n\tpublic ProgrameInfoVO selectProgramPageInfoDetail(String prodCode)\n\t\t\tthrows Exception {\n\t\treturn progMapper.selectProgramPageInfoDetail(prodCode);\n\t}", "public String getDatabaseProduct();", "public Product getProductFromName(String prodName) throws BackendException;", "public String getProductId();", "public String getLBR_ProductSource();", "private void receiveData()\n {\n Intent i = getIntent();\n productSelected = Paper.book().read(Prevalent.currentProductKey);\n vendorID = i.getStringExtra(\"vendorID\");\n if (productSelected != null) {\n\n productName = i.getStringExtra(\"productName\");\n productImage = i.getStringExtra(\"imageUrl\");\n productLongDescription = i.getStringExtra(\"productLongDescription\");\n productCategory = i.getStringExtra(\"productCategory\");\n productPrice = i.getStringExtra(\"productPrice\");\n productSizesSmall = i.getStringExtra(\"productSizesSmall\");\n productSizesMedium = i.getStringExtra(\"productSizesMedium\");\n productSizesLarge = i.getStringExtra(\"productSizesLarge\");\n productSizesXL = i.getStringExtra(\"productSizesXL\");\n productSizesXXL = i.getStringExtra(\"productSizesXXL\");\n productSizesXXXL = i.getStringExtra(\"productSizesXXXL\");\n productQuantity = i.getStringExtra(\"productQuantity\");\n }\n }", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product getProduct();", "@Override\r\n public void getProduct() {\r\n\r\n InventoryList.add(new Product(\"Prod1\", \"Shirt\", \"Each\", 10.0, LocalDate.of(2021,03,19)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,21)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,29)));\r\n }", "public ArrayList getProductCode() {\n return productCodeArray;\n }", "@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET)\n\t public ResponseEntity<ProductData> getProductDetails(@PathVariable int productId){\t\t\t\t\t\n\t ProductData product = productService.getProduct(productId);\n\t return new ResponseEntity<>(product, HttpStatus.OK);\n\t }", "public String productList(ProductDetails p);", "public ProductInfo call() throws DataLoadException {\n\t\t\treturn new ProductInfo();\r\n\t\t}", "public String getProductDescription() {\r\n/* 221 */ return this._productDescription;\r\n/* */ }", "public void setProductCode(String productCode) {\r\n/* 427 */ this._productCode = productCode;\r\n/* */ }", "public String product() {\n return this.product;\n }", "void setProductNumberCode(java.lang.String productNumberCode);", "public Meta findMetaByProductCode(String codigoProducto){\n for (Meta meta:metas){\n if(meta.getCodigo().equals(codigoProducto)){\n return meta;\n }\n }\n return null;\n }", "public String getProductno() {\n return productno;\n }", "@RequestMapping(\"/product/{productId}\")\n public ProductAggregated getProduct(@PathVariable int productId) {\n\n \tLOG.info(\"Starting the product details call....\");\n\t\t//RX java implementation............\n\t\tProductAggregated pa = getProductDetails(productId);\n\t\tLOG.info(\"End of the product details call....\");\n\n \t\n \treturn pa;\n }", "public com.mozu.api.contracts.productadmin.Product getProduct(String productCode, String responseFields) throws Exception\r\n\t{\r\n\t\tMozuClient<com.mozu.api.contracts.productadmin.Product> client = com.mozu.api.clients.commerce.catalog.admin.ProductClient.getProductClient(_dataViewMode, productCode, responseFields);\r\n\t\tclient.setContext(_apiContext);\r\n\t\tclient.executeRequest();\r\n\t\treturn client.getResult();\r\n\r\n\t}", "CafeProduct getProductById(final Integer productId);", "int getProductKey();", "public Product(String code, String name) {\n this.code = code;\n this.name = name;\n }", "public StockData stockData(String code) {\n String url = generateUrl(code);\n RestTemplate rt = new RestTemplate();\n ResponseEntity<String> responseEntity = rt.getForEntity(url, String.class);\n String body = responseEntity.getBody();\n if (body.length() < 25) {\n return null;\n }\n return parseStockData(body);\n }", "public java.lang.String getProduct() {\n return product;\n }", "Product getProductByProductName(String productName);", "@Override\n\tpublic List<ProductVO> mainProductList(Integer cate_code_prt) {\n\t\treturn mapper.mainProductList(cate_code_prt);\n\t}", "public List<productmodel> getproductbyname(String name);", "ProductCatelogueResponse getProduct(int catelogueId,int productId);", "public Product getProduct (int prodCod) throws ApplicationException {\n\t\ttry {\n\t\t\tTypedQuery<Product> query = em.createNamedQuery(Product.FIND_BY_PRODUCT_CODE, Product.class);\n\t\t\tquery.setParameter(Product.PRODUCT_CODE, prodCod);\n\t\t\treturn query.getSingleResult();\n\t\t} catch (Exception e) {\n\t\t\tthrow new ApplicationException (\"Product with code \" + prodCod + \" does not exist\");\n\t\t}\n\t}", "public Product getProductFromId(Integer prodId) throws BackendException;", "private JSONObject gatherShopStyleProductInfo(String productId){\n try {\n //provides access to by sending requests through http protocol to other http servers\n HttpClient http = HttpClientBuilder.create().build();\n\n //address to call, port 80 is a default\n //port number 443 for https connection (usually)\n HttpHost host = new HttpHost(\"api.shopstyle.com\", 80, \"http\");\n\n //reference to location we are trying to retrieve data from\n //query here is for information on one specific product\n String productUrl = \"http://api.shopstyle.com/api/v2/products/\" + productId + \"?pid=uid5921-39054839-10\";\n HttpGet getPage = new HttpGet(productUrl);\n\n //execute HTTP request and get HTTP response back\n HttpResponse resp = http.execute(host, getPage);\n\n // Put the JSON to a string object\n String jsonString = EntityUtils.toString(resp.getEntity());\n JSONObject obj = new JSONObject(jsonString);\n\n return obj;\n\n }catch (java.io.IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "List<PriceInformation> getPriceForProduct(ProductModel product);", "Cart getCartForCode(String orderCode);", "TradingProduct getTradingProduct();", "@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n ResponseBankingProduct response = api.getProductDetail(productId);\n\n // TODO: test validations\n }", "public String getProductid() {\n return productid;\n }", "Product getProductById(Integer productID);", "@Override\n\tpublic <K extends BasePojo> K getDataByCode(String dataCode)\n\t\t\tthrows ServiceException {\n\t\treturn null;\n\t}", "Shop getShopByCode(String shopCode);", "@Override\n\tpublic int getProductId(final String producerCode)\n\t{\n\t\tint item = 0;\n\t\ttry\n\t\t{\n\t\t\tdb = dbconnection.getConnection();\n\t\t\tString sql = \"select i.item from item i where producer_code = '\" + producerCode + \"'\";\n\t\t\tps = this.db.prepareStatement(sql);\n\t\t\tProductRset = ps.executeQuery();\n\t\t\tMyLogger.LogMessage(\"ProductDAOImpl.getProductId(): Returning item\"\n\t\t\t\t\t+ \"select i.item from item where producer_code = '\" + producerCode\n\t\t\t\t\t+ \"' returning item\");\n\t\t\twhile (ProductRset.next())\n\t\t\t{\n\t\t\t\titem = ProductRset.getInt(\"item\");\n\t\t\t}\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tMyLogger.Log(\"ProductDAOImpl.getProductId():\", ex.getMessage());\n\t\t}\n\n\t\treturn item;\n\n\t}", "@JsonGetter(\"product_details\")\n public ProductData getProductDetails ( ) { \n return this.productDetails;\n }", "public ST getProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "@Override\n\tpublic String getBarcode() {\n\t\treturn product.getBarcode();\n\t}", "public String getProductID() {\r\n return productID;\r\n }", "java.lang.String getProductDescription();", "public void getProduct() {\n\t\tUtil.debug(\"getProduct\",this);\n\t\ttry {\n\t\t\tinputStream.skip(inputStream.available());\n\t\t} catch (IOException e) {\n\t\t\tUtil.log(e.getStackTrace().toString(),this);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\toutputStream.write(new byte[] { 'x', 13 });\n\t\t} catch (IOException e) {\n\t\t\tUtil.log(e.getStackTrace().toString(),this);\n\t\t\treturn;\n\t\t}\n\n\t\t// wait for reply\n\t\tUtil.delay(RESPONSE_DELAY);\n\t}", "@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n \n ResponseBankingProductById response = api.getProductDetail( productId );\n response.toString();\n // TODO: test validations\n }", "public int getStock(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.stock;\n}\n}\nreturn -1;\n}", "Product getProductById(Integer productId);", "Product getProductById(Integer productId);", "@Override\n public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode,resultCode,data);\n if (intentResult.getContents() != null) {\n String scannedText = intentResult.getContents();\n\n // Get product data associated with the UPC barcode\n Uri uri = api.getURL(scannedText);\n api.getData(uri, this::productBarcodeHandler);\n }\n else {\n Toast.makeText(getApplicationContext(),\"Nothing was scanned\", Toast.LENGTH_SHORT).show();\n }\n }", "@SuppressWarnings(\"unchecked\")\n private void fetchProductInformation() {\n // Query the App Store for product information if the user is is allowed\n // to make purchases.\n // Display an alert, otherwise.\n if (SKPaymentQueue.canMakePayments()) {\n // Load the product identifiers fron ProductIds.plist\n String filePath = NSBundle.getMainBundle().findResourcePath(\"ProductIds\", \"plist\");\n NSArray<NSString> productIds = (NSArray<NSString>) NSArray.read(new File(filePath));\n\n StoreManager.getInstance().fetchProductInformationForIds(productIds.asStringList());\n } else {\n // Warn the user that they are not allowed to make purchases.\n alert(\"Warning\", \"Purchases are disabled on this device.\");\n }\n }", "@Override\r\n\tpublic List<PayedProduct> getAllInfoProduct(String pname) {\n\t\tList<PayedProduct> list=null;\r\n\t\ttry {\r\n\t\t\tString sql=\"SELECT * FROM payedproduct WHERE payedproduct_name LIKE CONCAT('%',?,'%')\";\r\n\t\t\treturn qr.query(sql, new BeanListHandler<PayedProduct>(PayedProduct.class),pname);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public int getM_Product_ID();", "public int getM_Product_ID();", "public String getCodProd() {\n return this.codProd;\n }", "public String getAcsProduct() {\n return acsProduct;\n }", "public ProductDetails getProductDetails(Long productId) {\n\t\t// TODO Auto-generated method stub\t\t\n\t\t//do http get call\n ResponseEntity<String> productDetails = doRestTemplateCall(ConstantsUtil.BASE_URL+productId+ConstantsUtil.URL_ENDPOINT);\n ProductDetails pdtDetailsResponse = new ProductDetails();\n //To handle redirect from http to https\n HttpHeaders httpHeaders = productDetails.getHeaders();\n HttpStatus statusCode = productDetails.getStatusCode();\n if (statusCode.equals(HttpStatus.MOVED_PERMANENTLY) || statusCode.equals(HttpStatus.FOUND) || statusCode.equals(HttpStatus.SEE_OTHER)) {\n if (httpHeaders.getLocation() != null) {\n \tproductDetails = doRestTemplateCall(httpHeaders.getLocation().toString());\n } else {\n throw new RuntimeException();\n }\n }\n if(null!= productDetails) { //to check if productdetail response is received \n log.info(\"product details found:\"+productDetails.getBody());\n \n JsonNode node;\n ObjectMapper objectMapper = new ObjectMapper();\n try {\n\t\t\tnode = objectMapper.readValue(productDetails.getBody(), JsonNode.class);\n\t\t\tif(!myRetailAppDao.isProductDetailsPresent(productId))\t //check if product data is present in MongoDB\n\t\t\t\tmyRetailAppDao.saveToMongoDB(productDetails.getBody()); // if not, save product data to MongoDB\n\t\t\telse\n\t\t\t\tlog.info(\"Data for prductId \"+productId+\" is already present in DB, skipping insert\");\n\t\t\tJsonNode title = null;\n\t\t\t//get product title from the nested json\n\t\t\ttitle = node.get(ConstantsUtil.PRODUCT).get(ConstantsUtil.ITEM).get(ConstantsUtil.PDT_DESC).get(ConstantsUtil.TITLE);\n\t\t\tlog.info(\"title:\"+title.asText());\n\t\t\t//set the product details response\n\t\t\tpdtDetailsResponse.setName(title.asText());\n\t\t\tpdtDetailsResponse.setId(productId);\n\t\t\tCurrentPrice currentPrice = new CurrentPrice();\n\t\t\tPriceAndCurrency priceAndCurr = myRetailAppDao.getPriceAndCurrency(productId); //get price and currency details\n\t\t\tcurrentPrice.setCurrency_code(CurrencyMap.getCurrencyCode(priceAndCurr.getCurrency()));\n\t\t\tcurrentPrice.setValue(priceAndCurr.getPrice()); \n\t\t\tpdtDetailsResponse.setCurrentPrice(currentPrice);\n\t\t\t\n\t\t\tlog.info(\"pdtDetailsResponse:\"+pdtDetailsResponse.toString());\n\t\t} catch (IOException e) {\n\t\t\tlog.error(\"Error while calling external api for title\",e);\n\t\t}\n }\n \n \treturn pdtDetailsResponse;\n\t}", "public String getProductNo() {\n\t\treturn productNo;\n\t}", "public String getProdDetailsName(){\n String prodName = productDetailsName.toString();\n return prodName;\n }", "ProductPurchaseItem getProductPurchaseItemPerId(long sprcId);", "public ST getPsl9_ProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "public java.lang.String getProductInfo () {\n\t\treturn productInfo;\n\t}", "public ArrayList<Product> getAllProducts(){\r\n\t\tArrayList<Product> prods = new ArrayList<Product>();\r\n\t\tIterator<Integer> productCodes = inventory.keySet().iterator();\r\n\t\twhile(productCodes.hasNext()) {\r\n\t\t\tint code = productCodes.next();\r\n\t\t\tfor(Product currProduct : Data.productArr) {\r\n\t\t\t\tif(currProduct.getID() == code) {\r\n\t\t\t\t\tprods.add(currProduct);\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\treturn prods;\r\n\t}", "public ArrayList<String> findProductCodes(){\n\t\t\tArrayList<String> returnCodeNames = new ArrayList<String>();\n\t\t\t\n\t\t\tfor(Product p: products){\n\t\t\t\treturnCodeNames.add(p.getProductCode());\n\t\t\t}\n\t\t\t\n\t\t\treturn returnCodeNames;\n\t\t\t\n\t\t}", "public void getProductData(PdpUseCase.ResponseValues responseValues) {\n mProductDetailsViewModel.parsePdpResponseValues(responseValues);\n }", "public String getProductName() {\r\n return productName;\r\n }", "public String getProductReference() {\n return productReference;\n }" ]
[ "0.7578511", "0.73306763", "0.7264064", "0.7117291", "0.70835495", "0.68406445", "0.6718634", "0.6671903", "0.6633241", "0.6620317", "0.6555952", "0.65424293", "0.6539335", "0.64992076", "0.64932215", "0.64872026", "0.647041", "0.64466095", "0.6421347", "0.64095473", "0.6405265", "0.64050746", "0.6403995", "0.6398412", "0.6385794", "0.6338954", "0.63355225", "0.63307637", "0.62880397", "0.6269474", "0.62559074", "0.62559074", "0.6251289", "0.6238379", "0.62342316", "0.621071", "0.6196203", "0.6195142", "0.6191467", "0.61888415", "0.6172214", "0.6137571", "0.6131651", "0.60960543", "0.609338", "0.6092956", "0.607935", "0.60755885", "0.60651916", "0.60584974", "0.6058049", "0.6043556", "0.60224694", "0.59953576", "0.5986894", "0.5986252", "0.59858", "0.59670955", "0.5965943", "0.59658366", "0.59605795", "0.59479344", "0.5916188", "0.59099007", "0.5902528", "0.5893005", "0.5887594", "0.58785135", "0.5869109", "0.5860118", "0.5855886", "0.585326", "0.5848037", "0.5846647", "0.58320546", "0.5829465", "0.58271545", "0.58245176", "0.5823259", "0.5803618", "0.5790161", "0.57765037", "0.57765037", "0.57681704", "0.5764404", "0.5763098", "0.5761139", "0.5761139", "0.5760855", "0.57529426", "0.57428205", "0.5740953", "0.5740562", "0.5728629", "0.5722811", "0.5711952", "0.57087445", "0.5701045", "0.56883365", "0.5683226", "0.56763184" ]
0.0
-1
limits the number of lines of astrix's that will be printed
public static void chaotic(int parameter) { for (int i = 0; i < parameter; i++) { // the randomizers output is limited from 1 to 5 int randNumb = (int) (Math.random() * (5)) + 1; // this loop prints the astrix's out while limiting the amount to output from the randomizer for (int x = 0; x < randNumb; x++) { System.out.print("*"); } // creates a new line for the next line of astrix's System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setLinesLimit(int value);", "int getLinesLimit();", "int getMaxOutputLines();", "private void lineBreak()\n\t{\n\t\tlog += String.format(\"%n\");\n\t\tfor(int i = 0; i < 25; i++)\n\t\t\tlog += \"-\";\n\t\tlog += String.format(\"%n\");\n\t}", "int getFixedLines();", "private static void chaotic(int lines) {\n Random rand = new Random();\r\n //prints out a random amout of * from 1 to 5 for every line\r\n for (int i = 0; i < lines; i++) {\r\n int length = rand.nextInt(5) + 1;\r\n for(int o = 0; o < length; o++)\r\n System.out.print(\"* \");\r\n //new line to separate lines of *\r\n System.out.println(\"\");\r\n }\r\n }", "public void setNoOfRelevantLines(int norl) { this.noOfRelevantLines = norl; }", "public void showLineage() {\n\t\tfor (Iterator i = this.getLineage().iterator(); i.hasNext();) {\n\t\t\tprtln((String) i.next());\n\t\t}\n\t}", "public static void invalidShowRemainingLimitPrinter() {\n System.out.println(line);\n System.out.println(INVALID_FORMAT_MSG);\n System.out.println(SHOW_FORMAT_MSG);\n System.out.println(line);\n }", "public ActionScriptBuilder lines(int count){\n\t\tfor(int i=0; i<count; i++)\n\t\t\tactionScriptLines.add(\"\");\n\t\treturn this;\n\t}", "@Override\n public void run() {\n if(body.getLineCount() < 4) {\n more.setVisibility(GONE);\n }\n body.setMaxLines(3);\n }", "private static void myLine(int zahl) {\n\n for (int i = 7; i < zahl; i += 7) {\n System.out.print(i + \" \");\n }\n }", "private static int getWrappedLines(JTextArea textArea) {\n AttributedString text = new AttributedString(textArea.getText());\n text.addAttribute(TextAttribute.FONT, textArea.getFont());\n FontRenderContext frc = textArea.getFontMetrics(textArea.getFont()).getFontRenderContext();\n AttributedCharacterIterator charIt = text.getIterator();\n LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(charIt, frc);\n float formatWidth = SideBarPanel.SIDEBAR_WIDTH - 30;\n lineMeasurer.setPosition(charIt.getBeginIndex());\n\n int noLines = 0;\n while (lineMeasurer.getPosition() < charIt.getEndIndex()) {\n lineMeasurer.nextLayout(formatWidth);\n noLines++;\n }\n return noLines;\n\n }", "public void limpiarPantalla() \n\t{\n\t\tfor( int i = 0; i < 300;i++)\n\t\t\tthis.println();\t\t\n\t}", "public static void chaos(int numbLines) {\n for (int i = 0; i < numbLines; i++) {\n // create the random\n int randNumb = (int)(Math.random()*(5 - 1 + 1)) + 1;\n \n // create a random amount of astrics\n for (int j = 0; j < randNumb - 1; j++) {\n System.out.print(\"*\");\n }\n System.out.println(\"*\");\n }\n \n \n }", "private void printLines() {\n for (String L: testLines) {\n print.write(L);\n }\n }", "@Test\n\tpublic void resultToPrintLimit25() {\n\t\tResultToPrint.setLimitRead(25);\n\t\t//execute\n\t\tList<ClientEntity> response = ResultToPrint.getSuspiciousClients(mapClients);\n\t\tassertEquals(1, response.size());\n\t\tassertEquals(ID_CLIENT_2, response.get(0).getId());\n\t\tassertEquals(\"2014\", response.get(0).getMonth());\n\t\tassertEquals(ID_CLIENT_READING_2, response.get(0).getReading());\n\t}", "public static int minimumNumberOfLineItems() {\n return 0;\n }", "public void setMaxLines(int maxLines) {\n if (mMaxLines == maxLines || maxLines <= 0) {\n return;\n }\n mMaxLines = maxLines;\n mNeedUpdateLayout = true;\n }", "public static void main(String[] args) {\n\t\tint lineaGatitos = 1, gatitos; \n\t\t\n\t\twhile(lineaGatitos <= 5) {\n\t\t\tSystem.out.println();\n\t\t\tgatitos = 0;\n\t\t\twhile (gatitos < lineaGatitos) {\n\t\t\t\tSystem.out.print(\"#\");\n\t\t\t\tgatitos++;\n\t\t\t}\n\t\tlineaGatitos++;\n\t\t}\n\n\t}", "public void setLineLength(int len) {\n lineLength = len / 4 * 4;\n }", "protected int bytesPerLine() {\n return (48);\n }", "protected int bytesPerLine() {\n return (48);\n }", "@Test\n\tpublic void resultToPrintLimit10() {\n\t\tResultToPrint.setLimitRead(10);\n\t\t//execute\n\t\tList<ClientEntity> response = ResultToPrint.getSuspiciousClients(mapClients);\n\t\tassertEquals(3, response.size());\n\t\tassertEquals(ID_CLIENT_1, response.get(0).getId());\n\t\tassertEquals(ID_CLIENT_2, response.get(1).getId());\n\t\tassertEquals(ID_CLIENT_2, response.get(2).getId());\n\t\tassertEquals(\"2015\", response.get(0).getMonth());\n\t\tassertEquals(\"2014\", response.get(1).getMonth());\n\t\tassertEquals(\"2013\", response.get(2).getMonth());\n\t\tassertEquals(ID_CLIENT_1_READING_2, response.get(0).getReading());\n\t\tassertEquals(ID_CLIENT_READING_2, response.get(1).getReading());\n\t\tassertEquals(ID_CLIENT_2_READING_2, response.get(2).getReading());\n\t}", "private void displayLine()\n {\n System.out.println(\"#################################################\");\n }", "public int maxL()\r\n {\r\n return metro.numberOfLines - 1;\r\n }", "private void printSeparation(){\n\t\tfor (int i = 0; i < 50; i++) {\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "protected void setMaxLineCount(int maxLineCount) {\n\t\tthis.maxLineCount = maxLineCount;\n\t}", "@Override\r\n\tpublic synchronized String toString()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\tStringBuilder sb = new StringBuilder()\r\n\t\t\t\t.append(lines.size()).append(' ')\r\n\t\t\t\t.append(numberOfClients).append(' ');\r\n\t\t\tfor(int i = size()-1; i >= 0; i--)\r\n\t\t\t{\r\n\t\t\t\tsb.append(lines.get(i).toString()).append(' ');\r\n\t\t\t}\r\n\t\t\treturn sb.toString();\r\n\t\t}\r\n\t}", "public int getNumLines ();", "public String printVerticalLine(int number){\n int count = 0;\n StringJoiner joiner = new StringJoiner(\"\\n\");\n\n while (count < number){\n joiner.add(printAsterisk());\n count = count + 1;\n }\n return joiner.toString();\n }", "public abstract int numberOfLines();", "public static void limpaTela() {\r\n\t\tfor (int i = 0; i < 30; i++)\r\n\t\t\tSystem.out.println();\r\n\t}", "private static void printNos() {\n\t\tfor(int i=0; i<=10; i++) { //this is a single line comment\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t/*\n\t\t * this is a multiline comment\n\t\t */\n\t}", "static void PrintPrimes(int limit)\n {\n final int primePerLine = 22; // Prime numbers in a line\n int count = 0; // count for prime numbers in line\n int n = 2; // numbers to print if it is prime\n\n // while n is less than limit \n while(n < limit)\n {\n // check number is prime\n if(isPrime(n))\n {\n count++; // if prime than increase count for prime numbers in line\n \n // if count is greater than prime per line add another line\n if(count % primePerLine == 0)\n {\n System.out.printf(\"%-5s\\n\", n);\n }\n else\n {\n System.out.printf(\"%-5s\", n);\n }\n }\n\n n++; // check next number\n }\n }", "private void printLineGap() {\r\n\t\tfor (int i = 0; i < 45; i++) {\r\n\t\t\tSystem.out.print('-');\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "int getBrokenLines();", "@Override\n public void setVisibleLength(int length) {}", "public void printPerFloorLine() {\r\n\t\tgetPerFloor();\r\n\t\tgetPerLine();\r\n\t\tprintPerFloor();\r\n\t\tSystem.out.println(\"\");\r\n\t\tprintPerLine();\r\n\t}", "private void makeTestLines(int n) {\n testLines = new ArrayList<>();\n for (int i = 0; i < n; i += 1) {\n testLines.add(\"Line \" + i);\n }\n }", "private void setLinesCount(String description, boolean isClicked) {\n mBinding.tvPdpProductDescription.setMaxLines(!isClicked ? (FOUR * moreIndex) : mLineCount);\n mBinding.tvPdpProductDescription.setEllipsize(\n mLineCount > FOUR * moreIndex ? TextUtils.TruncateAt.END : null);\n mBinding.tvPdpProductDesMore.setVisibility(\n (!isClicked) ? View.VISIBLE : View.GONE);\n }", "public void setLineWidth(float lineWidth);", "protected void setMinLineCount(int minLineCount) {\n\t\tthis.minLineCount = minLineCount;\n\t}", "public static void main(String[] args) {\n for (int i = 0; i <= 1000; i++) {\n if (i % 5 == 0) {\n System.out.print(i + \"\\t\");\n }\n if (i % (5 * 3) == 0) {\n System.out.println();//换行\n }\n }\n }", "public static void printLine() {\r\n if (!isDisabled()) {\r\n print(LINE_SEPARATOR);\r\n }\r\n }", "public OompaLoompaSong(int lines){\r\n\t\tthis.lines=lines;\r\n\t}", "public void setNotificationBodyMaxLines(int maxLines){\r\n\t\ttry{\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor (int i=0; i<totalNotifications; i++){\r\n\t\t\t\tNotificationView currentNotificationView = (NotificationView) this.getChildAt(i);\r\n\t\t\t\tcurrentNotificationView.setNotificationBodyMaxLines(maxLines);\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.setNotificationBodyMaxLines() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "public static void main (String args[])\n {\n final int START;\n final int STOP = 500;\n final int NUMBER_PER_LINE = 10;\n int temp = 0;\n Scanner inputDevice = new Scanner(System.in);\n System.out.println(\"Enter value to count by: \");\n START = inputDevice.nextInt();\n for(int i = START; i <= STOP; i += START)\n {\n System.out.print(i + \" \");\n temp++;\n if(temp % NUMBER_PER_LINE == 0)\n System.out.println();\n }\n System.out.println();\n }", "private void lineCheck(int linesToAdd) {\n\n\t\tTermio terminal = new Termio();\n\n\t\tif (lineCount >= maxLinesDisplayed) {\n\n\t\t\tlineCount = 0;\n\t\t\tSystem.out.print(\"\\n*** Press Enter To Continue ***\");\n\t\t\tterminal.keyboardReadChar();\n\n\t\t} else {\n\n\t\t\tlineCount += linesToAdd;\n\n\t\t} // if\n\n\t}", "@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}", "int getLinesCount();", "public void display(String line) {\r\n\t\tif (console.size() == 50) {\r\n\t\t\tconsole.remove(0);\r\n\t\t}\r\n\t\tconsole.addElement(line);\r\n\t}", "public void setShowLineNumbers(boolean aValue)\n {\n if (aValue == isShowLineNumbers()) return;\n _showLineNumbers = aValue;\n\n // Adjust PrefWidth\n setPrefWidth(getSuggestedPrefWidth());\n }", "public static void invalidLimitDurationPrinter() {\n System.out.println(line);\n System.out.println(INVALID_LIMIT_DURATION_MSG);\n System.out.println(line);\n }", "private Line[] makeTenRandomLines() {\n Random rand = new Random(); // create a random-number generator\n Line[] lines = new Line[NUM_LINE];\n for (int i = 0; i < NUM_LINE; ++i) {\n int x1 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y1 = rand.nextInt(300) + 1; // get integer in range 1-300\n int x2 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y2 = rand.nextInt(300) + 1; // get integer in range 1-300\n lines[i] = new Line(x1, y1, x2, y2);\n }\n return lines;\n }", "void showNewLine(String lineNumber, String directionId);", "@Override\n public int getNumOfPageRows() {\n return 10;\n }", "private void newline() {}", "private static void writeRiddle(int[][] a) {\n for (int i=0; i<9; ++i) {\n for (int j=0; j<9; ++j) {\n System.out.print(a[i][j]+ \" \");\n if ((j+1)%3==0) System.out.print(\" | \");\n }\n \n if ( (i+1)%3==0 && i!=8 ) {\n System.out.print(\"\\n--------------------------\");\n }\n \n System.out.print(\"\\n\");\n }\n \n System.out.println(\"\\n\");\n }", "public static int Main()\n\t\t{\n\t\t\tint n;\n\t\t\tint i;\n\t\t\tint wl;\n\t\t\tint len = 0;\n\t\t\tint line = 0;\n\t\t\tString w = new String(new char[64]);\n\t\t\tString tempVar = ConsoleInput.scanfRead();\n\t\t\tif (tempVar != null)\n\t\t\t{\n\t\t\t\tn = Integer.parseInt(tempVar);\n\t\t\t}\n\t\t\tfor (int i = 1; i <= n; i++)\n\t\t\t{\n\t\t\t\tString tempVar2 = ConsoleInput.scanfRead();\n\t\t\t\tif (tempVar2 != null)\n\t\t\t\t{\n\t\t\t\t\tw = tempVar2.charAt(0);\n\t\t\t\t}\n\t\t\t\twl = w.length();\n\t\t\t\tif (line == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 <= 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\" %s\",w);\n\t\t\t\t\tlen += wl + 1;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 > 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"\\n%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}", "private void drawLines() {\n int min = BORDER_SIZE;\n int max = PANEL_SIZE - min;\n int pos = min;\n g2.setColor(LINE_COLOR);\n for (int i = 0; i <= GUI.SIZE[1]; i++) {\n g2.setStroke(new BasicStroke(i % GUI.SIZE[0] == 0 ? 5 : 3));\n g2.drawLine(min, pos, max, pos);\n g2.drawLine(pos, min, pos, max);\n pos += CELL_SIZE;\n }\n }", "private void printGridLine(int line) {\n\t\tString textLine = \" \";\r\n\t\tswitch(line) {\r\n\t\t\tcase 1:\t\t\t\t\r\n\t\t\t\ttextLine += \" ╔ \";\r\n\t\t\t\tfor(int i = 0; i < 9; i++) {\r\n\t\t\t\t\ttextLine += \" ╦ \";\r\n\t\t\t\t}\r\n\t\t\t\ttextLine += \" ╗\";\r\n\t\t\t\tSystem.out.println(textLine);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\ttextLine += \" ║ \";\r\n\t\t\t\tfor(int i = 0; i < 9; i++) {\r\n\t\t\t\t\ttextLine += \" ╬ \";\r\n\t\t\t\t}\r\n\t\t\t\ttextLine += \" ║\";\r\n\t\t\t\tSystem.out.println(textLine);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\ttextLine += \" ╚ \";\r\n\t\t\t\tfor(int i = 0; i < 9; i++) {\r\n\t\t\t\t\ttextLine += \" ╩ \";\r\n\t\t\t\t}\r\n\t\t\t\ttextLine += \" ╝\";\r\n\t\t\t\tSystem.out.println(textLine);\r\n\t\t}\r\n\t}", "public synchronized void setOutputLimit(double limit)\n {\n limit = Math.abs(limit);\n setOutputRange(-limit, limit);\n }", "public void setLineWidth(int width)\n {\n if (width > 0)\n lineWidth = width;\n else \n lineWidth = 1;\n }", "public static void rowLine(int n){\r\n for (int i = 0; i<n; i++){\r\n System.out.print(\"+-\");\r\n }\r\n System.out.println('+');\r\n }", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public void setMaxRows(int maxRows);", "public int getLinesResource(){\n return response.body().split(\"\\n\").length;\n }", "public void setLineHeight(int i) {\n lineHeight = i;\n }", "public void displayGrid(){\n \tint max = currentOcean.getMaxGrid(); // modified by Ludo\n \tint line = max*2 +1; \t\t\t\t// modified by Ludo\n \tfor(int i=0; i<max+1;i++){\t\t\t// modified by Ludo\n \t int lineStart = 0 + line*i;\t\t// modified by Ludo\n \t int lineEnd = line + line*i;\t\t// modified by Ludo\n \t System.out.println(currentOcean.toString().substring(lineStart, lineEnd)); // modified by Ludo\n }\n }", "private void skipConsoleLine(){\n\t\tSystem.out.println();\n\t}", "void wrappedText(final int count);", "public static void main(String[] args) {\n\t\tint a[] = {3,4,4,6,1,4,4};\n\t\tint counter[] = new int[5];\n\t\tint max_counter = 0;\n\t\tint start_line = 0;\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t\n\t\t\tint x = a[i] - 1;\n\t\t\t\n\t\t\tif(a[i] > counter.length) {\n\t\t\t\t//max counter\n\t\t\t\tstart_line = max_counter;\n\t\t\t}else {\n\t\t\t\tif(counter[x] < start_line) {\n\t\t\t\t\tcounter[x] = counter[x] + start_line;\n\t\t\t\t}\n\t\t\t\t\tcounter[x]++;\n\t\t\t\t\t\n\t\t\t\t\tif(counter[x] > max_counter) {\n\t\t\t\t\t\tmax_counter = counter[x];\n\t\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<counter.length;i++) {\n\t\t\tif(counter[i] < start_line) {\n\t\t\t\tcounter[i] = start_line;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(Arrays.toString(counter));\n\t\t\n\t\t\n\t}", "private void makePreformattedLines(LayoutContext lc) {\n int end = -1;\n int max = text.length;\n boolean isLastLine = false;\n\n do {\n int beg = end + 1;\n do {\n if (++end >= max) {\n isLastLine = true;\n break;\n }\n } while (text[end] != '\\n');\n addLine(beg, end, true, lc, false);\n } while (!isLastLine);\n }", "@Override\n\tpublic String printToScreen(){\n\t\n\t\tif(this.getyMaxLines() == 0){return \"\";}\n\t\tTextProfile textProfile= new TextProfile(this.getScreenScores(), this.getyMaxLines(), this.getYLimitMin(), this.getYLimitMax());\n\t\t\n\t\tArrayList<String> lineStrings= new ArrayList<String>();\n\t\tfor(int i= (textProfile.getProfile().size() - 1); i >= 0; i--){\n\t\t\tList<String> xl= textProfile.getProfile().get(i);\n\t\t\tlineStrings.add(StringUtils.join(xl, \"\"));\n\t\t}\t\t\n\t\treturn Joiner.on(\"\\n\").join(lineStrings);\n\t}", "private static int numLines() {\n\t\tif(subway != null)\n\t\t\treturn subway[0].length;\n\t\treturn 0;\n\t}", "public void clean() {\n\t\tfor(int i = 0; i <= 20; i++) {\n\t\t\tSystem.out.println(\" \");\n\t\t}\n\t}", "public int getScanlineLength();", "static Interaction prints(String... lines) {\n return (input, output) -> {\n for (String line : lines) {\n output.append(line).append('\\n');\n }\n };\n }", "private void printLine(int n, int k) {\n System.out.printf(\"%4d- \", n + 1);\n for (int i = 0; i < k; i++) {\n if (i % 10 == 0) System.out.printf(\" \");\n System.out.printf(\"%c\", seq.get(i + n));\n }\n for (int i = k; i < printLength; i++) {\n if (i % 10 == 0) System.out.printf(\" \");\n System.out.printf(\" \");\n }\n System.out.printf(\" -%4d\\n\", n + printLength);\n }", "public int getNoOfRelevantLines() { return this.noOfRelevantLines; }", "@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }", "public int number_of_lines() {\r\n\t\treturn line_index.size() - 1;\r\n\t}", "public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }" ]
[ "0.69895446", "0.6897438", "0.66566443", "0.6269113", "0.62681705", "0.5859928", "0.58432984", "0.5819695", "0.5810627", "0.57697797", "0.5714368", "0.5695989", "0.56606925", "0.56371814", "0.5587667", "0.5579654", "0.55618334", "0.5546238", "0.5528285", "0.5503211", "0.54403394", "0.541125", "0.541125", "0.54100937", "0.54062045", "0.53678346", "0.535064", "0.53498554", "0.53345513", "0.53341943", "0.53313994", "0.5330765", "0.53119457", "0.53100044", "0.52942157", "0.5293595", "0.5289222", "0.5270809", "0.52583694", "0.52559465", "0.52416384", "0.52252597", "0.52072257", "0.5191304", "0.51811224", "0.51745623", "0.51682", "0.5160658", "0.51566887", "0.51544714", "0.5148831", "0.5142226", "0.51147604", "0.51097834", "0.50968677", "0.509539", "0.5090769", "0.50907546", "0.50675297", "0.506453", "0.50613594", "0.5058371", "0.505732", "0.505153", "0.5047092", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.5045771", "0.50412333", "0.5031783", "0.502489", "0.50169855", "0.50160176", "0.501404", "0.5005241", "0.50029075", "0.5002786", "0.49981177", "0.49946275", "0.49933144", "0.49834162", "0.4980692", "0.49777427", "0.49752188", "0.4974826" ]
0.558841
14
TODO Autogenerated method stub
public static void main(String[] args) { String interger = ""; int r = 0; int oper = 0; while (true) { Scanner s = new Scanner(System.in); System.out.print("숫자 한개, 연산자, d, e"); String firstInt = s.next(); if (firstInt.equals("+")) { oper = 1; r = r + Integer.parseInt(interger); interger = ""; } else if (firstInt.equals("-")) { oper = 2; r = r - Integer.parseInt(interger); interger = ""; } else if (firstInt.equals("=")) { if (oper == 1) { r = r + Integer.parseInt(interger); System.out.println(r); } else if (oper == 2) { r = r - Integer.parseInt(interger); System.out.println(r); } interger = "0"; } else if (firstInt.equals("d")) { interger = interger.substring(0, interger.length() - 1); } else { interger = interger + firstInt; } } }
{ "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
require permission if API is larger than 23
private void requirePermission(){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE; if (ActivityCompat.checkSelfPermission(MainActivity2.this, permission) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(MainActivity2.this, new String[]{permission},123); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestNeededPermissions(int requestCode);", "private void enforcePermission() {\n\t\tif (context.checkCallingPermission(\"com.marakana.permission.FIB_SLOW\") == PackageManager.PERMISSION_DENIED) {\n\t\t\tSecurityException e = new SecurityException(\"Not allowed to use the slow algorithm\");\n\t\t\tLog.e(\"FibService\", \"Not allowed to use the slow algorithm\", e);\n\t\t\tthrow e;\n\t\t}\n\t}", "@TargetApi(Build.VERSION_CODES.M)\n private void checkBTPermissions() {\n if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP){\n int permissionCheck = this.checkSelfPermission(\"Manifest.permission.ACCESS_FINE_LOCATION\");\n permissionCheck += this.checkSelfPermission(\"Manifest.permission.ACCESS_COARSE_LOCATION\");\n if (permissionCheck != 0) {\n\n this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number\n }\n }else{\n Log.d(TAG, \"checkBTPermissions: No need to check permissions. SDK version < LOLLIPOP.\");\n }\n }", "private void dynamicPermission() {\n if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {\n Log.i(\"MainActivity\", \"android sdk <= 28 Q\");\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n String[] strings =\n {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n ActivityCompat.requestPermissions(this, strings, 1);\n }\n } else {\n // Dynamically apply for required permissions if the API level is greater than 28. The android.permission.ACCESS_BACKGROUND_LOCATION permission is required.\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\") != PackageManager.PERMISSION_GRANTED) {\n String[] strings = {android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\"};\n ActivityCompat.requestPermissions(this, strings, 2);\n }\n }\n }", "private void checkAndRequestPermissions() {\n missingPermission = new ArrayList<>();\n // Check for permissions\n for (String eachPermission : REQUIRED_PERMISSION_LIST) {\n if (ContextCompat.checkSelfPermission(this, eachPermission) != PackageManager.PERMISSION_GRANTED) {\n missingPermission.add(eachPermission);\n }\n }\n // Request for missing permissions\n if (missingPermission.isEmpty()) {\n DroneModel.getInstance(this).setDjiProductStateCallBack(this);\n DroneModel.getInstance(this).startSDKRegistration();\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n ActivityCompat.requestPermissions(this,\n missingPermission.toArray(new String[missingPermission.size()]),\n REQUEST_PERMISSION_CODE);\n }\n }", "boolean requestIfNeeded(Activity activity, Permission permission);", "@Override\n public void onClick(View view) {\n String platform = checkPlatform();\n if (platform.equals(\"Marshmallow\")) {\n Log.d(TAG, \"Runtime permission required\");\n //Step 2. check the permission\n boolean permissionStatus = checkPermission();\n if (permissionStatus) {\n //Permission already granted\n Log.d(TAG, \"Permission already granted\");\n } else {\n //Permission not granted\n //Step 3. Explain permission i.e show an explanation\n Log.d(TAG, \"Explain permission\");\n explainPermission();\n //Step 4. Request Permissions\n Log.d(TAG, \"Request Permission\");\n requestPermission();\n }\n\n } else {\n Log.d(TAG, \"onClick: Runtime permission not required\");\n }\n\n\n }", "private void checkRunTimePermission() {\n\n if(checkPermission()){\n\n Toast.makeText(MainActivity.this, \"All Permissions Granted Successfully\", Toast.LENGTH_LONG).show();\n\n }\n else {\n\n requestPermission();\n }\n }", "public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }", "private boolean runtime_permissions() {\n if(Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},100);\n\n return true;\n }\n return false;\n }", "public void askPermission() {\n try {\n if (Build.VERSION.SDK_INT >= 23) {\n //call the function to ask for permission\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, 100);\n return;\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void checkRequestPermission(){\n\n\n hasPermission = (ActivityCompat.checkSelfPermission(this, Manifest.permission.VIBRATE)\n == PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n == PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n == PackageManager.PERMISSION_GRANTED );\n//check group permissons\n if (!hasPermission){\n ActivityCompat.requestPermissions(this,\n new String[]{\n Manifest.permission.VIBRATE,\n Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE\n\n },\n REQUEST_NETWORK_ACCESS);\n }\n }", "void permissionGranted(int requestCode);", "@Override\n public void checkPermission(Permission perm) {\n }", "void askForPermissions();", "private void requestPermissions() {\n mWaiting4Permission = Boolean.TRUE;\n\n ActivityCompat.requestPermissions(this, permissionsToAsk(), PERMISSIONS_REQUEST_CODE);\n }", "@Override\n public void onRequestAllow(String permissionName) {\n }", "private void askPermission() {\n if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n Parameters.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private boolean permisos() {\n for(String permission : PERMISSION_REQUIRED) {\n if(ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }", "public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }", "private void checkPermissions() {\n final ArrayList<String> missedPermissions = new ArrayList<>();\n\n for (final String permission : PERMISSIONS_REQUIRED) {\n if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {\n missedPermissions.add(permission);\n }\n }\n\n if (!missedPermissions.isEmpty()) {\n final String[] permissions = new String[missedPermissions.size()];\n missedPermissions.toArray(permissions);\n\n ActivityCompat.requestPermissions(this, permissions, PERMISSION_REQUEST_CODE);\n }\n }", "@Override\n public void checkPermission(Permission perm, Object context) {\n }", "@Override\n public void onClick(View v) {\n if (Build.VERSION.SDK_INT >= 23)\n {\n if (permissionUtils.checkPermissions())\n {\n Log.e(TAG, \"Permission Is Not Granted. Request For Permission\");\n permissionUtils.askPermission();\n }\n else\n {\n Log.e(TAG, \"Permission Already Granted\");\n Intent intent = new Intent(RuntimePermissionActivity.this, PermissionGrantedActivity.class);\n startActivity(intent);\n finish();\n }\n }\n else\n {\n /*\n * Pre-Marshmallow\n * If build version is less than or 23, then all permission is\n * granted at install time in google play store.\n */\n Intent intent = new Intent(RuntimePermissionActivity.this, PermissionGrantedActivity.class);\n startActivity(intent);\n finish();\n }\n }", "@Test\n public void testDenialWithPrejudice() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CONTACTS));\n\n String[] permissions = new String[] {Manifest.permission.WRITE_CONTACTS};\n\n // Request the permission and deny it\n BasePermissionActivity.Result firstResult = requestPermissions(\n permissions, REQUEST_CODE_PERMISSIONS,\n BasePermissionActivity.class, () -> {\n try {\n clickDenyButton();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Expect the permission is not granted\n assertPermissionRequestResult(firstResult, REQUEST_CODE_PERMISSIONS,\n permissions, new boolean[] {false});\n\n // Request the permission and choose don't ask again\n BasePermissionActivity.Result secondResult = requestPermissions(new String[] {\n Manifest.permission.WRITE_CONTACTS}, REQUEST_CODE_PERMISSIONS + 1,\n BasePermissionActivity.class, () -> {\n try {\n denyWithPrejudice();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Expect the permission is not granted\n assertPermissionRequestResult(secondResult, REQUEST_CODE_PERMISSIONS + 1,\n permissions, new boolean[] {false});\n\n // Request the permission and do nothing\n BasePermissionActivity.Result thirdResult = requestPermissions(new String[] {\n Manifest.permission.WRITE_CONTACTS}, REQUEST_CODE_PERMISSIONS + 2,\n BasePermissionActivity.class, null);\n\n // Expect the permission is not granted\n assertPermissionRequestResult(thirdResult, REQUEST_CODE_PERMISSIONS + 2,\n permissions, new boolean[] {false});\n }", "private void requestPermission() {\n boolean shouldProvideRationale = ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (shouldProvideRationale) {\n Log.i(TAG, \"requestPermission: \" + \"Displaying the permission rationale\");\n // provide a way so that user can grant permission\n\n showSnackbar(R.string.warning_txt, android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startLocationPermissionRequest();\n }\n });\n\n } else {\n startLocationPermissionRequest();\n }\n }", "public void checkpermission()\n {\n permissionUtils.check_permission(permissions,\"Need GPS permission for getting your location\",1);\n }", "private boolean shouldAskBackgroundPermissions() {\n return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;\n }", "private boolean checkAndRequestPermissions() {\n\n List<String> listPermissionsNeeded = new ArrayList<>();\n /*if (camera != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.CAMERA);\n }\n\n if (wstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\n }\n\n if (rstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);\n }\n if (rphoneState != PackageManager.PERMISSION_GRANTED)\n {\n listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);\n }*/\n\n// if(cLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);\n// }\n//\n// if(fLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n// }\n\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray\n (new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n success();\n return true;\n }", "private void checkBluetoothPermissions() {\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {\n int permissionCheck = activity.checkSelfPermission(\"Manifest.permission.ACCESS_FINE_LOCATION\");\n permissionCheck += activity.checkSelfPermission(\"Manifest.permission.ACCESS_COARSE_LOCATION\");\n if (permissionCheck != 0) {\n\n ((Activity) activity).requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.ACCESS_COARSE_LOCATION},\n 1001); //Any number\n }\n } else {\n Log.d(TAG, \"checkBluetoothPermissions: No need to check permissions. SDK version < LOLLIPOP.\");\n }\n }", "private void checkPermissions(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n ActivityCompat.requestPermissions(this, new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.ACCESS_COARSE_LOCATION\n },PERMS_CALL_ID);\n\n }\n\n\n }", "private void permissionLocationRequest() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int hasLocationPermission = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);\n if (hasLocationPermission != PackageManager.PERMISSION_GRANTED) {\n if (!shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) {\n showMessageOKCancel(\"You need to allow access to Location\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n });\n }\n }\n\n }\n }", "private boolean m21858b(Context context, String str) {\n boolean z = false;\n try {\n if (VERSION.SDK_INT >= 23) {\n if (context.checkSelfPermission(str) == 0) {\n z = true;\n }\n return z;\n }\n if (context.checkCallingOrSelfPermission(str) == 0) {\n z = true;\n }\n return z;\n } catch (Throwable unused) {\n return false;\n }\n }", "static boolean checkPermissionAllowed(Context context, String permission) {\n if (android.os.Build.VERSION.SDK_INT >= 23) {\n boolean hasPermission = false;\n try {\n // Invoke checkSelfPermission method from Android 6 (API 23 and UP)\n java.lang.reflect.Method methodCheckPermission = Activity.class.getMethod(\"checkSelfPermission\", java.lang.String.class);\n Object resultObj = methodCheckPermission.invoke(context, permission);\n int result = Integer.parseInt(resultObj.toString());\n hasPermission = (result == PackageManager.PERMISSION_GRANTED);\n } catch (Exception ex) {\n\n }\n\n return hasPermission;\n } else {\n return true;\n }\n }", "private boolean checkAndRequestPermissions() {\n List<String> listPermissionsNeeded = new ArrayList<>();\n for (String pem : appPermissions){\n if (ContextCompat.checkSelfPermission(this, pem) != PackageManager.PERMISSION_GRANTED){\n listPermissionsNeeded.add(pem);\n }\n }\n\n //ask for non-granted permissions\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_REQUEST_CODE);\n return false;\n }\n return true;\n }", "private void requestInternetPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) mLayout.getContext(),\n Manifest.permission.INTERNET)) {\n // Provide an additional rationale to the user if the permission was not granted\n // and the user would benefit from additional context for the use of the permission.\n // Display a SnackBar with cda button to request the missing permission.\n Snackbar.make(mLayout, R.string.internet_access_required,\n Snackbar.LENGTH_INDEFINITE).setAction(R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n // Request the permission\n ActivityCompat.requestPermissions((Activity) mLayout.getContext(),\n new String[]{Manifest.permission.INTERNET},\n PERMISSION_REQUEST_INTERNET);\n }\n }).show();\n\n } else {\n Snackbar.make(mLayout, R.string.internet_unavailable, Snackbar.LENGTH_SHORT).show();\n // Request the permission. The result will be received in onRequestPermissionResult().\n ActivityCompat.requestPermissions((Activity) mLayout.getContext(),\n new String[]{Manifest.permission.INTERNET}, PERMISSION_REQUEST_INTERNET);\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }", "abstract public void getPermission();", "public void verifyAppPermissions() {\n boolean hasAll = true;\n mHasBluetoothPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH) == PackageManager.PERMISSION_GRANTED;\n mHasBluetoothAdminPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_ADMIN) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n\n if (!hasAll) {\n // We don't have permission so prompt the user\n ActivityCompat.requestPermissions(\n this,\n APP_PERMISSIONS,\n REQUEST_PERMISSIONS\n );\n }\n }", "private void requestPermission(){\r\n ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},1);\r\n }", "public interface PermissionManagerServiceInternal extends PermissionManagerInternal,\n LegacyPermissionDataProvider {\n /**\n * Check whether a particular package has been granted a particular permission.\n *\n * @param packageName the name of the package you are checking against\n * @param permissionName the name of the permission you are checking for\n * @param userId the user ID\n * @return {@code PERMISSION_GRANTED} if the permission is granted, or {@code PERMISSION_DENIED}\n * otherwise\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n int checkPermission(@NonNull String packageName, @NonNull String permissionName,\n @UserIdInt int userId);\n\n /**\n * Check whether a particular UID has been granted a particular permission.\n *\n * @param uid the UID\n * @param permissionName the name of the permission you are checking for\n * @return {@code PERMISSION_GRANTED} if the permission is granted, or {@code PERMISSION_DENIED}\n * otherwise\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n int checkUidPermission(int uid, @NonNull String permissionName);\n\n /**\n * Adds a listener for runtime permission state (permissions or flags) changes.\n *\n * @param listener The listener.\n */\n void addOnRuntimePermissionStateChangedListener(\n @NonNull OnRuntimePermissionStateChangedListener listener);\n\n /**\n * Removes a listener for runtime permission state (permissions or flags) changes.\n *\n * @param listener The listener.\n */\n void removeOnRuntimePermissionStateChangedListener(\n @NonNull OnRuntimePermissionStateChangedListener listener);\n\n /**\n * Get whether permission review is required for a package.\n *\n * @param packageName the name of the package\n * @param userId the user ID\n * @return whether permission review is required\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n boolean isPermissionsReviewRequired(@NonNull String packageName,\n @UserIdInt int userId);\n\n /**\n * Reset the runtime permission state changes for a package.\n *\n * TODO(zhanghai): Turn this into package change callback?\n *\n * @param pkg the package\n * @param userId the user ID\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void resetRuntimePermissions(@NonNull AndroidPackage pkg,\n @UserIdInt int userId);\n\n /**\n * Read legacy permission state from package settings.\n *\n * TODO(zhanghai): This is a temporary method because we should not expose\n * {@code PackageSetting} which is a implementation detail that permission should not know.\n * Instead, it should retrieve the legacy state via a defined API.\n */\n void readLegacyPermissionStateTEMP();\n\n /**\n * Write legacy permission state to package settings.\n *\n * TODO(zhanghai): This is a temporary method and should be removed once we migrated persistence\n * for permission.\n */\n void writeLegacyPermissionStateTEMP();\n\n /**\n * Get all the permissions granted to a package.\n *\n * @param packageName the name of the package\n * @param userId the user ID\n * @return the names of the granted permissions\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n @NonNull\n Set<String> getGrantedPermissions(@NonNull String packageName, @UserIdInt int userId);\n\n /**\n * Get the GIDs of a permission.\n *\n * @param permissionName the name of the permission\n * @param userId the user ID\n * @return the GIDs of the permission\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n @NonNull\n int[] getPermissionGids(@NonNull String permissionName, @UserIdInt int userId);\n\n /**\n * Get the packages that have requested an app op permission.\n *\n * @param permissionName the name of the app op permission\n * @return the names of the packages that have requested the app op permission\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n @NonNull\n String[] getAppOpPermissionPackages(@NonNull String permissionName);\n\n /** HACK HACK methods to allow for partial migration of data to the PermissionManager class */\n @Nullable\n Permission getPermissionTEMP(@NonNull String permName);\n\n /** Get all permissions that have a certain protection */\n @NonNull\n ArrayList<PermissionInfo> getAllPermissionsWithProtection(\n @PermissionInfo.Protection int protection);\n\n /** Get all permissions that have certain protection flags */\n @NonNull ArrayList<PermissionInfo> getAllPermissionsWithProtectionFlags(\n @PermissionInfo.ProtectionFlags int protectionFlags);\n\n /**\n * Start delegate the permission identity of the shell UID to the given UID.\n *\n * @param uid the UID to delegate shell permission identity to\n * @param packageName the name of the package to delegate shell permission identity to\n * @param permissionNames the names of the permissions to delegate shell permission identity\n * for, or {@code null} for all permissions\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void startShellPermissionIdentityDelegation(int uid,\n @NonNull String packageName, @Nullable List<String> permissionNames);\n\n /**\n * Stop delegating the permission identity of the shell UID.\n *\n * @see #startShellPermissionIdentityDelegation(int, String, List)\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void stopShellPermissionIdentityDelegation();\n\n /**\n * Get all delegated shell permissions.\n */\n @NonNull List<String> getDelegatedShellPermissions();\n\n /**\n * Read legacy permissions from legacy permission settings.\n *\n * TODO(zhanghai): This is a temporary method because we should not expose\n * {@code LegacyPermissionSettings} which is a implementation detail that permission should not\n * know. Instead, it should retrieve the legacy permissions via a defined API.\n */\n void readLegacyPermissionsTEMP(@NonNull LegacyPermissionSettings legacyPermissionSettings);\n\n /**\n * Write legacy permissions to legacy permission settings.\n *\n * TODO(zhanghai): This is a temporary method and should be removed once we migrated persistence\n * for permission.\n */\n void writeLegacyPermissionsTEMP(@NonNull LegacyPermissionSettings legacyPermissionSettings);\n\n /**\n * Callback when the system is ready.\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onSystemReady();\n\n /**\n * Callback when a storage volume is mounted, so that all packages on it become available.\n *\n * @param volumeUuid the UUID of the storage volume\n * @param fingerprintChanged whether the current build fingerprint is different from what it was\n * when this volume was last mounted\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onStorageVolumeMounted(@NonNull String volumeUuid, boolean fingerprintChanged);\n\n /**\n * Callback when a user has been created.\n *\n * @param userId the created user ID\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onUserCreated(@UserIdInt int userId);\n\n /**\n * Callback when a user has been removed.\n *\n * @param userId the removed user ID\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onUserRemoved(@UserIdInt int userId);\n\n /**\n * Callback when a package has been added.\n *\n * @param pkg the added package\n * @param isInstantApp whether the added package is an instant app\n * @param oldPkg the old package, or {@code null} if none\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onPackageAdded(@NonNull AndroidPackage pkg, boolean isInstantApp,\n @Nullable AndroidPackage oldPkg);\n\n /**\n * Callback when a package has been installed for a user.\n *\n * @param pkg the installed package\n * @param previousAppId the previous app ID if the package is leaving a shared UID,\n * or Process.INVALID_UID\n * @param params the parameters passed in for package installation\n * @param userId the user ID this package is installed for\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onPackageInstalled(@NonNull AndroidPackage pkg, int previousAppId,\n @NonNull PackageInstalledParams params,\n @UserIdInt int userId);\n\n /**\n * Callback when a package has been removed.\n *\n * @param pkg the removed package\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onPackageRemoved(@NonNull AndroidPackage pkg);\n\n /**\n * Callback when a package has been uninstalled.\n * <p>\n * The package may have been fully removed from the system, or only marked as uninstalled for\n * this user but still instlaled for other users.\n *\n * TODO: Pass PackageState instead.\n *\n * @param packageName the name of the uninstalled package\n * @param appId the app ID of the uninstalled package\n * @param pkg the uninstalled package, or {@code null} if unavailable\n * @param sharedUserPkgs the packages that are in the same shared user\n * @param userId the user ID the package is uninstalled for\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n void onPackageUninstalled(@NonNull String packageName, int appId, @Nullable AndroidPackage pkg,\n @NonNull List<AndroidPackage> sharedUserPkgs, @UserIdInt int userId);\n\n /**\n * Listener for package permission state (permissions or flags) changes.\n */\n interface OnRuntimePermissionStateChangedListener {\n\n /**\n * Called when the runtime permission state (permissions or flags) changed.\n *\n * @param packageName The package for which the change happened.\n * @param userId the user id for which the change happened.\n */\n @Nullable\n void onRuntimePermissionStateChanged(@NonNull String packageName,\n @UserIdInt int userId);\n }\n\n /**\n * The permission-related parameters passed in for package installation.\n *\n * @see android.content.pm.PackageInstaller.SessionParams\n */\n //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)\n final class PackageInstalledParams {\n /**\n * A static instance whose parameters are all in their default state.\n */\n public static final PackageInstalledParams DEFAULT = new Builder().build();\n\n @NonNull\n private final List<String> mGrantedPermissions;\n @NonNull\n private final List<String> mAllowlistedRestrictedPermissions;\n @NonNull\n private final int mAutoRevokePermissionsMode;\n\n private PackageInstalledParams(@NonNull List<String> grantedPermissions,\n @NonNull List<String> allowlistedRestrictedPermissions,\n int autoRevokePermissionsMode) {\n mGrantedPermissions = grantedPermissions;\n mAllowlistedRestrictedPermissions = allowlistedRestrictedPermissions;\n mAutoRevokePermissionsMode = autoRevokePermissionsMode;\n }\n\n /**\n * Get the permissions to be granted.\n *\n * @return the permissions to be granted\n */\n @NonNull\n public List<String> getGrantedPermissions() {\n return mGrantedPermissions;\n }\n\n /**\n * Get the restricted permissions to be allowlisted.\n *\n * @return the restricted permissions to be allowlisted\n */\n @NonNull\n public List<String> getAllowlistedRestrictedPermissions() {\n return mAllowlistedRestrictedPermissions;\n }\n\n /**\n * Get the mode for auto revoking permissions.\n *\n * @return the mode for auto revoking permissions\n */\n public int getAutoRevokePermissionsMode() {\n return mAutoRevokePermissionsMode;\n }\n\n /**\n * Builder class for {@link PackageInstalledParams}.\n */\n public static final class Builder {\n @NonNull\n private List<String> mGrantedPermissions = Collections.emptyList();\n @NonNull\n private List<String> mAllowlistedRestrictedPermissions = Collections.emptyList();\n @NonNull\n private int mAutoRevokePermissionsMode = AppOpsManager.MODE_DEFAULT;\n\n /**\n * Set the permissions to be granted.\n *\n * @param grantedPermissions the permissions to be granted\n *\n * @see android.content.pm.PackageInstaller.SessionParams#setGrantedRuntimePermissions(\n * java.lang.String[])\n */\n public void setGrantedPermissions(@NonNull List<String> grantedPermissions) {\n Objects.requireNonNull(grantedPermissions);\n mGrantedPermissions = new ArrayList<>(grantedPermissions);\n }\n\n /**\n * Set the restricted permissions to be allowlisted.\n * <p>\n * Permissions that are not restricted are ignored, so one can just pass in all\n * requested permissions of a package to get all its restricted permissions allowlisted.\n *\n * @param allowlistedRestrictedPermissions the restricted permissions to be allowlisted\n *\n * @see android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)\n */\n public void setAllowlistedRestrictedPermissions(\n @NonNull List<String> allowlistedRestrictedPermissions) {\n Objects.requireNonNull(mGrantedPermissions);\n mAllowlistedRestrictedPermissions = new ArrayList<>(\n allowlistedRestrictedPermissions);\n }\n\n /**\n * Set the mode for auto revoking permissions.\n * <p>\n * {@link AppOpsManager#MODE_ALLOWED} means the system is allowed to auto revoke\n * permissions from this package, and {@link AppOpsManager#MODE_IGNORED} means this\n * package should be ignored when auto revoking permissions.\n * {@link AppOpsManager#MODE_DEFAULT} means no changes will be made to the auto revoke\n * mode of this package.\n *\n * @param autoRevokePermissionsMode the mode for auto revoking permissions\n *\n * @see android.content.pm.PackageInstaller.SessionParams#setAutoRevokePermissionsMode(\n * boolean)\n */\n public void setAutoRevokePermissionsMode(int autoRevokePermissionsMode) {\n mAutoRevokePermissionsMode = autoRevokePermissionsMode;\n }\n\n /**\n * Build a new instance of {@link PackageInstalledParams}.\n *\n * @return the {@link PackageInstalledParams} built\n */\n @NonNull\n public PackageInstalledParams build() {\n return new PackageInstalledParams(mGrantedPermissions,\n mAllowlistedRestrictedPermissions, mAutoRevokePermissionsMode);\n }\n }\n }\n\n /**\n * Sets the provider of the currently active HotwordDetectionService.\n *\n * @see HotwordDetectionServiceProvider\n */\n void setHotwordDetectionServiceProvider(@Nullable HotwordDetectionServiceProvider provider);\n\n /**\n * Gets the provider of the currently active HotwordDetectionService.\n *\n * @see HotwordDetectionServiceProvider\n */\n @Nullable\n HotwordDetectionServiceProvider getHotwordDetectionServiceProvider();\n\n /**\n * Provides the uid of the currently active\n * {@link android.service.voice.HotwordDetectionService}, which should be granted RECORD_AUDIO,\n * CAPTURE_AUDIO_HOTWORD and CAPTURE_AUDIO_OUTPUT permissions.\n */\n interface HotwordDetectionServiceProvider {\n int getUid();\n }\n}", "private void requestCameraPermission(){\n requestPermissions(cameraPermissions, CAMERA_REQUESTED_CODE);\n }", "public static void requestAppPermissions(Activity activity){\n String s = com.combustiongroup.burntout.Manifest.permission.C2D_MESSAGE;\n // Here, thisActivity is the current activity\n if (ContextCompat.checkSelfPermission(activity,\n android.Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity,\n Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED ) {\n\n\n ActivityCompat.requestPermissions(activity,\n new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.CAMERA},\n PermissionsRequestCode);\n\n }\n }", "private boolean requrstpermission(){\r\n if(ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED){\r\n return true;\r\n }\r\n else {\r\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, IMAGEREQUESTCODE);\r\n return false;\r\n }\r\n }", "private void permissionChecks() {\n if(Build.VERSION.SDK_INT < 23)\n return;\n\n if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, 0);\n }\n }", "private void checkAndRequestForPermission() {\n if(ContextCompat.checkSelfPermission(RegisterActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED){\n if(ActivityCompat.shouldShowRequestPermissionRationale(RegisterActivity.this,\n Manifest.permission.READ_EXTERNAL_STORAGE)){\n Toast.makeText(RegisterActivity.this, \"Please accept for required permission\",\n Toast.LENGTH_SHORT).show();\n }\n else{\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String []{Manifest.permission.READ_EXTERNAL_STORAGE},PReqCode);\n }\n }\n else{\n openGallery();\n }\n }", "public boolean checkPermission(Permission permission);", "public void requestPermissionsIfNeeded() {\n ArrayList<String> requiredPermissions = new ArrayList<String>();\n checkIfPermissionGranted(requiredPermissions, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n checkIfPermissionGranted(requiredPermissions, Manifest.permission.CAMERA);\n\n if(requiredPermissions.size() > 0) {\n // Request Permissions Now\n ActivityCompat.requestPermissions(activity,\n requiredPermissions.toArray(new String[requiredPermissions.size()]),\n Constants.REQUEST_PERMISSIONS);\n }\n }", "public boolean isAllGranted(){\n //PackageManager.PERMISSION_GRANTED\n return false;\n }", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_ACCESS_FINE_LOCATION);\n\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_ACCESS_COARSE_LOCATION);\n } else {\n isPermission = true;\n }\n }", "private void checkPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED){\n\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.CAMERA}, 56);\n }\n }", "private void requestPermissions() {\n String[] PERMISSIONS = {android.Manifest.permission.WRITE_EXTERNAL_STORAGE};\r\n ActivityCompat.requestPermissions(this, PERMISSIONS, 112);\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n // Check for GPS usage permission\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED\r\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n }\r\n }", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\r\n PERMISSIONS_ACCESS_FINE_LOCATION);\r\n\r\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED){\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\r\n PERMISSIONS_ACCESS_COARSE_LOCATION);\r\n } else {\r\n isPermission = true;\r\n }\r\n }", "private Boolean checkRuntimePermission() {\n List<String> permissionsNeeded = new ArrayList<String>();\n\n final List<String> permissionsList = new ArrayList<String>();\n if (!addPermission(permissionsList, Manifest.permission.READ_EXTERNAL_STORAGE))\n permissionsNeeded.add(\"Storage\");\n if (!addPermission(permissionsList, Manifest.permission.CAMERA))\n permissionsNeeded.add(\"Camera\");\n /* if (!addPermission(permissionsList, Manifest.permission.WRITE_CONTACTS))\n permissionsNeeded.add(\"Write Contacts\");*/\n\n if (permissionsList.size() > 0) {\n if (permissionsNeeded.size() > 0) {\n // Need Rationale\n String message = \"You need to grant access to \" + permissionsNeeded.get(0);\n for (int i = 1; i < permissionsNeeded.size(); i++)\n message = message + \", \" + permissionsNeeded.get(i);\n showMessageOKCancel(message,\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n }\n });\n return false;\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n return false;\n }\n return true;\n }", "@Test\n public void testRequestPermissionFromTwoGroups() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CONTACTS));\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CALENDAR));\n\n String[] permissions = new String[] {\n Manifest.permission.WRITE_CONTACTS,\n Manifest.permission.WRITE_CALENDAR\n };\n\n // Request the permission and do nothing\n BasePermissionActivity.Result result = requestPermissions(permissions,\n REQUEST_CODE_PERMISSIONS, BasePermissionActivity.class, () -> {\n try {\n clickAllowButton();\n getUiDevice().waitForIdle();\n clickAllowButton();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Expect the permission is not granted\n assertPermissionRequestResult(result, REQUEST_CODE_PERMISSIONS,\n permissions, new boolean[] {true, true});\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n public void requestPermissionLlamada() {\n //shouldShowRequestPermissionRationale es verdadero solamente si ya se había mostrado\n //anteriormente el dialogo de permisos y el usuario lo negó\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.CALL_PHONE)) {\n } else {\n //si es la primera vez se solicita el permiso directamente\n requestPermissions(new String[]{Manifest.permission.CALL_PHONE},\n MY_WRITE_EXTERNAL_STORAGE);\n }\n }", "private boolean checkPermission() {\n if (Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n return false;\n } else {\n return true;// Permission has already been granted }\n }\n }", "private void showRequestPermissionRationale() {\n final AlertDialog dialog = new AlertDialog.Builder(this)\n .setMessage(\"WiFiAugumentedReality requires camera permission\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n ActivityCompat.requestPermissions(WiFiAugmentedRealityActivity.this,\n new String[]{CAMERA_PERMISSION}, CAMERA_PERMISSION_CODE);\n }\n })\n .create();\n dialog.show();\n }", "public void checkPermission() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) +\n ContextCompat.checkSelfPermission(this, Manifest.permission.MODIFY_AUDIO_SETTINGS)\n != PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(this, perms, permsRequestCode);\n permissionGranted = false;\n } else {\n permissionGranted = true;\n }\n }", "@Test\n public void testRequestGrantedPermission() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CONTACTS));\n\n String[] permissions = new String[] {Manifest.permission.WRITE_CONTACTS};\n\n // Request the permission and allow it\n BasePermissionActivity.Result firstResult = requestPermissions(permissions,\n REQUEST_CODE_PERMISSIONS,\n BasePermissionActivity.class, () -> {\n try {\n clickAllowButton();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Expect the permission is granted\n assertPermissionRequestResult(firstResult, REQUEST_CODE_PERMISSIONS,\n permissions, new boolean[] {true});\n\n // Request the permission and do nothing\n BasePermissionActivity.Result secondResult = requestPermissions(new String[] {\n Manifest.permission.WRITE_CONTACTS}, REQUEST_CODE_PERMISSIONS + 1,\n BasePermissionActivity.class, null);\n\n // Expect the permission is granted\n assertPermissionRequestResult(secondResult, REQUEST_CODE_PERMISSIONS + 1,\n permissions, new boolean[] {true});\n }", "private boolean checkPermission() {\n int fineLocation = ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (fineLocation != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQUEST_CODE_FINE_LOCATION);\n }\n return false;\n } else {\n return true;\n }\n }", "private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), READ_CONTACTS);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA);\r\n int result2 = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\r\n int result3 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\r\n int result4 = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result5 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_PHONE_STATE);\r\n int result6 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n int result7 = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\r\n //int result8 = ContextCompat.checkSelfPermission(getApplicationContext(), BLUETOOTH);\r\n\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED && result2 == PackageManager.PERMISSION_GRANTED &&\r\n result3 == PackageManager.PERMISSION_GRANTED && result4 == PackageManager.PERMISSION_GRANTED && result5 == PackageManager.PERMISSION_GRANTED &&\r\n result6 == PackageManager.PERMISSION_GRANTED && result7 == PackageManager.PERMISSION_GRANTED/*&& result8== PackageManager.PERMISSION_GRANTED*/;\r\n }", "void checkPermission(T request) throws AuthorizationException;", "public void checkPermission(String permission, int requestCode)\n {\n if (ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_DENIED) {\n // Requesting the permission\n ActivityCompat.requestPermissions(this, new String[] { permission }, requestCode);\n }\n else {\n Toast.makeText(this, \"Permission already granted\", Toast.LENGTH_SHORT).show();\n }\n }", "public void requestCameraPermission() {\n int currentapiVersion = Build.VERSION.SDK_INT;\n if (currentapiVersion >= Build.VERSION_CODES.M) {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n }\n }\n }\n }", "private void requestCameraPermission(){\n if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, //has the user already denied the permission?\n Manifest.permission.CAMERA)) {\n //show explanation to user\n Toast.makeText(this, \"Camera permission needed to scan QR codes\", Toast.LENGTH_LONG).show();\n //request the permission\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.CAMERA},\n CAMERA_PERMISSION_CODE);\n } else {\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.CAMERA},\n CAMERA_PERMISSION_CODE);\n\n // CAMERA_PERMISSION_CODE is an\n // app-defined int constant. The onRequestPermissionsResult method gets the code\n }\n }", "@Override\n public void onRequestRefuse(String permissionName) {\n }", "public static void requestPermission(Activity act, PermissionsMapping pm){\n if (ContextCompat.checkSelfPermission(act, pm.permission[0])\n != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(act, pm.permission[0])) {\n ActivityCompat.requestPermissions(act, pm.permission, pm.requestCode);\n } else {\n ActivityCompat.requestPermissions(act, pm.permission, pm.requestCode);\n }\n }\n }", "private void getLocationPermission(){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationAccess = true;\n } else {\n locationAccess = false;\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION_PERMISSION);\n }\n }", "private boolean mayRequestStoragePermission() {\r\n\r\n if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)\r\n return true;\r\n\r\n if((checkSelfPermission(WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) &&\r\n (checkSelfPermission(CAMERA) == PackageManager.PERMISSION_GRANTED))\r\n return true;\r\n\r\n if((shouldShowRequestPermissionRationale(WRITE_EXTERNAL_STORAGE)) || (shouldShowRequestPermissionRationale(CAMERA))){\r\n Snackbar.make(mRlView, \"Los permisos son necesarios para poder usar la aplicación\",\r\n Snackbar.LENGTH_INDEFINITE).setAction(android.R.string.ok, new View.OnClickListener() {\r\n @TargetApi(Build.VERSION_CODES.M)\r\n @Override\r\n public void onClick(View v) {\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n });\r\n }else{\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n\r\n return false;\r\n }", "public void getPermissiontoAccessInternet() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.INTERNET)\n != PackageManager.PERMISSION_GRANTED) {\n\n // The permission is NOT already granted.\n // Check if the user has been asked about this permission already and denied\n // it. If so, we want to give more explanation about why the permission is needed.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.INTERNET)) {\n // Show our own UI to explain to the user why we need to read the contacts\n // before actually requesting the permission and showing the default UI\n }\n\n // Fire off an async request to actually get the permission\n // This will show the standard permission request dialog UI\n ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.INTERNET},\n INTERNET_PERMISSIONS_REQUEST);\n }\n }", "void configure_button(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n\n }", "private void locationPermission() {\n if(Build.VERSION.SDK_INT<23){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n }else{\n if(checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n return;\n }\n\n if(shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_COARSE_LOCATION) && shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)){\n Snackbar.make(drawer,\"Location access is required to show your friend and questions on map.\",Snackbar.LENGTH_INDEFINITE)\n .setAction(\"OK\", new View.OnClickListener() {\n @TargetApi(Build.VERSION_CODES.M)\n @Override\n public void onClick(View v) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n })\n .show();\n }else{\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n }\n }", "private void checkPermissions() {\n List<String> permissions = new ArrayList<>();\n String message = \"osmdroid permissions:\";\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n message += \"\\nLocation to show user location.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n message += \"\\nStorage access to store map tiles.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.READ_PHONE_STATE);\n message += \"\\n access to read phone state.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.RECEIVE_SMS);\n message += \"\\n access to receive sms.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.GET_ACCOUNTS);\n message += \"\\n access to read sms.\";\n //requestReadPhoneStatePermission();\n }\n if (!permissions.isEmpty()) {\n // Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n String[] params = permissions.toArray(new String[permissions.size()]);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(params, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n } // else: We already have permissions, so handle as normal\n }", "private void requestPermission() {\n\n ActivityCompat.requestPermissions(CalltoVendor.this, new String[]\n {\n CALL_PHONE\n }, RequestPermissionCode);\n }", "boolean ignoresPermission();", "private void requestCameraPermission() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {\n Toast.makeText(this, \"No Permissions\" , Toast.LENGTH_LONG).show();\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}, 0);\n }\n else\n {\n Toast.makeText(this, \"Has Permissions\" , Toast.LENGTH_LONG).show();\n }\n }", "private boolean checkPermissions() {\n boolean permissionGrant = false;\n if (Build.VERSION.SDK_INT >= 23 && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions((Activity) this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQUEST_CODE_ACCESS_COARSE_LOCATION);\n } else {\n permissionGrant = true;\n }\n return permissionGrant;\n\n }", "private void requestPermissions(){\n Intent intent = new Intent(this.getApplication(), MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n startActivity(intent);\r\n }", "private boolean checkAndRequestPermissions() {\n int locationPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n List<String> listPermissionsNeeded = new ArrayList<>();\n if (locationPermission != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n }\n// if (permissionSendMessage != PackageManager.PERMISSION_GRANTED) {\n// listPermissionsNeeded.add(Manifest.permission.SEND_SMS);\n// }\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n return true;\n }", "public interface PermissionsManager {\n /**\n * @param permission for which to enquire\n *\n * @return whether the permission is granted.\n */\n boolean isPermissionGranted(Permission permission);\n\n /**\n * Checks whether the permission was already granted, and if it was not, then it requests.\n *\n * @param activity to provide mContext\n * @param permission for which to enquire\n *\n * @return whether the permission was already granted.\n */\n boolean requestIfNeeded(Activity activity, Permission permission);\n}", "public boolean hasPerms()\n {\n return ContextCompat.checkSelfPermission(itsActivity, itsPerm) ==\n PackageManager.PERMISSION_GRANTED;\n }", "private void requestPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{\n Manifest.permission.CAMERA}, 1);\n //if not permitted by the user ,send a message to the user to get the right\n } else {\n opencamera();\n //if permitted by the user already ,then start open the camera directly\n }\n }", "private void checkPermission(int requestCode)\n {\n int permissionCheck = 0;\n\n if (requestCode == Constants.FILE_CHOOSER)\n {\n permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n if (permissionCheck != PackageManager.PERMISSION_GRANTED)\n {\n ActivityCompat.requestPermissions(\n this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Constants.FILE_CHOOSER);\n } else\n {\n pickImage();\n }\n } else\n {\n permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);\n\n if (permissionCheck != PackageManager.PERMISSION_GRANTED)\n {\n ActivityCompat.requestPermissions(\n this, new String[]{Manifest.permission.CAMERA}, CAMERA_PIC_REQUEST);\n } else\n {\n openCamera();\n }\n }\n }", "@Test\n public void testRuntimeGroupGrantSpecificity() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CONTACTS));\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.READ_CONTACTS));\n\n String[] permissions = new String[] {Manifest.permission.WRITE_CONTACTS};\n\n // request only one permission from the 'contacts' permission group\n BasePermissionActivity.Result result = requestPermissions(permissions,\n REQUEST_CODE_PERMISSIONS,\n BasePermissionActivity.class,\n () -> {\n try {\n clickAllowButton();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Expect the permission is granted\n assertPermissionRequestResult(result, REQUEST_CODE_PERMISSIONS,\n permissions, new boolean[] {true});\n\n // Make sure no undeclared as used permissions are granted\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.READ_CONTACTS));\n }", "void configure_permissions() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}\n , 10);\n }\n return;\n }\n }", "private void checkPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)\n != PackageManager.PERMISSION_GRANTED) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this)\n .setMessage(getString(R.string.can_not_handle_calls))\n .setCancelable(false)\n .setPositiveButton(R.string.text_ok, (dialog, id) -> {\n requestPermission();\n });\n\n builder.create().show();\n } else {\n presenter.gotPermissions = true;\n }\n }", "@Test\n public void testRevokePropagatedOnUpgradeNewToNewModel_part1() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.READ_CALENDAR));\n\n // Request the permission and allow it\n BasePermissionActivity.Result thirdResult = requestPermissions(new String[] {\n Manifest.permission.READ_CALENDAR}, REQUEST_CODE_PERMISSIONS,\n BasePermissionActivity.class, () -> {\n try {\n clickAllowButton();\n getUiDevice().waitForIdle();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n });\n\n // Make sure the permission is granted\n assertPermissionRequestResult(thirdResult, REQUEST_CODE_PERMISSIONS,\n new String[] {Manifest.permission.READ_CALENDAR}, new boolean[] {true});\n }", "public void requestPermissions(ArrayList<String> needPermissions) {\n\n String packageName = getApplicationContext().getPackageName();\n Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse(\"package:\" + packageName) );\n startActivityForResult(intent, REQ_CODE_REQUEST_SETTING);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n private void requestCameraPermission() {\n requestPermissions(cameraPermissions, CAMERA_REQUEST_CODE);\n }", "public boolean supportsPreemptiveAuthorization() {\n/* 225 */ return true;\n/* */ }", "@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 }", "private void checkIfPermissionGranted() {\n\n //if user already allowed the permission, this condition will be true\n if (ContextCompat.checkSelfPermission(this, PERMISSION_CODE)\n == PackageManager.PERMISSION_GRANTED) {\n Intent launchIntent = getPackageManager().getLaunchIntentForPackage(\"com.example.a3\");\n if (launchIntent != null) {\n startActivity(launchIntent);//null pointer check in case package name was not found\n }\n }\n //if user didn't allow the permission yet, then ask for permission\n else {\n ActivityCompat.requestPermissions(this, new String[]{PERMISSION_CODE}, 0);\n }\n }", "private boolean checkPermissions(String permissionStr, int requestCode) {\n // Check to see if we have permission to access something,\n // such like the microphone.\n int permission = ActivityCompat.checkSelfPermission(\n HotwordDetectionActivity.this,\n permissionStr);\n\n if (permission != PackageManager.PERMISSION_GRANTED) {\n // We can not access it, request authorization from the user.\n ActivityCompat.requestPermissions(\n HotwordDetectionActivity.this,\n new String[] {permissionStr},\n requestCode\n );\n return false;\n } else {\n return true;\n }\n }", "private boolean checkPermissions(HttpServletRequest request, RouteAction route) {\n\t\treturn true;\n\t}", "public boolean checkPermissions(String check)\n {\n Log.d(TAG,\"check single PErmission\");\n int permissionRequest= ActivityCompat.checkSelfPermission(UploadActivity.this,check);\n if(permissionRequest!= PackageManager.PERMISSION_GRANTED)\n {\n Log.d(TAG,\"check PErmission\\nPermission was not granted for:\"+check);\n return false;\n }\n else\n {\n Log.d(TAG,\"check PErmission\\nPermission was granted for:\"+check);\n return true;\n }\n\n }", "public void requestPermissions() {\n readPermission = ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.READ_EXTERNAL_STORAGE);\n writePermission = ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\n if (!(readPermission == PERMISSION_REQUEST_READ_STORAGE)) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_READ_STORAGE);\n } else {\n makeImageMandatory = true;\n }\n if (!(writePermission == PERMISSION_REQUEST_WRITE_STORAGE)) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_WRITE_STORAGE);\n }\n }", "void permissionDenied(int requestCode, boolean willShowCheckBoxNextTime);", "private void getLocationPermission(){\n Log.d(TAG, \"getLocationPermission: getting location permission.\");\n String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n COURSE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n mLocationPermissionGaranted = true;\n getDeviceLocation();\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "public void checkLocationPermission() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n 99);\n }\n\n }", "public void requestPermission() {\n ActivityCompat.requestPermissions(MainActivity.this, new String[]{\n Manifest.permission.CAMERA,\n Manifest.permission.READ_CONTACTS\n }, RequestPermissionCode);\n }" ]
[ "0.7178496", "0.69727165", "0.6871894", "0.6674945", "0.66586417", "0.6579265", "0.6567014", "0.6548381", "0.6484501", "0.64666986", "0.6455922", "0.6446334", "0.64156866", "0.6373044", "0.6366993", "0.63390034", "0.6284504", "0.6284409", "0.62769896", "0.62489605", "0.6236072", "0.6231039", "0.62178963", "0.6212234", "0.6208921", "0.6203541", "0.61655545", "0.6156737", "0.6141355", "0.61406446", "0.6136897", "0.613049", "0.6125476", "0.6094206", "0.60773546", "0.60738415", "0.60725784", "0.606852", "0.6067034", "0.6053211", "0.6049164", "0.6049093", "0.6045206", "0.60445005", "0.60443777", "0.6041847", "0.60384744", "0.6034693", "0.60309994", "0.6026426", "0.6004584", "0.6002107", "0.6002003", "0.60014474", "0.59854406", "0.59848243", "0.5976361", "0.5974303", "0.5969423", "0.5967002", "0.5952668", "0.5947764", "0.5947161", "0.5946927", "0.5934141", "0.59331423", "0.5925078", "0.5924063", "0.5917888", "0.59018654", "0.59016913", "0.5896492", "0.5893309", "0.5889569", "0.5884331", "0.5880443", "0.5880312", "0.5876163", "0.5874246", "0.5870859", "0.5870002", "0.58609724", "0.5856459", "0.5856081", "0.58558816", "0.58544385", "0.58502847", "0.5842519", "0.5839397", "0.583758", "0.5835992", "0.58308464", "0.582127", "0.5817985", "0.5816841", "0.581344", "0.58111084", "0.58009243", "0.5796179", "0.5789493" ]
0.6295002
16
delegate to configuration initializing method
protected void applicationInitalize() throws OwConfigurationException, OwServerException { OwConfiguration.applicationInitalize(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initialConfig() {\n }", "protected abstract void initializeImpl(Map<String,String> configuration);", "protected abstract void _init(DynMap config);", "public synchronized static void initConfig() {\n SeLionLogger.getLogger().entering();\n Map<ConfigProperty, String> initialValues = new HashMap<>();\n\n initConfig(initialValues);\n\n SeLionLogger.getLogger().exiting();\n }", "private void init() {\r\n this.configMapping = ChannelConfigHolder.getInstance().getConfigs();\r\n if (!isValid(this.configMapping)) {\r\n SystemExitHelper.exit(\"Cannot load the configuations from the configuration file please check the channelConfig.xml\");\r\n }\r\n }", "public static void initialize() {\n \tinitialize(new Configuration().configure());\n }", "public synchronized static void initConfig() {\n\t\tMap<CatPawConfigProperty, String> initialValues = new HashMap<CatPawConfigProperty, String>();\n\t\tinitConfig(initialValues);\n\t}", "private void initConfiguration() {\n\t\tseedList = new ArrayList<String>();\n\t\t// TODO: add other initialization here...\n\t}", "void init(Config config);", "@Override\n public void init() throws Exception {\n config = new Config();\n }", "private void config() {\n\t}", "@Override\n public void init()\n throws InitializationException\n {\n // Create a default configuration.\n String[] def = new String[]\n {\n DEFAULT_RUN_DATA,\n DEFAULT_PARAMETER_PARSER,\n DEFAULT_COOKIE_PARSER\n };\n configurations.put(DEFAULT_CONFIG, def.clone());\n\n // Check other configurations.\n Configuration conf = getConfiguration();\n if (conf != null)\n {\n String key,value;\n String[] config;\n String[] plist = new String[]\n {\n RUN_DATA_KEY,\n PARAMETER_PARSER_KEY,\n COOKIE_PARSER_KEY\n };\n for (Iterator<String> i = conf.getKeys(); i.hasNext();)\n {\n key = i.next();\n value = conf.getString(key);\n int j = 0;\n for (String plistKey : plist)\n {\n if (key.endsWith(plistKey) && key.length() > plistKey.length() + 1)\n {\n key = key.substring(0, key.length() - plistKey.length() - 1);\n config = (String[]) configurations.get(key);\n if (config == null)\n {\n config = def.clone();\n configurations.put(key, config);\n }\n config[j] = value;\n break;\n }\n j++;\n }\n }\n }\n\n\t\tpool = (PoolService)TurbineServices.getInstance().getService(PoolService.ROLE);\n\n if (pool == null)\n {\n throw new InitializationException(\"RunData Service requires\"\n + \" configured Pool Service!\");\n }\n\n parserService = (ParserService)TurbineServices.getInstance().getService(ParserService.ROLE);\n\n if (parserService == null)\n {\n throw new InitializationException(\"RunData Service requires\"\n + \" configured Parser Service!\");\n }\n\n setInit(true);\n }", "public void init(Map<String, String> configuration);", "@Override\n public void setupConfiguration(Configuration config)\n {\n\n }", "public void init() {\n if (getConfig().isEnabled()) {\n super.init();\n }\n }", "private Config() {\n }", "void initialize(C config);", "@Override\n public void initialize(ServerConfiguration config) {\n }", "protected void initialize() {}", "protected void initialize() {}", "void init (Map<String, String> conf) throws ConfigException;", "private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }", "public void init() {\n \t\tif (initLock.start()) {\n \t\t\ttry {\n \t\t\t\tthis._init(this.config);\n \t\t\t} finally {\n \t\t\t\tinitLock.end();\n \t\t\t}\n \t\t}\n \t}", "protected abstract void initialize();", "protected void initialize() {\n \t\n }", "protected void initialize()\n\t{\n\t}", "@Override\r\n public void initialize(Bootstrap<Configuration> bootstrap) {\n }", "private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }", "public void loadConfig() {\n\t}", "public static void initConfig()\r\n {\r\n try\r\n {\r\n ip = ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_IP\");\r\n localIP = ConfigProperties.getKey(ConfigList.BASIC, \"Local_IP\");\r\n port = Integer.parseInt(ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_PORT\"));\r\n }\r\n catch (NumberFormatException e)\r\n {\r\n log.error(\"read properties failed --\", e);\r\n }\r\n }", "public abstract void initialize();", "public abstract void initialize();", "public abstract void initialize();", "protected void initialize() {\n\n\t}", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize()\r\n {\n }", "private void configInit() {\r\n\t\tconfig = pluginInstance.getConfiguration();\r\n\t\tif (!new File(pluginInstance.getDataFolder().getPath() + File.separator + \"config.yml\")\r\n\t\t\t\t.exists()) {\r\n\t\t\tconfig.setProperty(\"reset-deathloc\", true);\r\n\t\t\tconfig.setProperty(\"use-iConomy\", true);\r\n\t\t\tconfig.setProperty(\"creation-price\", 10.0D);\r\n\t\t\tconfig.setProperty(\"deathtp-price\", 50.0D);\r\n\t\t\tconfig.setProperty(\"allow-tp\", true);\r\n\t\t\tconfig.setProperty(\"maxTombStone\", 0);\r\n\t\t\tconfig.setProperty(\"TombKeyword\", \"[Tomb]\");\r\n\t\t\tconfig.setProperty(\"use-tombAsSpawnPoint\", true);\r\n\t\t\tconfig.setProperty(\"cooldownTp\", 5.0D);\r\n\t\t\tconfig.setProperty(\"reset-respawn\", false);\r\n\t\t\tconfig.setProperty(\"maxDeaths\", 0);\r\n\t\t\tconfig.save();\r\n\t\t\tworkerLog.info(\"Config created\");\r\n\t\t}\r\n\t\tconfig.load();\r\n\t}", "protected void initialize() {\r\n }", "protected void initialize() {\r\n }", "public Config() {\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t}", "private void initialiseByHand() {\n Configuration production = new Configuration(\"api.example.com\", false, 2000);\n Configuration staging = new Configuration(\"api-staging.example.com\", false, 2000);\n Configuration debug = new Configuration(\"api-dev.example.com\", true, 1000);\n Map<String, Configuration> baseVariants = new HashMap<>();\n baseVariants.put(PRODUCTION, production);\n baseVariants.put(STAGING, staging);\n baseVariants.put(DEBUG, debug);\n Neanderthal.initialise(this, baseVariants, PRODUCTION);\n }", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\n }", "protected Configuration() {\r\n }", "@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}", "@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void init(EndpointConfig arg0) {\n\t\t\r\n\t}", "private void initialize() {\n }", "public void initialize() {\n final ConfigurationManager config = ConfigurationManager.getInstance();\n boolean overrideLog = System.getProperty(\"azureus.overridelog\") != null;\n\n for (int i = 0; i < ignoredComponents.length; i++) {\n ignoredComponents[i] = new ArrayList();\n }\n\n if (!overrideLog) {\n config.addListener(new COConfigurationListener() {\n public void configurationSaved() {\n checkLoggingConfig();\n }\n });\n }\n\n checkLoggingConfig();\n config.addParameterListener(CFG_ENABLELOGTOFILE, new ParameterListener() {\n public void parameterChanged(String parameterName) {\n FileLogging.this.reloadLogToFileParam();\n }\n });\n }", "void configure();", "protected void initialize() {\n\t}", "@Override\n public void initialize(Map<String, String> configuration) {\n userToMap = configuration.get(\"UserToMap\");\n realmToMapTo = configuration.get(\"RealmToMapTo\");\n }", "public void init(JSONObject config) throws Exception {\n\n }", "private void initialize() {\n\t}", "public void init(EndpointConfig arg0) {\n\t\t\n\t}", "abstract protected void initialize();", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "private void initialize() {\n\t\t\n\t}", "private void init() {\n String METHOD = Thread.currentThread().getStackTrace()[1].getMethodName();\n String msg = null;\n String type = ConstantsIF.RESOURCE;\n ConfigurationIF config = null;\n JSONObject json = null;\n Map<String, String> map = null;\n\n _logger.entering(CLASS, METHOD);\n\n /*\n * Get JSON data from the Config object via the Config Manager\n */\n config = _configMgr.getConfiguration(type);\n\n if (config != null) {\n json = config.getJSON();\n if (json == null) {\n msg = CLASS + \": \" + METHOD + \": JSON data for '\" + type + \"' is null\";\n this.setError(true);\n }\n } else {\n msg = CLASS + \": \" + METHOD + \": Configuration for '\" + type + \"' is null\";\n this.setError(true);\n }\n\n /*\n * setup the Mongo Data Access Object\n */\n if (_MongoDAO == null) {\n map = JSON.convertToParams(JSON.getObject(json, ConfigIF.RS_NOSQL));\n\n try {\n _MongoDAO = MongoFactory.getInstance(map);\n } catch (Exception ex) {\n msg = CLASS + \": \" + METHOD + \": Mongo DAO:\" + ex.getMessage();\n this.setError(true);\n }\n }\n\n if (!this.isError()) {\n this.setState(STATE.READY);\n } else {\n this.setState(STATE.ERROR);\n this.setStatus(msg);\n _logger.log(Level.SEVERE, msg);\n }\n\n _logger.exiting(CLASS, METHOD);\n\n return;\n }", "abstract void initialize();", "abstract void initialize();", "private void initalConfig() {\n \t\tconfig = new Configuration(new File(getDataFolder(),\"BeardStat.yml\"));\n \t\tconfig.load();\n \t\tconfig.setProperty(\"stats.database.type\", \"mysql\");\n \t\tconfig.setProperty(\"stats.database.host\", \"localhost\");\n \t\tconfig.setProperty(\"stats.database.username\", \"Beardstats\");\n \t\tconfig.setProperty(\"stats.database.password\", \"changeme\");\n \t\tconfig.setProperty(\"stats.database.database\", \"stats\");\n \n \t\tconfig.save();\n \t}", "public void initialize() {\n\t}", "public void initialize() {\n\t}", "public void initialize()\n {\n }", "public void initialize() {\n }", "public MecBasicsConfig()\n {\n\n }", "private static void initConfig() {\n /*\n * Human IO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Joysticks\n */\n {\n addToConstants(\"joysticks.left\", 0);\n addToConstants(\"joysticks.right\", 1);\n addToConstants(\"joysticks.operator\", 2);\n }\n\n /*\n * Buttons and axis\n */\n {\n }\n }\n }\n\n /*\n * RobotIO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Kicker\n */\n addToConstantsA(\"kicker.encoder.distPerPulse\", 360.0 / 1024.0);\n }\n }\n\n /*\n * Chassis\n */\n {\n /*\n * Constants\n */\n {\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Kicker\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"kicker.kick.normal\", 1.75);\n addToConstants(\"kicker.kick.timeout\", 0.75);\n\n addToConstants(\"kicker.shaken.voltage\", -0.3316);\n addToConstants(\"kicker.shaken.tolerance\", 3.0);\n\n addToConstants(\"kicker.zero.voltage\", 0.8);\n addToConstants(\"kicker.zero.duration\", 0.75);\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Gripper\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"gripper.collection.voltage\", 0.82);\n addToConstants(\"gripper.ejection.voltage\", -0.45);\n }\n }\n }", "public CrawlerConfiguration() {\n\t\tinitConfiguration();\n\t}", "void setConfiguration();", "public void init() {\n // the config string contains just the asset store directory path\n //set baseDir?\n this.initialized = true;\n }", "public void initialize() {\r\n }", "public void initialize () {\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void initialize() {\n\t}", "@Override\n\tpublic void initialize() {\n\t}", "@Override\n\tpublic void initialize() {\n\t}", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "public void initialize() {\n // TODO\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}" ]
[ "0.77889585", "0.76598406", "0.76444125", "0.74862725", "0.74759775", "0.74297154", "0.7330122", "0.73200655", "0.73081607", "0.72332704", "0.7227567", "0.72254443", "0.7204756", "0.7179146", "0.71389574", "0.710459", "0.70835483", "0.69552004", "0.6951088", "0.6951088", "0.69486403", "0.6896111", "0.6891914", "0.6880341", "0.6869808", "0.68380994", "0.6832248", "0.68130493", "0.6810036", "0.6791785", "0.6767808", "0.6767808", "0.6767808", "0.67585325", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.674703", "0.67460734", "0.67356324", "0.6730511", "0.6730511", "0.67266756", "0.6721587", "0.6719296", "0.6719296", "0.6716121", "0.67078453", "0.6698146", "0.6698146", "0.6692177", "0.66902024", "0.6688639", "0.66872686", "0.66759235", "0.6673657", "0.66736096", "0.6648203", "0.66357785", "0.66327715", "0.6624514", "0.66173863", "0.66142064", "0.66096175", "0.66096175", "0.6601052", "0.6589645", "0.6589645", "0.65885437", "0.6588485", "0.6578325", "0.6577374", "0.65751874", "0.656056", "0.6554222", "0.6554061", "0.6553569", "0.6549657", "0.654635", "0.654635", "0.654635", "0.6536794", "0.6536794", "0.6536794", "0.65313226", "0.65230983", "0.65230983" ]
0.0
-1
No state consistency check is performed at this level. State changing methods should do that and throw apropriate exceptions.
public synchronized void setStopped() { state = STOPPED; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void ensureChangesAllowed() {\n if (lifecycle.started() == false) {\n throw new IllegalStateException(\"Can't make changes to indices service, node is closed\");\n }\n }", "abstract protected void _checkState() throws IllegalStateException;", "void changed(State state, Exception e);", "protected abstract int newState();", "private SyncState() {}", "abstract public void updateState();", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "@Override\n\tpublic int getState() {\n\t\treturn 0;\n\t}", "OperationalState operationalState();", "OperationalState operationalState();", "@Test\n @DisplayName(\"State sees changes committed to backend if not modified on the state\")\n void dirtyRead() {\n backingStore.set(CHAD);\n final var state = createState();\n assertThat(state.get()).isEqualTo(CHAD);\n backingStore.set(DENMARK);\n assertThat(state.get()).isEqualTo(DENMARK); // Sees change\n state.put(ESTONIA);\n assertThat(state.get()).isEqualTo(ESTONIA);\n backingStore.set(FRANCE);\n assertThat(state.get()).isEqualTo(ESTONIA); // Does not see change\n }", "public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}", "public abstract void stateChanged(STATE state);", "protected void checkState()\n {\n if (getParentNode() != null)\n {\n throw new IllegalStateException(\n \"Node cannot be modified when added to a parent!\");\n }\n }", "@Override\n\tpublic void stateCheck() {\n\t\tif(balance<0 && balance>=-1000)\n\t\t{\n\t\t\tacc.setState(new YellowState(this));\n\t\t}\n\t\telse if(balance<-1000)\n\t\t{\n\t\t\tacc.setState(new RedState(this));\n\t\t}\n\t}", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "@Test()\n\tpublic void invalidName_changeState() throws IOException {\n\t\tint responseCode = 404;\n\t\tmainItem.changeState(\"S\", \"OFF\");\n\t\tassertTrue(mainItem.getConnection().getResponseCode() == responseCode);\n\t}", "private void checkStatus() {\n if (switchOff) {\n String msg = \"Locker is switched off - no data source accessible.\";\n log.error(msg);\n throw new IllegalStateException(msg);\n }\n }", "@Test\n\tpublic void invalidState_changeState() throws IOException {\n\t\tString testState = \"OFN\";\n\t\tItem testItem = new Item().createItemFromItemName(\"lamp_woonkamer\");\n\t\ttestItem.changeState(testItem.getName(), testState);\n\t\tSystem.out.println(testItem.getState());\n\t\tassertNotEquals(testItem.getState(), testState);\n\t}", "void beforeState();", "private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }", "@Override\n public Boolean call() throws Exception {\n return this.state22();\n }", "@Override\n\tvoid checkConsistency()\n\t{\n\t\t\n\t}", "@Override\r\n public FlowState call() {\r\n // TODO: We should not need? to pass the flowState because this flow is already known (reapplying same values???)\r\n FlowState flowState = getFlowState();\r\n if ( flowState == null ) {\r\n throw new FlowException(\"No flowState with id:\", getExistingFlowStateLookupKey());\r\n } else {\r\n return getFlowManagementWithCheck().continueFlowState(getExistingFlowStateLookupKey(), true, this.getInitialFlowState());\r\n }\r\n }", "public void getState();", "public abstract void updateStatus() throws Throwable;", "public void testSetState() {\r\n try {\r\n address.setState(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "@Override\n protected void incrementStates() {\n\n }", "@Override\n\tpublic boolean getState() {\n\t\treturn true;\n\t}", "@Override\n\tpublic void changeState(VehicleState newState) throws ServiceException {\n\t\t\n\t}", "protected abstract void assertState(HazelcastInstance hazelcastInstance);", "long getStateChange();", "@Test\n\tpublic void validState_changeState() {\n\t\tString testState = \"OFF\";\n\t\tItem testItem = new Item().createItemFromItemName(\"lamp_woonkamer\");\n\t\ttestItem.changeState(testItem.getName(), testState);\n\t\tSystem.out.println(testItem.getState());\n\t\tassertEquals(testItem.getState(), testState);\n\t\t\n\t}", "private void computeExternalState(InternalState newState) {\n if (internalState != newState) {\n switch (internalState) {\n case BUILD:\n Preconditions.checkState(newState == InternalState.PROBE_IN || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_IN:\n Preconditions.checkState(newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.REPLAY ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_OUT:\n case PROBE_PIVOT_AND_OUT:\n Preconditions.checkState(newState == InternalState.PROBE_IN ||\n newState == InternalState.PROBE_OUT ||\n newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROJECT_NON_MATCHES:\n Preconditions.checkState(newState == InternalState.REPLAY || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case REPLAY:\n Preconditions.checkState(newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n }\n internalState = newState;\n }\n computeExternalState();\n }", "private Object getState() {\n\treturn null;\r\n}", "public TransactionStateUpdater() {\n super();\n }", "@Override\n public int getState() {\n return myState;\n }", "@VisibleForTesting\n int getInternalState() {\n return currentState;\n }", "protected void stateChanged() {\r\n\t\tsetChanged();\r\n\t\tnotifyObservers();\r\n\t}", "@Override\r\n public boolean updateState(Status currentState, Event event,\r\n Status nextState, UserVmTcDetail vo, Object data) {\n return false;\r\n }", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "@Override\n\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\n\t}", "private void assertRunningState() {\n Misc.checkArgument(this.state == State.STARTED || this.state == State.STOPPING,\n \"Replicate state must be STARTED or STOPPING.\");\n }", "private void checkStateChange() {\n\t\tif(previousState == null){\n\t\t\tpreviousState = getOrientation();\n\t\t}\n\t\telse{\n\t\t\tif(previousState != getOrientation()){\n\t\t\t\tif(isTurningLeft){\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t\tif(isTurningRight){\n\t\t\t\t\tisTurningRight = false;\n\t\t\t\t}\n\t\t\t\tpreviousState = getOrientation();\n\t\t\t}\n\t\t}\n\t}", "void validateState() throws EPPCodecException {\n // add/chg/rem\n if ((addDsData == null) && (chgDsData == null) && (remKeyTag == null)) {\n throw new EPPCodecException(\"EPPSecDNSExtUpdate required attribute missing\");\n }\n \n // Ensure there is only one non-null add, chg, or rem\n\t\tif (((addDsData != null) && ((chgDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((chgDsData != null) && ((addDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((remKeyTag != null) && ((chgDsData != null) || (addDsData != null)))) {\n\t\t\tthrow new EPPCodecException(\"Only one add, chg, or rem is allowed\");\n\t\t}\n }", "@SuppressWarnings(\"resource\")\n\tpublic synchronized void advance() {\n\t\t/*\n\t\t * Do not advance the state machine if it is still valid. This is a convenience to application code\n\t\t * that can now try to advance the state machine redundantly without it getting costly.\n\t\t * \n\t\t * Here we have to be careful. We cannot just read valid() flag as that would create reactive dependency\n\t\t * that would be invalidated a few lines below when the valid() flag is set to true.\n\t\t * Such immediate invalidation would force another controlling (outer) reactive computation to run immediately after the current one ends.\n\t\t * While such overhead is common in reactive code and it is usually acceptable, it can be very wasteful here in some important use cases,\n\t\t * for example in ReactiveLazy where it would double compute cost of all reactive computations that read new/changed ReactiveLazy.\n\t\t *\n\t\t * We cannot just check for non-null trigger either as that would make the check completely non-reactive.\n\t\t * The controlling (outer) computation wouldn't run again when the state is invalidated and advancement would stop forever.\n\t\t *\n\t\t * Instead of creating dependency on the full valid() flag, we will reactively depend only on trigger state.\n\t\t * The difference is that trigger state only tracks validity of the last controlled (inner) computation\n\t\t * while the valid() flag tracks all current and future state of the whole reactive state machine.\n\t\t * Trigger state can change only in one direction from not fired to fired while valid() changes both ways.\n\t\t * This reduction in the scope of the dependency is sufficient to avoid redundant reactive computations\n\t\t * while keeping the dependency wide enough to ensure the state machine appears to be fully reactive.\n\t\t * \n\t\t * Trigger itself is of course non-reactive, because it is a low-level reactive primitive.\n\t\t * So how do we depend on its state? We will read valid() flag but only after we have already set it to true.\n\t\t * This breaks the basic principle of reactive programming that dependencies are recorded before reads,\n\t\t * but it is safe here, because it is equivalent to a scenario, in which another thread advances the state machine\n\t\t * and the current thread executed shortly afterwards, reads the valid() flag (which is true), and returns without advancing.\n\t\t * \n\t\t * This solution is so efficient that a lot of code can just blindly advance all the time without ever checking valid().\n\t\t * This may be actually more performant thanks to the reduced dependency optimization.\n\t\t */\n\t\tif (trigger != null) {\n\t\t\t/*\n\t\t\t * If the trigger is non-null, then valid() is true and we can just return without advancing.\n\t\t\t * We will record dependency on valid() to ensure that the controlling (outer) computation\n\t\t\t * tries to advance the state machine again when valid() becomes false.\n\t\t\t */\n\t\t\tvalid.get();\n\t\t\treturn;\n\t\t}\n\t\tReactiveScope scope = OwnerTrace.of(new ReactiveScope())\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\tif (pins != null)\n\t\t\tscope.pins(pins);\n\t\tpins = null;\n\t\ttry (CloseableScope computation = scope.enter()) {\n\t\t\tReactiveValue<T> value = ReactiveValue.capture(supplier);\n\t\t\t/*\n\t\t\t * We will be sending two invalidations to the controlling reactive computation.\n\t\t\t * We will first discourage redundant advancement by setting valid() to true.\n\t\t\t * Only then we set the output. This prevents unnecessary attempts to advance the state machine.\n\t\t\t */\n\t\t\tvalid.set(true);\n\t\t\toutput.value(value);\n\t\t}\n\t\t/*\n\t\t * As mentioned above, we will create dependency on valid() to ensure the controlling (outer) computation\n\t\t * tries to advance again when the current state is invalidated, i.e. when valid() is set to false.\n\t\t * We have to do this after setting valid() to true above to avoid immediately invalidating current computation.\n\t\t * We also have to do it before arming the trigger, because trigger could fire immediately (inline)\n\t\t * and such firing involves setting valid() to false, by which time the dependency on valid() must already exist.\n\t\t * We have to be additionally careful not to create the dependency inside the controlled (inner) computation.\n\t\t */\n\t\tvalid.get();\n\t\tif (scope.blocked())\n\t\t\tpins = scope.pins();\n\t\ttrigger = OwnerTrace\n\t\t\t.of(new ReactiveTrigger()\n\t\t\t\t.callback(this::invalidate))\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\t/*\n\t\t * Arming the trigger can cause it to fire immediately.\n\t\t * We don't worry about that, because our invalidation callback is very fast and non-conflicting.\n\t\t */\n\t\ttrigger.arm(scope.versions());\n\t}", "public ConvergenceInputModelState()\n {\n this.inputModelReady = false;\n this.systemUpdated = false;\n }", "protected void resetState()\n {\n // Nothing to do by default.\n }", "public void assertInState(T expected) {\n synchronized (this) {\n if (state != expected) {\n throw new IllegalStateException(\"Should be in state \" + expected + \".\");\n }\n }\n }", "private StateUtils() {}", "public abstract int getState() throws RcsServiceException;", "private StateChangeMonitor() {\n\t\t// Create the registry of StateChangeListeners\n\t\tlisteners = new Hashtable();\n\t}", "private static void _VerifyAllowedTransition(short oldState, short newState){\r\n\t\tswitch (oldState){\r\n\t\t\tcase STATE_INSTALLED: {\r\n\t\t\t\tif (newState == STATE_SELECTED) {break;}\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_SELECTED: {\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_UPLOADED: {\r\n\t\t\t\tif (newState == STATE_INSTALLED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t}\r\n\t}", "public State getState(){return this.state;}", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "@Test\n\tpublic void validName_changeState() throws IOException {\n\t\tint responseCode = 200;\n\t\tmainItem.changeState(\"lamp_woonkamer\", \"OFF\");\n\t\tassertTrue(mainItem.getConnection().getResponseCode() == responseCode);\n\t}", "protected final void checkWriteable()\n {\n if( m_readOnly )\n {\n final String message =\n \"Resource (\" + this + \") is read only and can not be modified\";\n throw new IllegalStateException( message );\n }\n }", "protected void setState( EntityState newState ) throws BusinessException\n\t{\n\t\t/* Invariant check */\n\t\tif( newState.equals( this.state ) )\n\t\t\tthrow new ActualStateException( );\n\t\t\n\t\t/* Set the state before the observers update */\n\t\tthis.state = newState;\n\t\t\n\t\t/* Notify the observers */\n\t\tHashMap< EntityState, StateEventsFactory > eventFactories = getEventFactories( );\n\t\tStateEventsFactory stateFactory = eventFactories.get( newState );\n\t\ttry\n\t\t{\n\t\t\tArrayList< DomainEvent > events = stateFactory.getEventsFor( newState, FacturaElectronica2DTO.map( this ) );\n\t\t\tnotifyObservers( events );\n\t\t}\n\t\tcatch ( ObserverUpdateFailed e ) \n\t\t{\n\t\t\te.printStackTrace( );\n\t\t\tArrayList< DomainEvent > failoverEvents = stateFactory.getFailoverEventsFor( newState, FacturaElectronica2DTO.map( this ) );\n\t\t\tnotifyObservers( failoverEvents );\n\t\t}\n\t}", "public void updateRoot(MachineState theState) {\n ;\n }", "@Override\n public void stateChanged()\n {\n if (this.systemUpdated)\n {\n inputModelReady = true;\n }\n }", "protected S state() {\n return state;\n }", "protected void stateChanged(final SpacecraftState state) {\n final AbsoluteDate date = state.getDate();\n final boolean forward = date.durationFrom(getStartDate()) >= 0.0;\n for (final DoubleArrayDictionary.Entry changed : state.getAdditionalStatesValues().getData()) {\n final TimeSpanMap<double[]> tsm = unmanagedStates.get(changed.getKey());\n if (tsm != null) {\n // this is an unmanaged state\n if (forward) {\n tsm.addValidAfter(changed.getValue(), date, false);\n } else {\n tsm.addValidBefore(changed.getValue(), date, false);\n }\n }\n }\n }", "Object getState();", "public void forceChangeState(State toState) {\n changeState(state, toState);\n }", "@Override\r\n public void stateChanged(ChangeEvent e) {\n }", "void onStoreValidateExclusiveFeatureUpdate(Context ctx, Subscriber oldSub, Subscriber newSub)\r\n\t{\r\n\t\tif (!oldSub.getSubscriberType().equals(newSub.getSubscriberType())\r\n\t\t\t&& !oldSub.getState().equals(newSub.getState()))\r\n\t\t{\r\n\t\t\tif (oldSub.getState() != SubscriberStateEnum.SUSPENDED && oldSub.getState() != SubscriberStateEnum.EXPIRED)\r\n\t\t\t{\r\n\t\t\t\tthrow new IllegalStateException(\"Not allowed to change subscriber type and state and the same time.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testGetState() {\r\n\t}", "State getState();", "State getState();", "State getState();", "State getState();", "@Override\r\n\tpublic void updateState() {\r\n\t\tState<A> result = null;\r\n\t\tif(events.size() > 0){\r\n\t\t\tfor(Event<A> a : events){\r\n\t\t\t\tstate = (result = state.perform(this,a)) == null ? state : result;\r\n\t\t\t}\r\n\t\t\tevents.removeAllElements();\r\n\t\t}\r\n\t\tstate = (result = state.perform(this, null)) == null ? state : result;\r\n\t\trequestInput();\r\n\t\t\r\n\t}", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t}", "public void updateState();", "public void checkState( )\n {\n if( null == this.logfilename )\n {\n throw new IllegalStateException( \"Tried to operate on WriteLogger while it had not been initialized yet. You first need to set the logfilename!!\" );\n }\n }", "@Test\n public void testStateTransitions2()\n {\n theEngine.start();\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Undo from player won state\n theEngine.undoLastMove();\n //didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }", "protected final void checkWriteable()\n throws IllegalStateException\n {\n if( m_readOnly )\n {\n throw new IllegalStateException\n ( \"ComponentSelector is read only and can not be modified\" );\n }\n }", "void updateIfNeeded()\n throws Exception;", "protected String doVerifyState() {\n\t\treturn null;\n\t}", "@Test\n public void Test_Maintain_State() {\n Map<String, Integer> inMap = new HashMap<>();\n calc = new StomaStateCalculator(3, 800);\n\n inMap.put(\"UrineColour\", 2);\n inMap.put(\"UrineFrequency\", 3);\n inMap.put(\"Volume\", 600);\n inMap.put(\"Consistency\", 2);\n inMap.put(\"PhysicalCharacteristics\", 6);\n\n assertEquals(\"Green\", calc.getState());\n assertEquals(3.0, calc.getStateVal(), 0.0);\n\n calc.Calculate_New_State(inMap);\n\n assertEquals(\"Green\", calc.getState());\n assertEquals(3.0, calc.getStateVal(), 0.0);\n }", "private void checkState(byte state) {\r\n\t\tif (GPSystem.getCardContentState() != state)\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t}", "public int getState() {return state;}", "public int getState() {return state;}", "@Override\n\tpublic boolean updateStatus() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "@Test\n public void testNotDeployedStateNotDeployedService() {\n cleanUp();\n\n State notDeployed = makeState(2L, \"State 2\");\n\n assertFalse(propertyService.isServiceDeployedInState(Service.MOBILE_ACADEMY, notDeployed));\n }", "@SuppressWarnings(\"EmptyMethod\")\npublic interface BeforeState {\n\n /**\n * This method will be called immediately prior to getting the baseline state.\n */\n void beforeState();\n}", "public boolean willNotBeResurrected() {\n return state == State.FRESH || state == State.ERROR;\n }", "private State assertState(State... states)\r\n\t{\r\n\t\tfor (State state : states)\r\n\t\t{\r\n\t\t\tif (this.state == state) return this.state;\r\n\t\t}\r\n\r\n\t\tthrow new IllegalStateException(this.state.toString());\r\n\t}", "StateManager getStateManager();", "@Override\n\tpublic void setState(STATE state) {\n\n\t}", "private void verifyActive() {\n if (!active) {\n throw new IllegalStateException(\"Container is no longer active for loading\");\n }\n }", "protected void verifyState() throws BOException {\n\t\t// No need to validate inactive objects\n\t\tif (isActive()) {\n\t\t\tif (children != null) {\n\t\t\t\tfor (BusinessObject child : children.values()) {\n\t\t\t\t\tif (child.independentProperty().getValue()) {\n\t\t\t\t\t\tchild.verifyState();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tString err = doVerifyState();\n\t\t\tif (!StringUtil.isNullOrBlank(err)) {\n//\t\t\t\tthrow new BOException(\"Failed to verfy child with message '\" + err + \"'\", this);\n\t\t\t\tthrow new BOException(err, this);\n\t\t\t}\n\t\t\tif (children != null) {\n\t\t\t\tfor(BusinessObject child : children.values()) {\n\t\t\t\t\tif (!child.independentProperty().getValue()) {\n\t\t\t\t\t\tchild.verifyState();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean isStateful() {\n return true;\n }", "@Test\n public void stateNullTest() throws GeneralException {\n JavaRuleContext testRuleContext = buildTestJavaRuleContext();\n testRuleContext.getArguments().remove(JDBCBuildMapRule.ARG_STATE);\n\n assertThrows(GeneralException.class, () -> jdbcBuildMapRule.execute(testRuleContext));\n verify(jdbcBuildMapRule).internalValidation(eq(testRuleContext));\n verify(jdbcBuildMapRule, never()).internalExecute(eq(testRuleContext), any());\n }", "public void saveState() { }", "private void checkMutability()\n\t{\n\t\tif (immutable)\n\t\t{\n\t\t\tthrow new UnsupportedOperationException(\"Map is immutable\");\n\t\t}\n\t}", "@Test\n @Transactional\n public void checkStateIsRequired() throws Exception {\n assertThat(transferEventRepository.findAll()).hasSize(0);\n // set the field null\n transferEvent.setState(null);\n\n // Create the TransferEvent, which fails.\n restTransferEventMockMvc.perform(post(\"/api/transferEvents\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(transferEvent)))\n .andExpect(status().isBadRequest());\n\n // Validate the database is still empty\n List<TransferEvent> transferEvents = transferEventRepository.findAll();\n assertThat(transferEvents).hasSize(0);\n }", "final protected int getEntityState()\n {\n return state;\n }", "public void changeState()\r\n\t{\r\n\t\tfailedNumber=0;\r\n\t\tif(state.equalsIgnoreCase(\"IN PREPARATION\"))\r\n\t\t\tsetState(\"IN TRANSIT\");\r\n\t\telse if(state.equalsIgnoreCase(\"IN TRANSIT\"))\r\n\t\t{\r\n\t\t\tfailedNumber=Math.random();\r\n\t\t\tif(failedNumber<=0.2) setState(\"FAILED\");\r\n\t\t\telse setState(\"RECEIVED\");\r\n\t\t}\r\n\t}", "int getState();" ]
[ "0.7080104", "0.7007933", "0.6611166", "0.6573377", "0.6490859", "0.6468542", "0.6461135", "0.6444348", "0.64180046", "0.64180046", "0.64100224", "0.6399623", "0.636405", "0.6252017", "0.62347424", "0.62163615", "0.6208403", "0.6183241", "0.6182357", "0.6178475", "0.61750686", "0.6174937", "0.6160469", "0.61490047", "0.61039686", "0.61026573", "0.60812795", "0.6034145", "0.601306", "0.6010207", "0.6006939", "0.6006317", "0.59797263", "0.59694076", "0.5965586", "0.59535503", "0.59532887", "0.59478605", "0.5939125", "0.59340924", "0.5924464", "0.5915726", "0.591546", "0.59129333", "0.5893391", "0.58825004", "0.5853096", "0.5846336", "0.584456", "0.5841015", "0.5840411", "0.58370274", "0.58306694", "0.5822655", "0.58123404", "0.5810078", "0.5810041", "0.5800101", "0.5796064", "0.5789496", "0.5787813", "0.57851565", "0.578313", "0.5780561", "0.5763623", "0.574941", "0.5748977", "0.5744244", "0.5744244", "0.5744244", "0.5744244", "0.5738704", "0.5728202", "0.5727247", "0.571522", "0.57101274", "0.5708765", "0.5703508", "0.5702052", "0.56947255", "0.5693431", "0.56911165", "0.56911165", "0.5683441", "0.56810313", "0.56775784", "0.5676936", "0.56740344", "0.5672103", "0.56712526", "0.56566924", "0.56547755", "0.5651239", "0.5638035", "0.5631121", "0.5620782", "0.56204796", "0.56181884", "0.56169444", "0.5611859", "0.56020904" ]
0.0
-1
Looks for changes made in the container, sends them to every listener
@Override public void detectAndSendChanges() { super.detectAndSendChanges(); if (inv != null) { for (int i = 0; i < listeners.size(); ++i) { IContainerListener icontainerlistener = listeners.get(i); if (furnaceBurnTime != inv.getField(0)) { icontainerlistener.sendWindowProperty(this, 0, inv.getField(0)); } if (currentItemBurnTime != inv.getField(1)) { icontainerlistener.sendWindowProperty(this, 1, inv.getField(1)); } if (cookTime != inv.getField(2)) { icontainerlistener.sendWindowProperty(this, 2, inv.getField(2)); } if (totalCookTime != inv.getField(3)) { icontainerlistener.sendWindowProperty(this, 3, inv.getField(3)); } } furnaceBurnTime = inv.getField(0); currentItemBurnTime = inv.getField(1); cookTime = inv.getField(2); totalCookTime = inv.getField(3); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void notifyListeners() {\n IDisplayPaneContainer container = (IDisplayPaneContainer) activeEditorMap\n .get(currentWindow);\n for (IVizEditorChangedListener listener : changeListeners) {\n listener.editorChanged(container);\n }\n }", "public void notifyListeners() {\n Handler handler = new Handler(Looper.getMainLooper()); // TODO reuse\n // handler\n Runnable runnable = new Runnable() {\n\n @Override\n public void run() {\n synchronized (listeners) {\n for (IContentRequester requester : listeners) {\n requester.contentChanged(Content.this);\n }\n }\n }\n };\n boolean success = handler.post(runnable);\n if (success) {\n // Log.d(TAG,\n // \"Posted notification for all listeners from \"+this.toString()+\" to \"+listeners.size()+\" listeners.\");\n Log.d(TAG, \"Posted notification for all listeners from content id \"\n + id + \" to \" + listeners.size() + \" listeners.\");\n } else {\n Log.e(TAG, \"Failed to post notification for all listeners\");\n }\n }", "public void detectAndSendChanges() {\n\t\tsuper.detectAndSendChanges();\n\n\t\tfor (int i = 0; i < this.listeners.size(); ++i) {\n\t\t\tIContainerListener containerListener = this.listeners.get(i);\n\n\t\t\tif (this.burnTime != this.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_BURN_TIME,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME));\n\t\t\t}\n\n\t\t\tif (this.currentItemBurnTime != this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME));\n\t\t\t}\n\n\t\t\tif (this.curEnergy != this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_CURRENT_ENERGY,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY));\n\t\t\t}\n\t\t}\n\n\t\tthis.burnTime = this.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME);\n\t\tthis.currentItemBurnTime = this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME);\n\t\tthis.curEnergy = this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY);\n\t}", "public void notifyListeners() {\n Logger logger = LogX;\n logger.d(\"notifyListeners: \" + this.mListeners.size(), false);\n List<IWalletCardBaseInfo> tmpCardInfo = getCardInfo();\n Iterator<OnDataReadyListener> it = this.mListeners.iterator();\n while (it.hasNext()) {\n it.next().refreshData(tmpCardInfo);\n }\n }", "@Override\r\n\tprotected void listeners() {\n\t\t\r\n\t}", "protected void notifyChangeListeners() { \n Utilities.invokeLater(new Runnable() {\n public void run() { for(ChangeListener l: _changeListeners) l.apply(this); }\n });\n }", "protected void notifyModificationListeners() {\r\n\t\tfor (ElementModificationListener l : modificationListeners) {\r\n\t\t\tl.elementModified(current);\r\n\t\t}\r\n\t}", "private void containerChanged() {\n if (getContainer() == null) {\n return;\n }\n\n ListModel dataCenter = getContainer().getDataCenter();\n dataCenter.getSelectedItemChangedEvent().addListener(new IEventListener() {\n @Override\n public void eventRaised(Event ev, Object sender, EventArgs args) {\n\n containerDataCenterChanged();\n }\n });\n\n // Call handler if there some data center is already selected.\n if (dataCenter.getSelectedItem() != null) {\n containerDataCenterChanged();\n }\n }", "private void notifyListeners() {\n\t\tfor(ModelListener l:listeners) {\n\t\t\tl.update();\t// Tell the listener that something changed\n\t\t}\n\t}", "void notifyAllAboutChange();", "protected void updateAll() {\n for (String key : listenerMap.keySet()) {\n updateValueForKey(key, true);\n }\n }", "protected void fireConfigUpdated()\r\n {\r\n List executeListeners = new ArrayList(listeners);\r\n \r\n for (int i=0; i < executeListeners.size(); i++)\r\n {\r\n IConfigurationListener listener = (IConfigurationListener) executeListeners.get(i);\r\n listener.configUpdated();\r\n }\r\n }", "private static void informListeners() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.classListChanged( );\r\n\t\t}\r\n\t}", "private void notifyListeners(ProteusOpaqueData pod) {\n \tEnumeration<ProteusOpaqueListener> e = listeners.elements();\n \twhile (e.hasMoreElements()) {\n \t\te.nextElement().newOpaqueData(pod);\n \t}\n }", "protected final void notifyContentChanged() {\n // notify all listeners (including parents)\n for (DialogModuleChangeListener listener : listeners) {\n listener.onContentChanged();\n }\n }", "private void notifyEventListListeners() {\n this.eventListListeners.forEach(listener -> listener.onEventListChange(this.getEventList()));\n }", "private void notifyBoardChanged() {\n if(this.boardChangeListenerList == null || this.boardChangeListenerList.isEmpty()) return;\n\n // yes - there are - create a thread and inform them\n (new Thread(new Runnable() {\n @Override\n public void run() {\n for(LocalBoardChangedListener listener : SchiffeVersenkenImpl.this.boardChangeListenerList) {\n listener.changed();\n }\n }\n })).start();\n }", "private void queueModified() {\n\tmServiceExecutorCallback.queueModified();\n }", "private void notifyListeners() \n\t{\n\t\tSystem.out.println(\"Event Source: Notifying all listeners\");\n\n\t\tfor(IListener listener : listeners)\n\t\t{\n\t\t\tlistener.eventOccured(new Event(this));//passing and object of source\n\t\t}\n\n\t}", "protected void notifyListeners(CacheEvent e) {\n synchronized (listeners) {\n for (int i=0; i<listeners.size(); i++) {\n CacheListener l = (CacheListener) listeners.elementAt(i);\n l.cacheUpdated(e);\n }\n }\n }", "public void watchAndClean() {\n runtimeClient.watchWithWatcher(new Watcher<Event>() {\n\n @Override\n public void eventReceived(Action action, Event resource) {\n if ((resource.getInvolvedObject().getKind().equals(\"Deployment\") ||\n resource.getInvolvedObject().getKind().equals(\"Service\"))\n && resource.getInvolvedObject().getName().startsWith(Constants.BPG_APP_TYPE_LAUNCHER)\n && (action == Action.DELETED || action == Action.MODIFIED)) {\n\n log.info(\"Received \"\n + action.toString() + \" event for \"\n + resource.getInvolvedObject().getKind() + \" \"\n + resource.getInvolvedObject().getName());\n\n cleanOrphanDeployments();\n cleanOrphanServices();\n } else {\n log.debug(\"Received action \" + action.toString() + \" for resource \"\n + resource.getInvolvedObject().getKind() + \":\"\n + resource.getInvolvedObject().getName());\n }\n }\n\n @Override\n public void onClose(KubernetesClientException cause) {\n log.info(\"Shutting down Event Watcher...\");\n }\n });\n }", "@Override\r\n\tpublic void operations() {\n\t\tSystem.out.println(\"update self!\"); \r\n notifyObservers(); \r\n\r\n\t}", "private void setListeners() {\n\n }", "private void notifyObservers() {\n BinStatusUpdate newStatus = buildNewStatus();\n observers.iterator().forEachRemaining(binStatusUpdateStreamObserver -> binStatusUpdateStreamObserver.onNext(newStatus));\n }", "protected void notifyWorkflowStatusListeners() {\n\t\tfor (WorkflowStatusListener listener : workflowStatusListeners) {\n\t\t\tlistener.workflowStatusChanged(this);\n\t\t}\n\t}", "@Override\n\tpublic void onDataChanged()\n\t{\n\t\tfor (DataChangedCallbacks listener : this.dataChangedListeners)\n\t\t{\n\t\t\tlistener.onDataChanged();\n\t\t}\n\t}", "void changed(DiscoveryEvent e);", "protected void addChangeListeners() {\n\t\tif (this.getChangeListenersAdded()) {\n\t\t\t// TODO don\\u00b4t throw an exception yet. CR has to fix another problem. then the exception is the right thing.\n\t\t\t// But what problem?! Should we just try this? UA\n\t\t\treturn;//throw new IllegalStateException();\n\t\t}\n\t\tthis.addCollectableComponentModelListeners();\n\t\tthis.addAdditionalChangeListeners();\n\t\tthis.bChangeListenersAdded = true;\n\n\t\tassert this.getChangeListenersAdded();\n\t}", "public void run()\n {\n CallerContextManager ccm = (CallerContextManager) ManagerManager.getInstance(CallerContextManager.class);\n CallerContext cc = ccm.getCurrentContext();\n CCData data = getCCData(cc);\n if ((data != null) && (data.listeners != null)) data.listeners.notifyChange(event);\n }", "private void notifyListeners() {\n for (SerialConnectionReadyListener listener : listeners) {\n listener.SerialConnectionReady(this);\n }\n }", "public void notifyListeners(Type type) {\n for (WorkspaceListener listener : listeners) {\n listener.update(type);\n }\n }", "final void fireListeners(){\n /// Fire target edited listeners\n if (editedTarget){\n fire(spanEditedListeners);\n editedTarget = false;\n }\n\n /// Fire child edited listeners\n if (editedChild){\n fire(childEditedListeners);\n editedChild = false;\n }\n\n /// Fire doc edited listeners\n fire(docEditedListeners);\n\n /// Recusive call\n for (Span span: this){\n if (span instanceof SpanNode){\n ((SpanNode<?>)span).fireListeners();\n }\n }\n }", "@Override\n public void eventsChanged() {\n }", "public void alert(){\n\t\tfor (ChangeListener l : listeners) {\n\t\t\tl.stateChanged(new ChangeEvent(this));\n\t\t}\n\t}", "@Override\n public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {\n final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction();\n LOG.debug(\"Received data change to ApplicationRib {}\", changes);\n for (final DataTreeCandidate tc : changes) {\n LOG.debug(\"Modification Type {}\", tc.getRootNode().getModificationType());\n final YangInstanceIdentifier path = tc.getRootPath();\n final PathArgument lastArg = path.getLastPathArgument();\n Verify.verify(lastArg instanceof NodeIdentifierWithPredicates, \"Unexpected type %s in path %s\", lastArg.getClass(), path);\n final NodeIdentifierWithPredicates tableKey = (NodeIdentifierWithPredicates) lastArg;\n for (final DataTreeCandidateNode child : tc.getRootNode().getChildNodes()) {\n final YangInstanceIdentifier tableId = this.adjRibsInId.node(tableKey).node(child.getIdentifier());\n if (child.getDataAfter().isPresent()) {\n LOG.trace(\"App peer -> AdjRibsIn path : {}\", tableId);\n LOG.trace(\"App peer -> AdjRibsIn data : {}\", child.getDataAfter().get());\n tx.put(LogicalDatastoreType.OPERATIONAL, tableId, child.getDataAfter().get());\n }\n }\n }\n tx.submit();\n }", "public void onContainerRestart(ContainerId containerId) {}", "public void notifyConfigChange() {\n }", "@Override\r\n\tprotected void attachListeners() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {\n\t\t\t\tworkServers = currentChilds;\n\t\t\t\tSystem.out.println(\"工作服务器的列表发生变化,变化后的列表为: \"+workServers);\n\t\t\t}", "private static void registerEventListener() {\r\n\r\n log.info(\"Registering event listener for Listeners\"); //$NON-NLS-1$\r\n\r\n try {\r\n ObservationManager observationManager = ContentRepository\r\n .getHierarchyManager(ContentRepository.CONFIG)\r\n .getWorkspace()\r\n .getObservationManager();\r\n\r\n observationManager.addEventListener(new EventListener() {\r\n\r\n public void onEvent(EventIterator iterator) {\r\n // reload everything\r\n reload();\r\n }\r\n }, Event.NODE_ADDED\r\n | Event.NODE_REMOVED\r\n | Event.PROPERTY_ADDED\r\n | Event.PROPERTY_CHANGED\r\n | Event.PROPERTY_REMOVED, \"/\" + CONFIG_PAGE + \"/\" + \"IPConfig\", true, null, null, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n }\r\n catch (RepositoryException e) {\r\n log.error(\"Unable to add event listeners for Listeners\", e); //$NON-NLS-1$\r\n }\r\n }", "void registerListeners();", "public interface INotifyChangeListenerServer\n{\n /**\n * 患者状态监听\n *\n * @param listener 消息状态监听器\n * @param registerType 注册类型\n */\n void registerPatientStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n\n /**\n * 医生状态监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 医生转诊申请监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorTransferPatientListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 医生认证状态监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorAuthStatusChangeListener(@NonNull IChange<Integer> listener, @NonNull RegisterType registerType);\n /**\n * 最近联系人监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerRecentContactChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 服务包订单状态\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerOrderStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n}", "public void changed() {\n // from ChangeHandler\n configSave.enable();\n }", "@Override\n public void onSave(MessageContainer messages) {\n }", "public void notifyChangementJoueurs();", "@Override\n\tpublic void onUpdate() {\n\t\tlistener.onUpdate();\n\t}", "@Override\r\n\tprotected void setListeners() {\n\t\t\r\n\t}", "public void notifyObservers(){\n for (GameObserver g: observers){\n g.handleUpdate(new GameEvent(this,\n currentPlayer,\n genericWorldMap,\n gameState,\n currentTerritoriesOfInterest,\n currentMessage));\n }\n }", "public List<String> listeners();", "private void containerDataCenterChanged() {\n storage_pool dataCenter = (storage_pool) getContainer().getDataCenter().getSelectedItem();\n Version ver31 = new Version(3, 1);\n\n boolean available = dataCenter != null && (dataCenter.getcompatibility_version().compareTo(ver31) >= 0 || dataCenter.getId().equals(Guid.Empty));\n\n getVersion().setIsAvailable(available);\n getRetransmissions().setIsAvailable(available);\n getTimeout().setIsAvailable(available);\n }", "void onContainerStatusReceived(ContainerId containerId,\n ContainerStatus containerStatus);", "@Override\n protected void registerCustomListeners(@NotNull MessageBusConnection connection) {\n connection.subscribe(EncodingManagerListener.ENCODING_MANAGER_CHANGES, (document, propertyName, oldValue, newValue) -> {\n if (propertyName.equals(EncodingManagerImpl.PROP_CACHED_ENCODING_CHANGED)) {\n updateForDocument(document);\n }\n });\n\n connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(new VirtualFileListener() {\n @Override\n public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {\n if (VirtualFile.PROP_ENCODING.equals(event.getPropertyName())) {\n updateForFile(event.getFile());\n }\n }\n }));\n }", "void handleChanged(Collection<AGStoredFile> existingFiles, Collection<AGStoredFile> changedFiles);", "@Override\n public void postReceive(RepositoryHookContext context, Collection<RefChange> refChanges) \n {\n }", "void watchListenerData(int port, ListenerWatcher watcher) {\n }", "private void listen() {\n try {\n this.console.println(MapControl.checkListen(FireSwamp.getPlayer().getPlayerPosition(),\n FireSwamp.getCurrentGame().getGameMap()));\n } catch (MapControlException ex) {\n Logger.getLogger(GameMenuView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void fireChange() {\n\t\tActionListener[] actionListenerArray = actionListeners.toArray(new ActionListener[0]);\n\t\tfor (int i = 0; i < actionListenerArray.length; i++) {\n\t\t\tActionListener listener = actionListenerArray[i];\n\t\t\tlistener.onActionChanged(this);\n\t\t}\n\t}", "public void detectAndSendChanges()\r\n\t{\r\n\t\t super.detectAndSendChanges();\r\n\r\n\t\t for (int i = 0; i < this.crafters.size(); ++i)\r\n\t\t {\r\n\t\t\t ICrafting icrafting = (ICrafting)this.crafters.get(i);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);\r\n\t\t }\r\n\t}", "@Override\n public void notifyObservers() {\n for (Observer observer : observers){\n // observers will pull the data from the observer when notified\n observer.update(this, null);\n }\n }", "void onListenerChanged(ListenerUpdate update);", "protected void installListeners() {\n\n\t}", "protected void attachListeners() {\n\t\t\n\t}", "@Async\r\n void processEvents() {\r\n for (;;) {\r\n \r\n // wait for key to be signalled\r\n WatchKey key;\r\n try {\r\n key = watcher.take();\r\n } catch (InterruptedException x) {\r\n log.error(\"interrupted exception: \" + x);\r\n return;\r\n }\r\n\r\n FolderConfig config = keys.get(key);\r\n Path dir = Paths.get(config.getDirectory());\r\n \r\n if (dir == null) {\r\n \r\n continue;\r\n }\r\n\r\n for (WatchEvent<?> event : key.pollEvents()) {\r\n WatchEvent.Kind kind = event.kind();\r\n\r\n // TBD - provide example of how OVERFLOW event is handled\r\n if (kind == OVERFLOW) {\r\n continue;\r\n }\r\n if (kind == StandardWatchEventKinds.ENTRY_CREATE) {\r\n insertIntoSDE(config, event.context().toString());\r\n }\r\n\r\n }\r\n\r\n // reset key and remove from set if directory no longer accessible\r\n boolean valid = key.reset();\r\n if (!valid) {\r\n keys.remove(key);\r\n\r\n // all directories are inaccessible\r\n if (keys.isEmpty()) {\r\n break;\r\n }\r\n }\r\n }\r\n }", "protected void fireContentsChanged() {\r\n\t// Guaranteed to return a non-null array\r\n\tObject[] listeners = listenerList.getListenerList();\r\n\tListDataEvent e = null;\r\n\t// Process the listeners last to first, notifying\r\n\t// those that are interested in this event\r\n\tfor (int i = listeners.length-2; i>=0; i-=2) {\r\n\t if (listeners[i]==ListDataListener.class) {\r\n\t\t// Lazily create the event:\r\n\t\tif (e == null) {\r\n\t\t e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED,\r\n\t\t\t\t\t 0, getSize()-1);\r\n\t\t}\r\n\t\t((ListDataListener)listeners[i+1]).contentsChanged(e);\r\n\t }\r\n\t}\r\n }", "protected void installListeners() {\n\t}", "private static void cacheContent(Collection listeners) {\r\n\r\n Iterator ipList = listeners.iterator();\r\n while (ipList.hasNext()) {\r\n Content c = (Content) ipList.next();\r\n try {\r\n Map types = new Hashtable();\r\n Listener.cachedContent.put(c.getNodeData(\"IP\").getString(), types); //$NON-NLS-1$\r\n Iterator it = c.getContent(\"Access\").getChildren().iterator(); //$NON-NLS-1$\r\n while (it.hasNext()) {\r\n Content type = (Content) it.next();\r\n types.put(type.getNodeData(\"Method\").getString().toLowerCase(), StringUtils.EMPTY); //$NON-NLS-1$\r\n }\r\n }\r\n catch (RepositoryException re) {\r\n log.error(\"RepositoryException caught while loading listener configuration: \" + re.getMessage(), re); //$NON-NLS-1$\r\n }\r\n }\r\n }", "@Override\n void notifys() {\n for (Observer o : observers) {\n o.update();\n }\n }", "private void triggerBlockListeners() {\r\n \tfor(IStopBlockListener listener : blockListeners){\r\n \t\tlistener.onStoppedBlock();\r\n \t}\r\n }", "private EventListener listenChanges() {\n Set<String> storeEvents = ImmutableSet.of(Events.STORE_INITED);\n EventListener eventListener = event -> {\n // Ensure task schema create after system info initialized\n if (storeEvents.contains(event.name())) {\n this.call(() -> this.tx().initSchema());\n return true;\n }\n return false;\n };\n this.graph.loadSystemStore().provider().listen(eventListener);\n return eventListener;\n }", "private void notifyListeners(MenuCommand mc) {\n connectorListeners.forEach(listener-> listener.onCommand(this, mc));\n }", "@Override\n public void onContainerAvailable(ContainerHolder containerHolder, String containerVersion) {\n Container container = containerHolder.getContainer();\n registerCallbacksForContainer(container);\n }", "private void checkForUpdates() {\n UpdateManager.register(this);\n }", "private void checkForUpdates() {\n UpdateManager.register(this);\n }", "private void metadataModification(CellID cid, Metadata metadata) {\n logger.log(Level.INFO, \"metadata modification!\");\n for(MetadataModificationListener l : modificationListeners){\n if(l.match(cid, metadata)){\n logger.log(Level.INFO, \"server-side alert\");\n l.fireAlert(cid, metadata);\n }\n }\n\n // collect all hit listeners for each client, we'll send just one message\n // to each client containing all of that client's hits\n HashMap<WonderlandClientID, ArrayList<MetadataModificationListener>> clientListenerHits\n = new HashMap<WonderlandClientID, ArrayList<MetadataModificationListener>>();\n\n for(Entry<MetadataModificationListener, ArrayList<WonderlandClientID>> e : clientModificationListeners.entrySet()){\n if(e.getKey().match(cid, metadata)){\n // for every client ID that is connected to this listener..\n for(WonderlandClientID wcid : e.getValue()){\n // create list of hits if necessary\n if(!clientListenerHits.containsKey(wcid)){\n clientListenerHits.put(wcid, new ArrayList<MetadataModificationListener>());\n }\n // add this listener hit\n ArrayList<MetadataModificationListener> clientHits = clientListenerHits.get(wcid);\n clientHits.add(e.getKey());\n clientListenerHits.put(wcid, clientHits);\n }\n }\n }\n\n CommsManager cm = WonderlandContext.getCommsManager();\n MetadataConnectionHandler handler = (MetadataConnectionHandler) cm.getClientHandler(MetadataConnectionType.CONN_TYPE);\n\n // send a message for each client with a hit\n for(Entry<WonderlandClientID, ArrayList<MetadataModificationListener>> e : clientListenerHits.entrySet()){\n handler.sendClientMessage(e.getKey(), new MetadataConnectionModMessage(e.getValue()));\n }\n \n }", "@Override\r\n\tpublic void notifyObservers() {\n\t\t\r\n\t}", "protected void indicateModified() {\n invalidationListenerManager.callListeners(this);\n }", "private static void fireListChanged(Object tag)\n {\n // if (DEBUG.Enabled) Log.info(\"fireListChanged: \" + Util.tags(tag));\n \n // if (disableEvents)\n // return;\n // for (MetadataListListener mdl : listeners) {\n // try {\n // mdl.listChanged();\n // } catch (Throwable t) {\n // Log.warn(\"listener update: \" + Util.tags(mdl), t);\n // }\n // }\n }", "protected void installListeners() {\n }", "protected void installListeners() {\n }", "private void fireConfigChanged()\n {\n ScmEventBus.getInstance().post(\n new RepositoryHandlerConfigChangedEvent<C>(config));\n }", "public void onCommitLastReInitialization(ContainerId containerId) {}", "private void fireContentModelModified(final String id, final String xmlData) throws SystemException {\r\n for (final ResourceListener contentModelListener : this.contentModelListeners) {\r\n contentModelListener.resourceModified(id, xmlData);\r\n }\r\n }", "void onContainerStarted(ContainerId containerId,\n Map<String, ByteBuffer> allServiceResponse);", "public void notifyObservers() {}", "private void notifyListeners(RestState state) {\n\t\tfor (RestStateChangeListener l : listener) {\n\t\t\tl.onStateChangedEvent(state);\n\t\t}\n\t}", "private void notifyObservers() {\n\t\tIterator<Observer> i = observers.iterator();\r\n\t\twhile( i.hasNext() ) {\r\n\t\t\tObserver o = ( Observer ) i.next();\r\n\t\t\to.update( this );\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void notifyObservers() {\n\t\tfor(Observer o : list) {\r\n\t\t\t// Atualiza a informacao no observador\r\n\t\t\to.update(this, this);\r\n\t\t}\r\n\t}", "@Override\n public void addChangeListener(ChangeListener l) {}", "private static void fireMazeChanged() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.mazeChanged(currentMaze);\r\n\t\t}\r\n\t}", "public void updateDate() {\n for (ChangeListener l : listeners) {\n l.stateChanged(new ChangeEvent(this));\n }\n }", "void notifySelectedChangeDirected(ISubContainer container);", "protected void initModifiedListeners()\n\t{\n\t\tif (path != null)\n\t\t{\n\t\t\tpath.addModifiedListener(this);\n\t\t}\n\t}", "public void onContainerReInitialize(ContainerId containerId) {}", "private void notifyListeners(boolean dataChanged) {\n for (OnDataChangedListener listener : dataChangedListeners) {\n listener.onDataChanged(dataChanged);\n }\n }", "@Override\n public void run() {\n final Node node = infoData.getNode(query.getPath());\n if (!node.isEmpty()) {\n List<? extends Event> infoEvents =\n infoSyncTree.applyServerOverwrite(query.getPath(), node);\n postEvents(infoEvents);\n onComplete.onListenComplete(null);\n }\n }", "public void notifyChangementCroyants();", "public void notifyObservers(){\n\t\tfor (ModelObserver c : controllers){\n\t\t\tc.update();\n\t\t}\n\t}", "public void managerOutputModified(ManagerEvent e);", "public abstract void registerListeners();", "@Override\n public void notifyStructureObservers() {\n for(StructureObserver structureObserver : structureObservers){\n structureObserver.update(entities.returnStructureRenderInformation());\n }\n }" ]
[ "0.68324286", "0.62443143", "0.6155047", "0.609791", "0.6078558", "0.59869635", "0.5922413", "0.5899209", "0.58949536", "0.588271", "0.5870886", "0.5850535", "0.5849606", "0.57727593", "0.57029915", "0.56982887", "0.56558186", "0.5649027", "0.56448203", "0.5615198", "0.5584812", "0.5578503", "0.5528098", "0.54871374", "0.54821986", "0.54778177", "0.5475288", "0.54688144", "0.5452933", "0.5446558", "0.544517", "0.543713", "0.54192233", "0.5418787", "0.5416666", "0.54122293", "0.5402067", "0.54011184", "0.5397657", "0.5379033", "0.53671205", "0.53611106", "0.5359533", "0.53445536", "0.53402936", "0.53369164", "0.5332182", "0.53319633", "0.53120375", "0.52990574", "0.52951694", "0.5290478", "0.5289028", "0.5288392", "0.5285069", "0.52846044", "0.5273631", "0.5272566", "0.52710456", "0.5270902", "0.52611", "0.5260388", "0.5257871", "0.52486265", "0.5241021", "0.52391344", "0.5238167", "0.52368426", "0.52330554", "0.52313995", "0.5228577", "0.52221286", "0.52221286", "0.52213466", "0.5215334", "0.52149475", "0.5212497", "0.5203915", "0.5203915", "0.520275", "0.51957667", "0.5193265", "0.51912147", "0.51904", "0.51891416", "0.5186557", "0.5180282", "0.5174593", "0.51701385", "0.51607245", "0.5157612", "0.5153466", "0.5151009", "0.5150469", "0.5145442", "0.51355183", "0.5135336", "0.5133194", "0.5131821", "0.51273936" ]
0.626887
1
Construct the RemoteViews object
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId, RecipeItem recipeItem) { RemoteViews views = getIngredientRemoteView(context, recipeItem); // Instruct the widget manager to update the widget appWidgetManager.updateAppWidget(appWidgetId, views); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addViews() {\n // Add self VideoView\n addSelfView(getVideoView(null));\n\n // Add remote VideoView(s)\n int maxIndex = getNumPeers();\n for (int i = 0; i < maxIndex; i++) {\n // Iterate over the remote Peers only (first Peer is self Peer)\n addRemoteView(getPeerId(i + 1));\n }\n }", "public SurfaceView createRemoteUI(Context context, final int uid) {\n SurfaceView surfaceV = RtcEngine.CreateRendererView(context);\n mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, uid));\n surfaceV.layout(0, 0, 20, 10);\n return surfaceV;\n }", "@Override\n public RemoteViewsFactory onGetViewFactory(Intent myIntents) {\n return new MyRemoteViewsService(this.getApplicationContext());\n }", "public abstract android.widget.RemoteViewsService.RemoteViewsFactory onGetViewFactory(android.content.Intent intent);", "private void initViews() {\n\n }", "private void initViews() {\n\n\t}", "public abstract void initViews();", "public void initViews(){\n }", "ViewContainer createViewContainer();", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "View createView();", "protected abstract void initViews();", "private void setupRemoteVideo(int uid) {\n int count = mRemoteContainer.getChildCount();\n View view = null;\n for (int i = 0; i < count; i++){\n View v = mRemoteContainer.getChildAt(i);\n if (v.getTag() instanceof Integer && ((int) v.getTag()) == uid) {\n view = v;\n }\n }\n\n if (view != null) {\n return;\n }\n\n mRemoteView = RtcEngine.CreateRendererView(getBaseContext());\n mRemoteContainer.addView(mRemoteView);\n mRtcEngine.setupRemoteVideo(new VideoCanvas(mRemoteView, VideoCanvas.RENDER_MODE_HIDDEN, uid));\n }", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "public Presenter(Model model, View view)\r\n\t{\r\n\t\tthis.myModel=model;\r\n\t\tthis.myView=view;\r\n\t\tConcurrentHashMap<String, RemoteControlCommand> commandMap=new ConcurrentHashMap<String, RemoteControlCommand>(); \r\n\t\tcommandMap.put(\"connection status\", new CheckConnectionStatus());\r\n\t\tcommandMap.put(\"disconnect user\", new DisconnectUser());\r\n\t\tcommandMap.put(\"start server\",new StartServer());\r\n\t\tcommandMap.put(\"stop server\", new StopServer());\r\n\t\tcommandMap.put(\"exit\", new exit());\r\n\r\n\t\tmyView.setCommands(commandMap);\r\n\t}", "@SuppressLint(\"RestrictedApi\")\n @Override\n public void call(Void aVoid) {\n\n initRemoteViews();\n\n }", "private void initView() {\n\n }", "ViewElement createViewElement();", "public abstract void initView();", "protected abstract void initView();", "void initView();", "private Views() {\n }", "@Override\r\n public void initializeView(ViewInterface[] subViews) {\r\n setLayout(new GridBagLayout());\r\n setBackground(Color.decode(\"#747b83\"));\r\n GridBagConstraints gridBagConstraints = new GridBagConstraints();\r\n\r\n Border titledBorder = new TitledBorder(null, \"Server Settings\", TitledBorder.LEADING,\r\n TitledBorder.TOP, FONT, null);\r\n\r\n createIntervalLabel(gridBagConstraints);\r\n createIntervalInputTextField(gridBagConstraints);\r\n createAutoRepeatCheckBox(gridBagConstraints);\r\n createServerStartStopButton(gridBagConstraints);\r\n createSendButton(gridBagConstraints);\r\n createStatusIndicator(gridBagConstraints);\r\n }", "public void initView(){}", "public ViewClass() {\n\t\tcreateGUI();\n\t\taddComponentsToFrame();\n\t\taddActionListeners();\n\t}", "private void initView() {\n\t\tsna_viewpager = (ViewPager) findViewById(R.id.sna_viewpager);\r\n\t\thost_bt = (Button) findViewById(R.id.host_bt);\r\n\t\tcomment_bt = (Button) findViewById(R.id.comment_bt);\r\n\t\tback_iv = (ImageView) findViewById(R.id.back_iv);\r\n\t\trelativeLayout_project = (RelativeLayout) findViewById(R.id.relativeLayout_project);\r\n\t\trelativeLayout_addr = (RelativeLayout) findViewById(R.id.relativeLayout_addr);\r\n\t\trelativeLayout_activity = (RelativeLayout) findViewById(R.id.relativeLayout_activity);\r\n\t\trelativeLayout_host = (RelativeLayout) findViewById(R.id.relativeLayout_host);\r\n\t\trelativeLayout_comment = (RelativeLayout) findViewById(R.id.relativeLayout_comment);\r\n\t\tll_point = (LinearLayout) findViewById(R.id.ll_point);\r\n\t\tstoyrName = (TextView) findViewById(R.id.stoyrName);\r\n\t\tstory_addr = (TextView) findViewById(R.id.story_addr);\r\n\t\t\r\n\t}", "private void setupRemoteVideo(int uid, ViewGroup remoteContainer) {\n int count = remoteContainer.getChildCount();\n View view = null;\n for (int i = 0; i < count; i++) {\n View v = remoteContainer.getChildAt(i);\n if (v.getTag() instanceof Integer && ((int) v.getTag()) == uid) {\n view = v;\n }\n }\n if (view != null) {\n return;\n }\n\n // Checks have passed so set up the remote video.\n int renderMode;\n SurfaceView remoteView = RtcEngine.CreateRendererView(getBaseContext());\n if (uid == WINDOW_SHARE_UID) {\n mRemoteShareView = remoteView;\n renderMode = VideoCanvas.RENDER_MODE_FIT;\n } else {\n mRemoteCameraView = remoteView;\n renderMode = VideoCanvas.RENDER_MODE_HIDDEN;\n }\n\n remoteContainer.addView(remoteView);\n mRtcEngine.setupRemoteVideo(new VideoCanvas(remoteView, renderMode, uid));\n remoteView.setTag(uid);\n }", "private void initUI() {\n mLocalContainer = findViewById(R.id.local_video_view_container);\n mRemoteContainer = findViewById(R.id.remote_video_view_container);\n\n mCallBtn = findViewById(R.id.btn_call);\n mMuteBtn = findViewById(R.id.btn_mute);\n mSwitchCameraBtn = findViewById(R.id.btn_switch_camera);\n }", "private void setViews() {\n\n }", "private void initViews() {\n mTvBalance = findViewById(R.id.tv_receive_client_balance);\n mListView = findViewById(R.id.lv_list_receive_client);\n mFab = findViewById(R.id.fab_receive_receip);\n mTvEmpty = findViewById(R.id.tv_empty_view);\n mIvEmpty = findViewById(R.id.iv_empty_view);\n mEmptyView = findViewById(R.id.empty_view);\n }", "private void init() {\n //set view to presenter\n presenter.setView(this, service);\n\n setupView();\n }", "@Override\n\tprotected void initViews(View view) {\n\t\tsuper.initViews(view);\n//\t\tsendRequestData();\n\t}", "private void initViews() {\n webView = (WebView)findViewById(R.id.crop_webview);\n confirm_location = (Button)findViewById(R.id.btn_confirm_location);\n toolbar = (Toolbar)findViewById(R.id.map_toolbar);\n }", "protected abstract void initContentView(View view);", "@Override\n public void initView() {\n }", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "public static RemoteObject _class_globals(RemoteObject __ref) throws Exception{\nb4i_customlistview._mbase = RemoteObject.createNew (\"B4XViewWrapper\");__ref.setField(\"_mbase\",b4i_customlistview._mbase);\n //BA.debugLineNum = 15;BA.debugLine=\"Public sv As B4XView\";\nb4i_customlistview._sv = RemoteObject.createNew (\"B4XViewWrapper\");__ref.setField(\"_sv\",b4i_customlistview._sv);\n //BA.debugLineNum = 16;BA.debugLine=\"Type CLVItem(Panel As B4XView, Size As Int, Value\";\n;\n //BA.debugLineNum = 18;BA.debugLine=\"Private items As List\";\nb4i_customlistview._items = RemoteObject.createNew (\"B4IList\");__ref.setField(\"_items\",b4i_customlistview._items);\n //BA.debugLineNum = 19;BA.debugLine=\"Private mDividerSize As Float\";\nb4i_customlistview._mdividersize = RemoteObject.createImmutable(0.0f);__ref.setField(\"_mdividersize\",b4i_customlistview._mdividersize);\n //BA.debugLineNum = 20;BA.debugLine=\"Private EventName As String\";\nb4i_customlistview._eventname = RemoteObject.createImmutable(\"\");__ref.setField(\"_eventname\",b4i_customlistview._eventname);\n //BA.debugLineNum = 21;BA.debugLine=\"Private CallBack As Object\";\nb4i_customlistview._callback = RemoteObject.createNew (\"NSObject\");__ref.setField(\"_callback\",b4i_customlistview._callback);\n //BA.debugLineNum = 22;BA.debugLine=\"Public DefaultTextColor As Int\";\nb4i_customlistview._defaulttextcolor = RemoteObject.createImmutable(0);__ref.setField(\"_defaulttextcolor\",b4i_customlistview._defaulttextcolor);\n //BA.debugLineNum = 23;BA.debugLine=\"Public DefaultTextBackgroundColor As Int\";\nb4i_customlistview._defaulttextbackgroundcolor = RemoteObject.createImmutable(0);__ref.setField(\"_defaulttextbackgroundcolor\",b4i_customlistview._defaulttextbackgroundcolor);\n //BA.debugLineNum = 24;BA.debugLine=\"Public AnimationDuration As Int = 300\";\nb4i_customlistview._animationduration = BA.numberCast(int.class, 300);__ref.setField(\"_animationduration\",b4i_customlistview._animationduration);\n //BA.debugLineNum = 25;BA.debugLine=\"Private LastReachEndEvent As Long\";\nb4i_customlistview._lastreachendevent = RemoteObject.createImmutable(0L);__ref.setField(\"_lastreachendevent\",b4i_customlistview._lastreachendevent);\n //BA.debugLineNum = 26;BA.debugLine=\"Public PressedColor As Int\";\nb4i_customlistview._pressedcolor = RemoteObject.createImmutable(0);__ref.setField(\"_pressedcolor\",b4i_customlistview._pressedcolor);\n //BA.debugLineNum = 27;BA.debugLine=\"Private xui As XUI\";\nb4i_customlistview._xui = RemoteObject.createNew (\"B4IXUI\");__ref.setField(\"_xui\",b4i_customlistview._xui);\n //BA.debugLineNum = 28;BA.debugLine=\"Private DesignerLabel As Label\";\nb4i_customlistview._designerlabel = RemoteObject.createNew (\"B4ILabelWrapper\");__ref.setField(\"_designerlabel\",b4i_customlistview._designerlabel);\n //BA.debugLineNum = 29;BA.debugLine=\"Private horizontal As Boolean\";\nb4i_customlistview._horizontal = RemoteObject.createImmutable(false);__ref.setField(\"_horizontal\",b4i_customlistview._horizontal);\n //BA.debugLineNum = 35;BA.debugLine=\"Private FeedbackGenerator As NativeObject\";\nb4i_customlistview._feedbackgenerator = RemoteObject.createNew (\"B4INativeObject\");__ref.setField(\"_feedbackgenerator\",b4i_customlistview._feedbackgenerator);\n //BA.debugLineNum = 37;BA.debugLine=\"Private mFirstVisibleIndex, mLastVisibleIndex As\";\nb4i_customlistview._mfirstvisibleindex = RemoteObject.createImmutable(0);__ref.setField(\"_mfirstvisibleindex\",b4i_customlistview._mfirstvisibleindex);\nb4i_customlistview._mlastvisibleindex = RemoteObject.createImmutable(0);__ref.setField(\"_mlastvisibleindex\",b4i_customlistview._mlastvisibleindex);\n //BA.debugLineNum = 38;BA.debugLine=\"Private MonitorVisibleRange As Boolean\";\nb4i_customlistview._monitorvisiblerange = RemoteObject.createImmutable(false);__ref.setField(\"_monitorvisiblerange\",b4i_customlistview._monitorvisiblerange);\n //BA.debugLineNum = 39;BA.debugLine=\"Private FireScrollChanged As Boolean\";\nb4i_customlistview._firescrollchanged = RemoteObject.createImmutable(false);__ref.setField(\"_firescrollchanged\",b4i_customlistview._firescrollchanged);\n //BA.debugLineNum = 40;BA.debugLine=\"Private ScrollBarsVisible As Boolean\";\nb4i_customlistview._scrollbarsvisible = RemoteObject.createImmutable(false);__ref.setField(\"_scrollbarsvisible\",b4i_customlistview._scrollbarsvisible);\n //BA.debugLineNum = 41;BA.debugLine=\"End Sub\";\nreturn RemoteObject.createImmutable(\"\");\n}", "public SurfaceView createLocalUI(Context context) {\n SurfaceView surfaceV = RtcEngine.CreateRendererView(context);\n surfaceV.setZOrderOnTop(true);\n surfaceV.setZOrderMediaOverlay(true);\n mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceV));\n surfaceV.layout(0, 0, 20, 10);\n return surfaceV;\n }", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "protected abstract void setupMvpView();", "@Override\n public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n return Arrays.<ViewManager>asList(\n new VrVideoViewManager(VrVideoViewPackage.mActivity)\n );\n }", "public static RemoteInputView inflate(Context context, ViewGroup root) {\n RemoteInputView v = (RemoteInputView) LayoutInflater.from(context).inflate(\n R.layout.abc_slice_remote_input, root, false);\n v.setTag(VIEW_TAG);\n return v;\n }", "private void registerViews() {\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "private void initView() {\n setContentView(R.layout.activity_dvkitdemo);\n\n mStartDiscoveryButton = findViewById(R.id.btn_start_discovery);\n mStopDiscoveryButton = findViewById(R.id.btn_stop_discovery);\n\n mLogTextView = findViewById(R.id.log);\n mScrollView = findViewById(R.id.scroll);\n\n mListView = (ListView) findViewById(R.id.listview);\n List<VirtualDeviceData> virtualDeviceDatas = new LinkedList<VirtualDeviceData>();\n mVirtualDeviceAdapter = new VirtualDeviceAdapter(this, virtualDeviceDatas);\n mListView.setAdapter(mVirtualDeviceAdapter);\n\n if (!mVirtualDeviceMap.isEmpty()) {\n mVirtualDeviceMap.clear();\n }\n }", "private void addViews() {\n\t}", "@Override\n public void initView() {\n\n }", "private ViewFactory() {}", "@Override protected void initViews() {\n\t\tsetFragments(F_PopularFragment.newInstance(T_HomeActivity.this), F_TimelineFragment.newInstance(T_HomeActivity.this));\n\t}", "public interface BaseView {\n void initViews();\n}", "private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }", "@Override\n public void Create() {\n\n initView();\n }", "private void init(){\n\t\tmIV = new ImageView(mContext);\r\n\t\tFrameLayout.LayoutParams param1 = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT\r\n\t\t\t\t, FrameLayout.LayoutParams.MATCH_PARENT);\r\n\t\tmIV.setLayoutParams(param1);\r\n\t\tmIV.setScaleType(ScaleType.FIT_XY);\r\n//\t\tmIVs[0] = iv1;\r\n\t\tthis.addView(mIV);\r\n//\t\tImageView iv2 = new ImageView(mContext);\r\n//\t\tFrameLayout.LayoutParams param2 = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT\r\n//\t\t\t\t, FrameLayout.LayoutParams.MATCH_PARENT);\r\n//\t\tiv2.setLayoutParams(param2);\r\n//\t\tiv2.setScaleType(ScaleType.CENTER_CROP);\r\n//\t\tmIVs[1] = iv2;\r\n//\t\tthis.addView(iv2);\r\n\t\tthis.mHandler = new Handler();\r\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_socket, container, false);\n initSocket(view);\n return view;\n }", "protected abstract void initViews(View mView);", "private void init(Context context) {\n getViewTreeObserver().addOnGlobalLayoutListener(this);\n inflate(context, R.layout.new_rp_resultview, this);\n mMainPanel = (ViewAnimator) findViewById(R.id.viewanimator);\n mInfoPanel = (ViewAnimator) findViewById(R.id.va_text);\n \n \n mInfoPanelText1 = (TextView) mInfoPanel.findViewById(R.id.tv1);\n mMainPanel.setDisplayedChild(0);\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "private void findViews() {\n serverView = findViewById(R.id.server_view);\n portView = findViewById(R.id.port_view);\n usernameView = findViewById(R.id.username_view);\n passwordView = findViewById(R.id.password_view);\n messageView = findViewById(R.id.message_view);\n uploadButtonView = findViewById(R.id.upload_button_view);\n }", "private void createView() {\n\t\tif (txtButtonCaption == null) {\n\t\t\tView v = LayoutInflater.from(getContext()).inflate(R.layout.ijoomer_voice_button, null);\n\n\t\t\tlnrPlayVoice = (LinearLayout) v.findViewById(R.id.lnrPlayVoice);\n\t\t\tlnrReportVoice = (LinearLayout) v.findViewById(R.id.lnrReportVoice);\n\n\t\t\ttxtButtonCaption = (IjoomerTextView) v.findViewById(R.id.txtButtonCaption);\n\t\t\timgPlay = (ImageView) v.findViewById(R.id.imgPlay);\n\t\t\tgifVoiceLoader = (IjoomerGifView) v.findViewById(R.id.gifVoiceLoader);\n\n\t\t\timgReport = (ImageView) v.findViewById(R.id.imgReport);\n\t\t\ttxtReportCaption = (IjoomerTextView) v.findViewById(R.id.txtReportCaption);\n\n\t\t\tpbrLoading = (ProgressBar) v.findViewById(R.id.pbrLoading);\n\n\t\t\taddView(v, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));\n\t\t\tupdateView();\n\t\t\tsetActionListener();\n\t\t}\n\t}", "public void initView() {\n JPanel pane= new JPanel();\n panel = new JPanel();\n this.getFile(pane);\n JScrollPane scp = new JScrollPane(pane);\n scp.setPreferredSize(new Dimension(500, 280));\n scp.setVisible(true);\n enter.setPreferredSize(new Dimension(100, 50));\n enter.setVisible(true);\n enter.setActionCommand(\"enter\");\n enter.addActionListener(this);\n send.setPreferredSize(new Dimension(80, 50));\n send.setVisible(true);\n send.setActionCommand(\"sendOptions\");\n send.addActionListener(this);\n send.setEnabled(true);\n back.setVisible(true);\n back.setActionCommand(\"back\");\n back.addActionListener(this);\n back.setPreferredSize(new Dimension(80, 50));\n \n panel.add(scp);\n panel.add(send);\n panel.add(enter);\n panel.add(back);\n Launch.frame.add(panel);\n }", "public PgViews() {\n this(\"pg_views\", null);\n }", "public ManipularView() {\n initComponents();\n }", "private void setUpView()\n {\n view = new DefaultDrawingView();\n DrawingEditorProxy editor = new DrawingEditorProxy();\n editor.setTarget(new DefaultDrawingEditor());\n view.addNotify(editor);\n for (Handle h : handles)\n h.setView(view);\n }", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "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 }", "@Override\n protected void initViewSetup() {\n }", "private void setupLocalVideo() {\n\n // Enable the video module.\n mRtcEngine.enableVideo();\n\n mLocalView = RtcEngine.CreateRendererView(getBaseContext());\n mLocalView.setZOrderMediaOverlay(true);\n mLocalContainer.addView(mLocalView);\n\n mRtcEngine.setupLocalVideo(new VideoCanvas(mLocalView, VideoCanvas.RENDER_MODE_HIDDEN, 0));\n }", "private void viewInit() {\n }", "private void initViews() {\n\t\t// TODO Auto-generated method stub\n\t\t// venuePager = (ViewPager)findViewById(R.id.pager);\n\n\t\tmyGallery = (LinearLayout) findViewById(R.id.horizontalScrollItems);\n\n\t\tvenueImageLarge = (ImageView) findViewById(R.id.imageVenueLarge);\n\n\t\tinfoImageView = (ImageView) findViewById(R.id.imageInfo);\n\n\t\tcloseBtn = (ImageView) findViewById(R.id.imageclose);\n\n\t\tvenueCapacity = (TextView) findViewById(R.id.venueCapacity);\n\n\t\tvenueDes = (TextView) findViewById(R.id.venueDes);\n\n\t\tvenueName = (TextView) findViewById(R.id.venueName);\n\n\t\tvenueRelative = (RelativeLayout) findViewById(R.id.venue_relative);\n\n\t\tviewAnimator = (ViewAnimator) this.findViewById(R.id.viewFlipper_venue);\n\n\t\tvenueFullname = (TextView) findViewById(R.id.venueFullnameValue);\n\n\t\tvenueCity = (TextView) findViewById(R.id.venueCityValue);\n\n\t\tvenueOwner = (TextView) findViewById(R.id.venueOwnerValue);\n\n\t\tvenueOpened = (TextView) findViewById(R.id.venueOpenedValue);\n\n\t\tvenueSurface = (TextView) findViewById(R.id.venueSurfaceValue);\n\n\t\tvenueWebsite = (TextView) findViewById(R.id.venueWebsiteValue);\n\n\n\t}", "protected void initView(View rootView) {\n\n }", "private void initview() {\n\t\tbtn_connect = (Button) findViewById(R.id.btn_connect);\n\t\tbtn_disconnect = (Button) findViewById(R.id.btn_disconnect);\n\t\tbtn_send = (Button) findViewById(R.id.pinpad_controller_btn_send);\n\t\tbtn_recv = (Button) findViewById(R.id.pinpad_controller_btn_recv);\n\t\tbtn_clear = (Button) findViewById(R.id.btn_clear);\n\t\tbtn_random = (Button) findViewById(R.id.btn_random);\n\t\tbtn_connect.setOnClickListener(this);\n\t\tbtn_recv.setOnClickListener(this);\n\t\tbtn_send.setOnClickListener(this);\n\t\tbtn_disconnect.setOnClickListener(this);\n\t\tbtn_clear.setOnClickListener(this);\n\t\tbtn_random.setOnClickListener(this);\n\t\ttv_read = (TextView) findViewById(R.id.pinpad_controller_tv_recv);\n\t\tet_send = (EditText) findViewById(R.id.pinpad_controller_et_send);\n\t\ttv_version = (TextView) findViewById(R.id.pinpad_controller_tv_version);\n\t\ttv_version.setText(\"\");\n\t\tsetViewEnabledFalse();\n\t}", "private Presenter createChatClientFactory(View view) {\r\n\t\tPresenter presenter = new ClientPresenter();\r\n\t\tview.setPresenter(presenter);\r\n\t\tpresenter.setView(view);\r\n\t\treturn presenter;\r\n\t}", "public static RemoteViews buildUpdate(Context context, int photoCount) {\n\t\tRemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);\n\t\t\n\t\tremoteViews.setTextViewText(R.id.widget_textview_flickr, String.valueOf(photoCount) );\n\t\t\n\t\treturn remoteViews;\n\t}", "protected abstract void initializeView();", "private void initPresenter() {\n\n RequestQueue requestQueue = App.getInstance().getRequestQueue();\n CatsHttp catsHttp = new VolleyCatsHttp(requestQueue);\n\n CatsRepository catsRepository = new CatsRepository(catsHttp);\n\n presenter = new MainPresenter(catsRepository);\n presenter.bindView(this);\n }", "@SuppressWarnings(\"UnusedParameters\")\n private void initInstances(View rootView, Bundle savedInstanceState) {\n toolbar = (Toolbar)rootView.findViewById(R.id.toolbar);\n ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar);\n // set up button\n setHasOptionsMenu(true);\n ((AppCompatActivity)getActivity()).getSupportActionBar().setHomeButtonEnabled(true);\n ((AppCompatActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(\"Chat\");\n\n btnCall = (ImageButton)rootView.findViewById(R.id.btnCall);\n btnCall.setOnClickListener(ImageButtonClick);\n }", "public interface MvpBaseView {\n void onInitViews();\n}", "public void inicializarFrames(){ // hay que enviar tambien la direccion IP\r\n \r\n this.empView = new Employees(this.user,this.host);\r\n this.equiView = new Equipments(this.user,this.host);\r\n this.deptView = new Departments(this.user,this.host);\r\n this.loctView = new Locations(this.user,this.host);\r\n this.artView = new Articles(this.user,this.host);\r\n this.suppView = new Suppliers(this.user,this.host);\r\n this.instView = new Instructions(this.user,this.host);\r\n this.mantView = new Mantenimiento(this.user,this.host);\r\n this.ordtrView = new OrdenTrabajo(this.user,this.host); \r\n this.repView = new Reports(this.user,this.host);\r\n this.pedView = new Pedidos(/*this.user,*/this.host);\r\n this.opeView = new Operabilidad(/*this.user,*/this.host);\r\n}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = (ViewGroup) inflater.inflate(R.layout.fragment_client_socket, container, false);\n //initComponent();\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_init, container, false);\n\n bt_connect = (Button) view.findViewById(R.id.server_Connect);\n bt_connect.setOnClickListener(new Button.OnClickListener() {\n public void onClick(View v) {\n // connect server\n connector.execute(\"get\",Consts.SERVER_IP);\n Toast.makeText(getContext(),\"connect Server is successed\",Toast.LENGTH_SHORT);\n }\n });\n\n bt_start = (Button) view.findViewById(R.id.moudle_start);\n bt_start.setOnClickListener(this);\n\n bt_stop = (Button) view.findViewById(R.id.moudle_stop);\n bt_stop.setOnClickListener(this);\n\n return view;\n }", "private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}", "public View() {\n this.view = new ViewPanel();\n //this.view.setGraph(this.graph);\n initComponents();\n this.m_algoritmos.setEnabled(false);\n this.mi_maze.setEnabled(false);\n this.mi_salvarImagem.setEnabled(false);\n }", "private VirtualDisplay createVirtualDisplay() {\n // 建立virtualDisplay\n return mediaProjection.createVirtualDisplay(\"MainActivity\", screenWidth, screenHeight, screenDensity,\n DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, mediaRecorder.getSurface(), null, null);\n }", "@Override\n protected void initView() {\n getPresenter().getRxManager().on(C.EVENT_LOGIN, new Action1<Object>() {\n\n @Override\n public void call(Object o) {\n\n Log.e(TAG, \"call() called with: o = [\" + o.toString() + \"]\"+o.getClass());\n }\n });\n\n }", "Viewpoint createViewpoint();", "public ViewServer(Address address) {\n super(address);\n }", "private View() {}", "@SuppressWarnings(\"deprecation\")\n private void setRemoteAdapterV11(Context context, @NonNull final RemoteViews views) {\n views.setRemoteAdapter(0, R.id.widget_list_view,\n new Intent(context, DetailWidgetRemoteViewsService.class));\n }", "private void init(View view){\n errorText = (TextView) view.findViewById(R.id.error_text);\n refreshButton = (TextView) view.findViewById(R.id.refreshButton);\n contactList = (ListView) view.findViewById(R.id.contactList);\n\n chatArrayList = new ArrayList<Chat>();\n profileRemoteDAO = new ProfileRemoteDAO(getContext(), this);\n chatRemoteDAO = new ChatRemoteDAO(getContext(), this);\n customArrayAdapter = new CustomArrayAdapter(getContext(), this, chatArrayList, profileRemoteDAO.getUserId());\n contactList.setAdapter(customArrayAdapter);\n }", "private void crearVista() {\n\t\tVista vista = Vista.getInstancia();\n\t\tvista.addObservador(this);\n\n\t}", "public LocalView(int playerId, RemoteView remoteView){\n this.playerBoardViews = remoteView.getPlayerBoardViews();\n this.playerId = playerId;\n this.mapView = remoteView.getMapView();\n this.playerPosition=remoteView.getMapView().getPlayerPosition(\n remoteView.getPlayerBoardViews().get(this.playerId).getColor());\n this.playerHand = remoteView.getPlayerHands().get(playerId);\n\n }", "public ClientView() {\n initComponents();\n }", "private void initView() {\n\t\tlogin = (Button) pageViews.get(2).findViewById(R.id.sendbtn);\n\t\tlogin.setOnClickListener(this);\n\t}", "ViewComponent createViewComponent();" ]
[ "0.6369699", "0.6223653", "0.62081635", "0.6186685", "0.61851186", "0.6163477", "0.6117833", "0.6103972", "0.6065221", "0.6053327", "0.6053327", "0.6031816", "0.603078", "0.59816545", "0.5978821", "0.5974008", "0.59235555", "0.5915171", "0.5863874", "0.58589846", "0.58471394", "0.58469707", "0.5830156", "0.57936645", "0.5792239", "0.5731287", "0.57175463", "0.5709552", "0.57006127", "0.5692622", "0.5683931", "0.5681263", "0.56786466", "0.56722695", "0.56635565", "0.5635341", "0.562694", "0.5626826", "0.5626826", "0.5626739", "0.5611771", "0.5609508", "0.5609508", "0.5591662", "0.55897653", "0.55821276", "0.55784756", "0.5572797", "0.5572797", "0.5571188", "0.55634123", "0.555757", "0.55558234", "0.55453", "0.5536584", "0.55262345", "0.5506665", "0.5500925", "0.54982024", "0.54900956", "0.54882276", "0.54881334", "0.5462676", "0.5462676", "0.5462343", "0.5454742", "0.5424599", "0.541608", "0.5401172", "0.53998876", "0.5391336", "0.538719", "0.53823274", "0.53799945", "0.5379452", "0.53787595", "0.53784084", "0.5378206", "0.53736115", "0.5369904", "0.53666466", "0.53665656", "0.5364565", "0.53600574", "0.5357969", "0.5350294", "0.5348086", "0.53470147", "0.534402", "0.5328072", "0.53250843", "0.53240657", "0.53237396", "0.5318673", "0.5307921", "0.5307558", "0.53072", "0.5297624", "0.52950716", "0.5277893", "0.5274258" ]
0.0
-1
There may be multiple widgets active, so update all of them
@Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { for (int appWidgetId : appWidgetIds) { // updateAppWidget(context, appWidgetManager, appWidgetId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateAllWidgets(){\n AppWidgetManager widgetManager = AppWidgetManager.getInstance(this);\n int[] appWidgetIds = widgetManager.getAppWidgetIds(new ComponentName(this,EasyBakeWidget.class));\n for (int i: appWidgetIds){\n widgetManager.notifyAppWidgetViewDataChanged(i,R.id.widget_ingredients_list);\n EasyBakeWidget.updateAppWidget(this,widgetManager,i);\n }\n }", "public void update()\n {\n for (Container container : containers)\n container.update(false);\n\n Gui.update(BanksGUI.class);\n Gui.update(BankGUI.class);\n Gui.update(ItemsGroupsGUI.class);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager,\n int[] appWidgetIds)\n {\n // There may be multiple widgets active, so update all of them.\n for (int appWidgetId : appWidgetIds)\n {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "protected void _updateWidgets()\n\t{\n\t\t// Show the title\n\t\tString title = _spItem.getTitleAttr() ;\n\t\tif( title != null )\n\t\t\t_obsTitle.setText( title ) ;\n\t\telse\n\t\t\t_obsTitle.setText( \"\" ) ;\n\n\t\tString state = _avTab.get( \"state\" ) ;\n\t\tif( state == null )\n\t\t\t_obsState.setText( \"Not in Active Database\" ) ;\n\t\telse\n\t\t\t_obsState.setText( state ) ;\n\n\t\tignoreActions = true ; // MFO\n\n\t\tSpObs obs = ( SpObs )_spItem ;\n\t\t\n\t\t// Set the priority\n\t\tint pri = obs.getPriority() ;\n\t\t_w.jComboBox1.setSelectedIndex( pri - 1 ) ;\n\n\t\t// Set whether or not this is a standard\n\t\t_w.standard.setSelected( obs.getIsStandard() ) ;\n\n\t\t// Added for OMP (MFO, 7 August 2001)\n\t\t_w.optional.setValue( obs.isOptional() ) ;\n\n\t\tint numberRemaining = obs.getNumberRemaining();\n\t\t_w.setRemainingCount(numberRemaining);\n\n\t\t_w.unSuspendCB.addActionListener( this ) ;\n\n\t\tignoreActions = false ;\n\n\t\t_w.estimatedTime.setText( OracUtilities.secsToHHMMSS( obs.getElapsedTime() , 1 ) ) ;\n\n\t\t_updateMsbDisplay() ;\n\t}", "void updateControls();", "public void updateAllButtons(){\n updateStartButton();\n updateResetButton();\n }", "protected void updateWidgets() {\n if (!isVisible()) {\n return;\n }\n if (myTopPanel != null) {\n // if we have a top panel, then we have a grid display there\n boolean gridOn = viewer.getGridVisible();\n GLGridPlane grid = viewer.getGrid();\n if ((myGridDisplay != null) != gridOn) {\n if (gridOn) {\n myGridDisplay =\n GridDisplay.createAndAdd (\n grid, myTopPanel, myGridDisplayIndex);\n }\n else {\n GridDisplay.removeAndDispose (\n myGridDisplay, myTopPanel, myGridDisplayIndex);\n myGridDisplay = null;\n }\n }\n if (myGridDisplay != null) {\n myGridDisplay.updateWidgets();\n }\n }\n }", "private void update()\n {\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //System.out.println(\"UPDATE\");\n updateHumanPlayerMoney();\n updateListViewDoctorItems();\n updateListViewHospitalItems();\n updateListViewLogWindow();\n updateListViewComputerPlayer();\n load_figure();\n updateComputerPlayerMoney();\n }\n });\n }", "protected void updatePanelContent() {\n updating = true;\n jTextFieldName.setText(bulb.getName());\n jTextFieldName.setToolTipText(bulb.getType());\n jSlider1.setValue(bulb.getIntensity());\n jToggleButton1.setSelected(bulb.isOn());\n if (bulb.getColor() != null) {\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n switch(bulb.getColor()) {\n case TradfriConstants.COLOR_NORMAL: jRadioNormal.setSelected(true); break;\n case TradfriConstants.COLOR_WARM: jRadioWarm.setSelected(true); break;\n case TradfriConstants.COLOR_COLD: jRadioCold.setSelected(true); break;\n }\n }\n else {\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n }\n \n \n if (bulb.isOnline()) {\n jToggleButton1.setEnabled(true);\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n jSlider1.setEnabled(true);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [online]\");\n }\n else {\n jToggleButton1.setEnabled(false);\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n jSlider1.setEnabled(false);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [offline]\");\n }\n \n updating = false;\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n ComponentName watchWidget = new ComponentName(context, AbsenMainWidget.class);\n updateAppWidget(context, appWidgetManager, watchWidget);\n }", "@Override\r\n public void updateUI() {\r\n }", "private void updateGUIStatus() {\r\n\r\n }", "public void updateUI(){}", "public void updateWidgets() {\n int i;\n if (this.mTransitionHelper.isTransitioning()) {\n this.mTransitionHelper.pendingUpdateWidgets();\n return;\n }\n int i2 = 0;\n int selectedZen = getSelectedZen(0);\n boolean z = true;\n boolean z2 = selectedZen == 1;\n boolean z3 = selectedZen == 2;\n boolean z4 = selectedZen == 3;\n if ((!z2 || this.mPrefs.mConfirmedPriorityIntroduction) && ((!z3 || this.mPrefs.mConfirmedSilenceIntroduction) && (!z4 || this.mPrefs.mConfirmedAlarmIntroduction))) {\n z = false;\n }\n this.mZenButtons.setVisibility(this.mHidden ? 8 : 0);\n this.mZenIntroduction.setVisibility(z ? 0 : 8);\n if (z) {\n if (z2) {\n i = R$string.zen_priority_introduction;\n } else if (z4) {\n i = R$string.zen_alarms_introduction;\n } else if (this.mVoiceCapable) {\n i = R$string.zen_silence_introduction_voice;\n } else {\n i = R$string.zen_silence_introduction;\n }\n this.mConfigurableTexts.add(this.mZenIntroductionMessage, i);\n this.mConfigurableTexts.update();\n this.mZenIntroductionCustomize.setVisibility(z2 ? 0 : 8);\n }\n String computeAlarmWarningText = computeAlarmWarningText(z3);\n TextView textView = this.mZenAlarmWarning;\n if (computeAlarmWarningText == null) {\n i2 = 8;\n }\n textView.setVisibility(i2);\n this.mZenAlarmWarning.setText(computeAlarmWarningText);\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\r\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\r\n\r\n\r\n for (int appWidgetId : appWidgetIds) {\r\n updateAppWidget(context, appWidgetManager, appWidgetId, appWidgetIds);\r\n }\r\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n\n\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n final int N = appWidgetIds.length;\n for (int i = 0; i < N; i++) {\n updateAppWidget(context, appWidgetManager, appWidgetIds[i], Color.MAGENTA);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n final int N = appWidgetIds.length;\n for (int i = 0; i < N; i++)\n {\n updateAppWidget(context, appWidgetManager, appWidgetIds[i]);\n }\n }", "public void updateComponents(){\n adapter.updateItems();\n }", "private void updateButtonsState() {\r\n ISelection sel = mTableViewerPackages.getSelection();\r\n boolean hasSelection = sel != null && !sel.isEmpty();\r\n\r\n mUpdateButton.setEnabled(mTablePackages.getItemCount() > 0);\r\n mDeleteButton.setEnabled(hasSelection);\r\n mRefreshButton.setEnabled(true);\r\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n final int N = appWidgetIds.length;\n for (int i=0; i<N; i++) {\n updateAppWidget(context, appWidgetManager, appWidgetIds[i]);\n }\n }", "protected void updateEnabled() {\n\t\tFieldGroup control = getUIControl();\n\t\tif (control != null) {\n\t\t\tCollection<? extends IRidget> ridgets = getRidgets();\n\t\t\tfor (IRidget ridget : ridgets) {\n\t\t\t\tridget.setEnabled(isEnabled());\n\t\t\t}\n\t\t\tcontrol.setEnabled(isEnabled());\n\t\t}\n\t}", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n\n for (int appWidgetId : appWidgetIds) {\n views = new RemoteViews(context.getPackageName(), R.layout.mywidget);\n //views.setProgressBar(R.id.progress_bar2, 100,0,true);\n updateAppWidget(context, appWidgetManager, appWidgetId);\n appWidgetManager2=appWidgetManager;\n contextt=context;\n appWidgetId2=appWidgetId;\n SetAlarm(context,1,mywidget.class);\n appWidgetManager.updateAppWidget(appWidgetId, views);\n\n }\n }", "public void UpdateCommandsUI(){\n Button B;\n try{\n for (int i = 0; i < f.getNumComp(); i++) {\n B = (Button) findViewById(300000 + i); //Buy Button\n if(dayOpen & (p.getMoney()>0)) {\n B.setEnabled(true);\n B.setTextColor(0xffffffff);\n } else if(dayOpen & (p.getLevel()>= 4)){\n B.setEnabled(true);\n B.setTextColor(0xffff0000);\n } else {\n B.setEnabled(false);\n B.setTextColor(0xff000000);\n }\n\n B = (Button) findViewById(400000 + i); //Sell Button\n if (dayOpen & (f.getSharesOwned(i) > 0)) {\n B.setEnabled(true);\n B.setTextColor(0xffffffff);\n } else if(p.getLevel()>=4 & !f.isShorted(i) & dayOpen){\n B.setEnabled(true);\n B.setTextColor(0xffff0000); //Red Color for short positions\n } else {\n B.setEnabled(false);\n B.setTextColor(0xff000000);\n }\n }\n } catch (Exception e){\n e.printStackTrace();\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager,\n int[] appWidgetIds) {\n LogHelper.log(String.format(\"Widget ID Count:%d\", appWidgetIds.length));\n\n // loop through existing widgets\n for (int index = 0; index < appWidgetIds.length; index++) {\n int appWidgetId = appWidgetIds[index];\n LogHelper.log(String.format(\"Widget ID:%d\", appWidgetId));\n\n RemoteViews appWidgetViews = getWidgetRemoteViews(context, appWidgetId);\n appWidgetManager.updateAppWidget(appWidgetId, appWidgetViews);\n }\n\n }", "public void updateAnalogWindowChilds() {\r\n\t\tif (this.analogTabItem != null && !this.analogTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.analogTabItem.updateChilds();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tDataExplorer.this.analogTabItem.updateChilds();\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}", "private void handleActionUpdateDriverWidget() {\n\n AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);\n int[] appWidgetIds = appWidgetManager\n .getAppWidgetIds(new ComponentName(this, WidgetProvider_Driver.class));\n\n //Trigger data update to handle the ListView widgets and force a data refresh\n appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_list_view_orders);\n\n //Now update all widgets\n WidgetProvider_Driver.updateDriverWidgets(this, appWidgetManager, appWidgetIds);\n\n\n }", "private void updateButtons() {\n\t\t SwingUtilities.invokeLater(new Runnable() {\n\t\t public void run() { \n\t\t botones[rowId1][columnId1].toggleOnOff();\n\t\t\t botones[rowId1][columnId1].setEnabled(true);\n\t\t\t \n\t\t\t botones[rowId2][columnId2].toggleOnOff();\n\t\t\t botones[rowId2][columnId2].setEnabled(true);\n\t\t\t \n\t\t\t setEnabled(true);\n\t\t\t \n\t\t timerPush.stop();\n\t\t }\n\t\t });\n\t }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n views.setEmptyView(R.id.list , R.id.empty_view);\n\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n// Log.d(\"로그\", \"위젯 onUpdate\");\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void update() {\n if ((mLikesDialog != null) && (mLikesDialog.isVisible())) {\n return;\n }\n\n if ((mCommentariesDialog != null) && (mCommentariesDialog.isVisible())) {\n return;\n }\n\n if (!getUserVisibleHint()) {\n return;\n }\n\n updateUI();\n }", "private void refreshControls() {\n\t// Scrollbars are upside-down from real sliders.\n\tint scrollValue = caeliScroll.getMaximum() - caeliScroll.getValue();\n\tcaeliValueLabel.setText( \"\"+(scrollValue / 100.0 ) );\n\tparent.setCaeliDensity( scrollValue / 100.0 );\n\n\t// Scrollbars are upside-down from real sliders.\n\tscrollValue = planetScroll.getMaximum() - planetScroll.getValue();\n\tplanetValueLabel.setText( \"\"+scrollValue );\n\tparent.setPlanetCount( scrollValue );\n\n\t// Scrollbars are upside-down from real sliders.\n\tscrollValue = triSizeScroll.getMaximum() - triSizeScroll.getValue()\n\t + triFineSizeScroll.getMaximum() - triFineSizeScroll.getValue();\n\t \n\ttriSizeValueLabel.setText( \"\"+(triSizeScroll.getMaximum() - triSizeScroll.getValue()) );\n\ttriFineSizeValueLabel.setText( \"\"+(triFineSizeScroll.getMaximum() - triFineSizeScroll.getValue()) );\n\tparent.setDustTrianglesThreshold( scrollValue );\n\n\t// Scrollbars are upside-down from real sliders.\n\tint strnScrollValue = attStrengthScroll.getMaximum() - attStrengthScroll.getValue();\n\tint distScrollValue = attDistanceScroll.getMaximum() - attDistanceScroll.getValue();\n\n\tattStrnValueLabel.setText( \"\"+strnScrollValue );\n\tattDistValueLabel.setText( \"\"+distScrollValue );\n\n\tparent.setAttraction( distScrollValue, strnScrollValue );\n\n\n\t// Refresh iPad display values\n\tosc.send( new OscMessage( \"/faders\", new Object[] { sliderFloatValue( caeliScroll ),\n\t\t\t\t\t\t\t sliderFloatValue( planetScroll ),\n\t\t\t\t\t\t\t sliderFloatValue( triSizeScroll ),\n\t\t\t\t\t\t\t sliderFloatValue( triFineSizeScroll ),\n\t\t\t\t\t\t\t sliderFloatValue( attDistanceScroll ),\n\t\t\t\t\t\t\t sliderFloatValue( attStrengthScroll ) } ),\n\t new NetAddress( ipadAddress, OSC_PORT_SEND ) );\n }", "public void update(){\n label = tag.getSelectedItemPosition() == 0 ? \"all\" : mLabel[tag.getSelectedItemPosition()];\n Refresh();\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n // Construct the RemoteViews object\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget_top3);\n\n //klikken op widget titel TextView opent de app\n Intent intent = new Intent(context, MainActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);\n views.setOnClickPendingIntent(R.id.titelTextView, pendingIntent);\n\n //update de UI\n String[] taaknamen = new TakenlijstDB(context).getWidgetTaken(3);\n views.setTextViewText(R.id.taak1TextView,\n taaknamen[0] == null ? \"\" : taaknamen[0]);\n views.setTextViewText(R.id.taak2TextView,\n taaknamen[1] == null ? \"\" : taaknamen[1]);\n views.setTextViewText(R.id.taak3TextView,\n taaknamen[2] == null ? \"\" : taaknamen[2]);\n\n // Instruct the widget manager to update the widget\n appWidgetManager.updateAppWidget(appWidgetId, views);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n Log.e(TAG, \"onUpdate action\");\n }", "private void updateWidgets(ShoppingList list) {\n AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);\n int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(this,\n ShoppingListWidgetProvider.class));\n ShoppingListWidgetProvider.updateAppWidgets(this, appWidgetManager, list, appWidgetIds);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n IDList = appWidgetIds;\n for (int appWidgetId : appWidgetIds) {\n\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "public void updateView()\n {\n int selectionCount = selection.getElementSelectionCount();\n\n // If only one item selected, enable & update the\n // text boxes and pull downs with values.\n if (selectionCount == 1) {\n // preserve selected state if a whole text field is selected\n Text text = WindowUtil.getFocusedText();\n boolean restoreSel = false;\n if ((text != null) &&\n (text.getSelectionCount() == text.getCharCount()))\n {\n restoreSel = true;\n }\n\n // get the selected item\n Iterator<FrameElement> iter =\n selection.getSelectedElementsIterator();\n\n // For each selected object, which there is only one.\n FrameElement elt = iter.next();\n\n if (elt instanceof IWidget) {\n IWidget widget = (IWidget) elt;\n\n view.useParameters(FrameEditorView.USE_SINGLE_SELECT);\n view.updateWidgetProperties(widget);\n }\n else if (elt instanceof FrameElementGroup) {\n FrameElementGroup eltGroup = (FrameElementGroup) elt;\n\n view.useParameters(FrameEditorView.USE_GROUP_SELECT);\n view.updateEltGroupProperties(eltGroup);\n }\n\n // Restore the selection state\n if (restoreSel) {\n text.selectAll();\n }\n }\n else if (selectionCount > 1) {\n // TODO: on multi selection, some values are left enabled\n // We need to set these to something or disable them.\n view.useParameters(FrameEditorView.USE_MULTI_SELECT);\n }\n else {\n view.useParameters(FrameEditorView.USE_NONE);\n view.updateFrameProperties(frame, false);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n // There may be multiple widgets active, so update all of them\n // Play around with the passed parameters to see how it affects the widget\n Log.d(\"TEMPLETE_Widget\", \"Widget onUpdate Received\");\n update(context,isLightMode(context));\n }", "private void updateUI() {\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n updateText();\n updateChart();\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "private void handleActionUpdateBakingWidgets(){\n AppDatabase myDatabase = RecipeRoomSingleton.getInstance(this);\n //If it's empty, forget it.\n if(myDatabase.daoAccess().getAll().isEmpty())return;\n //Get the items\n ArrayList<Ingredient> ingredients = (myDatabase.daoAccess().getAll()).get(0).getIngredients();\n //Get the WidgetManager\n AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);\n //Get the widget IDs\n int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(this, BakingWidget.class));\n //Notify the manager that the data has changed for the listview\n appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.appwidget_listview);\n\n //Update the appwidget\n BakingWidget.updateAppWidget(this, appWidgetIds, appWidgetManager, ingredients);\n }", "private void UpdateChecboxes()\r\n\t{\n\t\tfor (Iterator<CheckBox> iterator = this.CBlist.iterator(); iterator.hasNext();) \r\n\t\t{\r\n\t\t\t// for the next CheckBox\r\n\t\t\tCheckBox currChBox = iterator.next();\r\n\t\t\t\r\n\t\t\t// if the matching tag is true - \r\n\t\t\tif (this.hmTags.get(currChBox.getText()) == true)\r\n\t\t\t{\r\n\t\t\t\t// Check it\r\n\t\t\t\tcurrChBox.setChecked(true);\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "private void updateSubModeSpinnerTexts() {\n\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n\n startServiceToDisplayList(appWidgetId, context);\n\n handleRemoteViewClick(context);\n\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n\n //setup the intent such that it calls the service to populate the widget views\n Intent intent = new Intent(context, BucketListWidgetService.class);\n\n //add the app widget ID to the intent extras.\n intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);\n intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));\n\n //instantiate the RemoteViews object for the app widget layout\n RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.bucketlist_widget);\n //setup the adapter such that it populates the data\n rv.setRemoteAdapter(R.id.widget_listview, intent);\n //if there are no items in the bucket list, display this empty view\n rv.setEmptyView(R.id.widget_listview, R.id.empty_view);\n\n //setup onclick actions for the listview and empty view\n final Intent onClickIntent = new Intent(context, BucketListWidgetProvider.class);\n onClickIntent.setAction(BucketListWidgetProvider.CLICK_ACTION);\n onClickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);\n onClickIntent.setData(Uri.parse(onClickIntent.toUri(Intent.URI_INTENT_SCHEME)));\n final PendingIntent onClickPendingIntent = PendingIntent.getBroadcast(context, 0, onClickIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);\n rv.setOnClickPendingIntent(R.id.empty_view, onClickPendingIntent);\n rv.setPendingIntentTemplate(R.id.widget_listview, onClickPendingIntent);\n\n appWidgetManager.updateAppWidget(appWidgetId, rv);\n }\n\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n PlaybackService.startServiceToUpdateWidgets(context);\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n Intent intent = new Intent(context, AppWidgetService.class);\n intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);\n intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));\n\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget);\n views.setTextViewText(R.id.appwidget_text, Util.getAppWidgetRecipeNamePreference(context));\n views.setEmptyView(R.id.appwidget_ingredient_list, R.id.empty_view);\n views.setRemoteAdapter(appWidgetId, R.id.appwidget_ingredient_list, intent);\n\n appWidgetManager.updateAppWidget(appWidgetId, views);\n }\n\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n }", "public void refresh() {\r\n\t\tneeds.setText(needs());\r\n\t\tproduction.setText(production());\r\n\t\tjobs.setText(jobs());\r\n\t\tmarketPrices.setText(marketPrices());\r\n\t\tmarketSellAmounts.setText(marketSellAmounts());\r\n\t\tmarketBuyAmounts.setText(marketBuyAmounts());\r\n\t\tcompanies.setText(companies());\r\n\t\tmoney.setText(money());\r\n\t\ttileProduction.setText(tileProduction());\r\n\t\tcapital.setText(capital());\r\n\t\thappiness.setText(happiness());\r\n\t\tland.setText(land());\r\n\t\t//ArrayList of Agents sorted from lowest to highest in money is retrieved from Tile\r\n\t\tagents=tile.getAgentsByMoney();\r\n\t\tgui3.refresh();\r\n\t\tsliderPerson.setText(\"\"+agents.get(slider.getValue()).getMoney());\r\n\t\ttick.setText(tick());\r\n\t\tthis.pack();\r\n\t}", "private void updatePanels() // updatePanels method start\n\t{\n\t\tbalanceOutput.setText(log.balanceReport());\n\t\tlogOutput.setText(log.logReport());\n\t\tATBOutput.setText(log.adjustedTrialBalance());\n\t\tISOutput.setText(log.incomeStatement());\n\t\tRESOutput.setText(log.retainedEarningsStatement());\n\t\tBSOutput.setText(log.balanceSheet());\n\t}", "public void updateWidgetFor(String name) {\n }", "private void onUpdate(Context context) {\n AppWidgetManager appWidgetManager = AppWidgetManager.getInstance\n (context);\n\n // Uses getClass().getName() rather than MyWidget.class.getName() for\n // portability into any App Widget Provider Class\n ComponentName thisAppWidgetComponentName =\n new ComponentName(context.getPackageName(), getClass().getName()\n );\n int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisAppWidgetComponentName);\n onUpdate(context, appWidgetManager, appWidgetIds);\n }", "@Override\n\tpublic void onUpdate(Context ctxt, AppWidgetManager appWidgetManager,\n\t\t\tint[] appWidgetIds) {\n\t\t Log.w(LOG_TAG, \"onUpdate method called\");\n\t\t/* // Get all ids\n\t\t ComponentName thisWidget = new ComponentName(context,\n\t\t TaskWidget.class);\n\t\t int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);\n\n\t\t // Build the intent to call the service\n\t\t Intent intent = new Intent(context.getApplicationContext(),\n\t\t UpdateWidgetService.class);\n\t\t intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);\n\n\t\t // Update the widgets via the service\n\t\t context.startService(intent);*/\n for (int i=0; i<appWidgetIds.length; i++) {\n Intent svcIntent=new Intent(ctxt, WidgetService.class);\n\n svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]);\n svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));\n\n RemoteViews widget=new RemoteViews(ctxt.getPackageName(),\n R.layout.main);\n\n widget.setRemoteAdapter(appWidgetIds[i], R.id.widgetLV,\n svcIntent);\n\n Intent clickIntent=new Intent(ctxt, EditActivity.class);\n PendingIntent clickPI=PendingIntent\n .getActivity(ctxt, 0,\n clickIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n// widget.setPendingIntentTemplate(R.id.widgetLV, clickPI);\n widget.setOnClickPendingIntent(R.id.button, clickPI);\n appWidgetManager.updateAppWidget(appWidgetIds[i], widget);\n }\n\t}", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "public void updateWindowsForAnimator() {\n forAllWindows(this.mUpdateWindowsForAnimator, true);\n }", "@Override\r\n\tpublic void update() {\r\n\t\t// get the first element and set the values according to its\r\n\t\t// information\r\n\t\tIqmDataBox iqmDataBox = (IqmDataBox) this.workPackage.getSources().get(0);\r\n\t\tPlanarImage pi = iqmDataBox.getImage();\r\n\r\n\t\tjFormattedTextFieldOldWidth.setValue(pi.getWidth());\r\n\t\tjFormattedTextFieldOldHeight.setValue(pi.getHeight());\r\n\r\n\t\tint left = ((Number) jSpinnerLeft.getValue()).intValue();\r\n\t\tint right = ((Number) jSpinnerRight.getValue()).intValue();\r\n\t\tint top = ((Number) jSpinnerTop.getValue()).intValue();\r\n\t\tint bottom = ((Number) jSpinnerBottom.getValue()).intValue();\r\n\r\n\t\t// Set image dependent initial values;\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pi.getWidth() + left + right);\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.setValue(pi.getHeight() + top + bottom);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\t\t\r\n\t\tif (buttConst.isSelected()){\r\n\t\t\ttbConst.setTitleColor(Color.BLACK);\r\n\t\t\tjLabelConst.setEnabled(true);\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\ttbConst.setTitleColor(Color.GRAY);\r\n\t\t\tjLabelConst.setEnabled(false);\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\t\tthis.repaint(); //because of tb TitledBorder cahnge of color\r\n\t\t\r\n\r\n\t\tthis.updateParameterBlock();\r\n\t\tthis.setParameterValuesToGUI();\r\n\t}", "public void update() {\n\tfireContentsChanged(this, 0, getSize());\n }", "@Override\r\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n final int N = appWidgetIds.length;\r\n for (int i=0; i<N; i++) {\r\n updateAppWidget(context, appWidgetManager, appWidgetIds[i]);\r\n /*\r\n * Press the widget, send an broadcast to the broadcast receiver;\r\n * call onReceive() of the receiver.\r\n */\r\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.rotation_switcher);// get RemoteViews from xml file.\r\n Intent intent = new Intent(context, AutoSwitcherBroadcastReceiver.class); // MyReceiver.class is the receiver.\r\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context,0,intent,0);\r\n views.setOnClickPendingIntent(R.id.myImageView, pendingIntent); // similar to setOnClickListener()\r\n appWidgetManager.updateAppWidget(appWidgetIds, views);\r\n }\r\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n mContext = context;\n for (int appWidgetId : appWidgetIds) {\n\n\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.my_stocks);\n Intent widgetIntent = new Intent(context, MyStocksActivity.class);\n PendingIntent pi = PendingIntent.getActivity(context, 0, widgetIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n views.setPendingIntentTemplate(R.id.listView, pi);\n\n\n Intent i = new Intent(context, WidgetService.class);\n i.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);\n i.setData(Uri.parse(i.toUri(Intent.URI_INTENT_SCHEME)));\n views.setRemoteAdapter(R.id.listView, i);\n\n\n views.setEmptyView(R.id.listView, R.id.emptyList);\n\n\n // Instruct the widget manager to update the widget\n appWidgetManager.updateAppWidget(appWidgetId, views);\n\n }\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n }", "public void updateUi() {\n\t\t// // update the car color to reflect premium status or lack thereof\n\t\t// ((ImageView)findViewById(R.id.free_or_premium)).setImageResource(mIsPremium\n\t\t// ? R.drawable.premium : R.drawable.free);\n\t\t//\n\t\t// // \"Upgrade\" button is only visible if the user is not premium\n\t\t// findViewById(R.id.upgrade_button).setVisibility(mIsPremium ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // \"Get infinite gas\" button is only visible if the user is not\n\t\t// subscribed yet\n\t\t// findViewById(R.id.infinite_gas_button).setVisibility(mSubscribedToInfiniteGas\n\t\t// ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // update gas gauge to reflect tank status\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(R.drawable.gas_inf);\n\t\t// }\n\t\t// else {\n\t\t// int index = mTank >= TANK_RES_IDS.length ? TANK_RES_IDS.length - 1 :\n\t\t// mTank;\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(TANK_RES_IDS[index]);\n\t\t// }\n\t}", "@Override\n public void update() {\n this.blnDoUpdate.set(true);\n }", "private void refresh(int width, int height) {\n Integer numUnexposed = mainField.numUnexposed();\n nonminesLabel.setText(numUnexposed.toString());\n Integer numMarked = mainField.numMarked();\n if (numMarked < 0) {\n cellsUnmarked.setText(\"Too Many Marked!\");\n }\n else {\n cellsUnmarked.setText(numMarked.toString());\n }\n // iterate through all the buttons and update the text if it's an exposed cell\n for (int i = 0;i < width;i++) {\n for (int j = 0;j < height;j++) {\n int cellState = mainField.getCellState(i,j);\n if (cellState == mainField.EXPOSED) {\n Integer numValue = mainField.getValue(i,j);\n if (numValue == -1) {\n btArray[i][j].setText(\"B\");\n btArray[i][j].setStyle(\"-fx-background-color: #FF0000;\");\n }\n else if (numValue == 0) {\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n else {\n btArray[i][j].setText(numValue.toString());\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n }\n }\n }\n }", "protected void notifyDirty() {\n Event evt = new Event();\n evt.item = this;\n evt.widget = this;\n SelectionEvent event = new SelectionEvent(evt);\n for (SelectionListener listener : dirtyListener) {\n listener.widgetSelected(event);\n }\n }", "@Override\n\tpublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n\t\tfor (int appWidgetId : appWidgetIds) {\n\t\t\tupdateAppWidget(context, appWidgetManager, appWidgetId);\n\t\t}\n\t\tsuper.onUpdate(context, appWidgetManager, appWidgetIds);\n\t}", "public void updateAnalogWindow() {\r\n\t\tif (this.analogTabItem != null && !this.analogTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.analogTabItem.update(true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tDataExplorer.this.analogTabItem.update(true);\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}", "private void updateUI() {\n updateTrackDetails();\n //Disable Prev or Next or both button based on the current Index and number of tracks available\n if (mPlayingIndex == 0) {\n mPlayPrevBtn.setClickable(false);\n }\n if (mPlayingIndex == mTracks.size() - 1) {\n mPlayNextBtn.setClickable(false);\n }\n if (mPlayingIndex > 0 && mPlayingIndex < mTracks.size() - 1) {\n mPlayNextBtn.setClickable(true);\n mPlayPrevBtn.setClickable(true);\n }\n }", "private void updateControls() {\n updateBadge();\n etExtUsrId.setEnabled(isPushRegistrationAvailable() && !isUserPersonalizedWithExternalUserId());\n btnPersonalize.setEnabled(!isUserPersonalizedWithExternalUserId());\n btnDepersonalize.setEnabled(isUserPersonalizedWithExternalUserId());\n btnToInbox.setEnabled(isUserPersonalizedWithExternalUserId());\n }", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "public void refreshPanelComponents() {\r\n }", "@Override\r\n\tpublic void updateUpdateableElements(double deltaTime) {\n\t\tfor (int i = 0; i < buttons.length; i++) {\r\n\t\t\tbuttons[i].updateUpdateableElements(deltaTime);\r\n\t\t}\r\n\t\t\r\n\t\t// Update screen\r\n\t\tfor (int i = 0; i < screens.length; i++) {\r\n\t\t\tscreens[i].updateUpdateableElements(deltaTime);\r\n\t\t}\r\n\t\t\r\n\t}", "public void update() {\r\n\r\n // update attributes\r\n finishIcon.setColored(isDirty());\r\n cancelIcon.setColored(isDirty());\r\n finishButton.repaint();\r\n cancelButton.repaint();\r\n\r\n }", "private void updateUI() {\n mLatestFeedsAdapter.notifyDataSetChanged();\n }", "public void update()\n\t{\n\t\tJPanel panel = getPanel();\n\n\t\tif (panel instanceof StylePanel)\n\t\t\t((StylePanel) panel).updatePanel();\n\t}", "public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n // Create an Intent to refresh\n Intent refreshIntent = new Intent(context, WidgetProvider.class);\n refreshIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);\n refreshIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[]{appWidgetId});\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, refreshIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get the layout for the App Widget\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);\n views.setOnClickPendingIntent(R.id.rootView, pendingIntent);\n\n randomNumber = (int) (Math.random() * 100);\n Intent serviceIntent = new Intent(context, WidgetRemoteViewsService.class);\n serviceIntent.setData(Uri.fromParts(\"content\", String.valueOf(appWidgetId + randomNumber), null));\n views.setRemoteAdapter(R.id.listView, serviceIntent);\n\n // Tell the AppWidgetManager to perform an update on the current app widget\n appWidgetManager.updateAppWidget(appWidgetId, views);\n }\n }", "private void updateButtons() {\n\t\tif(buttonCount>1){\n\t\t\tremoveTableButton.setEnabled(true);\n\t\t}\n\t\telse{\n\t\t\tremoveTableButton.setEnabled(false);\n\t\t}\n\t\tif(buttonCount<tablesX.length){\n\t\t\taddTableButton.setEnabled(true);\n\t\t}\n\t\telse{\n\t\t\taddTableButton.setEnabled(false);\n\t\t}\n\t}", "private void updateGUI() {\n\t\tsfrDlg.readSFRTableFromCPU();\n\t\tsourceCodeDlg.updateRowSelection(cpu.PC);\n\t\tsourceCodeDlg.getCyclesLabel().setText(\"Cycles count : \" + cpu.getCyclesCount());\n\t\tdataMemDlg.fillDataMemory();\n\t\t//ioPortsDlg.fillIOPorts();\t\t\n\t\tIterator iter = seg7DlgList.iterator();\n\t\twhile(iter.hasNext())\n\t\t\t((GUI_7SegDisplay)iter.next()).drawSeg();\n\t}", "@Override\r\n\tpublic void drawUpdateableElements(Graphics g, ImageObserver observer) {\n\t\tfor (int i = 0; i < buttons.length; i++) {\r\n\t\t\tbuttons[i].drawUpdateableElements(g, observer);\r\n\t\t}\r\n\t\t\r\n\t\t// draw selected screen updateable\r\n\t\tthis.screens[this.selectedIndex].drawUpdateableElements(g, observer);\r\n\t}", "private void updateDialog() {\n for (int i = 0; i < NUMBER_OF_CARD_BACKGROUNDS; i++) {\n linearLayoutsBackgrounds[i].setBackgroundResource(i == selectedBackground ? R.drawable.settings_highlight : typedValue.resourceId);\n }\n\n for (int i = 0; i < NUMBER_OF_CARD_BACKGROUNDS; i++) {\n imageViews[i].setImageBitmap(bitmaps.getCardBack(i, selectedBackgroundColor));\n }\n\n for (int i = 0; i < 4; i++) {\n linearLayoutsColors[i].setBackgroundResource(i == selectedBackgroundColor ? R.drawable.settings_highlight : typedValue.resourceId);\n }\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n Recipe recipe = RecipeAppWidgetConfigure.loadRecipe(context, appWidgetId);\n if (recipe != null) {\n updateAppWidget(context, appWidgetManager, recipe, appWidgetId);\n }\n }\n }", "private void notifyWidget() {\n if (getActivity() != null) {\n ComponentName widget = new ComponentName(getActivity().getApplication(),\n RecipeWidgetProvider.class);\n AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getActivity());\n int[] ids = appWidgetManager.getAppWidgetIds(widget);\n appWidgetManager.notifyAppWidgetViewDataChanged(ids, R.id.widget_list);\n RecipeWidgetProvider widgetProvider = new RecipeWidgetProvider();\n widgetProvider.updateWidget(getActivity().getApplication(), ids);\n }\n }", "public void updateDisplay()\r\n {\r\n boardpanel.removeAll();\r\n for(int i = 0; i < 3; i++)\r\n {\r\n for(int j = 0; j < 3; j++)\r\n {\r\n if(buttons[i][j].getText().charAt(0) == ' ') {\r\n buttons[i][j].setEnabled(true);\r\n }\r\n else\r\n {\r\n buttons[i][j].setEnabled(false);\r\n }\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "private void updateAll() {\n updateAction();\n updateQueryViews();\n }", "private void updateUI() {\n Log.i(DEBUG.TAG, \"BTDevicesActivity - updateUI - start\");\n\n btnBTScan.setEnabled(btAdapter.isEnabled() && !btAdapter.isDiscovering());\n\n if (btAdapter.isDiscovering())\n btnBTScan.setText(R.string.btn_bt_devices_scan_running_text);\n else\n btnBTScan.setText(R.string.btn_bt_devices_scan_text);\n tglBTToggle.setChecked(btAdapter.isEnabled());\n\n // remove all found (if any) devices when BT is disabled\n if (!btAdapter.isEnabled())\n lvAdapter.clear();\n\n if (lvAdapter.getCount() > 0)\n tvHeader.setText(R.string.tv_bt_devices_header_text_devices_found);\n else\n tvHeader.setText(R.string.tv_bt_devices_header_text_no_devices);\n\n Log.i(DEBUG.TAG, \"BTDevicesActivity - updateUI - finish\");\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n Intent buttonIntent = new Intent(context, PassiveJammerService.class);\n buttonIntent.setAction(ACTION_WIDGET_PASSIVE);\n PendingIntent pendingButtonIntent = PendingIntent.getService(context, 0, buttonIntent, 0);\n\n // wrap the whole widget layout in a view to capture button and text touch\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.passive_control_widget);\n views.setOnClickPendingIntent(R.id.passive_control_button, pendingButtonIntent);\n\n appWidgetManager.updateAppWidget(appWidgetId, views);\n\n //TODO check and start the Passive service to account for Android 11\n // can't create widget on screen if service already running...\n Log.d(\"PS_WIDGET\", \"press the button and update!\");\n\n /*\n Intent mainIntent = new Intent(context, MainActivity.class);\n mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(mainIntent);\n */\n\n\n ActivityManager manager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE);\n assert manager != null;\n for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n if (PassiveJammerService.class.getName().equals(service.service.getClassName())) {\n Toast.makeText(context, \"service already running\", Toast.LENGTH_SHORT).show();\n Log.d(\"PS_WIDGET\", \"service running\");\n }\n else {\n // Sam4 said service NOT started when it was, still worked though\n Toast.makeText(context, \"service NOT started\", Toast.LENGTH_SHORT).show();\n Log.d(\"PS_WIDGET\", \"service NOT running\");\n }\n }\n }\n }", "private void updatePanel() {\n\t\tProbeUtilities.updateModelProbePanel();\n\t}", "private void updateUI() {\n Bite bite = BiteLab.get(getActivity()).getBite(mBiteId);\n\n mPlacementTextView.setText(bite.getPlacement());\n\n Calendar c = bite.getCalendar();\n int year = c.get(Calendar.YEAR);\n int month = c.get(Calendar.MONTH)+1;\n int day = c.get(Calendar.DAY_OF_MONTH);\n mDateTextView.setText(getString(R.string.show_date, day, month, year));\n\n mDaysSinceBiteTextView.setText(getString(R.string.days_since_bite\n , bite.getDaysSinceBite()));\n\n mStageTextView.setText(getString(R.string.show_stage, bite.getStage()));\n }", "public void updateDigitalWindowChilds() {\r\n\t\tif (this.digitalTabItem != null && !this.digitalTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.digitalTabItem.updateChilds();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tDataExplorer.this.digitalTabItem.updateChilds();\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}" ]
[ "0.7656193", "0.7297317", "0.714009", "0.7135275", "0.6749839", "0.67158055", "0.66727895", "0.6530493", "0.65155786", "0.6509987", "0.64944255", "0.6487007", "0.6481362", "0.6456751", "0.6446927", "0.6446927", "0.6446927", "0.6443015", "0.64248186", "0.64102197", "0.6405948", "0.63872164", "0.63796777", "0.6375777", "0.6349839", "0.63407457", "0.63302815", "0.6325425", "0.6318881", "0.63126564", "0.6291697", "0.6286114", "0.6274798", "0.62541807", "0.62541807", "0.62541807", "0.62541807", "0.62541807", "0.62541807", "0.62541807", "0.62541807", "0.6250458", "0.62386173", "0.6229441", "0.6226361", "0.6224175", "0.6224175", "0.6222276", "0.62182647", "0.6206024", "0.62044007", "0.6199613", "0.6195471", "0.6194287", "0.6180853", "0.6170106", "0.6157504", "0.6148832", "0.6138275", "0.6113248", "0.61069167", "0.6105407", "0.61036277", "0.6087673", "0.6075953", "0.60753065", "0.6066043", "0.60620874", "0.6061183", "0.6052521", "0.60463136", "0.6045689", "0.6038903", "0.6036079", "0.60218287", "0.60188067", "0.60044223", "0.60036075", "0.59887064", "0.5983485", "0.5968181", "0.5966403", "0.59661746", "0.59571725", "0.59520596", "0.594596", "0.5937796", "0.59376293", "0.59303015", "0.5897019", "0.58939785", "0.58930355", "0.58927965", "0.5892013", "0.587963", "0.58776027", "0.58623433", "0.5852172", "0.5850865", "0.5846515" ]
0.6543706
7
Enter relevant functionality for when the first widget is created
@Override public void onEnabled(Context context) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onEnabled(Context context) {\n // Enter relevant functionality for when the first widget is created\n }", "public abstract Widget onInitialize();", "public abstract void initUiAndListener();", "private void initUI() {\n }", "private void initUI() {\n tvQuote = (TextView) findViewById(R.id.tvQuote);\n tvBeginButton = (TextView) findViewById(R.id.tvBeginButton);\n\n tvBeginButton.setOnClickListener(this);\n\n loadBackground();\n }", "@Override\n protected void windowInit ()\n {\n }", "public void onNew() {\t\t\n\t\tdesignWidget.addNewForm();\n\t}", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "private void dynInit()\r\n\t{\t\t\r\n\t\t//\tInfo\r\n\t\tstatusBar.setStatusLine(Msg.getMsg(Env.getCtx(), \"InOutGenerateSel\"));//@@\r\n\t\tstatusBar.setStatusDB(\" \");\r\n\t\t//\tTabbed Pane Listener\r\n\t\ttabbedPane.addChangeListener(this);\r\n\t}", "private void init() {\n setText(\"Case Name\");\n createFieldsComp();\n GuiUtil.addSeparator(shell, SWT.HORIZONTAL);\n createBottomActionButtons();\n }", "private void setUpWidgets(){\n\n }", "public void init()\n {\n buildUI(getContentPane());\n }", "@Override\n\tprotected void initAddButton() {\n addBtn = addButton(\"newBtn\", TwlLocalisationKeys.ADD_BEAT_TYPE_TOOLTIP, new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tnew AddEditBeatTypePanel(true, null, BeatTypesList.this).run(); // adding\n\t\t\t\t}\n\t }); \t\t\n\t}", "private void initiateInternal() {\n\n //define adaptation listener\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(ComponentEvent e) {\n adapt(e);\n }\n });\n\n //solve problem with unloading of internal components\n setExtendedState(ICONIFIED | MAXIMIZED_BOTH);\n //the set visible must be the last thing called \n pack();\n setExtendedState(MAXIMIZED_BOTH);\n setVisible(true);\n }", "@Override\n public void Create() {\n\n initView();\n }", "public void onStart() {\r\n\t\tthis.setVisible(true);\r\n\t}", "private void initUI()\r\n\t{\r\n\t\tthis.label = new Label();\r\n\t\t\r\n\t\tthis.label.setText(\"This view is also saveable\");\r\n\t\t\r\n\t\tthis.label.setSizeUndefined();\r\n\t\tthis.add(this.label);\r\n\t\tthis.setSizeFull();\r\n\t}", "protected void onPostInitUI() {\n if (hasPositiveButton()) {\n getPositiveButton().addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n onPositiveButtonClicked();\n }\n });\n }\n if (hasNegativeButton()) {\n getNegativeButton().addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n onNegativeButtonClicked();\n }\n });\n }\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "private GUIReminder() {\n\n initComponents();\n initOthers();\n\n }", "@Override\n\t\tpublic void postInit(){\n\t\tsuper.postInit();\n\t\tthis.buttonList.add(this.readDescription = new GuiButton(6, this.width - 110, 2, 100, 20, \"World Description\"));\n\t\tthis.readDescription.enabled = false;\n\t}", "private void init() {\n initView();\n setListener();\n }", "protected void initUI() {\n\r\n\t\t((Button) findViewById(R.id.project_site_start_wifiscan_button)).setOnClickListener(this);\r\n\r\n\t\t// ((Button) findViewById(R.id.project_site_calculate_ap_positions_button)).setOnClickListener(this);\r\n\r\n\t\t// ((Button) findViewById(R.id.project_site_add_known_ap)).setOnClickListener(this);\r\n\r\n\t\t((Button) findViewById(R.id.project_site_step_detect)).setOnClickListener(this);\r\n\t\t\r\n\t\t((ToggleButton) findViewById(R.id.project_site_toggle_autorotate)).setOnClickListener(this);\r\n\r\n\t\tmultiTouchView = ((MultiTouchView) findViewById(R.id.project_site_resultview));\r\n\t\tmultiTouchView.setRearrangable(false);\r\n\r\n\t\tmultiTouchView.addDrawable(map);\r\n\r\n\t\tif (site.getTitle().equals(ProjectSite.UNTITLED)) {\r\n\t\t\tshowDialog(DIALOG_TITLE);\r\n\t\t} else {\r\n\t\t\tif (freshSite) {\r\n\t\t\t\t// start configuration dialog\r\n\t\t\t\tshowDialog(DIALOG_FRESH_SITE);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private void init() {\n LayoutInflater inflater = getActivity().getLayoutInflater();\n layout = inflater.inflate(R.layout.approvalaction_popup, null);\n showButton();\n bindButtonClick();\n }", "private void initGui() {\n initSeekBar();\n initDateFormatSpinner();\n GuiHelper.defineButtonOnClickListener(view, R.id.settings_buttonSave, this);\n\n }", "@Override\n\tpublic void initUi() {\n\t\tlayoutShowContact = currentView.findViewById(R.id.contact_layout_show);\n\t\tlayoutShowContact.setOnClickListener(clickListener);\n\t\tsetTitle(R.string.contact);\n\t}", "private void initFormCreateMode() {\n initSpinnerSelectionChamps();\n //TODO\n }", "protected void init() {\r\n\t\tsetBackground(Color.black);\r\n\t\tsetForeground(Color.white);\r\n\t\taddMouseListener(this);\r\n\t\taddMouseMotionListener(this);\r\n\t\tcreateSelection();\r\n\t\tsel.addListener(this);\r\n\t\tcreateSection();\r\n\t\tsection.addListener(this);\r\n\t\tsetOpaque(true);\r\n\t\tremoveAll();\r\n\t}", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }", "@Override\n public void initGUI() {\n\n }", "private void initial() {\n\t\tsetTitleTxt(getString(R.string.choose_game));\n\t\tLinearLayout contentView = (LinearLayout) findViewById(R.id.contentView);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\n\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tview = View.inflate(this, R.layout.user_choose_game, null);\n\t\tcontentView.addView(view, params);\n\t\tgameGrid = (GridView) view.findViewById(R.id.game_list);\n\t\tgameContent = (LinearLayout) view.findViewById(R.id.game_list_info);\n\t\tview.setVisibility(View.GONE);\n\t}", "protected void initControl() {\n\t\t\r\n\t}", "void initUI();", "public void onModuleLoad() { \n\t\tsingleton = this;\n\t\t\n\t\tdockPanel.setWidth(\"100%\");\n\t\tdockPanel.setSpacing(8);\n\t\t\n\t\tmenuBar.setVisible(false);\n\t\tmenuBar.setStyleName(\"menu\");\n\t\t\n\t\tflowPanel.setWidth(\"100%\");\n\t\tflowPanel.add(menuBar);\n\t\t\n\t\tstatusBar.setVisible(false);\n\t\tstatusBar.setStyleName(\"status\");\n\t\t\n\t\tflowPanel.add(statusBar);\n\t\t\n\t\tdockPanel.add(flowPanel,DockPanel.NORTH);\n\t\t\n\t\tloginPanel.setVisible(false);\n\t\tdockPanel.add(loginPanel,DockPanel.WEST);\n\t\t\n\t\tpublisherListPanel.setVisible(false);\n\t\tpublisherListPanel.setWidth(\"100%\");\n\t\tdockPanel.add(publisherListPanel,DockPanel.CENTER);\n\t\t\n\t\tRootPanel.get(\"publisher\").add(dockPanel);\n\t}", "@FXML\r\n private void initialize() {\r\n addButton.setOnAction(new EventHandler<ActionEvent>() {\r\n @Override\r\n public void handle(ActionEvent event) {\r\n handleOk();\r\n }\r\n });\r\n\r\n cancelButton.setOnAction(new EventHandler<ActionEvent>() {\r\n @Override\r\n public void handle(ActionEvent event) {\r\n handleCancel();\r\n }\r\n });\r\n }", "private void initUI() {\n // deal with toolbar\n setSupportActionBar(activityToolbar);\n if(getSupportActionBar() != null) {\n getSupportActionBar().setTitle(\"\");\n } else {\n Timber.w(\"Action bar is null? Strange behavior might occur\");\n }\n\n // deal with nav drawer\n drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n drawerLayout.addDrawerListener(drawerListener);\n\n }", "public MainView() {\n initComponents();\n addWindowListener(new AreYouSure());\n }", "private void initComponent()\n {\n groupName = findViewById(R.id.groupName);\n groupId = findViewById(R.id.gId);\n groupAddress = findViewById(R.id.gAddress);\n groupDescription = findViewById(R.id.gDescription);\n bCreate = findViewById(R.id.bCreate);\n rPublic = findViewById(R.id.rSecret);\n fTime = findViewById(R.id.fTime);\n toolbar = findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n calendar = Calendar.getInstance();\n progressBar = findViewById(R.id.progress);\n\n //set scrollview in description editText\n groupDescription.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n if(v.getId() == R.id.txtNotice){\n v.getParent().requestDisallowInterceptTouchEvent(true);\n switch (event.getAction() & MotionEvent.ACTION_MASK){\n case MotionEvent.ACTION_UP:\n v.getParent().requestDisallowInterceptTouchEvent(false);\n break;\n }\n }\n return false;\n }\n });\n\n\n sharedPreferenceData = new SharedPreferenceData(this);\n currentUserName = sharedPreferenceData.getCurrentUserName();\n someMethod = new NeedSomeMethod(this);\n internetIsOn = new CheckInternetIsOn(this);\n dialogClass = new AlertDialogClass(this);\n }", "private void viewInit() {\n }", "private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}", "@Override\n public void Create() {\n initView();\n initData();\n }", "@Override\n public void initView() {\n }", "private void initialize() {\r\n\r\n // add default buttons\r\n addButton(getToggleButton(),\"toggle\");\r\n addButton(getFinishButton(),\"finish\");\r\n addButton(getCancelButton(),\"cancel\");\r\n addActionListener(new ActionListener() {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n String cmd = e.getActionCommand();\r\n if(\"toggle\".equalsIgnoreCase(cmd)) change();\r\n else if(\"finish\".equalsIgnoreCase(cmd)) finish();\r\n else if(\"cancel\".equalsIgnoreCase(cmd)) cancel();\r\n }\r\n\r\n });\r\n\r\n }", "private void afterInitComponents() {\n \t\t\n \t}", "private void initProcess(){\n this.getScPanelFriends().getViewport().setOpaque(false);\n this.getScPanelTopics().getViewport().setOpaque(false);\n this.getCenterPanel().setSize(0,0);\n this.getEastPanel().setSize(1700,800);\n //Administrador inhabilitado por defecto hasta implementación\n this.getBtnAdmin().setEnabled(false);\n this.getMenuOption().setLocationRelativeTo(this);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@Override \n protected void startup() {\n GretellaView view = new GretellaView(this);\n show( view );\n view.initView(); \n }", "public void installFirstDrawTrigger() {\n mFrameAdapter.getFrameContainer().getViewTreeObserver().addOnGlobalLayoutListener(\n mFirstDrawTrigger);\n }", "@Override\r\n protected void onFinishInflate() {\r\n initComponents();\r\n }", "public void onCreateClick(){\r\n\t\tmyView.advanceToCreate();\r\n\t}", "@Override\n\tprotected void initContentView() {\n\t\t\n\t}", "void init() {\n setVisible(true);\n\n }", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initUIandEvent()\n\t{\n\t\tnew Handler(Looper.getMainLooper()).postDelayed(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tIntent i = new Intent(MainActivity.this, LiveRoomActivity.class);\n\t\t\t\t\ti.putExtra(ConstantApp.ACTION_KEY_CROLE, Constants.CLIENT_ROLE_AUDIENCE);\n\t\t\t\t\ti.putExtra(ConstantApp.ACTION_KEY_ROOM_NAME, \"channel_00_01\");\n\t\t\t\t\tstartActivity(i);\n\t\t\t\t\tMainActivity.this.finish();\n\t\t\t\t}\n\t\t}, 1000);\n\t\t//finish();\n\t}", "private static void initAndShowGUI() {\n }", "@Override\r\n\tprotected void initEvents() {\n\t\t\r\n\t}", "@Override\r\n \tpublic void start(AcceptsOneWidget panel, EventBus eventBus) {\n \t\tpanel.setWidget(view);\t\t\r\n \t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "public void initGui()\n {\n StringTranslate var1 = StringTranslate.getInstance();\n int var2 = this.func_73907_g();\n\n for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)\n {\n this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));\n }\n\n this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey(\"gui.done\")));\n this.screenTitle = var1.translateKey(\"controls.minimap.title\");\n }", "protected void setupUI() {\n\n }", "@Override\r\n\tpublic void initEvent() {\n\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "private void initializeUI() {\n MedUtils.displayMedInfo(coverArt, playBinding.thumbIv, playBinding.titleTv,\n playBinding.subtitleTv, selectedMed);\n\n playBinding.playPauseBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switch (MediaPlayerService.getState()) {\n case Constants.STATE_PLAY:\n mediaPlayerService.pauseAction();\n break;\n case Constants.STATE_PAUSE:\n mediaPlayerService.playAction();\n break;\n case Constants.STATE_NOT_INIT:\n startMediaPlayerService();\n break;\n }\n }\n });\n\n playBinding.stopBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mediaPlayerService.stopAction();\n }\n });\n }", "private void initView() {\n\n }", "private void initDialog() {\n }", "private void inicialize() {\n\t\t\n\t\t/**\n\t\t * Labels e textField of the page:\n\t\t * Nome\n\t\t * Descrição\n\t\t */\n\n\t\tJLabel lblNome = new JLabel(\"Nome\");\n\t\tlblNome.setBounds(5, 48, 86, 28);\n\t\tlblNome.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\tcontentPanel.add(lblNome);\n\t\t\n\t\tJLabel lblDescricao = new JLabel(\"Descrição\");\n\t\tlblDescricao.setBounds(5, 117, 86, 51);\n\t\tlblDescricao.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\tcontentPanel.add(lblDescricao);\n\t\t\n\t\ttextFieldNome = new JTextField();\n\t\ttextFieldNome.setBounds(103, 45, 290, 35);\n\t\ttextFieldNome.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\ttextFieldNome.setColumns(10);\n\t\tcontentPanel.add(textFieldNome);\n\t\t\n\t\ttextFieldDescricao = new JTextArea();\n\t\ttextFieldDescricao.setBackground(Color.WHITE);\n\t\ttextFieldDescricao.setLineWrap(true);\n\t\ttextFieldDescricao.setBounds(101, 118, 290, 193);\n\t\ttextFieldDescricao.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\ttextFieldDescricao.setColumns(10);\n\t\tcontentPanel.add(textFieldDescricao);\n\n\t\t/**\n\t\t * Confirmation panel\n\t\t * Confirmation button\n\t\t * Cancellation button\n\t\t */\n\n\t\tpainelConfirmacaoSetup();\n\t}", "@Override\n public void setWidget(Object arg0)\n {\n \n }", "private void initialize() {\n this.setLayout(new CardLayout());\n this.setName(this.extension.getMessages().getString(\"spiderajax.options.title\"));\n \t if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {\n \t \tthis.setSize(391, 320);\n \t }\n this.add(getPanelProxy(), getPanelProxy().getName()); \n \t}", "private void initialize() {\r\n //this.setVisible(true);\r\n \r\n\t // added pre-set popup menu here\r\n// this.add(getPopupFindMenu());\r\n this.add(getPopupDeleteMenu());\r\n this.add(getPopupPurgeMenu());\r\n\t}", "@Override\n public void initView() {\n\n }", "private void initializeWidgets() {\n resultTextView = findViewById(R.id.resultTextView);\n\n goBackButton = findViewById(R.id.goBackButton);\n goBackButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n finish();\n }\n });\n }", "@Override\r\n public void initControl() {\n \r\n }", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\tdisplayEvent();\n\t}", "public void setup() {\n self.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n // make dialog background unselectable\n self.setCanceledOnTouchOutside(false);\n }", "@Override protected void startup() {\n show(new FrontView());\n //show(new RestaurantManagementView(this));\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tinitView();\n\t\tinitData();\n\t\tsetOnClick();\n\t\tdelete();\n\t}", "public void init() {\r\n this.getChildren().clear();\r\n \r\n setAlignment(Pos.TOP_CENTER);\r\n setVgap(10);\r\n setHgap(10);\r\n setPadding(new Insets(25, 25, 25, 25));\r\n \r\n descriptionField.setMaxWidth(250);\r\n \r\n add(titleLabel, 0, 0);\r\n add(titleField, 1, 0);\r\n \r\n add(descLabel, 0, 1);\r\n add(descriptionField, 1, 1);\r\n \r\n add(urlLabel, 0, 2);\r\n add(urlField, 1, 2);\r\n \r\n add(addLabel, 0, 3);\r\n add(addIntensityBox, 1, 3);\r\n \r\n add(moviesLabel, 0, 4);\r\n add(includesMoviesBox, 1, 4);\r\n \r\n add(showsLabel, 0, 5);\r\n add(includesShowsBox, 1, 5);\r\n \r\n add(loginLabel, 0, 6);\r\n add(requiresLoginBox, 1, 6);\r\n \r\n \r\n add(addMovieSiteButton, 1, 7);\r\n \r\n addMovieSiteButton.setOnAction(e -> {\r\n String name = titleField.getText();\r\n String desc = descriptionField.getText();\r\n String url = urlField.getText();\r\n \r\n String addText = addIntensityBox.getText();\r\n \r\n int addIntensity = Integer.parseInt(addText.isEmpty() ? \"0\" : addText );\r\n boolean movies = includesMoviesBox.isSelected();\r\n boolean shows = includesShowsBox.isSelected();\r\n boolean login = requiresLoginBox.isSelected();\r\n \r\n if (name.matches(\"(\\\\p{L}){4,}\") && url.matches(\"www\\\\.[a-z0-9A-Z]{2,}\\\\.[a-z]+\")) {\r\n new MovieSite(name, desc, url, addIntensity, movies, shows, login);\r\n \r\n controller.getMainAppView().onMovieSitesClick(new ActionEvent());\r\n } else {\r\n \r\n controller.alert(\"Chyba\", \"\", \"Vyplňte alespoň název (alespoň 4 znaky a bez mezer) a url stránky (ve tvaru www.[jméno].[doména]!\");\r\n }\r\n \r\n \r\n \r\n \r\n });\r\n }", "private void init()\n {\n btnUser.setOnAction(buttonHandler);\n btnHome.setOnAction(event -> changeScene(\"store/fxml/home/home.fxml\"));\n btnCategories.setOnAction(event -> changeScene(\"store/fxml/category/categories.fxml\"));\n btnTopApps.setOnAction(buttonHandler);\n btnPurchased.setOnAction(buttonHandler);\n btnMenu.setOnAction(buttonHandler);\n btnSearch.setOnAction(buttonHandler);\n btnFeatured.setOnAction(buttonHandler);\n\n itmLogout = new MenuItem(\"Logout\");\n itmAddApp = new MenuItem(\"Add app\");\n itmUsers = new MenuItem(\"Manage users\");\n itmCategories = new MenuItem(\"Manage categories\");\n\n itmAddApp.setOnAction(itemHandler);\n itmLogout.setOnAction(itemHandler);\n itmUsers.setOnAction(itemHandler);\n itmCategories.setOnAction(itemHandler);\n\n if (user.getId() != null)\n {\n btnMenu.setVisible(true);\n if (user.getAdmin())\n btnMenu.getItems().addAll(itmAddApp, itmCategories, itmUsers, itmLogout);\n else\n btnMenu.getItems().add(itmLogout);\n\n ImageView imageView = new ImageView(user.getPicture());\n imageView.setFitHeight(25);\n imageView.setFitWidth(25);\n\n btnUser.setText(user.getUsername());\n }\n else\n btnMenu.setVisible(false);\n }", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\r\n\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\r\n\t}", "@Override\n public void initGui()\n {\n super.initGui();\n }", "@Override\n public void onStart() {\n super.onStart();\n updateUI();\n }", "public startingMenu() {\r\n initComponents();\r\n }", "public abstract void onInit();", "@Override\n\tprotected void InitButtonListener() {\n\t\tLayoutTop.setOnClickListener(new View.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\tClickOption();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "private void initialize() {\n\tif (setup == false) {\n\t elementList.add(new GUISlider());\n\t elementList.add(new GUIChart());\n\t elementList.add(new GUIStatsDisplay());\n\t elementList.add(new GUIPID());\n\t elementList.add(new GUITimer());\n\t elementList.add(new GUINumericUpDown());\n\t setup = true;\n\t}\n }", "public TodoGUI() {\r\n todoChooserGui();\r\n }", "public void initWidgets(){\n\n g = (Globals)getApplication();\n\n //Application\n context = this;\n res = context.getResources();\n\n //Objekt\n mannschaft = g.getMannschaft();\n statistik = new Statistik();\n statistikwerte = new Statistikwerte();\n isUpdate = getIntent().getExtras().getBoolean(\"Update\");\n\n //Input-Widgets\n heim = (RadioGroup) findViewById(R.id.radioHeimAuswärts);\n gegner = (EditText) findViewById(R.id.gegnerbezeichnung);\n spielerListView = new SwipeMenuEditDelete(this, mannschaft, (SwipeMenuListView)findViewById(R.id.spielerList), new Spieler(), R.layout.swipemenu_item, false, false, false, true);\n anlegen = (Button) findViewById(R.id.stati_Anlegen);\n\n //Variablen\n spieler = new ArrayList<Spieler>();\n kategorien = new ArrayList<Kategorie>();\n datum = new Date();\n\n }" ]
[ "0.715538", "0.7002158", "0.6855211", "0.66847444", "0.6628957", "0.6619105", "0.66157687", "0.6520471", "0.6480197", "0.6431846", "0.641436", "0.63807935", "0.63721234", "0.6347073", "0.63405263", "0.63396084", "0.6333276", "0.63222086", "0.63017315", "0.6289287", "0.62836015", "0.6283359", "0.62593704", "0.62120783", "0.6206465", "0.6203842", "0.6187872", "0.61733097", "0.6160458", "0.6155827", "0.6144275", "0.61442196", "0.61358833", "0.6135225", "0.6133366", "0.6133062", "0.6127421", "0.6126418", "0.61236787", "0.6116742", "0.61128294", "0.6110151", "0.60938793", "0.608378", "0.6077107", "0.60764706", "0.6075842", "0.6075371", "0.6075371", "0.60721546", "0.6069784", "0.6064686", "0.6062066", "0.6056229", "0.6054631", "0.6049548", "0.60493255", "0.6043036", "0.60396475", "0.60376173", "0.6028715", "0.60280144", "0.60280144", "0.60192245", "0.6014575", "0.6011432", "0.6011384", "0.6011384", "0.60079473", "0.60041994", "0.5997207", "0.59911823", "0.5986873", "0.5984791", "0.5982719", "0.59817773", "0.5980645", "0.5975888", "0.59741944", "0.59741944", "0.59741944", "0.59741944", "0.59741944", "0.59741944", "0.59685993", "0.59616184", "0.5961411", "0.59523654", "0.5946995", "0.59457797", "0.5945508", "0.5945508", "0.5943934", "0.5939491", "0.5933506", "0.5931528", "0.5929658", "0.5929432", "0.59248674", "0.59218025", "0.5919066" ]
0.0
-1
Enter relevant functionality for when the last widget is disabled
@Override public void onDisabled(Context context) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onDisabled(Context context) {\n // Enter relevant functionality for when the last widget is disabled\n }", "@Override\n public void onEnabled(Context context) {\n // Enter relevant functionality for when the first widget is created\n }", "@Override\n public void onDisabled() {\n }", "private void disableButtons()\r\n {\r\n }", "void outOfTime() {\r\n\r\n disableOptionButtons();\r\n }", "protected void onDisabled() {\n // Do nothing.\n }", "public void onDisable() {\r\n }", "public void updateDisabledButtons() {\n\t\t//at least 3 credits should be there for perform add max action\n\t\tif (obj.getCredit() < 3)\n\t\t\taddMax.setEnabled(false);\n\t\t//at least a credit should be there for perform add max action\n\t\tif (obj.getCredit() == 0)\n\t\t\taddOne.setEnabled(false);\n\t\tif (obj.getCredit() >= 3)\n\t\t\taddMax.setEnabled(true);\n\t\tif (obj.getCredit() > 0)\n\t\t\taddOne.setEnabled(true);\n\t}", "public void onDisable() {\n }", "public void onDisable() {\n }", "public void onDisable()\n {\n }", "public void onDisable() {\n }", "@Override\n public void onDisable() {\n }", "public abstract void onDisable();", "default void onDisable() {}", "@Override\n public void onDisable() {\n super.onDisable();\n running = false;\n }", "@Override\n\tpublic void onDisable() {\n\t\t\n\t}", "@Override\n\tpublic void onDisable() {\n\n\t}", "public void disableEndOfProductionButton(){\n this.endOfproductionButton.setEnabled(false);\n }", "@Override\r\n\tpublic void onDisable() {\n\t}", "public abstract void wgb_onDisable();", "@Override\n public void onDisabled(Context context) {\n SetAlarm(context,1,mywidget.class);\n\n }", "protected void updateEnabled() {\n\t\tFieldGroup control = getUIControl();\n\t\tif (control != null) {\n\t\t\tCollection<? extends IRidget> ridgets = getRidgets();\n\t\t\tfor (IRidget ridget : ridgets) {\n\t\t\t\tridget.setEnabled(isEnabled());\n\t\t\t}\n\t\t\tcontrol.setEnabled(isEnabled());\n\t\t}\n\t}", "private void unlockButton() {\n\t\tconversionPdf_Txt.setEnabled(true);\n\t\tavisJury.setEnabled(true);\n\t\tstatistique.setEnabled(true);\n bData.setEnabled(true);\n\t}", "private void disableComponents() {\r\n maintainSponsorHierarchyBaseWindow.btnChangeGroupName.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnCreateNewGroup.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnDelete.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnMoveDown.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnMoveUp.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnSave.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnPanel.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.btnPanel.setSelected(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmChangeGroupName.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmCreateNewGroup.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmDelete.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmMoveDown.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmMoveUp.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmSave.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmPanel.setEnabled(false);\r\n maintainSponsorHierarchyBaseWindow.mnuItmPanel.setSelected(false);\r\n }", "@Override\n public void onEnabled(Context context) {\n Log.d(\"PS_WIDGET\", \"onEnabled reached\");\n }", "@Override\n\tpublic void onDisabled(Context context) \n\t{\n\t\tPackageManager pm = context.getPackageManager();\n\t\tpm.setComponentEnabledSetting(\n\t\t\t\tnew ComponentName(\"de.fhe\", \"MyAppWidgetProvider\"),\n\t\t\t\tPackageManager.COMPONENT_ENABLED_STATE_DISABLED, \n\t\t\t\tPackageManager.DONT_KILL_APP );\n\t}", "private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}", "@Override\n public void disableEndTurnButton() {\n gameboardPanel.disableEndTurnButton();\n }", "@Override\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t\t\t\tList<Pair<Text, Button>> texts = inputFields.get(fp);\n \t\t\t\ttexts.remove(pair);\n \t\t\t\tupdateState();\n \t\t\t\tremoveButton.dispose();\n \t\t\t\ttext.dispose();\n\t\t\t\taddButtons.get(fp).setEnabled(true);\n \t\t\t\tif (texts.size() == fp.getMinOccurrence())\n \t\t\t\t\tfor (Pair<Text, Button> otherPair : texts)\n \t\t\t\t\t\totherPair.getSecond().setEnabled(false);\n \n \t\t\t\t// do layout\n \t\t\t\t((Composite) getControl()).layout();\n \t\t\t\t// pack to make wizard smaller if possible\n \t\t\t\tgetWizard().getShell().pack();\n \t\t\t}", "public abstract void Disabled();", "private void setButtonDisabled() {\n final boolean areProjects = mainController.selectedOrganisationProperty().getValue().getProjects().size() > 0;\n final boolean areTeams = mainController.selectedOrganisationProperty().getValue().getTeams().size() > 0;\n //allocateTeamButton.setDisable(!(areProjects && areTeams));\n }", "public void handleApiDisabled() {\r\n\t\thandler.post(new Runnable(){\r\n\t\t\tpublic void run(){\r\n\t\t \tUtils.showMessageAndExit(SessionsList.this, getString(R.string.label_api_disabled));\r\n\t\t\t}\r\n\t\t});\t\t\t\t\r\n }", "String disabledButton();", "public void disablePanelInput() {\n\t\tif (!clickThem) {\r\n\t\t\ttxt_mssv.setText(\"\");\r\n\t\t\ttxt_mssv.setEnabled(false);\r\n\t\t\ttxt_hoten.setEnabled(false);\r\n\t\t\ttxt_hoten.setText(\"\");\r\n\t\t\tcomboSex.setEnabled(false);\r\n\t\t\ttxt_ntns.setText(\"\");\r\n\t\t\ttxt_ntns.setEnabled(false);\r\n\t\t\tbtn_nhap.setEnabled(false);\r\n\t\t} else {\r\n\t\t\ttxt_mssv.setEnabled(true);\r\n\t\t\ttxt_hoten.setEnabled(true);\r\n\t\t\tcomboSex.setEnabled(true);\r\n\t\t\ttxt_ntns.setEnabled(true);\r\n\t\t\tbtn_nhap.setEnabled(true);\r\n\t\t}\r\n\t}", "public void disableProductionButtons(){\n for(int i = 0; i < 3; i++){\n Gui.removeAllListeners(productionButtons[i]);\n productionButtons[i].addActionListener(new ActivateProductionListener(gui,productionButtons[i],i));\n productionButtons[i].setEnabled(false);\n }\n\n baseProductionPanel.disableButton();\n }", "@Override\n\tpublic void onDisable() {\n\t\tgetLogger().info(\"SimplyWrapper successfully disabled !\");\n\t}", "public void disable(){\r\n\t\tthis.activ = false;\r\n\t}", "private void disableButtons() {\n for (DeployCommand cmd : DeployCommand.values()){\n setButtonEnabled(cmd, false);\n }\n butDone.setEnabled(false);\n setLoadEnabled(false);\n setUnloadEnabled(false);\n setAssaultDropEnabled(false);\n }", "public void disableEndTurnButton(){\n\n this.endTurnButton.setEnabled(false);\n }", "public void onEnabled() {\r\n }", "public void onNotEnabled() {\n Timber.d(\"onNotEnabled\");\n // keep the callback in case they turn it on manually\n setTorPref(Status.DISABLED);\n createClearnetClient();\n status = Status.NOT_ENABLED;\n if (onStatusChangedListener != null) {\n new Thread(() -> onStatusChangedListener.notEnabled()).start();\n }\n }", "@Override\n public void valueChanged(ListSelectionEvent e) {\n if (!strategyList.isSelectionEmpty())\n playButton.setEnabled(true);\n }", "public void inhabilitaPanel() {\n\n\t\t//comboNombreCarta.setEnabled(false);\n\t\tjScrollPane1.setEnabled(false);\n\t\tjScrollPane1.getVerticalScrollBar().setEnabled(false);\n\t\tjScrollPane1.getHorizontalScrollBar().setEnabled(false);\n\t\tjScrollPane2.setEnabled(false);\n\t\tjScrollPane2.getVerticalScrollBar().setEnabled(false);\n\t\tjScrollPane2.getHorizontalScrollBar().setEnabled(false);\n\t\tlistaSeleccionadas.setEnabled(false);\n\t\tlistaDisponibles.setEnabled(false);\n\t\tlabelFondo.setEnabled(false);\n\t\ttextoNumeroCartas.setEnabled(false);\n\t\ttextoRaza.setEnabled(false);\n\t\tbotCargar.setEnabled(false);\n\t\tbotGuardar.setEnabled(false);\n\t\tbotGuardarComo.setEnabled(false);\n\t\tbotSalir.setEnabled(false);\n\t\tbotAyuda.setEnabled(false);\n\t\tbotNuevaBaraja.setEnabled(false);\n\t\ttextoBarajaCargada.setEnabled(false);\n\t\tthis.panelFondo.setEnabled(false);\n\t\tlabelImagen.setEnabled(false);\n this.NumeroPuntos.setEnabled(false);\n\n\t}", "public boolean isEnabled () {\r\n\tcheckWidget();\r\n\treturn getEnabled () && parent.isEnabled ();\r\n}", "private void updateEnabledState() {\n updateEnabledState(spinner, spinner.isEnabled()); }", "private void checkEnableDisable() {\n\t\tif (_trainingSet.getCount() > 0) {\n\t\t\t_saveSetMenuItem.setEnabled(true);\n\t\t\t_saveSetAsMenuItem.setEnabled(true);\n\t\t\t_trainMenuItem.setEnabled(true);\n\t\t} else {\n\t\t\t_saveSetMenuItem.setEnabled(false);\n\t\t\t_saveSetAsMenuItem.setEnabled(false);\n\t\t\t_trainMenuItem.setEnabled(false);\n\t\t}\n\n\t\tif (_currentTrainGrid == null) {\n\t\t\t_deleteGridMenuItem.setEnabled(true);\n\t\t} else {\n\t\t\t_deleteGridMenuItem.setEnabled(true);\n\t\t}\n\n\t\tif (_index > 0) {\n\t\t\t_leftGridMenuItem.setEnabled(true);\n\t\t\t_leftBtn.setEnabled(true);\n\t\t\t_firstGridMenuItem.setEnabled(true);\n\t\t\t_firstBtn.setEnabled(true);\n\t\t} else {\n\t\t\t_leftGridMenuItem.setEnabled(false);\n\t\t\t_leftBtn.setEnabled(false);\n\t\t\t_firstGridMenuItem.setEnabled(false);\n\t\t\t_firstBtn.setEnabled(false);\n\t\t}\n\n\t\tif (_index < _trainingSet.getCount() - 1) {\n\t\t\t_rightGridMenuItem.setEnabled(true);\n\t\t\t_rightBtn.setEnabled(true);\n\t\t\t_lastGridMenuItem.setEnabled(true);\n\t\t\t_lastBtn.setEnabled(true);\n\t\t} else {\n\t\t\t_rightGridMenuItem.setEnabled(false);\n\t\t\t_rightBtn.setEnabled(false);\n\t\t\t_lastGridMenuItem.setEnabled(false);\n\t\t\t_lastBtn.setEnabled(false);\n\t\t}\n\n\t\tif (_index >= _trainingSet.getCount()) {\n\t\t\t_indexLabel.setText(String.format(NEW_INDEX_LABEL, _trainingSet.getCount()));\n\t\t} else {\n\t\t\t_indexLabel.setText(String.format(INDEX_LABEL, _index + 1, _trainingSet.getCount()));\n\t\t}\n\n\t\t_resultLabel.setText(EMPTY_RESULT_LABEL);\n\t}", "private void disableInputs() {\n bulbPressTime.setEnabled(false);\n intervalTime.setEnabled(false);\n numTicks.setEnabled(false);\n startBtn.setEnabled(false);\n connStatus.setText(getString(R.string.StatusRunning));\n connStatus.setTextColor(getColor(R.color.green));\n }", "@Override\n public void disableEndOfProductionButton() {\n gameboardPanel.disableEndOfProductionButton();\n }", "protected void disableButtons() {\n if (mFalseButton.isPressed() || mTrueButton.isPressed())\n mFalseButton.setEnabled(false);\n mTrueButton.setEnabled(false);\n }", "public void inhabilitaPanel() {\n\t\t// contentPane.setEnabled(false);\n\t\tpanelPrincipal.setEnabled(false);\n\t\tpanelBotones.setEnabled(false);\n\t\tboton1Jugador.setEnabled(false);\n\t\tbotonJuegoRed.setEnabled(false);\n\t\tbotonEditar.setEnabled(false);\n\t\tbotonDemo.setEnabled(false);\n\t\tbotonReglas.setEnabled(false);\n\t\tbotonAyuda.setEnabled(false);\n\t\tbotonRecibir.setEnabled(false);\n\t\tbotonEnviar.setEnabled(false);\n\t\tbotonDescargaSobre.setEnabled(false);\n\t\tbotonSalir.setEnabled(false);\n\t\tlabelFondo.setEnabled(false);\n\t\tlabelDibujo.setEnabled(false);\n\n\t}", "@Override\n public void enableEndTurnButton() {\n gameboardPanel.enableEndTurnButton();\n }", "protected abstract void disable();", "private void deActivateButtons(){\n limiteBoton.setEnabled(false);\n derivadaBoton.setEnabled(false);\n integralBoton.setEnabled(false);\n}", "protected void whileDisable()\n\t{\n\n\t}", "public void enableEndOfProductionButton(){\n this.endOfproductionButton.setEnabled(true);\n }", "@FXML\n void disableHourly() {\n annualAddText.setDisable(false);\n managerRadio.setDisable(false);\n dHeadRadio.setDisable(false);\n directorRadio.setDisable(false);\n hourlyAddText.setDisable(true);\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "@Override\n public void onDisabled(Context context) {\n }", "public void setDisabled() {\n\t\tdisabled = true;\n\t}", "public void disableButtons() {\n\t\t\r\n\t\tcapture.setEnabled(false);\r\n\t\tstop.setEnabled(false);\r\n\t\tfilter.setEnabled(false);\r\n\t\tsave.setEnabled(false);\r\n\t\t//load.setEnabled(false);\r\n\t}", "public void dama_DamaCloseButtonListener() {\n this.buttonDisabled = false;\n }", "@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tebar.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tesend.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetopic.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetext.setEnabled(false);\n\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}", "public Widget() {\n\t\tenabled = true;\n\t}" ]
[ "0.8324667", "0.66936314", "0.6632969", "0.6590516", "0.65348405", "0.6503779", "0.6500005", "0.6481272", "0.64199775", "0.64199775", "0.63905513", "0.63777363", "0.6373405", "0.6338429", "0.630844", "0.62827057", "0.62471", "0.62242955", "0.62146366", "0.62080747", "0.6201108", "0.61709094", "0.6104599", "0.6058021", "0.60551906", "0.6045964", "0.6041686", "0.6030131", "0.60231024", "0.60197717", "0.60184926", "0.6015299", "0.5999035", "0.5998961", "0.5990952", "0.59826654", "0.597735", "0.5977323", "0.5955284", "0.59354264", "0.5910098", "0.5909336", "0.59004164", "0.58990175", "0.5883039", "0.58812", "0.5877268", "0.5871307", "0.5848898", "0.5848581", "0.5841035", "0.5836575", "0.58363795", "0.5834862", "0.58303124", "0.58262", "0.5803186", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.57928157", "0.5788713", "0.57822496", "0.5775713", "0.5774406", "0.57701635" ]
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.main, 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\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\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 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}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\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\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_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.layout.menu, menu);\n\t\treturn true;\n\t}", "@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 \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 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\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.724863", "0.7203384", "0.7197011", "0.71784776", "0.71090055", "0.7040796", "0.7039464", "0.7013998", "0.70109546", "0.6982435", "0.6946134", "0.6939684", "0.6935636", "0.69193685", "0.69193685", "0.6892893", "0.6884914", "0.68768066", "0.68763", "0.68635243", "0.68635243", "0.68635243", "0.68635243", "0.6854071", "0.68483156", "0.6820635", "0.6818679", "0.68139905", "0.68138844", "0.68138844", "0.68068254", "0.68019366", "0.67988884", "0.6792257", "0.6791312", "0.67894673", "0.6785093", "0.67605865", "0.67587006", "0.67494637", "0.6745356", "0.6745356", "0.67428446", "0.6741961", "0.6726888", "0.67248803", "0.67236483", "0.67236483", "0.6722583", "0.6712873", "0.6707795", "0.67058164", "0.67011815", "0.669981", "0.66978544", "0.6695866", "0.66877913", "0.66849333", "0.66849333", "0.6684108", "0.66811496", "0.6680523", "0.6678561", "0.6669383", "0.66685265", "0.6664329", "0.6658405", "0.6658405", "0.6658405", "0.66576266", "0.6655998", "0.6655998", "0.6655998", "0.6653282", "0.66530126", "0.6651592", "0.6650151", "0.6648575", "0.6647844", "0.6647643", "0.6647611", "0.66465765", "0.6646401", "0.6644694", "0.6643749", "0.6643608", "0.6640089", "0.66356236", "0.6634635", "0.6633641", "0.6633641", "0.6633641", "0.66333216", "0.6630465", "0.66291285", "0.662822", "0.66277045", "0.6625648", "0.6621995", "0.6620415", "0.6620415" ]
0.0
-1
Test case 3 Scenarios for PM Companies and for Test Case 9 CS Companies PMCompaniesCompany Name
@Then("^I should see (.*) in the Companies-Company Name$") public void iShouldSeeValueToFindInThePMCompaniesCompanyName(String searchText) throws Throwable { String search1Text = searchText.toLowerCase(); // check to see if the Text is present Boolean itemPresent = !getDriver().findElements(By.xpath("//table[@class='table table-bordered table-striped']/tbody/tr/td[1][contains(translate(text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '" + search1Text + "')]")).isEmpty(); assertTrue("Error: Cannot find " + search1Text + " in the search results", itemPresent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testGenerateCompany() throws Exception {\n\n\t}", "@Test\n public void company() {\n System.out.println(client.companyName(1));\n }", "private void testGetCompanyHome() {\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n NodeRef companyHome = getompanyHomeFolder();\n assertNotNull(companyHome);\n String companyHomeName = (String) nodeService.getProperty(companyHome, ContentModel.PROP_NAME);\n assertNotNull(companyHomeName);\n assertEquals(\"Company Home\", companyHomeName);\n LOG.debug(\"Got \" + companyHomeName + \" NodeRef: \" + companyHome);\n }", "@Test\n void testGetAllApplicationsToCompany() {\n Company company = new Company(\"HoraceCorp\");\n Branch branch1 = company.createBranch(\"HQ\", \"M5S2E8\");\n HRCoordinator hrc1 = new HRCoordinator(\"horace\", \"ABC\", \"Horace Businessman\",\n \"horace@gmail.com\", branch1, LocalDate.now());\n BranchJobPosting branchJobPosting1 = hrc1.addJobPosting(\"Test Job\", \"HR\", \"This is a job.\",\n new ArrayList<>(), new ArrayList<>(), 1, LocalDate.now(), LocalDate.now().plusDays(3),\n LocalDate.now().plusDays(4));\n Applicant applicant = new Applicant(\"dudebro7\", \"ABC\", \"DudeBro Smith\",\n \"dudebro@gmail.com\", \"Toronto\", LocalDate.now());\n JobApplication application1 = new JobApplication(applicant, branchJobPosting1, LocalDate.now());\n Branch branch2 = company.createBranch(\"South Branch\", \"N9G0A3\");\n HRCoordinator hrc2 = new HRCoordinator(\"boris\", \"ABC\", \"Boris Businessman\",\n \"boris@gmail.com\", branch2, LocalDate.now());\n BranchJobPosting branchJobPosting2 = hrc2.addJobPosting(\"Best Job\", \"HR\",\n \"This is a better job.\", new ArrayList<>(), new ArrayList<>(), 1, LocalDate.now(),\n LocalDate.now().plusDays(3), LocalDate.now().plusDays(4));\n JobApplication application2 = new JobApplication(applicant, branchJobPosting2,\n LocalDate.now().plusDays(1));\n assertEquals(2, company.getAllApplicationsToCompany(applicant).size());\n assertTrue(company.getAllApplicationsToCompany(applicant).contains(application1));\n assertTrue(company.getAllApplicationsToCompany(applicant).contains(application2));\n }", "public static void fillCompanies() {\n\t\tString constant=indentation+\"- Empresa: \"; //Creo esta variable, ya que la voy a usar varias veces y me ahorra tiempo\n\t\twhile (company1.equals(company2) || company2.equals(company3) || company1.equals(company3)) { //Si los nombres son iguales vuelve a asignar nombres\n\t\t\tcompany1=constant+companies[selector.nextInt(companies.length)]; //Asigna aleatoriamente los nombres de entre los definidos al principio de la clase en el array companies\n\t\t\tcompany2=constant+companies[selector.nextInt(companies.length)];\n\t\t\tcompany3=constant+companies[selector.nextInt(companies.length)];\n\t\t}\n\t}", "public void labelRootCompany() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying if Label is available or not\");\n\t\tString RootCompanyName = BasePage.getCellData(xlsxName, sheetName, 3, 0);\n\t\tString ActualRootCompany = driver\n\t\t\t\t.findElement(By.xpath(\"//*[@id='company-edit-form']/fieldset/div[1]/div[2]/div[1]/span/h\")).getText();\n\t\tSystem.out.println(\"Company Name:********\" + ActualRootCompany + \"*********\");\n\t\tlog.info(\"Click on customer name\");\n\t\tJavaScriptExec.sleep();\n\t\tAssert.assertEquals(ActualRootCompany, RootCompanyName);\n\t}", "@Then(\"^user clicks on particular company and edit that$\")\n\tpublic void user_clicks_on_particular_company_and_edit_that() {\n\t\tWebElement loginBtn = driver.findElement(By.xpath(\"//input[@value='Login']\"));\n\t\tloginBtn.click();\n\t driver.switchTo().frame(\"mainpanel\");\n\t Actions action = new Actions(driver);\n\t action.moveToElement(driver.findElement(By.xpath(\"//a[text()='Companies']\"))).build().perform();\n\t driver.findElement(By.xpath(\"//a[@title='Full Search Form' and text()='Full Search Form']\")).click();\n\t}", "public static void main(String[] args) {\n\r\n System.out.println(\"* * * * * Welcome to the employee inform * * * * * \");\r\n\r\n Employee_Company Jane = new Employee_Company();\r\n Employee_Company Lucas = new Employee_Company();\r\n Employee_Company Intern_Sophia = new Employee_Company();\r\n Employee_Company Intern_Ava = new Employee_Company();\r\n Employee_Company Intern_James = new Employee_Company();\r\n Employee_Company Intern_Nicholas = new Employee_Company();\r\n\r\n\r\n Lucas.Set_name_employee(\"Lucas Smith\");\r\n Lucas.Set_Email_employee(\"Lucas_Smith@TechCompany.org\");\r\n Lucas.Set_role_employee(\"Software Engineer\");\r\n Lucas.setSalary_employee(103438);\r\n\r\n\r\n Jane.Set_name_employee(\"Jane charlotte\");\r\n Jane.Set_Email_employee(\"Jane_Charlotte@TechCompany.org\");\r\n Jane.setSalary_employee(623100);\r\n Jane.Set_role_employee(\"CEO Tech Company\");\r\n\r\n\r\n Intern_Sophia.Set_name_employee(\"Sophia Wood\");\r\n Intern_Sophia.Set_Intern_application('A');\r\n Intern_Sophia.Set_role_employee(\"Intern Artificial Intelligence \");\r\n\r\n\r\n Intern_Ava.Set_name_employee(\"Ava Richardson\");\r\n Intern_Ava.Set_Intern_application('B');\r\n Intern_Ava.Set_role_employee(\"Intern Computer Science\");\r\n\r\n\r\n Intern_James.Set_name_employee(\"James Benjamin\");\r\n Intern_James.Set_Intern_application('B');\r\n Intern_James.Set_role_employee(\"Intern Business Analyst\");\r\n\r\n\r\n Intern_Nicholas.Set_name_employee(\"Nicholas Miller\");\r\n Intern_Nicholas.Set_Intern_application('C');\r\n Intern_Nicholas.Set_role_employee(\"Intern Systems Integration Engineering\");\r\n\r\n\r\n\r\n System.out.println(\"\\n\\t*** Tech Company employee information ***\");\r\n System.out.println(\"1. View Salary\");\r\n System.out.println(\"2. View Name of the Employee\");\r\n System.out.println(\"3. View Email Address\");\r\n System.out.println(\"4. View Employee Role\");\r\n System.out.println(\"5. View Intern Application grade\");\r\n\r\n\r\n\r\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Direction: Input the number is addressed in Tech Company employee information\");\r\n int input_user = input.nextInt();\r\n\r\n switch (input_user){\r\n case 1 -> {\r\n System.out.println(\"Here is the salary of the employee of Tech Company\");\r\n System.out.println(\"Salary of Software engineering: \"+Lucas.getSalary_employee());\r\n System.out.println(\"Salary of CEO: \"+Jane.getSalary_employee());\r\n }\r\n case 2 ->{\r\n System.out.println(\"Here is the name of the employee of Tech Company\");\r\n System.out.println(\"The software engineering of Tech Company name of the employee is: \"+Jane.Get_name_employee());\r\n System.out.println(\"The CEO Tech Company name of the employee is: \"+Lucas.Get_name_employee());\r\n }\r\n case 3 ->{\r\n System.out.println(\"Here is the Email Address of employee of Tech Company\");\r\n System.out.println(\"Jane Charlotte is CEO of Tech company Email Address its : \"+Jane.Get_Email_employee());\r\n System.out.println(\"Lucas Smith is Software Engineering of Tech Company Email Address its: \"+Lucas.Get_Email_employee());\r\n }\r\n case 4 ->{\r\n System.out.println(\"Here is the Employee Role of Tech Company\");\r\n System.out.println(Jane.Get_role_employee());\r\n System.out.println(Lucas.Get_role_employee());\r\n }\r\n case 5 ->{\r\n System.out.println(\"Here is all the Intern get accepted to Tech Company \");\r\n System.out.println(\"1.\"+Intern_Ava.Get_name_employee()+\" GPA college: \"+Intern_Ava.Get_Intern_application()+\"- \"+\" Application: Accepted \"+Intern_Ava.Get_role_employee());\r\n System.out.println(\"2.\"+Intern_Sophia.Get_name_employee()+\" GPA college: \"+Intern_Sophia.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_Sophia.Get_role_employee());\r\n System.out.println(\"3.\"+Intern_James.Get_name_employee()+\" GPA college: \"+Intern_James.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_James.Get_role_employee());\r\n System.out.println(\"4.\"+Intern_Nicholas.Get_name_employee()+\"GPA college: \"+Intern_Nicholas.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_Nicholas.Get_role_employee());\r\n }\r\n }\r\n\r\n\r\n\r\n }", "public static void main(String[] s) {\n\n\t\tSystem.out.println(getCompany());\n\t}", "public void SetCheckoutRegistrationcompanyname(String compname){\r\n\t\tString Companyname = getValue(compname);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+Companyname);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration company name should be entered as '\"+Companyname+\"' \");\r\n\t\ttry{\r\n\r\n\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationcompanyname\"),Companyname);\r\n\t\t\tSystem.out.println(\"Registration company name is entered as '\"+Companyname+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration company name is entered as '\"+Companyname+\"' \");\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration company name is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationcompanyname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "java.lang.String getCompanyName();", "java.lang.String getCompanyName();", "@Test\n public void getCompanyInfo() throws Exception {\n List<Stock> comps = quoteService.companiesByNameOrSymbol(TestConfiguration.QUOTE_SYMBOL);\n assertFalse(comps.isEmpty());\n boolean pass = false;\n for (Stock info : comps) {\n if (info.getSymbol().equals(TestConfiguration.QUOTE_SYMBOL)) {\n pass = true;\n }\n }\n assertTrue(pass);\n }", "@Test\n\tpublic void companyLogin()\n\t{\n\t\tCompanyFacade comf = comp.login(\"Comp1\", \"12345\", ClientType.COMPANY);\n\t\tAssert.assertNotNull(comf);\n\t}", "@Test\r\n public void testGetCompanyInfo() throws MovieDbException {\r\n LOG.info(\"getCompanyInfo\");\r\n Company company = tmdb.getCompanyInfo(ID_COMPANY_LUCASFILM);\r\n assertTrue(\"No company information found\", company.getCompanyId() > 0);\r\n }", "@Test\n public void TC3(){\n TryCloudUtil.clickContactsModule(driver);\n\n // 3.Verify the contact names are in the list (Pre-condition: there should be at least 2 contact names are displayed On the contact list)\n\n //Creating 2 contacts\n TryCloudUtil.CreatingNewContact(driver);\n WebElement company=driver.findElement(By.xpath(\"//input[@id='contact-org']\"));\n company.sendKeys(\"Test1\");\n BrowserUtils.wait(5);\n\n TryCloudUtil.CreatingNewContact(driver);\n company.sendKeys(\"Test2\");\n BrowserUtils.wait(5);\n\n Assert.assertTrue(driver.getPageSource().contains(\"Test1\"));\n Assert.assertTrue(driver.getPageSource().contains(\"Test2\"));\n\n }", "@Test // This test will pass\n public void testIfCompanyNameIsEquals(){\n String expected = \"Amazon\";\n String actual = \"Amazon\";\n\n assertEquals(expected, actual);\n }", "@Test\r\n\tpublic void createContactWithOrgtest() throws Throwable {\r\n\t\tString orgName = excelL.readExcelData(\"contact\", 1, 2)+\"_\"+webutils.getRandomNo();\r\n\t\tString orgType= excelL.readExcelData(\"contact\", 1, 3);\r\n\t\tString orgIndustry = excelL.readExcelData(\"contact\", 1, 4);\r\n\t\tString contactName = excelL.readExcelData(\"contact\", 1, 5)+\"-\"+webutils.getRandomNo();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/* navigate to Organization page */\r\n\t\t\r\n\t\tdriver.findElement(By.linkText(\"Organizations\")).click();\r\n\t\t\t\r\n\t\t/* navigate to create new Organization page */\r\n\t\t\r\n\t\tdriver.findElement(By.xpath(\"//img[@alt='Create Organization...']\")).click();\r\n\t\t\r\n\t\t/* Create Organization */\r\n\t\t\r\n\t\tdriver.findElement(By.name(\"accountname\")).sendKeys(orgName);\r\n\t\r\n\t\tWebElement swb1 = driver.findElement(By.name(\"accounttype\"));\r\n\t webutils.select(swb1, orgType);\r\n\t\t\t\t\r\n\t\tWebElement swb2 = driver.findElement(By.name(\"industry\"));\r\n\t\twebutils.select(swb2, orgIndustry);\r\n\t\t\t\t\r\n\t\tdriver.findElement(By.xpath(\"//input[@title='Save [Alt+S]']\")).click();\r\n\t\t\r\n\t\t/* verify the Organization */\r\n\t\t\r\n\t\tString actualOrgName = driver.findElement(By.xpath(\"//span[@class='dvHeaderText']\")).getText();\r\n\t\tAssert.assertTrue(actualOrgName.contains(orgName));\r\n\t\t\r\n\t\t\r\n\t\t/* Navigate to Contact page */\r\n\t\tdriver.findElement(By.linkText(\"Contacts\")).click();\r\n\t\t\r\n\t\t/* Navigate to create new Contact page */\r\n\t\tdriver.findElement(By.xpath(\"//img[@alt='Create Contact...']\")).click();\r\n\t\t\r\n\t\t/* Create new Contact */\r\n\t\tdriver.findElement(By.name(\"lastname\")).sendKeys(contactName);\r\n\t\t\r\n\t\t/* Identify and Click On Organization name look up icon */\r\n\t\tdriver.findElement(By.xpath(\"//input[@name='account_name']/following-sibling::img\")).click();\r\n\t\t\r\n\t\t/* handle child browser */\r\n\t webutils.switchToNewWindow(driver, \"specific_contact_account_address\");\r\n\t\t\r\n\t\tdriver.findElement(By.name(\"search_text\")).sendKeys(orgName);\r\n\t\tdriver.findElement(By.name(\"search\")).click();\r\n\t\tdriver.findElement(By.linkText(orgName)).click();\r\n\t\t\r\n\t\t/* come back to parent Window */\r\n\t\twebutils.switchToNewWindow(driver, \"Administrator - Contacts\");\r\n\t\tdriver.findElement(By.xpath(\"//input[@title='Save [Alt+S]']\")).click();\r\n\t\t\r\n\t\t/* verify the Organization */\r\n\t\tString actualconatct = driver.findElement(By.xpath(\"//span[@class='dvHeaderText']\")).getText();\r\n\t\tAssert.assertTrue(actualconatct.contains(contactName));\r\n\t\t\r\n\t}", "@And(\"^user clicks Manage Company$\")\n\tpublic void user_clicks_Manage_Company() throws Throwable {\n\t\ttry\n\t\t{\n\t\t SeleniumOperations.clickButton(\"//a[@title='Manage Company']\");\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user clicks Manage Company\", \"Expected:User should able to click Manage Company,Actual:User clicked Manage Company successfully\");\n\t\t// String op1=\"Expected:User should able to click Manage Company:\"+\",Actual:User is able to click Manage Company Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t \n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\t HTMLReportGenerator.StepDetails(\"Fail\", \"user clicks Manage Company\", \"Expected:User should able to click Manage Company,Actual:Failed to clicked Manage Company \");\n\t\t\t//String op1=\"Expected:User should able to click Manage Company:\"+\",Actual:Flied to click Manage Company ,Exception:\"+ex.getMessage();\n\t \t//System.out.println(op1);\n\t\t}\n\t}", "private void processCompany(SwsService swsService) {\n ForetakSokResponse foretakSokResponse = swsService.companySearch(getCompanySearchRequest());\n ForetakData foretakData = foretakSokResponse.getForetakData().get(0);\n Integer orgNo = foretakData.getOrgnr();\n\n // 2. fetch company information based in retrieved organization number\n HentForetakResponse hentForetakResponse = swsService.companyInfo(orgNo);\n\n // 3. output company name\n System.out.println(hentForetakResponse.getNavnAdresse().getNavn());\n\n // 4. output messages (if any)\n List<com.bisnode.services.sws.generated.company.Meldinger> messages = hentForetakResponse.getMeldinger();\n\n if (messages != null && messages.size() > 0) {\n for (com.bisnode.services.sws.generated.company.Meldinger msg : hentForetakResponse.getMeldinger()) {\n System.out.println(msg.getMeldingsKode() + \": \" + msg.getMeldingsTekst());\n }\n }\n }", "static String editCompany()\n {\n if(companyName !=null) companyName = \"IBM\";\n return companyName;\n }", "String getCompany();", "@Test(priority = 1, groups= {\"regression\",\"smoke\"})\r\n\tpublic void PrintHospitals()\r\n\t{\r\n\t\tlogger= report.createTest(\"Printing Hospitals as per requirement\");\r\n\t\tDisplayHospitalNames hp=Base.nextPage1();\r\n\t\thp.selectLocation();\r\n\t\thp.selectHospital();\r\n\t\thp.applyFilters();\r\n\t\thp.hospitals();\r\n\t\thp.Back();\r\n\t}", "public void setCompany(String company) {\n this.company = company;\n }", "public static List<Company> createCompanies() {\r\n\t\tList<Company> companies = new ArrayList<Company>();\r\n\t\tcompanies.add(createCompany(1, \"Pepcus\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help1\"));\r\n\t\tcompanies.add(createCompany(2, \"Google\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help2\"));\r\n\t\tcompanies.add(createCompany(3, \"Facebook\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help3\"));\r\n\t\tcompanies.add(createCompany(4, \"Suzuki\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help4\"));\r\n\t\tcompanies.add(createCompany(5, \"General Motors\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help5\"));\r\n\t\tcompanies.add(createCompany(6, \"L & T\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help6\"));\r\n\t\tcompanies.add(createCompany(7, \"General Electric\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help7\"));\r\n\t\tcompanies.add(createCompany(8, \"Oracle\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help8\"));\r\n\t\tcompanies.add(createCompany(9, \"Microsoft\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help9\"));\r\n\t\tcompanies.add(createCompany(10, \"Thinkhr\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help10\"));\r\n\t\treturn companies;\r\n\r\n\t}", "@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}", "@Test\r\n public void testSearchCompanies() throws MovieDbException {\r\n LOG.info(\"searchCompanies\");\r\n List<Company> results = tmdb.searchCompanies(COMPANY_NAME, 0);\r\n assertTrue(\"No company information found\", !results.isEmpty());\r\n }", "@Test\n\tpublic void companyLogin2()\n\t{\n\t\tCompanyFacade comf = comp.login(\"Comp1\", \"43621\", ClientType.COMPANY);\n\t\tAssert.assertNull(comf);\n\t}", "@And(\"^user clicks Company$\")\n\tpublic void user_clicks_Company() throws Throwable {\n\t\ttry\n\t\t{\n\t\t SeleniumOperations.clickButton(\"//span[@class='tree-hit tree-collapsed']\");\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user clicks Company\", \"Expected:User should able to click Company,Actual:User clicked Company successfully\");\n\t\t //String op1=\"Expected:User should able to click Company button:\"+\",Actual:User is able to click button Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\t HTMLReportGenerator.StepDetails(\"Fail\", \"user clicks Company\", \"Expected:User should able to click Company,Actual:Failed to clicked Company \");\n\t\t\t//String op1=\"Expected:User should able to Launch the URL:\"+\",Actual:Failed to click Company button,Exception:ex\"+ex.getMessage();\n\t \t//System.out.println(op1);\n\t\t \n\t\t}\n\t}", "public static void main(String[] args) {\n Company myCompany = new Company();\n System.out.println(myCompany.getName());\n Worker oyelowo = new JuniorWorker(989.9);\n Worker Dan = new JuniorWorker(987.8);\n Worker Shane = new MidLevelWorker(34.5);\n Worker Dolan = new SeniorWorker(4567.8);\n Worker Maria = new SeniorWorker(84.3);\n SeniorWorker Sam = new SeniorWorker();\n JuniorWorker jim = new JuniorWorker(\"Jim\", \"HJK\", 1, 345.9);\n System.out.println(jim.getBalance());\n\n\n System.out.println(myCompany.getBalance() + \" \" +myCompany.getAuthorizationKey());\n\n\n\n myCompany.paySalary(1000.0, oyelowo);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n\n\n System.out.println();\n System.out.println(myCompany.getBalance());\n System.out.println(myCompany.getDebits());\n System.out.println(oyelowo.getBalance(myCompany));\n System.out.println(Dan.getBalance(myCompany));\n\n\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyNoofAcctsinViewname() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the functionalities of Close link and Previous and next if more than 10 accounts in that overlay \");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.ViewAcctsOverlay(userProfile);\n\t}", "@Test\n\tpublic void testGenerateAndValidateCompanyUniqueness() throws Exception {\n\n\t}", "public static void main(String[] args) {\n for (int pageNumber =1; pageNumber<=51; pageNumber++){\n try {\n //System.out.println(\"Page number: \" + pageNumber);\n String pageContent = getPageContent(\"https://powerlist.talint.co.uk/talint-powerlist/search-companies/?sf_paged=\" + pageNumber);\n String [] linkSections = pageContent.split(\"</a></h2>\");\n for (String linkSection: linkSections) {\n if(linkSection.contains(\"<h2><a href=\\\"\")){\n String companyLink = linkSection.substring(linkSection.indexOf(\"<h2><a href=\\\"\")+13,\n linkSection.lastIndexOf(\"/\\\">\"));\n String companyDetailsContent = getPageContent(companyLink);\n processCompanyDetails(companyLink, companyDetailsContent);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "private String companies() {\r\n\t\tint num=tile.getCompaniesNum();\r\n\t\tString out=\"Total Companies: \"+num;\r\n\t\treturn out;\r\n\t}", "@Test(priority = 99)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"SCHOOL FEES PAYMENTS\") })\r\n@Step (\"Verify that system is able to search and display correct school Name school code and Bank branch when user click on search for school functionality\")\r\npublic void Verify_that_system_is_able_to_search_and_display_correct_school_name_school_code_and_Bank_branch_when_user_click_on_search_for_school_functionality() {\n\tdriver.findElement(By.xpath(\"//a[contains(.,'Home')]\")).click();\r\n\tWebDriverWait wait = new WebDriverWait(driver, 15);\r\n\twait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText(\"Bill Payment\")));\r\n\tdriver.findElement(By.linkText(\"Bill Payment\")).click();\r\n\tWebDriverWait wait1 = new WebDriverWait(driver, 15);\r\n\twait1.until(\r\n\t\tExpectedConditions.visibilityOfElementLocated(By.xpath(\"//div[text()=' Institutional Payments ']\")));\r\n\tdriver.findElement(By.xpath(\"//div[text()=' Institutional Payments ']\")).click();\r\n\tdriver.findElement(By.xpath(\"//div[@class='col-in schoolFee']\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\")).click();\r\n\t{\r\n\t WebElement dropdown = driver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\"));\r\n\t dropdown.findElement(By.xpath(\"//option[. = 'Account Number']\")).click();\r\n\t}\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SF_ACCOUNT_NUMBER\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SF_ACCOUNT_NUMBER\")).sendKeys(\"01129080146300\");\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL\")).click();\r\n\tdriver.findElement(By.cssSelector(\".ct-formlayout-SCHOOL_NAME .ct-form__ip\")).click();\r\n\tdriver.findElement(By.cssSelector(\".ct-formlayout-SCHOOL_CODE .ct-form__ip\")).click();\r\n\tSystem.out.println(\"TC13 Verify_that_system_is_able_to_search_and_display_correct_school_name_school_code_and_Bank_branch_when_user_click_on_search_for_school_functionality |Success:\");\r\n\r\n\t}", "public void searchCompanies() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\ttry {\r\n\t\t\tbusiness = businessDao.searchBusinessForNameOrNit(searchCompany);\r\n\t\t\tif (business == null || business.size() <= 0) {\r\n\t\t\t\tControladorContexto.mensajeInformacion(\r\n\t\t\t\t\t\t\"frmAsociarPermisos:empresas\",\r\n\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t} else {\r\n\t\t\t\tBusinessAction businessAction = ControladorContexto\r\n\t\t\t\t\t\t.getContextBean(BusinessAction.class);\r\n\t\t\t\tbusinessAction.setListBusiness(new ArrayList<Business>());\r\n\t\t\t\tbusinessAction.setListBusiness(business);\r\n\t\t\t\tbusinessAction.loadDetailsBusiness();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}", "@Test(enabled = true)\n\tpublic void test001() {\n\t\tCategoryPOM laptops = new CategoryPOM(driver);\n\t\tlaptops.showAllLaptops();\n\t\tlaptops.clickProduct(\"Air\");\n\t\tProductPOM macbookAir = new ProductPOM(driver);\n\t\tmacbookAir.addToWishlist();\n\t\tmacbookAir.addToComparelist();\n\t}", "public void setCompanyName(String name) {\n this.companyName = name;\n }", "public static void main(String[] args) {\n\t\tTestLinkAPIClient testlinkAPIClient = new TestLinkAPIClient(CyborgConstants.DEVKEY,CyborgConstants.URL);\n\t\ttry {\n\t\t\tString ProjectId=null;\n\t\t\tString TestSuiteId=null;\n\t\t\tArrayList<Integer> TestSuitesId = new ArrayList<Integer>();\n\t\t\tTestLinkAPIResults projResult= testlinkAPIClient.getProjects();\n\t\t for (int i = 0; i < projResult.size(); i++) {\n\t\t \tif(projResult.getValueByName(i, \"name\").equals(ProjectName)){\n\t\t \t\t ProjectId= (String) projResult.getValueByName(i, \"id\");\n\t\t \t\t System.out.println(projResult.getValueByName(i, \"name\"));\n\t\t \t\t break;\n\t\t \t\t \n\t\t \t}\n\t\t\t}\n\t\t \n\t\t\t String TestPalns[]= TestPlan.split(\",\");\n\t\t\t for (int k = 0; k < TestPalns.length; k++) {\n\t\t\t\tTestLinkAPIResults testSuiteResults=testlinkAPIClient.getTestSuitesForTestPlan(ProjectName, TestPalns[k]);\n\t\t\t\t//System.out.println(\"TestPalns[k]===\"+TestPalns[k]);\n\t\t\t\tfor (int l = 0; l < testSuiteResults.size(); l++) {\n\t\t\t\t\t//System.out.println(\"TestSuite===\"+TestSuite);\n\t\t\t\t\t//System.out.println(\"Suite Name===\"+testSuiteResults.getValueByName(l, \"name\"));\n\t\t\t\t\tString TestSuites[]= TestSuite.split(\",\");\n\t\t\t\t\tfor (int z = 0; z < TestSuites.length; z++){\n\t\t\t\t\t\t\tif(testSuiteResults.getValueByName(l, \"name\").equals(TestSuites[z])){\n\t\t\t\t\t\t\tSystem.out.println(testSuiteResults.getValueByName(l, \"name\").equals(TestSuites[z]));\n\t\t\t\t\t\t\t TestSuiteId= (String) testSuiteResults.getValueByName(l, \"id\");\n\t\t\t\t\t\t\t// System.out.println(\"SuiteNamer===\"+testSuiteResults.getValueByName(l, \"name\"));\n\t\t\t\t\t\t\tString SuiteName=(String)testSuiteResults.getValueByName(l, \"name\");\n\t\t\t\t\t\t\t getTestCases(testlinkAPIClient, ProjectId, TestSuiteId,SuiteName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t }\n\t\t\t \n\t\t \n\t\t} catch (TestLinkAPIException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setCompany(String company) {\r\n\t\tthis.company = company;\r\n\t}", "public static final String getCompany() { return company; }", "@Test(enabled = true)\n\tpublic void test002() {\n\t\tCategoryPOM laptops = new CategoryPOM(driver);\n\t\tlaptops.showAllDesktops();\n\t\tlaptops.clickProduct(\"Apple Cinema 30\\\"\");\n\t\tProductPOM appleCinema = new ProductPOM(driver);\n\t\tappleCinema.clickSpecification();\n\t\tWait.sleep(2);\n\t\tappleCinema.clickReview();\n\t\tWait.sleep(2);\n\t\tappleCinema.addToCart();\n\t\tWait.sleep(2);\n\t\tappleCinema.clickCart();\n\t\tWait.sleep(2);\n\t}", "@Test(groups=\"SMR1137\")\r\n\tpublic void smr1137(){\r\n\t\ttry {\r\n\t\t\t//final String firstName=testDataOR.get(\"mono_first_name\"),lastName=testDataOR.get(\"mono_last_name\"); \r\n\t\t\t//login(\"URLEportal\",testDataOR.get(\"mono_user_login\"),firstName,lastName);\r\n\t\t\teportalCust=testDataOR.get(\"customer\");\r\n\t\t\tfinal String firstName=testDataOR.get(\"superuser_first_name\"),lastName=testDataOR.get(\"superuser_last_name\");\r\n\t\t\tlogin(\"URLEportal\",testDataOR.get(\"superuser\"),firstName,lastName);\r\n\t\t\t//login(\"URLEverest\",testDataOR.get(\"superuser\"),firstName,lastName);\r\n\t\t\t/*logger.info(\"SMR1137 execution started\");\r\n\t\t\tfinal String customerName=testDataOR.get(\"customer\");\r\n\r\n\t\t\t//Access ePortal and 'In Store Payment' menu should be available\r\n\t\t\tlogger.info(\"Step 1 :\");\r\n\t\t\tlogger.info(\"Access eportal with superuser\");\r\n\t\t\tselUtils.verifyElementDisp(selUtils.getCommonObject(\"instorepay_tab_xpath\"), INSTOREPAY);\r\n\r\n\t\t\t//logout from eportal and login everest, select customer in eportal\r\n\t\t\tlogger.info(\"Step 2,3,4:\");\r\n\t\t\tlogoutNEvselCust(customerName);\r\n\t\t\t\r\n\t\t\t//Disable ‘ePayment’ module and validate\r\n\t\t\tlogger.info(\"Step 5:\");\r\n\t\t\tdisableModNVal(\"ep_ckbx_id\", EPAYMENT);\r\n\t\t\t\t\t\t\r\n\t\t\t//Disable 'Card Payment' module and validate\r\n\t\t\tlogger.info(\"Step 6:\");\r\n\t\t\tdisableModNVal(\"cp_ckbx_id\", CARDPAYMENT);\r\n\t\t\t\t\t\t\r\n\t\t\t//Access ePortal with a superuser and select customer\r\n\t\t\t//In Store Payment menu should not be available\r\n\t\t\tlogger.info(\"Step 7:\");\r\n\t\t\tlogoutEpSelCust(customerName);\r\n\t\t\tAssert.assertFalse(selUtils.isElementPresentCommon(\"instorepay_tab_xpath\"),INSTOREPAY+\" menu is available\");\r\n\t\t\tlogger.info(\"In store payment menu is not available\");\r\n\r\n\t\t\t//logout from eportal and login everest, select customer in eportal\r\n\t\t\tlogger.info(\"Step 8,9:\");\r\n\t\t\tlogoutNEvselCust(customerName);\r\n\t\t\t\r\n\t\t\t//Enable 'Card Payment' module and validate\r\n\t\t\tlogger.info(\"Step 10\");\r\n\t\t\tenableModNVal(\"cp_ckbx_id\", CARDPAYMENT);\r\n\t\t\r\n\t\t\t\r\n\t\t\t//Access ePortal and 'In Store Payment' menu should be available\r\n\t\t\tlogger.info(\"Step 11\");\r\n\t\t\tlogoutEpSelCust(customerName);\r\n\t\t\tselUtils.verifyElementDisp(selUtils.getCommonObject(\"instorepay_tab_xpath\"), INSTOREPAY);*/\r\n\t\t\tlogger.info(\"SMR1137 execution started\");\r\n\t\t}catch (Throwable t) {\r\n\t\t\thandleException(t);\r\n\t\t}\r\n\t}", "@Test\n\tpublic void canFillAllInformation() {\n\t\t\n\t\tuserData John = People.getJohnInfo();\n\t\tboolean expected = true;\n\t\tboolean actual = new AutomationPracticeFormPageObject(driver, baseUrl)\n\t\t.openAutomationWebPage()\n\t\t.inputFirstName(John.getFirstName())\n\t\t.inputLastName(John.getLastName())\n\t\t.selectGender(John.getGender())\n\t\t.selectYearsOfExperience(John.getYearsOfExperience())\n\t\t.inputDate(John.getDate().toString())\n\t\t.selectProfession(John.getProfession())\n\t\t.selectAutomationTool(John.getAutomationTool())\n\t\t.selectContinent(John.getContinent())\n\t\t.selectMultipleContinents(John.getContinentList())\n\t\t.selectSeleniumCommand(John.getSeleniumCommands())\n\t\t.areFieldsCompleted();\n\t\t\n\t\tAssert.assertEquals(actual, expected);\n\t}", "@Test(dataProvider=\"getData\")\n\t public void signUp(String Firstname, \n String Lastname,\n String Email,\n String JobTitle,\n String Phone,\n String Company) {\n\t\t\tHomePageObjects hp = new HomePageObjects(driver);\n\t\t\thp.FreeTrial().click();\n\t\t\t\n\t\t\t\t\n\t\t \t//*****Maximize the window and wait*****//\n\t\t\tdriver.manage().window().maximize();\n\t\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t\t //*****Actions on Login Page*****//\n\t\t\tLoginObjectPage logpg = new LoginObjectPage(driver);\n\t \tlogpg.Firstname().sendKeys(Firstname);\n\t \tlogpg.Lastname().sendKeys(Lastname);\n\t \tlogpg.Email().sendKeys(Email);\n\t \tlogpg.JobTitle().sendKeys(JobTitle);\n\t \tlogpg.Phone().sendKeys(Phone);\n\t \tlogpg.Company().sendKeys(Company);\n\t \tlogpg.NoofEmployees().click();\n\t \tlogpg.employeedropdown(3);\n\t \tlogpg.checkBox().click();\n\t \tlogpg.Enroll().click();\t \n\t System.out.println(driver.getTitle());\n\t \n\t }", "public String getCompanyname() {\n return companyname;\n }", "public static void main(String[] args) throws InterruptedException {\n\r\n\t\tlogin();\r\n\t\tWebDriverWait wait = new WebDriverWait(driver, 10);\r\n\t\tdriver.findElementByLinkText(\"CRM/SFA\").click();\r\n\t\tdriver.findElementByLinkText(\"Leads\").click();\r\n\t\tdriver.findElementByLinkText(\"Find Leads\").click();\r\n\t\tdriver.findElementByXPath(\"(//input[@name='firstName'])[3]\").sendKeys(\"Vikram\");\r\n\t\tdriver.findElementByXPath(\"//button[text()='Find Leads']\").click();\r\n\t\t//Thread.sleep(8000);\r\n\t\t wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"(//table[@class='x-grid3-row-table'])[1]/tbody/tr/td[1]/div/a\")));\r\n\t\tdriver.findElementByXPath(\"(//table[@class='x-grid3-row-table'])[1]/tbody/tr/td[1]/div/a\").click();\r\n\r\n\t\tString actualTitle = driver.getTitle();\r\n\r\n\t\tif (actualTitle.equalsIgnoreCase(expectedTitle)) {\r\n\t\t\tSystem.out.println(\"The Title is matching with the expected\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"The title is not matching with the expected\");\r\n\t\t}\r\n\r\n\t\tdriver.findElementByLinkText(\"Edit\").click();\r\n\t\tdriver.findElementById(\"updateLeadForm_companyName\").clear();\r\n\t\tdriver.findElementById(\"updateLeadForm_companyName\").sendKeys(\"CGI modified\");\r\n\t\tdriver.findElementByXPath(\"//input[@value='Update']\").click();\r\n\t\tThread.sleep(5000);\r\n\r\n\t\tString getCompanyName = driver.findElementById(\"viewLead_companyName_sp\").getText();\r\n\t\tgetCompanyName = getCompanyName.substring(0, getCompanyName.lastIndexOf(\"(\")).trim();\r\n\r\n\t\tif (getCompanyName.equalsIgnoreCase(\"CGI modified\")) {\r\n\t\t\tSystem.out.println(\"The modified company is displayed correctly \" + getCompanyName);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"The modified company name is not displayed \" + getCompanyName);\r\n\t\t}\r\n\r\n\t\t// driver.close();\r\n\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStandardUserSpecificAccounts_RBP() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether confirmation page is getting displayed for Reads, Bills, Payments users\");\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SubmitMeterReadodb\");\n\t\tCrmUserProfile crmuserProfile = new TestDataHelper().getCrmUserProfile(\"SlingshotCrmDetailsRBP\"); \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.VerifySpecificAccountsViewName(userProfile);\t\t\t\t\t \t \t\t\t\t\t \t \t\n\t\tnew BgbRegistrationAction()\n\t\t.AddNewStdUserdata(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.verifyAuditTabledetails(userProfile)\n\t\t.AdduserConfirmationPage();\n\t\t/*.confirmationPageVerificationLinks()\n\t\t.UserJourney_RBPAccessVerification(userProfile);\n\t\tnew SapCrmAction()\n\t\t.loginDetails(crmuserProfile)\n\t\t.searchCrmFieldsVerification(crmuserProfile, userProfile);*/\n\t}", "@Test(groups = { \"android\", \"ios\", \"web\", \"BVT02\" })\n\tpublic void P0Pass_2_testSignUpAsATeacher_BoysScout() throws Exception {\n\t\tSystem.out.println(\"P0Pass_1_testSignUpAsATeacher_BoysScout\");\n\t\tString sEmail = \"test_BoyScouts\" + getTimeStamp().replaceAll(\"-\", \"_\") + \"@test.com\";\n\t\tSystem.out.println(sEmail);\n\t\tLandingPage.getLandingPage(browser).clickOnCreateAccount().clickOnCreateNewClassGroup().clickOnBoyScoutsGroup()\n\t\t.enterFirstName(\"test\").enterLastName(\"Boy Scouts\")\n\t\t.enterEmailId(sEmail).enterPassword(\"bloomz999\")\n\t\t.clickOnSignUpButton().thenVerifyCreateButtonShouldBeDisplayed().thenVerifyProfileName(\"test Boy Scouts\")\n\t\t.thenVerifyWelcomeScreenTroop(\"Create a Troop\").clickOnSettingButton().clickOnAccountSettingsButton()\n\t\t.clickOnDeleteAccountButton().selectReasonForDeleteButton().selectReasonAsOthersButton()\n\t\t.enterPassword().clickDeletePermanentButton().clickOnYesButton().thenVerifyConfirmMessage().clickOnOkButton()\n\t\t.thenVerifySignInAndCreateButtonsShouldBeDisplayed();\n\t}", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\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:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "@When(\"^I set the FI Name dropdown under PM-Companies to (.*)$\")\n public void iSetTheFINameDropdownUnderPMCompaniesToValue(String SearchText) throws Throwable {\n\n companySearch = new CompanySearch(getDriver());\n // Set the FI Dropdown\n companySearch.SetCompanyFIDropdown(SearchText);\n }", "public void setCompany(String company) {\n\t\tthis.company = company;\n\t}", "public static void main(String[] args) {\n\t\tList<String> x=getCompanyNames();\n\t\t\n\t\tfor(String y:x){\n\t\t\tSystem.out.println(y);\n\t\t}\n\t}", "public static Company createCompany() {\r\n\t\treturn createCompany(1, \"Pepcus\", \"Software\", \"PEP\", new Date(), \"Special\", \"This is search help\");\r\n\t}", "@Test(priority = 2, dependsOnMethods = {\"PrintHospitals\"},groups= {\"regression\"})\r\n\tpublic void PrintTopCities()\r\n\t{\r\n\t\tlogger= report.createTest(\"Printing Top Cities\");\r\n\t\tDisplayTopCities top=DisplayHospitalNames.nextPage();\r\n\t\ttop.Back();\r\n\t\ttop.clickOnDiagnostics();\r\n\t\ttop.topcities();\r\n\t}", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "public String getCompanyName() {\r\n return companyName;\r\n }", "public String getCompanyName() {\r\n return companyName;\r\n }", "public String getCompanyName() {\r\n return companyName;\r\n }", "@Step\n public void assertContactUs(){\n contactusPages.assertContactUs();\n }", "@Test\n\n public void verifyRegistrationPageSLT() throws InterruptedException {\n ReadFromPropFile readFromPropFileObj = new ReadFromPropFile(\"RegiProfile.properties\");\n RegisterHealthcareProfPO registerHealthcareProfPOObj = new RegisterHealthcareProfPO(driver);\n\n //**********************Registration Screen************************************//\n\n //1. Click \"Sign in\" button\n Assert.assertTrue(registerHealthcareProfPOObj.clickOnLinkBtn(registerHealthcareProfPOObj.SignIN_xpath),\"Unable to click on SignIn link \");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Click on SignIn link \", \"User should able to click on sign in link\");\n\n //3. Click on \"Click Here\" button for healthcare office.\n Assert.assertTrue(registerHealthcareProfPOObj.clickOnLinkBtn(registerHealthcareProfPOObj.HireReg_xpath),\"Unable to 'Click Here' button\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Click on 'Click Here' button \", \"User should able to Click on 'Click Here' button \");\n\n //4.Enter \"Facility\" name\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.FacilityName_xpath,readFromPropFileObj.getFacilityName()),\"Unable to enter facilityName\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter facility name \", \"User should able to enter on facility name \");\n\n //5.Enter \"First name\"\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.FName_xpath, readFromPropFileObj.getFirstName()),\"Unable to enter First Name\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter first name \", \"User should able to enter first name \");\n\n //5A.Enter \"last name\"\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.LName_xpath, readFromPropFileObj.getLastName()),\"Unable to get LastName\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter last name \", \"User should able to enter on last name \");\n\n //6.Enter EmailID\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.Email_xpath, readFromPropFileObj.getEmail1()),\"Unable to enter emailID\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter EmailID \", \"User should able to enter EmailID\");\n\n //7.Enter phone number\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.Phone_xpath, readFromPropFileObj.getphone()),\"Unable to enter ph\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter phone number \", \"User should able to enter phone number\");\n\n //8.Enter department\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.Dept_xath, readFromPropFileObj.getDept()),\"Unable to enter Dept\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter department \", \"User should able to enter department\");\n\n //9.Enter address\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.Address_xpath, readFromPropFileObj.getAddress()),\"Unable to enter addrees\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter address \", \"User should able to enter address\");\n\n //10.Enter city\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.City_xpath, readFromPropFileObj.getCity()),\"Unable to enter city\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter department \", \"User should able to enter department\");\n\n ((JavascriptExecutor) driver).executeScript(\"window.scrollBy(0,3000)\");\n\n //11.Select State\n Assert.assertTrue(registerHealthcareProfPOObj.selectFromDropDownBtn(registerHealthcareProfPOObj.State_xpath, registerHealthcareProfPOObj.State1_xpath),\"Unable to select state\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Select state \", \"User should able to select state\");\n\n //12.Enter zip code\n Assert.assertTrue(registerHealthcareProfPOObj.enterTextInInputBtn(registerHealthcareProfPOObj.Zip_xpath, readFromPropFileObj.getZip()),\"Unable to enter zip\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Enter zip code \", \"User should able to enter zip code\");\n\n //13.Click \"Registor Now\" button\n Assert.assertTrue(registerHealthcareProfPOObj.clickOnLinkBtn(registerHealthcareProfPOObj.RegisterNow_xpath),\"Unable to click on register now\");\n ExtentTestManager.getTest().log(LogStatus.PASS, \"Click on 'Register Now'\", \"User should able to Click on 'Register Now' \");\n\n //14.User registered successfully and message should display - \"check inbox to verify your account\".\n String expectedMessage = \"Check inbox to verify your account.\";\n Assert.assertEquals(registerHealthcareProfPOObj.findText(registerHealthcareProfPOObj.VerifyAcct_xpath),expectedMessage);\n ExtentTestManager.getTest().log(LogStatus.PASS, \"User should see toast message 'Check inbox to verify your account'\", \"User able to see the toast message\");\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Company.cname);\n\t\tSystem.out.println(Company.cname.toUpperCase());\n\t\n//\t\tCompany.cname.toUpperCase();\n//\t\tSystem.out.println();\n\t\t\n\t\tCompany c = new Company();\n\t\tSystem.out.println(c.cname);\n\t\tc.companyInfo();\n\t\tCompany.companyInfo();\n\t\tSystem.out.println(Math.round(455.6322));\n\t\t\n\t}", "@Test\n\tpublic void TC630DaADL_06(){\n\t\tresult.addLog(\"ID : TC630DaADL_06 : Verify that the apps & devices table \"\n\t\t\t\t+ \"only shows up all devices of specific company \"\n\t\t\t\t+ \"when clicking on company name in apps & device table.\");\n\t\t/*\n\t\t \t1. Navigate to DTS portal\n\t\t\t2. Log into DTS portal as a DTS user successfully\n\t\t\t3. Navigate to \"Apps & Devices\" page\n\t\t\t4. Click on a company name in apps & devices table.\n\t\t */\n\t\t// 3. Navigate to \"Apps & Devices\" page\n\t\thome.click(Xpath.LINK_APP_DEVICES);\n\t\t// 4. Click on a company name in apps & devices table.\n\t\tString company = home.selectTableAt(0, 0);\n\t\t/*\n\t\t * apps & devices table only shows up all devices of selected company. \n\t\t */\n\t\tArrayList<String> companies = home.getColumsByIndex(1);\n\t\tBoolean checkOnly = DTSUtil.containOnlyString(companies, company);\n\t\tAssert.assertTrue(checkOnly);\n\t}", "public void setCompany(String company)\r\n {\r\n m_company = company;\r\n }", "public void companyName(String name) {\n\t\tSystem.out.println(\"One argument\");\n\t\tSystem.out.println(\"Name:\"+name);\n\t}", "public static void showCompanies(){\n\t\tCompanyDao.getAllCompanies();\n\t}", "public static void main(String[] args) {\n WebDriverManager.chromedriver().setup();\n\n // 1.Open Chrome browser\n WebDriver driver = new ChromeDriver();\n\n driver.manage().window().maximize();\n\n // 2.Go to http://practice.cybertekschool.com\n driver.get(\"http://practice.cybertekschool.com\");\n\n // 3.Verify URL contains Expected: cybertekschool\n String currentUrl = driver.getCurrentUrl();\n System.out.println(\"currentUrl = \" + currentUrl);\n String needs = \"cybertekschool\";\n\n // 4.Verify title: Expected: Practice\n String currentTitle = driver.getTitle();\n System.out.println(\"currentTitle = \" + currentTitle);\n String wants = \"Practice\";\n\n if(currentUrl.contains(needs) && currentTitle.contains(wants)){\n System.out.println(\"URL and Title verification test passed\");\n }else{\n System.out.println(\"URL and Title verification test failed\");\n }\n\n\n\n }", "public void setCompanyName(String companyName) {\r\n this.companyName = companyName;\r\n }", "public void setCompanyName(String companyName) {\r\n this.companyName = companyName;\r\n }", "@And(\"^the System displays Citywide Payroll Transactions$\")\n public void the_System_displays_citywide_Payroll_Transactions() throws Exception {\n\tInteger dataFeedsDetailsCountFromDB = DatabaseUtil.getPayrollDetailsCount(2020,'C');\n\tassertFieldContainsText(\"Payroll Data feeds Default Transaction Count\", PayrollPage.getTotalCountForDatfeeds() ,dataFeedsDetailsCountFromDB.toString());\n\t//assertFieldHasText(\"Payroll Advanced search Title\", PayrollPage.getAdvancedSearchOGEPayrollDetailsTitle(), \"NYCHA Payroll Transactions\");\n//\tassertFieldContainsText(\"Payroll Advanced Search Default Transactions Top navigation Amount\", PayrollPage.getTransactionAmount() , PayrollAmount);\n\t\n\t\n\tsoftAssertion.assertAll();\n}", "@Test(priority = 2 , retryAnalyzer = Retry.class)\n\tpublic void VPORT_10_VerifyAllTabsPages()\n\t{\n\t\tString districtUser = dependentData.getProperty(\"VPORT_002_DistrictUserName\");\n\t\tvportloginpage.enterLoginCredentials(districtUser, vportData.distUserPassword);\n\t\tdistrictAdminHomepage = (DistrictAdminHomepage) vportloginpage.clickSignInButton(ReturnPage.MYDISTRICPAGE);\n\t\t//\tVerifying all the Pages and links for District user\n\t\tdistrictAdminHomepage.verifyAllTheLinksAndPages(\"DistUser\");\n\t\t//Log out from District user Login\n\t\tvportloginpage=districtAdminHomepage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();\n\n\t\t/*\t ---Verification For Campus User User--- \n\t\tString campusUser = dependentData.getProperty(\"VPORT_002_SchoolUser\");\n\t\tvportloginpage.enterLoginCredentials(campusUser, vportData.schoolUserPassword);\n\t\tdistrictAdminHomepage = (DistrictAdminHomepage) vportloginpage.clickSignInButton(ReturnPage.MYDISTRICPAGE);\n\t\t//\tVerifying all the Pages and links for District user\n\t\tdistrictAdminHomepage.verifyAllTheLinksAndPages(\"CampUser\");\n\t\t//Log out from Campus/School user Login\n\t\tvportloginpage=districtAdminHomepage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();\n\n\t\t ---Verification For Teacher User--- \n\t\tString teacher = dependentData.getProperty(\"VPORT_006_TeacherUserID\");\n\t\tvportloginpage.enterLoginCredentials(teacher, teacher);\n\t\tdistrictAdminHomepage = (DistrictAdminHomepage) vportloginpage.clickSignInButton(ReturnPage.MYDISTRICPAGE);\n\t\t//\tVerifying all the Pages and links for District user\n\t\tdistrictAdminHomepage.verifyAllTheLinksAndPages(\"Teacher\");\n\t\t//Log out from Teacher user Login\n\t\tvportloginpage=districtAdminHomepage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();*/\n\t}", "@BeforeClass\n\t\n\tpublic void DashboadPageSetup() {\n\t\n\t\tdataSheetName = \"NiyogaaAdministrationHeadSMMmodule\";\n\t\t\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"SchoolERPAdminusername\"), prop.getProperty(\"SchoolERPAdminpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"CADMINusername\"), prop.getProperty(\"CADMINpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"Librarianusername\"), prop.getProperty(\"Librarianpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"Principalusername\"), prop.getProperty(\"Principalpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"VicePrincipalusername\"), prop.getProperty(\"VicePrincipalpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"NiyogaaMarketingHeadusername\"), prop.getProperty(\"NiyogaaMarketingHeadpassword\"));\n\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"NiyogaaAdministartionHeadusername\"), prop.getProperty(\"NiyogaaAdministartionHeadpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"NiyogaaFinanceHeadusername\"), prop.getProperty(\"NiyogaaFinanceHeadpassword\"));\n//\t\tSchoolManagementmodulepages = loginpage1.dousersSMMLogin(prop.getProperty(\"SchoolAccountHeadusername\"), prop.getProperty(\"SchoolAccountHeadpassword\"));\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyRPAccessJourneys() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the RB user is able to perform journeys\");\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"Switchtopaperlessacctspecificsdata\");\t\t\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.bgbloginDetails(userProfile);\t\t\n\t\tnew MultiUserMultiViewAction()\n\t\t.ManageAccountLink(userProfile)\n\t\t.verifyRPuserjourneyverification();\n\t\n\t}", "@Then(\"User should be navigated to Bills page on clicking Bills tab\")\n\tpublic void services_positive_tc_011() throws IOException {\n\t\ttry {\n\t\t\tclick(\"bills\");\n\t\t\tstr=driver.findElement(By.xpath(OR_reader(\"Object Locator\",\"bills_title\"))).isDisplayed();\n\t\t\tAssert.assertEquals(str, true);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttakeScreenShot(\"services_positive_tc_011\");\n\t\t}\n\t}", "@Test\n public void testGetBusinessName() {\n \n assertNotNull(o1.getBusinessName());\n assertEquals(\"testName\", o1.getBusinessName());\n \n assertNull(o2.getBusinessName());\n }", "@Then(\"User can view the dashboard\")\npublic void user_can_view_the_dashboard() {\n addCust = new AddcustomerPage(driver);\n Assert.assertEquals(\"Dashboard / nopCommerce administration\", addCust.getPageTitle());\n \n}", "public String getCompany() {\n return company;\n }", "@And(\"^user enters \\\"([^\\\"]*)\\\" as Company Name$\")\n\tpublic void user_enters_as_Company_Name(String arg1) throws Throwable {\n\t\ttry {\n\t\t SeleniumOperations.setText(\"//input[@name='name']\",arg1);\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:User enters CompanyName successfully \");\n\t\t \n\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:User entered Company name Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\t HTMLReportGenerator.StepDetails(\"Fail\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:Fail to enters CompanyName\");\n\t\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:Fail to enter Company name ,Exception:NA\"+ex.getMessage();\n\t\t //\tSystem.out.println(op1);\n\t\t \n\t\t}\n\t}", "@Test(priority=1, dataProviderClass = BillingDataProvider.class, dataProvider=\"dataProviderForGoLive\")\n\tpublic void Billing_UseCase1(String testDataSetId) {\n\t\t\n\t\tLoginPage loginPage = new LoginPage();\n\t\tHomePage homePage = new HomePage();\n\t\tDealershipPage dealershipPage = new DealershipPage();\n\t\tOpportunityPage opportunityPage = new OpportunityPage();\n\t\tProductPage productPage = new ProductPage();\n\t\tBillingObjectPage billingObjectPage = new BillingObjectPage();\n\t\tAriaHierarchyPage ariaHierarchyPage = new AriaHierarchyPage();\n\t\tAriaIntegrationPage ariaIntegrationPage = new AriaIntegrationPage();\n\n\t\t/*Fetch Use Case details*/\n\t\tMap<String, String> useCaseDetails = EdmundsConfigProperties\n\t\t\t\t.XL_READER.fromSheet(\"Use Cases List\").getDataFromRow(\"Case 1\");\n\t\t\n\t\ttestReporter.initTestCase(useCaseDetails.get(\"Use Case ID\") + \" (with \" + testDataSetId + \")\", \n\t\t\t\tuseCaseDetails.get(\"Description\"), \n\t\t\t\tuseCaseDetails.get(\"Category\"));\n\t\t\n\t\t/*Fetch Use Case test data*/\n\t\tTestData data = testDataGetter.getTestData(\"Billing Go Live Test Data\", testDataSetId);\n\n\t\tOpportunityType opportunityType = OpportunityType.convertStringToOpportunityType(data.get(\"Opportunity Type\"));\n\t\tString dateTimeStamp = TextUtil.getCurrentDateTimeStamp();\n\t\tString dealershipName = TextUtil.getAutoPrefixWithDateTimeStamp(data.get(\"Dealership Name\"), dateTimeStamp);\n\t\tString opportunityName = TextUtil.getAutoPrefixWithDateTimeStamp(data.get(\"Opportunity Name\"), dateTimeStamp);\n\t\tString initialStage = data.get(\"Initial Stage\");\n\t\tString finalStage = data.get(\"Final Stage\");\n\t\t\n\t\ttry {\n\t\t\t/*Test Steps*/\n\t\t\tloginPage.login(EdmundsConfigProperties.USERNAME, EdmundsConfigProperties.PASSWORD);\n\t\t\t\n\t\t\thomePage.navigateToDealerShips();\n\t\t\tString dealershipId = dealershipPage.createDealership(dealershipName);\n\t\t\tAssertions.info(\"Dealership Id \t\t= \" + dealershipId);\n\n\t\t\tString opportunityId = opportunityPage.createOpportunity(opportunityType, opportunityName, initialStage, dealershipName);\n\t\t\tAssertions.verify(opportunityId!=null, \n\t\t\t\t\t\"Opportunity Id \t= \" + opportunityId, \n\t\t\t\t\t\"Failed to create opportunity.\");\n\n\t\t\tproductPage.createProduct(opportunityType, data.get(\"Sales Price\"), opportunityName);\n\t\t\tboolean stageChanged = opportunityPage.changeStageTo(finalStage);\n\t\t\t\n\t\t\tif (!stageChanged) {\n\t\t\t\tAssertions.fail(\"Stage could NOT be changed to \" + finalStage);\n\t\t\t\tthrow new TestFailedException();\n\t\t\t} \n\t\t\t\n\t\t\tString totalSalesPrice_InOppty = opportunityPage.labelTotalSalesPrice_Value.getText();\n\t\t\tString liveDate_InOppty = opportunityPage.labelLiveDate_Value.getText();\n\t\t\tString invoicingAccount_InOppty = opportunityPage.linkInvoicingAccount.getText();\n\t\t\tString dealershipName_InOppty = opportunityPage.linkDealershipName.getText();\n\n\t\t\tif (opportunityType.equals(OpportunityType.New)) {\n\t\t\t\topportunityPage.navigateToBillingObject();\n\t\t\t} else {\n\t\t\t\topportunityPage.navigateToBillingObject(opportunityType);\n\t\t\t}\n//\t\t\topportunityPage.navigateToBillingObject();\n\t\t\tString billingObjectId = billingObjectPage.getBillingObjectId();\n\t\t\tAssertions.info(\"Billing Object Id \t= \" + billingObjectId);\n\t\t\t\n\t\t\tString ariaHierarchyId = billingObjectPage.getAriaHierarchyId();\n\t\t\tAssertions.info(\"Aria Hierarchy Id \t= \" + ariaHierarchyId);\n\t\t\t\n\t\t\tString salesPrice_InBO = billingObjectPage.labelSalesPrice_Value.getText();\n\t\t\tString billingStartDate_InBO = billingObjectPage.labelBillingStartDate_Value.getText();\n\t\t\tString invoicingAccount_InBO = billingObjectPage.linkInvoicingAccount.getText();\n\t\t\tString parentAccount_InBO = billingObjectPage.linkParentAccount.getText();\n\t\t\tboolean jBFlagCreateProductAccount_InBO = billingObjectPage.imageJBFlagCreateProductAccount_Checked.isDisplayed();\n\t\t\tboolean jBFlagCreateParentAccount_InBO = billingObjectPage.imageJBFlagCreateParentAccount_Checked.isDisplayed();\n\t\t\t\n\t\t\t//Salesforce Validations before Aria Integration:\n\t\t\tAssertions.info(\"======== Salesforce Validations before Aria Integration ========\");\n\t\t\t\t\t\n\t\t\tAssertions.verify(totalSalesPrice_InOppty.equals(salesPrice_InBO),\n\t\t\t\t\t\"Opportunity Total Sales Price = Billing Object Sales Price\",\n\t\t\t\t\t\"Opportunity Total Sales Price is NOT equal to Billing Object Sales Price\");\n\t\t\tAssertions.verify(liveDate_InOppty.equals(billingStartDate_InBO),\n\t\t\t\t\t\"Opportunity Live Date = Billing Object Billing Start Date\",\n\t\t\t\t\t\"Opportunity Live Date is NOT equal to Billing Object Billing Start Date\");\n\t\t\tAssertions.verify(invoicingAccount_InOppty.equals(invoicingAccount_InBO),\n\t\t\t\t\t\"Opportunity Invoicing Account = Billing Object Invoicing Account\",\n\t\t\t\t\t\"Opportunity Invoicing Account is NOT equal to Billing Object Invoicing Account\");\n\t\t\tAssertions.verify(dealershipName_InOppty.equals(parentAccount_InBO),\n\t\t\t\t\t\"Opportunity Dealership Name = Billing Object Parent Account\",\n\t\t\t\t\t\"Opportunity Dealership Name is NOT equal to Billing Object Parent Account\");\n\n\t\t\tAssertions.verify(\"JB Flag Create Product Account\", \n\t\t\t\t\ttrue, jBFlagCreateProductAccount_InBO);\n\t\t\tAssertions.verify(\"JB Flag Create Parent Account\", \n\t\t\t\t\ttrue, jBFlagCreateParentAccount_InBO);\n\t\t\t\t\t\n\t\t\tbillingObjectPage.linkAriaHierarchy.click();\n\t\t\t\n\t\t\tString dealership_InAH = ariaHierarchyPage.linkDealership.getText();\n\t\t\tString invoicingAccount_InAH = ariaHierarchyPage.labelInvoicingAccount_Value.getText();\n\t\t\tString ariaDealershipAccountNo_InAH = ariaHierarchyPage.labelAriaDealershipAccountNo_Value.getText();\n\t\t\tString ariaInvoicingAccountNo_InAH = ariaHierarchyPage.labelAriaInvoicingAccountNo_Value.getText();\n\t\t\tString empty = \" \";\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Aria Hierarchy:\");\n\t\t\tAssertions.verify(dealership_InAH.equals(dealershipName_InOppty),\n\t\t\t\t\t\"Dealership = Opportunity Dealership Name\",\n\t\t\t\t\t\"Dealership is NOT equal to Opportunity Dealership Name\");\n\t\t\tAssertions.verify(invoicingAccount_InAH.equals(empty)||invoicingAccount_InAH.equals(\"\"),\n\t\t\t\t\t\"Invoicing Account = <Null> \",\n\t\t\t\t\t\"Invoicing Account is NOT <Null> \");\n\t\t\tAssertions.verify(ariaDealershipAccountNo_InAH.equals(empty)||ariaDealershipAccountNo_InAH.equals(\"\"),\n\t\t\t\t\t\"Aria Dealership Account No = <Null>\",\n\t\t\t\t\t\"Aria Dealership Account No is NOT <Null>\");\n\t\t\tAssertions.verify(ariaInvoicingAccountNo_InAH.equals(\" \"),\n\t\t\t\t\t\"Aria Invoicing Account No = <Null>\",\n\t\t\t\t\t\"Aria Invoicing Account No is NOT <Null>\");\n\t\t\t\n\t\t\t//Aria Integration:\n\t\t\thomePage.navigateToAriaIntegrationPage();\n\t\t\tAssertions.info(\"Starting Jitterbit job ...\");\n\t\t\tariaIntegrationPage.startJitterBitJob();\n\t\t\t// Wait to let Jitterbit job complete.\n\t\t\tboolean ariaIntegrationIsDone = ariaIntegrationPage\n\t\t\t\t\t.waitForJitterBitJobToComplete(600);//(EdmundsConfigProperties.ARIA_INTEGRATION_WAITING_TIME);\n\n\t\t\tif (ariaIntegrationIsDone) {\n\t\t\t\n\t\t\t\t//Salesforce Validations after Aria Integration:\n\t\t\t\tAssertions.info(\"======== Salesforce Validations after Aria Integration ========\");\n\t\t\t\topportunityPage.navigateToOpportunity(opportunityId);\n\t\t\t\tif (opportunityType.equals(OpportunityType.New)) {\n\t\t\t\t\topportunityPage.navigateToBillingObject();\n\t\t\t\t} else {\n\t\t\t\t\topportunityPage.navigateToBillingObject(opportunityType);\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\topportunityPage.navigateToBillingObject();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString ariaInvoicingAccountNo_InBO_AfterIntegration = billingObjectPage.labelAriaInvoicingAccountNo_Value.getText();\n\t\t\t\tString ariaParentAccountNo_InBO_AfterIntegration = billingObjectPage.labelAriaParentAccountNo_Value.getText();\n\t\t\t\tString ariaProductAccountNo_InBO_AfterIntegration = billingObjectPage.labelAriaProductAccountNo_Value.getText();\n\t\t\t\t\n\t\t\t\tAssertions.verify(ariaInvoicingAccountNo_InBO_AfterIntegration.equals(\"\") || ariaInvoicingAccountNo_InBO_AfterIntegration.equals(\" \"),\n\t\t\t\t\t\t\"Aria Invoicing Account No = <null>\",\n\t\t\t\t\t\t\"Aria Invoicing Account No is NOT <null>\");\n\t\t\t\tAssertions.verify(\t!\t(ariaParentAccountNo_InBO_AfterIntegration.equals(\"\")||ariaParentAccountNo_InBO_AfterIntegration.equals(\" \")),\n\t\t\t\t\t\t\"Aria Parent Account No = \" + ariaParentAccountNo_InBO_AfterIntegration,\n\t\t\t\t\t\t\"Aria Parent Account No is NOT <populated>\");\n\t\t\t\tAssertions.verify(!ariaProductAccountNo_InBO_AfterIntegration.equals(\"\"),\n\t\t\t\t\t\t\"Aria Product Account No = \" + ariaProductAccountNo_InBO_AfterIntegration,\n\t\t\t\t\t\t\"Aria Product Account No is NOT <populated>\");\n\t\t\t\tAssertions.verify(billingObjectPage.isJBFlagCreateProductAccountUnchecked(),\n\t\t\t\t\t\t\"JB Flag Create Product Account is unchecked\", \n\t\t\t\t\t\t\"JB Flag Create Product Account is NOT unchecked\");\n\t\t\t\tAssertions.verify(billingObjectPage.isJBFlagCreateParentAccountUnchecked(),\n\t\t\t\t\t\t\"JB Flag Create Parent Account is unchecked\", \n\t\t\t\t\t\t\"JB Flag Create Parent Account is NOT unchecked\");\n\t\t\t\t\n\t\t\t\tbillingObjectPage.navigateToAriaHierarchy();\n\t\t\t\t\n\t\t\t\tString ariaDealershipAccountNo_InAH_AfterIntegration = ariaHierarchyPage.labelAriaDealershipAccountNo_Value.getText();\n\t\t\t\t\n\t\t\t\tAssertions.verify(\t!\t(ariaDealershipAccountNo_InAH_AfterIntegration.equals(\"\")||ariaDealershipAccountNo_InAH_AfterIntegration.equals(\" \")),\n\t\t\t\t\t\t\"Aria Dealership Account No = \" + ariaDealershipAccountNo_InAH_AfterIntegration,\n\t\t\t\t\t\t\"Aria Dealership Account No is NOT <populated>\");\n\t\t\t\t\n\t\t\t\thomePage.logout();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Aria API Validations:\n\t\t\t\t\n\t\t\t\t//Product Account\n\t\t\t\tAssertions.info(\"======== Aria side API Validations after Integration ========\");\n\t\t\t\tString productNo = ariaProductAccountNo_InBO_AfterIntegration;\n\t\t\t\tboolean isProductExists = AriaAPIHelper.verifyIfProductExistsInAria(productNo);\n\t\t\t\tAssertions.verify(isProductExists, \n\t\t\t\t\t\t\"Product with number \"+productNo+\" exists in the Aria.\", \n\t\t\t\t\t\t\"Product with number \"+productNo+\" does NOT exists in the Aria.\");\n\t\t\t\t\n\t\t\t\tboolean isSuppPlanAssigned = AriaAPIHelper.checkIfSuppPlanIsAssigned(productNo);\n\t\t\t\tAssertions.verify(isSuppPlanAssigned, \n\t\t\t\t\t\t\"Supplemental Plan is assigned to the Product Account with number \"+productNo+\".\", \n\t\t\t\t\t\t\"Supplemental Plan is NOT assigned to the Product Account with number \"+productNo+\".\");\n\t\t\t\t\n\t\t\t\tAcctHierarchyDetailsReturnElement acctHierarchyDetails = AriaAPIHelper.getAcctHierarchyDetailsElement(productNo);\n\t\t\t\tString actualResponsibilityLevel = AriaAPIHelper.getResponsibilityLevel_FromCode(acctHierarchyDetails.getRespLevelCd());\n\t\t\t\tString expectedResponsibilityLevel = \"Parent Pay\";\n\t\t\t\tAssertions.verify(\"Responsibility Level\", expectedResponsibilityLevel, actualResponsibilityLevel);\n\t\t\t\t\n\t\t\t\tString suppPlanName = AriaAPIHelper.getLatestAssignedSuppPlan(productNo).getPlanName();\n\t\t\t\tAssertions.verify(\"Supplemental Plan Name\", data.get(\"Opportunity Name\"), suppPlanName);\n\t\t\t\t\n\t\t\t\t//Invoice Date\n\t\t\t\tInvoiceHistoryReturnElement invoiceHistory = AriaAPIHelper.getLatestInvoiceFromInvoiceHistory(productNo);\n\t\t\t\tif (invoiceHistory==null){\n\t\t\t\t\tAssertions.info(\"No Invoice History\");\n\t\t\t\t} else {\n\t\t\t\t\tString invoiceDateFromApi = (invoiceHistory.getPostingDate().split(\" \")[0]);\n\t\t\t\t\t\n\t\t\t\t\tDateTimeFormatter \treceivedFormat = DateTimeFormatter.ofPattern(\"uuuu-MM-dd\"),\n\t\t\t\t\t\t\trequiredFormat = DateTimeFormatter.ofPattern(\"MM/dd/yyyy\");\n\t\t\t\t\tLocalDate date = LocalDate.parse(invoiceDateFromApi, receivedFormat);\n\t\t\t\t\tString actualInvoiceDate = date.format(requiredFormat);\n\t\t\t\t\t\n\t\t\t\t\tString splitDate[] = billingStartDate_InBO.split(\"/\");\n\t\t\t\t\tLocalDate billingStartDate_InDate = LocalDate.of(Integer.valueOf(splitDate[2]), Integer.valueOf(splitDate[0]), Integer.valueOf(splitDate[1]));\n\t\t\t\t\tString expectedInvoiceDate = billingStartDate_InDate.format(requiredFormat);//date2.format(requiredFormat);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tAssertions.verify(\"Invoice Date\", expectedInvoiceDate, actualInvoiceDate);\n\t\t\t\t\t\n\t\t\t\t\t//Invoice Details\n\t\t\t\t\tString invoiceNo = invoiceHistory.getInvoiceNo().toString();\n\t\t\t\t\tInvoiceLineItemsReturnElement invoiceLineItem = AriaAPIHelper.getLatestInvoiceLineItem(productNo, invoiceNo);\n\t\t\t\t\tString actualUnits = invoiceLineItem.getUnits().toString();\n\t\t\t\t\tString actualRatePerUnit = invoiceLineItem.getRatePerUnit().toString();\n\t\t\t\t\tString actualAmount = invoiceLineItem.getAmount().toString();\n\t\t\t\t\t//TODO\n\t\t\t\t\tDouble expectedUnitsDoubleValue = Double.valueOf(EdmundsUtil.getUnitsForToday(TimeZone.getTimeZone(\"PST\"))); \n\t\t\t\t\tDouble expectedRatePerUnitDoubleValue = Double.valueOf(\"1000\");\n\t\t\t\t\tDouble expectedAmountDoubleValue = expectedUnitsDoubleValue*expectedRatePerUnitDoubleValue;\n\t\t\t\t\tString expectedUnits = //EdmundsUtil.getDecimalFormat(\"#0.00\", expectedUnitsDoubleValue);\n\t\t\t\t\t\n\t\t\t\t\t(actualUnits.split(\"\\\\.\")[1].length()==1)? \n\t\t\t\t\t\t\tEdmundsUtil.getDecimalFormat(\"#0.0\", expectedUnitsDoubleValue):\n\t\t\t\t\t\t\t\tEdmundsUtil.getDecimalFormat(\"#0.00\", expectedUnitsDoubleValue);\n\t\t\t\t\t\n\t\t\t\t\tString expectedRatePerUnit = EdmundsUtil.getDecimalFormat(\"#0.0\", expectedRatePerUnitDoubleValue);\n\t\t\t\t\tString expectedAmount = (actualAmount.split(\"\\\\.\")[1].length()==1)? \n\t\t\t\t\t\t\tEdmundsUtil.getDecimalFormat(\"#0.0\", expectedAmountDoubleValue):\n\t\t\t\t\t\t\t\tEdmundsUtil.getDecimalFormat(\"#0.00\", expectedAmountDoubleValue);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tAssertions.verify(\"Units\", expectedUnits, actualUnits);\n\t\t\t\t\t\t\tAssertions.verify(\"Rate Per Unit\", expectedRatePerUnit, actualRatePerUnit);\n\t\t\t\t\t\t\tAssertions.verify(\"Amount\", expectedAmount, actualAmount);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Supplemental Fields\n\t\t\t\t\t\t\tMap<String, String> suppFields = AriaAPIHelper.getSuppFields(productNo);\n\t\t\t\t\t\t\tString cddId = suppFields.get(\"CDDID\");\n\t\t\t\t\t\t\tString bundleId = suppFields.get(\"BundleID\");\n\t\t\t\t\t\t\tAssertions.verify(!cddId.isEmpty(), \n\t\t\t\t\t\t\t\t\t\"CDD ID = \" + cddId +\".\",\n\t\t\t\t\t\t\t\t\t\"CDD ID is NOT populated.\");\n\t\t\t\t\t\t\tAssertions.verify(!bundleId.isEmpty(), \n\t\t\t\t\t\t\t\t\t\"Bundle ID = \" + bundleId +\".\",\n\t\t\t\t\t\t\t\t\t\"Bundle ID is NOT populated.\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tAssertions.fail(\"Aria Integration\");\n\t\t\t\thomePage.logout();\n\t\t\t}\n\t\t\tAssertions.info(\"Use Case : \" + useCaseDetails.get(\"Use Case ID\") + \" completed.\");\n\t\t} catch (Exception e) {\n\t\t\tAssertions.fail(\"Use case could NOT be completed.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setCompanyname(java.lang.String newCompanyname) {\n\tcompanyname = newCompanyname;\n}", "public static void viewPage(WebDriver driver, String sTestCaseName) throws Exception{\r\n\t\r\n\t\t//Check that all of the elements of that are expected are displayed\r\n\t\tObjects_Job_Completion_Summary_Page.lbl_Summary(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Summary label displayed as expected\");\r\n\t\t}\r\n\r\n\t\tif (\"Exchange_1_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"INST_14_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_19_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_1_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\telse if (\"Exchange_2_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_15_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_20_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_11_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_8_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t}\r\n\t\telse if (\"Exchange_3_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_SMeter_Post_Installation_Pressure_Drop_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Initial_Risk_Assessment_Gas_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Suitable_For_Smart_Installation_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_21_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_16_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Polarity_Check_At_Meter_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Suitable_For_Smart_Installation_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_Found_Meter_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t} \r\n\t\telse \t\t\r\n\t\t{ \r\n\t\t\tSystem.out.println(\"Doing the else \"); \r\n\t\t}\t\t\t\t\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Potential_Customer_Vulnerability_Identified_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Potential Customer Vulnerability Identified - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.txt_Additional_Notes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Additional notes textbox displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_No(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - No radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t//Take a screenshot to show what we've done\r\n\t\tUtils.takeScreenshot(driver, sTestCaseName + \"-viewPage\");\r\n\t\t\r\n\t//END OF VIEW PAGE METHOD\r\n\t}", "public static void main(String[] args) {\n\t\tCompanyDao companyDao = new CompanyDao();\n\t\tArrayList<Company> company_list = companyDao.getArrayList_company();\n\n\t\tfor(int i = 0; i < company_list.size(); i++) {\n\t\t\tSystem.out.print(company_list.get(i).getNameString());\n\t\t\tSystem.out.print(company_list.get(i).getSalesman_nameString());\n\t\t}\n \n\t}", "@When (\"^job information details is filled \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\"$\")\r\n\tpublic void whenJobInfo(String email,String title, String appemail, String website, String company) throws InterruptedException\r\n\t{\n\t\tdriver.findElement(By.xpath(\"//input[@name='create_account_email']\")).sendKeys(email);\r\n\t\tThread.sleep(2000);\r\n\t\t\r\n\t\t// entering the new job details\r\n\t\t driver.findElement(By.xpath(\"//input[@name='job_title']\")).sendKeys(title);\r\n\t\t Thread.sleep(5000);\r\n\t\t \r\n\t\t \r\n\t\t// entering the discription\r\n\t\t// driver.findElement(By.xpath(\"//div[@class='field required-field']//div[@class='wp-job_description-wrap']//div[@class='wp-editor-container']//div[@id='mceu_16']//iframe[@id='job_description_ifr']//body[@id='tinymce']//p[1]\")).sendKeys(\"Test Opening\");\r\n\t\t \r\n\t // scrolling the page down\r\n//\t\t JavascriptExecutor js = (JavascriptExecutor) driver;\r\n//\t\t js.executeScript(\"window.scrollTo(0,document.body.scrollHeight)\");\r\n\t\t \r\n\r\n\t\t \r\n\t// entering other details\r\n\t\t // application email\r\n\t\t System.out.println(\"Application Email \"+email);\r\n\t\t String txt1=driver.findElement(By.xpath(\"//input[contains(@name,'application')]\")).getText();\r\n\t\t System.out.println(txt1);\r\n\t\t driver.findElement(By.xpath(\"//input[contains(@name,'application')]\")).sendKeys(appemail);\r\n\t\t Thread.sleep(5000);\r\n\t\t \r\n\t\t // website\r\n\t\t driver.findElement(By.xpath(\"//input[@name='company_website']\")).sendKeys(website);\r\n\t\t Thread.sleep(2000);\r\n\t\t \r\n\t\t // company name\r\n\t\t driver.findElement(By.xpath(\"//input[@name='company_name']\")).sendKeys(company);\r\n\t\t Thread.sleep(2000);\r\n\t\t \r\n\t// publishing the job\r\n\t\t WebElement publish = driver.findElement(By.xpath(\"//input[@name='submit_job']\"));\r\n\t\t publish.click();\r\n\t\t System.out.println(\"job vacancy is submitted for review\");\r\n\t\t Thread.sleep(2000);\r\n\t\r\n\t// republish after review\r\n\t\t driver.findElement(By.xpath(\"//input[@type='submit'][contains(@id,'button')]\")).click();\r\n\t\t System.out.println(\"job vacancy is published\");\r\n\t\t driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);\r\n\t\t \r\n\t\t \r\n\t// publish confirmation\r\n\t\t driver.findElement(By.xpath(\"//div[@class='editor-post-publish-panel__header-published'][contains(.,'Published')]\"));\r\n\t\t \r\n\t// Job successfully posting\r\n\t\t String posting = driver.findElement(By.xpath(\"//div[@itemprop='text']\")).getText();\r\n\t\t System.out.println(posting);\r\n\t\t Assert.assertEquals(\"Job submitted successfully. Your listing will be visible once approved.\",posting);\t\r\n\t}", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "void companyStudentMatching (Student[]students, Company[]companies){\n match1to1s(students, companies);\n\n //case 2: lol\n assign(students, companies);\n\n }", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n return company;\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyRBPAccessJourneys() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the RBP user is able to perform journey\");\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"Switchtopaperlessacctspecificsdata\");\t\t\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.bgbloginDetails(userProfile);\t\t\n\t\tnew MultiUserMultiViewAction()\n\t\t.ManageAccountLink(userProfile)\n\t\t.verifyRBPuserjourneyverification();\n\t\n\t}", "@Test(groups = {\"Regression\", \"IntakeLender\"})\t\n\tpublic void LoAssignment() throws InterruptedException, AWTException {\n\t\t// Login to the BLN with provided credentials\n\t\tHomePage homePage = new HomePage(d);\n\t\t// Login to BLN Application\n\t\thomePage.logIntoBLN();\n\t\t// Navigating to MyProfile Tab\n\t\tUsers Users1 = homePage.navigateToUsers();\n\t\tLender Lender1=Users1.select_RCNLender();\n\t\tLender1.RCN_loanOfficers();\n\t\t// Navigating to MyProfile Tab\n\t\tUsers Users2 = homePage.navigateToUsers();\n\t\tUsers2.select_intakeLender();\n\t\tApplication Application1 = homePage.createLoanRequest();\n\t\tApplication1.LoanOfficer();\n\t\tApplication1.LoanOfficerTest(Users1.sortedList1,Users2.sortedList1);\n\t\t\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifySAPElecCustomer()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the SAP SMR page for Electricity customer\");\n//SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SAPSMRGasUserforsingleMeter\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SAPSMRElectricityUserforsingleMeter\");\n\t\t new SubmitMeterReadAction()\n\t\t .openSMRpage(\"Electricity\")\n\t\t.verifyAnonymousSAPElecCustomersRewrite(smrProfile);\n}", "public void setCompanyName(String companyName) {\n this.companyName = companyName;\n }", "boolean hasCompany();", "@Then(\"User should be navigated to Second opinions page on clicking Second opinions tab\")\n\tpublic static void services_positive_tc_002() throws IOException {\n\t\ttry {\n\t\t\tclick(\"second_opinions\");\n\t\t\tstr=driver.findElement(By.xpath(OR_reader(\"Object Locator\",\"second_opinions_title\"))).isDisplayed();\n\t\t\tAssert.assertEquals(str, true);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttakeScreenShot(\"services_positive_tc_002\");\n\t\t}\n\t}", "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}", "@Test\n\tpublic void testGetAllAdminAccountsWithBusinessInformation() {\n\t\tBusinessInformation businessInformation = new BusinessInformation();\n\t\tbusinessInformation.setName(INFO_NAME);\n\t\tList<AdminAccount> users = adminAccountService.getAllAdminAccountsWithBusinessInformation(INFO_NAME);\n\t\tassertNotNull(users);\n\t\tassertEquals(users.get(0).getUsername(), USERNAME1);\n\t\tassertEquals(users.get(1).getUsername(), USERNAME2);\n\t}", "@Test\n public void customerNameTest() {\n // TODO: test customerName\n }", "public static void main(String[] args) {\n\n\n String employeeName = \"Gurcu\";\n String companyName = \"Kucuk Holding\";\n int employeeId = 5;\n String jobTitle = \" CEO \";\n double salary = 100000.5;\n int ssn = 12345678;\n\n System.out.println(\"Employee Name: \"+employeeName);\n System.out.println(\"Company Name: \"+companyName);\n System.out.println(\"Employee Id :\" +employeeId );\n System.out.println(\"Job Title :\"+jobTitle);\n System.out.println(\"Social Security Number:\"+ssn);\n System.out.println(\"Salary:\"+salary);\n\n System.out.println(\"Employee Name:\"+employeeName + \"\\nCompany Name:\"+companyName +\n \"\\nEmployee ID: \" +employeeId + \"\\nJob Title: \" + jobTitle +\n \"\\nSalary:\"+ salary + \"\\nSnn:\" +ssn);\n\n System.out.println(\"==================================================\");\n\n String firstName = \"Zeynep\";\n String lastName = \"Dere\";\n\n System.out.println(\"Full Name: \" + firstName+\" \"+lastName);\n\n\n }" ]
[ "0.6544909", "0.6495229", "0.63256705", "0.6155111", "0.6114997", "0.60016334", "0.59954405", "0.5994621", "0.598038", "0.59790325", "0.58884597", "0.58884597", "0.5885274", "0.5796271", "0.57669395", "0.5739747", "0.57200867", "0.5719151", "0.57156247", "0.5703166", "0.56931704", "0.5687681", "0.56814003", "0.5651997", "0.563193", "0.56306064", "0.5626116", "0.5610361", "0.5601473", "0.55883104", "0.55714816", "0.553532", "0.55309016", "0.5483408", "0.54817605", "0.5472892", "0.54726857", "0.54706794", "0.547042", "0.54688025", "0.54542", "0.5450973", "0.5424881", "0.54240555", "0.5420887", "0.5412469", "0.5409635", "0.54084665", "0.5401128", "0.5392738", "0.53729403", "0.5365217", "0.535621", "0.53557855", "0.534189", "0.53295785", "0.532706", "0.532706", "0.532706", "0.5325397", "0.5318351", "0.5304832", "0.53025043", "0.5302381", "0.530213", "0.5299394", "0.5297386", "0.5296039", "0.5296039", "0.52912873", "0.52873814", "0.5285125", "0.52757275", "0.5270778", "0.5262406", "0.5260006", "0.5255871", "0.52555025", "0.52385354", "0.52383417", "0.52373457", "0.5227654", "0.5224826", "0.52218324", "0.52218324", "0.52218324", "0.52218324", "0.52206314", "0.52162576", "0.52162576", "0.5211322", "0.5206763", "0.5204609", "0.5202586", "0.52019614", "0.51947314", "0.51938474", "0.5191204", "0.5187283", "0.518612" ]
0.62763095
3
FI Dropdown for PMCompanies
@When("^I set the FI Name dropdown under PM-Companies to (.*)$") public void iSetTheFINameDropdownUnderPMCompaniesToValue(String SearchText) throws Throwable { companySearch = new CompanySearch(getDriver()); // Set the FI Dropdown companySearch.SetCompanyFIDropdown(SearchText); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void showCompanies(){\n\t\tCompanyDao.getAllCompanies();\n\t}", "public void fillPLComboBox(){\n\t\tmonths.add(\"Select\");\n\t\tmonths.add(\"Current Month\");\n\t\tmonths.add(\"Last Month\");\n\t\tmonths.add(\"Last 3 Months\");\n\t\tmonths.add(\"View All\");\n\t}", "public void selectCompany() throws Exception {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tWebElement Companyelement = driver.findElement(By.xpath(\"//select[@name='j_client_id']\"));\n\t\tSelect se = new Select(Companyelement);\n\t\tse.selectByVisibleText(BasePage.getCellData(xlsxName, sheetName, 2, 0));\n\n\t}", "public String navigateServicesCompanyList() {\n if (this.getSelected() != null) {\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"ServicesCompany_items\", this.getSelected().getServicesCompanyList());\n }\n return \"/admin/servicesCompany/index\";\n }", "private JComboBox getOrgCmb() {\r\n cmbOrganization = new JComboBox();\r\n \r\n vOrganizations = getProposalSubOrgs();\r\n\r\n CoeusVector cvOrgs = new CoeusVector();\r\n \tcvOrgs.add(0, \"\");\r\n\r\n HashMap mapRow = new HashMap();\r\n \tfor (int c=0;c<vOrganizations.size();c++) {\r\n mapRow = (HashMap) vOrganizations.elementAt(c);\r\n \tcvOrgs.add(c+1,(String)mapRow.get(\"LOCATION_NAME\"));\r\n \t}\r\n \t\r\n \tcmbOrganization.setModel(new DefaultComboBoxModel(cvOrgs));\r\n return cmbOrganization;\r\n }", "private void renderCombobox(){\r\n\r\n\t\tCollection<String> sitesName= new ArrayList<String>();\r\n\t\t\tfor(SiteDto site : siteDto){\r\n\t\t\t\tsitesName.add(site.getSiteName());\r\n\t\t\t}\r\n\t\t\r\n\t\tComboBox siteComboBox = new ComboBox(\"Select Site\",sitesName);\r\n\t\tsiteName = sitesName.iterator().next();\r\n\t\tsiteComboBox.setValue(siteName);\r\n\t\tsiteComboBox.setImmediate(true);\r\n\t\tsiteComboBox.addValueChangeListener(this);\r\n\t\tverticalLayout.addComponent(siteComboBox);\r\n\t}", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "List getCompanies(OwnCodes ownCodes) throws PopulateDataException;", "String getCompany();", "public static void fillComboBox() {\r\n\t\ttry {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tresults = statement.executeQuery(\"Select PeopleName from people \");\r\n\t\t\twhile (results.next()) {\r\n\t\t\t\tString peopleName = results.getString(\"PeopleName\");\r\n\t\t\t\tcomboBox.addItem(peopleName);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t \te.printStackTrace();\r\n\t\t}\r\n\t}", "public void searchCompanies() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\ttry {\r\n\t\t\tbusiness = businessDao.searchBusinessForNameOrNit(searchCompany);\r\n\t\t\tif (business == null || business.size() <= 0) {\r\n\t\t\t\tControladorContexto.mensajeInformacion(\r\n\t\t\t\t\t\t\"frmAsociarPermisos:empresas\",\r\n\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t} else {\r\n\t\t\t\tBusinessAction businessAction = ControladorContexto\r\n\t\t\t\t\t\t.getContextBean(BusinessAction.class);\r\n\t\t\t\tbusinessAction.setListBusiness(new ArrayList<Business>());\r\n\t\t\t\tbusinessAction.setListBusiness(business);\r\n\t\t\t\tbusinessAction.loadDetailsBusiness();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}", "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 StringConverter<Company> LabelCombo (){\n return new StringConverter<Company>() {\n @Override\n public String toString(Company object){\n return object.getCompanyname();\n }\n\n @Override\n public Company fromString(String string) {\n return null;\n }\n };\n }", "public void fillCombobox() {\n List<String> list = new ArrayList<String>();\n list.add(\"don't link\");\n if (dataHandler.persons.size() == 0) {\n list.add(\"No Persons\");\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n } else {\n for (int i = 0; i < dataHandler.persons.size(); i++) {\n list.add(dataHandler.persons.get(i).getName());\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n }\n }\n }", "static String editCompany()\n {\n if(companyName !=null) companyName = \"IBM\";\n return companyName;\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "private JComboBox accountSelector()\n\t{\n\t\tJComboBox viewSelectorDropdown = new JComboBox();\n\t\tviewSelectorDropdown.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker());\n\t\tviewSelectorDropdown.setFocusable(false);\n\t\tviewSelectorDropdown.setForeground(ColorScheme.GRAND_EXCHANGE_PRICE);\n\t\tviewSelectorDropdown.setRenderer(new ComboBoxListRenderer());\n\t\tviewSelectorDropdown.setToolTipText(\"Select which of your account's trades list you want to view\");\n\t\tviewSelectorDropdown.addItemListener(event ->\n\t\t{\n\t\t\tif (event.getStateChange() == ItemEvent.SELECTED)\n\t\t\t{\n\t\t\t\tString selectedName = (String) event.getItem();\n\t\t\t\tplugin.changeView(selectedName);\n\t\t\t}\n\t\t});\n\n\t\treturn viewSelectorDropdown;\n\t}", "public String getCompanyCode() {\n return companyCode;\n }", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n return company;\n }", "private void RenderCombo()\r\n\t{\r\n\t\tSystem.out.println(\"Setup\");\r\n\t\tList<ProductionOrder> productionOrders = null;\r\n\t\t\t\t\r\n \ttry {\r\n \t\tproductionOrders = this.getProductionOrderService().findProductionOrders(); \r\n \t\tif(productionOrders==null)\r\n \t\t\tSystem.out.println(\"productoinOrders is null\");\r\n\t \t_productionOrderSelect = null;\r\n\t \t_productionOrderSelect = new GenericSelectModel<ProductionOrder>(productionOrders,ProductionOrder.class,\"FormattedDocNo\",\"id\",_access);\r\n\t \tif(_productionOrderSelect==null){\r\n\t \t\tSystem.out.println(\"Setuprender productionOrderselect is null\");\r\n\t \t}\r\n \t}\r\n \tcatch(Exception e)\r\n \t{\r\n \t\t\r\n \t}\r\n \tfinally {\r\n \t\t\r\n \t}\r\n\t}", "private void fillComboBox(ServiceManager serviceManager){\n for (String vendingMachineName : serviceManager.getVmManager().getVendingMachineNames()) {\n getItems().add(vendingMachineName); \n }\n }", "public String getCompany() {\n return company;\n }", "public void buildConsultantComboBox(){\r\n combo_user.getSelectionModel().selectFirst(); // Select the first element\r\n \r\n // Update each timewindow to show the string representation of the window\r\n Callback<ListView<User>, ListCell<User>> factory = lv -> new ListCell<User>(){\r\n @Override\r\n protected void updateItem(User user, boolean empty) {\r\n super.updateItem(user, empty);\r\n setText(empty ? \"\" : user.getName());\r\n }\r\n };\r\n \r\n combo_user.setCellFactory(factory);\r\n combo_user.setButtonCell(factory.call(null)); \r\n }", "private void fillcbGrupo() {\n\t\tcbGrupoContable.setNullSelectionAllowed(false);\n\t\tcbGrupoContable.setInputPrompt(\"Seleccione Grupo Contable\");\n\t\tfor (GruposContablesModel grupo : grupoimpl.getalls()) {\n\t\t\tcbGrupoContable.addItem(grupo.getGRC_Grupo_Contable());\n\t\t\tcbGrupoContable.setItemCaption(grupo.getGRC_Grupo_Contable(), grupo.getGRC_Nombre_Grupo_Contable());\n\t\t}\n\t}", "public void riempiProceduraComboBox(){\n Statement stmt;\n ResultSet rst;\n String query = \"SELECT P.schema, P.nomeProcedura FROM Procedura P\";\n \n proceduraComboBox.removeAllItems();\n try{\n stmt = Database.getDefaultConnection().createStatement();\n rst = stmt.executeQuery(query);\n \n while(rst.next()){\n //le Procedure nella comboBox saranno mostrate secondo il modello: nomeSchema.nomeProcedura\n //in quanto Procedure appartenenti a Schemi diversi possono avere lo stesso nome\n proceduraComboBox.addItem(rst.getString(1)+\".\"+rst.getString(2));\n }\n proceduraComboBox.setSelectedIndex(-1);\n \n stmt.close();\n }catch(SQLException e){\n mostraErrore(e);\n }\n }", "public void setCompanyCd(String companyCd) {\r\n this.companyCd = companyCd;\r\n }", "public void setCompanyCd(String companyCd) {\r\n this.companyCd = companyCd;\r\n }", "public void validatePermissionCompaniesSelected() {\r\n\t\tResourceBundle bundleSecurity = ControladorContexto\r\n\t\t\t\t.getBundle(\"messageSecurity\");\r\n\t\tif (listPermissionPersonBusinessTemp == null\r\n\t\t\t\t|| listPermissionPersonBusinessTemp.size() <= 0) {\r\n\t\t\tControladorContexto\r\n\t\t\t\t\t.mensajeError(\r\n\t\t\t\t\t\t\t\"frmAsociarPermisos:extDTPermisoPersonaEmpresa\",\r\n\t\t\t\t\t\t\tbundleSecurity\r\n\t\t\t\t\t\t\t\t\t.getString(\"person_permission_company_message_validate_select_company\"));\r\n\t\t}\r\n\t}", "@Override\r\n public WsResultTogetherPersonsBean dropdownTogetherPersons(String workformId, String loginCode) throws Exception {\n try {\r\n return this.service.dropdownTogetherPersons(workformId, loginCode);\r\n } catch (Exception e) {\r\n // TODO Auto-generated catch block\r\n throw e;\r\n }\r\n }", "public String getCompanyno() {\n return companyno;\n }", "public void generateMenu () \n {\n mCoffeeList = mbdb.getCoffeeMenu();\n for(int i =0;i<mCoffeeList.size();i++){\n coffeeTypeCombo.addItem(mCoffeeList.get(i).toString());\n }\n mWaffleList = mbdb.getWaffleMenu();\n for(int j =0;j<mWaffleList.size();j++){\n waffleTypeCombo.addItem(mWaffleList.get(j).toString());\n }\n }", "public void getProject(){\n\t\n\t String getList[] = clientFacade.GetProjects().split(\"\\n\");\n\t DefaultComboBoxModel addPro = new DefaultComboBoxModel();\n\t\tfor(int i=1; i<getList.length; i+=2) \n\t\t\t addPro.addElement(getList[i]);\n\t\t\t \n\t\tcPro.setModel(addPro);\t\n\t}", "@GetMapping(\"/admin/addCompany\")\n public String addCompanyForm(Model model){\n model.addAttribute(\"company\", new Company());\n model.addAttribute(\"Countries\", adminRepository.getCountries());\n return \"addCompany\";\n }", "private void LoadSubjectToCBO() {\n\n List<MonHoc> monHocs = monHocDAO.getAll();\n for (MonHoc monHoc : monHocs) {\n cbsuject.addItem(monHoc.getTenmonhoc());\n }\n }", "@Override\r\n public void onModuleLoad() {\r\n final ListBox select = new ListBox();\r\n\r\n// Beispielcode:\r\n// \r\n final Label airportLabel = new Label();\r\n// Airport ap = new Airport();\r\n// ap.setCountry(\"Germany\");\r\n// ap.setId(\"FRA\");\r\n// \r\n// airportService.save(ap, new SuccessCallback<Airport>() {\r\n//\r\n// @Override\r\n// public void onSuccess(Airport result) {\r\n// airportLabel.setText(result.toString());\r\n// }\r\n// });\r\n//\r\n// airportService.load(\"FRA\", new SuccessCallback<Airport>() {\r\n//\r\n// @Override\r\n// public void onSuccess(Airport result) {\r\n// airportLabel.setText(result.toString());\r\n// }\r\n// });\r\n\r\n select.setVisibleItemCount(1);\r\n\r\n class CategoryJsoSelectChangeHandler implements ChangeHandler {\r\n\r\n @Override\r\n public void onChange(ChangeEvent event) {\r\n refreshSelection(select);\r\n }\r\n }\r\n\r\n final CategoryJsoSelectChangeHandler csHandler = new CategoryJsoSelectChangeHandler();\r\n select.addChangeHandler(csHandler);\r\n\r\n database.getCategory(new AsyncCallback<List<Category>>() {\r\n\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n showErrorPanel(RPC_ERROR_TITLE, SERVER_ERROR);\r\n }\r\n\r\n @Override\r\n public void onSuccess(List<Category> result) {\r\n CategoryJsos = result;\r\n\r\n for (Category r : result) {\r\n select.addItem(r.toString());\r\n select.setItemSelected(0, true);\r\n refreshSelection(select);\r\n }\r\n }\r\n });\r\n\r\n // We can add style names to widgets\r\n //sendButton.addStyleName(\"sendButton\");\r\n\r\n // Add the Control Elements to the RootPanel\r\n // Use RootPanel.get() to get the entire body element\r\n RootPanel.get(\"errorLabelContainer\").add(airportLabel);\r\n RootPanel.get(\"selectContainer\").add(select);\r\n }", "public ObservableList<Company> LoadCombo() {\n ObservableList<Company> _list = FXCollections.observableArrayList();\n _list.add(new Company(\"20428776110\", \"ICR PERU\"));\n _list.add(new Company(\"20555029277\", \"ICR INSTALACIONES\"));\n return _list;\n }", "public void llenarComboSeccion() {\t\t\n\t\tString respuesta = negocio.llenarComboSeccion(\"\");\n\t\tSystem.out.println(respuesta);\t\t\n\t}", "public void clickOnVehicleNameDropdownButton() {\r\n\t\tsafeClick(vehicleLinkPath.replace(\"ant-card-head-title\", \"ant-select ant-select-enabled\"), MEDIUMWAIT);\r\n\t}", "WebElement getStatusSelectField();", "private void defaultdata()\n {\n try\n {\n \n StageBao stage_bao =\n new BaoFactory().createStageBao(); //create building bao object\n List<StageDto> stage_list =\n stage_bao.viewAll(); //get all building from DB\n \n stageComboBox.removeAllItems(); //remove all item from building combobox\n\n if(stage_list!=null&&!stage_list.isEmpty())\n {\n for(int i = 0; i<stage_list.size(); i++)\n {\n stageComboBox.addItem(stage_list.get(i).getNumber());\n }\n\n stageComboBox.setSelectedIndex(-1); //select no thing in this combo\n }\n \n \n DepartmentBao depart_bao = new BaoFactory().createDepartmentBao();\n List<DepartmentDto> depart_list = depart_bao.viewAll();\n DepartComboBox.removeAllItems();\n\n if(depart_list!=null&&!depart_list.isEmpty())\n {\n for(int i = 0; i<depart_list.size(); i++)\n {\n DepartComboBox.addItem(depart_list.get(i).getName());\n }\n DepartComboBox.setSelectedIndex(-1);\n }\n\n \n }\n \n catch(Exception e)\n {\n e.printStackTrace();\n }\n\n }", "private ListCompaniesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public String getCompanyname() {\n return companyname;\n }", "@When(\"^Click on Contactus Option$\")\r\n\tpublic void click_on_Contactus_Option() {\n\t\tnop.click(\"//*[@id=\\\"contact-link\\\"]/a\"); //clicking contact us option\r\n\t\t\r\n\t}", "private org.gwtbootstrap3.client.ui.ListDropDown get_f_ListDropDown66() {\n return build_f_ListDropDown66();\n }", "public void clickOnGroupNameDropdownButton() {\r\n\t\tsafeClick(vehicleLinkPath.replace(\"ant-card-head-title\", \"ant-select ant-select-enabled\"), MEDIUMWAIT);\r\n\t}", "public static List<Company> createCompanies() {\r\n\t\tList<Company> companies = new ArrayList<Company>();\r\n\t\tcompanies.add(createCompany(1, \"Pepcus\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help1\"));\r\n\t\tcompanies.add(createCompany(2, \"Google\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help2\"));\r\n\t\tcompanies.add(createCompany(3, \"Facebook\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help3\"));\r\n\t\tcompanies.add(createCompany(4, \"Suzuki\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help4\"));\r\n\t\tcompanies.add(createCompany(5, \"General Motors\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help5\"));\r\n\t\tcompanies.add(createCompany(6, \"L & T\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help6\"));\r\n\t\tcompanies.add(createCompany(7, \"General Electric\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help7\"));\r\n\t\tcompanies.add(createCompany(8, \"Oracle\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help8\"));\r\n\t\tcompanies.add(createCompany(9, \"Microsoft\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help9\"));\r\n\t\tcompanies.add(createCompany(10, \"Thinkhr\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help10\"));\r\n\t\treturn companies;\r\n\r\n\t}", "private JLabel getDchjComboBox() {\r\n\t\tif (dchjComboBox == null) {\r\n\t\t\tdchjComboBox = new JLabel();\r\n\t\t\tdchjComboBox.setForeground(color);\r\n\t\t\tdchjComboBox.setBounds(new Rectangle(96, 54, 90, 18));\r\n\t\t\tdchjComboBox.setText(name);\r\n\t\t}\r\n\t\treturn dchjComboBox;\r\n\t}", "public void llenarComboBox(){\n TipoMiembroComboBox.removeAllItems();\n TipoMiembroComboBox.addItem(\"Administrador\");\n TipoMiembroComboBox.addItem(\"Editor\");\n TipoMiembroComboBox.addItem(\"Invitado\");\n }", "@GetMapping(\"/sysadm/companyRegistrationList\")\n public String showCompanyRegistrationList() {\n return \"admin/sysadm/companyInfoView\";\n }", "@SuppressWarnings(\"unchecked\")\n private void addComboBox() throws Exception{\n\n Connection con = Coagent.getConnection();\n PreparedStatement query = con.prepareStatement(\"SELECT Publisher_Name FROM publishers;\");\n ResultSet result = query.executeQuery();\n\n while(result.next()){\n jComboBoxAdd.addItem(result.getString(1));\n }\n }", "private void cargaLista() {\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Aclaracion\", \"Aclaracion\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revision\", \"Revision\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revocatoria\", \"Revocatoria\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Subsidiaria\", \"Subsidiaria\"));\n \n }", "void getCboSubject(){ \n cboSubject.removeAllItems();\n cboSubject.addItem(\"--- Select ---\");\n try {\n clsCon.setRs(clsCon.getStmt().executeQuery(\"select SubjectName from qTimetable where CourseID=\"+lblCourse.getText()+\" and SemesterID='\"+lblSemester.getText()+\"' and ClassID='\"+lblClass.getText()+\"' and Active = 1 group by SubjectName\"));\n if(clsCon.getRs().first()){ \n do{\n cboSubject.addItem(clsCon.getRs().getString(\"SubjectName\"));\n }while(clsCon.getRs().next());\n }\n }\n catch(SQLException e){}\n }", "private void buildCountryComboBox() {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectCountryByID.sql\"),\n Collections.singletonList(Constants.WILDCARD)\n );\n\n ObservableList<Country> countries = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Country_ID\");\n String name = rs.getString(\"Country\");\n countries.add(new Country(id, name));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n countryComboBox.setItems(countries);\n\n countryComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(Country item) {\n return item.getCountryName();\n }\n\n @Override\n public Country fromString(String string) {\n return null;\n }\n });\n }", "public String getCompany() {\r\n\t\treturn company;\r\n\t}", "public String consultPermissionPersonCompany() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\tResourceBundle bundleSecurity = ControladorContexto\r\n\t\t\t\t.getBundle(\"messageSecurity\");\r\n\t\tlistPermissionPersonBusiness = new ArrayList<PermissionPersonBusiness>();\r\n\t\tList<SelectItem> parameters = new ArrayList<SelectItem>();\r\n\t\tStringBuilder consult = new StringBuilder();\r\n\t\tStringBuilder unionMessagesSearch = new StringBuilder();\r\n\t\tString messageSearch = \"\";\r\n\t\tString panelId = \"frmGestionarPermisosEmpresa:panelEmpresaPermiso\";\r\n\t\ttry {\r\n\t\t\tif (person != null) {\r\n\t\t\t\tadvanceSearch(consult, parameters, bundle, unionMessagesSearch);\r\n\t\t\t\tpagination.paginar(permissionPersonBusinessDao\r\n\t\t\t\t\t\t.amountBusinessAccessPerson(consult, parameters));\r\n\t\t\t\tList<PermissionPersonBusiness> listPermissionPersonBusinessTemp = permissionPersonBusinessDao\r\n\t\t\t\t\t\t.consultBusinessAccessPerson(consult, parameters,\r\n\t\t\t\t\t\t\t\tpagination.getInicio(), pagination.getRango());\r\n\t\t\t\tif ((listPermissionPersonBusinessTemp == null || listPermissionPersonBusinessTemp\r\n\t\t\t\t\t\t.size() <= 0)\r\n\t\t\t\t\t\t&& !\"\".equals(unionMessagesSearch.toString())) {\r\n\t\t\t\t\tmessageSearch = MessageFormat\r\n\t\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t\t.getString(\"message_no_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\t\tunionMessagesSearch);\r\n\t\t\t\t} else if (listPermissionPersonBusinessTemp == null\r\n\t\t\t\t\t\t|| listPermissionPersonBusinessTemp.size() <= 0) {\r\n\t\t\t\t\tControladorContexto.mensajeInformacion(panelId,\r\n\t\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t\t} else if (!\"\".equals(unionMessagesSearch.toString())) {\r\n\t\t\t\t\tmessageSearch = MessageFormat\r\n\t\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t\t.getString(\"message_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\t\tbundleSecurity\r\n\t\t\t\t\t\t\t\t\t\t\t.getString(\"person_permission_company_label\"),\r\n\t\t\t\t\t\t\t\t\tunionMessagesSearch);\r\n\t\t\t\t}\r\n\t\t\t\tif (!\"\".equals(messageSearch)) {\r\n\t\t\t\t\tControladorContexto.mensajeInformacion(panelId,\r\n\t\t\t\t\t\t\tmessageSearch);\r\n\t\t\t\t}\r\n\t\t\t\tdetailsPermissionPersonCompany(listPermissionPersonBusinessTemp);\r\n\t\t\t\tloadCombos();\r\n\t\t\t} else {\r\n\t\t\t\tControladorContexto\r\n\t\t\t\t\t\t.mensajeError(bundleSecurity\r\n\t\t\t\t\t\t\t\t.getString(\"person_permission_company_message_validate_select_user\"));\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t\treturn \"gesPermissionPersonBusiness\";\r\n\t}", "public Collection<CompaniaDTO> findObtenerListaCompanias() throws ERPException{\r\n\t\treturn this.companiaGestor.obtenerListaCompanias();\r\n\t}", "public String getCompanyShortname() {\r\n return companyShortname;\r\n }", "public void llenarComboGrado() {\t\n\t\tString respuesta = negocio.llenarComboGrado(\"\");\n\t\tSystem.out.println(respuesta);\t\n\t}", "public void setComboBoxValues() {\n String sql = \"select iName from item where iActive=? order by iName asc\";\n \n cbo_iniName.removeAllItems();\n try {\n pst = conn.prepareStatement(sql);\n pst.setString(1,\"Yes\");\n rs = pst.executeQuery();\n \n while (rs.next()) {\n cbo_iniName.addItem(rs.getString(1));\n }\n \n }catch(Exception e) {\n JOptionPane.showMessageDialog(null,\"Item list cannot be loaded\");\n }finally {\n try{\n rs.close();\n pst.close();\n \n }catch(Exception e) {}\n }\n }", "private void cargarCmbColores(){\n MapaColores.getMap().forEach((k,v)->cmbColores.getItems().add(k));\n cmbColores.getSelectionModel().selectFirst();\n }", "public static final String getCompany() { return company; }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"Company [code=%s, name=%s]\", code, name);\n\t}", "public java.util.List<contactsapi.company.CompanyResponse.Builder> \n getCompaniesBuilderList() {\n return getCompaniesFieldBuilder().getBuilderList();\n }", "java.lang.String getCompanyName();", "java.lang.String getCompanyName();", "public JComponent playerDropDownList(Player[] plyrs) {\n \tplayers=plyrs;\n \tif(players!=null){\n\t \tString[] nameStrings = new String[players.length];\n\t \tfor(int i=0;i<players.length;i++){\n\t \t\tnameStrings[i]=\"\"+players[i].getID()+\" - \"+players[i].getFirst()+\" \"+players[i].getLast();\n\t \t}\n\t \t\n\t \tplayerComboBox = new JComboBox(nameStrings);\n\t \tplayerComboBox.setSelectedItem(\"Select from a list of current players\");\n\t \tplayerComboBox.addActionListener(new ActionListener() {\n\t \t public void actionPerformed(ActionEvent e) { \t\t\t\n\t \t\t\tfirstFieldP.setText(players[playerComboBox.getSelectedIndex()].getFirst()); \n\t \t\t\tlastFieldP.setText(players[playerComboBox.getSelectedIndex()].getLast());\n\t \t\t\tpID=players[playerComboBox.getSelectedIndex()].getID();\n\t \t\t}\n\t \t});\n \t} else\n \t\tplayerComboBox=new JComboBox();\n\t \tJPanel p = new JPanel();\n\t \tp.add(playerComboBox);\n\t \treturn p;\n }", "public void setCompany(String company) {\n this.company = company;\n }", "private void loadCustomerCombo() {\n ArrayList<CustomerDTO> allCustomers;\n try {\n allCustomers = ctrlCustomer.get();\n for (CustomerDTO customer : allCustomers) {\n custIdCombo.addItem(customer.getId());\n }\n } catch (Exception ex) {\n Logger.getLogger(PlaceOrderForm.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public String getCompanyName() {\r\n return companyName;\r\n }", "public String getCompanyName() {\r\n return companyName;\r\n }", "public String getCompanyName() {\r\n return companyName;\r\n }", "public void datosCombobox() {\n listaColegios = new ColegioDaoImp().listar();\n for (Colegio colegio : listaColegios) {\n cbColegio.addItem(colegio.getNombre());\n }\n }", "public void listarIgrejaComboBox() {\n\n IgrejasDAO dao = new IgrejasDAO();\n List<Igrejas> lista = dao.listarIgrejas();\n cbIgrejas.removeAllItems();\n\n for (Igrejas c : lista) {\n cbIgrejas.addItem(c);\n }\n }", "public String getCompanyCountry() {\n return companyCountry;\n }", "@Override\n\tpublic List<CompanyVO> getCompanyInfo(String c_name) {\n\t\treturn null;\n\t}", "private void setProjectsIntoComboBox() {\n cboClients.getSelectionModel().selectedItemProperty().addListener((options, oldVal, newVal) -> {\n if (newVal != null) {\n if (mainModel.getProjectList() != null) {\n try {\n mainModel.loadProjects(newVal);\n cboProjects.getItems().clear();\n cboProjects.getItems().addAll(mainModel.getProjectList());\n } catch (ModelException ex) {\n alertManager.showAlert(\"Could not get the projects.\", \"An error occured: \" + ex.getMessage());\n }\n }\n }\n });\n }", "public companyDetails() {\n initComponents();\n showTableData();\n }", "private org.gwtbootstrap3.client.ui.ListDropDown get_f_ListDropDown71() {\n return build_f_ListDropDown71();\n }", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "public String getCompanyName() {\n return companyName;\n }", "@Override\n\tpublic void showCities() {\n\t\tArrayList<City> cities = Singleton.CityRegistDao().findAll();\n\t\tcityOptions = \"\";\n\t\tfor (City city : cities) {\n\t\t\tcityOptions += String.format(\"<li role=\\\"presentation\\\"> <a role=\\\"menuitem\\\" tabindex=\\\"-1\\\" href=javascript:void(0)>%s</a> </li>\\n\", city.getName(), city.getName());\n\t\t}\n\t\tSystem.out.println(cityOptions);\n\t}", "public void addClubSelector() {\n\n if (clubSelectorTour == null) {\n clubSelectorTour = calendarMenu.addItem(\"Set Club\", command -> {\n\n Window window = new Window(\"Select Club for Calendar Events\");\n window.setWidth(\"400px\");\n window.setHeight(\"200px\");\n getUI().addWindow(window);\n window.center();\n window.setModal(true);\n C<Club> cs = new C<>(Club.class);\n ComboBox clubs = new ComboBox(\"Club\", cs.c());\n clubs.setItemCaptionMode(ItemCaptionMode.ITEM);\n clubs.setNullSelectionAllowed(false);\n\n clubs.setFilteringMode(FilteringMode.CONTAINS);\n Button done = new Button(\"Done\");\n done.addClickListener(listener -> {\n window.close();\n Object id = clubs.getValue();\n if (id != null) {\n calendar.filterEventOwnerId(id);\n setClubName(id);\n calendar.markAsDirty();\n }\n });\n\n EVerticalLayout l = new EVerticalLayout(clubs, done);\n\n window.setContent(l);\n });\n }\n }", "public void plannerDisplayComboBoxs(){\n Days dm = weekList.getSelectionModel().getSelectedItem();\n if (dm.isBreakfastSet()){\n //find Recipe set for breakfast in the Days in the comboBox and display it in the comboBox\n Recipe breakfast = findRecipeFromID(dm.getBreakfast().getId(), breakfastCombo);\n breakfastCombo.getSelectionModel().select(breakfast);\n }\n\n if (dm.isLunchSet()){\n //find Recipe set for lunch in the Days in the comboBox and display it in the comboBox\n Recipe lunch = findRecipeFromID(dm.getLunch().getId(), lunchCombo);\n lunchCombo.getSelectionModel().select(lunch);\n }\n\n if (dm.isDinnerSet()){\n //find Recipe set for dinner in the Days in the comboBox and display it in the comboBox\n Recipe dinner = findRecipeFromID(dm.getDinner().getId(), dinnerCombo);\n dinnerCombo.getSelectionModel().select(dinner);\n }\n }", "private void buildDivisionComboBox() {\n List<String> args = Collections.singletonList(Constants.WILDCARD);\n Country selectedCountry = countryComboBox.getSelectionModel().getSelectedItem();\n if (selectedCountry != null) {\n args = Collections.singletonList(String.valueOf(selectedCountry.getCountryID()));\n }\n\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectDivisionsByCountry.sql\"),\n args\n );\n\n ObservableList<FirstLevelDivision> divisions = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Division_ID\");\n String name = rs.getString(\"Division\");\n int countryID = rs.getInt(\"Country_ID\");\n divisions.add(new FirstLevelDivision(id, name, countryID));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n divisionComboBox.setItems(divisions);\n\n divisionComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(FirstLevelDivision item) {\n return item.getDivisionName();\n }\n\n @Override\n public FirstLevelDivision fromString(String string) {\n return null;\n }\n });\n }", "cb.Careerbuilder.Company.PhoneType getType();", "@Override\r\npublic void Display(Company c) {\n\tchildren.add(c);\r\n}", "private void cargaComboBoxTipoLaboreo() {\n Session session = Conexion.getSessionFactory().getCurrentSession();\n Transaction tx = session.beginTransaction();\n\n Query query = session.createQuery(\"SELECT p FROM TipoLaboreoEntity p\");\n java.util.List<TipoLaboreoEntity> listaTipoLaboreoEntity = query.list();\n\n Vector<String> miVectorTipoLaboreo = new Vector<>();\n for (TipoLaboreoEntity tipoLaboreo : listaTipoLaboreoEntity) {\n miVectorTipoLaboreo.add(tipoLaboreo.getTpoNombre());\n cboMomentos.addItem(tipoLaboreo);\n\n// cboCampania.setSelectedItem(null);\n }\n tx.rollback();\n }", "private void comboCarrega() {\n\n try {\n con = BancoDeDados.getConexao();\n //cria a string para inserir no banco\n String query = \"SELECT * FROM servico\";\n\n PreparedStatement cmd;\n cmd = con.prepareStatement(query);\n ResultSet rs;\n\n rs = cmd.executeQuery();\n\n while (rs.next()) {\n JCservico.addItem(rs.getString(\"id\") + \"-\" + rs.getString(\"modalidade\"));\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro de SQL \" + ex.getMessage());\n }\n }", "private void napuniCbPozoriste() {\n\t\t\r\n\t\tfor (Pozoriste p:Kontroler.getInstanca().vratiPozorista())\r\n\t\t\t\r\n\t\t\tcbPozoriste.addItem(p.getImePozorista());\r\n\t}", "public String getCompany() {\n return (String) get(\"company\");\n }", "public static void loadMyCompany() {\n\t\tMyCompany myCompany = fetchFromDB();\n\n\t\trender(\"@myCompany\", myCompany);\n\t}", "public String getCompany()\r\n {\r\n return (m_company);\r\n }", "public MenuUtamaPenyedia() {\n initComponents();\n tabPenyedia.setTitleAt(0, \"View Profile\");\n tabPenyedia.setTitleAt(1, \"Edit Profile\");\n tabPenyedia.setTitleAt(2, \"Create Barang\");\n tglSpinner.setValue(0);\n blnSpinner.setValue(0);\n thnSpinner.setValue(2016);\n kbComboBox.setMaximumRowCount(2);\n kbComboBox.removeAllItems();\n kbComboBox.insertItemAt(\"Bagus\", 0);\n kbComboBox.insertItemAt(\"Tidak Bagus\", 1);\n }" ]
[ "0.6705983", "0.6281906", "0.61724895", "0.61690044", "0.60626346", "0.59999347", "0.59064287", "0.59064287", "0.58764476", "0.58696765", "0.58417284", "0.5821389", "0.58152133", "0.58078605", "0.5777194", "0.57441074", "0.57384855", "0.57384855", "0.57243305", "0.56923497", "0.56741375", "0.56741375", "0.56415516", "0.5640258", "0.5626683", "0.5624892", "0.56138086", "0.5606068", "0.56050366", "0.56050366", "0.5603338", "0.5599032", "0.5598274", "0.558462", "0.5561752", "0.55565137", "0.5547024", "0.5546778", "0.55435145", "0.55364573", "0.55337715", "0.55240816", "0.55168235", "0.5516727", "0.5508771", "0.550395", "0.5501159", "0.54980206", "0.5493728", "0.5491783", "0.5491064", "0.54904795", "0.54880244", "0.54777396", "0.54637116", "0.5461999", "0.5460572", "0.5455153", "0.5451917", "0.5451123", "0.5432631", "0.54311645", "0.54269516", "0.5425204", "0.54248226", "0.5419296", "0.5419214", "0.5419214", "0.54168016", "0.5412076", "0.5405093", "0.54048634", "0.54048634", "0.54048634", "0.540206", "0.5394119", "0.53902835", "0.5388954", "0.5382506", "0.5379579", "0.5370241", "0.5362957", "0.5362957", "0.5356443", "0.5356443", "0.5356443", "0.5356443", "0.5354191", "0.53518504", "0.5347538", "0.53438926", "0.5342673", "0.5337061", "0.5335832", "0.5335728", "0.53351796", "0.533227", "0.5330909", "0.5315286", "0.5308956" ]
0.63257724
1
Tests setting and getting the name using Notification class accessor methods.
@Test public void testNameAccessors() { // Create a new Notification and use accessors to set the note name INotification note = new Notification("TestNote"); // test assertions Assert.assertEquals("Expecting note.getName() == 'TestNote'", note.getName(), "TestNote"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetName() {\n System.out.println(\"getName\");\n Setting instance = Setting.factory(\"testname\", Setting.SETTING_TYPE.UND, new Object());\n String expResult = \"testname\";\n String result = instance.getName();\n assertEquals(expResult, result);\n\n }", "public String getNotification() {\n return notification;\n }", "public void testGetNoticeByName()\n {\n Notice notice = dbNotice.getNoticeByName(\"Test\");\n\n Assert.assertEquals(\"Test\", notice.getName());\n }", "@Test\n public void testSetName() {\n System.out.println(\"setName\");\n\n Setting instance = Setting.factory();\n String oldName = instance.getName();\n assertFalse(Setting.isNotUsed(oldName));\n String name = \"newName\";\n instance.setName(name);\n assertEquals(name, instance.getName());\n assertTrue(Setting.isNotUsed(oldName));\n assertFalse(Setting.isNotUsed(name));\n\n }", "private void configPElemGeneralInfoSection_name(final Text nameTextBox)\n {\n\t\tif (notifications != null) {\n\t\t\tif (notifications.getNotification() != null) {\n\t\t\t\tif (notifications.getNotification().size() != 0) {\n\t\t\t\t\tif (notifications.getNotification().get(0) != null) {\n\t\t\t\t\t\tif (notifications.getNotification().get(0)\n\t\t\t\t\t\t\t\t.getPresentationElements() != null) {\n\t\t\t\t\t\t\tif (notifications.getNotification().get(0)\n\t\t\t\t\t\t\t\t\t.getPresentationElements().getName() != null) {\n\t\t\t\t\t\t\t\tif (notifications.getNotification().get(0)\n\t\t\t\t\t\t\t\t\t\t.getPresentationElements().getName()\n\t\t\t\t\t\t\t\t\t\t.size() != 0) {\n\t\t\t\t\t\t\t\t\tif (notifications.getNotification().get(0)\n\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\t\t\t\t\t\t.getName().get(0) != null) {\n\t\t\t\t\t\t\t\t\t\tif (notifications.getNotification()\n\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\t\t\t\t\t\t\t.getName().get(0).getMixed() != null) {\n\t\t\t\t\t\t\t\t\t\t\tif (notifications.getNotification()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getName().get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getMixed().size() != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (notifications\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getNotification()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName().get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getMixed().get(0) != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (notifications\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getNotification()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName().get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getMixed().get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getValue() != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.setText(notifications\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getNotification()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPresentationElements()\n\t\t\t\t\t\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\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getMixed()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString());\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\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\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\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\tnameTextBox\n\t\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnameTextBox\n\t\t\t\t\t\t\t.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnameTextBox.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t\t}\n\t\t} else {\n\t\t\tnameTextBox.setText(EMFObjectHandleUtil.RESOURCE_NOT_AVAILABLE);\n\n\t\t}\n\t\t\n\t\t \t\t\n\t\t nameTextBox.addModifyListener(new ModifyListener() {\n\t\t \t\t\tpublic void modifyText(ModifyEvent e) \n\t\t \t\t\t{\n\t\t \t\t\t// validateInput(); \n\t\t \t\t\t setAttribute_tParameter(htdPackage.eINSTANCE.getTExpression_Mixed(), nameTextBox.getText()); \n\t\t \t\t\t\t\n\t\t \t\t\t}\n\t\t \t\t});\n\t }", "@Test\r\n\tpublic void getName() {\r\n\t\tassertEquals(\"Name was intialized as 'test'\", \"test\", testObj.getName());\r\n\t}", "@Override\n\tpublic String getNotification() {\n\t\treturn null;\n\t}", "@Test\n public void testGetSetName() {\n\n String name = \"name\";\n messtyp.setName(name);\n assertEquals(name, messtyp.getName());\n\n }", "public java.lang.String getNotification()\r\n\t{\r\n\t\tString results = \"\";\r\n\t\tif (!locked)\r\n\t\t{\r\n\t\t\tif (notification == null)\r\n\t\t\t\tresults = \"No notification\";\r\n\t\t\tif (notification != null)\r\n\t\t\t\tresults = notification;\t\r\n\t\t}\r\n\t\tif (locked == true && notification != null)\r\n\t\t\tresults = \"You have a notification\";\r\n\t\treturn results;\r\n\t}", "public void setNotification(String notification) {\n this.notification = notification;\n }", "public String getNotificationTitle() {\r\n\t\treturn notificationTitle;\r\n\t}", "@Test\n public void testSetName() {\n service.setName(\"ServiceNew\");\n assertEquals(\"ServiceNew\", service.getName());\n \n }", "@Override\n\t\t\tpublic <V> V get(ConfigurationProperty<V> property) {\n\t\t\t\treturn (V) \"Unit Test Dummy Name\";\n\t\t\t}", "@Test\r\n\tpublic void testToString() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the note name\r\n\t\tINotification note = new Notification(\"TestNote\", \"1,3,5\", \"TestType\");\r\n\t\tString ts = \"Notification Name: TestNote Body:1,3,5 Type:TestType\";\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertEquals(\"Expecting note.testToString() == '\" + ts + \"'\", note.toString(), ts);\r\n\t}", "@Test\n public void testSetName() {\n System.out.println(\"setName\");\n Menu instance = MenuFactory.createMenu(MenuType.FOOD, name, 14000);\n instance.setName(name);\n assertEquals(name, instance.getName());\n }", "@Test\n public void getName() {\n assertTrue(channel.getDisplayName().equals(\"Together4Ever\"));\n }", "public static String setName()\n {\n read_if_needed_();\n \n return _set_name;\n }", "@Test\n void setName() {\n assertEquals(\"Process\", new Process() {{\n setName(\"Process\");\n }}.getName());\n }", "public String getName() { return name.get(); }", "@Test\n public void getNameTest() {\n // expected name for e1\n String expected = \"Pepper Potts\";\n\n assertEquals(\"The expected value of name does not match the actual: \"\n , expected, e1.getName());\n }", "@Test\n public void testGetName() {\n System.out.println(\"getName\");\n Menu instance = MenuFactory.createMenu(MenuType.FOOD, name, 14000);\n String expResult = \"Nasi Ayam Goreng Dada Penyet\";\n String result = instance.getName();\n assertEquals(expResult, result);\n }", "public final void testToString() {\n try {\n Notification.class.getDeclaredMethod(\"toString\", new Class[0]);\n } catch (SecurityException e) {\n printStackTrace(e);\n } catch (NoSuchMethodException e) {\n fail(\"The method toString() is not overridden\");\n }\n }", "String getNotificationID();", "public String getNotchianName();", "@Test\n void getName() {\n assertEquals(\"Process\", new Process() {{\n setName(\"Process\");\n }}.getName());\n }", "@Test\n public void whenGetNameThenReturnResult() {\n String expected = underTest.getName();\n assertThat(expected, is(\"UnderTest\"));\n }", "public static void set_GetName(String v) throws RuntimeException\n {\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaGetNameCmd, v);\n UmlCom.check();\n \n _get_name = v;\n \n }", "@Test\n public void setNameTest() {\n e1.setName(\"Pepper Stark\");\n String expected = \"Pepper Stark\";\n\n assertEquals(\"The expected new name does not match the actual: \"\n , expected, e1.getName());\n }", "protected String getName(){\r\n return this.name;\r\n }", "private static String testSetName(String newName, Greeter greeter)\n {\n String output = \"Saying hello to the greeter: \\n\" + greeter.sayHello();\n output += \"Setting \" + newName + \" as the newName\";\n greeter.setName(newName);\n output += \"Saying hello to the greeter: \\n\" + greeter.sayHello();\n return output;\n }", "@org.junit.Test\n public void getName() {\n Weapon sword = new Sword();\n String dmg = sword.getName();\n assertEquals(\"Normal Sword.getName() failed\",\"Sword\",dmg);\n\n Weapon stick = new WoodStick();\n dmg = stick.getName();\n assertEquals(\"Normal WoodStick.getName() failed\",\"Wooden Stick\",dmg);\n }", "java.lang.String getPatStatusName();", "java.lang.String getPatStatusName();", "@Override\r\n public String getName()\r\n {\r\n assert(true);\r\n return this.name;\r\n }", "public void testGetDisplayName() {\n Context context = getContext();\n String expect, name;\n expect = context.getString(R.string.mailbox_name_display_inbox);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_INBOX);\n assertEquals(expect, name);\n expect = null;\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_MAIL);\n assertEquals(expect, name);\n expect = null;\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_PARENT);\n assertEquals(expect, name);\n expect = context.getString(R.string.mailbox_name_display_drafts);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_DRAFTS);\n assertEquals(expect, name);\n expect = context.getString(R.string.mailbox_name_display_outbox);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_OUTBOX);\n assertEquals(expect, name);\n expect = context.getString(R.string.mailbox_name_display_sent);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_SENT);\n assertEquals(expect, name);\n expect = context.getString(R.string.mailbox_name_display_trash);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_TRASH);\n assertEquals(expect, name);\n expect = context.getString(R.string.mailbox_name_display_junk);\n name = Utility.FolderProperties.getInstance(context).getDisplayName(Mailbox.TYPE_JUNK);\n assertEquals(expect, name);\n // Testing illegal index\n expect = null;\n name = Utility.FolderProperties.getInstance(context).getDisplayName(8);\n assertEquals(expect, name);\n }", "public void setName(String n){ name=n; }", "public String getNotificationText() {\r\n\t\treturn notificationText;\r\n\t}", "public void setName(String newValue);", "public void setName(String newValue);", "String getName() ;", "public String getName()\r\n/* 23: */ {\r\n/* 24:20 */ return \"Wire demo receiver\";\r\n/* 25: */ }", "@Test\n public void getName() {\n System.out.println(\"getName\");\n BBDParameterMetaData instance = new BBDParameterMetaData(1,\"test\",2);\n String expResult = \"test\";\n String result = instance.getName();\n assertEquals(expResult, result);\n }", "void mo54412a(int i, Notification notification);", "public String getName() { return (String)get(\"Name\"); }", "@Test\r\n public void getNameTest()\r\n {\r\n Assert.assertEquals(stub.getName(), NAME);\r\n }", "String getIssueName();", "public final java.lang.String getDisplayName() { throw new RuntimeException(\"Stub!\"); }", "public String getNotificationType() {\n\t\treturn notificationType;\n\t}", "public String getName() { return name; }", "public String getName () { return this.name; }", "public void onGetName(String user,String name);", "public void _getPropertyByName() {\n requiredMethod(\"getProperties()\");\n boolean result;\n try {\n Property prop = oObj.getPropertyByName(IsThere.Name);\n result = (prop != null);\n } catch (com.sun.star.beans.UnknownPropertyException e) {\n log.println(\"Exception occurred while testing\" +\n \" getPropertyByName with existing property\");\n e.printStackTrace(log);\n result = false;\n }\n\n try {\n oObj.getPropertyByName(\"Jupp\");\n log.println(\"No Exception thrown while testing\"+\n \" getPropertyByName with non existing property\");\n result = false;\n }\n catch (UnknownPropertyException e) {\n result = true;\n }\n tRes.tested(\"getPropertyByName()\", result);\n return;\n }", "@Test\n public void testSetName() {\n System.out.println(\"setName\");\n String name = \"Test\";\n Library instance = new Library();\n instance.setName(name);\n String result = instance.getName();\n assertEquals(name, result);\n }", "String getConfigName();", "@Override \n public String getName() {\n return NAME;\n }", "public static String getAppName(){\r\n return getProperty(\"name\", \"Jin\");\r\n }", "public void setNotificationTitle(String notificationTitle) {\r\n\t\tthis.notificationTitle = notificationTitle;\r\n\t}", "@Override\n public String getName(){\n return Name; \n }", "protected NotificationInfo getNotificationInfo() {\n List<NotificationInfo> list = notificationService.storeDigestJCR();\n assertTrue(list.size() > 0);\n return list.get(0);\n }", "@Test\n\tpublic void test_TCM__String_getName() {\n\t\tfinal Attribute attr = new Attribute(\"test\", \"value\");\n\t\tassertTrue(\"incorrect attribute name\", attr.getName().equals(\"test\"));\n\n\t}", "public String getNotificationText() {\n\t\treturn notificationText;\n\t}", "public String getName() { return _name; }", "@Override\n public String getName() {\n return name();\n }", "public abstract String getSystemName();", "public NotificationService(String name) {\n super(name);\n }", "@Test\n public void testGetAtt_name() {\n VirusAttribute virusAttribute = new VirusAttribute(\"att\", \"desc\", 30);\n String result = virusAttribute.getAtt_name();\n assertEquals(\"att\", result);\n }", "String getName(){return this.name;}", "@Test\n void getName() {\n assertEquals(\"roo\", roo.getName());\n }", "String getSupName();", "public String getNotificationTitle() {\n if (this.mInvitation != null) return \"Contact request from: \" + this.mInvitation.getSenderUsername();\n else if (this.mChatMessageFragment != null) {\n String title = \"New message from: \"\n + this.mChatMessageFragment.getSender();\n return title;\n }\n else return null;\n }", "String getName() throws RemoteException;", "@Test public void getAndSetNameTest() {\n DirectMC d = new DirectMC(\"AdMailing\", 10000.00, 3.00, 2000);\n d.setName(\"AdMailing\");\n Assert.assertEquals(\"test 4\", d.getName(), \"AdMailing\");\n }", "@IcalProperty(pindex = PropertyInfoIndex.NAME,\n required = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true)\n public void setName(final String val) {\n name = val;\n }", "@Override\n public String getName() {\n return name;\n }", "public String getName(){ return name; }", "@Override\r\n\tprotected String getName() {\n\t\treturn NAME;\r\n\t}", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.64013153", "0.6083128", "0.60221785", "0.60064614", "0.5888527", "0.5885459", "0.5873225", "0.58578175", "0.5856092", "0.5848136", "0.5842267", "0.582522", "0.5808397", "0.5794924", "0.5786191", "0.5765943", "0.57632464", "0.5745913", "0.56884", "0.56631434", "0.5652633", "0.56517756", "0.5640671", "0.5633676", "0.56187624", "0.56101596", "0.5587226", "0.55317396", "0.55083", "0.55038905", "0.54950684", "0.54605585", "0.54605585", "0.54436684", "0.54146236", "0.5403968", "0.54007316", "0.5397681", "0.5397681", "0.5397094", "0.5390167", "0.538997", "0.5388083", "0.5375492", "0.53697217", "0.5362264", "0.53598666", "0.53586906", "0.53509253", "0.5349943", "0.5349304", "0.53487337", "0.5344584", "0.5343771", "0.5339954", "0.5336287", "0.5334999", "0.53348386", "0.5332237", "0.5331757", "0.5330693", "0.5329876", "0.53202426", "0.5320034", "0.53153056", "0.53142214", "0.5313971", "0.5313123", "0.5308681", "0.5306672", "0.53066283", "0.53061914", "0.5304327", "0.5303319", "0.5301882", "0.5296766", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294", "0.5292294" ]
0.7499269
0
Tests setting and getting the body using Notification class accessor methods.
@Test public void testBodyAccessors() { // Create a new Notification and use accessors to set the body INotification note = new Notification(null); note.setBody(5); // test assertions Assert.assertTrue("Expecting note.getBody()as Number == 5", (Integer) note.getBody() == 5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBody(String newValue);", "public String getBody()\n {\n return super.getBody();\n }", "public String getBody(){\n return body;\n }", "public String getBody() {\r\n return body;\r\n }", "public String getBody()\n {\n return body;\n }", "String getBody();", "String getBody();", "String getBody();", "String getBody();", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public String getBody() {\r\n\t\treturn mBody;\r\n\t}", "public String getBody () {\n\t\treturn body;\n\t}", "public Body getBody() {\n return body;\n }", "Body getBody();", "public String getBody_() {\n return body_;\n }", "public abstract Body getBody();", "public java.lang.String getBody() {\n return body_;\n }", "public String getBody()\n\t{\n\t\treturn m_sBody;\t\n\t}", "public void enterAppNotificationBody(String value) {\r\n\r\n\t\treportStep(\"About to enter the App notification Body \" + value, \"INFO\");\r\n\r\n\t\tif(enterTextInChrome(appNotificationBody,value)) {\r\n\r\n\t\t\treportStep(\"Successfully enter the App Notification body Text \" + value, \"PASS\");\r\n\r\n\t\t}else {\r\n\t\t\t\r\n\t\t\treportStep(\"Failed to enter the App notification Body Text \" + value, \"FAIL\");\r\n\r\n\t\t}\r\n\t}", "private void selfCheck()\n {\n createSession();\n\n // Verify that we can create a mail body\n ImmutableNotification notification = Notification.builder(Instant.now(), \"message\")\n .siteId(1)\n .projectName(\"project\")\n .projectId(2)\n .workflowName(\"workflow\")\n .revision(\"revision\")\n .attemptId(3)\n .sessionId(4)\n .taskName(\"task\")\n .timeZone(ZoneOffset.UTC)\n .sessionUuid(UUID.randomUUID())\n .sessionTime(OffsetDateTime.now())\n .workflowDefinitionId(5L)\n .build();\n try {\n body(notification);\n }\n catch (Exception e) {\n throw ThrowablesUtil.propagate(e);\n }\n }", "java.lang.String getBody();", "public java.lang.String getBody() {\n return instance.getBody();\n }", "public Object getBody() {\n return body;\n }", "public String getBodyText() {\n return bodyText;\n }", "public void setBody(String body) {\r\n this.body = body;\r\n }", "public String getBody() {\n\t\treturn Body;\n\t}", "public void setBody(String body)\n {\n this.body = body;\n }", "public void setBody_(String body_) {\n this.body_ = body_;\n }", "public String getBody(){\n return bodiesText;\n }", "@Test\n public void testMailBodyForIdGood() {\n Integer i = new Integer(5);\n MailMessage mMessage = new MailMessage();\n mMessage.setBody(BODY_STRING);\n given(dao.getMessageForId(i)).willReturn(mMessage);\n String body = service.getMailBodyForId(i, null);\n assertEquals(BODY_STRING, body);\n\n }", "public void setBody(String body) {\n this.body = body;\n }", "public void setBody(Body body) {\n this.body = body;\n }", "private void setBody(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n body_ = value;\n }", "String getOtherAlertMailBody( );", "public void setBody(Object body) {\n this.body = body;\n }", "SmilBody getBody();", "public AgentBody getBody() {\n\t\treturn body;\n\t}", "public String getBodyString() {\n return this.bodyString;\n }", "public void setBody(String v) \n {\n \n if (!ObjectUtils.equals(this.body, v))\n {\n this.body = v;\n setModified(true);\n }\n \n \n }", "@Override\n public void run() {\n while (!BodyWrapper.this.body.isActive() && BodyWrapper.this.body.isAlive()) {\n try {\n Thread.sleep(updateFrequence);\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n \n // and once the body is activated, we can forward the\n // notifications\n while (BodyWrapper.this.body.isActive()) {\n try {\n Thread.sleep(updateFrequence);\n sendNotifications();\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n }", "public Builder setBody(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n body_ = value;\n onChanged();\n return this;\n }", "private void createNotification(String title, String body) {\n Context context = getBaseContext();\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Intent notificationIntent = new Intent(context, OffersActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(context,\n 0, notificationIntent,\n PendingIntent.FLAG_CANCEL_CURRENT);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(getString(R.string.app_name))\n .setContentText(body)\n .setTicker(body)\n .setSound(defaultSoundUri)\n .setContentIntent(contentIntent)\n .setAutoCancel(true);\n NotificationManager mNotificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n }", "public Builder setBody(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n body_ = value;\n onChanged();\n return this;\n }", "private void showArrivalNotification(String body) {\n\n PendingIntent contentIntent = PendingIntent.getActivity(getBaseContext()\n , 0, new Intent(), PendingIntent.FLAG_ONE_SHOT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getBaseContext());\n\n builder.setAutoCancel(true).setDefaults(android.app.Notification.DEFAULT_LIGHTS| android.app.Notification.DEFAULT_SOUND)\n .setWhen(System.currentTimeMillis()).setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"Arrival\").setContentText(body)\n .setContentIntent(contentIntent);\n NotificationManager manager = (NotificationManager)getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE);\n manager.notify(1, builder.build());\n }", "@Override\n public Object getBody() {\n return null;\n }", "public void setBody(String body)\n\t{\n\t\tm_sBody=body;\t\n\t}", "@Override\n public String getBody() {\n return mSubject; /*mFile.toString();*/\n }", "public BodyWrapper(ObjectName oname, AbstractBody body) {\n this.objectName = oname;\n this.id = body.getID();\n this.body = body;\n this.nodeUrl = body.getNodeURL();\n this.isReifiedObjectSerializable = body.getReifiedObject() instanceof Serializable;\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n this.launchNotificationsThread();\n }", "private void sendNotification(String ttl, String messageBody) {\n Intent intent = new Intent(this, ActivitySplash.class);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setSmallIcon(R.mipmap.splash_screen_logo);\n notificationBuilder.setColor(getResources().getColor(R.color.white));\n } else {\n notificationBuilder.setSmallIcon(R.mipmap.logo);\n }\n notificationBuilder.setContentTitle(ttl)\n .setContentText(messageBody)\n // .setStyle(new NotificationCompat.BigPictureStyle().bigPicture(image))/*Notification with Image*/\n .setAutoCancel(true)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.logo))\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }", "public Body getBody() {\n if (jBody == null) {\n throw new RuntimeException(\"No jimplification happened yet, no body available.\");\n }\n return jBody;\n }", "@Override\n\tpublic void setBody(Object body) {\n\t\tsuper.setBody(body);\n\t}", "@Override\n\tpublic java.lang.String getBody() {\n\t\treturn _news_Blogs.getBody();\n\t}", "private void mostrarNotificacion(String title, String body)\r\n {\r\n Intent intent = new Intent(this, MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\r\n\r\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\r\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\r\n .setSmallIcon(R.mipmap.ic_launcher)\r\n .setContentTitle(title)\r\n .setContentText(body)\r\n .setAutoCancel(true)\r\n .setSound(soundUri)\r\n .setContentIntent(pendingIntent);\r\n\r\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\r\n notificationManager.notify(0/*ID de l notificación*/, notificationBuilder.build());\r\n }", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n sendNotification(remoteMessage.getNotification().getTitle(),\n remoteMessage.getNotification().getBody());\n\n bodyMessage = remoteMessage.getNotification().getBody();\n Log.d(TAG, \"onMessageReceived: \" + bodyMessage);\n\n Log.d(TAG, \"onMessageReceived: \" + remoteMessage.getNotification().getTitle() + \" vvvvvvvv \" +\n remoteMessage.getNotification().getBody());\n }", "@Override\n public EmailBody getBody(String BodyType) {\n if(BodyType == null){\n return null;\n }\n if(BodyType.equalsIgnoreCase(\"VipBody\")){\n return new VipBody();\n } else return null;\n\n }", "public byte[] getBody() {\n\t\treturn body;\n\t}", "public String getNotification() {\n return notification;\n }", "@Test\r\n\tpublic void testToString() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the note name\r\n\t\tINotification note = new Notification(\"TestNote\", \"1,3,5\", \"TestType\");\r\n\t\tString ts = \"Notification Name: TestNote Body:1,3,5 Type:TestType\";\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertEquals(\"Expecting note.testToString() == '\" + ts + \"'\", note.toString(), ts);\r\n\t}", "public interface NotificationMessageContentService {\n /**\n * Parses a Notification request message into business objects. Performs syntactic and semantic validation. \n * This method takes an InputStream.\n * @param stream request message stream\n * @return Notification business object\n * @throws SAXException\n * @throws ParserConfigurationException\n * @throws IOException\n * @throws XmlException\n */\n public NotificationBo parseNotificationRequestMessage(InputStream stream) throws IOException, XmlException;\n \n /**\n * Parses a Notification request message into business objects. Performs syntactic and semantic validation. \n * This method takes a String of XML.\n * @param notificationMessageAsXml\n * @return\n * @throws IOException\n * @throws XmlException\n */\n public NotificationBo parseNotificationRequestMessage(String notificationMessageAsXml) throws IOException, XmlException;\n \n /**\n * Generates a Notification response message\n * @param response\n * @return String XML representation of a Notification response object\n */\n public String generateNotificationResponseMessage(NotificationResponseBo response);\n\n /**\n * This method is responsible for marshalling out the passed in Notification object in and XML representation. \n * @param notification\n * @return String of XML.\n */\n public String generateNotificationMessage(NotificationBo notification);\n \n /**\n * This method is responsible for marshalling out the passed in Notification object in and XML representation, with \n * the addition of adding the specific recipient to the recipients list and removing the others. \n * @param notification\n * @param userRecipientId\n * @return String of XML.\n */\n public String generateNotificationMessage(NotificationBo notification, String userRecipientId);\n \n /**\n * This method parses out the serialized XML version of Notification BO and populates a Notification BO with it.\n * @param xmlAsBytes\n * @return Notification\n * @throws Exception\n */\n public NotificationBo parseSerializedNotificationXml(byte[] xmlAsBytes) throws Exception;\n}", "public byte[] getBody() {\n return body;\n }", "DBody getBody();", "public GHFrom getBody() {\n return body;\n }", "public TestNotification update(TestNotification notif) {\n\t\treturn null;\n\t}", "String getFirstAlertMailBody( );", "void setBody(final Body body);", "public void setBody(AgentBody newBody) {\n\t\tbody = newBody;\n\t}", "public UserModel getBody() {\n return localBody;\n }", "public UserModel getBody() {\n return localBody;\n }", "private void sendNotification(String messageBody) {\n Log.d(TAG, messageBody);\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"default\",\n \"oqatt\",\n NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(\"oqatt_updates\");\n channel.setImportance(IMPORTANCE_HIGH);\n assert mNotificationManager != null;\n mNotificationManager.createNotificationChannel(channel);\n }\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext(), \"default\")\n .setSmallIcon(R.mipmap.oqatt_logo) // notification icon\n .setContentTitle(messageBody) // title for notification\n .setSound(defaultSoundUri) // sound notification\n .setAutoCancel(true); // clear notification after click\n\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n PendingIntent pi = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n mBuilder.setContentIntent(pi);\n assert mNotificationManager != null;\n mNotificationManager.notify(0, mBuilder.build());\n }", "protected abstract Body newBodyImpl();", "void setBody (DBody body);", "public void setBody (String body) {\n\t\tresetText(body);\n\t}", "public void setBodyText(String bodyText) {\n this.bodyText = bodyText;\n }", "public String getBody() {\n\t\tif(body == null) {\n\t\t\ttry {\n\t\t\t\tbody = streamToString(response.getEntity().getContent());\n\t\t\t\treturn body;\n\t\t\t} catch (IllegalStateException e) {\n\t\t\t\tLog.e(Integrum.TAG, e.getStackTrace().toString());\n\t\t\t\treturn \"\";\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.e(Integrum.TAG, e.getStackTrace().toString());\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn body;\n\t\t}\n\t}", "void notificationReceived(Notification notification);", "public interface Notifier {\n void notify(boolean isHtml);\n}", "String getExpirationtMailBody( );", "public void setBody(BodyType _body) {\n this.body = _body;\n }", "public String getEmailBodyString() {\r\n return this.emailBodyString;\r\n }", "public String getNotificationText() {\r\n\t\treturn notificationText;\r\n\t}", "public Body getBody1() {\r\n\t\treturn body1;\r\n\t}", "@Override\n public com.google.protobuf.ByteString\n getBodyBytes() {\n Object ref = body_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n\tpublic String getNotification() {\n\t\treturn null;\n\t}", "@Override\n public String getBody() {\n Object ref = body_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n body_ = s;\n return s;\n }\n }", "public Builder setBody(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n body_ = value;\n onChanged();\n return this;\n }", "public String getContentBody() {\n return contentBody;\n }", "private String buildMessageBody(NotificationJob job) {\n\t\tRepositorySecurityManager securityManager = RepositoryComponentFactory.getDefault().getSecurityManager();\n\t\tUserPrincipal user = (job.getUserId() == null) ? null : securityManager.getUser( job.getUserId() );\n\t\tString templateLocation = new StringBuilder().append( TEMPLATE_LOCATION )\n\t\t\t\t.append( job.getAction().toString().toLowerCase() ).append( \".vm\" ).toString();\n\t\tTemplate template = velocityEngine.getTemplate( templateLocation, \"UTF-8\" );\n\t\tVelocityContext context = new VelocityContext();\n\t\tStringWriter writer = new StringWriter();\n\t\t\n\t\t// Handle some special cases before populating the context\n\t\tif (job.getAction() == RepositoryActionType.UNLOCK) {\n\t\t\tif (REMARK_UNLOCK_REVERT.equals( job.getRemarks() )) {\n\t\t\t\tjob.remarks = null;\n\t\t\t\tcontext.put( \"isUnlockRevert\", true );\n\t\t\t}\n\t\t}\n\t\tif (job.getAction() == RepositoryActionType.LIBRARY_MOVED) {\n\t\t\tif (job.getRemarks() != null) {\n\t\t\t\tString newBaseNamespace;\n\t\t\t\ttry {\n\t\t\t\t\tVersionSchemeFactory factory = VersionSchemeFactory.getInstance();\n\t\t\t\t\tVersionScheme vScheme = factory.getVersionScheme( job.getItem().getVersionScheme() );\n\t\t\t\t\t\n\t\t\t\t\tnewBaseNamespace = vScheme.getBaseNamespace( job.getRemarks() );\n\t\t\t\t\t\n\t\t\t\t} catch (VersionSchemeException e) {\n\t\t\t\t\tnewBaseNamespace = job.getRemarks();\n\t\t\t\t}\n\t\t\t\tcontext.put( \"newBaseNamespace\", newBaseNamespace );\n\t\t\t}\n\t\t}\n\t\t\n\t\tcontext.put( \"repositoryName\", manager.getDisplayName() );\n\t\tcontext.put( \"baseRepositoryUrl\", baseRepositoryUrl );\n\t\tcontext.put( \"action\", job.getAction() );\n\t\tcontext.put( \"affectedNamespace\", job.getAffectedNamespace() );\n\t\tcontext.put( \"item\", job.getItem() );\n\t\tcontext.put( \"remarks\", job.getRemarks() );\n\t\tcontext.put( \"user\", user );\n\t\tcontext.put( \"utils\", new TemplateUtils() );\n\t\t\n\t\ttemplate.merge( context, writer );\n\t\treturn writer.toString();\n\t}", "public String getNotificationText() {\n\t\treturn notificationText;\n\t}", "public Object getBody() throws MessagingException {\n if (body == null) {\n body = getMarshaler().unmarshal(exchange, this);\n }\n return body;\n }", "@ApiModelProperty(required = true, value = \"The body of the approval request to show the user.\")\n public String getBody() {\n return body;\n }", "private void sendNotification() {\n }", "private void launchNotificationsThread() {\n Thread t = new Thread(\"JMXNotificationThread for \" + BodyWrapper.this.objectName) {\n @Override\n public void run() {\n // first we wait for the creation of the body\n while (!BodyWrapper.this.body.isActive() && BodyWrapper.this.body.isAlive()) {\n try {\n Thread.sleep(updateFrequence);\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n \n // and once the body is activated, we can forward the\n // notifications\n while (BodyWrapper.this.body.isActive()) {\n try {\n Thread.sleep(updateFrequence);\n sendNotifications();\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n }\n };\n t.setDaemon(true);\n t.start();\n }", "public boolean isSetBody() {\n return this.body != null;\n }", "public boolean isSetBody() {\n return this.body != null;\n }", "protected String getElementBody() {\n return this.getMessage() == null ? null : this.getMessage();\n }", "public abstract void sendNotification(T notification) throws NotificationException;", "private void sendNotification(String messageBody, String titleMessage) {\n Intent intent = new Intent(this, HomeMenu.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);\n\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setSmallIcon(R.mipmap.ic_launcher);\n }\n\n notificationBuilder.setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(titleMessage)\n .setContentText(messageBody)\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody)); //Making the text in big Picture Style\n\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0, notificationBuilder.build());\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n private void showNotification(String title, String body)\n {\n Intent intent = new Intent(this, LoginActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_notification)\n .setContentTitle(title)\n .setContentText(body)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.app_icon))\n .setPriority(NotificationCompat.PRIORITY_HIGH) // for lower than api 26\n .setContentIntent(pendingIntent)\n .setAutoCancel(true) // removes notification on click\n .build();\n\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.notify(new Random().nextInt(), notification);\n }" ]
[ "0.64603996", "0.64179677", "0.6298397", "0.6270937", "0.6238864", "0.62111026", "0.62111026", "0.62111026", "0.62111026", "0.6156531", "0.6156531", "0.6156531", "0.6142734", "0.6115109", "0.609675", "0.6084367", "0.6070416", "0.60472304", "0.6044363", "0.6027192", "0.6023014", "0.60099405", "0.6007685", "0.599221", "0.59532905", "0.593448", "0.5902693", "0.589166", "0.58912235", "0.5874741", "0.5855894", "0.5840009", "0.58198875", "0.5797304", "0.5765345", "0.5759562", "0.57224315", "0.57175726", "0.5714218", "0.5698004", "0.56262165", "0.5617691", "0.560419", "0.55981076", "0.5581453", "0.5580059", "0.5579742", "0.5576055", "0.5566772", "0.55537176", "0.55368274", "0.5533152", "0.552196", "0.54964054", "0.54931396", "0.5487048", "0.54740644", "0.5463954", "0.54261553", "0.542092", "0.5419311", "0.53876644", "0.5376614", "0.5362258", "0.5360093", "0.5355071", "0.5353598", "0.53534216", "0.5348735", "0.5348735", "0.5330763", "0.53201413", "0.5311558", "0.53024715", "0.5287626", "0.525938", "0.5247441", "0.5232805", "0.52293533", "0.52273184", "0.5224154", "0.52015543", "0.5198507", "0.5190672", "0.51793295", "0.5176192", "0.51739275", "0.51676166", "0.5163535", "0.5161713", "0.51615286", "0.51602894", "0.5143262", "0.5108348", "0.50985956", "0.50985956", "0.50975543", "0.50823736", "0.5079526", "0.50732076" ]
0.8056748
0
Tests setting the name and body using the Notification class Constructor.
@Test public void testConstructor() { // Create a new Notification using the Constructor to set the note name // and body INotification note = new Notification("TestNote", 5, "TestNoteType"); // test assertions Assert.assertEquals("Expecting note.getName() == 'TestNote'", note.getName(), "TestNote"); Assert.assertTrue("Expecting note.getBody()as Number == 5", (Integer) note.getBody() == 5); Assert.assertEquals("Expecting note.getType() == 'TestNoteType'", note.getType(), "TestNoteType"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Notification()\n\t{\n\t\t\n\t}", "public Notification()\n\t{\n\t\t// Start of user code constructor for Notification)\n\t\tsuper();\n\t\t// End of user code\n\t}", "public Notification() {\r\n }", "public Notification() {\r\n }", "@Test\r\n\tpublic void testBodyAccessors() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the body\r\n\t\tINotification note = new Notification(null);\r\n\t\tnote.setBody(5);\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertTrue(\"Expecting note.getBody()as Number == 5\", (Integer) note.getBody() == 5);\r\n\t}", "private void createNotification(String title, String body) {\n Context context = getBaseContext();\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Intent notificationIntent = new Intent(context, OffersActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(context,\n 0, notificationIntent,\n PendingIntent.FLAG_CANCEL_CURRENT);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(getString(R.string.app_name))\n .setContentText(body)\n .setTicker(body)\n .setSound(defaultSoundUri)\n .setContentIntent(contentIntent)\n .setAutoCancel(true);\n NotificationManager mNotificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n }", "public Notification() {\n\n\t}", "public Notification() {\n\n }", "public final void testSetUserData() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertNull(n.getUserData());\n n.setUserData(\"User data\");\n assertEquals(\"User data\", n.getUserData());\n }", "@Test\r\n\tpublic void testNameAccessors() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the note name\r\n\t\tINotification note = new Notification(\"TestNote\");\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertEquals(\"Expecting note.getName() == 'TestNote'\", note.getName(), \"TestNote\");\r\n\t}", "public Notifications() {\n \n \t}", "@NonNull\n\tNotificationBuilder newNotification();", "private Notifier(){}", "public BaseNotificationBuilder() {\n this(new Notification());\n }", "public void setNotification(String notification) {\n this.notification = notification;\n }", "private void mostrarNotificacion(String title, String body)\r\n {\r\n Intent intent = new Intent(this, MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\r\n\r\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\r\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\r\n .setSmallIcon(R.mipmap.ic_launcher)\r\n .setContentTitle(title)\r\n .setContentText(body)\r\n .setAutoCancel(true)\r\n .setSound(soundUri)\r\n .setContentIntent(pendingIntent);\r\n\r\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\r\n notificationManager.notify(0/*ID de l notificación*/, notificationBuilder.build());\r\n }", "public void sendNotification(String notifTitle, String notifText) {\n\n }", "public BaseNotificationBuilder(Notification notification) {\n this.notification = notification;\n }", "public void testNotificationConfigurationException1() {\n NotificationConfigurationException exception = new NotificationConfigurationException(ERROR_MESSAGE);\n assertNotNull(\"Unable to instantiate NotificationConfigurationException.\", exception);\n assertEquals(\"Error message is not properly propagated to super class.\", ERROR_MESSAGE, exception.getMessage());\n }", "@Test\r\n\tpublic void testToString() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the note name\r\n\t\tINotification note = new Notification(\"TestNote\", \"1,3,5\", \"TestType\");\r\n\t\tString ts = \"Notification Name: TestNote Body:1,3,5 Type:TestType\";\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertEquals(\"Expecting note.testToString() == '\" + ts + \"'\", note.toString(), ts);\r\n\t}", "public void setBody(String newValue);", "private void selfCheck()\n {\n createSession();\n\n // Verify that we can create a mail body\n ImmutableNotification notification = Notification.builder(Instant.now(), \"message\")\n .siteId(1)\n .projectName(\"project\")\n .projectId(2)\n .workflowName(\"workflow\")\n .revision(\"revision\")\n .attemptId(3)\n .sessionId(4)\n .taskName(\"task\")\n .timeZone(ZoneOffset.UTC)\n .sessionUuid(UUID.randomUUID())\n .sessionTime(OffsetDateTime.now())\n .workflowDefinitionId(5L)\n .build();\n try {\n body(notification);\n }\n catch (Exception e) {\n throw ThrowablesUtil.propagate(e);\n }\n }", "private void setNotification() {\n mBuilder.setProgress(updateMax, ++updateProgress, false)\n .setContentTitle(getResources().getString(R.string.notification_message));\n // Issues the notification\n nm.notify(0, mBuilder.build());\n }", "public final void testNotificationStringObjectlonglongString() {\n Notification n = new Notification(\"type\", \"src\", 1, 2, \"msg\");\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(2, n.getTimeStamp());\n assertEquals(\"msg\", n.getMessage());\n }", "public final void testNotificationStringObjectlonglong() {\n Notification n = new Notification(\"type\", \"src\", 1, 2);\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(2, n.getTimeStamp());\n }", "public Notification(NType type, Date date, String description, User target, Event trigger)\n\t{\n\t\tthis.type = type;\n\t\tthis.date = date;\n\t\tthis.description = description;\n\t\tthis.target = target;\n\t\tthis.trigger = trigger;\n\t}", "public void setNotificationText(String notificationText) {\r\n\t\tthis.notificationText = notificationText;\r\n\t}", "@Override\r\n\tpublic Notification createEmailNotification() {\n\t\treturn null;\r\n\t}", "@Before\n public void setUp()\n {\n sut = new NotificationMessageBuilderHelper();\n }", "public INotification createNotification()\n throws OculusException;", "public NotificationService(String name) {\n super(name);\n }", "public void enterAppNotificationBody(String value) {\r\n\r\n\t\treportStep(\"About to enter the App notification Body \" + value, \"INFO\");\r\n\r\n\t\tif(enterTextInChrome(appNotificationBody,value)) {\r\n\r\n\t\t\treportStep(\"Successfully enter the App Notification body Text \" + value, \"PASS\");\r\n\r\n\t\t}else {\r\n\t\t\t\r\n\t\t\treportStep(\"Failed to enter the App notification Body Text \" + value, \"FAIL\");\r\n\r\n\t\t}\r\n\t}", "private Notes() {}", "private void sendNotification() {\n }", "private void initNotification() {\n Notification.Builder notificationBuilder =\n new Notification.Builder(this).setSmallIcon(R.drawable.notification_anim)\n .setContentTitle(\"Streaming\")\n .setContentText(\"Display mode stream\")\n .setTicker(\"Stream in progress\");\n notificationBuilder.setAutoCancel(true);\n if (notificationManager != null)\n notificationManager.notify(12345, notificationBuilder.build());\n }", "private void sendNotification(String ttl, String messageBody) {\n Intent intent = new Intent(this, ActivitySplash.class);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setSmallIcon(R.mipmap.splash_screen_logo);\n notificationBuilder.setColor(getResources().getColor(R.color.white));\n } else {\n notificationBuilder.setSmallIcon(R.mipmap.logo);\n }\n notificationBuilder.setContentTitle(ttl)\n .setContentText(messageBody)\n // .setStyle(new NotificationCompat.BigPictureStyle().bigPicture(image))/*Notification with Image*/\n .setAutoCancel(true)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.logo))\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }", "public void setNotification(String notif) {\n frame.setNotification(notif);\n }", "public final void testNotificationStringObjectlongString() {\n Notification n = new Notification(\"type\", \"src\", 1, \"msg\");\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(\"msg\", n.getMessage());\n }", "private void showArrivalNotification(String body) {\n\n PendingIntent contentIntent = PendingIntent.getActivity(getBaseContext()\n , 0, new Intent(), PendingIntent.FLAG_ONE_SHOT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getBaseContext());\n\n builder.setAutoCancel(true).setDefaults(android.app.Notification.DEFAULT_LIGHTS| android.app.Notification.DEFAULT_SOUND)\n .setWhen(System.currentTimeMillis()).setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"Arrival\").setContentText(body)\n .setContentIntent(contentIntent);\n NotificationManager manager = (NotificationManager)getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE);\n manager.notify(1, builder.build());\n }", "public void addNotification(java.lang.String notificationIn)\r\n\t{\r\n\t\tnotification = notificationIn;\r\n\t}", "public Notifica(){}", "public void setNotificationText(String notificationText) {\n\t\tthis.notificationText = notificationText;\n\t}", "public PopupNotificationView(Context context, String[] args, String head, String line1, String line2, int type) {\r\n \tsuper(context);\r\n \tpopupNotificationController = new PopupNotificationController(this);\r\n }", "private static void setNotification(Context context, String message) {\n NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n Notification notification = new Notification(R.drawable.icon, message, System.currentTimeMillis());\n\n Intent currentEvent = new Intent(context, CurrentEvent.class);\n PendingIntent target = PendingIntent.getActivity(context, 0, currentEvent, 0);\n String title = context.getString(R.string.reminder_title);\n notification.setLatestEventInfo(context, title, message, target);\n\n // We never want more than one notification, so always use the same ID\n nm.notify(NOTIFICATION_ID, notification);\n }", "private void sendNotification(String messageBody) {\n Log.d(TAG, messageBody);\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"default\",\n \"oqatt\",\n NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(\"oqatt_updates\");\n channel.setImportance(IMPORTANCE_HIGH);\n assert mNotificationManager != null;\n mNotificationManager.createNotificationChannel(channel);\n }\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext(), \"default\")\n .setSmallIcon(R.mipmap.oqatt_logo) // notification icon\n .setContentTitle(messageBody) // title for notification\n .setSound(defaultSoundUri) // sound notification\n .setAutoCancel(true); // clear notification after click\n\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n PendingIntent pi = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n mBuilder.setContentIntent(pi);\n assert mNotificationManager != null;\n mNotificationManager.notify(0, mBuilder.build());\n }", "private void launchNotificationsThread() {\n Thread t = new Thread(\"JMXNotificationThread for \" + BodyWrapper.this.objectName) {\n @Override\n public void run() {\n // first we wait for the creation of the body\n while (!BodyWrapper.this.body.isActive() && BodyWrapper.this.body.isAlive()) {\n try {\n Thread.sleep(updateFrequence);\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n \n // and once the body is activated, we can forward the\n // notifications\n while (BodyWrapper.this.body.isActive()) {\n try {\n Thread.sleep(updateFrequence);\n sendNotifications();\n } catch (InterruptedException e) {\n logger.error(\"The JMX notifications sender thread was interrupted\", e);\n }\n }\n }\n };\n t.setDaemon(true);\n t.start();\n }", "public PrtNotificationVORowImpl() {\r\n }", "Notification createNewAppointmentNotification(Appointment appointment);", "public void run() {\n String lg_ti = \"Test.\";\n String des_ti = \"The license valid until \";\n String ban_ti = \"Warning!\";\n getNotificationData();\n //notificationShow(des_ti,lg_ti,ban_ti);\n }", "@Test\n public void testAddPrizeNotification() throws Exception {\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n private void showNotification(String title, String body)\n {\n Intent intent = new Intent(this, LoginActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_notification)\n .setContentTitle(title)\n .setContentText(body)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.app_icon))\n .setPriority(NotificationCompat.PRIORITY_HIGH) // for lower than api 26\n .setContentIntent(pendingIntent)\n .setAutoCancel(true) // removes notification on click\n .build();\n\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.notify(new Random().nextInt(), notification);\n }", "public final void testSetTimeStamp() {\n Notification n = new Notification(\"type\", \"src\", 1);\n n.setTimeStamp(123);\n assertEquals(123, n.getTimeStamp());\n }", "public final void testSetSource() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertEquals(\"src\", n.getSource());\n n.setSource(\"new src\");\n assertEquals(\"new src\", n.getSource());\n }", "public void setNotificationTitle(String notificationTitle) {\r\n\t\tthis.notificationTitle = notificationTitle;\r\n\t}", "public Notification(Date dateOfAdded, String notificationType, String notificationText, boolean isActive) {\n\t\tthis.dateOfAdded = dateOfAdded;\n\t\tthis.notificationType = notificationType;\n\t\tthis.notificationText = notificationText;\n\t\tthis.isActive = isActive;\n\t}", "private void sendNotification(String messageBody, String titleMessage) {\n Intent intent = new Intent(this, HomeMenu.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);\n\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setSmallIcon(R.mipmap.ic_launcher);\n }\n\n notificationBuilder.setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(titleMessage)\n .setContentText(messageBody)\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody)); //Making the text in big Picture Style\n\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0, notificationBuilder.build());\n }", "private void createNotification() {\n\t\tIntent notifyIntent = new Intent(this, BirthdayActivity.class);\r\n\t\t// Sets the Activity to start in a new, empty task\r\n\t\tnotifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t// Creates the PendingIntent\r\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(this,\r\n\t\t\t\t(int) System.currentTimeMillis(), notifyIntent,\r\n\t\t\t\tPendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\tNotificationManagerUtil notificationManagerUtil = NotificationManagerUtil\r\n\t\t\t\t.getInstance();\r\n\t\tnotificationManagerUtil.createNotifications(this, 1, \"Message\",\r\n\t\t\t\tpendingIntent);\r\n\t}", "public Notification(String message, Long date) {\n this.message = message;\n this.date = date;\n }", "@Override\n\tpublic void setNotification(String title, String text, int minutes, int type) {\n\t \t Calendar cal = Calendar.getInstance();\n\t \t // add 5 minutes to the calendar object\n\t \t cal.add(Calendar.MINUTE, minutes);\n\t \t Intent intent = new Intent(this, AlarmReceiver.class);\n\t \t intent.putExtra(\"title\", title);\n\t \t intent.putExtra(\"text\", text);\n\t \t intent.putExtra(\"type\", type);\n\t \t // In reality, you would want to have a static variable for the request code instead of 192837\n\t \t PendingIntent sender = PendingIntent.getBroadcast(this, 192213, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t \t \n\t \t // Get the AlarmManager service\n\t \t AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t \t am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);\n\t}", "public Notifications(String postName, Set<String> tags,\n Set<String> category, String timeStart, String timeEnd, String type, String userId){\n name = postName;\n this.tags = tags;\n this.category = category;\n this.beginTime= timeStart;\n this.endTime= timeEnd;\n this.type = type;\n this.userID = userId;\n //idk if we want to add this or not\n this.requestID = \"N/A\";\n }", "public NotificationService() {\n super(\"NotificationService\");\n }", "public void createNotification(View view) {\n Intent intent = new Intent(this, Status1.class);\r\n PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);\r\n\r\n // Build notification\r\n // Actions are just fake\r\n Notification noti = new Notification.Builder(this)\r\n .setContentTitle(\"RKC App \")\r\n .setContentText(\"Click To Enter \").setSmallIcon(R.drawable.arc)\r\n .setContentIntent(pIntent)\r\n .addAction(R.drawable.ironman, \"Back\", pIntent)\r\n .addAction(R.drawable.gun, \"More\", pIntent)\r\n .build();\r\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n // hide the notification after its selected\r\n noti.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\r\n notificationManager.notify(0, noti);\r\n\r\n }", "public SentMail(String date, String to, String subject/*,String body*/) {\n this.date = new SimpleStringProperty(date);\n this.to = new SimpleStringProperty(to);\n this.Subject = new SimpleStringProperty(subject);\n //this.body = new SimpleStringProperty(body);\n }", "public NotificationJob(RepositoryActionType action, String userId, String affectedNamespace, String remarks) {\n \t\tthis.action = action;\n \t\tthis.userId = userId;\n \t\tthis.affectedNamespace = affectedNamespace;\n \t\tthis.remarks = remarks;\n \t\tthis.delayExpiration = System.currentTimeMillis() + notificationDelay;\n \t}", "public Note(String body, String title) {\n super(title, null);\n this.body = body;\n this.attachments = new HashMap<>();\n }", "public final void testNotificationStringObjectlong() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n }", "public NotificationResource() {\r\n }", "public Notifications(Integer postID, Integer requesterID, Integer providerID,\n String locationOfRequester, String type){\n //PostID, requesterID, providerID,locationOfRequester need to create variable?\n this.postID = postID;\n this.requesterID = requesterID;\n this.userId = providerID;\n\n this.type = type;\n this.setActiveStatus(true);\n //idk if we want to add this or not\n this.beginTime = \"N/A\";\n this.endTime = \"N/A\";\n this.category = null;\n this.tags = null;\n this.location = locationOfRequester;\n\n\n }", "public void test_WrapNotifyingCase() throws Exception {\n\t\tinit(null); \n\t\trepo = factory.createRepository(notifier) ;\n\t\trepo.initialize() ;\n\t\t\n\t\tassertTrue(repo instanceof NamedQueryRepositoryWrapper) ;\n\t\tfunctionalTest();\n\t}", "public void createNotification(String userId, String desc, String text,\r\n\t\t\tString subject) {\n\t\tNotification notification = new Notification();\r\n\t\tif (StringUtils.isNotBlank(userId)) {\r\n\t\t\tUser user = userDAO.findById(userId);\r\n\t\t\t// User info\r\n\t\t\tnotification.setUser(user);\r\n\t\t\t// description\r\n\t\t\tDescription descr = new Description();\r\n\t\t\tdescr.setLang(\"Eng\");\r\n\t\t\tdescr.setVal(desc);\r\n\t\t\tnotification.setDesc(descr);\r\n\t\t\t// text\r\n\t\t\tnotification.setText(text);\r\n\t\t\t// notificationType\r\n\t\t\tnotification.setType(NotificationType.ALERTS);\r\n\t\t\t// subject\r\n\t\t\tnotification.setNotificationSubject(subject);\r\n\t\t\tnotificationDAO.save(notification);\r\n\t\t}\r\n\t}", "public Notes() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Notification (){\n //Calendar cal = Calendar.getInstance();\n //cal.setTimeInMillis(0);\n //cal.set(year, month, day, hours, minutes, seconds);\n\n }", "public NotificationDialog(List<Notification> notifications, JLabel notificationLabel) {\r\n this(notifications, notificationLabel, 500, 50);\r\n }", "public abstract void sendNotification(String sendFrom, List<Object> sendTo, String sendToProperty, NoticeTemplate noticeTemplate, Object noticeData);", "public NotificationStore(){}", "private void showNotification() {\n }", "public BodyWrapper(ObjectName oname, AbstractBody body) {\n this.objectName = oname;\n this.id = body.getID();\n this.body = body;\n this.nodeUrl = body.getNodeURL();\n this.isReifiedObjectSerializable = body.getReifiedObject() instanceof Serializable;\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n this.launchNotificationsThread();\n }", "@Test\n\t\t\tpublic void setMessageTest() {\n\t\t\t\tMessage msgjunit = new Message();\n\t\t\t\tString expectedmsg = msgjunit.getMessage();\n\t\t\t\tString actualmsg = msgjunit.getMessage();\n\t\t\t\tassertSame(expectedmsg, actualmsg);\n\t\t\t\tif (expectedmsg == actualmsg) {\n\n\t\t\t\t\tSystem.out.println(\"Both expected message and actual message are equal:\" + \" \" + expectedmsg\n\t\t\t\t\t\t\t+ \" \" + \"=\" + \" \" + actualmsg);\n\t\t\t\t}\n\t\t\t}", "private void showNotification() {\n\n }", "private NotificationClient() { }", "public NotificationDialog(List<Notification> notifications, JLabel notificationLabel, int width, int height) {\r\n this.notifications = notifications;\r\n this.width = width;\r\n this.height = height;\r\n this.notificationLabel = notificationLabel;\r\n this.notificationLabel.setBounds(EscapeRoom.location.x + (EscapeRoom.SCREEN_WIDTH - this.width) / 2, EscapeRoom.location.y + 50, this.width, this.height);\r\n new ProcessTimedEvent().start();\r\n }", "@Override\n public void notifyObserver(String news) {\n //send an actual email\n System.out.println(\"Reading the news paper : \"+ news);\n }", "@Override\r\n\tpublic Notification createSMSNotification() {\n\t\treturn null;\r\n\t}", "public final void setUp() {\n if (n == null) {\n fail(\"The AttributeChangeNotification \"\n + \"has not been received in 3 seconds.\");\n finish();\n }\n }", "private void setupMessage() {\n \tmessage = new GLabel(\"\");\n \tmessage.setFont(\"SansSerif-12\");\n }", "@Override\n\tpublic void setNotificationTitle(@Nullable CharSequence title) {\n\t\tif (title == null) {\n\t\t\ttitleLabel.setText(\"\");\n\t\t} else {\n\t\t\ttitleLabel.setText(title.toString());\n\t\t}\n\t}", "public MockEditNote() {}", "public abstract void sendNotification(T notification) throws NotificationException;", "private void setBody(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n body_ = value;\n }", "void mo54412a(int i, Notification notification);", "public StatusBarNotification(String pkg, String opPkg, int id,\n String tag, int uid, int initialPid, Notification notification, UserHandle user,\n String overrideGroupKey, long postTime) {\n if (pkg == null) throw new NullPointerException();\n if (notification == null) throw new NullPointerException();\n\n this.pkg = pkg;\n this.opPkg = opPkg;\n this.id = id;\n this.tag = tag;\n this.uid = uid;\n this.initialPid = initialPid;\n this.notification = notification;\n this.user = user;\n this.postTime = postTime;\n this.overrideGroupKey = overrideGroupKey;\n this.key = key();\n this.groupKey = groupKey();\n }", "private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}", "public NoteDataObject(String noteTitle, TextView noteContent){\n this.title = noteTitle;\n this.content = noteContent;\n }", "public void testNotificationConfigurationException2() {\n NotificationConfigurationException exception = new NotificationConfigurationException(ERROR_MESSAGE,\n CAUSE_EXCEPTION);\n\n assertNotNull(\"Unable to instantiate NotificationConfigurationException.\", exception);\n assertTrue(\"The error message should match\", exception.getMessage().indexOf(ERROR_MESSAGE) >= 0);\n assertEquals(\"Cause is not properly propagated to super class.\", CAUSE_EXCEPTION, exception.getCause());\n }", "public Note(String description) throws NoteException {\n if(description.equals(\"note\")) {\n throw new NoteException();\n }\n this.description = description;\n }", "private void setupNotificationCharacteristic() {\n notificationCharacteristic =\n new BluetoothGattCharacteristic(CHARACT_NOTIFICATION_UUID,\n BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_NOTIFY,\n BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);\n\n notificationCharacteristic.addDescriptor(\n Peripheral.getClientCharacteristicConfigurationDescriptor());\n\n notificationCharacteristic.addDescriptor(\n Peripheral.getCharacteristicUserDescriptionDescriptor(CHARACT_NOTIFICATION_DESC));\n\n notificationCharacteristic.setValue(notificationCharacteristic_value);\n }", "private static void generateNotification(Context context, Bundle bundle) {\n\t\tint icon = R.drawable.icon;\n\t\tlong when = System.currentTimeMillis();\n\t\tString message = bundle.getString(\"message\");\n\t\tNotificationManager notificationManager = (NotificationManager) context\n\t\t\t\t.getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tNotification notification = new Notification(icon, message, when);\n\t\tString title = context.getString(R.string.app_name);\n\t\tIntent notificationIntent = new Intent(context, NetasDemoActivity.class);\n\n\t\tnotificationIntent.putExtras(bundle);\n\n\t\t// set intent so it does not start a new activity\n\t\tnotificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\n\t\t\t\t| Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\tPendingIntent intent = PendingIntent.getActivity(context, 0,\n\t\t\t\tnotificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t\tnotification.defaults |= Notification.DEFAULT_SOUND\n\t\t\t\t| notification.DEFAULT_LIGHTS | notification.DEFAULT_VIBRATE;\n\t\t// long[] vibrate = {0,100,200,300};\n\t\t// notification.vibrate = vibrate;\n\t\tnotification.setLatestEventInfo(context, title, message, intent);\n\t\tnotification.flags |= Notification.FLAG_AUTO_CANCEL\n\t\t\t\t| Notification.FLAG_SHOW_LIGHTS;\n\t\tnotification.ledOnMS = 1000; // light on in milliseconds\n\t\tnotification.ledOffMS = 4000; // light off in milliseconds\n\t\tnotificationManager.notify(0, notification);\n\t}", "final void mo2198a(Notification notification) {\n notification.defaults = this.notificationDefaults;\n notification.flags = this.notificationFlags;\n notification.icon = this.statusBarDrawable;\n }", "public Notification(AGateway gateway)\r\n/* 11: */ {\r\n/* 12:31 */ setGateway(gateway);\r\n/* 13: */ }", "public Email(Application application, Student student){\n setRecipient(student.getEmail());\n setContent(application.getTitle(),student.getFirstname() + \" \" +student.getLastname(),\n application.getId(), application.getStatus());\n setSubject(\"Application Notification\");\n type = application.getStatus();\n }" ]
[ "0.6497874", "0.64630085", "0.63810587", "0.63810587", "0.6317283", "0.62733763", "0.6249906", "0.62071615", "0.6171131", "0.6103475", "0.59860075", "0.5923864", "0.5870323", "0.5869258", "0.5834964", "0.58003634", "0.579911", "0.5796465", "0.57922393", "0.57910687", "0.5700258", "0.5686854", "0.56702155", "0.56132334", "0.55909216", "0.5560716", "0.55555475", "0.55550796", "0.55444705", "0.5536335", "0.5516508", "0.55107933", "0.5507882", "0.55039644", "0.55026156", "0.54940546", "0.5493958", "0.5465076", "0.545577", "0.5445388", "0.5442381", "0.5431107", "0.5429273", "0.5426426", "0.5419146", "0.54171544", "0.5396427", "0.538885", "0.5385643", "0.5383798", "0.5373347", "0.53679544", "0.5367657", "0.53636074", "0.53569347", "0.5355909", "0.5355741", "0.5354917", "0.53333014", "0.5328144", "0.5322664", "0.5316184", "0.53141534", "0.531072", "0.5305542", "0.53033483", "0.5301815", "0.5299939", "0.5282776", "0.5278241", "0.5272818", "0.5253471", "0.5253292", "0.52485394", "0.52420247", "0.5240595", "0.52292585", "0.522909", "0.5222031", "0.52184045", "0.5216321", "0.5215534", "0.52141994", "0.52086294", "0.52027774", "0.52022517", "0.5200568", "0.5194337", "0.518197", "0.5176334", "0.5173404", "0.5164739", "0.5158773", "0.5138833", "0.5133477", "0.5123992", "0.51220673", "0.51151544", "0.51087004", "0.51074046" ]
0.6721264
0
Tests the toString method of the notification
@Test public void testToString() { // Create a new Notification and use accessors to set the note name INotification note = new Notification("TestNote", "1,3,5", "TestType"); String ts = "Notification Name: TestNote Body:1,3,5 Type:TestType"; // test assertions Assert.assertEquals("Expecting note.testToString() == '" + ts + "'", note.toString(), ts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void testToString() {\n try {\n Notification.class.getDeclaredMethod(\"toString\", new Class[0]);\n } catch (SecurityException e) {\n printStackTrace(e);\n } catch (NoSuchMethodException e) {\n fail(\"The method toString() is not overridden\");\n }\n }", "public final void testNotificationStringObjectlongString() {\n Notification n = new Notification(\"type\", \"src\", 1, \"msg\");\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(\"msg\", n.getMessage());\n }", "@Test\n public void toString_shouldReturnInCorrectFormat() {\n Task task = new Task(\"Test\");\n String expected = \"[N] Test\";\n Assertions.assertEquals(expected, task.toString());\n }", "public void test_toString() {\n String logMessage = instance.getLogMessage();\n\n assertEquals(\"'toString' should be correct.\", logMessage, instance.toString());\n }", "public final void testNotificationStringObjectlonglongString() {\n Notification n = new Notification(\"type\", \"src\", 1, 2, \"msg\");\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(2, n.getTimeStamp());\n assertEquals(\"msg\", n.getMessage());\n }", "public final void testNotificationStringObjectlong() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n }", "public final void testNotificationStringObjectlonglong() {\n Notification n = new Notification(\"type\", \"src\", 1, 2);\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(2, n.getTimeStamp());\n }", "@Test\n\tpublic void testToString() {\n\t\tSystem.out.println(\"toString\");\n\t\tDeleteTask task = new DeleteTask(1);\n\t\tassertEquals(task.toString(), \"DeleteTask -- [filePath=1]\");\n\t}", "@Test\n\tpublic void testToString() {\n\t\tString result = email + \" \" + amount;\n\t\tassertEquals(\"Test : toString()\", bid.toString(), result);\n\t}", "@Test\n public void testToString() throws Exception {\n assertEquals(test.toString(), \"Responding\");\n\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Notification [id=\" + id + \", dateOfAdded=\" + dateOfAdded + \", notificationType=\" + notificationType\n\t\t\t\t+ \", notificationText=\" + notificationText + \", isActive=\" + isActive + \"]\";\n\t}", "@Test\n public void testToString() {\n Order order = new Order(\"Test\", LocalTime.NOON, GridCoordinate.ZERO);\n\n Assert.assertEquals(\"Compare toString.\",\n \"Order [orderId=Test, orderTime=12:00, customerLocation=GridCoordinate [x=0, y=0]]\",\n order.toString());\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes(listaExposicoes);\n StringBuilder expResult = new StringBuilder();\n expResult.append(\"RegistoExposicoes{\");\n for (Exposicao exposicao : instance.getListaExposicoes()) {\n expResult.append(String.format(\"%s%n\", exposicao));\n }\n expResult.append(\"}\");\n String result = instance.toString();\n assertEquals(expResult.toString(), result);\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"*****************\");\r\n System.out.println(\"Test : toString\");\r\n Cours_Reservation instance = new Cours_Reservation();\r\n instance.setFormation(\"Miage\");\r\n instance.setModule(\"programmation\");\r\n String expResult = instance.getFormation() + \"\\n\" + instance.getModule() ;\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }", "@Test\n\tpublic void testToString_True() {\n\n\t\tString result = \"\";\n\t\tresult = \"\\n*************Title: \" + book1.getTitle();\n\t\tresult += \"\\n*************Author: \" + book1.getAuthor();\n\t\tresult += \"\\n*************Publication Year: \" + book1.getPublicationDate();\n\t\tresult += \"\\n*************ISBN: \" + book1.getIsbnNumber() + \"\\n \";\n\t\tassertEquals(result, book1.toString());\n\n\t}", "@Test\r\n\tpublic void testToString() {\r\n\t\tPerson p1 = new Person(1, \"JavaLord\", \"hunter2\", \"The Lord of Java\");\r\n\t\tString s = p1.toString();\r\n\t\tassertTrue(s.equals(\"JavaLord:hunter2:The Lord of Java\"));\r\n\t}", "@Test public void toStringTest() {\n DirectMC i = new DirectMC(\"AdMailing\", 10000.00, 3.00, 2000);\n Assert.assertTrue(\"test\", i.toString().contains(\"(class DirectMC)\"));\n }", "@Test\r\n public void testToString() {\r\n // TODO \r\n assertTrue(true); \r\n }", "@Override String toString();", "@Test\n\tpublic void test_TCM__String_toString() {\n\t\t//expected value\n\t\tfinal Namespace ns = Namespace.getNamespace(\"prefx\", \"http://some.other.place\");\n\t\tfinal Attribute attr = new Attribute(\"test\", \"value\", ns);\n\t\tString str= attr.toString();\n\t\tassertTrue(\"incorrect toString form\", str.equals(\"[Attribute: prefx:test=\\\"value\\\"]\"));\n\n\t}", "@Test\n public void testToString() {\n LOGGER.info(\"testToString\");\n final String actual = new AtomString(\"Hello\").toString();\n final String expected = \"Hello\";\n assertEquals(expected, actual);\n }", "@Override\r\n String toString();", "@Override\n String toString();", "@Override\n String toString();", "@Test\n public void testToString() {\n LevelReportDto body = new LevelReportDto(\"product-name\", \"key-obs\",\n ProductFamily.L0_REPORT);\n GenericMessageDto<LevelReportDto> dto =\n new GenericMessageDto<LevelReportDto>(123, \"input-key\", body);\n String str = dto.toString();\n assertTrue(\"toString should contain the identifier\",\n str.contains(\"id: 123\"));\n assertTrue(\"toString should contain the body\",\n str.contains(\"body: \" + body.toString()));\n assertTrue(\"toString should contain the input key\",\n str.contains(\"inputKey: input-key\"));\n }", "public void testToString() {\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n Simulacao instance = new Simulacao(TipoDPolarizacao.ABSORCAO);\r\n String expResult = \"Simulacao{\" + \"tipoDPolarizacao=\" + instance.getTipoDPolarizacao() + '}';\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n ChannelType instance = null;\n String expResult = \"\";\n String result = instance.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override public String toString();", "public void testToString() {\n SynchronousQueue q = new SynchronousQueue();\n String s = q.toString();\n assertNotNull(s);\n }", "@Override\r\n public String toString();", "@Override\n public String toString();", "@Override\n public String toString();", "@Test\n public void testToString() {\n String result = chatMessage.toString();\n // use a regex for matching the date\n assertTrue(result.matches(\"^<[0-9:]+> \" + Pattern.quote(author) +\n \": \" + Pattern.quote(text)));\n }", "@Test\n public void testNoteToString() {\n \tassertEquals(\"string for a note\", note.toString(), \"^C'24\");\n }", "@Test \n\tpublic void testToString() {\n\t\t\n\t\tString saida = \"decio neto - 56554522\";\n\t\tassertEquals(contato1.toString(), saida);\n\t}", "@Override\n String toString();", "@Override\n\tString toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "public String toString() ;", "@Override\r\n\tpublic String toString();", "@Override\n\tpublic String toString();", "@Test\n public void testToString() {\n log.info(thresholdCrossingEvent.toString());\n\n DvThresholdCrossingEvent tce = createThresholdCrossingEvent(KEPLER_ID,\n EPOCH_MJD, ORBITAL_PERIOD, TRIAL_TRANSIT_PULSE_DURATION,\n MAX_MULTIPLE_EVENT_SIGMA, MAX_SINGLE_EVENT_SIGMA, PIPELINE_TASK,\n null, CHI_SQUARE_1, CHI_SQUARE_2, CHI_SQUARE_DOF_1,\n CHI_SQUARE_DOF_2, ROBUST_STATISTIC, MAX_SES_IN_MES);\n log.info(tce.toString());\n }", "@Test\n public void toStringTest() {\n \tConcreteVerticesGraph<String> graph=new ConcreteVerticesGraph<String>();\n \tassertEquals(\"Graph is empty\", graph.toString());\n \tgraph.set(\"v1\", \"v4\", 10);\n \tassertEquals(\"v1->v4:10\\n\", graph.toString());\n }", "@Override\n public abstract String toString();", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n OpeningTicketPurpose instance = new OpeningTicketPurpose();\r\n String expResult = \"\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"Name: Gates, Bill\" + \"\\n\"\n + \"Date of Birth: 09/05/1993\";\n String result = customer.toString();\n assertEquals(expResult, result);\n }", "public void test_toString() {\n // ## Arrange ##\n FromToOption option = createOption();\n option.compareAsDate();\n\n // ## Act ##\n String actual = option.toString();\n\n // ## Assert ##\n log(actual);\n assertTrue(actual.contains(\"lessThan=true\"));\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n RevisorParentesis instance = null;\r\n String expResult = \"\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public String toString() {\n String s = \"Message <RxTxMonitoringMsg> \\n\";\n try {\n s += \" [infos.type=0x\"+Long.toHexString(get_infos_type())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.log_src=0x\"+Long.toHexString(get_infos_log_src())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.timestamp=0x\"+Long.toHexString(get_infos_timestamp())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.seq_num=0x\"+Long.toHexString(get_infos_seq_num())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.size_data=0x\"+Long.toHexString(get_infos_size_data())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.valid_noise_samples=0x\"+Long.toHexString(get_infos_valid_noise_samples())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.noise=\";\n for (int i = 0; i < 3; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_noise(i) & 0xffff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.metadata=\";\n for (int i = 0; i < 2; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_metadata(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [data=\";\n for (int i = 0; i < 60; i++) {\n s += \"0x\"+Long.toHexString(getElement_data(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "@Override\n public String toString() {\n return message;\n }", "@Test\n\tpublic final void testToString() {\n\t\tanimal.moveTo(testForest);\n\t\t\n\t\tassertEquals(animal.toString(), \n\t\t\t\t\"[Animal: Possum, Type: Mammal, Gender: male, Legs: 4\"\n\t\t\t\t+ \" is in \" + testForest.toString() + \"]\");\n\t}", "@Override\n\tpublic abstract String toString();", "@Test\n public void testToString() {\n String expected =\"Business: name='AMC Lowes', description='', price_range=2, stars=3.75}\";\n String actual = theater.toString();\n Assert.assertEquals(expected,actual);\n }", "@Override\n public String toString() {\n return string;\n }", "public String toString(){\n \treturn \"todo: use serialize() method\";\r\n }", "@Test\n void testToString() {\n // Create a new item object with the following parameters:\n // Description: \"Test Description\", Due Date: \"2022-05-30\", isComplete: \"Complete\"\n Item actualResult = new Item(\"Test Description\", \"2022-05-30\", \"Complete\");\n // Then assertEquals to see if the actual string equals \"Test Description,2022-05-30,Complete\"\n assertEquals(\"Test Description,2022-05-30,Complete\", actualResult.toString());\n }", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "@Override\n\tpublic String toString(){\n\t\treturn this.message;\n\t}", "@Test\n public void testToString() throws Exception {\n this.queue = new HeapPriorityQueue<Person>(5); \n this.queue.add(new Person(\"Four\"), 4);\n this.queue.add(new Person(\"Five\"), 5);\n String actualResult = this.queue.toString();\n String expectedResult = \"[(Five, 5), (Four, 4)]\";\n assertEquals(expectedResult, actualResult);\n }", "@Test\r\n public void testToStringReturnString(){\r\n Assertions.assertEquals(patientResult.toString(), \"class PatientResult {\\n\" +\r\n \" patient: null\\n\" +\r\n \" patient: []\\n\" +\r\n \" child: []\\n\" +\r\n \" category: []\\n\" +\r\n \"}\");\r\n }", "@Override\n public String toString() {\n return (this.str);\n }", "@Test\n public void toStringTest() {\n String expected = \"Pepper Potts has an hourly salary of 16.00 and has worked 152 this month\";\n\n assertEquals(\"The expected string output does not match the actual\",\n expected, e1.toString());\n\n }", "@Test\n void testToString() {\n Tests tests = new Tests();\n String result = tests.toString();\n assertTrue(result.contains(\"total=\"));\n\n\n }", "public String toString()\r\n\t{\r\n\t\treturn message;\r\n\t}", "@Test\r\n\tvoid testToString2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(2);\r\n\t\tString output = test.toString();\r\n\t\tassertNotEquals(\"2 \", output);\r\n\t}", "@Override\n public String toString() {\n return mString;\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n ConfigNode configNode = new ConfigNode(testLine);\r\n assertEquals(testLine, configNode.toString());\r\n }", "@Test\n\tpublic void testaToString() {\n\t\tcontato = new Contato(\"Jardely\", \"Maris\", \"984653722\");\n\t\tassertEquals(contato.toString(), \"Jardely Maris - 984653722\");\n\t}", "@Override\n\tpublic abstract String toString ();", "@Override\n public String toString(){\n return toString(false);\n }", "@Test\n\tpublic void test_toString() {\n\tTennisPlayer c1 = new TennisPlayer(5,\"David Ferrer\");\n\tassertEquals(\"[5,David Ferrer]\",c1.toString());\n }", "public String toString() {\n\treturn createString(data);\n }", "@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }", "public String toString() {\n\t}", "protected String toString(Object expectedValue) {\n\t\treturn expectedValue == null ? \"\" : expectedValue.toString(); //$NON-NLS-1$\n\t}", "public String toString() { return stringify(this, true); }", "public String toString(){\n return \"info\";\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"DetalleAhorro{codigo=1, fechaPago=Tue Jan 01 00:10:00 COT 2019, interes=0.07, saldo=600.0}\";\n String result = detalleAhorro.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();" ]
[ "0.7581185", "0.68786126", "0.68459314", "0.6841439", "0.68035084", "0.67355824", "0.670605", "0.66728", "0.65680003", "0.65348667", "0.6531978", "0.65082616", "0.6498858", "0.6494249", "0.6489869", "0.64447594", "0.6423005", "0.6392348", "0.6386391", "0.6374167", "0.63706", "0.63559055", "0.6355281", "0.6355281", "0.63541", "0.63336253", "0.63279045", "0.6325742", "0.6318454", "0.63134205", "0.6307945", "0.6285412", "0.6285412", "0.6279387", "0.6275373", "0.62717825", "0.62704605", "0.62682307", "0.62360543", "0.62360543", "0.62360543", "0.62360543", "0.62360543", "0.62360543", "0.62360543", "0.6231678", "0.62294716", "0.6205643", "0.6200139", "0.6198157", "0.61868954", "0.6176331", "0.6175647", "0.6171897", "0.6168019", "0.61579275", "0.61550355", "0.614224", "0.61385703", "0.61090726", "0.6107658", "0.61041534", "0.61032224", "0.6101366", "0.60988486", "0.60940087", "0.6087895", "0.6075702", "0.60752285", "0.60664755", "0.6064801", "0.6062512", "0.6057709", "0.60559887", "0.6053048", "0.6050358", "0.60481155", "0.60468763", "0.6039703", "0.60367155", "0.6035726", "0.6022503", "0.6018046", "0.6017637", "0.60150564", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793", "0.60003793" ]
0.82393444
0
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ view = inflater.inflate(R.layout.fragment_my_profile, container, false); context = getActivity(); initialize(); connectionClass = new ConnectionClass(); TxtDpt.setText(ACU.MySP.getFromSP(context,ACU.MySP.PROFILE_DEPARTMENT,"")); etProfileEmailId.setText(ACU.MySP.getFromSP(context,ACU.MySP.PROFILE_EMAIL_ID,"")); etProfileEmployeeID.setText(ACU.MySP.getFromSP(context,ACU.MySP.PROFILE_EMPLOYEE_ID,"")); etProfileMobileNo.setText(ACU.MySP.getFromSP(context,ACU.MySP.PROFILE_MOBILE_NO,"")); etProfileName.setText(ACU.MySP.getFromSP(context,ACU.MySP.PROFILE_NAME,"")); btnEditProfile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (btnEditProfile.getText().toString().equals("Edit Profile")) { Log.e("inside_edit", btnEditProfile.getText().toString()); etProfileName.setEnabled(true); // etProfileEmployeeID.setEnabled(true); etProfileMobileNo.setEnabled(true); etProfileEmailId.setEnabled(true); btnEditProfile.setText("UPDATE Profile"); } else { Log.e("inside", btnEditProfile.getText().toString()); if(Validate()){ etProfileName.setEnabled(false); etProfileEmployeeID.setEnabled(false); etProfileMobileNo.setEnabled(false); etProfileEmailId.setEnabled(false); btnEditProfile.setText("Edit Profile"); stringProfileName= etProfileName.getText().toString().trim(); stringProfileEmployeeID= etProfileEmployeeID.getText().toString().trim(); stringProfileMobileNo= etProfileMobileNo.getText().toString().trim(); stringProfileEmailId= etProfileEmailId.getText().toString().trim(); UpdateProfileAsync updateProfileAsync = new UpdateProfileAsync(); updateProfileAsync.execute(stringProfileName, stringProfileEmployeeID, stringProfileMobileNo, stringProfileEmailId); } } } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Mapper for the entity Milestone and its DTO MilestoneDTO.
@Mapper(componentModel = "spring", uses = {}) public interface MilestoneMapper extends EntityMapper<MilestoneDTO, Milestone> { default Milestone fromId(Long id) { if (id == null) { return null; } Milestone milestone = new Milestone(); milestone.setId(id); return milestone; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Mapper(componentModel = \"spring\", uses = {OperationMapper.class, PecStatusChangeMatrixMapper.class, StatusPecMapper.class,})\npublic interface RaisonPecMapper extends EntityMapper <RaisonPecDTO, RaisonPec> {\n\n @Mapping(source = \"operation.id\", target = \"operationId\")\n @Mapping(source = \"operation.label\", target = \"operationLabel\")\n @Mapping(source = \"statusPec.id\", target = \"statusPecId\")\n @Mapping(source = \"statusPec.label\", target = \"statusPecLabel\")\n\n \n @Mapping(source = \"pecStatusChangeMatrix.id\", target = \"pecStatusChangeMatrixId\")\n @Mapping(source = \"pecStatusChangeMatrix.label\", target = \"pecStatusChangeMatrixLabel\")\n \n RaisonPecDTO toDto(RaisonPec raisonPec); \n\n @Mapping(source = \"operationId\", target = \"operation\")\n\n\n\n @Mapping(source = \"statusPecId\", target = \"statusPec\")\n\n \n @Mapping(source = \"pecStatusChangeMatrixId\", target = \"pecStatusChangeMatrix\")\n\n RaisonPec toEntity(RaisonPecDTO raisonPecDTO); \n default RaisonPec fromId(Long id) {\n if (id == null) {\n return null;\n }\n RaisonPec raisonPec = new RaisonPec();\n raisonPec.setId(id);\n return raisonPec;\n }\n}", "@Mapper\npublic interface MissionMapper {\n\n MissionMapper INSTANCE = Mappers.getMapper(MissionMapper.class);\n\n @Mapping(source = \"izQuestion\", target = \"izQuestion\")\n @Mapping(source = \"missionDescription\", target = \"missionDescription\")\n @Mapping(source = \"missionName\", target = \"missionName\")\n @Mapping(source = \"shortDescription\", target = \"shortDescription\")\n @Mapping(source = \"winnerScore\", target = \"winnerScore\")\n @Mapping(source = \"storyId\", target = \"story.id\")\n Mission dtoToMission (MissionDTO missionDTO);\n}", "@Mapper(componentModel = \"spring\", uses = { CustomUserMapper.class, IconMapper.class })\npublic interface TeamMapper extends EntityMapper<TeamDTO, Team> {\n\n /* (non-Javadoc)\n * @see com.ttth.teamcaring.service.mapper.EntityMapper#toDto(java.lang.Object)\n */\n @Mapping(source = \"owner.id\", target = \"ownerId\")\n @Mapping(source = \"icon.id\", target = \"iconId\")\n TeamDTO toDto(Team team);\n\n /* (non-Javadoc)\n * @see com.ttth.teamcaring.service.mapper.EntityMapper#toEntity(java.lang.Object)\n */\n @Mapping(target = \"groups\", ignore = true)\n @Mapping(target = \"appointments\", ignore = true)\n @Mapping(source = \"ownerId\", target = \"owner\")\n @Mapping(source = \"iconId\", target = \"icon\")\n Team toEntity(TeamDTO teamDTO);\n\n /**\n * From id.\n *\n * @param id the id\n * @return the team\n */\n default Team fromId(Long id) {\n if (id == null) {\n return null;\n }\n Team team = new Team();\n team.setId(id);\n return team;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {CategorieFilmMapper.class})\npublic interface FilmMapper extends EntityMapper<FilmDTO, Film> {\n\n @Mapping(source = \"categorie.id\", target = \"categorieId\")\n FilmDTO toDto(Film film);\n\n @Mapping(source = \"categorieId\", target = \"categorie\")\n Film toEntity(FilmDTO filmDTO);\n\n default Film fromId(Long id) {\n if (id == null) {\n return null;\n }\n Film film = new Film();\n film.setId(id);\n return film;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {SysRoleMapper.class, SysMenuMapper.class, })\npublic interface SysRoleMenuMapper extends EntityMapper <SysRoleMenuDTO, SysRoleMenu> {\n\n @Mapping(source = \"sysRole.id\", target = \"sysRoleId\")\n\n @Mapping(source = \"sysMenu.id\", target = \"sysMenuId\")\n SysRoleMenuDTO toDto(SysRoleMenu sysRoleMenu);\n\n @Mapping(source = \"sysRoleId\", target = \"sysRole\")\n\n @Mapping(source = \"sysMenuId\", target = \"sysMenu\")\n SysRoleMenu toEntity(SysRoleMenuDTO sysRoleMenuDTO); \n default SysRoleMenu fromId(Long id) {\n if (id == null) {\n return null;\n }\n SysRoleMenu sysRoleMenu = new SysRoleMenu();\n sysRoleMenu.setId(id);\n return sysRoleMenu;\n }\n}", "@Mapper\npublic interface ModularMapper {\n\n List<Modular> getAllModulars();\n\n Modular getModularById(Integer id);\n\n Integer addModular(Modular modular);\n\n void updateModular(Modular modular);\n\n void deleteModularById(Integer id);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MedicoCalendarioMapper extends EntityMapper<MedicoCalendarioDTO, MedicoCalendario> {\n\n\n\n default MedicoCalendario fromId(Long id) {\n if (id == null) {\n return null;\n }\n MedicoCalendario medicoCalendario = new MedicoCalendario();\n medicoCalendario.setId(id);\n return medicoCalendario;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MisteriosoMapper extends EntityMapper<MisteriosoDTO, Misterioso> {\n\n \n\n \n\n default Misterioso fromId(Long id) {\n if (id == null) {\n return null;\n }\n Misterioso misterioso = new Misterioso();\n misterioso.setId(id);\n return misterioso;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TxnActivityAuditMapper {\n\n @Mapping(source = \"editedBy.id\", target = \"editedById\")\n TxnActivityAuditDTO txnActivityAuditToTxnActivityAuditDTO(TxnActivityAudit txnActivityAudit);\n\n @Mapping(source = \"editedById\", target = \"editedBy\")\n TxnActivityAudit txnActivityAuditDTOToTxnActivityAudit(TxnActivityAuditDTO txnActivityAuditDTO);\n\n default Staff staffFromId(Long id) {\n if (id == null) {\n return null;\n }\n Staff staff = new Staff();\n staff.setId(id);\n return staff;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {NotificationTemplatesMapper.class})\npublic interface UserNotificationsMapper extends EntityMapper<UserNotificationsDTO, UserNotifications> {\n\n @Mapping(source = \"notificationTemplates.id\", target = \"notification_templatesId\")\n UserNotificationsDTO toDto(UserNotifications userNotifications);\n\n @Mapping(source = \"notification_templatesId\", target = \"notificationTemplates\")\n UserNotifications toEntity(UserNotificationsDTO userNotificationsDTO);\n\n default UserNotifications fromId(Long id) {\n if (id == null) {\n return null;\n }\n UserNotifications userNotifications = new UserNotifications();\n userNotifications.setId(id);\n return userNotifications;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface AtActivityStatusesMapper extends EntityMapper<AtActivityStatusesDTO, AtActivityStatuses> {\n\n\n\n default AtActivityStatuses fromId(Long id) {\n if (id == null) {\n return null;\n }\n AtActivityStatuses atActivityStatuses = new AtActivityStatuses();\n atActivityStatuses.setId(id);\n return atActivityStatuses;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {RoomExpenseSplitMapper.class})\npublic interface RoomExpenseSplitRecordMapper extends EntityMapper<RoomExpenseSplitRecordDTO, RoomExpenseSplitRecord> {\n\n @Mapping(source = \"split.id\", target = \"splitId\")\n RoomExpenseSplitRecordDTO toDto(RoomExpenseSplitRecord roomExpenseSplitRecord);\n\n @Mapping(source = \"splitId\", target = \"split\")\n RoomExpenseSplitRecord toEntity(RoomExpenseSplitRecordDTO roomExpenseSplitRecordDTO);\n\n default RoomExpenseSplitRecord fromId(Long id) {\n if (id == null) {\n return null;\n }\n RoomExpenseSplitRecord roomExpenseSplitRecord = new RoomExpenseSplitRecord();\n roomExpenseSplitRecord.setId(id);\n return roomExpenseSplitRecord;\n }\n}", "@Mapper\npublic interface ProjectMapper {\n\n ProjectMapper INSTANCE = Mappers.getMapper(ProjectMapper.class);\n\n Project toModel(ProjectDTO projectDTO);\n\n ProjectDTO toDTO(Project project);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TourBubblRoutePointMapper {\n\n @Mapping(source = \"tourBubbl.id\", target = \"tourBubblId\")\n TourBubblRoutePointDTO tourBubblRoutePointToTourBubblRoutePointDTO(TourBubblRoutePoint tourBubblRoutePoint);\n\n List<TourBubblRoutePointDTO> tourBubblRoutePointsToTourBubblRoutePointDTOs(List<TourBubblRoutePoint> tourBubblRoutePoints);\n\n @Mapping(source = \"tourBubblId\", target = \"tourBubbl\")\n TourBubblRoutePoint tourBubblRoutePointDTOToTourBubblRoutePoint(TourBubblRoutePointDTO tourBubblRoutePointDTO);\n\n List<TourBubblRoutePoint> tourBubblRoutePointDTOsToTourBubblRoutePoints(List<TourBubblRoutePointDTO> tourBubblRoutePointDTOs);\n\n default TourBubbl tourBubblFromId(Long id) {\n if (id == null) {\n return null;\n }\n TourBubbl tourBubbl = new TourBubbl();\n tourBubbl.setId(id);\n return tourBubbl;\n }\n}", "@Mapper(uses = {PassengerMapper.class, TicketScheduleSectionMapper.class})\npublic interface TicketMapper {\n\n /**\n * To dto ticket dto.\n *\n * @param ticketEntity the ticket entity\n * @return the ticket dto\n */\n @Mappings({\n @Mapping(target = \"passengerDto\", source = \"ticketEntity.passengerEntity\"),\n @Mapping(target = \"ticketScheduleSectionDtoList\", source = \"ticketEntity.ticketScheduleSectionEntityList\")\n })\n TicketDto toDto(TicketEntity ticketEntity);\n\n /**\n * To dto list list.\n *\n * @param ticketEntityList the ticket entity list\n * @return the list\n */\n List<TicketDto> toDtoList(List<TicketEntity> ticketEntityList);\n\n /**\n * To entity ticket entity.\n *\n * @param ticketDto the ticket dto\n * @return the ticket entity\n */\n @Mappings({\n\n @Mapping(target = \"passengerEntity\", source = \"ticketDto.passengerDto\"),\n @Mapping(target = \"ticketScheduleSectionEntityList\", source = \"ticketDto.ticketScheduleSectionDtoList\")\n })\n TicketEntity toEntity(TicketDto ticketDto);\n\n /**\n * To entity list list.\n *\n * @param ticketDtoList the ticket dto list\n * @return the list\n */\n List<TicketEntity> toEntityList(List<TicketDto> ticketDtoList);\n\n}", "@Mapper(componentModel = \"spring\", uses = {TipoDocumentoMapper.class, GeneroMapper.class, AseguradoraMapper.class, GrupoEtnicoMapper.class, RegimenMapper.class, MunicipioMapper.class, TipoResidenciaMapper.class})\npublic interface PacienteMapper extends EntityMapper<PacienteDTO, Paciente> {\n\n @Mapping(source = \"tipoDocumento.id\", target = \"tipoDocumentoId\")\n @Mapping(source = \"tipoDocumento.nombre\", target = \"tipoDocumentoNombre\")\n @Mapping(source = \"genero.id\", target = \"generoId\")\n @Mapping(source = \"genero.nombre\", target = \"generoNombre\")\n @Mapping(source = \"aseguradora.id\", target = \"aseguradoraId\")\n @Mapping(source = \"aseguradora.nombre\", target = \"aseguradoraNombre\")\n @Mapping(source = \"grupoEtnico.id\", target = \"grupoEtnicoId\")\n @Mapping(source = \"grupoEtnico.nombre\", target = \"grupoEtnicoNombre\")\n @Mapping(source = \"regimen.id\", target = \"regimenId\")\n @Mapping(source = \"regimen.nombre\", target = \"regimenNombre\")\n @Mapping(source = \"municipio.id\", target = \"municipioId\")\n @Mapping(source = \"municipio.nombre\", target = \"municipioNombre\")\n @Mapping(source = \"tipoResidencia.id\", target = \"tipoResidenciaId\")\n @Mapping(source = \"tipoResidencia.nombre\", target = \"tipoResidenciaNombre\")\n PacienteDTO toDto(Paciente paciente);\n\n @Mapping(target = \"aplicacions\", ignore = true)\n @Mapping(target = \"acudientes\", ignore = true)\n @Mapping(source = \"tipoDocumentoId\", target = \"tipoDocumento\")\n @Mapping(source = \"generoId\", target = \"genero\")\n @Mapping(source = \"aseguradoraId\", target = \"aseguradora\")\n @Mapping(source = \"grupoEtnicoId\", target = \"grupoEtnico\")\n @Mapping(source = \"regimenId\", target = \"regimen\")\n @Mapping(source = \"municipioId\", target = \"municipio\")\n @Mapping(source = \"tipoResidenciaId\", target = \"tipoResidencia\")\n Paciente toEntity(PacienteDTO pacienteDTO);\n\n default Paciente fromId(Long id) {\n if (id == null) {\n return null;\n }\n Paciente paciente = new Paciente();\n paciente.setId(id);\n return paciente;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {GovernorateMapper.class, DelegationMapper.class, UserMapper.class, })\npublic interface PolicyHolderMapper extends EntityMapper <PolicyHolderDTO, PolicyHolder> {\n\n @Mapping(source = \"governorate.id\", target = \"governorateId\")\n @Mapping(source = \"governorate.label\", target = \"governorateLabel\")\n\n @Mapping(source = \"delegation.id\", target = \"delegationId\")\n @Mapping(source = \"delegation.label\", target = \"delegationLabel\")\n\n @Mapping(source = \"creationUser.id\", target = \"creationUserId\")\n @Mapping(source = \"creationUser.login\", target = \"creationUserLogin\")\n\n @Mapping(source = \"updateUser.id\", target = \"updateUserId\")\n @Mapping(source = \"updateUser.login\", target = \"updateUserLogin\")\n PolicyHolderDTO toDto(PolicyHolder policyHolder); \n\n @Mapping(source = \"governorateId\", target = \"governorate\")\n\n @Mapping(source = \"delegationId\", target = \"delegation\")\n\n @Mapping(source = \"creationUserId\", target = \"creationUser\")\n\n @Mapping(source = \"updateUserId\", target = \"updateUser\")\n PolicyHolder toEntity(PolicyHolderDTO policyHolderDTO); \n default PolicyHolder fromId(Long id) {\n if (id == null) {\n return null;\n }\n PolicyHolder policyHolder = new PolicyHolder();\n policyHolder.setId(id);\n return policyHolder;\n }\n}", "@Mapper\npublic interface ReduceMapper {\n\n public void updateStatus(DataCollectionEntity bean);\n\n public DataCollectionEntity findById(DataCollectionEntity bean);\n\n\n public List<DataCollectionEntity> pageReduceApply(DataCollectionEntity bean);\n\n public List<DataCollectionEntity> pageReduceApplyExport(DataCollectionEntity bean);\n\n public List<DataCollectionEntity> totalExport(DataCollectionEntity bean);\n\n public void saveReduceApply(DataCollectionEntity bean);\n\n public void updateReduceApply(DataCollectionEntity bean);\n\n public void updateApplyStatus(DataCollectionEntity bean);\n\n}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, LanguageMapper.class })\npublic interface ProjectMapper {\n\n @Mapping(source = \"owner.id\", target = \"ownerId\")\n @Mapping(source = \"owner.login\", target = \"ownerName\")\n ProjectDTO projectToProjectDTO(Project project);\n\n List<ProjectDTO> projectsToProjectDTOs(List<Project> projects);\n\n @Mapping(target = \"releases\", ignore = true)\n @Mapping(source = \"ownerId\", target = \"owner\")\n Project projectDTOToProject(ProjectDTO projectDTO);\n\n List<Project> projectDTOsToProjects(List<ProjectDTO> projectDTOs);\n\n default Language languageFromId(Long id) {\n if (id == null) {\n return null;\n }\n Language language = new Language();\n language.setId(id);\n return language;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {SubjectMapper.class, ChapterMapper.class, TopicMapper.class, GradeMapper.class, UserInfoMapper.class})\npublic interface ContentMapper extends EntityMapper<ContentDTO, Content> {\n\n @Mapping(source = \"subject.id\", target = \"subjectId\")\n @Mapping(source = \"chapter.id\", target = \"chapterId\")\n @Mapping(source = \"topic.id\", target = \"topicId\")\n @Mapping(source = \"userInfo.id\", target = \"userInfoId\")\n ContentDTO toDto(Content content);\n\n @Mapping(source = \"subjectId\", target = \"subject\")\n @Mapping(source = \"chapterId\", target = \"chapter\")\n @Mapping(source = \"topicId\", target = \"topic\")\n @Mapping(target = \"contentLists\", ignore = true)\n @Mapping(target = \"contentreviews\", ignore = true)\n @Mapping(source = \"userInfoId\", target = \"userInfo\")\n Content toEntity(ContentDTO contentDTO);\n\n default Content fromId(Long id) {\n if (id == null) {\n return null;\n }\n Content content = new Content();\n content.setId(id);\n return content;\n }\n}", "@Mapper\r\npublic interface NotificationDao {\r\n\r\n int insert(NotificationDomain notification);\r\n\r\n // 修改状态\r\n int modifyStatus(@Param(\"nid\") Long nid);\r\n\r\n NotificationDomain getSelect(NotificationDomain notificationDomain);\r\n\r\n List<NotificationDto> getList(NotificationDomain notificationDomain);\r\n\r\n\r\n int getUnread(Integer receiver);\r\n\r\n\r\n}", "@Mapper\npublic interface ProjectMapper extends EntityMapper<ProjectDTO, Project> {\n\n // All methods are parameterized for EntityMapper\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockOutFrozenTubeMapper {\n\n @Mapping(source = \"stockOutFrozenBox.id\", target = \"stockOutFrozenBoxId\")\n @Mapping(source = \"frozenTube.id\", target = \"frozenTubeId\")\n StockOutFrozenTubeDTO stockOutFrozenTubeToStockOutFrozenTubeDTO(StockOutFrozenTube stockOutFrozenTube);\n\n List<StockOutFrozenTubeDTO> stockOutFrozenTubesToStockOutFrozenTubeDTOs(List<StockOutFrozenTube> stockOutFrozenTubes);\n\n @Mapping(source = \"stockOutFrozenBoxId\", target = \"stockOutFrozenBox\")\n @Mapping(source = \"frozenTubeId\", target = \"frozenTube\")\n StockOutFrozenTube stockOutFrozenTubeDTOToStockOutFrozenTube(StockOutFrozenTubeDTO stockOutFrozenTubeDTO);\n\n List<StockOutFrozenTube> stockOutFrozenTubeDTOsToStockOutFrozenTubes(List<StockOutFrozenTubeDTO> stockOutFrozenTubeDTOs);\n\n default StockOutFrozenBox stockOutFrozenBoxFromId(Long id) {\n if (id == null) {\n return null;\n }\n StockOutFrozenBox stockOutFrozenBox = new StockOutFrozenBox();\n stockOutFrozenBox.setId(id);\n return stockOutFrozenBox;\n }\n\n default FrozenTube frozenTubeFromId(Long id) {\n if (id == null) {\n return null;\n }\n FrozenTube frozenTube = new FrozenTube();\n frozenTube.setId(id);\n return frozenTube;\n }\n}", "public interface Mapper<T, T2> {\n\n /**\n * Sets the source object.\n *\n * @param source the source instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> from(T source);\n\n /**\n * Sets the target class.\n *\n * @param target the target class.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> to(Class<T2> target);\n\n /**\n * Sets an ignorable object with the ignorable fields for mapping operation.\n *\n * @param ignorable the ignorable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> ignoring(Ignorable ignorable);\n\n /**\n * Sets a customizable object with the fields for the explicit mapping.\n *\n * @param customizable the customizable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> relate(Customizable customizable);\n\n /**\n * Starts with the building target object\n *\n * @return a target object instance.\n */\n T2 build();\n\n}", "@Mapper(componentModel = \"spring\", uses = {ClientMapper.class, UserAppMapper.class, DistrictMapper.class})\npublic interface CampusMapper extends EntityMapper<CampusDTO, Campus> {\n\n @Mapping(source = \"client\", target = \"clientDto\")\n @Mapping(source = \"district\", target = \"districtDto\")\n CampusDTO toDto(Campus campus);\n\n @Mapping(source = \"clientDto\", target = \"client\")\n @Mapping(source = \"districtDto\", target = \"district\")\n @Mapping(target = \"fields\", ignore = true)\n Campus toEntity(CampusDTO campusDTO);\n\n default Campus fromId(Long id) {\n if (id == null) {\n return null;\n }\n Campus campus = new Campus();\n campus.setId(id);\n return campus;\n }\n}", "@Mapper(componentModel = \"spring\")\npublic interface WaitApportionMapper {\n /**\n * Entity to model app user info.\n *\n * @param waitApportionEntity\n * @return\n */\n @Mappings({\n\n })\n WaitApportion entityToModel(WaitApportionEntity waitApportionEntity);\n\n /**\n * Model to entity app user entity.\n *\n * @param waitApportion\n * @return\n */\n @Mappings({\n\n })\n WaitApportionEntity modelToEntity(WaitApportion waitApportion);\n\n /**\n * Entitiesto models list.\n *\n * @param waitApportionEntityList the app user entity\n * @return the list\n */\n List<WaitApportion> entitiestoModels(Iterable<WaitApportionEntity> waitApportionEntityList);\n\n /**\n * Modelsto entities list.\n *\n * @param waitApportionList the app user entity\n * @return the list\n */\n List<WaitApportionEntity> modelstoEntities(List<WaitApportion> waitApportionList);\n}", "@Mapper(uses = DateMapper.class)\npublic interface ExerciseMapper {\n\n // Autogenerated code will map exercise object to ExerciseDTO\n // @Mapping(source = \"firstName\", target = \"name\") can be used if the field names do not match.\n ExerciseDTO convertToExerciseDTO(Exercise exercise);\n\n Exercise convertToExercise(ExerciseDTO exerciseDTO);\n\n}", "public interface MovieMapper {\n\n public int insertMovie(Movie movie);\n\n public int updateMovie(Movie movie);\n\n public Movie getMovieById(int id);\n\n public int deleteMovie(int id);\n\n public List<Movie> getAllMovie();\n\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TarifLineMapper extends EntityMapper <TarifLineDTO, TarifLine> {\n \n \n default TarifLine fromId(Long id) {\n if (id == null) {\n return null;\n }\n TarifLine tarifLine = new TarifLine();\n tarifLine.setId(id);\n return tarifLine;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {UtilisateurMapper.class, DepotMapper.class})\npublic interface UtilisateurDepotPKMapper extends EntityMapper<UtilisateurDepotPKDTO, UtilisateurDepotPK> {\n\n @Mapping(source = \"utilisateur.id\", target = \"utilisateurId\")\n @Mapping(source = \"depot.id\", target = \"depotId\")\n UtilisateurDepotPKDTO toDto(UtilisateurDepotPK utilisateurDepotPK);\n\n @Mapping(source = \"utilisateurId\", target = \"utilisateur\")\n @Mapping(source = \"depotId\", target = \"depot\")\n UtilisateurDepotPK toEntity(UtilisateurDepotPKDTO utilisateurDepotPKDTO);\n\n default UtilisateurDepotPK fromId(Long id) {\n if (id == null) {\n return null;\n }\n UtilisateurDepotPK utilisateurDepotPK = new UtilisateurDepotPK();\n utilisateurDepotPK.setId(id);\n return utilisateurDepotPK;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {MatiereMapper.class})\npublic interface ClasseMapper extends EntityMapper<ClasseDTO, Classe> {\n\n\n @Mapping(target = \"professeurClasses\", ignore = true)\n Classe toEntity(ClasseDTO classeDTO);\n\n default Classe fromId(Long id) {\n if (id == null) {\n return null;\n }\n Classe classe = new Classe();\n classe.setId(id);\n return classe;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {UsuarioMapper.class, FileMapper.class})\npublic interface RateMapper extends EntityMapper<RateDTO, Rate> {\n\n @Mapping(source = \"usuario.id\", target = \"usuarioId\")\n @Mapping(source = \"file.id\", target = \"fileId\")\n RateDTO toDto(Rate rate); \n\n @Mapping(source = \"usuarioId\", target = \"usuario\")\n @Mapping(source = \"fileId\", target = \"file\")\n Rate toEntity(RateDTO rateDTO);\n\n default Rate fromId(Long id) {\n if (id == null) {\n return null;\n }\n Rate rate = new Rate();\n rate.setId(id);\n return rate;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {LectureMapper.class, CourseMapper.class, })\npublic interface CourseLectureMapper extends EntityMapper <CourseLectureDTO, CourseLecture> {\n\n @Mapping(source = \"lecture.idPartyRole\", target = \"lectureId\")\n @Mapping(source = \"lecture.name\", target = \"lectureName\")\n\n @Mapping(source = \"course.idCourse\", target = \"courseId\")\n @Mapping(source = \"course.description\", target = \"courseDescription\")\n CourseLectureDTO toDto(CourseLecture courseLecture); \n\n @Mapping(source = \"lectureId\", target = \"lecture\")\n\n @Mapping(source = \"courseId\", target = \"course\")\n CourseLecture toEntity(CourseLectureDTO courseLectureDTO); \n\n default CourseLecture fromId(UUID id) {\n if (id == null) {\n return null;\n }\n CourseLecture courseLecture = new CourseLecture();\n courseLecture.setIdCourseLecture(id);\n return courseLecture;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface WordOccurrencesMapper {\n \n /**\n * Instance of mapper\n */\n WordOccurrencesMapper INSTANCE =Mappers.getMapper(WordOccurrencesMapper.class);\n\n @Mapping(source = \"review.id\", target = \"reviewId\")\n WordOccurrencesDTO wordOccurrencesToWordOccurrencesDTO(WordOccurrences wordOccurrences);\n\n List<WordOccurrencesDTO> wordOccurrencesToWordOccurrencesDTOs(List<WordOccurrences> wordOccurrences);\n\n @Mapping(source = \"reviewId\", target = \"review\")\n WordOccurrences wordOccurrencesDTOToWordOccurrences(WordOccurrencesDTO wordOccurrencesDTO);\n\n List<WordOccurrences> wordOccurrencesDTOsToWordOccurrences(List<WordOccurrencesDTO> wordOccurrencesDTOs);\n\n default Review reviewFromId(Long id) {\n if (id == null) {\n return null;\n }\n Review review = new Review();\n review.setId(id);\n return review;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {EntryDataMapper.class})\npublic interface InvoiceLineMapper extends EntityMapper<InvoiceLineDTO, InvoiceLine> {\n\n @Mapping(source = \"entryData.id\", target = \"entryDataId\")\n InvoiceLineDTO toDto(InvoiceLine invoiceLine);\n\n @Mapping(source = \"entryDataId\", target = \"entryData\")\n @Mapping(target = \"attributes\", ignore = true)\n InvoiceLine toEntity(InvoiceLineDTO invoiceLineDTO);\n\n default InvoiceLine fromId(Long id) {\n if (id == null) {\n return null;\n }\n InvoiceLine invoiceLine = new InvoiceLine();\n invoiceLine.setId(id);\n return invoiceLine;\n }\n}", "public abstract M toModel(DTO dto);", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, CustomerMapper.class})\npublic interface WorkDayMapper extends EntityMapper<WorkDayDTO, WorkDay> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n @Mapping(source = \"customer.id\", target = \"customerId\")\n WorkDayDTO toDto(WorkDay workDay);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(source = \"customerId\", target = \"customer\")\n WorkDay toEntity(WorkDayDTO workDayDTO);\n\n default WorkDay fromId(Long id) {\n if (id == null) {\n return null;\n }\n WorkDay workDay = new WorkDay();\n workDay.setId(id);\n return workDay;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {OgWorkPlaceTypesMapper.class})\npublic interface OgWorkPlacesMapper extends EntityMapper<OgWorkPlacesDTO, OgWorkPlaces> {\n\n @Mapping(source = \"idParent.id\", target = \"idParentId\")\n @Mapping(source = \"idParent.name\", target = \"idParentName\")\n @Mapping(source = \"idWorkPlaceTypes.id\", target = \"idWorkPlaceTypesId\")\n @Mapping(source = \"idWorkPlaceTypes.name\", target = \"idWorkPlaceTypesName\")\n OgWorkPlacesDTO toDto(OgWorkPlaces ogWorkPlaces);\n\n @Mapping(source = \"idParentId\", target = \"idParent\")\n @Mapping(source = \"idWorkPlaceTypesId\", target = \"idWorkPlaceTypes\")\n OgWorkPlaces toEntity(OgWorkPlacesDTO ogWorkPlacesDTO);\n\n default OgWorkPlaces fromId(Long id) {\n if (id == null) {\n return null;\n }\n OgWorkPlaces ogWorkPlaces = new OgWorkPlaces();\n ogWorkPlaces.setId(id);\n return ogWorkPlaces;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ProvinciaMapper.class})\npublic interface CodigoPostalMapper extends EntityMapper<CodigoPostalDTO, CodigoPostal> {\n\n @Mapping(source = \"provincia.id\", target = \"provinciaId\")\n @Mapping(source = \"provincia.nombreProvincia\", target = \"provinciaNombreProvincia\")\n CodigoPostalDTO toDto(CodigoPostal codigoPostal);\n\n @Mapping(source = \"provinciaId\", target = \"provincia\")\n CodigoPostal toEntity(CodigoPostalDTO codigoPostalDTO);\n\n default CodigoPostal fromId(Long id) {\n if (id == null) {\n return null;\n }\n CodigoPostal codigoPostal = new CodigoPostal();\n codigoPostal.setId(id);\n return codigoPostal;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ProduitMapper.class, AchatLigneProformaMapper.class})\npublic interface AchatArticleLigneProformaMapper extends EntityMapper<AchatArticleLigneProformaDTO, AchatArticleLigneProforma> {\n\n @Mapping(source = \"produit.id\", target = \"produitId\")\n @Mapping(source = \"achatLigneProforma.id\", target = \"achatLigneProformaId\")\n AchatArticleLigneProformaDTO toDto(AchatArticleLigneProforma achatArticleLigneProforma);\n\n @Mapping(source = \"produitId\", target = \"produit\")\n @Mapping(source = \"achatLigneProformaId\", target = \"achatLigneProforma\")\n AchatArticleLigneProforma toEntity(AchatArticleLigneProformaDTO achatArticleLigneProformaDTO);\n\n default AchatArticleLigneProforma fromId(Long id) {\n if (id == null) {\n return null;\n }\n AchatArticleLigneProforma achatArticleLigneProforma = new AchatArticleLigneProforma();\n achatArticleLigneProforma.setId(id);\n return achatArticleLigneProforma;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {TravauxMapper.class, ChantierMapper.class, EmployeMapper.class})\npublic interface AffectationMapper extends EntityMapper<AffectationDTO, Affectation> {\n\n @Mapping(source = \"travaux.id\", target = \"travauxId\")\n @Mapping(source = \"travaux.nomTrav\", target = \"travauxNomTrav\")\n @Mapping(source = \"chantier.id\", target = \"chantierId\")\n @Mapping(source = \"chantier.nomChantier\", target = \"chantierNomChantier\")\n AffectationDTO toDto(Affectation affectation);\n\n @Mapping(source = \"travauxId\", target = \"travaux\")\n @Mapping(source = \"chantierId\", target = \"chantier\")\n Affectation toEntity(AffectationDTO affectationDTO);\n\n default Affectation fromId(Long id) {\n if (id == null) {\n return null;\n }\n Affectation affectation = new Affectation();\n affectation.setId(id);\n return affectation;\n }\n}", "public PickPermitTileBonusAction map(PickPermitTileActionDTO pickPermitTileActionDTO);", "public interface QuestionLabelMapper {\n\n Integer createQuestionLabel(QuestionLabelEntity questionLabelEntity);\n\n Integer updateQuestionLabel(QuestionLabelEntity questionLabelEntity);\n\n QuestionLabelEntity getQuestionLabelById(@Param(\"id\") Integer id);\n\n /**\n * 获取题库的标签列表\n * */\n List<QuestionLabelEntity> getQuestionLabelsByLibrary(@Param(\"libraryId\") Integer libraryId,@Param(\"name\") String name);\n\n /**\n * 获取题库的标签列表\n * */\n List<QuestionLabelEntity> getQuestionLabelsByLibraryId(@Param(\"libraryId\") Integer libraryId);\n\n String getLabelNameById(@Param(\"id\") Integer id);\n\n /**\n * 批量删除\n * */\n Integer batchSafeDelete(@Param(\"labelIds\") List<Integer> labelIds);\n\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface PermissionCategoryMapper {\n\n PermissionCategoryDTO permissionCategoryToPermissionCategoryDTO(PermissionCategory permissionCategory);\n\n List<PermissionCategoryDTO> permissionCategoriesToPermissionCategoryDTOs(List<PermissionCategory> permissionCategories);\n\n PermissionCategory permissionCategoryDTOToPermissionCategory(PermissionCategoryDTO permissionCategoryDTO);\n\n List<PermissionCategory> permissionCategoryDTOsToPermissionCategories(List<PermissionCategoryDTO> permissionCategoryDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {ProOrderMapper.class})\r\npublic interface ProOrderItemMapper extends EntityMapper<ProOrderItemDTO, ProOrderItem> {\r\n\r\n @Mapping(source = \"proOrder.id\", target = \"proOrderId\")\r\n ProOrderItemDTO toDto(ProOrderItem proOrderItem);\r\n\r\n @Mapping(source = \"proOrderId\", target = \"proOrder\")\r\n ProOrderItem toEntity(ProOrderItemDTO proOrderItemDTO);\r\n\r\n default ProOrderItem fromId(Long id) {\r\n if (id == null) {\r\n return null;\r\n }\r\n ProOrderItem proOrderItem = new ProOrderItem();\r\n proOrderItem.setId(id);\r\n return proOrderItem;\r\n }\r\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OrganisationTypeMapper extends EntityMapper<OrganisationTypeDTO, OrganisationType> {\n\n\n @Mapping(target = \"organisations\", ignore = true)\n OrganisationType toEntity(OrganisationTypeDTO organisationTypeDTO);\n\n default OrganisationType fromId(Long id) {\n if (id == null) {\n return null;\n }\n OrganisationType organisationType = new OrganisationType();\n organisationType.setId(id);\n return organisationType;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface PerformerMapper extends EntityMapper<PerformerDTO, Performer> {\n\n\n\n default Performer fromId(Long id) {\n if (id == null) {\n return null;\n }\n Performer performer = new Performer();\n performer.setId(id);\n return performer;\n }\n}", "@Mapper\npublic interface SeguridadDtoMap {\n SeguridadDtoMap INSTANCE = Mappers.getMapper( SeguridadDtoMap.class );\n\n GrupoDto grupoToGrupoDto(Grupo grupo);\n\n Grupo grupoDtoToGrupo(GrupoDto grupoDto);\n}", "@Mapper(componentModel = \"spring\")\npublic interface DataDictItemMapping {\n DataDictItemVo asDataDictItemVo(DataDictItem entity);\n\n DataDictItemOrdinaryVo asOrdinary(DataDictItem entity);\n\n @Mapping(target = \"priority\", ignore = true)\n @Mapping(target = \"lastUpdater\", ignore = true)\n @Mapping(target = \"lastUpdatedAt\", ignore = true)\n @Mapping(target = \"id\", ignore = true)\n @Mapping(target = \"dictId\", ignore = true)\n @Mapping(target = \"creator\", ignore = true)\n @Mapping(target = \"createdAt\", ignore = true)\n DataDictItem asDataDictItem(DataDictItemInsertRo ro);\n\n DataDictItemComplexVo asComplex(DataDictItem entity);\n\n DataDictItem asDataDictItem(DataDictItemUpdateRo ro);\n}", "public interface MowerMapper {\n\n public List<Mower> mapMowerDtoListToMowerEntityList(final List<MowerRequestJsonDto> mowerRequestJsonDto);\n\n public Mower mapMowerDtoToMowerEntity(final MowerRequestJsonDto mowerRequestJsonDto);\n}", "@Mapper(componentModel = \"cdi\")\npublic interface ArchivoMapper {\n\n ArchivoDTO toDTO(Archivo source);\n List<ArchivoDTO> toDTOList(List<Archivo> sourceList);\n\n void updateFromDTO(ArchivoDTO source, @MappingTarget Archivo target);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TerminalMapper extends EntityMapper<TerminalDTO, Terminal> {\n\n\n\n default Terminal fromId(Long id) {\n if (id == null) {\n return null;\n }\n Terminal terminal = new Terminal();\n terminal.setId(id);\n return terminal;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {OrderPreparationMapper.class})\npublic interface StateMapper extends EntityMapper<StateDTO, State> {\n\n @Mapping(source = \"orderPreparation.id\", target = \"orderPreparationId\")\n StateDTO toDto(State state);\n\n @Mapping(source = \"orderPreparationId\", target = \"orderPreparation\")\n State toEntity(StateDTO stateDTO);\n\n default State fromId(Long id) {\n if (id == null) {\n return null;\n }\n State state = new State();\n state.setId(id);\n return state;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ExerciseFamilyMapper {\n\n ExerciseFamilyDTO exerciseFamilyToExerciseFamilyDTO(ExerciseFamily exerciseFamily);\n\n List<ExerciseFamilyDTO> exerciseFamiliesToExerciseFamilyDTOs(List<ExerciseFamily> exerciseFamilies);\n\n @Mapping(target = \"exercises\", ignore = true)\n ExerciseFamily exerciseFamilyDTOToExerciseFamily(ExerciseFamilyDTO exerciseFamilyDTO);\n\n List<ExerciseFamily> exerciseFamilyDTOsToExerciseFamilies(List<ExerciseFamilyDTO> exerciseFamilyDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface UserMessageAccountMapper extends EntityMapper<UserMessageAccountDTO, UserMessageAccount> {\n\n \n\n @Mapping(target = \"jobs\", ignore = true)\n UserMessageAccount toEntity(UserMessageAccountDTO userMessageAccountDTO);\n\n default UserMessageAccount fromId(Long id) {\n if (id == null) {\n return null;\n }\n UserMessageAccount userMessageAccount = new UserMessageAccount();\n userMessageAccount.setId(id);\n return userMessageAccount;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockInMapper {\n\n @Mapping(source = \"tranship.id\", target = \"transhipId\")\n @Mapping(source = \"project.id\", target = \"projectId\")\n @Mapping(source = \"projectSite.id\", target = \"projectSiteId\")\n StockInDTO stockInToStockInDTO(StockIn stockIn);\n\n List<StockInDTO> stockInsToStockInDTOs(List<StockIn> stockIns);\n\n @Mapping(source = \"transhipId\", target = \"tranship\")\n @Mapping(source = \"projectId\", target = \"project\")\n @Mapping(source = \"projectSiteId\", target = \"projectSite\")\n StockIn stockInDTOToStockIn(StockInDTO stockInDTO);\n\n List<StockIn> stockInDTOsToStockIns(List<StockInDTO> stockInDTOS);\n\n default Tranship transhipFromId(Long id) {\n if (id == null) {\n return null;\n }\n Tranship tranship = new Tranship();\n tranship.setId(id);\n return tranship;\n }\n\n default Project projectFromId(Long id) {\n if (id == null) {\n return null;\n }\n Project project = new Project();\n project.setId(id);\n return project;\n }\n\n default ProjectSite projectSiteFromId(Long id) {\n if (id == null) {\n return null;\n }\n ProjectSite projectSite = new ProjectSite();\n projectSite.setId(id);\n return projectSite;\n }\n\n default List<StockInForDataTable> stockInsToStockInTables(List<StockIn> stockIns){\n if ( stockIns == null ) {\n return null;\n }\n\n List<StockInForDataTable> list = new ArrayList<StockInForDataTable>();\n for ( StockIn stockIn : stockIns ) {\n list.add( stockInToStockInTable( stockIn ) );\n }\n\n return list;\n }\n\n default StockInForDataTable stockInToStockInTable(StockIn stockIn){\n if ( stockIn == null ) {\n return null;\n }\n\n StockInForDataTable stockInTable = new StockInForDataTable();\n\n stockInTable.setId( stockIn.getId() );\n stockInTable.setProjectCode( stockIn.getProjectCode() );\n stockInTable.setProjectSiteCode( stockIn.getProjectSiteCode() );\n stockInTable.setStoreKeeper1( stockIn.getStoreKeeper1() );\n stockInTable.setStoreKeeper2( stockIn.getStoreKeeper2() );\n stockInTable.setStockInDate( stockIn.getStockInDate() );\n stockInTable.setCountOfSample( stockIn.getCountOfSample() );\n stockInTable.setStatus( stockIn.getStatus() );\n stockInTable.setTranshipCode(stockIn.getTranship().getTranshipCode());\n stockInTable.setCountOfBox(stockIn.getTranship().getFrozenBoxNumber());\n stockInTable.setRecordDate(stockIn.getTranship().getReceiveDate());\n stockInTable.setStockInCode(stockIn.getStockInCode());\n return stockInTable;\n }\n\n default StockInForDataDetail stockInToStockInDetail(StockIn stockIn){\n if ( stockIn == null ) {\n return null;\n }\n\n StockInForDataDetail stockInDetail = new StockInForDataDetail();\n\n stockInDetail.setId( stockIn.getId() );\n stockInDetail.setProjectId(stockIn.getProject()!=null?stockIn.getProject().getId():null);\n stockInDetail.setProjectCode( stockIn.getProjectCode() );\n stockInDetail.setProjectSiteId(stockIn.getProjectSite()!=null?stockIn.getProjectSite().getId():null);\n stockInDetail.setProjectSiteCode( stockIn.getProjectSiteCode() );\n stockInDetail.setStoreKeeper1( stockIn.getStoreKeeper1() );\n stockInDetail.setStoreKeeper2( stockIn.getStoreKeeper2() );\n stockInDetail.setStockInDate( stockIn.getStockInDate() );\n stockInDetail.setStatus( stockIn.getStatus() );\n stockInDetail.setTranshipCode(stockIn.getTranship()!=null?stockIn.getTranship().getTranshipCode():null);\n stockInDetail.setReceiveDate(stockIn.getReceiveDate());\n stockInDetail.setStockInCode(stockIn.getStockInCode());\n stockInDetail.setReceiver(stockIn.getReceiveName());\n stockInDetail.setMemo(stockIn.getMemo());\n return stockInDetail;\n }\n}", "@Mapper\n@Qualifier(\"taskMapper\")\npublic interface TaskMapper {\n\n void insertTask(@Param(\"task\") Task task);\n\n void updateTask(@Param(\"task\") Task task);\n\n void updateTaskSprint(@Param(\"id\") Long id, @Param(\"sprintId\") long sprintId);\n\n void updateTasksSprint(@Param(\"idList\") List<Long> idList, @Param(\"sprintId\") long sprintId);\n\n Task getTaskById(@Param(\"id\") long id);\n\n List<Task> getTasksForProject(@Param(\"projectId\") long projectId, @Param(\"offset\") int offset, @Param(\"limit\") Integer limit);\n\n List<Task> getTasksForContributor(@Param(\"contributorId\") long contributorId, @Param(\"offset\") int offset, @Param(\"limit\") int limit);\n\n List<Task> getTasksForUser(@Param(\"userId\") long userId, @Param(\"offset\") int offset, @Param(\"limit\") int limit);\n\n List<Task> getTasksForSprint(@Param(\"sprintId\") long sprintId, @Param(\"offset\") int offset, @Param(\"limit\") Integer limit);\n\n Integer countUserTasks(@Param(\"userId\") long userId);\n\n Integer countContributorTasks(@Param(\"ctrId\") long ctrId);\n\n Integer countSprintTasks(@Param(\"spId\") long spId);\n\n void deleteProjectTasks(@Param(\"projectId\") long projectId);\n\n void deleteTask(@Param(\"id\") long id);\n\n @Delete(\"DELETE FROM task\")\n void deleteTasks();\n\n}", "@Mapper\npublic interface ManageVOMapper {\n void addManage(ManageVO vo);\n\n List<ManageVO> getAll();\n\n List<ManageVO> getMyManage(Long id);\n\n void addMyManage(@Param(\"proId\") String proId,@Param(\"id\") Long id);\n\n void removeByUser(Long id);\n}", "@Mapper\npublic interface JorugiBoardMapper {\n List<JorugiBoard> getJorugiBoardList();\n}", "@Mapper(componentModel = \"spring\", uses = {ProvinceMapper.class})\npublic interface CommuneMapper extends EntityMapper<CommuneDTO, Commune> {\n\n @Mapping(source = \"province.id\", target = \"provinceId\")\n CommuneDTO toDto(Commune commune);\n\n @Mapping(target = \"villageSecteurs\", ignore = true)\n @Mapping(target = \"cebs\", ignore = true)\n @Mapping(source = \"provinceId\", target = \"province\")\n Commune toEntity(CommuneDTO communeDTO);\n\n default Commune fromId(Long id) {\n if (id == null) {\n return null;\n }\n Commune commune = new Commune();\n commune.setId(id);\n return commune;\n }\n}", "@Mapper\npublic interface MenuMapper extends MyMapper<Menu> {\n\n /**\n * 根据条件查询菜单\n *\n */\n List<Map<String, Object>> selectMenus(@Param(\"condition\") String condition, @Param(\"level\") String level);\n\n /**\n * 根据条件查询菜单\n *\n */\n List<Integer> getMenuIdsByRoleId(@Param(\"roleId\") Integer roleId);\n\n /**\n * 获取菜单列表树\n *\n */\n List<ZTreeNode> menuTreeList();\n\n /**\n * 获取菜单列表树\n *\n */\n List<ZTreeNode> menuTreeListByMenuIds(List<Integer> menuIds);\n\n /**\n * 删除menu关联的relation\n *\n */\n int deleteRelationByMenu(Integer menuId);\n\n /**\n * 获取资源url通过角色id\n *\n */\n List<String> getResUrlsByRoleId(Integer roleId);\n\n /**\n * 根据角色获取菜单\n *\n */\n List<MenuNode> getMenusByRoleIds(List<Integer> roleIds);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TypeCentreCompositionMapper extends EntityMapper<TypeCentreCompositionDTO, TypeCentreComposition> {\n\n\n @Mapping(target = \"centreCompositions\", ignore = true)\n TypeCentreComposition toEntity(TypeCentreCompositionDTO typeCentreCompositionDTO);\n\n default TypeCentreComposition fromId(Long id) {\n if (id == null) {\n return null;\n }\n TypeCentreComposition typeCentreComposition = new TypeCentreComposition();\n typeCentreComposition.setId(id);\n return typeCentreComposition;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface AlterationDisplayTypeMapper {\n\n AlterationDisplayTypeDTO alterationDisplayTypeToAlterationDisplayTypeDTO(AlterationDisplayType alterationDisplayType);\n\n List<AlterationDisplayTypeDTO> alterationDisplayTypesToAlterationDisplayTypeDTOs(List<AlterationDisplayType> alterationDisplayTypes);\n\n @Mapping(target = \"alterations\", ignore = true)\n AlterationDisplayType alterationDisplayTypeDTOToAlterationDisplayType(AlterationDisplayTypeDTO alterationDisplayTypeDTO);\n\n List<AlterationDisplayType> alterationDisplayTypeDTOsToAlterationDisplayTypes(List<AlterationDisplayTypeDTO> alterationDisplayTypeDTOs);\n}", "@Mapper\npublic interface ShippmentDtoBoMapper {\n\n\tpublic ShippmentDto mapBoToDto(ShippmentBo shippmentBo);\n\n\n\n\tpublic ShippmentBo mapDtoToBo(ShippmentDto shippmentDto);\n}", "@Mapper\npublic interface ProjectAchievementsMapper {\n\n int deleteByPrimaryKey(String projectNum);\n int insert(ProjectAchievements record);\n int insertSelective(ProjectAchievements record);\n ProjectAchievements selectByPrimaryKey(String projectNum);\n int updateByPrimaryKeySelective(ProjectAchievements record);\n int updateByPrimaryKey(ProjectAchievements record);\n void delete();\n List<ProjectAchievements> selectProject(ProjectAchievements projectAchievements, RowBounds row);\n int selectCountProject(ProjectAchievements projectAchievements);\n List<ProjectAchievements> selectProject(ProjectAchievements projectAchievements);\n}", "@Mapper(componentModel = \"spring\", uses = {LessonMapper.class})\npublic interface CourseMapper extends EntityMapper<CourseDTO, Course> {\n\n\n @Mapping(target = \"resources\", ignore = true)\n @Mapping(target = \"programs\", ignore = true)\n Course toEntity(CourseDTO courseDTO);\n\n default Course fromId(Long id) {\n if (id == null) {\n return null;\n }\n Course course = new Course();\n course.setId(id);\n return course;\n }\n}", "@Repository\npublic interface ItemMapper extends Mapper<Item> {\n\n\n}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, })\npublic interface PeopleMapper extends EntityMapper <PeopleDTO, People> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.firstName\", target = \"userFirstName\")\n @Mapping(source = \"user.lastName\", target = \"userLastName\")\n PeopleDTO toDto(People people);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(target = \"seminarsPresenteds\", ignore = true)\n @Mapping(target = \"seminarsAttendeds\", ignore = true)\n @Mapping(target = \"specialGuestAts\", ignore = true)\n People toEntity(PeopleDTO peopleDTO);\n default People fromId(Long id) {\n if (id == null) {\n return null;\n }\n People people = new People();\n people.setId(id);\n return people;\n }\n\n default String peopleName(People people) {\n String name = \"\";\n if (people == null) {\n return null;\n }\n if (people.getUser() == null) {\n return null;\n }\n String firstName = people.getUser().getFirstName();\n if (firstName != null) {\n name += firstName;\n }\n String lastName = people.getUser().getLastName();\n if (lastName != null) {\n name += \" \" + lastName;\n }\n return name;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OTHERMapper extends EntityMapper<OTHERDTO, OTHER> {\n\n\n\n default OTHER fromId(Long id) {\n if (id == null) {\n return null;\n }\n OTHER oTHER = new OTHER();\n oTHER.setId(id);\n return oTHER;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {OrgaoMapper.class, PermissaoMapper.class})\npublic interface UsuarioMapper {\n\n @Mapping(target = \"orgao\", ignore = true)\n UsuarioDTO usuarioToUsuarioDTO(Usuario usuario);\n\n List<UsuarioDTO> usuariosToUsuarioDTOs(List<Usuario> usuarios);\n\n Usuario usuarioDTOToUsuario(UsuarioDTO usuarioDTO);\n\n List<Usuario> usuarioDTOsToUsuarios(List<UsuarioDTO> usuarioDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {PlaqueMapper.class})\npublic interface PlaqueRuleMapper extends EntityMapper<PlaqueRuleDTO, PlaqueRule> {\n\n @Mapping(source = \"plaque.id\", target = \"plaqueId\")\n @Mapping(source = \"plaque.title\", target = \"plaqueTitle\")\n PlaqueRuleDTO toDto(PlaqueRule plaqueRule);\n\n @Mapping(source = \"plaqueId\", target = \"plaque\")\n PlaqueRule toEntity(PlaqueRuleDTO plaqueRuleDTO);\n\n default PlaqueRule fromId(Long id) {\n if (id == null) {\n return null;\n }\n PlaqueRule plaqueRule = new PlaqueRule();\n plaqueRule.setId(id);\n return plaqueRule;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ConsumerMapper.class, TransactionTypeMapper.class, })\npublic interface TransactionMapper extends EntityMapper <TransactionDTO, Transaction> {\n\n TransactionDTO toDto(Transaction transaction); \n\n Transaction toEntity(TransactionDTO transactionDTO); \n default Transaction fromId(Long id) {\n if (id == null) {\n return null;\n }\n Transaction transaction = new Transaction();\n transaction.setId(id);\n return transaction;\n }\n}", "@Mapper\npublic interface WorkGroupMapper extends BaseMapper<WorkGroup> {\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TarifMapper extends EntityMapper <TarifDTO, Tarif> {\n \n \n default Tarif fromId(Long id) {\n if (id == null) {\n return null;\n }\n Tarif tarif = new Tarif();\n tarif.setId(id);\n return tarif;\n }\n}", "@Mapper\npublic interface ArticleMapper extends BaseMapper<Article> {\n}", "@Mapper\npublic interface RecruitMapper {\n\n /**\n * 根据招募表主键ID查询\n * @param id\n * @return\n */\n public Recruit getRecruitById(String id);\n\n /**\n * 根据商家ID查询对应招募信息\n * @param owner\n * @return\n */\n public List<Recruit> getRecruitListByOwner(String owner);\n\n public int insertRecruit(Recruit recruit);\n\n public int updateRecruit(Recruit recruit);\n}", "@Mapper(componentModel = \"spring\", uses = {AppMenuMapper.class, AppGroupMapper.class})\npublic interface AppAppsMapper extends EntityMapper<AppAppsDTO, AppApps> {\n\n @Mapping(source = \"menu.id\", target = \"menuId\")\n @Mapping(source = \"group.id\", target = \"groupId\")\n AppAppsDTO toDto(AppApps appApps); \n\n @Mapping(source = \"menuId\", target = \"menu\")\n @Mapping(source = \"groupId\", target = \"group\")\n AppApps toEntity(AppAppsDTO appAppsDTO);\n\n default AppApps fromId(Long id) {\n if (id == null) {\n return null;\n }\n AppApps appApps = new AppApps();\n appApps.setId(id);\n return appApps;\n }\n}", "public abstract DTO toDTO(M model);", "@Repository\npublic interface ActorMapper {\n /**\n *@description 删除角色\n *@author fangjiang\n *@date 2018/3/27 15:45\n */\n\n Integer deleteActor(List<String> list);\n\n /**\n *@description 新增角色\n *@author fangjiang\n *@date 2018/3/27 15:46\n */\n\n Integer insertActor(Actor actor);\n\n /**\n *@description 查询角色分页数据\n *@author fangjiang\n *@date 2018/3/27 15:48\n */\n\n List<Actor> findActorByPage(Map<String,String> paraMap);\n\n /**\n *@description 更改角色信息\n *@author fangjiang\n *@date 2018/3/27 15:49\n */\n\n Integer updateActor(Actor actor);\n\n /**\n *@description 根据ID查找角色信息\n *@author fangjiang\n *@date 2018/3/27 15:50\n */\n\n Actor findActorById(String id);\n}", "public ChangePermitTiles map(ChangePermitTilesDTO selectedActionDTO);", "@Bean\n public ModelMapper modelMapper() {\n ModelMapper mapper = new ModelMapper();\n\n mapper.addMappings(new PropertyMap<Permit, PermitDto>() {\n @Override\n protected void configure() {\n Converter<List<Code>, List<Integer>> codeConverter = mappingContext -> {\n List<Integer> result = new ArrayList<>();\n mappingContext.getSource().forEach(code -> result.add(code.getId()));\n return result;\n };\n\n using(codeConverter).map(source.getCodes()).setCodeIds(null);\n }\n });\n return mapper;\n }", "@Mapper(componentModel = \"spring\", uses = {ArchiveMapper.class, })\npublic interface IndependentCandidateMapper extends EntityMapper <IndependentCandidateDTO, IndependentCandidate> {\n\n @Mapping(source = \"image.id\", target = \"imageId\")\n IndependentCandidateDTO toDto(IndependentCandidate independentCandidate); \n\n @Mapping(source = \"imageId\", target = \"image\")\n IndependentCandidate toEntity(IndependentCandidateDTO independentCandidateDTO); \n default IndependentCandidate fromId(Long id) {\n if (id == null) {\n return null;\n }\n IndependentCandidate independentCandidate = new IndependentCandidate();\n independentCandidate.setId(id);\n return independentCandidate;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ResourceMapper {\n\n ResourceDTO resourceToResourceDTO(Resource resource);\n\n Set<ResourceDTO> resourcesToResourceDTOs(Set<Resource> resources);\n\n default Resource resourceDTOToResource(ResourceDTO resourceDTO, Authority auth) {\n \tResource res = new Resource();\n res.setId(resourceDTO.getId());\n res.setName(resourceDTO.getName());\n res.setPermission(resourceDTO.getPermission());\n res.setAuthority(auth);\n\n return res;\n }\n\n default Set<Resource> resoursesFromResourceDTOs(Set<ResourceDTO> resourceDTOs, Authority auth) {\n return resourceDTOs.stream().map(resourceDTO -> {\n return resourceDTOToResource(resourceDTO, auth);\n }).collect(Collectors.toSet());\n }\n}", "public interface ActivityStatusMapper\n{\n\t//查询所有活动状态\n\tList<ActivityStatus> listAll();\n\t//修改活动状态\n\tpublic void updateStaus(ActivityStatus activityStatus);\n\n\t//根据期数查询状态\n\tpublic String queryByPeriod(String persion);\n\t//根据id查询\n\tpublic ActivityStatus queryById(String id);\n\n}", "@Mapper(componentModel = \"spring\", uses = {ArquivoAnexoMapper.class})\npublic interface ProcessoAnexoMapper{\n\n ProcessoAnexoDTO processoAnexoToProcessoAnexoDTO(ProcessoAnexo processoAnexo);\n\n List<ProcessoAnexoDTO> processoAnexosToProcessoAnexoDTOs(List<ProcessoAnexo> processoAnexos);\n\n @Mapping(target = \"processo\", ignore = true)\n ProcessoAnexo processoAnexoDTOToProcessoAnexo(ProcessoAnexoDTO processoAnexoDTO);\n\n List<ProcessoAnexo> processoAnexoDTOsToProcessoAnexos(List<ProcessoAnexoDTO> processoAnexoDTOs);\n\n\n}", "@Mapper\r\npublic interface GridMapper {\r\n int addGrid(Map gridMap);\r\n\r\n int updateGrid(Map gridMap);\r\n\r\n int deleteGrid(Map gridMap);\r\n\r\n List listGrid(Map gridMap);\r\n\r\n Map getGrid(Map idMap);\r\n\r\n List allGridByType(Map map);\r\n\r\n int countGrid();\r\n int countGridByUser(Map map);\r\n\r\n List getTopImage();\r\n}", "@Mapper(componentModel = \"spring\")\npublic interface PedidoMapper {\n\t\n\t@AfterMapping\n\tdefault void afterMapping(@MappingTarget PedidoDTO target, Pedido source) {\n\t\t\n\t\tFloat totalIVA = new Float(0);\n\t\tFloat totalDomicilio = new Float(0);\n\t\tFloat totalNeto = new Float(0);\n\t\t\n\t\tif(source.getEstado().equals(Constantes.ESTADO_PEDIDO_ACTIVO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEIDIDO_ACTIVO_STRING);\n\t\t\ttotalIVA = new Float(target.getSubtotal() * 0.19);\n\t\t\ttotalDomicilio = target.getSubtotal() >= Constantes.VALOR_MINIMO_PARA_COBRO_DE_DOMICILIO && target.getSubtotal() <= Constantes.VALOR_MAXIMO_PARA_COBRO_DE_DOMICILIO ? new Float(target.getSubtotal() * 0.05) : new Float(0);\n\t\t\ttotalNeto = target.getSubtotal() + totalIVA + totalDomicilio;\n\t\t}\n\t\telse if (source.getEstado().equals(Constantes.ESTADO_PEDIDO_CANCELADO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEDIDO_CANCELADO_STRING);\n\t\t\ttotalNeto = new Float(target.getSubtotal() * 0.10);\n\t\t}\t\t \n\t\t\n\t\t\n\t\ttarget.setTotalIVA(totalIVA);\n\t\ttarget.setTotalDomicilio(totalDomicilio);\n\t\ttarget.setTotalNeto(totalNeto);\n\t}\n\t\n\t@Mapping(source = \"entity.idUsuario.idUsuario\", target = \"idUsuario\")\n\t@Mapping(source = \"entity.idUsuario.nombre\", target = \"nombreUsuario\")\n\t@Mapping(source = \"entity.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"entity.estado\", target = \"estado\")\n\t@Mapping(target = \"idProductosConcatenados\", ignore = true)\n\t@Mapping(target = \"totalIVA\", ignore = true)\n\t@Mapping(target = \"totalDomicilio\", ignore = true)\n\t@Mapping(target = \"totalNeto\", ignore = true)\n\t@Mapping(target = \"codigoRespuesta\", ignore = true)\n\t@Mapping(target = \"mensajeRespuesta\", ignore = true)\n\t@Mapping(target = \"estadoString\", ignore = true)\n\tpublic PedidoDTO transformEntityToDTO(Pedido entity);\n\t\n\t@Mapping(source = \"DTO.idUsuario\", target = \"idUsuario.idUsuario\")\n\t@Mapping(source = \"DTO.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"DTO.estado\", target = \"estado\")\n\tpublic Pedido transformDTOToEntity(PedidoDTO DTO);\n\t\n\tpublic List<PedidoDTO> transformEntitiesToDTO(List<Pedido> listEntities);\n\t\n\tpublic List<Pedido> transformDTOToEntities(List<Pedido> listDTO);\n\n}", "@Mapper\r\n@Component\r\npublic interface UacRoleMenuMapper extends MyMapper<UacRoleMenu> {\r\n\t/**\r\n\t * Count child menu num list.\r\n\t *\r\n\t * @param roleId the role id\r\n\t *\r\n\t * @return the list\r\n\t */\r\n\tList<MenuCountVo> countChildMenuNum(Long roleId);\r\n\r\n\t/**\r\n\t * Add role menu list int.\r\n\t *\r\n\t * @param addUacRoleMenuList the add uac role menu list\r\n\t *\r\n\t * @return the int\r\n\t */\r\n\tint addRoleMenuList(List<UacRoleMenu> addUacRoleMenuList);\r\n\r\n\r\n\t/**\r\n\t * Delete by role id list int.\r\n\t *\r\n\t * @param roleIdList the role id list\r\n\t *\r\n\t * @return the int\r\n\t */\r\n\tint deleteByRoleIdList(@Param(\"roleIdList\") List<Long> roleIdList);\r\n}", "@Mapper\npublic interface GridMapper {\n int addGrid(Map gridMap);\n\n int updateGrid(Map gridMap);\n\n int deleteGrid(Map gridMap);\n\n List listGrid(Map gridMap);\n\n Map getGrid(Map idMap);\n\n List allGridByType(Map map);\n\n int countGrid();\n int countGridByUser(Map map);\n\n List getTopImage();\n}", "@Mapper(componentModel = \"spring\")\npublic interface MessageMapper {\n\n\t@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)\n\tpublic MessageDto convertToMessageDto(Message message);\n}", "@Mapper(componentModel = \"spring\", uses = {AanvraagberichtMapper.class})\npublic interface FdnAanvragerMapper extends EntityMapper<FdnAanvragerDTO, FdnAanvrager> {\n\n @Mapping(source = \"aanvraagbericht.id\", target = \"aanvraagberichtId\")\n FdnAanvragerDTO toDto(FdnAanvrager fdnAanvrager);\n\n @Mapping(target = \"adres\", ignore = true)\n @Mapping(target = \"legitimatiebewijs\", ignore = true)\n @Mapping(target = \"werksituaties\", ignore = true)\n @Mapping(target = \"gezinssituaties\", ignore = true)\n @Mapping(target = \"financieleSituaties\", ignore = true)\n @Mapping(source = \"aanvraagberichtId\", target = \"aanvraagbericht\")\n FdnAanvrager toEntity(FdnAanvragerDTO fdnAanvragerDTO);\n\n default FdnAanvrager fromId(Long id) {\n if (id == null) {\n return null;\n }\n FdnAanvrager fdnAanvrager = new FdnAanvrager();\n fdnAanvrager.setId(id);\n return fdnAanvrager;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface SampleClassificationMapper {\n\n SampleClassificationDTO sampleClassificationToSampleClassificationDTO(SampleClassification sampleClassification);\n\n List<SampleClassificationDTO> sampleClassificationsToSampleClassificationDTOs(List<SampleClassification> sampleClassifications);\n\n SampleClassification sampleClassificationDTOToSampleClassification(SampleClassificationDTO sampleClassificationDTO);\n\n List<SampleClassification> sampleClassificationDTOsToSampleClassifications(List<SampleClassificationDTO> sampleClassificationDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface GradeMapper extends EntityMapper<GradeDTO, Grade> {\n\n\n @Mapping(target = \"subjects\", ignore = true)\n @Mapping(target = \"contents\", ignore = true)\n Grade toEntity(GradeDTO gradeDTO);\n\n default Grade fromId(Long id) {\n if (id == null) {\n return null;\n }\n Grade grade = new Grade();\n grade.setId(id);\n return grade;\n }\n}", "@Mapper\npublic interface UserGroupMapper extends BaseMapper<UserGroupDO> {\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TemplateFormulaireMapper extends EntityMapper<TemplateFormulaireDTO, TemplateFormulaire> {\n\n\n @Mapping(target = \"questions\", ignore = true)\n TemplateFormulaire toEntity(TemplateFormulaireDTO templateFormulaireDTO);\n\n default TemplateFormulaire fromId(Long id) {\n if (id == null) {\n return null;\n }\n TemplateFormulaire templateFormulaire = new TemplateFormulaire();\n templateFormulaire.setId(id);\n return templateFormulaire;\n }\n}", "public interface OrganizationMapper extends Mapper<OrganizationDTO> {\n}", "@Mapper(uses ={DateComponent.class}, componentModel = \"spring\")\npublic interface CreateCodeMapper extends EntityMapper<CreateCodeDto , Code> {\n}", "@Mapper\npublic interface SysPercentMapper {\n\n public void updatePercent(SysPercent sysPercent);\n\n public List<SysPercent> listPencent();\n\n public SysPercent findByClient(SysPercent bean);\n\n public SysPercent findRemark();\n\n public void updateRemark(SysPercent bean);\n\n SysStandard listStandard();\n\n void updateStandard(SysStandard sysStandard);\n}" ]
[ "0.60328823", "0.6028524", "0.58346254", "0.5812198", "0.5746309", "0.5709573", "0.5709402", "0.56944174", "0.56866246", "0.56746364", "0.5670265", "0.5630634", "0.56130594", "0.5610288", "0.5572832", "0.5511441", "0.54850113", "0.5476965", "0.54696715", "0.5458798", "0.54402244", "0.5433286", "0.5425158", "0.54229325", "0.5422315", "0.5418315", "0.54178077", "0.5408575", "0.540129", "0.5397122", "0.53883433", "0.53757125", "0.5367927", "0.53639", "0.5362406", "0.5343365", "0.53346056", "0.53293765", "0.5329306", "0.5318239", "0.5301431", "0.5295204", "0.5291365", "0.52757984", "0.5265803", "0.52622914", "0.52567506", "0.52474385", "0.5242168", "0.52327186", "0.52179825", "0.5217667", "0.5214177", "0.5210473", "0.52100384", "0.519266", "0.5192092", "0.5184201", "0.5184118", "0.518093", "0.51807463", "0.5177626", "0.51573735", "0.5149964", "0.51443523", "0.5136173", "0.5132308", "0.5130801", "0.5129185", "0.5125007", "0.51242435", "0.5116032", "0.5115703", "0.51139796", "0.5111763", "0.5106247", "0.5103569", "0.5098613", "0.5089983", "0.50871223", "0.50786054", "0.50776565", "0.50717133", "0.5068675", "0.5068281", "0.50668067", "0.5056982", "0.50560606", "0.5049999", "0.50471616", "0.5042415", "0.5037682", "0.5033597", "0.5033089", "0.50310475", "0.50194705", "0.50180626", "0.5016571", "0.5016185", "0.50122494" ]
0.72513276
0
TODO Autogenerated method stub
@Override public void write(Object obj, File file) throws IJunitException { }
{ "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
System.out.println("Elevator regThread"); System.out.println("Elevator id = " + socketClient.getID()); System.out.println("Elevator receivedMsg = " + socketClient.getReceivedMsg()); System.out.println("Elevator alive thread = " + Thread.activeCount());
public static void regThread(SocketClient socketClient) { mSocketClient = socketClient; initMsg(); movement(); try { // mSocketClient.send(msg); String msg = mSocketClient.receive(); System.out.println("From CP's msg : " + msg); String[] line = msg.split(","); if (line[0].equals("e")) { if (Integer.valueOf(line[1]) == EID) { if (Integer.valueOf(line[1]) < Integer.valueOf(line[2])) { upQueue.add(Integer.valueOf(line[1])); upQueue.add(Integer.valueOf(line[2])); } else { downQueue.add(Integer.valueOf(line[1])); downQueue.add(Integer.valueOf(line[2])); } } } } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void getId() {\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\tString info = \"\";\n\t\t\t\ttry {\n\n\t\t\t\t\tserverSocket3 = new ServerSocket(51000);\n\t\t\t\t\twhile (yes) {\n\t\t\t\t\t\tSocket client = serverSocket3.accept();\n\t\t\t\t\t\tBufferedReader input = new BufferedReader(\n\t\t\t\t\t\t\t\tnew InputStreamReader(client.getInputStream()));\n\t\t\t\t\t\tinfo = input.readLine();\n\t\t\t\t\t\tSystem.out.println(info);\n\t\t\t\t\t\tString name[] = info.split(\"::\");\n\n\t\t\t\t\t\tSystem.out.print(client.getInetAddress());\n\t\t\t\t\t\tbu = Integer.parseInt(name[0]);\n\t\t\t\t\t\tb[bu].setText(name[1]);\n\t\t\t\t\t\tclientIP[bu] = client.getInetAddress();\n\t\t\t\t\t\tb[bu].setFont(new Font(\"sansserif\", Font.BOLD, 12));\n\t\t\t\t\t\tb[bu].setHorizontalAlignment(JButton.LEFT);\n\t\t\t\t\t\tb[bu].setBackground(Color.blue);\n\t\t\t\t\t\tseatTableSpace.repaint();\n\t\t\t\t\t\tfor (int i = 0; i < count; i++)\n\t\t\t\t\t\t\tb[i].setLocation(arrX[i], arrY[i]);\n\t\t\t\t\t}\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}.start();\n\t}", "static void printActiveClients() {\n\t\tint count = 0;\n\t\tfor (ClientThread thread : threads) {\n\t\t\tif (thread != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Clients: \" + count);\n\t}", "@Override\n public void run() {\n while(true){\n try{\n Socket s = server.accept();\n String i = new DataInputStream(s.getInputStream()).readUTF();\n if(clientColl.containsKey(i)){\n DataOutputStream dout = new DataOutputStream(s.getOutputStream());\n dout.writeUTF(\"You Are Already Registered....!!\");\n }else{\n clientColl.put(i, s);\n txt.append(sdf.format(date) + \" \" + i + \" Joined !\\n\");\n DataOutputStream dout = new DataOutputStream(s.getOutputStream());\n dout.writeUTF(\"\");\n new MsgRead(s,i).start();\n new PrepareClientList().start();\n }\n \n }catch(Exception ex){\n ex.printStackTrace();\n }\n }\n \n }", "private void verifyAlive(int coordID, int procID, int electedID, String token) {\r\n\tSystem.out.println(\"so im here now\" + coordID);\r\n\t\tlong time = 3000;\r\n\t\ttry {\r\n\t\t\tThread.sleep(time);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif(procID>6) {\r\n \tprocID = procID - 6;\r\n }\r\n try {\r\n socket = new Socket(\"127.0.0.1\", 8080+procID);\r\n out = new PrintWriter(socket.getOutputStream());\r\n out.println(token);\r\n out.flush();\r\n out.close();\r\n socket.close();\r\n //ring.currentAlive = electedID;\r\n } catch(Exception ex) {\r\n \tverifyAlive(coordID, procID+1, electedID, token); // pass to next next if next was unavailable\r\n }\r\n\t//}\r\n}", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n public void run()\n {\n System.out.println(\"[\" + getCurrentDateTimeStamp() + \"]\" + \" Received connection from: \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"Received connection from: \" + clientSocket);\n try (PrintWriter pw = new PrintWriter(clientSocket.getOutputStream());\n BufferedReader br = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()))) {\n String line = \"\";\n\n while ((line != null) && (!line.trim().toUpperCase().equals(\"CLOSE\")) && (!stop)) {\n if (!stop && !clientSocket.isClosed()) {\n synchronized (this) {\n line = br.readLine();\n }\n }\n\n if ((line != null) && (!line.trim().isEmpty()) && (!stop)) {\n if(\"getRegisterTopics\".equalsIgnoreCase(line))\n {\n sendRegisterTopics(pw);\n }\n else\n {\n line = processMessage(clientSocket, pw, line);\n }\n }\n }\n } catch (SocketException e1)\n {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"the connection was interrupted by the client - \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e1));\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] the connection was interrupted by the client - \" + clientSocket);\n } catch (IOException e)\n {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"Error while try to read from client \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e));\n System.out.println(\"Error while try to read from client \" + clientSocket);\n } finally {\n //remove from topic table\n synchronized (Server.class) {\n if (clientTopicsTable.containsKey(clientSocket)) {\n clientTopicsTable.remove(clientSocket);\n }\n //remove from threads table\n if (Server.handleClients.contains(this)) {\n Server.handleClients.remove(this);\n }\n }\n try {\n clientSocket.close();\n } catch (IOException e) {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"Error while try to close socket clientSocket: \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e));\n System.out.println(\"Error while try to close socket clientSocket: \" + clientSocket);\n }\n }\n }", "public int lookAround(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(4, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n int result = (int) m_fromServer.getReturnValue();\n com.close ();\n\n return result;\n }", "public void run() {\n try {\n\n // Create character streams for the socket.\n in = new BufferedReader(new InputStreamReader(\n socket.getInputStream()));\n out = new PrintWriter(socket.getOutputStream(), true);\n System.out.println(\"...\"+socket.getInetAddress());\n\n // Request a name from this client. Keep requesting until\n // a name is submitted that is not already used. Note that\n // checking for the existence of a name and adding the name\n // must be done while locking the set of names.\n while (true) {\n out.println(\"SUBMIT NAME\");\n name = in.readLine();\n \tString[] arr= name.split(\":\", 2);\n \tname= arr[1];\n if (name == null) {\n return;\n }\n if (!ip.contains(socket.getInetAddress())) {\n ip.add(socket.getInetAddress());\n }\n else\n {\n \tout.println(\"already opened once.\");\n \tcontinue;\n }\n synchronized (clientOut) {\n if (clientOut.get(name) == null) {\n client.put(count, name);\n id= count;\n break;\n }\n }\n }\n\n // Now that a successful name has been chosen, add the\n // socket's print writer to the set of all writers so\n // this client can receive broadcast messages.\n clientOut.put(name, out);\n out.println(\"NAMEACCEPTED\"+name);\n //adding online users to the new user.\n for (int i= 0;i < count;i++) {\n \tString str;\n\t\t\t\t\tif((str= (String)client.get(i)) != null)\n \t\tout.println(\"TAB\"+i+str);\n }\n \n //adding new user to all the users who are online.\n for (int i= 0;i < count;i++) {\n \tPrintWriter wrt;\n \tif((wrt= clientOut.get(client.get(i))) != null)\n \t\twrt.println(\"TAB\"+count+name);\n }\n count++;\n\n // Accept messages from this client and broadcast them.\n // Ignore other clients that cannot be broadcasted to.\n while (true) {\n \tString input= in.readLine();\n \tchar c1;\n \tint c2;\n \tString[] arr= input.split(\":\", 2);\n \tif(arr[0].equals(\"FILE\"))\n \t{\n \t\tString[] arr1= input.split(\":\", 3);\n \t\tPrintWriter p= clientOut.get(client.get(Integer.valueOf(arr1[1])));\n \t\tp.println(\"FILE:\"+id+\":\"+arr1[2]);\n \t\twhile((input= in.readLine()) != \"stop\")\n \t\t{\n \t\t\tp.println(input);\n \t\t\tp.flush();\n \t\t}\n \t\tp.println(\"stop\");\n \t\tp.flush();\n \t\tSystem.out.println(\"sent.........\");\n/* \t\twhile((c2= in.read()) != -1)\n \t\t{\n \t\t\tc1= (char) c2;\n \t\t\tp.print(c1);\n \t\t\tp.flush();\n \t\t\tSystem.out.print(c2);\n \t\t}\n \t\tSystem.out.println(c2+\".......\");\n \t\tp.print((char)-1);*/\n \t}\n \telse\n \t\tclientOut.get(client.get(Integer.valueOf(arr[0]))).println(\"MESSAGE:\"+id+\":\"+name+\":\"+arr[1]);\n }\n } catch (IOException e) {\n System.out.println(e);\n } finally {\n // This client is going down! Remove its name and its print\n // writer from the sets, and close its socket.\n \t//remove this client from every other client.(TAB)\n \tfor (int i= 0;i < count;i++) {\n \t\tPrintWriter wrt;\n\t\t\t\t\tif(i != id && (wrt= clientOut.get(client.get(i))) != null)\n \t\t\twrt.println(\"REMOVE\"+id);\n }\n\n if (name != null) {\n \tclient.remove(id);\n \tclientOut.remove(name);\n \tip.remove(socket.getInetAddress());\n }\n try {\n socket.close();\n } catch (IOException e) {\n }\n }\n }", "private void runProgram() {\n\n try {\n ServerSocket ss = new ServerSocket(8088);\n Dispatcher dispatcher = new Dispatcher(allmsg,allNamedPrintwriters,clientsToBeRemoved);\n Cleanup cleanup = new Cleanup(clientsToBeRemoved,allClients);\n cleanup.start();\n dispatcher.start();\n logger.initializeLogger();\n\n while (true) {\n Socket client = ss.accept();\n InputStreamReader ir = new InputStreamReader(client.getInputStream());\n PrintWriter printWriter = new PrintWriter(client.getOutputStream(),true);\n BufferedReader br = new BufferedReader(new InputStreamReader(client.getInputStream()));\n String input = br.readLine();\n System.out.println(input);\n String name = input.substring(8);\n logger.logEventInfo(name + \" has connected to the chatserver!\");\n allClients.put(name,client);\n allNamedPrintwriters.put(name,printWriter);\n ClientHandler cl = new ClientHandler(name,br, printWriter, allmsg);\n Thread t = new Thread(cl);\n t.start();\n allmsg.add(\"ONLINE#\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\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\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }", "public void run()\n {\n try\n {\n String ack = \"You are online!\";\n DatagramPacket outPacket = new DatagramPacket(ack.getBytes(), ack.getBytes().length, clientAddress, udpPort);\n DatagramSocket outSocket = new DatagramSocket();\n outSocket.send(outPacket);\n clients.add(new Client(inMsg.split(\",\")[1], clientAddress));\n System.out.println(LocalDateTime.now() + \n \"\\nClient \" + inMsg.split(\",\")[1] + \" connected!\" +\n \"\\nClient address is : \" + clientAddress + \" (\" + clientUDPPort + \")\" +\n \"\\n============================================\");\n }\n catch(SocketException e)\n {\n System.out.println(\"SocketException in ConnectionAccepter : \" +\n \"\\n\" + e + \n \"\\n============================================\");\n }\n catch(IOException e)\n {\n System.out.println(\"IOException in ConnectionAccepter : \" +\n \"\\n\" + e + \n \"\\n============================================\");\n }\n }", "public void start() throws SocketException {\n serverSocket = new DatagramSocket(port);\n serverThread = new Thread(new Runnable() {\n public void run() {\n\n\n\n try{\n while(true) {\n byte[] receiveBuffer = new byte[BUFFER_SIZE];\n\n DatagramPacket receivePacket = new DatagramPacket(receiveBuffer,BUFFER_SIZE);\n serverSocket.receive(receivePacket);\n\n if(drop()) continue;\n\n String receiveString = new String(receivePacket.getData());\n receiveString = trim(receiveString);\n\n\n UUID uuid = Message.getUUIDFromMessageString(receiveString);\n int timestamp = Message.getTimestampFromMessageString(receiveString);\n int type = Message.getTypeFromMessageString(receiveString);\n int port = Message.getPortFromMessageString(receiveString);\n MachineInfo.MachineState state = Message.getStateFromMessageString(receiveString);\n\n\n \n\n SocketAddress sa = receivePacket.getSocketAddress();\n String[] address = sa.toString().split(\":\");\n if(address[0].startsWith(\"/\")) {\n address[0] = address[0].substring(1);\n }\n\n MachineInfo machineInfo = new MachineInfo(address[0], port);\n machineInfo.setUUID(uuid).setTimestamp(timestamp).setState(state);\n\n EventMessage em = null;\n \n if(type == 0 ) { // join message\n if(DistributedMachine.isContactServer()) {\n machineInfo.setStateConnected();\n em = new EventMessage(EventMessage.EventType.Join);\n em.setMachineInfo(machineInfo);\n }\n logger.info(\"Received a join message\");\n } else if(type == 1) { //leave message\n em = new EventMessage(EventMessage.EventType.Leave);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a leave message\");\n } else if(type == 2) { //sync message\n em = new EventMessage(EventMessage.EventType.Sync);\n em.setMemberList(Message.getMemberListfromMessageString(receiveString));\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a sync message\");\n } else if(type == 3) { //ping message\n em = new EventMessage(EventMessage.EventType.Ping);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a ping\");\n } else if(type == 4) { //receive pingack\n em = new EventMessage(EventMessage.EventType.Ping_ACK);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a pingack\");\n }\n \n else if (type == -1){\n logger.error(\"Receive an unknown type message\");\n }\n\n if(em != null) {\n eventMessageQueue.add(em);\n }\n\n\n logger.info(\"Receive \" + receiveString);\n// System.out.println();\n// System.out.println(receiveString);\n// System.out.print(\">\");\n }\n } catch(Exception ex) {\n logger.info(ex.toString());\n }\n }\n });\n\n serverThread.start();\n }", "@Override\n\tpublic void run() {\n\t while (true) {\n\t try {\n\t\t\t\tsocket = serverSocket.accept();\n\n\t \tClient client = new Client(socket);\n\t \tclientList.add(client);\n\t \tSystem.out.println(\"New user connected.\");\n\n\t \tthreadProc = new Thread(client);\n\t \tthreadProc.start();\n\t \n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t }\n\t}", "private void requestServerId() {\n connection.startClient(lbInfo.getIp(), lbInfo.getPort());\n System.out.println(\"Connected!\");\n connection.sendMessage(connectionInfo);\n }", "@Override\r\n\tpublic void run() {\r\n\t\twhile (closer) {\r\n\t\t\ttry {\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(client.getInputStream());\r\n\t\t\t\tObject object = ois.readObject();\r\n\t\t\t\tArrayList<String> input = (ArrayList<String>) object;\r\n\t\t\t\tInteger election = inputTransformer(input);\r\n\t\t\t\tif (election == 1) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 1 - For Chat\");\r\n\t\t\t\t}\r\n\t\t\t\tif (election == 2) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 2 - For Points\");\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static synchronized void printMonitoringSocketStatus() {\r\n\r\n\t\tif (log.isInfoEnabled()) {\r\n\t\t\tlog.info(\"There are currently \" + numberOfOpenSockets\r\n\t\t\t\t\t+ \" open MonitoringSockets\");\r\n\t\t}\r\n\t}", "public static boolean GetClientListenerStatus (){\n return ClientListenerAlive;\n }", "public void run(){\r\n boolean nameGet = false;\r\n try{\r\n ObjectInputStream ois = new ObjectInputStream(mySocket.getInputStream());\r\n oos = new ObjectOutputStream(mySocket.getOutputStream());\r\n\r\n //Listen for messages and RollRequest objects.\r\n while(true){\r\n DataWrapper dw = (DataWrapper) ois.readObject();\r\n //Get the name from the InputStream if not retrieved already\r\n if(!nameGet){\r\n //Store the client's first message, which is always in the format \"<name> connected.\"\r\n String line = \"\";\r\n if(dw.getType() == DataWrapper.STRINGCODE){\r\n line = dw.getMessage();\r\n }\r\n consoleAppend(line);\r\n\r\n /*\r\n * Extract the alias from the String by getting the substring from 0 to the last index of whitespace,\r\n * effectively removing the \" connected.\" part of the String.\r\n */\r\n String alias = line.substring(0, line.lastIndexOf(\" \"));\r\n\r\n //Disconnect the client if the name is already in use\r\n if(getIndex(alias) != -1){\r\n oos.writeObject(\r\n new DataWrapper(\r\n DataWrapper.STRINGCODE, \"Sorry, that name is in use. Disconnecting..\", false));\r\n oos.flush();\r\n mySocket.close();\r\n }\r\n\r\n this.setName(alias);\r\n turnQueue.add(alias);\r\n nameGet = true;\r\n\r\n //If the first client\r\n if(clientThreads.get(0) == this) {\r\n //send the boardLayout for them to unpack\r\n oos.writeObject(new DataWrapper(DataWrapper.BICODE, boardLayout));\r\n }\r\n //If not the first client\r\n if(clientThreads.get(0) != this) {\r\n //request a board from the first client and wait until the updated board is received\r\n requestBoard();\r\n synchronized (waitForBoardLock) {\r\n while (!boardUpdated) {\r\n// System.out.println(\"Thread \" + this.getName() + \" waiting\");\r\n waitForBoardLock.wait();\r\n }\r\n }\r\n oos.writeObject(new DataWrapper(DataWrapper.BICODE, boardLayout));\r\n boardUpdated = false;\r\n }\r\n\r\n //Instruct all clients to add the new player\r\n sendCTToAll(new ControlToken(ControlToken.ADDCODE, alias, rand.nextInt(8)));\r\n\r\n }\r\n //Handle DataWrapper objects\r\n switch(dw.getType()){\r\n //Ensure all clients see each others' messages\r\n case DataWrapper.STRINGCODE:\r\n //Send incoming client chat messages to all clients, and append sender name\r\n String fmtMessage = String.format(\"%s: %s\", this.getName(), dw.getMessage());\r\n sendToAll(fmtMessage);\r\n consoleAppend(fmtMessage);\r\n break;\r\n\r\n //Receive updated board information from the first client in the client list\r\n case DataWrapper.BICODE:\r\n boardLayout = dw.getBoardInformation();\r\n System.out.println(\"Received an updated BoardInformation.\");\r\n System.out.println(boardLayout.toString());\r\n synchronized(waitForBoardLock){\r\n boardUpdated = true;\r\n waitForBoardLock.notify();\r\n// System.out.println(\"Thread \" + this.getName() + \" notified because of receiving a BoardInformation.\");\r\n }\r\n break;\r\n\r\n //Handle ControlToken objects\r\n case DataWrapper.CTCODE:\r\n //Client informs server that they are finished with their turn\r\n if(dw.getCT().getCode() == ControlToken.TURNFINISHEDCODE){\r\n synchronized(turnFinishedLock) {\r\n turnFinished = true;\r\n turnFinishedLock.notify();\r\n }\r\n// System.out.println(\"Thread \" + this.getName() + \" notified because of receiving a turnFinished.\");\r\n }\r\n //Client asks to roll the dice, Server returns a random value from 1-6\r\n if(dw.getCT().getCode() == ControlToken.ROLLREQUESTCODE) {\r\n //Generate the roll result\r\n int rolledResult = rollResult();\r\n //Send it as a game message to all clients\r\n String rolledResultString = String.format(\"%s rolled a %d!\",\r\n dw.getCT().getPlayerName(), rolledResult);\r\n sendGMToAll(rolledResultString);\r\n //Instruct the clients to move the player on all boards\r\n sendCTToAll(new ControlToken(ControlToken.MOVECODE, this.getName(), rolledResult, true));\r\n }\r\n break;\r\n\r\n //Default case\r\n default:\r\n consoleAppend(\"Error: invalid DataWrapper.type\");\r\n break;\r\n } //end of switch statement\r\n } //end of while loop\r\n } catch(ClassNotFoundException cnfe) {\r\n System.err.println(\"Error: class not found \" + cnfe.getMessage());\r\n } catch(SocketException | EOFException se) {\r\n handleDisconnect();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n } catch (InterruptedException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }", "public static void main(String[] args) throws Exception {\n JFrame frame = new JFrame (\"Chatting Server\");\r\n frame.setLayout(null);\r\n frame.setBounds(100, 100, 300, 300);\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n\r\n JLabel connectionStatusLabel = new JLabel(\"No Clients Connected\");\r\n connectionStatusLabel.setBounds(80, 30, 200, 30);\r\n connectionStatusLabel.setForeground(Color.red);\r\n frame.getContentPane().add(connectionStatusLabel);\r\n\r\n // create the welcoming server's socket\r\n ServerSocket welcomeSocket = new ServerSocket(6789);\r\n\r\n // thread to always listen for new connections from clients\r\n new Thread (new Runnable(){ @Override\r\n public void run() {\r\n\r\n Socket connectionSocket;\r\n DataOutputStream outToClient;\r\n\r\n while (!welcomeSocket.isClosed()) {\r\n\r\n try {\r\n // when a new client connect, accept this connection and assign it to a new connection socket\r\n connectionSocket = welcomeSocket.accept();\r\n\r\n // create a new output stream and send the message \"You are connected\" to the client\r\n outToClient = new DataOutputStream(connectionSocket.getOutputStream());\r\n outToClient.writeBytes(\"-Connected\\n\");\r\n\r\n clientCount++;\r\n\r\n // add the new client to the client's array\r\n Clients.add(new ClientThread(clientCount, connectionSocket, Clients));\r\n // start the new client's thread\r\n Clients.get(Clients.size() - 1).start();\r\n\r\n }\r\n catch (Exception ex) {\r\n\r\n }\r\n\r\n }\r\n\r\n }}).start();\r\n\r\n\r\n\r\n // thread to always get the count of connected clients and update the label\r\n new Thread (new Runnable(){ @Override\r\n public void run() {\r\n\r\n try {\r\n\r\n while (true) {\r\n\r\n if (Clients.size() > 0)\r\n {\r\n if (Clients.size() == 1)\r\n connectionStatusLabel.setText(\"1 Client Connected\");\r\n else\r\n connectionStatusLabel.setText(Clients.size() + \" Clients Connected\");\r\n\r\n connectionStatusLabel.setForeground(Color.blue);\r\n }\r\n else { //if there are no clients connected, print \"No Clients Connected\"\r\n\r\n connectionStatusLabel.setText(\"No Clients Connected\");\r\n connectionStatusLabel.setForeground(Color.red);\r\n\r\n }\r\n\r\n\r\n Thread.sleep(1000);\r\n\r\n }\r\n\r\n } catch (Exception ex) {\r\n\r\n }\r\n\r\n }}).start();\r\n\r\n\r\n\r\n frame.setVisible(true);\r\n\r\n }", "public void run(){\n while(thread != null){\n try{\n clientSocket = serverSocket.accept();\n System.out.println(\"Client Connected\");\n ClientHandler client = new ClientHandler(clientSocket, clientArray, this);\n clientArray.add(client);\n client.start();\n currentItem = item.get(Index);\n displayItem();\n }\n\n catch(IOException ioExc){\n ioExc.printStackTrace();\n }\n //Starts the time and rests it\n if(newTimer){\n startTimer();\n newTimer = false;\n }\n }\n }", "public void run() {\n System.out.println(\"NS: in service NameServer worker!\");\n\n PrintStream out;\n BufferedReader in;\n\n try {\n out = new PrintStream(serv.getOutputStream());\n in = new BufferedReader(new InputStreamReader(serv.getInputStream()));\n\n String input = in.readLine();\n StringTokenizer parsedIn = new StringTokenizer(input, \"&\");\n\n \n //if the message sent is a host registering, take the info and put it in\n //the host info list.\n if (input.contains(\"HOST:\")) {\n parsedIn.nextToken();\n String ip = parsedIn.nextToken();\n int port = Integer.parseInt(parsedIn.nextToken());\n HostInfo newHost = new HostInfo(ip, port);\n HostInfoList.add(newHost);\n\n out.println(\"Host registered with NameServer: \" + newHost.toString());\n out.flush();\n\n } else if (input.startsWith(\"NEWAGENT:\")) {\n //register agent with its ID number... assign it a name\n //give all the names of group members\n parsedIn.nextToken();\n AgentInfo agent = newAgent(parsedIn);\n\n out.println(\"NEWAGENT:&\" + agent.getName() + \"&\" + agent.getGroupId());\n out.flush();\n\n\n } else if (input.startsWith(\"AGENTMIGRATE:\")) {\n /*\n * updates info on the agent.\n */\n parsedIn.nextToken();\n String agentId = parsedIn.nextToken();\n AgentInfo agent = null;\n List<AgentInfo> agentList = AgentInfoList.getList();\n for (AgentInfo a : agentList){\n if (a.agentId.equals(agentId))\n agent = a;\n }\n\n //agent.getCurLocation().setNumAgents(agent.getCurLocation().getNumAgents() - 1);\n agent.getCurLocation().incNumAgents();\n HostInfo newHost = HostInfoList.getRandomHost();\n agent.setCurLocation(newHost);\n //newHost.setNumAgents(newHost.getNumAgents() + 1);\n newHost.incNumAgents();\n\n out.println(\"AGENTMIGRATE:&\" + newHost.getIp() + \"&\" + newHost.getPort());\n out.flush();\n\n \n\n \n \n } else if (input.startsWith(\"REAGENT:\")){\n System.out.println(\"NS: receiving: \");\n parsedIn.nextToken();\n String agentId = parsedIn.nextToken();\n int newPort = Integer.parseInt(parsedIn.nextToken());\n List<AgentInfo> agentList = AgentInfoList.getList();\n for (AgentInfo a : agentList){\n if (a.agentId.equals(agentId))\n a.setPort(newPort);\n }\n \n }\n else {\n System.out.println(\"NS: Agent or HostServer requesting unimplemented action from service port.\");\n }\n\n\n } catch (IOException e) {\n System.out.println(\"NS: issue with connection in service NameServer worker!\");\n }\n\n\n }", "public void run(){\n\t\t/*\n\t\ttry {\t\n\t\t\tclient_ip=parentIp;\n\t\t\tpingskt = new Socket(parentIp,TCP_Port);\n\t\t\tin = new BufferedReader(new InputStreamReader(pingskt.getInputStream()));\n\t\t\tout = new PrintWriter(pingskt.getOutputStream(),true);\n\t\t}catch(Exception e){ \n\t\t\tSystem.out.println(\"Error in Catch TCPSender.java line no 96 \");\t\n\t\t}\n\t\t(bufferReaderThread=new Thread(){\n \tpublic void run(){\n\t\t\t\tsynchronized(in){\n \twhile(!tcpsend_Flag){\n try{\n\t\t\t\t String str=\"\";\n if((str=in.readLine())!=null) {\n\t\t\t\t\t\t\t\tif((str!=null) && (!str.equals(\"\"))) {\n\t\t\t\t\t\t\t\t\tif(str.startsWith(\"BackupTreeCource_id\")){\n\t\t\t\t\t\t\t\t\t\tstr=str.replaceAll(\"BackupTreeCource_id\",\"\");\t\t\n\t\t\t\t\t\t\t\t\t\tString str1[]=str.split(\"@\");\n\t\t\t\t\t\t\t\t\t\tlog.setString(\"str1[1] TCPClient \"+str1[1]);\n\t\t\t\t\t\t\t\t\t\tTCPUtil.getController().getString(str1[0],str1[1]);\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else if(str.startsWith(\"SetUserList=\")){\n\t\t\t\t\t\t\t\t\t\tString courseid=str.replaceAll(\"SetUserList=\",\"\");\n\t\t\t\t\t\t\t\t\t}else if(str.startsWith(\"UserList=\")){\n\t\t\t\t\t\t\t\t\t\tString courseid_data=str.replaceAll(\"UserList=\",\"\");\n\t\t\t\t\t\t\t\t\t\tString data[]=courseid_data.split(\"#\");\n\t\t\t\t\t\t\t\t\t\tUserListUtil.getContriller().addDataForVector(data[0],data[1]);\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tint temp=str.indexOf(\",\",0);\n\t\t\t\t\t\t\t\t\tString courseid=str.substring(0,temp);\n\t\t\t\t\t\t\t\t\ttemp=temp+1;\n \t\t\tstr=str.substring(temp,str.length());\n\t\t\t\t\t\t\t\t\tMyHashTable temp_ht=RuntimeDataObject.getController().getMyHashTable();\n\t\t\t\t\t\t\t\t\tif(temp_ht.getStatus(courseid)) {\n BufferMgt te=temp_ht.getValues(courseid);\n //te.putByte(str,client_ip,\"ch_wb\");\n } else if(!temp_ht.getStatus(courseid)) {\n BufferMgt bm= new BufferMgt();\n temp_ht.setValues(courseid,bm);\n //bm.putByte(str,client_ip,\"ch_wb\");\n }\n\t\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\tbufferReaderThread.yield();\n \tbufferReaderThread.sleep(100);\n }catch(Exception e){\n\t\t\t\t\t\t\tcleancourseID();\n\t\t\t\t\t\t\tfor (int l=0;l<course_id.size();l++) {\n\t\t\t\t\t\t\t\tString courseid=course_id.get(l).toString();\n\t\t\t\t\t\t\t\tTCPClient.getController().setcourseID(courseid);\n\t\t\t\t\t\t\t\tMyHashTable tempht=RuntimeDataObject.getController().getUserListMyHashTable();\n\t\t\t\t\t\t\t\tVectorClass vectorclass=tempht.getCourseIdUserListVector(courseid);\n\t\t\t\t\t\t\t\tVector v=vectorclass.getBackupTreeValue();\n \t\t\tlog.setString(\"Backup Tree value-------------\"+v.toString())\n; \t\t\tif((v.get(0).toString()).equals(\"#GParent\")){\n \t\t\tString str=v.get(0).toString();\n str=str.replaceAll(\"#GParent\",\"\");\n\t\t\t\t\t\t\t\t\tsetparentIp(str);\n }\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSystem.gc();\t\t\t\n TCPClient.getController().start();\n\t\t\t\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\tlog.setString(\" inputStream \"+e.getMessage());\n\t\t\t\t\t\t\tlog.setString(\" TCPClient in inputStream \"+e.getMessage());\n\t\t\t\t\t\t\ttcpsend_Flag=true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tprintWriterThread.interrupt();\n \t printWriterThread.stop();\n\t\t\t\t\t\t\tbufferReaderThread.interrupt();\n bufferReaderThread.stop();\n\t \t \ttry { \n\t\t\t\t\t\t\t\tpingskt.close();\n\t\t\t\t\t\t\t\tpingskt=null;\n\t \t\t\t\t\t}catch(Exception ex ){\n\t\t\t\t\t\t\t\tlog.setString(\"Error in to catch in TCPClient!! \"+ex.getMessage());\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tSystem.gc(); \t \n\t\t\t\t\t\t\tprintWriterThread=null;\n\t\t\t\t\t\t\tbufferReaderThread=null;\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}).start();\n\t\t\n\t\t(printWriterThread =new Thread(){\n \tpublic void run(){\n\t\t\t\tsynchronized(out){\n\t \twhile(!tcpsend_Flag){\n \t \ttry{\n\t\t\t\t\t\t\tif(ipnumber != course_id.size()){\n\t\t\t\t\t\t\t\tipnumber=course_id.size();\n\t\t\t\t\t\t\t\tout.println(\"Cource_id\"+course_id.get(ipnumber-1));\t\n\t\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tMyHashTable temp_ht=RuntimeDataObject.getController().getMyHashTable();\n\t\t\t\t\t\t\t\tfor(int i=0;i<course_id.size();i++) {\n\t\t\t\t\t\t\t\t\tTCPUtil.getController().getString(course_id.get(i).toString(),\"#Parent\"+client_ip);\n\t\t\t\t\t\t\t\t\tif(temp_ht.getStatus(course_id.get(i).toString())) {\n \t\tBufferMgt buffer_mgt=temp_ht.getValues(course_id.get(i).toString());\n \t \t\t\t\t\tString str=(buffer_mgt.sendData(client_ip,\"ch_wb\")).toString();\n \t \t\tif(str !=null ){\n\t\t\t\t\t\t\t\t\t\t\tstr=course_id.get(i)+\",\"+str;\n\t\t\t\t \t\tout.println(str);\n \t \t\t\tout.flush();\n \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\tcountint++;\n \t\tout.flush();\t\n\t\t\t\t\t\t\tSystem.gc();\n\t\t\t\t\t\t\tprintWriterThread.yield();\n \t printWriterThread.sleep(100);\n\t\t\t\t\t\t}catch(Exception ex){\n\t\t\t\t\t\t\tSystem.gc();\t\n\t\t\t\t\t\t\tlog.setString(\"Error in TCPClient class in outputStream \");\n\t\t\t\t\t\t}\n \t\t}\n\t\t\t\t}\n \t}\n\t\t}).start();*/\n\t}", "private synchronized static void incrementNumberOfOpenSockets() {\r\n\r\n\t\tnumberOfOpenSockets++;\r\n\t}", "private void informCoordinator(int coord, int procNo, int elector){\r\nSystem.out.println(\"found\" + elector);\r\nif(procNo>6) {\r\n\tprocNo = procNo - 6;\r\n}\r\n\r\nString token = \"COORDINATOR\" + coord;\r\ntry {\r\n socket = new Socket(\"127.0.0.1\", 8080+procNo);\r\n out = new PrintWriter(socket.getOutputStream());\r\n out.println(token);\r\n out.flush();\r\n out.close();\r\n socket.close();\r\n if(elector!=procNo){\r\n \tinformCoordinator(coord, procNo+1, elector); \r\n } \r\n \r\n}catch(Exception ex) {\r\n\tinformCoordinator(coord, procNo+1, elector); // inform to next next if the next one was unavailable\r\n} \r\n}", "public void enter(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(8, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\n public void run() {\n try{\n System.out.println(\"A new client is trying to connect\");\n inputFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n outputFromServer = new PrintWriter(socket.getOutputStream(),true);\n retrievingClientInformation(); // Identifies clients\n sendPreviousMessagesToClient(); // Sends last 15 messages to new comers\n while (clientConnected) // It will execute until client sends a signal to disconnect\n {\n readMessagesFromClients(); // Reads a client inputs then sends them to other clients\n }\n }catch (IOException ioException)\n {\n \tSystem.out.println(username + \" has left the chat.\"); // Announce client's disconnection on server\n }finally {\n try\n {\n socket.close();\n }catch (IOException ioException)\n {\n \tSystem.out.println(username + \" has left the chat.\"); // Announce client's disconnection on server\n }\n }\n }", "public void run()\n\t{\n\t\tSystem.out.println(\"Connection established: \" + clientSocket);\n\t\tThread messageThread; // start a new Thread on TCPReceiver to receive messages through clientSocket.\n\t\ttry \n\t\t{\n\t\t\tmessageThread = new Thread(new TCPNodeReceiver(clientSocket, messagingNode), \"tcpReceiverThread\"); // pass a copy of the MessagingNode to TCPNodeReceiver.\n\t\t\tmessageThread.start(); // start receiving messages.\t\t\t\t\t\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\tSystem.err.println(\"messagingNodeThread got error: \" + e.getMessage());\n\t\t} \n\t}", "@Override\n public void run() {\n P.print(\"Receive thread starts up.\");\n try {\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());\n while (P.choke_thread_running) { //read input forever.\n try{\n Object o = ois.readObject(); //blocking.\n if (o instanceof Handshake) { // this is a Handshake.\n Handshake hs = (Handshake)o;\n P.print(\"Received handshake from \"+hs.pid);\n }\n else if(o instanceof Message){ //this is a Message.\n Message M = (Message) o;\n if(M.type==0){\n P.print(\"Received choke from \"+t.getName());\n }\n else if(M.type==1){\n P.print(\"Received unchoke from \"+t.getName());\n }\n else if(M.type==2){\n P.print(\"Received interested from \"+t.getName());\n }\n else if(M.type ==3){\n P.print(\"Received not_interested from \"+t.getName()); \n }\n else if(M.type==4){\n P.print(\"Received have from \"+t.getName());\n }\n else if(M.type==5){\n P.print(\"Received bitfield from \"+t.getName());\n }\n else if(M.type==6){\n P.print(\"Received request from \"+t.getName());\n }\n else if(M.type==7){\n P.print(\"Received piece from \"+t.getName());\n }\n else{\n P.print(\"Error: undefined message type: \"+M.type);\n }\n }\n else {\n System.out.println(\"Class not found.\");\n }\n }\n catch(ClassNotFoundException ex){\n ex.printStackTrace();\n }\n }\n ois.close();\n socket.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public void run() {\n\t\ttry {\r\n\t\t\tInetAddress localHost = InetAddress.getLocalHost();\r\n\t\t\tString ip_address = localHost.getHostAddress().trim();\r\n\t\t\tSocket socket = new Socket(this.ip_address_server, this.port_server);\r\n\t\t\twhile (socket.isClosed() == true) {\r\n\t\t\t\tsocket = new Socket(this.ip_address_server, this.port_server);\r\n\t\t\t}\r\n\t\t\tString request = \"HELLO \" + ip_address + \" \" + socket \r\n\t\t\t\t\t+ \" \" + this.client_id;\r\n\t\t\tOutputStream output = socket.getOutputStream();\r\n\t\t\tPrintWriter writer = new PrintWriter(output, true);\t\r\n\t\t\t// while <300 send request\r\n\t\t\tint requests = 0;\r\n\t\t\tlong sum=0;\r\n\t\t\twhile (requests < 300) {\r\n\t\t\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\t\twriter.println(request);\r\n\t\t\t\tDataInputStream reader = new DataInputStream(new BufferedInputStream(socket.getInputStream()));\r\n\t\t\t\treader.readUTF();\r\n\t\t\t\tint length = reader.readInt();\r\n\t\t\t\tif(length>0){\r\n\t\t\t\t\tbyte[] payload = new byte[length];\r\n\t\t\t\t reader.readFully(payload, 0, payload.length); // read the message\r\n\t\t\t\t}\r\n\t\t\t\trequests++;\r\n\t\t\t\tlong endTime = System.currentTimeMillis();\r\n\t\t\t\tlong time = endTime - startTime;\r\n\t\t\t\tsum+=time;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Client \" + this.client_id + \" has finished after \"\r\n\t\t\t\t\t+ requests + \" requests\");\r\n\t\t\tdouble averTime = sum / 300;\r\n\t\t\tString text = \"Average Communication Latency (\" + this.client_id + \"): \" + averTime + \"\\n\";\r\n\t\t\tFiles.write(Paths.get(this.latencyTimes.getName()), text.getBytes(), StandardOpenOption.APPEND);\r\n\t\t\tsocket.close();\t\r\n\t\t} catch (UnknownHostException ex) {\r\n\t\t\tSystem.out.println(\"Server not found: \" + ex.getMessage());\r\n\t\t\tex.printStackTrace();\r\n\t\t} catch (IOException ex) {\r\n\t\t\tSystem.out.println(\"I/O error: \" + ex.getMessage());\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}", "public void run() {\n // open socket\n Socket s = null;\n int retries = 3;\n int retry_interval_ms = 100;\n for (int i = 0; i < retries; i++) {\n\n // create or find a socket server\n try {\n InetAddress localhost = InetAddress.getByName(null);\n if (id < otherId) {\n ServerSocket serverSocket = new ServerSocket(port, 0, localhost);\n s = serverSocket.accept();\n } else {\n s = new Socket(localhost, port);\n }\n System.out.println(logPrefix + \"socket connected\");\n break;\n\n // retry a few times if necessary\n } catch (IOException e) {\n System.out.println(logPrefix + \"Socket connection failure.\");\n System.out.println(logPrefix + e.getMessage());\n if (i < retries - 1) {\n System.out.println(logPrefix + \"Trying again...\");\n try {\n Thread.sleep(retry_interval_ms);\n } catch (InterruptedException e1) {\n }\n } else {\n System.out.println(logPrefix + \"Giving up.\");\n }\n }\n }\n\n // if socket exists, finish initialization then listen for messages\n if (s != null) {\n try (\n // get I/O streams\n PrintWriter xxx = outContainer[0] =\n new PrintWriter(s.getOutputStream(), true);\n BufferedReader in = new BufferedReader(new InputStreamReader(\n s.getInputStream()));\n ) {\n // enqueue received messages\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n messages.add(Integer.parseInt(inputLine));\n }\n } catch (IOException e) {\n System.out.println(logPrefix + \"Exception in socket thread.\");\n System.out.println(logPrefix + e.getMessage());\n }\n }\n }", "public void run()\n {\n try\n {\n logger.debug(\"Starting server-side thread\");\n while (active)\n {\n List<Node> nodesFromQuery = null;\n if (clients.size() > 0)\n {\n nodesFromQuery = BeanLocator.getRouterService().findNodesWithNumberOfMessages(routerId);\n logger.debug(\"Number of nodesFromQuery for this routerId :\" + routerId + \" is:\" + nodesFromQuery.size());\n\n for (Node node : nodesFromQuery)\n {\n // if node exists in map\n if (this.nodes.get(node.getId()) != null)\n {\n logger.debug(\"Node already in map\");\n // check if something has been updated on the node - using hashcode\n\n logger.debug(this.nodes.get(node.getId()).getNumberOfMessagesHandled().toString());\n logger.debug(node.getNumberOfMessagesHandled().toString());\n boolean hasNumberOfMessagesChanged = !this.nodes.get(node.getId()).getNumberOfMessagesHandled().equals(node.getNumberOfMessagesHandled());\n if (hasNumberOfMessagesChanged)\n {\n logger.debug(\"Fire update event..\");\n // if something has changed fire update event\n this.nodes.put(node.getId(), node);\n fireNodeUpdatedEvent(node);\n } else\n {\n // nothing changed - ignore and log\n logger.info(\"Nothing changed on node :\" + node.getId());\n }\n } else\n {\n // else if node does not exist store the node in the map\n logger.debug(\"Storing node in map\");\n this.nodes.put(node.getId(), node);\n fireNodeUpdatedEvent(node);\n }\n }\n } else\n {\n logger.info(\"Thread running but no registered clients\");\n }\n Thread.sleep(CALLBACK_INTERVALL);\n }\n logger.debug(\"Stopping server-side thread. Clearing nodes and clients.\");\n clients.clear();\n nodes.clear();\n }\n catch (InterruptedException ex)\n {\n logger.warn(\"Thread interrupted.\", ex);\n }\n }", "public void readTheMenu(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(12, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public MainThread(/*Socket socket, int id*/) {\r\n// this.socket = socket;\r\n// // this.idSession = id;\r\n// try {\r\n// \t\r\n// \t\r\n// out = new DataOutputStream(socket.getOutputStream());\r\n// in = new DataInputStream(socket.getInputStream());\r\n// \r\n// \r\n// \r\n// } catch (IOException ex) {\r\n// Logger.getLogger(MainThread.class.getName()).log(Level.SEVERE, null, ex);\r\n// }\r\n }", "private void startFedServer(){\r\n \r\n try {\r\n System.out.println(\"Start server to listen for client connection....\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Start server to listen for client connection....\", \"info\");\r\n sSocket = new ServerSocket(serverPort);\r\n sSocket.setReuseAddress(true);\r\n //System.out.println(\"FedServer is launching\");\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Error listening on port \" + serverPort, \"severe\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n List<Thread> proc_list = new ArrayList();\r\n while (FLAG) {\r\n if (proc_list.size() == PROC_MAX) {\r\n boolean full = true;\r\n //check if thread number reach the maximum number, if yes, sleep; \r\n while (full) {\r\n for (int i = proc_list.size() - 1; i >= 0; i--) {\r\n if (!proc_list.get(i).isAlive()) {\r\n proc_list.remove(i);\r\n full = false;\r\n }\r\n }\r\n if (full) {\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }\r\n }\r\n }\r\n //if not full, accpet new client connection\r\n try {\r\n cSocket = sSocket.accept();\r\n //System.out.println(\"[C4C-Notification] Accept connection from client\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Accept connection from client\", \"info\");\r\n //create new thread to process client request\r\n // System.out.println(\"Accept connection from client -step 1\");\r\n Thread request = new Thread(new processRequest(cSocket));\r\n request.start();\r\n proc_list.add(request);\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n\r\n }\r\n closeFedSockets();\r\n }", "public void run() {\n\t\tPrintWriter out = null;\r\n\t\ttry {\r\n\t\t\tout = new PrintWriter(clientSocket.getOutputStream(), true);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tBufferedReader in = null;\r\n\t\ttry {\r\n\t\t\tin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tString inputLine, outputLine;\r\n\t\tProtocol kkp = new Protocol();\r\n\r\n\t\toutputLine = kkp.processInput(null);\r\n\t\tout.println(outputLine);\r\n\t\t// Leo continuamente e interactuo\r\n\t\ttry {\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n//\t\t\t\toutputLine = kkp.processInput(inputLine);\r\n\t\t\t\toutputLine = inputLine;\r\n\t\t\t\tout.println(outputLine);\r\n\t\t\t\tif (outputLine.equals(\"Bye.\")){\r\n\t\t\t\t\tbreak;\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t// Cierro la entrada y salida\r\n\t\t\tout.close();\r\n\t\t\tin.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} finally{\r\n\t\t\tlog.info(\"Clientes activos: \"+ (taskExecutor.getThreadPoolExecutor().getActiveCount()-1));\t\t\t\r\n\t\t}\r\n\t}", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "private void startClient(){\n if (started) return;\n\n// //GET RID OF THIS!!\n// sensorReadingArrayList = new ArrayList<MHLSensorReading>();\n\n started = true;\n clientThread = new Thread(new MHLClientThread(ip, port, userID));\n clientThread.start();\n }", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n RemoteSensor remoteSensor = RemoteSensorManager.getInstance().addSensorChannel(ctx);\n QueuerManager.getInstance().addClient(remoteSensor);\n// System.out.println(RemoteSensorManager.getInstance().getRemoteSensorsNamesList().size());\n }", "public int getNumberOfPeopleInElevator(int elevator) {\r\n /*\r\n switch(elevator) {\r\n case 1: return 1;\r\n case 2: return 4;\r\n default: return 0;\r\n }\r\n */\r\n int i = 0;\r\n try {\r\n ElevatorScene.personCountMutex.acquire();\r\n i = numberOfSpacesInElevator;\r\n ElevatorScene.personCountMutex.release();\r\n } catch (InterruptedException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n } \r\n return i;\r\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tString msg=\"\";\n\t\t\twhile((msg=br.readLine())!=null){\n\t\t\t\tSystem.out.println((server?\"Client\":\"Server\")+\": \"+msg);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void sendElectionRequest()\n {\n System.out.println(\"INFO : Election initiated\");\n int numberOfFailedRequests = 0;\n for ( int key : ServerState.getInstance().getServers().keySet() ) {\n if( key > ServerState.getInstance().getSelfID() ){\n Server destServer = ServerState.getInstance().getServers().get(key);\n try {\n MessageTransfer.sendServer(\n ServerMessage.getElection( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n System.out.println(\"INFO : Sent election request to s\"+destServer.getServerID());\n }\n catch(Exception e){\n System.out.println(\"WARN : Server s\"+destServer.getServerID() +\n \" has failed, cannot send election request\");\n numberOfFailedRequests++;\n }\n }\n\n }\n if (numberOfFailedRequests == ServerState.getInstance().getNumberOfServersWithHigherIds()) {\n if(!electionInProgress){\n //startTime=System.currentTimeMillis();\n electionInProgress = true;\n receivedOk = false;\n Runnable timer = new BullyAlgorithm(\"Timer\");\n new Thread(timer).start();\n }\n }\n }", "public void alertTheWaiter(){\n Chef c = (Chef) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = c.getChefID();\n \tstate_fields[1] = c.getChefState();\n\n Message m_toServer = new Message(1, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n c.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public void run() {\n while (true) {\n try {\n /* Get string from client */\n String fromClient = this.in.readLine();\n \n /* If null, connection is closed, so just finish */\n if (fromClient == null) {\n for (int x=0; x<clientlist.size(); x++) {\n if (this == clientlist.get(x)){ clientlist.get(x).out.println(\"Client \" + this.id + \" disconnected\"); }\n }\n this.in.close();\n this.out.close();\n this.socket.close();\n return;\n }\n \n /* If the client said \"bye\", close the connection */\n if (fromClient.equals(\"bye\")) {\n for (int x=0; x<clientlist.size(); x++) {\n if (this != clientlist.get(x)){ clientlist.get(x).out.println(\"Client \" + this.id + \" said bye, disconnecting\"); }\n }\n this.in.close();\n this.out.close();\n this.socket.close();\n return;\n }\n\n if(fromClient.startsWith(\"/id \")) {\n String oldID=this.id;\n String msg = this.changeID(fromClient.substring(4));\n if (msg.equals(\"\")) {\n for (int x=0; x<clientlist.size(); x++) {\n if (this != clientlist.get(x)){ clientlist.get(x).out.println(\"Client \" + oldID + \" changed his/her name to \" + this.id); }\n }\n }\n else {\n this.out.println(msg);\n }\n }\n else if(fromClient.startsWith(\"/whisper \")){\n String msg = this.whisper(fromClient.substring(9, StringUtils.ordinalIndexOf(fromClient, \" \", 2)));\n String user = fromClient.substring(9, StringUtils.ordinalIndexOf(fromClient, \" \", 2));\n for (int x=0; x<clientlist.size(); x++) {\n if (user.equalsIgnoreCase(clientlist.get(x).id) && !user.equalsIgnoreCase(this.id)){\n clientlist.get(x).out.println(this.id + \" whispered : \" + (fromClient.substring(StringUtils.ordinalIndexOf(fromClient, \" \", 2)+1)).toUpperCase() );\n }\n }\n if(!msg.equalsIgnoreCase(\"\")){ this.out.println(msg); }\n }\n else if(fromClient.startsWith(\"/room \")){\n String msg = this.roomChange(fromClient.substring(6));\n String roomName = fromClient.substring(6);\n for (int x=0; x<rooms.size(); x++) {\n if (rooms.get(x).title.equalsIgnoreCase(roomName)) {\n for (int y = 0; y < clientlist.size(); y++) {\n if (rooms.get(x).hasClient(clientlist.get(y).id) && !clientlist.get(y).id.equalsIgnoreCase(this.id)) {\n clientlist.get(y).out.println(this.id + \" has joined room \" + roomName);\n }\n }\n }\n }\n this.out.println(msg);\n\n room aRoom = new room(\"x\");\n for(room theRoom : rooms){\n ArrayList<String> members = theRoom.getMembers();\n for(String member : members) {\n if (member.equalsIgnoreCase(this.id)) {\n aRoom = theRoom;\n }\n }\n }\n\n this.out.print(\"The admins in the group are: \");\n for(String admin: aRoom.getAdmins()){\n this.out.print(admin + \" \");\n }\n this.out.println(\"\");\n this.out.println(\"The topic of the room is \" + aRoom.topic);\n }\n else if(fromClient.startsWith(\"/+admin \")){\n if (!this.isAdmin()){\n this.out.println(\"You don't have permission to use that command\");\n }\n String roomName=\"\";\n room aRoom = new room(\"x\");\n String user = fromClient.substring(8);\n for(room theRoom : rooms){\n ArrayList<String> admins = theRoom.getAdmins();\n for(String admin : admins) {\n if (admin.equalsIgnoreCase(this.id)) {\n roomName = theRoom.title;\n aRoom = theRoom;\n }\n }\n }\n this.addAdmin(user, roomName);\n for (int x=0; x<clientlist.size(); x++) {\n if (aRoom.getMembers().contains(clientlist.get(x).id) && !user.equalsIgnoreCase(this.id)){\n clientlist.get(x).out.println(user + \" was made an admin of \" + roomName);\n }\n }\n }\n else if(fromClient.startsWith(\"/-admin \")){\n if (!this.isAdmin()){\n this.out.println(\"You don't have permission to use that command\");\n }\n String roomName=\"\";\n room aRoom = new room(\"x\");\n String user = fromClient.substring(8);\n for(room theRoom : rooms){\n ArrayList<String> admins = theRoom.getAdmins();\n for(String admin : admins) {\n if (admin.equalsIgnoreCase(this.id)) {\n roomName = theRoom.title;\n aRoom = theRoom;\n }\n }\n }\n this.removeAdmin(user);\n for (int x=0; x<clientlist.size(); x++) {\n if (aRoom.getMembers().contains(clientlist.get(x).id) && !user.equalsIgnoreCase(this.id)){\n clientlist.get(x).out.println(clientlist.get(x).id + \" was removed from the admin position in \" + roomName);\n }\n }\n }\n else if(fromClient.startsWith(\"/kick \")){\n if (!this.isAdmin()){\n this.out.println(\"You don't have permission to use that command\");\n }\n String user = fromClient.substring(6);\n String roomName=\"\";\n room aRoom = new room(\"x\");\n for(room theRoom : rooms){\n ArrayList<String> admins = theRoom.getAdmins();\n for(String admin : admins) {\n if (admin.equalsIgnoreCase(this.id)) {\n roomName = theRoom.title;\n aRoom = theRoom;\n }\n }\n }\n for (int x=0; x<clientlist.size(); x++) {\n if (aRoom.getMembers().contains(clientlist.get(x).id) && !user.equalsIgnoreCase(this.id) && !clientlist.get(x).id.equalsIgnoreCase(user)){\n clientlist.get(x).out.println(user + \" was kicked from \" + roomName);\n }\n else if (aRoom.getAdmins().contains(user) && clientlist.get(x).id.equalsIgnoreCase(this.id) ){\n this.out.println(\"You cannot kick an admin of the group\");\n }\n else if (aRoom.getMembers().contains(clientlist.get(x).id) && clientlist.get(x).id.equalsIgnoreCase(user)) {\n clientlist.get(x).out.println(\"You are being kicked from \" + roomName + \" by \" + this.id + \", and being placed in Lobby.\");\n this.kick(user);\n }\n }\n }\n else if(fromClient.startsWith(\"/topic \")){\n if (!this.isAdmin()){\n this.out.println(\"You don't have permission to use that command\");\n }\n String topic = fromClient.substring(7);\n String roomName=\"\";\n\n for(room theRoom : rooms){\n ArrayList<String> members = theRoom.getMembers();\n for(String member : members) {\n if (member.equalsIgnoreCase(this.id)) {\n roomName = theRoom.title;\n }\n }\n }\n\n this.addTopic(topic);\n for (int x=0; x<rooms.size(); x++) {\n if (rooms.get(x).title.equalsIgnoreCase(roomName)) {\n for (int y = 0; y < clientlist.size(); y++) {\n if (rooms.get(x).hasClient(clientlist.get(y).id) && !clientlist.get(y).id.equalsIgnoreCase(this.id) && rooms.get(x).getAdmins().contains(this.id)) {\n clientlist.get(y).out.println(this.id + \" changed the topic of the room to \" + topic);\n }\n }\n }\n }\n }\n \n /* Otherwise send the text to the server*/\n\n else {\n for (int y=0; y < rooms.size(); y++) {\n for (int x = 0; x < clientlist.size(); x++) {\n if (this != clientlist.get(x)) {\n if(rooms.get(y).hasClient(this.id) && rooms.get(y).hasClient(clientlist.get(x).id)) {\n clientlist.get(x).out.println(\"Client \" + this.id + \" said: \" + fromClient);\n }\n }\n }\n }\n }\n \n } catch (IOException e) {\n /* On exception, stop the thread */\n System.out.println(\"IOException: \" + e);\n return;\n }\n }\n }", "@Override\n\tpublic void run() {\n\t\tSocket s = null;\n\t\tDataOutputStream dos = null;\n\t\tDataInputStream dis = null;\n\t\tString clientName = \"\";\n\t\tString userid = null;\n\t\tString password = null;\n\t\t\n\t\ttry {\n\t\t\ts = ss.accept(); // wait for a client\n\t\t\tnew Thread(this).start(); // make a thread to connect the NEXT client - somewhat recursive\n\t\t\tdis = new DataInputStream(s.getInputStream());\n\t\t\tString firstMsg = dis.readUTF();\n\t\t\tdos = new DataOutputStream(s.getOutputStream());\n\t\t\t\n\t\t\t// validate connection \n\t\t\tif (firstMsg.charAt(0) == '\\u0274') { // char startsWith()\n\t\t\t\tfirstMsg = firstMsg.substring(1); // drop unicode char\n\t\t\t\tint slashOffset = firstMsg.indexOf(\"/\");\n\t\t\t\tuserid = firstMsg.substring(0, slashOffset).toLowerCase();\n\t\t\t\tpassword = firstMsg.substring(slashOffset + 1);\n\t\t\t\tSystem.out.println(userid + \" is attempting to join with password \" + password);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdos.writeUTF(\"Invalid protocol. \" + \"Are you calling the right address and port?\");\n\t\t\t\tdos.close(); // close connection\n\t\t\t\tSystem.out.println(\"Invalid 1st msg received: \" + firstMsg);\n\t\t\t\treturn; // kill this client thread\n\t\t\t}\n\t\t\t\n\t\t\t// validate username then get chatName from this collection: \n\t\t\tif (authorizedClients.containsKey(userid)) clientName = authorizedClients.get(userid);\n\t\t\t else { //The submitted userid is not in the collection...\n\t\t\t\t dos.writeUTF(\"user id \" + userid + \" is not authorized to join the PrivateChatRoom.\");\n\t\t\t\t System.out.println(userid + \" is not authorized to join.\");\n\t\t\t\t dos.close(); // hang up.\n\t\t\t\t return; // and kill this client thread\n\t\t\t }\n\t\t\tif (clients.containsKey(clientName)) {\n\t\t\t\t dos.writeUTF(clientName + \" is already in the chat room. Cannot be joined from two locations concurrently.\");\n\t\t\t\t System.out.println(\"Received join request for a userid (\" + userid + \"=\" + clientName + \" that is already in the chat room.\" );\n\t\t\t\t dos.close(); // hang up.\n\t\t\t\t return; // and kill this client thread\n\t\t\t}\n\t\t\telse { // process this request\n\t\t\t\tSystem.out.println(clientName + \" is joining.\"); // trace\n\t\t\t\tsendToAllClients(\"Welcome to \" + clientName + \" who has just joined the chat room!\"); // let everyone know you're flossing\n\t\t\t\tclients.put(clientName, dos); // add to collection\n\t\t\t}\n\t\t\tObjectOutputStream oos = null;\n\t\t\tif (!passwords.containsKey(userid)) // stored password not found\n\t\t\t\t\t { // That's OK! This is just a first-time join!\n\t\t\t\t\t passwords.put(userid, password);//add to collection\n\t\t\t\t\t //And save the updated passwords collection to disk:\n\t\t\t\t\t oos= new ObjectOutputStream(new FileOutputStream(\"ChatRoomPasswords.ser\"));\n\t\t\t\t\t oos.writeObject(passwords);\n\t\t\t\t\t oos.close();\n\t\t\t\t\t }\n\t\t\t\t\t else // a stored password for this userid is found\n\t\t\t\t\t {\n\t\t\t\t\t String storedPassword = passwords.get(userid);\n\t\t\t\t\t if(!storedPassword.equals(password))\n\t\t\t\t\t {\n\t\t\t\t\t dos.writeUTF(\"Join rejected. The submitted password does not match the password stored for this user id.\");\n\t\t\t\t\t return; // and kill this client's thread.\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\tdos.writeUTF(\"Welcome to the chat room \" + clientName + \"!\");\t\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Client connection failure: \" + e);\n\t\t\tif (s.isConnected()) {\n\t\t\t\ttry {\n\t\t\t\t\ts.close(); // hang up\n\t\t\t\t}\n\t\t\t\tcatch (IOException ioe){\n\t\t\t\t\t// Already hung up\n\t\t\t\t}\n\t\t\t} // end if\n\t\t} // end catch\n\t\t\n\t\t// Send Receive loop\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tString inChat = dis.readUTF();\n\t\t\t\tString outChat = clientName + \" says: \" + inChat;\n\t\t\t\tSystem.out.println(outChat); // trace\n\t\t\t\tsendToAllClients(outChat); // send it to everyone\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ioe){ // leave processing\n\t\t\tSystem.out.println(clientName + \" is leaving.\"); // trace\n\t\t\tsendToAllClients(\"Goodbye to \" + clientName + \" who has just left the chat room!\"); // let everyone know you're leaving\n\t\t\tclients.remove(clientName); // remove from collection\n\t\t\treturn; // kill thread since we're done now for w/e reason\n\t\t}\n\t}", "public void run() {\n ServerSocket serverSocket = null;\n try {\n serverSocket = new ServerSocket(8823);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // running infinite loop for getting\n // client request\n while (true)\n {\n Socket socket = null;\n\n try\n {\n // socket object to receive incoming client requests\n socket = serverSocket.accept();\n\n //System.out.println(\"A new client is connected : \" + socket);\n\n // obtaining input and out streams\n InputStream inputStream = new DataInputStream(socket.getInputStream());\n OutputStream outputStream = new DataOutputStream(socket.getOutputStream());\n\n //System.out.println(\"Assigning new thread for this client\");\n\n // create a new thread object\n Thread t = new ClientHandler(socket, inputStream, outputStream);\n\n // Invoking the start() method\n t.start();\n\n }\n catch (Exception e){\n try {\n socket.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n e.printStackTrace();\n }\n }\n }", "public synchronized void incrementClients()\r\n\t{\r\n\t\tnumberOfClients++;\r\n\t}", "protected void listClients() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tint procCount = processors.count();\r\n\t\t\t\tif (procCount > 0) {\r\n\t\t\t\t\tSimulatorPDUProcessor proc;\r\n\t\t\t\t\tfor (int i = 0; i < procCount; i++) {\r\n\t\t\t\t\t\tproc = (SimulatorPDUProcessor) processors.get(i);\r\n\t\t\t\t\t\tSystem.out.print(proc.getSystemId());\r\n\t\t\t\t\t\tif (!proc.isActive()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\" (inactive)\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.out.println();\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\tSystem.out.println(\"No client connected.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException { /* THIS IS THE MAIN FUNCTION TO START THE SERVER OR REPORTS IF THERE IS ANY ISSUE*/\n\ntry {\n serverSocket = new ServerSocket(4457);\n System.out.println(\"Server started.\");\n ServerDemo.display(\"server started\");\n} catch (Exception e) {\n System.err.println(\"Port already in use.\");\n System.exit(1);\n}\n\nwhile (true) { /* accepting the socket connection*/\n try {\n clientSocket = serverSocket.accept();\n System.out.println(\"Accepted connection : \" + clientSocket);\n ServerDemo.display(\"Accepted connection : \" + clientSocket);\n\n int i = 0;\n for (i = 0; i < maxClientsCount; i++) {\n if (threads[i] == null) {\n (threads[i] = new CLIENTConnection(clientSocket, threads)).start();\n break;\n }\n }\n if (i == maxClientsCount) {\n PrintStream os = new PrintStream(clientSocket.getOutputStream());\n os.println(\"Server too busy. Try later.\");\n os.close();\n clientSocket.close();\n }\n\n } catch (Exception e) {\n System.err.println(\"Error in connection attempt.\");\n }\n }\n }", "public void acceptedSocket(long socketId) {}", "public void run() {\n GlobalLogger.log(this, LogLevel.INFO, \"STARTING RequestThread\");\n while(true) {\n int request = client.recvInt();\n if (request == -2147483648) {\n return;\n }\n int i;\n int d;\n int id;\n int x;\n int y;\n switch(request) {\n case 0xC0:\n mustSync = true;\n break;\n case 1:\n i = receiveUntilNotSync();\n d = receiveUntilNotSync();\n GlobalLogger.log(this, LogLevel.INFO, \"Updating direction of client %d to %d\",i, d);\n if(getOpponentByClientId(i) != null) getOpponentByClientId(i).setDirection(d);\n break;\n case 2:\n id = receiveUntilNotSync();\n x = receiveUntilNotSync();\n y = receiveUntilNotSync();\n MySnakeMultiplayerOpponent newopponent = new MySnakeMultiplayerOpponent(id);\n GlobalLogger.log(this, LogLevel.INFO, \"New opponent at id %d, on pos (%d,%d)\",id,x,y);\n newopponent.addPiece(new MySnakePiece(x,y));\n newopponent.addPiece(new MySnakePiece(x+1,y));\n opponents.add(newopponent);\n break;\n case 3:\n id = receiveUntilNotSync();\n GlobalLogger.log(this, LogLevel.INFO, \"Apple eaten by opponent %d!\", id);\n if(getOpponentByClientId(id) != null) getOpponentByClientId(id).addPiece(new MySnakePiece(getOpponentByClientId(id).getSnake().get(getOpponentByClientId(id).getSnake().size()-1).getX(), getOpponentByClientId(id).getSnake().get(getOpponentByClientId(id).getSnake().size()-1).getY()));\n break;\n case 4:\n x = receiveUntilNotSync();\n y = receiveUntilNotSync();\n GlobalLogger.log(this, LogLevel.INFO, \"New apple pos is (%d,%d)\",x,y);\n apple.x = x;\n apple.y = y;\n break;\n case 5:\n int playern = receiveUntilNotSync();\n // GlobalLogger.log(this, LogLevel.INFO, \"Global sync received\");\n // GlobalLogger.log(this, LogLevel.INFO, \"%d players currently connected (besides you)\", playern);\n for(int k=0; k<playern; k++) {\n id = receiveUntilNotSync();\n MySnakeMultiplayerOpponent currentOpponent = getOpponentByClientId(id);\n if(currentOpponent != null) {\n currentOpponent.setDirection(client.recvInt());\n int tailsn = receiveUntilNotSync();\n for(int j=0; j<tailsn; j++) {\n int tailx = receiveUntilNotSync();\n int taily = receiveUntilNotSync();\n currentOpponent.getSnake().get(j).setX(tailx);\n currentOpponent.getSnake().get(j).setY(taily);\n }\n }\n }\n\n int controlcode = receiveUntilNotSync();\n if(controlcode != 1908) {\n GlobalLogger.log(this, LogLevel.SEVERE, \"Something went horribly wrong. Got %d for control code\", controlcode);\n } else {\n // GlobalLogger.log(this, LogLevel.INFO, \"Seems like everything went smoothly :D! Noice!\");\n }\n break;\n case 6:\n fuckingDead = true;\n break;\n\n case 7:\n id = receiveUntilNotSync();\n opponents.remove(getOpponentByClientId(id));\n break;\n\n default:\n GlobalLogger.log(this, LogLevel.SEVERE, \"Invalid request %d received from server\", request);\n this.stop();\n break;\n }\n }\n }", "public int getClients()\r\n\t{\r\n\t\treturn numberOfClients;\r\n\t}", "@Override\n public void run()\n {\n Boolean running = true;\n String messageType, IP, message;\n int port;\n int index;\n ObjectOutputStream out;\n ObjectInputStream input;\n Socket socket;\n UserMessage outMessage;\n UserMessage inMessage;\n \n \n while( running )\n {\n //prompt user for message type\n messageType = userInput.next();\n\n //if message type is join\n if( messageType.equals( \"JOIN\" ) )\n {\n //ask for target ip\n System.out.print(\"Input an IP to join: \");\n IP = userInput.next();\n \n //ask for target port\n System.out.print(\"Input a port number: \");\n port = Integer.parseInt(userInput.next());\n \n \n if( isConnected )\n {\n System.out.println(\"You are already in a chat.\");\n continue;\n }\n \n else\n {\n // CONNECT THE USER TO THE GIVEN USER\n \n //pack message\n message = messageType;\n outMessage = new UserMessage( thisNode.myInfo, message);\n \n try\n {\n socket = new Socket(IP, port);\n System.out.println(\"Connected\");\n \n // send myInfo to socket\n out = new ObjectOutputStream(socket.getOutputStream());\n out.writeObject( outMessage );\n \n // get participantList\n input = new ObjectInputStream(socket.getInputStream());\n try\n {\n inMessage = (UserMessage) input.readObject();\n for( index = 0; index < inMessage.participantList.size(); index++)\n {\n thisNode.addParticipant(inMessage.participantList.get( index ));\n }\n thisNode.participantList = inMessage.participantList;\n System.out.println(thisNode.participantList);\n \n } \n \n catch (ClassNotFoundException e)\n {\n System.out.println(\"Failed to migrate participants list\");\n e.printStackTrace();\n }\n socket.close();\n } \n \n catch (IOException err)\n {\n System.out.println(\"Socket connection failed\");\n err.printStackTrace();\n }\n \n isConnected = true;\n }\n }\n \n \n else if( messageType.equals( \"LEAVE\" ) )\n {\n // DISCONNECT THE USER FROM ALL OTHER USERS\n for( ChatNode.NodeInfo participants : thisNode.participantList)\n {\n try\n {\n socket = new Socket(participants.IP, participants.Port);\n UserMessage leaveMsg = new UserMessage(thisNode.myInfo, \"LEAVE\");\n out = new ObjectOutputStream(socket.getOutputStream());\n out.writeObject(leaveMsg);\n \n input = new ObjectInputStream(socket.getInputStream());\n input.readObject();\n socket.close();\n } \n \n catch (IOException | ClassNotFoundException e)\n {\n System.out.println(\"Socket connection failed\");\n e.printStackTrace();\n }\n }\n System.out.println(\"You have left the chat\");\n isConnected = false;\n }\n \n \n else if( messageType.equals( \"SHUTDOWN\" ) )\n {\n // DISCONNECT THE USER FROM ALL AND CLOSE PROGRAM. COULD BE PUT WITH ABOVE CHUNK WITH SLIGHTLY MORE\n // SINCE THIS ONE WILL DO THE EQUIVALENT OF LEAVE WITH ONE EXTRA STEP AFTER\n for( ChatNode.NodeInfo participants : thisNode.participantList)\n {\n try\n {\n socket = new Socket(participants.IP, participants.Port);\n UserMessage leaveMsg = new UserMessage(thisNode.myInfo, \"SHUTDOWN\");\n out = new ObjectOutputStream(socket.getOutputStream());\n out.writeObject(leaveMsg);\n \n input = new ObjectInputStream(socket.getInputStream());\n input.readObject();\n socket.close();\n } \n \n catch (IOException | ClassNotFoundException e)\n {\n System.out.println(\"Socket connection failed\");\n e.printStackTrace();\n }\n }\n System.out.println(\"You have shutdown the chat\");\n running = false;\n System.exit(0);\n }\n \n \n // NOTE \"message\" ( we won't need name because we included in NodeInfo\n else if( messageType.equals( \"NOTE\" ) )\n {\n // SEND THE MESSAGE OUT TO THE PARTICIPANT LIST; REFERENCE TO IT CAN BE AS ChatNode.participantList\n System.out.print(\"Input a message to send: \");\n message = userInput.next();\n for( ChatNode.NodeInfo participants : thisNode.participantList)\n {\n try\n {\n socket = new Socket(participants.IP, participants.Port);\n UserMessage leaveMsg = new UserMessage(thisNode.myInfo, message);\n out = new ObjectOutputStream(socket.getOutputStream());\n out.writeObject(leaveMsg);\n \n input = new ObjectInputStream(socket.getInputStream());\n input.readObject();\n socket.close();\n } \n \n catch (IOException | ClassNotFoundException e)\n {\n System.out.println(\"Socket connection failed\");\n e.printStackTrace();\n }\n }\n }\n \n else\n {\n System.out.println(\"\\nInvalid message type.\");\n continue;\n }\n }\n }", "public void run() {\n\n switch( operation )\n {\n case \"Timer\":\n System.out.println( \"INFO : Timer started\" );\n try {\n // wait 7 seconds\n Thread.sleep( 7000 );\n if( !receivedOk )\n {\n // OK not received. Set self as leader\n LeaderState.getInstance().setLeaderID( ServerState.getInstance().getSelfID() );\n electionInProgress = false; // allow another election request to come in\n leaderFlag = true;\n System.out.println( \"INFO : Server s\" + LeaderState.getInstance().getLeaderID()\n + \" is selected as leader! \" );\n\n LeaderState.getInstance().resetLeader(); // reset leader lists when newly elected\n\n Runnable sender = new BullyAlgorithm( \"Sender\", \"coordinator\" );\n new Thread( sender ).start();\n }\n\n if( receivedOk && !leaderFlag )\n {\n System.out.println( \"INFO : Received OK but coordinator message was not received\" );\n\n electionInProgress = false;\n receivedOk = false;\n\n Runnable sender = new BullyAlgorithm( \"Sender\", \"election\" );\n new Thread( sender ).start();\n }\n }\n catch( Exception e ) {\n System.out.println( \"INFO : Exception in timer thread\" );\n }\n break;\n\n case \"Heartbeat\":\n while( true ) {\n try {\n Thread.sleep(10);\n if( leaderFlag && ServerState.getInstance().getSelfID() != LeaderState.getInstance().getLeaderID() ) {\n Thread.sleep( 1500 );\n Server destServer = ServerState.getInstance().getServers()\n .get( LeaderState.getInstance().getLeaderID() );\n\n MessageTransfer.sendServer(\n ServerMessage.getHeartbeat( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n //System.out.println( \"INFO : Sent heartbeat to leader s\" + destServer.getServerID() );\n }\n }\n\n catch( Exception e ) {\n leaderFlag = false;\n leaderUpdateComplete = false;\n System.out.println( \"WARN : Leader has failed!\" );\n // send election request\n Runnable sender = new BullyAlgorithm( \"Sender\", \"election\" );\n new Thread( sender ).start();\n }\n }\n\n case \"Sender\":\n switch( reqType ) {\n case \"election\":\n try {\n sendElectionRequest();\n } catch( Exception e ) {\n System.out.println( \"WARN : Server has failed, election request cannot be processed\" );\n }\n break;\n\n case \"ok\":\n try {\n sendOK();\n } catch( Exception e ) {\n e.printStackTrace();\n }\n break;\n\n case \"coordinator\":\n try {\n sendCoordinatorMsg();\n } catch( Exception e ) {\n e.printStackTrace();\n }\n break;\n }\n break;\n }\n }", "public static void main(String args[]) throws UnknownHostException, IOException {\n Scanner scanner = new Scanner(System.in); // Create scanner to allow keyboard input\n\n while(true) {\n System.out.print(\"INFO: Enter 1 to register\\n Enter 2 to login\\n Enter ´q´ to stop session\\n\");\n String state = scanner.nextLine();\n if (\"q\".equals(state)) {\n System.out.println(\"Exit!\"); // if keyboard input equal to ´q´ close client process\n break;\n }else if(\"1\".equals(state)){\n System.out.print(\"Enter username :\\n\");\n String username = scanner.nextLine(); // Waiting for keyboard input\n if(username.isEmpty()){System.out.println(\"please enter a username\"); username=scanner.nextLine();}\n System.out.println(\"Enter password :\\n\");\n String password = scanner.nextLine();\n if(password.isEmpty()){System.out.println(\"please enter a password\"); password=scanner.nextLine();}\n System.out.println(\"Enter name :\\n\");\n String name = scanner.nextLine();\n if(name.isEmpty()){System.out.println(\"please enter a name\"); name=scanner.nextLine();}\n\n System.out.println(\"Enter rate :\\n\");\n int rate = scanner.nextInt();\n if(rate == 0){System.out.println(\"please enter a rate = 1\"); username=scanner.nextLine();}\n\n System.out.println(\"choose a role from (main role, part role 1, part role 2)\");\n String role = scanner.nextLine();\n TeamMember member = new TeamMember(username,password,name,rate,role,state);\n thPoolClient.execute(new ClientSocketTask(member)); // create a new socket task\n\n }else if(\"2\".equals(state)){\n\n System.out.print(\"Enter username :\\n\");\n String username = scanner.nextLine(); // Waiting for keyboard input\n if(username.isEmpty()){System.out.println(\"please enter a username\"); username=scanner.nextLine();}\n System.out.println(\"Enter password :\\n\");\n String password = scanner.nextLine();\n if(password.isEmpty()){System.out.println(\"please enter a password\"); password=scanner.nextLine();}\n TeamMember member = new TeamMember(username, password, state);\n thPoolClient.execute(new ClientSocketTask(member)); // create a new socket task\n\n }else {\n System.out.println(\"Enter 1, 2 or q\");\n }\n thPoolClient.shutdown(); //shutdown the ThreadPool\n\n\n }\n }", "@Override\n public void run() {\n //Create output and input streams that read from and write to the client socket\n try (ObjectOutputStream outStream = new ObjectOutputStream(clientSocket.getOutputStream());\n ObjectInputStream inStream = new ObjectInputStream(clientSocket.getInputStream())) {\n\n System.out.println(\"New Server Thread Running for Client\" + clientSocket.getInetAddress());\n\n //Try to store the values from the input stream in numList\n try {\n numList = (ArrayList<Integer>) inStream.readObject();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(LargestSubsequenceConcurrentServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n System.out.println(\"Client: \" + clientIdNumber + \"\\nEntry \" + numList + \" Added\");\n //Passes numList, outputStream and the getSubSequence Function results to print function to handle output\n printNumbersList(numList, outStream, getSubsequence(numList));\n\n } catch (IOException e) {\n System.out.println(\"IOException:\" + e.getMessage());\n }\n }", "public ThreadedConnectionHandler(Socket clientSocket) {\r\n this.clientSocket = clientSocket;\r\n //Set up a service object to get the current date and time\r\n this.theDateService = new DateTimeService();\r\n //this.lngNumberOfReadings = 0;\r\n this.theTemperatureService = new TemperatureService();\r\n }", "void clientReady();", "public static void main(String[] args) {\n try {\r\n ServerSocket server=new ServerSocket(port);\r\n System.out.println(\"Waiting for a client...\");\r\n\r\n connections=new ArrayList<>();\r\n ExecutorService es = Executors.newFixedThreadPool(max_clients);\r\n\r\n Connection tmp;\r\n while(true) {\r\n\r\n\r\n Socket socket = server.accept();\r\n if(max_clients<=clients){\r\n OutputStream out = socket.getOutputStream();\r\n BufferedWriter rout= new BufferedWriter(new OutputStreamWriter(out));\r\n rout.write(\"Chat is full(\"+max_clients+\" users). You can't join. Try again later.\");\r\n rout.write(\"\\n\");\r\n rout.flush();\r\n socket.close();\r\n out.close();\r\n continue;\r\n }\r\n\r\n tmp=new Connection(socket);\r\n es.submit(tmp);\r\n clients++;\r\n System.out.println(\"New user has joined. Number of users - \"+clients);\r\n connections.add(tmp);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void run() {\n\t\t\n\t\ttry \n\t\t{\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\tsocket = socketserver.accept();\n\t\t\t\twriteListIdEmployee();\n\t socket.close();\n\t }\n\t \n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tsocketserver.close();\n\t\t\t} \n\t\t\tcatch (IOException e2) \n\t\t\t{\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void run() {\n P.print(\"Listening on port \"+P.port+\", waiting for incomming connection...\");\n try {\n ServerSocket serverSocket = new ServerSocket(P.port);\n while (P.choke_thread_running) { //read input forever.\n Receive receive_thread = new Receive();\n Socket s = serverSocket.accept();\n String addr = s.getInetAddress().toString();\n int p = s.getPort();\n int i;\n for(i = 0;i<P.peer_ip.length;i++){\n if(addr.equals(P.peer_ip[i])){\n P.sockets[i] = s;\n P.tcp_out_stream[i] = new ObjectOutputStream(s.getOutputStream());\n break;\n }\n }\n receive_thread.start(P,s,P.peer_id[--i]);\n P.print(\"Accepted incomming connection: ip = \"+addr.substring(1)+\", port = \"+p);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public void run()\n\t{\n\t\tint state = 1;\n\t\t\n\t\ttry \n\t\t{\n\t\t\t_socket = new Socket(_hostname, Integer.parseInt(_portnum));\n\t\t\t\t\t\t\n\t\t\t_sendBuf = new byte[_socket.getSendBufferSize()];\n\t\t\t_recBuf = new byte[_socket.getReceiveBufferSize()];\n\t\t\t\n\t\t\t_address = _socket.getInetAddress();\n\t\t\t_port = _socket.getPort();\n\t\t\t_user = new User(_myName, _address, _port);\n\t\t\t\n\t\t\t_sendBuf = toByteArray(_user);\n\t\t\t_socket.getOutputStream().write(Message.USER);\n\t\t\t_socket.getOutputStream().write(_sendBuf);\n\t\t\t_socket.getOutputStream().flush();\n\t\t\t\n\t\t\tstate = _socket.getInputStream().read();\n\t\t\t\n\t\t\twhile (state == 200)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Username already is use!\");\n\t\t\t\tbuildRelog();\n\t\t\t\tstate = _socket.getInputStream().read();\n\t\t\t\tSystem.out.println(state);\n\t\t\t\t_relogFrame.dispose();\n\t\t\t\t\n\t\t\t\tif (state != 200)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tClient._mainFrame.setTitle(\"Cr@p Talk: \" + _myName);\n\t\t\tClient._mainFrame.setVisible(true);\n\t\t\t\n\t\t\t\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\tMessage rec = new Message();\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tstate = _socket.getInputStream().read();\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tif (state == Message.HASHSET)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing hashset\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\tObject[] online = (Object[]) toObject(_recBuf);\n\t\t\t\t\t\tString[] onlineList = new String[online.length];\n\t\t\t\t\t\tfor (int i = 0; i < online.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonlineList[i] = (String) online[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tClient._userList.setListData(onlineList);\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.LOBBY)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing lobby\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\t\n\t\t\t\t\t\tClient._chatLog.append(\"[\" + rec.getOrigin() +\"]: \" + rec.getMessage() + \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.WHISPER)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing whisper\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\t\n\t\t\t\t\t\tClient._chatLog.append(\"[\" + rec.getOrigin() +\"(whisp)]: \" + rec.getMessage() + \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.SHARED)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing shared\");\n\t\t\t\t\t\tArrayList<String> files = new ArrayList<String>();\n\t\t\t\t\t\tScanner file = new Scanner(new File(\"shared.txt\"));\n\t\t\t\t\t\t\n\t\t\t\t while(file.hasNextLine()) \n\t\t\t\t {\n\t\t\t\t String line = file.nextLine();\n\t\t\t\t files.add(line);\n\t\t\t\t }\n\t\t\t\t _sendBuf = toByteArray(files.toArray());\n\t\t\t\t _socket.getOutputStream().write(Message.TEXT);\n\t\t\t\t _socket.getOutputStream().write(_sendBuf);\n\t\t\t\t\t\t_socket.getOutputStream().flush();\n\t\t\t\t\t\tSystem.out.println(\"sent data\");\n\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.RESULTS)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing results\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t \t\t\tObject[] lines = (Object[]) toObject(_recBuf);\n\t \t\t\t\n\t \t\t\tString[] mal = new String[lines.length];\n\t \t\t\t\n\t \t\t\tfor (int i = 0; i < lines.length; i++)\n\t \t\t\t{\n\t \t\t\t\tmal[i] = (String) lines[i];\n\t \t\t\t}\n\t \t\t\tbuildResultGUI(mal);\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.TEST)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing test\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\t\n\t\t\t\t\t\tString[] data = rec.getMessage().split(\"\\\\&\\\\&\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t_person = data[0];\n\t\t\t\t\t\t_fileName = data[1];\n\t\t\t\t\t\t_filePath = data[2];\n\t\t\t\t\t\t_comPort = Integer.parseInt(data[3]);\n\t\t\t\t\t\tSystem.out.println(\"*******SENDER PORT: \" + _comPort);\n\t\t\t\t\t\t_fileKey = data[4];\n\n\t\t\t\t\t\tString prompt = \"Upload \" + _fileName + \" to \" + _person + \"?\";\n\t\t\t\t\t\tint reply = JOptionPane.showConfirmDialog(null, prompt, \"Upload confirmation\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t \n\t\t\t\t\t\tif (reply == JOptionPane.YES_OPTION)\n\t\t\t\t {\t\t\t\t \n\t\t\t\t\t\t\tFile file = new File(_filePath);\n\t\t\t\t\t\t\tlong fileSize = file.length();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tArrayList<String> metaData = new ArrayList<String>();\n\t\t\t\t\t\t\tmetaData.add(\"\" + _comPort);\n\t\t\t\t\t\t\tmetaData.add(\"\" + fileSize);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_sendBuf = toByteArray(metaData.toArray());\n\t\t\t\t\t\t\t\n\t\t\t\t \tSystem.out.println(\"accepted\");\n\t\t\t\t \t_socket.getOutputStream().write(Message.ACCEPT);\n\t\t\t\t\t\t\t_socket.getOutputStream().flush();\n\t\t\t\t\t\t\t\n\t\t\t\t \t_socket.getOutputStream().write(_sendBuf);\n\t\t\t\t\t\t\t_socket.getOutputStream().flush();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tClient._sending = new SenderThread(_fileName, _filePath, _comPort, _fileKey);\n\t\t\t\t\t\t\tClient._sending.start();\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"declined\");\n\t\t\t\t \t_socket.getOutputStream().write(Message.DECLINE);\n\t\t\t\t\t\t\t_socket.getOutputStream().flush();\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.ACCEPT)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing accept\");\n\t\t\t\t\t\tlong fileSize = 0;\n\t\t\t\t\t\tint port = -1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t_fileKey = Client._key;\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t \t\t\tObject[] data = (Object[]) toObject(_recBuf);\n\t \t\t\t\n\t \t\t\tport = Integer.parseInt((String) data[0]);\n\t \t\t\tfileSize = Long.parseLong((String) data[1]);\n\t \t\t\t\n\t \t\t\tSystem.out.println(\"*******RECV PORT: \" + port);\n\t \t\t\t\n\t \t\t\tClient._receiving = new ReceiverThread(_fileName, _hostname, port, _fileKey, fileSize);\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep(300);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tClient._receiving.start();\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.DECLINE)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing decline\");\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"File transfer denied.\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.DC)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing dc\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\t\n\t\t\t\t\t\tClient._chatLog.append(rec.getMessage());\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.SERVERDOWN)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing serverdown\");\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Server has gone down...\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.ERROR)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing error\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"It's bad to talk to yourself...\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (state == Message.REMOVED)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"doing doing removed\");\n\t\t\t\t\t\t_socket.getInputStream().read(_recBuf);\n\t\t\t\t\t\trec = (Message) toObject(_recBuf);\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (SocketException e) \n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"Server is not responding\");\n\t\t\tSystem.exit(0);\n\t\t} \n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t\tcatch (ClassNotFoundException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (!client.isClosed()) {\n\t\t\t\t\tSystem.out.println(\"is socket connected\" + client.isConnected());\n\t\t\t\t\tInputStreamReader reader;\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\treader = new InputStreamReader(client.getInputStream());\n\t\t\t\t\t\tBufferedReader buf = new BufferedReader(reader);\n\t\t\t\t\t\tString msg = buf.readLine();\n\t\t\t\t\t\tif (msg != null) {\n\t\t\t\t\t\t\tSystem.out.println(\"server:\" + msg.toString());\n\t\t\t\t\t\t\tString ContextMsg = \"来自被连接的回复:\" + client.getInetAddress() + \"\\n\" + msg.toString();\n\t\t\t\t\t\t\ttextList.add(ContextMsg);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (IOException 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\t\t\t}\n\n\t\t\t}", "public static void main(String args[]){\n\n\n try {\n socket_obj = new Socket(ip, port_number);\n System.out.println(\"hello, i'm Connected!\");\n\n // br_obj = new BufferedReader(new InputStreamReader(socket_obj.getInputStream()));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n MorampudiClient Client_obj = new MorampudiClient();\n int number = 0;\n while(number < 1000)\n {\n Random r_obj = new Random();\n int probability = r_obj.nextInt(20);// getting the probability with which each event can happen\n // System.out.println(probability);\n /**\n * checking for the designated probabilities for each event in the process object to happen\n */\n if(probability >= 0 && probability < 7)\n {\n Client_obj.send_message();\n }\n else if(probability > 7 && probability < 14){\n Client_obj.receive_message();\n }\n else if(probability >= 14 && probability < 19)\n {\n Client_obj.internal_event();\n }\n else{\n Client_obj.byzantine_failure();\n }\n number++;\n }\n System.out.println(logical_clock);\n System.out.println(\"hello\");\n\n\n /**\n * object for the Client class\n */\n \n }", "@Override\n public void completed(AsynchronousSocketChannel sockChannel, AsynchronousServerSocketChannel serverSockMain ) {\n serverSockMain.accept( serverSockMain, this );\n\n //Print IP Address\n try{\n System.out.println( sockChannel.getLocalAddress());\n clientChannel = sockChannel;\n }catch(IOException e) {\n\n e.printStackTrace();\n }\n\n //Add To Client List\n //list.add(list.size(), sockChannel);\n\n //start to read message from the client\n startRead( sockChannel );\n \n }", "private TimerTask socketListener()\r\n\t{\r\n\t\tString theMessage;\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\tif (theSocket.isReady())\r\n\t\t\t{\r\n\t\t\t\t// blocks execution\r\n\t\t\t\t// get theMessage\r\n\t\t\t\ttheMessage = theSocket.getMessage();\r\n\t\t\t\tif (theMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"Our connection has ended!\", 0);\r\n\t\t\t\t\trunning = false;\r\n\t\t\t\t\t// if the message = null\r\n\t\t\t\t\t// the we need to check the socket again\r\n\t\t\t\t\t// just in case\r\n\t\t\t\t\t// close it nicely if we can\r\n\t\t\t\t\tif (theSocket != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttheSocket.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// otherwise just set it to null\r\n\t\t\t\t\t// set it to null regardless\r\n\t\t\t\t\ttheSocket = null;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// if the socket is OK\r\n\t\t\t\t\t// and the socket isReady\r\n\t\t\t\t\t// then display the input\r\n\t\t\t\t\twriteLine(theMessage, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end if theSocket !=null\r\n\t\treturn null;\r\n\t}", "public void saluteTheClient(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(0, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n\t\t\t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\n\tpublic void run() {\n\t\tServerSocket serverSocket;\n\t\tSocket socket;\n\t\tDataInputStream dis;\n\t\tDataOutputStream dos;\n\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(portNo);\n\t\t\tserverSocket.setSoTimeout(10000000);\n\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.println(COORDINATOR_WAIT_MSG);\n\t\t\t\tsocket = serverSocket.accept();\n\t\t\t\tdis = new DataInputStream(socket.getInputStream());\n\t\t\t\tdos = new DataOutputStream(socket.getOutputStream());\n\n\t\t\t\t// Check if threads are available in thread pool\n\t\t\t\tif (threadpool.getPoolSize() == MAX_THREADS) {\n\t\t\t\t\tSystem.out.println(PARTICIPANT_UNABLE_ACCEPT);\n\t\t\t\t\tdos.writeUTF(PARTICIPANT_UNABLE_ACCEPT);\n\t\t\t\t\tdos.flush();\n\t\t\t\t\tdos.close();\n\t\t\t\t\tdis.close();\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Connected to participant: \" + socket);\n\t\t\t\tdos.writeUTF(PARTICIPANT_CONN_ACCEPT);\n\t\t\t\tdos.flush();\n\t\t\t\tthreadpool.execute(new CoordinatorWorker(socket, dis, dos));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tthreadpool.shutdown();\n\t\t\ttry {\n\t\t\t\tthreadpool.awaitTermination(2, TimeUnit.MINUTES);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void callTheWaiter(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(7, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\n public void run(){\n System.out.println(clientID+\" run\");\n open();\n if(isHost){ //HostClient listening\n try{\n controller.sendHostAddress(ip, port);\n socket = hostSocket.accept();\n System.out.println(clientID+\": run: accept\");\n close(); //closes hostSocket\n connected = true;\n open(); //gets streams\n controller.sendConnect(); \n }catch(IOException e){\n System.out.println(clientID+\": run: accept: failed: IOException: \"+e);\n }\n }\n while(connected){ //interprets requests from other client\n try{\n String request = streamIn.readUTF();\n System.out.println(clientID+\": receive: \"+request);\n String response[] = request.split(\"<&>\");\n controller.interpretRequest(response);\n }catch(IOException ioe){\n System.out.println(clientID+\": receive: failed: IOException:\"+ioe);\n connected = false; \n }\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSocket socket = serverSocket.accept();\n\t\t\t\t\t\tclients.add(new Client(socket));\n\t\t\t\t\t\tSystem.out.println(\"[클라이언트 접속] \" + socket.getRemoteSocketAddress() + \": \"\n\t\t\t\t\t\t\t\t+ Thread.currentThread().getName());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tif (!serverSocket.isClosed()) {\n\t\t\t\t\t\t\tstopServer();\n\t\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}", "public void run(){\n\t\t\tObjectReader readerClient = new ObjectReader(in, clientInetAddress);\r\n\t\t\treaderClient.start();\r\n\t\t\t\r\n\t\t\t// Constantly checks msgToSend for messages and sends them\r\n\t\t\twhile(true){\r\n\t\t\t\ttry{\r\n\t\t\t\t\t// Send message\r\n\t\t\t\t\tif(msgToSend.length() != 0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tout.writeObject(new DataObject(DataObject.STRING, msgToSend.toString()));\r\n\t\t\t\t\t\tout.flush();\r\n\t\t\t\t\t\tmsgToSend.setLength(0);\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\tcatch(IOException ioe){\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "@Override\n public void run() {\n // When we read from the input stream, broadcast it to all client observers to relay to the clients via the respective socket.\n try {\n Object dataFromClient = inputFromClient.readObject();\n while (dataFromClient != null) {\n setChanged();\n if(dataFromClient instanceof Integer){\n Integer clientID = (Integer) dataFromClient;\n // This client sent its client id to be added to or removed from registered users. So, send the updated list to all observers to push to ALL clients.\n if(registeredUsers.contains(clientID)){\n removeClient(clientID);\n clientData.remove(clientID);\n }else {\n registeredUsers.add((Integer)dataFromClient); // Add the new client's future ID to the list of registered users. ID sent\n }\n System.out.println(\"Server sending \" + registeredUsers);\n notifyObservers(registeredUsers);\n }else if (dataFromClient instanceof Group){\n System.out.println(\"Server received \" + dataFromClient);\n Group group = (Group)dataFromClient;\n if(group.getGroupID() == -1){ // Indicates group is asking for proper id.\n group.setGroupID(currentGroupNumber);\n System.out.println(\"Here ya go, number \" + currentGroupNumber);\n currentGroupNumber++;\n }\n notifyObservers(group);\n }else{\n notifyObservers(dataFromClient);\n }\n System.out.println(\"Server sent \" + dataFromClient);\n dataFromClient = inputFromClient.readObject();\n }\n } catch (IOException | ClassNotFoundException e) {\n System.out.println(\"Could not read data from client\");\n }\n }", "public static void main(String[] args) throws IOException\n {\n Scanner sc=new Scanner(System.in);\n System.out.print(\"Enter Port No:\");\n int port=sc.nextInt();\n ServerSocket server_sokt=new ServerSocket(port); //Server Created \n System.out.println(\"Server Hosted at Port \"+port);\n\n while(true)\n {\n Socket socket_object=null; // Initialize Listening Socket\n try \n {\n socket_object=server_sokt.accept(); //Accept Connection Request from Client\n cnt+=1; \n DataInputStream inpt=new DataInputStream(socket_object.getInputStream());\n // String name=\"Client\"+cnt; // I can also put names like client1,client2 ......\n String name=inpt.readUTF(); // Read Name of Client \n System.out.println(\"Client \"+name+\" Connected\"); \n Thread new_client_thread=new ClientHandle(socket_object,inpt,name); // Creating a thread for a client\n new_client_thread.start(); //starting thread\n } \n catch (Exception e)\n {\n socket_object.close();\n e.printStackTrace();\n break;\n }\n }\n server_sokt.close();\n sc.close();\n }", "public void sendJob(int elevator) {\n\t\tbyte [] msg = createBytes(elevator);\n\t\ttry {\n\t\t\t\tsendPacket = new DatagramPacket(msg, msg.length, InetAddress.getLocalHost(), 5015);\n\t\t} catch (UnknownHostException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tSystem.out.print(\"Time: \" + System.currentTimeMillis() + \": Scheduler Thread 2: \");\n\t\tif (Constants.debug) {\n\t\t\tSystem.out.println(\"Destination host port: \" + sendPacket.getPort());\n\t\t\tint len = sendPacket.getLength();\n\t\t\tSystem.out.println(\"Length: \" + len);\n\t\t}\n\t\ttry {\n\t\t\tsendReceiveSocket.send(sendPacket);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tif (Constants.debug) {\n\t\t\tSystem.out.print(\"Time: \" + System.currentTimeMillis() + \": Scheduler Thread 2: \");\n\t\t\tSystem.out.println(\"Packet sent.\\n\");\t\n\t\t}\n\t}", "public void run() {\n\n // Start threadPool\n for (int i = 0; i < nbThreads; i++) {\n ThreadClient threadClient = new ThreadClient(listSocketDevice, String.valueOf(i), handler);\n arrayThreadClients.add(threadClient);\n threadClient.start();\n }\n\n while (true) {\n try {\n if (v) Log.d(TAG, \"Server is waiting on accept...\");\n ISocket isocket = acceptISocket();\n\n if (v) Log.d(TAG, isocket.getRemoteSocketAddress() + \" accepted\");\n listSocketDevice.addSocketClient(isocket);\n\n // Notify handler\n handler.obtainMessage(Service.CONNECTION_PERFORMED,\n isocket.getRemoteSocketAddress()).sendToTarget();\n\n } catch (SocketException e) {\n handler.obtainMessage(Service.LOG_EXCEPTION, e).sendToTarget();\n break;\n } catch (IOException e) {\n handler.obtainMessage(Service.LOG_EXCEPTION, e).sendToTarget();\n break;\n }\n }\n }", "private void addClient () {\n ArrayList<String> info = loadOnePlayerInfo();\n Ntotal++;\n Nnow++;\n\n System.out.println(\"Vai ser inicializado o utilizador \" + info.get(0));\n initThread(info.get(0), info.get(1));\n }", "private void beginAcceptClients() throws Exception {\r\n \t\tClientAcceptThread acceptClientsThread = new ClientAcceptThread(this.serverSocket, this);\r\n \t\tacceptClientsThread.start();\r\n \r\n \t\tLogger.logMessage(\"ClientAcceptThread started\");\r\n \t}", "@Override\n public void run() {\n while(true){\n //----------------ACCIONES QUE REALIZA EL HILO-----------------------\n if(isActive()){\n \n try {\n socket = serverSocket.accept(); //Espera una nueva conexion\n socket.setSoTimeout(10000); //Se espera recibir informacion durante 10 segundos\n dataInput = new BufferedReader(new InputStreamReader(socket.getInputStream()));//Se recibe informacion\n String data = dataInput.readLine();\n System.out.println(data);\n //Se disparan recien aqui las transiciones para evitar inconvenientes en caso de TimeOut\n monitor.disparar(transitions.get(0));\n monitor.disparar(transitions.get(1));//Se guarda en base de datos\n dataBase.insertEventWeb(data);\n monitor.disparar(transitions.get(2));\n } \n catch (SocketTimeoutException ex) { //En caso que haya expirado el TimeOut tengo que \n System.out.println(\"El tiempo a expirado\");\n }\n catch (IOException ex) {\n System.out.println(\"Error en Socket\");\n }\n try {\n socket.close();\n } \n catch (IOException ex) {\n System.out.println(\"Error al cerrar Socket\");\n }\n }\n }\n }", "ClientProcess(Socket socket)\r\n {\r\n\r\n id = IDCounter++;\r\n this.socket = socket;\r\n\r\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\r\n try\r\n {\r\n //set up i/o\r\n out = new ObjectOutputStream(socket.getOutputStream());\r\n in = new ObjectInputStream(socket.getInputStream());\r\n\r\n username = (String) in.readObject();\r\n displayMessage(\"***username + \" + \"JUST CONNECTED***\");\r\n userNames.add(username);\r\n }\r\n catch (IOException e) {\r\n displayMessage(\"Exception creating new Input/output Streams: \" + e);\r\n return;\r\n }\r\n\r\n\r\n catch (ClassNotFoundException e) {\r\n }\r\n\r\n System.out.println(\"complete\");\r\n }", "@Override\n public void completed(AsynchronousSocketChannel sockChannel, AsynchronousServerSocketChannel serverSock ) {\n serverSock.accept( serverSock, this );\n\n try{\n //Print IP Address\n System.out.println( sockChannel.getLocalAddress().toString());\n\n //Add To Client List\n list.add(list.size(), sockChannel);\n\n }catch(IOException e) {\n e.printStackTrace();\n }\n\n //start to read message from the client\n startRead( sockChannel );\n \n }", "public void takeABus() {\n\t\tClientCom clientCom = new ClientCom(RunParameters.ArrivalQuayHostName, RunParameters.ArrivalQuayPort);\n\t\twhile (!clientCom.open()) {\n\t\t\tSystem.out.println(\"Arrival Quay not active yet, sleeping for 1 seccond\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t\t;\n\t\tPassenger passenger = (Passenger) Thread.currentThread();\n\t\tMessage pkt = new Message();\n\t\tpkt.setType(MessageType.PASSENGERS_WAITING);\n\t\tpkt.setId(passenger.getPassengerId());\n\n\t\tclientCom.writeObject(pkt);\n\t\tpkt = (Message) clientCom.readObject();\n\n\t\tpassenger.setCurrentState(pkt.getState());\n\t\tclientCom.close();\n\t}", "public void run() {\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\n try\n {\n \t out_stream = socket.getOutputStream(); \n \t dos = new DataOutputStream(out_stream);\n \t output = new PrintWriter(socket.getOutputStream(), true);\n \t \n input = new BufferedReader( new InputStreamReader(socket.getInputStream()));\n \n \n }\n catch (IOException e) {\n System.out.println(\"Exception creating new Input/output Streams: \" + e);\n return;\n }\n System.out.println(\"Thread waiting for a String from the Client\");\n\n \n boolean active = true;\n \n //loop connection\n do{\n String cmd = null;\n \n if(socket.isConnected())\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t//line based input\n\t\t\t\t\t\t\tcmd = input.readLine(); \n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tauth_id=0;\n output.close();\n \n if(session0!=null)\n \tsession0.setLogout_time(System.currentTimeMillis());\n \n try {\n\t\t\t\t\t\t\t\tinput.close();\n\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tif(session0!=null)\n\t \tsession0.setLogout_time(System.currentTimeMillis());\n\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t // Handle the error\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\n if(cmd != null){\n // System.out.println(\"*\"+cmd+\"*\");\n switch(cmd.charAt(0)){\n /*\n username = client0\n\t\t\t\t\t\tpassword = oisjoseoisiusde\n\t\t\t\t\t\tkey = 0AnL]d`50m\n */\n \n \n case 'U' : username = cmd.substring(1);\n \t\t\t\tSystem.out.println(\"#\"+username+\"#\");\n \t\t\t\t//1. check if valid user in db\n \t\t\t\t\n \t\t\t\t//todo:\n \t\t\t\t//some security and length checks here\n \t\t\t\t\n \t\t\t\tString statement = \"select * from snesnet.user where username like '\"+ username +\"'\";\n \t\t\t int db_userid=0;\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tdb_userid = dao.getIntFromqueryDB(statement, \"userid\");\n\t\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\n\t\t\t\t\t\t\t\t\tif(db_userid!=0){\n\t\t\t\t\t\t\t\t\t\t\tif(addSession(username,db_userid)==0){ //2. is valid username - add session\n\t \t\t\t\t\t\tSystem.out.println(\"new session added: auth needed\");\n\t \t\t\t\t\t}else{\n\t \t\t\t\t\t\tSystem.out.println(\"old session: reauth needed\");\n\t \t\t\t\t\t\treauth=1;\n\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tid=db_userid;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// reference Session\n\t\t\t\t\t\t\t\t\tsession0 = getSession(db_userid);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//send iv\n\t\t\t\t\t\t\t\t\t\tiv = generateIV();\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"iv test: \"+iv);\n\t\t\t\t\t\t\t\t\t\toutput.println(\"IV \"+iv);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//send wrong username\n\t\t\t\t\t\t\t\t\t\toutput.println(\"ERROR\");\n\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\n \t\t\t\t//maybe add with unique db-id instead 1-333\n \t\t\t\n \t\t\t\n \t\t\t\tbreak;\n\t\t\t\t\t case 'P' : password = cmd.substring(1);\n\t\t\t\t\t System.out.println(\"#\"+password+\"#\");\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t String key=\"\";\n\t\t\t\t\t // System.out.println(\"id: \"+id);\n\t\t \t\t\t\tstatement = \"select * from snesnet.user where userid = '\"+ id +\"'\";\n\t\t \t\t\t \n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tkey = dao.getStringFromqueryDB(statement, \"key\");\n\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t String db_pw=\"\";\n\t\t\t\t\t // System.out.println(\"id: \"+id);\n\t\t \t\t\t\tstatement = \"select * from snesnet.user where userid = '\"+ id +\"'\";\n\t\t \t\t\t \n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tdb_pw = dao.getStringFromqueryDB(statement, \"password\");\n\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \t\tString iv_hex = bytesToHex(iv.getBytes());\n\t\t\t\t\t \t\tString key_hex = bytesToHex(key.getBytes());\n\t\t\t\t\t \t\tString pass_hex_crypt = password; //bytesToHex(password.getBytes());\n\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t // using the Runtime exec method:\n\t\t\t\t\t \tString exec = \"/home/tt/snesnet/trivium_cmd/trivium \"+key_hex+\" \"+iv_hex+\" \"+pass_hex_crypt;\n\t\t\t\t\t\t\t\t\t\t\tProcess p = null;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tp = Runtime.getRuntime().exec(exec);\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\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\t BufferedReader stdInput = new BufferedReader(new\n\t\t\t\t\t\t\t\t\t\t InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t // read the output from the command\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t String hex_pw = \"\"; \n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tString tmp = null;\n\t\t\t\t\t\t\t\t\t\t\t\twhile ((tmp = stdInput.readLine()) != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thex_pw = tmp.substring(5);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\t\t\t // System.out.println(\"enc2: \"+hex_pw); //pw in hex\n\t\t\t\t\t\t\t\t\t\t\t StringBuilder decoded_pw = new StringBuilder();\n\t\t\t\t\t\t\t\t\t\t\t for (int i = 0; i < hex_pw.length(); i+=2) {\n\t\t\t\t\t\t\t\t\t\t\t String str = hex_pw.substring(i, i+2);\n\t\t\t\t\t\t\t\t\t\t\t decoded_pw.append((char)Integer.parseInt(str, 16));\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t System.out.println( \"decoded: \"+ decoded_pw);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t//sqlquery :> if plain pw is the right one\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tString user_esc = username; //todo escape me first\n\t\t\t\t\t\t\t\t\t\t\t\tString pass_esc = decoded_pw.toString(); //todo escape me first\n\n\t\t\t\t\t\t\t\t\t\t\t\tString auth_query = \"SELECT userid FROM snesnet.user WHERE username = '\"+user_esc+\"' AND password = (SHA1(CONCAT_WS(':','\"+user_esc+\"','\"+pass_esc+\"')))\"; \n\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\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tauth_id = dao.getIntFromqueryDB(auth_query, \"userid\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t//not found -> null -> 0\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/*\t\t\t\t\t \n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException 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}\n\t\t\t\t\t\t*/\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(auth_id!=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t System.out.println( \"auth: access granted\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t output.println(\"OK\");\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t System.out.println( \"auth: access denied\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t output.println(\"ERROR\");\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t break;\n \n \n case 'C' : //command\n \t \t\t if(auth_id!=0){\n \t \t\t\t String value=cmd.substring(1);\n \t \t\t\t System.out.println(\"cmd: [\"+value+\"]\");\n \t \t\t\t \n \t \t\t\t \t\t//check if reauth\n \t \t\t\t \t\tif(reauth==0){\n \t \t\t\t \t\t\t//first byte is module id\n \t \t\t\t \t\t\tSystem.out.println(\"setting module:\"+value);\n \t \t\t\t \t\t\tswitch(value){\n \t \t\t\t \t\t\t case \"01\": session0.setModule(new TestModule(dos));\n \t \t\t\t \t\t\t \t\t\tbreak;\n \t \t\t\t \t\t\t case \"02\": session0.setModule(new DemoModule(dos));\n \t \t\t\t \t\t\t \t\t\t\t\t\tbreak; \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\t default: session0.setModule(new DummyModule(dos));\n \t \t\t\t \t\t\t}\n \t \t\t\t \t\t\t\n \t \t\t\t \t\t\t//setting in reauth mode not to add the next cmd as module\n \t \t\t\t \t\t\treauth=2;\n \t \t\t\t \t\t\n \t \t\t\t \t\t}else{\n \t \t\t\t \t\t\tif(reauth==1){ //real_reauth mode - set new dos\n \t \t\t\t \t\t\tSystem.out.println(\"setting new dos to module\");\n\t \t \t\t\t \t\t\tsession0.getModule().setDos(dos);\n\t \t \t\t\t \t\t\treauth=2;\n \t \t\t\t \t\t\t}\n \t \t\t\t \t\t\t\n \t \t\t\t \t\t\t//std module command\n \t \t\t\t \t\t\tsession0.getModule().setCommand(value);\n \t \t\t\t \t\t}\n\t\t \t \t\t\n\t\t \t \t\t \n\t\t \t \t\t\t/*if(value.equals(\"ff\")){\n\t\t \t \t\t\tstartTime = System.currentTimeMillis();\n\t\t \t \t\t\t}else if (value.equals(\"00\")){\n\t\t \t \t\t\t long stopTime = System.currentTimeMillis();\n\t\t \t \t\t long elapsedTime = stopTime - startTime;\n\t\t \t \t\t System.out.println(\"benchmark - 100 bytes: \"+elapsedTime+\" ms\");\n\t\t \t \t\t\t}else{\n\t\t \t \t\t\t System.out.println(\"pkt counter: \"+ (++pkt_cnt));\n\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 }\n \t \t\t //send command to modul inside session\n \t \t\t\tbreak;\n case 'Q' : //quit\n \t\t//log out\n \t try {\n \t \t auth_id=0;\n \t \t session0.setLogout_time(System.currentTimeMillis());\n \t \t \t active=false;\n output.close();\n input.close();\n System.out.println(\"Client quit\");\n }\n catch (Exception e) { \n }\n \t\n \tbreak;\n case 'X' : //clearList(output, input); \n \t\t\t\tbreak; //clear finished stopped\n \tdefault : break;\n }\n }else{\n \t //nullstring -> quit client\n \t try {\n \t \t auth_id=0;\n \t \t session0.setLogout_time(System.currentTimeMillis());\n \t \t \t active=false;\n output.close();\n input.close();\n System.out.println(\"Client quit\");\n }\n catch (Exception e) { \n }\n }\n \n //still active?\n }while(active);\n \n \n }", "@Override\n\tpublic void run()\n\t{\n\t\tThread serverWorker = new Thread(tcpServer); \n\t\tserverWorker.start(); \n\t\t\n\t\tThread clientManagerWorker = new Thread(clientManager);\n\t\tclientManagerWorker.start();\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\tif (tcpServer.newPlayer() == true)\n\t\t\t{\n\t\t\t\tnewClients = tcpServer.getNewClients();\n\t\t\t\tfor (Client client : newClients)\n\t\t\t\t{\n\t\t\t\t\tlog.log(\"GameEngine: Adding new client #\" + clients.size());\n\t\t\t\t\tgameState.addPlayer(client); \n\t\t\t\t\tclients.add(client); \n\t\t\t\t}\n\t\t\t\tnewClients.clear();\n\t\t\t}\n\t\t\t\n\t\t\tgameState.updatePlayers(clientManager.getPending()); \n\t\t\tgameState.update();\n\t\t\t\n\t\t\tString gameString = gameState.toJson();\n\t\t\t//System.out.println(gameString);\n\t\t\t//System.out.println(\"gameString length: \" + gameString.length());\n\t\t\ttry {\n\t\t\t\tsendUpdate(gameString, gameState.sequenceNumber);\n\t\t\t} catch (IOException e1) {\n\t\t\t\tlog.log(\"Failed to send update to clients\");\n\t\t\t\te1.printStackTrace();\n\t\t\t} \n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tThread.sleep(15);\n\t\t\t} \n\t\t\tcatch (InterruptedException e) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "void clientConnected(Client client);", "void closeSocket() {\n\t\tint size = threads.size();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (threads.get(i) == this) {\n\t\t\t\tthreads.remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tprintActiveClients();\n\n\t\ttry {\n\t\t\tmessageBuffer.add(name + \" has just left the chatroom...\");\n\t\t\tinputStream.close();\n\t\t\toutputStream.close();\n\t\t\tclientSocket.close();\n\t\t\treturn;\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t} catch (InterruptedException ine) {\n\t\t\treturn;\n\t\t}\n\t}", "@Override\r\n\tpublic void run() {\n\t\tString msg;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\tBufferedReader inFromClient =\r\n\t\t\t\t new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n\t\t\t\t DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());\r\n\t\t\t\t \r\n\t\t\t\t String clientSentence;\r\n\t\t\t\t while((clientSentence = inFromClient.readLine())!=null)\r\n\t\t\t\t {\t\r\n\t\t\t\t\t System.out.println(\"Received: \" + clientSentence);\r\n\t\t\t\t\t System.out.println(\"port: \" + socket.getPort());\r\n\r\n\t\t\t\t\t String newsentence = clientSentence + '\\n';\r\n\t\t\t\t\t outToClient.writeBytes(\"Server: \"+newsentence);\r\n\t\t\t\t\t \r\n\t\t\t\r\n\t\t\t\t }\r\n//\t\t\t\t \r\n//\t\t\t\t\treader.close();\r\n//\t\t\t\t\tinFromClient.close();\r\n//\t\t\t\t\toutToClient.close();\r\n//\t\t\t\t\tsocket.close();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(SocketException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Client has Disconnected\");\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void start() {\n try {\n Socket socket = new Socket(conf.getServerIp(), conf.getServerPort());\n\n java.io.InputStream is = socket.getInputStream();\n BufferedReader reader = new BufferedReader(new java.io.InputStreamReader(is));\n\n readerThread = new MessageReader(reader);\n new Thread(readerThread).start();\n\n java.io.OutputStream os = socket.getOutputStream();\n PrintWriter writer = new PrintWriter(os);\n writerThread = new MessageWriter(writer);\n new Thread(writerThread).start();\n\n while (serverMessages.empty()) {\n //Do nothing\n }\n\n ServerMessage serverMessage = serverMessages.pop();\n if (!serverMessage.getMessageType().equals(ServerMessage.MessageType.HELO)) {\n System.out.println(\"Expecting a HELO message but received: \" + serverMessage.toString());\n } else {\n System.out.println(\"Please fill in your username: \");\n Scanner scanner = new Scanner(System.in);\n String username = scanner.nextLine();\n\n\n ClientMessage heloMessage = new ClientMessage(ClientMessage.MessageType.HELO, username);\n clientMessages.push(heloMessage);\n\n while (serverMessages.empty()) {\n }\n\n\n isConnected = validateServerMessage(heloMessage, serverMessages.pop());\n if (!isConnected) {\n System.out.println(\"Error logging into server\");\n } else {\n System.out.println(\"Successfully connected to server.\");\n System.out.println(\"(Type '/quit' to close connection and stop application.)\");\n System.out.println(\"Type a broadcast message: \");\n nonblockReader = new NonblockingBufferedReader(new BufferedReader(new java.io.InputStreamReader(System.in)));\n\n\n while (isConnected) {\n String line = nonblockReader.readLine();\n if (line != null) {\n ClientMessage clientMessage;\n if (line.equals(\"/quit\")) {\n clientMessage = new ClientMessage(ClientMessage.MessageType.QUIT, username + \" left the server\");\n isConnected = false;\n\n Thread.sleep(500L);\n } else if (line.startsWith(\"/msg\") && line.split(\" \").length > 1) {\n //Split the message first\n String[] splittedline = line.split(\" \");\n String senderUsername = splittedline[1].toLowerCase();\n\n if (!senderUsername.equalsIgnoreCase(username)) {\n line = line.replace(\"/msg \" + splittedline[1] + \" \", \"\");\n\n //Check if we have an encryptionsession with the user or not\n if (encryptionSessionHashMap.containsKey(senderUsername)) {\n //We have an encryptionsession, so we can just send the message\n String encryptedLine = encryptionSessionHashMap.get(senderUsername).encryptMessage(line);\n clientMessage = new ClientMessage(ClientMessage.MessageType.ENCR, senderUsername + \" \" + encryptedLine);\n System.out.println(\"(You -> \" + senderUsername + \"): \" + line);\n } else {\n //We don't have an encryptionsession yet, so we create one\n EncryptionSession encryptionSession = new EncryptionSession();\n encryptionSessionHashMap.put(senderUsername, encryptionSession);\n clientMessage = new ClientMessage(ClientMessage.MessageType.KEYS, senderUsername + \" \" + encryptionSession.getPublicKey());\n savedMessage.put(senderUsername, line);\n }\n } else {\n System.out.println(\"You cannot send a message to yourself\");\n clientMessage = null;\n }\n } else if (line.startsWith(\"/file\") && line.split(\" \").length == 3) {\n //Split the message first\n String[] splitLine = line.split(\" \");\n String senderUsername = splitLine[1].toLowerCase();\n\n if (!senderUsername.equalsIgnoreCase(username)) {\n String fileBase64String = new FileTransfer(splitLine[2], senderUsername).sendFile();\n clientMessage = new ClientMessage(ClientMessage.MessageType.FILE, fileBase64String);\n System.out.println(\"You have send \" + splitLine[2] + \" to \" + senderUsername);\n } else {\n System.out.println(\"You cannot send a file to yourself\");\n clientMessage = null;\n }\n\n } else {\n clientMessage = new ClientMessage(ClientMessage.MessageType.BCST, line);\n System.out.println(line);\n }\n\n if (clientMessage != null) {\n clientMessages.push(clientMessage);\n }\n }\n if (!serverMessages.empty()) {\n ServerMessage received = serverMessages.pop();\n\n\n if (received.getMessageType().equals(ServerMessage.MessageType.BCST)) {\n System.out.println(received.getPayload());\n }\n\n //Check if we received an encrypted message\n else if (received.getMessageType().equals(ServerMessage.MessageType.ENCR)) {\n //Split the message first\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String encryptedMessage = splitMessage[1];\n\n //If we have a session with this user, we can decrypt the message\n if (encryptionSessionHashMap.containsKey(sender)) {\n System.out.println(\"(\" + sender + \" -> You): \" + encryptionSessionHashMap.get(sender).decryptMessage(encryptedMessage));\n }\n }\n\n //If this is the first time, we have to share keys\n else if (received.getMessageType().equals(ServerMessage.MessageType.KEYS)) {\n //Split the message first\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String encryptedKey = splitMessage[1];\n\n //Check if we send the first message or not\n if (encryptionSessionHashMap.containsKey(sender)) {\n encryptionSessionHashMap.get(sender).decryptKey(encryptedKey);\n\n //After saving the aes key, we have to resend our first message\n String msg = savedMessage.get(sender);\n if (msg != null) {\n String encryptedLine = encryptionSessionHashMap.get(sender).encryptMessage(msg);\n ClientMessage responseMessage = new ClientMessage(ClientMessage.MessageType.ENCR, sender + \" \" + encryptedLine);\n clientMessages.push(responseMessage);\n System.out.println(\"(You -> \" + sender + \"): \" + msg);\n savedMessage.remove(sender);\n }\n }\n\n //We send our aes key when we didn't send the message first\n else {\n EncryptionSession encryptionSession = new EncryptionSession();\n encryptionSessionHashMap.put(sender, encryptionSession);\n String aesKey = encryptionSession.encryptKey(encryptedKey);\n\n ClientMessage responseMessage = new ClientMessage(ClientMessage.MessageType.KEYS, sender + \" \" + aesKey);\n clientMessages.push(responseMessage);\n }\n }\n\n //Check if the message is a file\n else if (received.getMessageType().equals(ServerMessage.MessageType.FILE)) {\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String base64String = splitMessage[2];\n\n new FileTransfer(base64String, splitMessage[0], true).readFile();\n System.out.println(\"You have received \" + splitMessage[1] + \" from \" + sender);\n }\n }\n }\n }\n\n disconnect();\n System.out.println(\"Client disconnected!\");\n }\n } catch (IOException e) {\n System.out.println(\"Ouch! Could not connect to server!\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void run() {\n\t\t\tPrintWriter out = null;\n\t\t\ttry {\n\n\t\t\t\t/*\n\t\t\t\t * byte[] buf = new byte[2048]; DatagramPacket packet = new\n\t\t\t\t * DatagramPacket(buf, buf.length);\n\t\t\t\t * System.out.print(\"Server: Receiving\\n\");\n\t\t\t\t * incomingUDP.receive(packet);\n\t\t\t\t * \n\t\t\t\t * System.out.print(\"Receiving successful packet with :\" +\n\t\t\t\t * packet.getLength() + \"kb\");\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tout = new PrintWriter(new OutputStreamWriter(\n\t\t\t\t\t\tincoming.getOutputStream()));\n\n\t\t\t\t// inform the server of this new client\n\t\t\t\tServerNMS.this.addClient(out);\n\n\t\t\t\tout.print(\"Welcome to AndyChat! \");\n\t\t\t\tout.println(\"Enter BYE to exit.\");\n\t\t\t\tout.flush();\n\n\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\t\t\tincoming.getInputStream()));\n\t\t\t\tfor (;;) {\n\t\t\t\t\tString msg = in.readLine();\n\t\t\t\t\tif (msg == null) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (msg.trim().equals(\"BYE\"))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tSystem.out.println(\"Received: \" + msg\n\t\t\t\t\t\t\t\t+ \"With size is: \" + msg.getBytes().length\n\t\t\t\t\t\t\t\t+ \"bytes\");\n\t\t\t\t\t\t// broadcast the receive message\n\t\t\t\t\t\tServerNMS.this.broadcast(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tincoming.close();\n\n\t\t\t\tServerNMS.this.removeClient(out);\n\t\t\t} catch (Exception e) {\n\t\t\t\tif (out != null) {\n\t\t\t\t\tServerNMS.this.removeClient(out);\n\t\t\t\t}\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void run(){\n\tSystem.out.println(\"ServerListenerThread started!\");\n\t\t\t\twhile (parent.isWorking)\n\t\t\t\t{\n\n\t\t\t\t\tint t=0;\n\t\t\t\t\tString user = null,message=null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tt =Integer.parseInt(parent.inputStream.readLine());\n\t\t\t\t\t\tuser=parent.inputStream.readLine();\n\t\t\t\t\t\tmessage=parent.inputStream.readLine();\n\t\t\t\t\t\tif(t==MessageType.WILL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\">\"+user+\" wants to play!\");\n\t\t\t\t\t\t\tparent.parent.addWaiter(parent,user);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(t==MessageType.PRIVATE || t==MessageType.MOVE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"Inside message from: \"+user);\n\t\t\t\t\t\t\tparent.parent.sendPlayed(t,user,message);\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\tparent.parent.sendMessage(t, user, message);\n\t\t\t\t\t\t\tif(!parent.socket.isConnected())break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\n\t\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"Recevied a message from: \"+user+\": \"+message);\n\n\t\t\t\t}\n\t\t\t//END\n\t\t\tsynchronized(this)\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\tparent.inputStream.close();\n\t\t\t\t\tparent.outputStream.close();\n\t\t \tparent.socket.close();\n\t\t \tSystem.out.println(\"ServerListenerThread closed!\");\n\t\t }\n\t\t catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t\t}\n}", "public void run() {\n try {\n String receivedMessage = \"\";\n \t\twhile (!receivedMessage.startsWith(this.PSEUDO+\" left.\")) {\n \n byte[] buf = new byte[256];\n DatagramPacket packet = new DatagramPacket(buf, buf.length);\n \n clientSocket.receive(packet);\n receivedMessage = new String(packet.getData(), packet.getOffset(), packet.getLength());\n\n conversation.append(receivedMessage + \"\\n\");\n\n \t\t}\n \t\tSystem.exit(0);\n\n \t} catch (Exception e) {\n \tSystem.err.println(\"Error in ReceptionClientThread:\" + e); \n }\n }", "@Override\n public void run(){\n while(true){\n ArrayList<Thread> threads = new ArrayList<Thread>();\n \n //construct the string\n String message = String.format(\"hb|%d|%d\", serverPort, sequence);\n\n //have a thread to send heart beat\n for(ServerInfo peer : serverStatus.keySet()){\n //pass it to the client runnable\n Thread thread = new Thread(new SenderRunnable(peer, message));\n threads.add(thread);\n thread.start();\n }\n\n //wait for the completion\n for(Thread thread : threads){\n try{\n thread.join();\n }catch(Exception e){}\n \n \n }\n\n //increment the sequence by 1\n sequence += 1;\n\n //sleep for 2 secs\n try{\n Thread.sleep(2000);\n }catch(InterruptedException e){\n //System.err.println(e);\n }\n\n }\n }", "public ClientThread(Socket socket){\n this.socket = socket;\n }", "void main(String[] args) throws IOException {\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Server().setVisible(true);\n }\n });\n\t\t\n\t\tServerSocket ss=new ServerSocket(1234);\n\t\tSocket s;\n<<<<<<< HEAD\n \t\t\n=======\n \n\t\t\n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n\t\twhile(true) {\n\t\t\ts=ss.accept();\n\t\t\tSystem.out.println(\"New client request received \"+s );\n\t\t\t\n\t\t\tDataInputStream dis=new DataInputStream(s.getInputStream());\n\t\t\tDataOutputStream dos=new DataOutputStream(s.getOutputStream());\n\t\t\tString name=dis.readUTF();\n\t\t\t\n\t\t\tSystem.out.println(\"creating a new handler for this client..\");\n\t\t\t\n\t\t\tClientHandler mtch=new ClientHandler(s,name,dis,dos);\n\t\t\t\n\t\t\tThread t=new Thread(mtch);\n \n //print to server textArea\n<<<<<<< HEAD\n //msg_area.setText(msg_area.getText().trim()+\" \"+name+ \" Added to Server\\n\");\n\t\t\t\n \t\t\tSystem.out.println(\"Adding this client to active client list\");\n \n Activity.setText(Activity.getText().trim()+\"\\n\"+\"New Client:\"+name+\" is Connected\");\n Active.setText(Active.getText().trim()+\"\\n\"+ClientCount+\".\"+name);\n=======\n msg_area.setText(msg_area.getText().trim()+\" \"+name+ \" Added to Server\\n\");\n\t\t\t\n \t\t\tSystem.out.println(\"Adding this client to active client list\");\n \n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n \n\t\t\t\n\t\t\tar.add(mtch);\n \n<<<<<<< HEAD\n // Client.Refresh(ar);\n \n \n=======\n Active.addElement(name);\n \n final JList<String> ActiveList = new JList<>(Active); \n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n\t\t\t\n\t\t\tt.start();\n\t\t\t\n\t\t\tClientCount++;\n<<<<<<< HEAD\n \n \n=======\n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t}\n\t}\n \n\t\n\n//}\n\n \n \n \n ///end my code\n \n \n \n \n// public static void main(String args[]) {\n// /* Set the Nimbus look and feel */\n// //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n// /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n// * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n// */\n// try {\n// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n// if (\"Nimbus\".equals(info.getName())) {\n// javax.swing.UIManager.setLookAndFeel(info.getClassName());\n// break;\n// }\n// }\n// } catch (ClassNotFoundException ex) {\n// java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (InstantiationException ex) {\n// java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (IllegalAccessException ex) {\n// java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n// java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// }\n// //</editor-fold>\n//\n// /* Create and display the form */\n// java.awt.EventQueue.invokeLater(new Runnable() {\n// public void run() {\n// new Server().setVisible(true);\n// }\n// });\n// }\n\n // Variables declaration - do not modify//GEN-BEGIN:variables\n<<<<<<< HEAD\n private static javax.swing.JTextArea Active;\n private static javax.swing.JTextArea Activity;\n private javax.swing.JScrollPane jScrollPane1;\n private javax.swing.JScrollPane jScrollPane2;\n private javax.swing.JTextField jTextField1;\n=======\n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n private static javax.swing.JTextField msg_area;\n // End of variables declaration//GEN-END:variables\n}\n\n///client handler code start\nclass ClientHandler implements Runnable{\n\t \n\t Scanner scn=new Scanner(System.in);\n<<<<<<< HEAD\n\t String name;\n=======\n\t private String name;\n>>>>>>> 15ab5f76f7b86e84c76a59ddc836fa4658ef686e\n\t private DataInputStream dis;\n\t private DataOutputStream dos;\n\t Socket s;\n\t boolean isloggedin;\n\t \n\t public ClientHandler(Socket s, String name,DataInputStream dis,DataOutputStream dos) {\n\t\t \n\t\t this.dis=dis;\n\t\t this.name=name;\n\t\t this.dos=dos;\n\t\t this.isloggedin=true;\n \n\t\t \n\t }\n\n\t@Override\n\tpublic void run() {\n\t\tString received;\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\treceived=dis.readUTF();\n \n\t\t\t\tSystem.out.println(received+\" server\");\n\t\t\t\tif(received.contentEquals(\"logout\")) {\n\t\t\t\t\tthis.isloggedin=false;\n\t\t\t\t\tthis.dis.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//break message to message vs recepient\n\t\t\t\tStringTokenizer st=new StringTokenizer(received,\"#\");\n\t\t\t\tString MsgToSend=st.nextToken();\n\t\t\t\tString recepient=st.nextToken();\n\t\t\t\t\n\t\t\t\t//search recepient in active list\n\t\t\t\t\n\t\t\t\tfor(ClientHandler mc:Server.ar) {\n\t\t\t\t\tif(mc.name.contentEquals(recepient) && mc.isloggedin==true) {\n\t\t\t\t\t\tmc.dos.writeUTF(this.name+ \" : \" + MsgToSend+'\\n');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \n \n \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tthis.dis.close();\n\t\t\tthis.dos.close();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}\n\t\n}\n\n///client handler code end", "public void run()\n {\n try {\n clientSocket = serverSocket.accept();\n System.out.println(\"Client connected.\");\n clientOutputStream = new PrintWriter(clientSocket.getOutputStream(), true);\n clientInputStream = new BufferedReader( new InputStreamReader(clientSocket.getInputStream()));\n\n while(isRunning)\n {\n try {\n serverTick(clientSocket, clientOutputStream, clientInputStream);\n } catch (java.net.SocketException e)\n {\n //System.out.println(\"Network.Client closed connection. Ending server\");\n this.closeServer();\n }\n }\n } catch (Exception e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n\n /***Legacy Code for allowing multiple users. No point in spending time implementing\n * When this is just suppose to be one way communication\n\n try {\n acceptClients.join();\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n closeServer();\n */ }", "public void pingToClient() {\n Thread t = new Thread(() -> {\n while (connected) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n try {\n socketOut.writeObject(\"\");\n } catch (IOException e) {\n //e.printStackTrace();\n }\n }\n });\n t.start();\n }", "@Override\n public void run(){\n passwordChecker();\n System.out.println(\"you are connected\");\n System.out.println(\"Welcome :\" + UserName);\n\n try{\n PrintWriter toClient = new PrintWriter(socket.getOutputStream(), false);\n InputStream fromClient = socket.getInputStream();\n Scanner serverIn = new Scanner(fromClient);\n\n while(!socket.isClosed()){\n if(fromClient.available() > 0){\n if(serverIn.hasNextLine()){\n System.out.println(serverIn.nextLine());\n }\n }\n if(hasMessages){\n String nextMessage = \"\";\n synchronized(ChatMessage){\n nextMessage = ChatMessage.pop();\n hasMessages = !ChatMessage.isEmpty();\n }\n toClient.println(UserName + \" --> \" + nextMessage);\n toClient.flush();\n }\n }\n }\n catch(IOException e){\n e.printStackTrace();\n }\n\n }", "ClientThread(Server server, Socket socket) {\n // a unique id\n id = ++uniqueId;\n this.socket = socket;\n //Creating both Data Stream\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\n try {\n\n sOutput = new DataOutputStream(socket.getOutputStream());\n sInput = new DataInputStream(socket.getInputStream());\n // read the username\n username = sInput.readUTF();\n\n for(ClientThread clientThread : clientThreads){\n if(username.equals(clientThread.getUsername())){\n username = username +\n uniqueId +\n uniqueId / 2 +\n uniqueId * 3;\n }\n }\n\n\n/*\n for(int i = 0 ; i < clientThreads.size() ; i++){\n if(username.equals(clientThreads.get(i).getUsername())){\n writeMsg(\"choose another username: \");\n username = sInput.readUTF();\n i = 0;\n }\n }\n\n */\n\n\n\n server.broadcast(notification + username + \" has joined the chat room.\" + notification, getClientThreads());\n } catch (IOException e) {\n server.display(\"Exception creating new Input/output Streams: \" + e);\n return;\n }\n date = new Date().toString() + \"\\n\";\n }", "public static void main(String[] args) throws IOException {\n ServerSocket ss = new ServerSocket(3000);\n\n // infinite loop is running for getting client request\n while (true) {\n Socket serverSocket = null;\n\n try {\n // server socket object receive incoming client requests\n serverSocket = ss.accept();\n count++;\n\n System.out.println(\"A new client\" + clientNum++ + \" is connected : \" + serverSocket);\n\n // getting input and out streams\n DataInputStream dataInputStream = new DataInputStream(serverSocket.getInputStream());\n DataOutputStream dataOutputStream = new DataOutputStream(serverSocket.getOutputStream());\n\n System.out.println(\"Allocating new thread for this client\" + clientNum);\n\n // create a new thread object\n Thread newThread = new ClientHandler(serverSocket, dataInputStream, dataOutputStream, count);\n\n // Invoking the start() method\n newThread.start();\n\n } catch (Exception e) {\n serverSocket.close();\n e.printStackTrace();\n }\n }\n }", "public void run() {\n // Create a socket to wait for clients.\n try {\n //Set up all the security needed to run an SSLServerSocket for clients to connect to.\n SSLContext context = SSLContext.getInstance(\"TLS\");\n KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(\"SunX509\");\n KeyStore keyStore = KeyStore.getInstance(\"JKS\");\n\n keyStore.load(new FileInputStream(\"./keystore.txt\"), \"storepass\".toCharArray());\n keyManagerFactory.init(keyStore, \"keypass\".toCharArray());\n context.init(keyManagerFactory.getKeyManagers(), null, null);\n\n SSLServerSocketFactory factory = context.getServerSocketFactory();\n SSLServerSocket sslServerSocket = (SSLServerSocket) factory.createServerSocket(conf.SERVER_PORT);\n threads = new HashSet<>();\n\n while (true) {\n //Just keep running until the end of times (or until you're stopped.)\n // Wait for an incoming client-connection request (blocking).\n SSLSocket socket = (SSLSocket) sslServerSocket.accept();\n\n // When a new connection has been established, start a new thread.\n ClientThreadPC ct = new ClientThreadPC(this, socket);\n threads.add(ct);\n new Thread(ct).start();\n System.out.println(\"Num clients: \" + threads.size());\n\n // Simulate lost connections if configured.\n if (conf.doSimulateConnectionLost()) {\n DropClientThread dct = new DropClientThread(ct);\n new Thread(dct).start();\n }\n }\n } catch (IOException | KeyManagementException | KeyStoreException | UnrecoverableKeyException |\n NoSuchAlgorithmException | CertificateException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}" ]
[ "0.6519089", "0.62265515", "0.6081188", "0.5993119", "0.5949336", "0.5923613", "0.59200597", "0.5899596", "0.5893418", "0.580709", "0.57772356", "0.5777086", "0.57758856", "0.5752365", "0.57464266", "0.5735779", "0.57283354", "0.571941", "0.56728524", "0.5670326", "0.5667276", "0.5658995", "0.5648141", "0.56311315", "0.56083834", "0.5590633", "0.5570766", "0.55532223", "0.55232203", "0.5509502", "0.5507213", "0.5502807", "0.5502206", "0.5501735", "0.5494622", "0.54936033", "0.5480334", "0.5469194", "0.5456943", "0.54568255", "0.5443931", "0.5442923", "0.5437793", "0.54363453", "0.5431955", "0.5422225", "0.5418569", "0.5418056", "0.5412394", "0.54066813", "0.54052794", "0.54020125", "0.5392153", "0.5391173", "0.53744006", "0.5372614", "0.5367695", "0.5363496", "0.53584015", "0.5348603", "0.53482294", "0.5344647", "0.53445774", "0.5342915", "0.53313845", "0.5330724", "0.53299093", "0.53251636", "0.5324685", "0.5323713", "0.5322568", "0.53181934", "0.5317364", "0.5311622", "0.5308758", "0.530705", "0.53041565", "0.53006923", "0.53002363", "0.5292163", "0.52840745", "0.52833796", "0.5262807", "0.52601504", "0.52520955", "0.5251677", "0.5251381", "0.5245433", "0.5241468", "0.5240049", "0.5239738", "0.5232954", "0.5230332", "0.5221646", "0.5220598", "0.520371", "0.5202459", "0.52023256", "0.51989156", "0.51951665" ]
0.65554744
0
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView thumbnail = (ImageView) findViewById(R.id.thumbnail); Bitmap bmSource = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); Bitmap bmThumbnail = ThumbnailUtils.extractThumbnail(bmSource, Thumbnail_WIDTH, Thumbnail_HEIGHT); thumbnail.setImageBitmap(bmThumbnail); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "protected void onCreate() {\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "protected void onFirstTimeLaunched() {\n }", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }", "@Override\n public void onCreate() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}", "@Override\n public void onCreate() {\n\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "public void onCreate() {\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}", "@Override\n\tpublic void onCreate() {\n\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }", "@Override\n public void onCreate()\n {\n\n\n }", "@Override\n\tprotected void onCreate() {\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}", "public void onCreate();", "public void onCreate();", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }", "@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}", "@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }", "@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}", "@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }" ]
[ "0.791686", "0.77270156", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7637394", "0.7637394", "0.7629958", "0.76189965", "0.76189965", "0.7543775", "0.7540053", "0.7540053", "0.7539505", "0.75269467", "0.75147736", "0.7509639", "0.7500879", "0.74805456", "0.7475343", "0.7469598", "0.7469598", "0.7455178", "0.743656", "0.74256307", "0.7422192", "0.73934627", "0.7370002", "0.73569906", "0.73569906", "0.7353011", "0.7347353", "0.7347353", "0.7333878", "0.7311508", "0.72663945", "0.72612154", "0.7252271", "0.72419256", "0.72131634", "0.71865886", "0.718271", "0.71728176", "0.7168954", "0.7166841", "0.71481615", "0.7141478", "0.7132933", "0.71174103", "0.7097966", "0.70979583", "0.7093163", "0.7093163", "0.7085773", "0.7075851", "0.7073558", "0.70698684", "0.7049258", "0.704046", "0.70370424", "0.7013127", "0.7005552", "0.7004414", "0.7004136", "0.69996923", "0.6995201", "0.69904065", "0.6988358", "0.69834954", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69783133", "0.6977392", "0.69668365", "0.69660246", "0.69651115", "0.6962911", "0.696241", "0.6961096", "0.69608897", "0.6947069", "0.6940148", "0.69358927", "0.6933102", "0.6927288", "0.69265485", "0.69247025" ]
0.0
-1
=====getter and setter ===
public void setDataSet(DataSet dataSet) { this.dataSet = dataSet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract Set method_1559();", "String setValue();", "@Override\n public void get() {}", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "public T get() {\n return value;\n }", "@Override\n String get();", "public T get() {\n return value;\n }", "public T get() {\n return value;\n }", "public String get();", "public Object get()\n {\n return m_internalValue;\n }", "public abstract String get();", "public void get() {\n }", "boolean get();", "public V get() {\n return value;\n }", "public Object getNewValue()\n {\n return newValue;\n }", "public String get()\n {\n return this.string;\n }", "public int\t\tget() { return value; }", "public void setdat()\n {\n }", "public String setter() {\n\t\treturn prefix(\"set\");\n\t}", "public Object getValue(){\n \treturn this.value;\n }", "public String getValue() {\n/* 99 */ return this.value;\n/* */ }", "public int getAge() {return age;}", "public int getlife(){\r\n return life;\r\n}", "public int getSet() {\n return set;\n }", "boolean getSet();", "public void setAge(int age) { this.age = age; }", "public Object getValue() { return _value; }", "public int getAge(){\n return age;\n }", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "public String get()\n {\n return val;\n }", "@Test\n public void testSongGettersSetters() {\n Integer id = 4;\n String title=\"title\",uri = \"uri\";\n\n Song song = new Song();\n song.setId(id);\n song.setTitle(title);\n song.setUri(uri);\n\n assertEquals(\"Problem with id\",id, song.getId());\n assertEquals(\"Problem with title\",title, song.getTitle());\n assertEquals(\"Problem with uri\",uri, song.getUri());\n }", "public int value() { \n return this.value; \n }", "public String get() {\n return value;\n\t}", "public Value makeSetter() {\n Value r = new Value(this);\n r.setters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }", "public byte[] get(){\n return this.value;\n }", "public Object getValue()\n {\n\treturn value;\n }", "public void setPrice(double price){this.price=price;}", "public Object getValue() { return this.value; }", "@Test\n\tpublic void get_test()\n\t{\n\t\tb.set(1,2,'x');\n\t\tassertEquals(b.get(1,2),'x');\n\t}", "@Override\n public Object getValue()\n {\n return value;\n }", "public int getAge()\r\n {\r\n return age;\r\n }", "String get();", "String get();", "public int get () { return rating; }", "public String get() {\n return this.value;\n }", "public int getArmadura(){return armadura;}", "@Test\r\n\tpublic void testGettersSetters()\r\n\t{\r\n\t\tPerson p = new Person(42);\r\n\t\tp.setDisplayName(\"Fred\");\r\n\t\tassertEquals(\"Fred\", p.getFullname());\r\n\t\tp.setPassword(\"hunter2\");\r\n\t\tassertEquals(\"hunter2\", p.getPassword());\r\n\t\tassertEquals(42, p.getID());\r\n\t}", "@Override\r\n public Object getValue() {\r\n return value;\r\n }", "public abstract void set(M newValue);", "String getValue() {\n return mValue;\n }", "public String getValor()\n/* 17: */ {\n/* 18:27 */ return this.valor;\n/* 19: */ }", "public int getx(){\r\n return z;\r\n}", "V getValue() {\n return value;\n }", "public Value getValue(){\n return this.value;\n }", "private void assignment() {\n\n\t\t\t}", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "public S getValue() { return value; }", "public int getValue(){\n return this.value;\n }", "public double getPrice(){return price;}", "public int getNumber(){return number;}", "public void setX(int x) { this.x=x; }", "protected Object doGetValue() {\n\t\treturn value;\n\t}", "@Override\n \tpublic IValue getValue() {\n \t\treturn this;\n \t}", "public final Object get() {\n return getValue();\n }", "@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}", "public int getAge()\n {\n return age;\n }", "public abstract Object getValue();", "public abstract Object getValue();", "public abstract Object getValue();", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }", "public int getValue() \n {\n return value;\n }", "@Test\n\tpublic void testSet() {\n\t}", "double sety(double y) {\nreturn this.y;\n }", "@Override\n\t\tpublic V setValue(V p1){\n\t\t\treturn p1;\n\t\t}", "private interface Valuable extends Base {\n\t\tString getValue();\n\t\tvoid setValue(String value);\n\t}", "@Test\n public void testSetNombre() {\n System.out.println(\"setNombre\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n String expResult = \"nom1\";\n String result = instance.getNombre();\n assertEquals(expResult, result);\n }", "@Override\n\tpublic void set() {\n\t\tSystem.out.println(\"A==========set\");\n\t}", "public Empleado getEmpleado()\r\n/* 183: */ {\r\n/* 184:337 */ return this.empleado;\r\n/* 185: */ }", "@Override\n\tpublic T somme() {\n\t\treturn val;\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void setValue(T value) {\n/* 89 */ this.value = value;\n/* */ }", "public int getf(){\r\n return f;\r\n}", "public Value makeGetter() {\n Value r = new Value(this);\n r.getters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }", "public int getPrice(){\n return price;\n }", "public Student getStudent() { return student; }", "public void set()\r\n {\r\n isSet = true;\r\n }", "int getBlue(){\n\n return this.blue;\n }", "private ReadProperty()\r\n {\r\n\r\n }", "public int geti(){\r\n return i;\r\n}", "protected V getValue() {\n return this.value;\n }", "@Override\n\tpublic void set(T e) {\n\t\t\n\t}", "public Object getVal()\n { return val; }", "public int value(){\n return this.value;\n }", "private void setData() {\n\n }", "public void setValue(Object value) { this.value = value; }", "@Override\n\tpublic void setValue(Object value) {\n\t\t\n\t}", "@Override\r\n\tpublic String get() {\n\t\treturn null;\r\n\t}", "public int getX(){return this.x;}", "public int getValue(){\n return value;\n }" ]
[ "0.68746555", "0.6669855", "0.6592208", "0.65716314", "0.65195763", "0.6489604", "0.64769495", "0.64769495", "0.64741004", "0.6390364", "0.63812256", "0.63475984", "0.63428676", "0.63208425", "0.6320077", "0.6239044", "0.62389517", "0.62387156", "0.6236269", "0.6202517", "0.6194557", "0.61909187", "0.61868364", "0.6148265", "0.61218965", "0.6106565", "0.6104702", "0.61024547", "0.6097983", "0.607597", "0.6068097", "0.60675204", "0.60631776", "0.60544753", "0.6053797", "0.6040871", "0.60309136", "0.60286826", "0.60245436", "0.60190547", "0.5992833", "0.5991962", "0.5991962", "0.59903026", "0.59766936", "0.5963892", "0.5960691", "0.5958991", "0.5958429", "0.59551746", "0.5945767", "0.5941649", "0.59338105", "0.59259015", "0.5918368", "0.59144914", "0.59144914", "0.59092504", "0.58966815", "0.5887246", "0.58835185", "0.58798933", "0.5871371", "0.587073", "0.5861605", "0.58615756", "0.58578897", "0.5855421", "0.5855421", "0.5855421", "0.5851118", "0.5848981", "0.5848366", "0.58414906", "0.5841178", "0.58407253", "0.5837665", "0.58357847", "0.58332515", "0.58319557", "0.5816554", "0.5813777", "0.58028555", "0.5802604", "0.5800858", "0.5797123", "0.5795033", "0.578993", "0.5788359", "0.57828796", "0.57828385", "0.5778897", "0.57675683", "0.5763743", "0.5762737", "0.5760473", "0.57572675", "0.5756459", "0.57556385", "0.5754421", "0.5752262" ]
0.0
-1
to save customer/pet details
public Customer saveCustomerDetails(Customer customer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void save() {\n Toast.makeText(ContactActivity.this, getString(R.string.save_contact_toast), Toast.LENGTH_SHORT).show();\n\n String nameString = name.getText().toString();\n String titleString = title.getText().toString();\n String emailString = email.getText().toString();\n String phoneString = phone.getText().toString();\n String twitterString = twitter.getText().toString();\n \n if (c != null) {\n datasource.editContact(c, nameString, titleString, emailString, phoneString, twitterString);\n }\n else {\n \tc = datasource.createContact(nameString, titleString, emailString, phoneString, twitterString);\n }\n }", "@Override\n\tpublic void saveUserInfo(Customer customer) {\n\t\t\n\t}", "@Override\r\n\tpublic void saveCustomer(CRMDto theCustomer) {\n\t\t\r\n\t\tSession session = factory.openSession();\r\n\t\tTransaction tx = session.beginTransaction();\r\n\t\tsession.update(theCustomer);\r\n\t\ttx.commit();\r\n\t\t//System.out.println(\"pk update is \" +pk);\r\n\t\t\r\n\t\t\r\n\t}", "private void savePet() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String nameString = mNameEditText.getText().toString().trim();\n String breedString = mBreedEditText.getText().toString().trim();\n String weightString = mWeightEditText.getText().toString().trim();\n\n if (mCurrentPetUri == null && TextUtils.isEmpty(nameString) && TextUtils.isEmpty(breedString) &&\n TextUtils.isEmpty(weightString) && mGender == PetContract.PetEntry.GENDER_UNKNOWN) {\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and pet attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(PetContract.PetEntry.COLUMN_PET_NAME, nameString);\n values.put(PetContract.PetEntry.COLUMN_PET_BREED, breedString);\n values.put(PetContract.PetEntry.COLUMN_PET_GENDER, mGender);\n\n int weight = 0;\n if (!TextUtils.isEmpty(weightString)) {\n weight = Integer.parseInt(weightString);\n }\n values.put(PetContract.PetEntry.COLUMN_PET_WEIGHT, weight);\n\n if (mCurrentPetUri == null) {\n\n Uri newUri = getContentResolver().insert(PetContract.PetEntry.CONTENT_URI, values);\n if (newUri == null) {\n Toast.makeText(this, \"Failed to save Pet\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Save successfully\", Toast.LENGTH_SHORT).show();\n }\n\n } else {\n\n int rowsAffected = getContentResolver().update(mCurrentPetUri, values, null, null);\n if (rowsAffected == 0) {\n Toast.makeText(this, \"Failed to update Pet\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Update Successfully \", Toast.LENGTH_SHORT).show();\n }\n\n\n Toast.makeText(this, \"Successfully saved pet\", Toast.LENGTH_SHORT).show();\n }\n }", "public String save() {\n\t\tSystem.out.println(\"Action数据封装\"+customer);\n\t\tcustomerService.save(customer);\n\t\treturn NONE;\n\t}", "public void saveInformation(){\n market.saveInformationOfMarket();\n deckProductionCardOneBlu.saveInformationOfProductionDeck();\n deckProductionCardOneGreen.saveInformationOfProductionDeck();\n deckProductionCardOneViolet.saveInformationOfProductionDeck();\n deckProductionCardOneYellow.saveInformationOfProductionDeck();\n deckProductionCardThreeBlu.saveInformationOfProductionDeck();\n deckProductionCardThreeGreen.saveInformationOfProductionDeck();\n deckProductionCardThreeYellow.saveInformationOfProductionDeck();\n deckProductionCardThreeViolet.saveInformationOfProductionDeck();\n deckProductionCardTwoBlu.saveInformationOfProductionDeck();\n deckProductionCardTwoGreen.saveInformationOfProductionDeck();\n deckProductionCardTwoViolet.saveInformationOfProductionDeck();\n deckProductionCardTwoYellow.saveInformationOfProductionDeck();\n\n\n }", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "public void save(MakerBean maker) {\n\t\t\r\n\t\tSystem.out.println(\"############################### Save\");\r\n\t\tSystem.out.println(\"createBy : \" + maker.getUpdateBy() + \r\n\t\t\t\t\" || maker_ID: \" + maker.getMaker_ID() + \r\n\t\t\t\t\" || maker_name: \" + maker.getMaker_name() +\t\t\t\t\r\n\t\t\t\t\" || maker_contactName: \" + maker.getMaker_contactName() + \r\n\t\t\t\t\" || maker_contactLastName: \" + maker.getMaker_contactLastName() +\r\n\t\t\t\t\" || maker_tel: \" + maker.getMaker_tel() +\r\n\t\t\t\t\" || maker_address1: \" + maker.getMaker_address1() + \r\n\t\t\t\t\" || maker_province: \" + maker.getMaker_province() +\r\n\t\t\t\t\" || maker_email: \" + maker.getMaker_email() +\r\n\t\t\t\t\" || activeFlag: \" + maker.getActiveFlag());\t\r\n\t\t\r\n\t\ttry {\r\n\r\n\t\t\tString query =\t\"INSERT INTO tb_maker (maker_ID,maker_name,maker_tel\"\r\n\t\t\t\t\t+ \",maker_contactName,maker_contactLastName,maker_address1,maker_province,maker_email\"\r\n\t\t\t\t\t+ \",activeFlag,CreateDate,CreateBy) \"+\r\n\t\t\t\t\t\t\t\"VALUES (?,?,?,?,?,?,?,?,?,getdate(),? ) \";\r\n\t\t\tjdbcTemplate.update(query,\r\n\t\t\t\t\tnew Object[] { \r\n\t\t\t\t\t\t\tmaker.getMaker_ID(),\r\n\t\t\t\t\t\t\tmaker.getMaker_name(),\r\n\t\t\t\t\t\t\tmaker.getMaker_tel(),\r\n\t\t\t\t\t\t\tmaker.getMaker_contactName(),\r\n\t\t\t\t\t\t\tmaker.getMaker_contactLastName(),\r\n\t\t\t\t\t\t\tmaker.getMaker_address1(),\r\n\t\t\t\t\t\t\tmaker.getMaker_province(),\r\n\t\t\t\t\t\t\tmaker.getMaker_email(),\r\n\t\t\t\t\t\t\tmaker.getActiveFlag(),\r\n\t\t\t\t\t\t\tmaker.getCreateBy(),\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \t\t\t\r\n\t}", "@Override\n\tpublic void saveCustomer(AMOUNT theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// save the customer ... \n\t\tcurrentSession.save(theCustomer);\n\t}", "public void savePerson()\r\n { \r\n\t/*get values from text fields*/\r\n\tname = tfName.getText();\r\n\taddress = tfAddress.getText();\r\n\tphone = Integer.parseInt(tfPhone.getText());\r\n\temail = tfEmail.getText();\r\n\r\n\tif(name.equals(\"\"))\r\n\t{\r\n\t\tJOptionPane.showMessageDialog(null, \"Please enter person name.\");\r\n\t}else\r\n {\r\n\r\n\t /*create a new PersonInfo object and pass it to PersonDAO to save it*/\r\n\t PersonInfo person = new PersonInfo(name, address, phone, email);\r\n\t pDAO.savePerson(person);\r\n\r\n\t JOptionPane.showMessageDialog(null, \"Record added\");\r\n }\r\n }", "@FXML\n public void saveCust(ActionEvent event) throws SQLException {\n\n if (completionCheck() < 0)\n return;\n\n int id = Integer.parseInt(idTB.getText().trim());\n\n CustomerDAOImpl.updateCustomer(id , nameTB.getText().trim(), addressTB.getText().trim(), postCodeTB.getText().trim(), stateProvinceCB.getSelectionModel().getSelectedItem().toString(), phone.getText());\n\n AlertMessage.addCustomerInfo();\n\n stage = (Stage)((Button) event.getSource()).getScene().getWindow();\n try {\n scene = FXMLLoader.load(getClass().getResource(\"../View_Controller/MainScreen.fxml\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n stage.setScene(new Scene(scene));\n stage.show();\n }", "private void savePet() {\n String xtasyidString = xtasyid.getText().toString().trim();\n String nameString = name.getText().toString().trim();\n String emailString = email.getText().toString().trim();\n String collegeString = college.getText().toString().trim();\n String contactString = contact.getText().toString().trim();\n String genderString = gender.getText().toString().trim();\n String extrasString = extras.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentPetUri == null && TextUtils.isEmpty(nameString) && TextUtils.isEmpty(emailString) ) {\n // Since no fields were modified, we can return early without creating a new pet.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and pet attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(PetEntry.COLUMN_PET_ID, xtasyidString);\n values.put(PetEntry.COLUMN_PET_NAME, nameString);\n values.put(PetEntry.COLUMN_PET_EMAIL, emailString);\n values.put(PetEntry.COLUMN_PET_COLLEGE, collegeString);\n values.put(PetEntry.COLUMN_PET_CONTACT, contactString);\n values.put(PetEntry.COLUMN_PET_GENDER, genderString);\n values.put(PetEntry.COLUMN_PET_EXTRAS, extrasString);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentPetUri == null) {\n // This is a NEW pet, so insert a new pet into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(PetEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_pet_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_pet_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING pet, so update the pet with content URI: mCurrentPetUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentPetUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentPetUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_pet_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_pet_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "private Customer createCustomerData() {\n int id = -1;\n Timestamp createDate = DateTime.getUTCTimestampNow();\n String createdBy = session.getUsername();\n\n if (action.equals(Constants.UPDATE)) {\n id = existingCustomer.getCustomerID();\n createDate = existingCustomer.getCreateDate();\n createdBy = existingCustomer.getCreatedBy();\n }\n\n String name = nameField.getText();\n String address = addressField.getText() + \", \" + cityField.getText();\n System.out.println(address);\n String postal = postalField.getText();\n String phone = phoneField.getText();\n Timestamp lastUpdate = DateTime.getUTCTimestampNow();\n String lastUpdatedBy = session.getUsername();\n\n FirstLevelDivision division = divisionComboBox.getSelectionModel().getSelectedItem();\n int divisionID = division.getDivisionID();\n\n return new Customer(id, name, address, postal, phone, createDate, createdBy, lastUpdate, lastUpdatedBy, divisionID);\n }", "protected void Save() {\n\t\tString WareName = txtWareName.getText().trim();\n\t\tint WareCap = Integer.parseInt(txtWareCap.getText().trim());\n\t\tString WareAddress = txtWareAddress.getText().trim();\n\t\tint WareUser = Integer.parseInt(txtWareUser.getText().trim());\n\t\tWareUserDto wud = new WareUserDto();\n\t\t\n\t\twud.setWareID(this.wud.getWareID());\n\t\twud.setWareName(WareName);\n\t\twud.setWareCap(WareCap);\n\t\twud.setWareAddress(WareAddress);\n\t\twud.setWareUser(WareUser);\n\t\t\n\t\tif(service.updateWareUserService(wud)){\n\t\t\tList<WareUserDto> list = service.getWareHouseAllInfo();\n\t\t\t//bwj.setTabDate(list);\n\t\t\tbtnWareJDialog.setTabDate(list);\n\t\t\tthis.dispose();\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(this, \"修改失败\", \"错误\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void saveCustomer(Customer theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\t// save the customer\n\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t\t//currentSession.save(theCustomer);\n\t}", "public Customer save(final Customer customer) {\n\t\tAssert.notNull(customer);\r\n\t\tBoolean isCreating = null;\r\n\r\n\t\tAssert.isTrue(!(customer.getEmail().endsWith(\"@\") || customer.getEmail().endsWith(\"@>\")));\r\n\r\n\t\tif (customer.getId() == 0) {\r\n\t\t\tisCreating = true;\r\n\t\t\tcustomer.setSuspicious(false);\r\n\r\n\t\t\t//comprobamos que ningún actor resté autenticado (ya que ningun actor puede crear los customers)\r\n\t\t\t//this.serviceUtils.checkNoActor();\r\n\r\n\t\t} else {\r\n\t\t\tisCreating = false;\r\n\t\t\t//comprobamos que su id no sea negativa por motivos de seguridad\r\n\t\t\tthis.serviceUtils.checkIdSave(customer);\r\n\r\n\t\t\t//este customer será el que está en la base de datos para usarlo si estamos ante un customer que ya existe\r\n\t\t\tCustomer customerBD;\r\n\t\t\tAssert.isTrue(customer.getId() > 0);\r\n\r\n\t\t\t//cogemos el customer de la base de datos\r\n\t\t\tcustomerBD = this.customerRepository.findOne(customer.getId());\r\n\r\n\t\t\t//Si el customer que estamos guardando es nuevo (no está en la base de datos) le ponemos todos sus atributos vacíos\r\n\r\n\t\t\t//\t\t\tcustomer.setUserAccount(new UserAccount());\r\n\t\t\t//\t\t\tfinal Authority authority = new Authority();\r\n\t\t\t//\t\t\tauthority.setAuthority(Authority.CUSTOMER);\r\n\t\t\t//\t\t\tcustomer.getUserAccount().addAuthority(authority);\r\n\t\t\t//los atributos que no pueden estar vacíos\r\n\r\n\t\t\tcustomer.setSuspicious(customerBD.getSuspicious());\r\n\t\t\tcustomer.setUserAccount(customerBD.getUserAccount());\r\n\r\n\t\t\t//Comprobamos que el actor sea un Customer\r\n\t\t\tthis.serviceUtils.checkAuthority(\"CUSTOMER\");\r\n\t\t\t//esto es para ver si el actor que está logueado es el mismo que se está editando\r\n\t\t\tthis.serviceUtils.checkActor(customer);\r\n\r\n\t\t}\r\n\t\tif ((!customer.getPhone().startsWith(\"+\")) && StringUtils.isNumeric(customer.getPhone()) && customer.getPhone().length() > 3) {\r\n\t\t\tfinal Settings settings = this.settingsService.findSettings();\r\n\t\t\tcustomer.setPhone(settings.getCountryCode() + customer.getPhone());\r\n\t\t}\r\n\t\tCustomer res;\r\n\t\t//le meto al resultado final el customer que he ido modificando anteriormente\r\n\t\tres = this.customerRepository.save(customer);\r\n\t\tthis.flush();\r\n\t\tif (isCreating)\r\n\t\t\tthis.folderService.createSystemFolders(res);\r\n\t\treturn res;\r\n\t}", "@PostMapping\n public PetDTO savePet(@RequestBody PetDTO petDTO) {\n Customer customer = null;\n if ((Long) petDTO.getOwnerId() != null) {\n customer = customerService.getCustomerById(petDTO.getOwnerId());\n }\n Pet pet = ConvertService.convertDTOToPetEntity(petDTO);\n pet.setCustomer(customer);\n\n pet = petService.save(pet);\n petDTO.setId(pet.getId());\n\n return petDTO;\n }", "@PostMapping(\"/customers\")\n\tpublic Customer savecustomer(@RequestBody Customer thecustomer) {\n\t\t\n\t\tthecustomer.setId(0); //here 0 is not id, we are telling saveorupdate() DAO method to insert the customer object coz it inserts if id is empty(so give 0 or null)\n\t\tthecustomerService.saveCustomer(thecustomer);\n\t\treturn thecustomer;\n\t}", "CustDataNotesResponseDTO saveCustDataNotes(CustDataNotesRequestDTO custDataNotesRequestDTO) throws Exception;", "@Override\n\tpublic void saveCustomer(Customer theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// currentSession.save(theCustomer);\n\n\t\t// save/upate the customer\n\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t}", "public void saveCustomer(Customer c) {\n database.saveCustomer(c.getCustomerID(), c.getName(), c.getAddress(), c.getEmail(), Customer.toBase64(c.getPassword()), c.getBirthday(), c.getPhoneNumber(), Customer.toBase64(c.getSalt()), -1);\n //TODO Implement a getter for getting the orderId so that it can be saved.\n }", "@Override\n\tpublic void saveCustomer(Customer theCustomer){\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n//\t\tcurrentSession.createQuery(\"from Customer c where c.firstName=\"+ theCustomer.getFirstName()).executeUpdate();\n\n\t\tQuery<Customer> query =\n\t\t\t\tcurrentSession.createQuery(\"select c from Customer c \"+\n\t\t\t\t\t\t\t\t\"where c.firstName =:theCustomerFirstName and \" +\n\t\t\t\t\t\t\t\t\"c.lastName =:theCustomerLastName and \" +\n\t\t\t\t\t\t\t\t\"c.email=:theCustomerEmail\",\n\t\t\t\t\t\t Customer.class);\n\n\t\t// set parameter on query\n\t\tquery.setParameter(\"theCustomerFirstName\", theCustomer.getFirstName());\n\t\tquery.setParameter(\"theCustomerLastName\", theCustomer.getLastName());\n\t\tquery.setParameter(\"theCustomerEmail\", theCustomer.getEmail());\n\n\t\ttry {\n\t\t\t// execute query and get instructor\n\t\t\tCustomer temp = query.getSingleResult();\n\t\t}\n\t\tcatch (Exception exe){\n\t\t\tlogger.log(Level.INFO,\"Already exists!!\");\n\t\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t\t}\n\t}", "public void addCustomer(){\n Customer customer = new Customer();\n customer.setId(data.numberOfCustomer());\n customer.setFirstName(GetChoiceFromUser.getStringFromUser(\"Enter First Name: \"));\n customer.setLastName(GetChoiceFromUser.getStringFromUser(\"Enter Last Name: \"));\n data.addCustomer(customer,data.getBranch(data.getBranchEmployee(ID).getBranchID()));\n System.out.println(\"Customer has added Successfully!\");\n }", "private void saveAT() \n {\n // get DatabaseConnector to interact with the SQLite database\n\t AnimalDatabase db = new AnimalDatabase(this);\n\t AnimalList al = new AnimalList (db);\n\t \n // insert the contact information into the database\n al.Update(id, amount, comments);\n\n }", "@Override\n public Owner save(Owner object) {\n Owner savedOwner = null;\n if(object != null) {\n if(object.getPets() != null) {\n object.getPets().forEach(pet -> {\n // 1. Handling Pet Type ID\n if(pet.getPetType() != null) {\n // when the pet has not been saved to our map yet -> save it.\n if(pet.getPetType().getId() == null) {\n pet.setPetType(petTypeService.save(pet.getPetType()));\n }\n } else {\n throw new RuntimeException(\"Pet Type is required!\");\n }\n\n // 2. Handling Pet ID\n if(pet.getId() == null) {\n Pet savedPet = petService.save(pet);\n pet.setId(savedPet.getId());\n }\n });\n }\n return super.save(object);\n } else {\n return null;\n }\n\n }", "public Company saveCompany(Company company);", "void save(Cartera entity);", "@RequestMapping(value=\"/insertCust\",method=RequestMethod.POST)\r\n\tpublic String saveCust(@ModelAttribute(\"customer\")Customer cust,ModelMap map){\r\n\t\t//generating pwd,token using codeUtil\r\n\t\tString token=codeUtil.genToken();\r\n\t\tString pwd=codeUtil.getPwd();\r\n\t\t//encoding using codec util\r\n\t\tString encToken=codecUtil.doEncode(token);\r\n\t\tString encPwd=codecUtil.doEncode(pwd);\r\n\t\t//set encoded values to customer (model attribute)\r\n\t\tcust.setPassword(encPwd);\r\n\t\tcust.setAccTock(encToken);\r\n\t\t//save object using SL.\r\n\t\tint custId=service.saveCustomer(cust);\r\n\r\n\t\t//send email\r\n\t\tString text=\"welcome to Customer :\"+cust.getCustName()+\r\n\t\t\t\t\"(\"+cust.getCustType()+\"),Your user name is:\"+cust.getCustEmail()\r\n\t\t\t\t+\",password is:\"+pwd+\",token is:\"+token;\r\n\t\tcommonUtil.sendEmail(cust.getCustEmail(), \"welcome to Customer\", text);\r\n\t\t//send success msg\r\n\t\tmap.addAttribute(\"msg\",\"Customer added with Id:\"+custId);\r\n\t\treturn \"CustomerReg\";\r\n\t}", "private void save(ActionEvent e){\r\n // Make sure all required fields are filled out before saving\r\n if (formIsValid()){\r\n // Check if client currently exists. If so, modify. Otherwise create new entry.\r\n if (existingClient){\r\n // Modify the existing currentClient holder -- Change the variable to global currentClient cache holder\r\n currClient.setName(NAME_FIELD.getText());\r\n currClient.setAddress1(ADDRESS_1_FIELD.getText());\r\n currClient.setAddress2(ADDRESS_2_FIELD.getText());\r\n currClient.setCity(CITY_FIELD.getText());\r\n currClient.setZip(ZIP_FIELD.getText());\r\n currClient.setCountry(COUNTRY_FIELD.getText());\r\n currClient.setPhone(PHONE_FIELD.getText());\r\n // Update client in database\r\n Client.modifyClient(currClient, currClient.getClientID());\r\n }\r\n // Create new client entry\r\n else { \r\n Client c = new Client (NAME_FIELD.getText(),ADDRESS_1_FIELD.getText(),\r\n ADDRESS_2_FIELD.getText(),CITY_FIELD.getText(),\r\n ZIP_FIELD.getText(),COUNTRY_FIELD.getText(),PHONE_FIELD.getText());\r\n Client.addNewClient(c);\r\n }\r\n\r\n existingClient = false; // reset existing client flag\r\n clearFields(); // remove data from fields\r\n // Return to Appt Mgmt Screen if we came from there\r\n if (fromAppt){\r\n goToManageApptScreen();\r\n }\r\n }\r\n // If forms are not complete throw an alert\r\n else {\r\n AlertBox.display(\"Invalid Submission\", \"Form is missing required information or has invalid input.\"\r\n + \" The following information is required:\\n\"\r\n + \"Name\\nAddress 1\\nCity, State, Country, Zipcode\\nPhoneNumber\"\r\n + \"\\nPlease complete form with valid input and submit again.\");\r\n }\r\n }", "void createAndManageCustomer() {\r\n\t\tSystem.out.println(\"\\nCreating and managing a customer:\");\r\n\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c = new Customer2(\"Sami\", \"Cemil\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c);\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\t\r\n\t\ttx = em.getTransaction();\r\n\t\ttx.begin();\r\n\t\tc.setLastName(\"Kamil\");\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\tem.close();\r\n\t}", "ThingsResponse saveThingsDetails(ThingsRequest request);", "void saveProduct(Product product);", "@Override\n\tpublic void Save(Customer customer) {\n\t\tif (customerCheckDao.CheckIfRealPerson(customer)) {\n\t\t\tsuper.Save(customer);\n\t\t\tSystem.out.println(\"Veri tabanưna kaydedildi\");\n\t\t} else {\n\t\t\tSystem.err.println(\"Cannot divide by zero\");\n\t\t}\n\t}", "@PostMapping(\"/saveCustomer\")\r\n\tpublic String saveCustomer(@ModelAttribute(\"customer\") Customer theCustomer){\n\t\tcustomerService.saveCustomer(theCustomer);\r\n\t\t\r\n\t\treturn \"redirect:/customer/list\";\r\n\t}", "@Override\n\tpublic void saveCustomer(Customer theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\t// save/upate the customer ... finally LOL\n\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t\t\n\t}", "private Customer storeCustomer(Customer customer){\n customerRestService.createCustomer(customer);\n return customer;\n }", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "void save(Bill bill);", "@Override\n\tpublic void save(Company company) {\n\t\t\n\t}", "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 }", "void createACustomer() {\r\n\t\tSystem.out.println(\"\\nCreating a customer:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Ali\", \"Telli\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "CustomerOrder save(CustomerOrder customerOrder);", "public String save() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result;\r\n\t\tif (vendorMaster.getVendorCode().equals(\"\")) {\r\n\t\t\tresult = model.add(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record saved successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\tresult = model.mod(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record updated Successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of else\r\n\t\tmodel.calforedit(vendorMaster,vendorMaster.getVendorCode());\t\r\n\t\tmodel.terminate();\r\n\t\treturn \"Data\";\r\n\t}", "public void onSaveButton(ActionEvent actionEvent) {\n if (nameField.getText() == null || addressField.getText() == null || postalField.getText() == null || phoneField.getText() == null || divisionCombo.getValue() == null) {\n Alert error = new Alert(Alert.AlertType.ERROR);\n error.setTitle(\"Error\");\n error.setHeaderText(\"Error: Invalid input.\");\n error.setContentText(\"Check values and try again.\");\n error.showAndWait();\n }\n else {\n try {\n int divisionID = getDivisionIdFromDivisionName(divisionCombo.getValue().toString());\n Customer newCustomer = new Customer(\n 0,\n nameField.getText(),\n addressField.getText(),\n postalField.getText(),\n phoneField.getText(),\n divisionID);\n Customer.addNewCustomer(newCustomer);\n onBackButton(actionEvent);\n } catch (RuntimeException | IOException e) {\n Alert error = new Alert(Alert.AlertType.ERROR);\n error.setTitle(\"Error\");\n error.setHeaderText(\"Error: Server issue.\");\n error.setContentText(\"Unable to complete this action, please try again.\");\n error.showAndWait();\n }\n }\n }", "void save(Employee employee);", "private void saveContact() throws SQLException {\n \n if (checkFieldsForSaving()) {\n\n clsContactsDetails mContactDetails = new clsContactsDetails();\n\n //Differentiate between the two saving modes new and modify.\n clsContacts.enmSavingMode mSavingMode = null;\n if (this.pStatus == enmStatus.New) {\n mSavingMode = clsContacts.enmSavingMode.New;\n } else if (this.pStatus == enmStatus.Modify) {\n mSavingMode = clsContacts.enmSavingMode.Modify;\n\n int mID = ((clsContactsTableModel) tblContacts.getModel()).getID(tblContacts.getSelectedRow());\n int mIDModifications = ((clsContactsTableModel) tblContacts.getModel()).getIDModifications(tblContacts.getSelectedRow());\n mContactDetails.setID(mID);\n mContactDetails.setIDModification(mIDModifications);\n }\n\n //Create the contact details.\n mContactDetails.setFirstName(txtFirstName.getText());\n mContactDetails.setMiddleName(txtMiddleName.getText());\n mContactDetails.setLastName(txtLastName.getText());\n mContactDetails.setBirthday(dtpBirthday.getDate());\n mContactDetails.setGender(getGender());\n mContactDetails.setStreet(txtStreet.getText());\n mContactDetails.setPostcode(txtPostcode.getText());\n mContactDetails.setCity(txtCity.getText());\n mContactDetails.setCountry(txtCountry.getText());\n mContactDetails.setAvailability(txtAvailability.getText());\n mContactDetails.setComment(txtComment.getText());\n \n int mIDContacts = this.pModel.saveContact(mSavingMode, mContactDetails);\n if (mIDContacts > 0) {\n this.pStatus = enmStatus.View;\n setComponents();\n \n //Select the created or modified row.\n if (mSavingMode == clsContacts.enmSavingMode.New) {\n this.pSelectedRow = getRowOfID(mIDContacts);\n }\n selectContact();\n }\n }\n }", "private void saveProduct() {\n //Delegating to the Presenter to trigger focus loss on listener registered Views,\n //in order to persist their data\n mPresenter.triggerFocusLost();\n\n //Retrieving the data from the views and the adapter\n String productName = mEditTextProductName.getText().toString().trim();\n String productSku = mEditTextProductSku.getText().toString().trim();\n String productDescription = mEditTextProductDescription.getText().toString().trim();\n ArrayList<ProductAttribute> productAttributes = mProductAttributesAdapter.getProductAttributes();\n mCategoryOtherText = mEditTextProductCategoryOther.getText().toString().trim();\n\n //Delegating to the Presenter to initiate the Save process\n mPresenter.onSave(productName,\n productSku,\n productDescription,\n mCategoryLastSelected,\n mCategoryOtherText,\n productAttributes\n );\n }", "@PostMapping(\"/addcustomer\")\n\tpublic String save(@ModelAttribute(\"customer\") Customer theCustomer) {\n\t\tcustomerServices.save(theCustomer);\n\t\treturn \"redirect:/dairymilk/customers\";\n\t}", "@Override\n\t@Transactional\n\tpublic void save(Customer customer) {\n\t\tcustomerDAO.save(customer);\n\t}", "public void SaveInfo() {\n if (NameSurname_enter.getText() != null && validateString(NameSurname_enter.getText())) {\n patient.setName(NameSurname_enter.getText());\n } else {\n JOptionPane.showMessageDialog(null, \"Please, enter a valid name and surname. It should only contain characters and spaces. \", \"Warning\", JOptionPane.INFORMATION_MESSAGE);\n }\n if (Age_enter.getText() != null && validateInt(Age_enter.getText())) {\n patient.setAge(Integer.parseInt(Age_enter.getText()));\n } else {\n JOptionPane.showMessageDialog(null, \"Please, enter a valid age. It should be a number. \", \"Warning\", JOptionPane.INFORMATION_MESSAGE);\n }\n if (Sex_box.getSelectedItem().equals(\"Male\")) {\n patient.setSex(\"MALE\");\n } else {\n patient.setSex(\"FEMALE\");\n }\n\n }", "@Override\r\n public void save(BuyTicketModel value) {\n String sql = \"insert into buyticket values(?,?,?,?,?,?,?,?,?,?,?,?) \";\r\n \r\n try {\r\n PreparedStatement pstm = database.getCon().prepareStatement(sql);\r\n pstm.setString(1, value.getSlno());\r\n pstm.setString(2, value.getCustomername());\r\n pstm.setString(10,value.getContact());\r\n pstm.setString(3, value.getDestination());\r\n pstm.setString(4, value.getTime());\r\n pstm.setString(5, value.getFare());\r\n pstm.setString(6, value.getComment());\r\n pstm.setString(7, value.getDate());\r\n pstm.setString(8, value.getPayment());\r\n pstm.setString(9, value.getSeat());\r\n pstm.setString(11, value.getType());\r\n pstm.setString(12, value.getBusname());\r\n \r\n \r\n pstm.executeUpdate();\r\n pstm.close();\r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(BuyTicketImpl.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n }", "public void saveProduct(Product product);", "CounselorBiographyTemp save(CounselorBiographyTemp entity);", "void saveCity(City city);", "@Override\n\tpublic void save(Customer customer) throws Exception {\n\t\tthis.getHibernateTemplate().save(customer);\n\t}", "public Customer updateCustomer(@RequestBody Customer theCustomer)\n {\n customerService.save(theCustomer);\n return theCustomer;\n }", "@Override\n public boolean onSave(EditTransaction et) {\n et.retrieveData(VisitDrug.CODE, typecode, false, null, null);\n\n ContentValues cv = et.getContentValues();\n cv.put(VisitDrug.CODE, typecode.getSelectId());\n cv.put(\"dentalcode\", typecode.getSelectId());\n if (dentist.getSelectId() != null)\n cv.put(VisitDrug.DOCTOR1, dentist.getSelectId());\n cv.put(\"unit\", \"1\");\n cv.put(\"costprice\", cost);\n cv.put(\"realprice\", real);\n //cv.put(VisitDrug.DOCTOR2, \"waitForMethod\");\n cv.put(VisitDrug._DATEUPDATE, DateTime.getCurrentDateTime());\n return true;\n }", "public void saveNew() {\r\n String name, compName;\r\n double price;\r\n int id, inv, max, min, machId;\r\n //Gets the ID of the last part in the inventory and adds 1 to it \r\n id = Inventory.getAllParts().get(Inventory.getAllParts().size() - 1).getId() + 1;\r\n name = nameField.getText();\r\n inv = Integer.parseInt(invField.getText());\r\n price = Double.parseDouble(priceField.getText());\r\n max = Integer.parseInt(maxField.getText());\r\n min = Integer.parseInt(minField.getText());\r\n\r\n if (inHouseSelected) {\r\n machId = Integer.parseInt(machineOrCompanyField.getText());\r\n Part newPart = new InHouse(id, name, price, inv, min, max, machId);\r\n Inventory.addPart(newPart);\r\n } else {\r\n compName = machineOrCompanyField.getText();\r\n Part newPart = new Outsourced(id, name, price, inv, min, max, compName);\r\n Inventory.addPart(newPart);\r\n }\r\n\r\n }", "private void saveNewPerson() {\r\n\r\n\t\tSystem.out.println(\"Start Save new Patient...\");\r\n\r\n\t\ttry {\r\n\t\t\tIPerson p1 = new Person(\"admin\", new Role(Roles.ADMINISTRATOR,\r\n\t\t\t\t\t\"Hauptadministrator\"), \"Passwort\", \"te@te.te\", \"Vorname\",\r\n\t\t\t\t\t\"Nachname\", \"Organisation\", \"Abteilung\", \"Fachrichtung\",\r\n\t\t\t\t\t\"Strasse\", \"3e\", \"54321\", \"Ort\");\r\n\r\n\t\t\tp1.save();\r\n\t\t} catch (BusinesslogicException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} catch (DatabaseException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"New Patient saved!!\");\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 }", "public void saveFormData() {\r\n if(!saveRequired) return;\r\n if(cvHierarchyData != null && cvHierarchyData.size()>0) {\r\n SponsorHierarchyBean sponsorHierarchyBean;\r\n for(int index=0; index<cvHierarchyData.size(); index++) {\r\n try {\r\n sponsorHierarchyBean = (SponsorHierarchyBean)cvHierarchyData.get(index);\r\n if(sponsorHierarchyBean.getAcType() != null) {\r\n if(sponsorHierarchyBean.getAcType() == TypeConstants.UPDATE_RECORD) {\r\n queryEngine.update(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.INSERT_RECORD) {\r\n queryEngine.insert(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.DELETE_RECORD) {\r\n queryEngine.delete(queryKey,sponsorHierarchyBean);\r\n }\r\n }\r\n }catch(CoeusException coeusException){\r\n coeusException.printStackTrace();\r\n }\r\n }\r\n }\r\n saveRequired = false;\r\n }", "Patient save(Patient patient);", "@Override\r\n\tpublic void save(XftPayment xtp) {\n\t\ttry {\r\n\t\t\tlogger.info(\"save..........servicr.....:\"+JSONUtils.beanToJson(xtp));\t\r\n\t\t\txftPaymentMapper.insert(xtp);\r\n\t\t}catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "Product save(Product product);", "@PostMapping(\"/customers\")\n public void addCustomer(@RequestBody CustomerHibernate theCustomerHibernate) {\n //this is to force a save for a new item .... instead of update\n\n theCustomerHibernate.setId(0);\n\n customerService.save(theCustomerHibernate);\n }", "Customer saveCustomer(Customer customer) throws CustomerExistsException;", "private void updateCustomer(HttpServletRequest request, HttpServletResponse response) throws IOException {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n String name = request.getParameter(\"name\");\n String phone = request.getParameter(\"phone\");\n String email = request.getParameter(\"email\");\n Customer updateCustomer = new Customer(id, name, phone, email);\n CustomerDao.addCustomer(updateCustomer);\n response.sendRedirect(\"list\");\n\n }", "public Customer saveCustomer(Customer customer) {\n\t\treturn null;\n\t}", "public Bookings saveBookingDetails(Bookings bookings) ;", "@Override\n\tpublic void putCustomers(Customer customer) {\n\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(customer);;\n\n\t}", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tStoredBookDAO storeBookDAO = new StoredBookDAO(BookInfoActivity.this);\n\t\t\tBookStoredEntity testBookBorrowedEntity1 = new BookStoredEntity();\n\t\t\ttestBookBorrowedEntity1.setBookId(\"1\");\n\t\t\ttestBookBorrowedEntity1.setBookText(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookImageUrl(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookPress(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookPressTime(\"android\");\n\t\t\tstoreBookDAO.insert(testBookBorrowedEntity1);\n\t\t\tToast.makeText(BookInfoActivity.this, R.string.storesuccess, Toast.LENGTH_SHORT).show();\n\t\t}", "private void saveData() {\n try {\n Student student = new Student(firstName.getText(), lastName.getText(),\n form.getText(), stream.getText(), birth.getText(),\n gender.getText(), Integer.parseInt(admission.getText()),\n Integer.parseInt(age.getText()));\n\n\n if (action.equalsIgnoreCase(\"new\") && !assist.checkIfNull(student)) {\n\n dao.insertNew(student);\n JOptionPane.showMessageDialog(null, \"Student saved !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n\n } else if (action.equalsIgnoreCase(\"update\") && !assist.checkIfNull(student)) {\n dao.updateStudent(student, getSelected());\n JOptionPane.showMessageDialog(null, \"Student Updated !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n prepareTable();\n prepareHistory();\n buttonSave.setVisible(false);\n admission.setEditable(true);\n }catch (Exception e)\n {}\n }", "public void saveDetails() {\n\t\tTimelineUpdater timelineUpdater = TimelineUpdater.getCurrentInstance(\":mainForm:timeline\");\n\t\tmodel.update(event, timelineUpdater);\n\n\t\tFacesMessage msg =\n\t\t new FacesMessage(FacesMessage.SEVERITY_INFO, \"The booking details \" + getRoom() + \" have been saved\", null);\n\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\n\t}", "public void save(Customer customer) {\n\t\t//get current session\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t//create account\n\t\tcurrentSession.save(customer);\n\t}", "public void saveMedicine(Medicine medicine);", "@Override\n\t@Transactional\n\tpublic void saveCustomer(Customer theCustomer) {\n\t\tcustomerDAO.saveCustomer(theCustomer);\n\t\t\n\t}", "public void save(Customer customer) {\r\n EntityManagerHelper.beginTransaction();\r\n CUSTOMERDAO.save(customer);\r\n EntityManagerHelper.commit();\r\n renderManager.getOnDemandRenderer(SessionRenderer.ALL_SESSIONS).requestRender();\r\n }", "@Override\r\n\tpublic void save(Plate tipo) {\n\t\t\r\n\t}", "public void addCustomer(CustomerSignup p)\n {\n Session session = this.sessionFactory.getCurrentSession();\n \n session.persist(p);\n \n CustomerLogin cl=new CustomerLogin();\n cl.setUsername(p.getUsername());\n cl.setPassword(p.getPassword());\n cl.setId(p.getId());\n session.persist(cl);\n \n Authorities a = new Authorities();\n a.setUsername(p.getUsername());\n a.setAuthority(\"ROLE_USER\");\n a.setId(p.getId());\n session.saveOrUpdate(a);\n\n session.flush();\n \n logger.info(\"Customer saved successfully, Customer Details=\"+p);\n }", "@Override\n\tpublic void save(EmpType entity) {\n\t\t\n\t}", "private void saveEmployee() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String nameString = mNameEditText.getText().toString().trim();\n String addressString = mAddressEditText.getText().toString().trim();\n String numberString = mNumberEditText.getText().toString().trim();\n String birthDateString = mBirthTextView.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentPetUri == null &&\n TextUtils.isEmpty(nameString) &&\n mImagePath.isEmpty()) {\n // Since no fields were modified, we can return early without creating a new pet.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and employee attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NAME, nameString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_ADDRESS, addressString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_BIRTH_DAY, birthDateString);\n\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_PHOTOS, mImagePath);\n\n // If the number is not provided by the user, don't try to parse the string into an\n // integer value. Use 0 by default.\n int number = 0;\n if (!TextUtils.isEmpty(numberString)) {\n number = Integer.parseInt(numberString);\n }\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NUMBER, number);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentPetUri == null) {\n // This is a NEW employee, so insert a new employee into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(EmployeeEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING pet, so update the pet with content URI: mCurrentPetUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentPetUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentPetUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\n }", "void save(Student student);", "public void saveEmployee(Employee emp){\n System.out.println(\"saved\" + emp);\n\n }", "@PostMapping(\"/saveCustomer\")\n\tpublic String saveCustomer(@Valid @RequestBody @ModelAttribute(\"customer\") CustomerModel customer, Model m,\n\t\t\tPrincipal princpl) {\n\t\tboolean flag = true;\n\t\tString email = customer.getCustemail();\n\t\tAgentModel[] allAgent = this.servimple.getAllAgent();\n\t\tCustomerModel[] allCustomer = this.servimple.getAllCustomer();\n\n\t\tfor (int i = 0; i < allAgent.length; i++) {\n\t\t\tString allEmail = allAgent[i].getAgent_email();\n\t\t\tif (allEmail.equals(email))\n\t\t\t\tflag = false;\n\t\t}\n\n\t\tfor (int i = 0; i < allCustomer.length; i++) {\n\t\t\tString allEmail = allCustomer[i].getCustemail();\n\t\t\tif (allEmail.equals(email))\n\t\t\t\tflag = false;\n\t\t}\n\n\t\tif (flag == true) {\n\t\t\tif (customer.getPolicyAmount() > 50000) {\n\t\t\t\tcustomer.setRole(\"ROLE_USER\");\n\t\t\t\tcustomer.setCustpassword(passencoder.encode(customer.getCustpassword()));\n\t\t\t\tthis.servimple.saveCustomer(customer);\n\t\t\t\tm.addAttribute(\"allagntid\", allAgent);\n\t\t\t\tm.addAttribute(\"valid\", \"This Agent was successfully Created!\");\n\t\t\t\treturn \"Customer/customerForm\";\n\t\t\t} else {\n\t\t\t\tm.addAttribute(\"allagntid\", allAgent);\n\t\t\t\tm.addAttribute(\"invalid\", \"Sorry! Your Policy Amount less then 50000 tk\");\n\t\t\t\treturn \"Customer/customerForm\";\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tm.addAttribute(\"allagntid\", allAgent);\n\t\t\tm.addAttribute(\"invalid\", \"Sorry this Email: \" + email + \" is already used\");\n\t\t\treturn \"Customer/customerForm\";\n\t\t}\n\n\t}", "public boolean createPersonalDetails(Integer staffID, String surname, String name, Date dob, String address, String town, String county,\n String postCode, String telNo, String mobileNo, String emergencyContact, String emergencyContactNo){\n\n\n hrDB.addPDRecord(staffID, surname, name, dob, address, town, county,\n postCode, telNo, mobileNo, emergencyContact, emergencyContactNo);\n return true;\n\n\n }", "public void saveProfileEditData() {\r\n\r\n }", "@Action(value = \"saveCustomChargeInfo\", results = { @Result(name = \"success\", type = \"json\"), })\n\tpublic String saveCustomChargeInfo() {\n\t\tlog.info(\"Starting to save customer charge info into DB\");\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tthis.customerChargeServiceImpl.addCustomChargeInfo(this.customerChargeBean);\n\t\t\tflag = true;\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"save customer charge data into DB occured error, please references the detail log\\n \" + \"[\" + e + \"]\\n\"\n\t\t\t\t\t+ ErrorLogUtil.printInfo(e));\n\t\t\treturn ERROR;\n\t\t}\n\t\tif (flag) {\n\t\t\tlog.info(\"Successfully save customer charge info into DB\");\n\t\t\treturn SUCCESS;\n\t\t}\n\t\treturn ERROR;\n\t}", "public abstract CustomerOrder save(CustomerOrder entity);", "@Override\r\n\tpublic int save(CustomerRec customerRec) {\n\t\t\r\n\t\t\r\n\t\tif(customerRec.getId()==null||\"\".equals(customerRec.getId())){\r\n\t\t\t//新建\r\n\t\t\tSystem.out.println(\"YYYYYYYYYYYYY1\");\r\n\t\t\tlong id = (new Date()).getTime();\r\n\t\t\tSystem.out.println(\"YYYYYYYYYYYYY2\");\r\n\r\n\t\t\tcustomerRec.setId(String.valueOf(id));\r\n\t\t\tSystem.out.println(\"YYYYYYYYYYYYY3\");\r\n\r\n\t\t\tList<CustomerReceipt> receiptList = customerRec.getReceiptList();\r\n\t\t\tfor (CustomerReceipt customerReceipt : receiptList) {\r\n\t\t\t\tint idR = (int) (new Date()).getTime();\r\n\t\t\t\tcustomerReceipt.setId(Integer.valueOf(idR));\r\n\t\t\t\tcustomerReceipt.setCustomerId(String.valueOf(id));\r\n\t\t\t\tif (customerReceipt.getAddressProvince() == null\r\n\t\t\t\t\t\t|| \"\".equals(customerReceipt.getAddressProvince()))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tSystem.out.println(\"customerReceipt.getCustomerId()\"\r\n\t\t\t\t\t\t+ customerReceipt.getCustomerId());\r\n\t\t\t\tSystem.out.println(\"customerReceipt.getAddressProvince()\"\r\n\t\t\t\t\t\t+ customerReceipt.getAddressProvince());\r\n\t\t\t\tcustomerReceiptDao.insertSelective(customerReceipt);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcustomerRecDao.insert(customerRec);\r\n\t\t}\r\n\t\t\r\n\r\n\t\tSystem.out.println(\"YYYYYYYYYYYYY4\");\r\n\r\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic Customer saveCustomer(Customer customer) {\n\t\treturn null;\n\t}", "public void save(PtJJdwcy entity);", "@Transactional\n\tpublic void saveCustomer(Customer theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t// save the customer ... finally LOL\n\t\tcurrentSession.save(theCustomer);\t\t\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public Customer save(final Customer customer) {\n\t\tAssert.notNull(customer);\n\n\t\t//comprobamos que su id no sea negativa por motivos de seguridad\n\t\tthis.serviceUtils.checkIdSave(customer);\n\n\t\t//este customer será el que está en la base de datos para usarlo si estamos ante un customer que ya existe\n\t\tCustomer customerBD;\n\t\tAssert.isTrue(customer.getId() > 0);\n\n\t\t//cogemos el customer de la base de datos\n\t\tcustomerBD = this.customerRepository.findOne(customer.getId());\n\n\t\t//Si el customer que estamos guardando es nuevo (no está en la base de datos) le ponemos todos sus atributos vacíos\n\t\tif (customer.getId() == 0) {\n\t\t\tcustomer.setBanned(false);\n\t\t\tcustomer.setFixupTasks(new ArrayList<FixupTask>());\n\t\t\tcustomer.setFolders(this.folderService.createSystemFolders(customer));\n\t\t\tcustomer.setReceivedMessages(new ArrayList<Message>());\n\t\t\tcustomer.setSendedMessages(new ArrayList<Message>());\n\t\t\tcustomer.setSocialProfiles(new ArrayList<SocialProfile>());\n\t\t\tcustomer.setSuspicious(false);\n\n\t\t\t//comprobamos que ningún actor resté autenticado (ya que ningun actor puede crear los customers)\n\t\t\tthis.serviceUtils.checkNoActor();\n\n\t\t} else {\n\t\t\tcustomer.setBanned(customerBD.getBanned());\n\t\t\tcustomer.setFixupTasks(customerBD.getFixupTasks());\n\t\t\tcustomer.setFolders(customerBD.getFolders());\n\t\t\tcustomer.setReceivedMessages(customerBD.getReceivedMessages());\n\t\t\tcustomer.setSendedMessages(customerBD.getSendedMessages());\n\t\t\tcustomer.setSocialProfiles(customerBD.getSocialProfiles());\n\t\t\tcustomer.setSuspicious(customerBD.getSuspicious());\n\t\t\tcustomer.setUserAccount(customerBD.getUserAccount());\n\n\t\t\t//Comprobamos que el actor sea un Customer\n\t\t\tthis.serviceUtils.checkAuthority(\"CUSTOMER\");\n\t\t\t//esto es para ver si el actor que está logueado es el mismo que se está editando\n\t\t\tthis.serviceUtils.checkActor(customer);\n\n\t\t}\n\t\tCustomer res;\n\t\t//le meto al resultado final el customer que he ido modificando anteriormente\n\t\tres = this.customerRepository.save(customer);\n\t\treturn res;\n\t}", "private void createCustomer(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n String customerName = request.getParameter(\"CustomerName\");\n System.out.println(\"them mới id\"+ customerName);\n String customerBir = request.getParameter(\"CustomerBir\");\n String gender = request.getParameter(\"Gender\");\n int cusIdNum =Integer.parseInt(request.getParameter(\"CusIdNum\"));\n int cusTelNum = Integer.parseInt(request.getParameter(\"CusTelNum\"));\n String cusEmail = request.getParameter(\"CusEmail\");\n String address = request.getParameter(\"Address\");\n String customerTypeId = request.getParameter(\"CustomerTypeId\");\n System.out.println(\"them mới id\"+ customerName);\n Customer customer = new Customer(customerName,customerBir,gender,cusIdNum,cusTelNum,cusEmail,address, new CustomerType(customerTypeId));\n customerService.save(customer);\n showCustomerList(request,response);\n System.out.println(\"them mới\"+ customer);\n }", "public void savePerson() {\n\t\tSystem.out.println(\"save person\");\n\t}", "public void savePerson() {\n\t\tSystem.out.println(\"save person\");\n\t}", "private void save(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tBook book = new Book();\r\n\t\tbook.setId(bookService.list().size()+1);\r\n\t\tbook.setBookname(request.getParameter(\"bookname\"));\r\n\t\tbook.setAuthor(request.getParameter(\"author\"));\r\n\t\tbook.setPrice(Float.parseFloat(request.getParameter(\"price\")));\r\n\t\tbookService.save(book);\r\n\t\t//out.println(\"<script>window.location.href='index.html'</script>\");\r\n\t\tresponse.sendRedirect(\"index.html\");\r\n\t}", "private void savePhone() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String brandString = mBrandEditText.getText().toString().trim();\n String modelString = mModelEditText.getText().toString().trim();\n String storageSizeString = mStorageSizeEditText.getText().toString().trim();\n String quantityString = mQuantityEditText.getText().toString().trim();\n String priceString = mPriceEditText.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check for user validation\n if (TextUtils.isEmpty(brandString) || TextUtils.isEmpty(modelString)\n || priceString.equalsIgnoreCase(\"\") || quantityString.equalsIgnoreCase(\"\")\n || storageSizeString.equalsIgnoreCase(\"\")) {\n // Since no fields were modified, we can return early without creating a new inventory.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n Toast.makeText(getApplicationContext(),\"Please fill in all input values\",\n Toast.LENGTH_LONG).show();\n return;\n }\n\n int price = 0;\n if(!priceString.equalsIgnoreCase(\"\")) {\n price = Integer.valueOf(priceString);\n }\n int quantity = 0;\n if(!quantityString.equalsIgnoreCase(\"\")) {\n quantity = Integer.valueOf(priceString);\n }\n int storageSize = 0;\n if(!storageSizeString.equalsIgnoreCase(\"\")) {\n storageSize = Integer.valueOf(priceString);\n }\n\n if(mProductPhoto.getDrawable() == null) {\n Toast.makeText(this,\"You must upload an image.\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n Bitmap imageBitMap = ((BitmapDrawable)mProductPhoto.getDrawable()).getBitmap();\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n imageBitMap.compress(Bitmap.CompressFormat.PNG, 100, bos);\n byte[] imageByteArray = bos.toByteArray();\n\n // Create a ContentValues object where column names are the keys,\n // and Phone attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(PhoneEntry.COLUMN_PHONE_BRAND, brandString);\n values.put(PhoneEntry.COLUMN_PHONE_MODEL, modelString);\n values.put(PhoneEntry.COLUMN_PHONE_PRICE, price);\n values.put(PhoneEntry.COLUMN_PHONE_QUANTITY, quantity);\n values.put(PhoneEntry.COLUMN_PHONE_MEMORY, storageSize);\n values.put(PhoneEntry.COLUMN_PHONE_COLOUR, mColour);\n values.put(PhoneEntry.COLUMN_PHONE_PICTURE,imageByteArray);\n\n // Determine if this is a new or existing pet by checking if mCurrentPhoneUri is null or not\n if (mCurrentPhoneUri == null) {\n // This is a NEW pet, so insert a new pet into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(PhoneEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_phone_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_phone_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING pet, so update the pet with content URI: mCurrentPetUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentPetUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentPhoneUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_phone_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_phone_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }" ]
[ "0.67196375", "0.67056155", "0.65059996", "0.65011376", "0.64690566", "0.64233845", "0.6406681", "0.6349624", "0.6339873", "0.62688214", "0.62677294", "0.6257078", "0.62323356", "0.62214917", "0.622145", "0.62190336", "0.62182325", "0.6216953", "0.62164503", "0.62063575", "0.6192364", "0.6173783", "0.61477894", "0.61468595", "0.6143925", "0.61369014", "0.6119298", "0.61158776", "0.6112455", "0.61045724", "0.60718447", "0.6052205", "0.60490346", "0.60449827", "0.60393566", "0.6037373", "0.6031716", "0.60231024", "0.6019511", "0.6015954", "0.6012736", "0.6012356", "0.6007618", "0.6004283", "0.5997201", "0.59845716", "0.59780526", "0.5968343", "0.5958096", "0.5956447", "0.5954019", "0.5953882", "0.5937551", "0.59284407", "0.59278643", "0.5926434", "0.5910579", "0.5906143", "0.59041214", "0.5898769", "0.5897024", "0.5894605", "0.5894047", "0.5891849", "0.58765644", "0.5876538", "0.58617437", "0.5851617", "0.5843629", "0.5839316", "0.5832316", "0.5830767", "0.5830423", "0.5822078", "0.5822045", "0.58215857", "0.5821027", "0.5819796", "0.5813321", "0.5808986", "0.58058065", "0.580417", "0.58021075", "0.5801803", "0.5800009", "0.57986945", "0.5794677", "0.57769805", "0.57765317", "0.5772899", "0.5770545", "0.577044", "0.5765612", "0.57644266", "0.5763739", "0.5761238", "0.5760303", "0.5760303", "0.57567996", "0.57525414" ]
0.7174064
0
to save booking details
public Bookings saveBookingDetails(Bookings bookings) ;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Booking saveBooking(Booking booking);", "public void saveDetails() {\n\t\tTimelineUpdater timelineUpdater = TimelineUpdater.getCurrentInstance(\":mainForm:timeline\");\n\t\tmodel.update(event, timelineUpdater);\n\n\t\tFacesMessage msg =\n\t\t new FacesMessage(FacesMessage.SEVERITY_INFO, \"The booking details \" + getRoom() + \" have been saved\", null);\n\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\n\t}", "@Override\n\tpublic void saveBooking(BookingDetails bookingDetails) {\n\t\tbookingDao.saveBooking(bookingDetails);\n\t}", "public void insertBooking(){\n \n Validator v = new Validator();\n if (createBookingType.getValue() == null)\n {\n \n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Booking Type!\")\n .showInformation();\n \n return;\n \n }\n if (createBookingType.getValue().toString().equals(\"Repair\"))\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Go to Diagnosis and Repair tab for creating Repair Bookings!\")\n .showInformation();\n \n \n if(v.checkBookingDate(parseToDate(createBookingDate.getValue(),createBookingTimeStart.localTimeProperty().getValue()),\n parseToDate(createBookingDate.getValue(),createBookingTimeEnd.localTimeProperty().getValue()))\n && customerSet)\n \n { \n \n int mID = GLOBAL.getMechanicID();\n \n try {\n mID = Integer.parseInt(createBookingMechanic.getSelectionModel().getSelectedItem().toString().substring(0,1));\n } catch (Exception ex) {\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Mechanic!\")\n .showInformation();\n return;\n }\n \n if (mID != GLOBAL.getMechanicID())\n if (!getAuth(mID)) return;\n \n createBookingClass();\n dbH.insertBooking(booking);\n booking.setID(dbH.getLastBookingID());\n appointment = createAppointment(booking);\n closeWindow();\n \n }\n else\n {\n String extra = \"\";\n if (!customerSet) extra = \" Customer and/or Vehicle is not set!\";\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Errors with booking:\"+v.getError()+extra)\n .showInformation();\n }\n \n }", "public void saveBorrowings() {\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 }", "Booking createBooking(Booking newBooking) throws Exception;", "public static void addBooking(BookingImpl b, String status){\n Firebase bRefChild;\n if(!status.equals(\"new\")){\n //Dispatched Booking\n //Removes from Awaiting_Dispatch and puts in Dispatched\n bRefChild = dRef.child(status);\n bRef.child(b.getBookingNumber()+\"\").removeValue();\n } else {\n bRefChild = bRef.child(b.getBookingNumber() + \"\");\n }\n bRefChild.child(\"pickup\").setValue(b.getPickUpAddress());//\n bRefChild.child(\"dropoff\").setValue(b.getDropOffAddress());//\n bRefChild.child(\"name\").setValue(b.getClientName());//\n bRefChild.child(\"time\").setValue(b.getTime().toString());\n bRefChild.child(\"comment\").setValue(b.getComments());//\n bRefChild.child(\"tel\").setValue(b.getClientTel());//\n bRefChild.child(\"email\").setValue(b.getClientEmail());//\n bRefChild.child(\"booking_number\").setValue(b.getBookingNumber());//\n bRefChild.child(\"account\").setValue(Cash.getInstance().getId());\n bRefChild.child(\"vehicle_type\").setValue(b.getVehicleType());\n bRefChild.child(\"no_passengers\").setValue(b.getNoPassengers());\n bRefChild.child(\"date\").setValue(b.getDate());\n try {\n bRefChild.child(\"time\").setValue(new SimpleDateFormat(\"HH:mm\").format(b.getTime()));\n } catch (IllegalArgumentException e){\n // Always throws this exception - unsure why as it saves correctly.\n // Do nothing as it still writes to database as expected\n // Maybe need to look at different formats for time?\n }\n bRefChild.child(\"price\").setValue(b.getPrice());\n\n }", "public static void saveData() throws FileNotFoundException {\t\n\t\t\t\n\tScanner inputStream = new Scanner(new File(\"bookings.dat\"));\n\t\ttry {\n\t\t\t\n\t\t\tBookingList.surName = inputStream.nextLine();\n\t\t\tBookingList.tableNo = inputStream.nextLine();\n\t\t\tBookingList.sittingTime = inputStream.nextLine();\n\t\t\tBookingList.partyOf = inputStream.nextLine();\n\t\t\t\t\n\t\t\tBooking<?> bookingData = new Booking<Object>(null, surName, tableNo, sittingTime, partyOf);\n\t\t\tb1.insert(bookingData);\n\t\t\t\t\n\t\t}finally {\n\t\t\tinputStream.close();\n\t\t}\n\t\t\t\n\t}", "public void insertBooking(Booking booking) throws SQLException, Exception;", "Hotel saveHotel(Hotel hotel);", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "public void save(String addressbookname,AddressbookModel addressbook){\n Addressbookservices.WriteToACsv(addressbook,addressbookname);\n }", "private void SaveAppoint(View view)\n {\n String userIdStr = getSharedPreferences(\"prefs\",0).getString(\"Id_User\", \"\");\n if(userIdStr.equals(\"\"))\n {\n Intent i = new Intent(this, LoginActivity.class);\n startActivity(i);\n finish();\n return;\n }\n\n dbAdapter = new DbAdapter(this);\n\n //covert unix-datetime (in seconds) to string\n Date appointTime = new Date(dateTimeUnix * 1000L);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEE, d MMM yyyy hh:mm aaa\");\n AppointmentTime = sdf.format(appointTime);\n\n //bind model\n bModel = new Booking();\n userIdStr = getSharedPreferences(\"prefs\", 0).getString(\"Id_User\", \"1\");\n int userIdInt = Integer.parseInt(userIdStr);\n bModel.setId_User(userIdStr);\n bModel.setAppointmentTime(this.AppointmentTime);\n bModel.setClinic(txtV.getText().toString());\n bModel.setCreationTime(sdf.format( Calendar.getInstance().getTime() ));\n if(spinDrList.getSelectedItemPosition() == 0)\n {\n Snackbar.make(view, \"Select a doctor\", Snackbar.LENGTH_LONG).show();\n return;\n }\n bModel.setDoctor(VariablesGlobal.DrProfiles.get(spinDrList.getSelectedItemPosition() -1).name);\n bModel.setDRAVAILABLE(\"1\");\n bModel.setId_Doc((VariablesGlobal.DrProfiles.get(spinDrList.getSelectedItemPosition() - 1)).id_doc);\n\n //make json from model\n formData = gson.toJson(bModel);\n\n //chk if u r coming from List of appoints or from Map\n if (app == null) //i.e. Coming from Map, hence a non-existing booking, so create a new one\n {\n\n paramsApiUri[0] = VariablesGlobal.API_URI + \"/api/values/newAppointment\";\n paramsApiUri[1] = formData;\n paramsApiUri[2] = \"POST\";\n }\n else\n {\n int appointId = getSharedPreferences(\"prefs\", 0).getInt(\"Id_Appointment\", 0);\n paramsApiUri[0] = VariablesGlobal.API_URI + \"/api/values/UpdateAppoint/\" + appointId;\n paramsApiUri[1] = formData;\n paramsApiUri[2] = \"POST\";\n }\n\n //pass args to AsyncTask to read db\n dbAdapter.execute(paramsApiUri);\n if(Bookings_AllActivity.instance != null)\n {\n Bookings_AllActivity.instance.finish();\n }\n }", "private void save(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tBook book = new Book();\r\n\t\tbook.setId(bookService.list().size()+1);\r\n\t\tbook.setBookname(request.getParameter(\"bookname\"));\r\n\t\tbook.setAuthor(request.getParameter(\"author\"));\r\n\t\tbook.setPrice(Float.parseFloat(request.getParameter(\"price\")));\r\n\t\tbookService.save(book);\r\n\t\t//out.println(\"<script>window.location.href='index.html'</script>\");\r\n\t\tresponse.sendRedirect(\"index.html\");\r\n\t}", "@RequestMapping(\"/create\")\n\tpublic Booking create(Booking booking) {\n\t\tbooking.setTravelDate(new Date());\n\t\tbooking = bookingRepository.save(booking);\n\t return booking;\n\t}", "public void createBooking(Booking book) {\n\tStudentDAO studentDAO=new StudentDAO();\n\tstudentDAO.createBooking(book);\n}", "public boolean bookSave(Book book) {\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void handleSaveAppointment() {\n if (wrapperDataMakeAppoint.isUpdateProfile()) {\n wrapperDataMakeAppoint.setAddNewCar(false);\n }\n String encode = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create().toJson(wrapperDataMakeAppoint);\n RESTManager.getInstance().makeAppointment(encode, new IRequestListener<PostAppointmentResponse>() {\n @Override\n public void onCompleted(PostAppointmentResponse data) {\n super.onCompleted(data);\n if (data != null && data.isSuccess()) {\n EventBusUtils.postEvent(data);\n getView().showSuccessMakeAppointment();\n if (wrapperDataMakeAppoint.isUpdateProfile()) {\n LocalDataManager.getInstance(getContext()).updateProfile(wrapperDataMakeAppoint.getCustomerName(), wrapperDataMakeAppoint.getCustomerEmail());\n }\n if (wrapperDataMakeAppoint.isAddNewCar()) {\n LocalDataManager.getInstance(getContext()).updateCar(wrapperDataMakeAppoint.getCarId(), wrapperDataMakeAppoint.getCarName(), wrapperDataMakeAppoint.getLicensePlates());\n }\n }\n }\n });\n }", "public void addBooking(Bookings b) {\n IController<Bookings> ic = new Controller<>();\n\n // Check whether the booking conflicts with another booking.\n for (Bookings booking : ic.readAll(Bookings.class)) {\n if (b.conflictsWith(booking)) {\n throw new IllegalArgumentException(\"That booking conflicts with another booking.\");\n }\n }\n\n Modules relatedModule = b.getModule();\n\n // Check whether the room is available at the given time.\n if (!b.getRooms().isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"That room is unavailable at this time.\");\n }\n // Check whether the students are available at that time.\n for (Students student : relatedModule.getStudents()) {\n if (!student.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A student is unavailable at this time.\");\n }\n }\n // Check whether the staff members are available at that time.\n for (Staff staff : relatedModule.getStaff()) {\n if (!staff.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A staff member is unavailable at this time.\");\n }\n }\n\n // Put the booking into the database.\n ic.create(b);\n System.out.println(b.confirmation() + \"\\n\");\n }", "@Override\r\n\tpublic boolean createBooking(Booking_IF bk) {\r\n\t\tPreparedStatement myStatement = null;\r\n\t\tString query = null;\r\n\t\tint count = 0;\r\n\t\ttry{\r\n\t\t\tquery = \"insert into Booking values(?,?);\";\r\n\t\t\tmyStatement = myCon.prepareStatement(query);\r\n\t\t\tmyStatement.setInt(2, bk.getUserid());\r\n\t\t\tmyStatement.setInt(1, bk.getShiftid());\r\n\t\t\tcount = myStatement.executeUpdate();\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally{\r\n\t\t\ttry {\r\n\t\t\t\tif (myStatement != null)\r\n\t\t\t\t\tmyStatement.close();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count!=1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}", "@PostMapping(\"/add\")\r\n\tResponseEntity<BookingDetails> bookingprocess(@RequestBody CreateBookingRequest bookingDto){\r\n\t\tList<Seat> seats = choosenSeats(bookingDto.getChoosenSeats());\r\n\t\tdouble cost = getCost(seats);\r\n\t\t\r\n\t\tBooking booking=convertBookingDto(bookingDto,cost);\r\n\t\tbooking = bookingService.createBooking(booking,bookingDto.getPaymentMethod(),bookingDto.getScreenName());\r\n\t\t\r\n\t\tBookingDetails bookingDetails = convertBooking(booking);\r\n\t\tResponseEntity<BookingDetails> response = new ResponseEntity<BookingDetails>(bookingDetails,HttpStatus.OK);\r\n\t\treturn response;\r\n\t}", "void saveShipment(Shipment shipment);", "@Override\r\n public void save(BuyTicketModel value) {\n String sql = \"insert into buyticket values(?,?,?,?,?,?,?,?,?,?,?,?) \";\r\n \r\n try {\r\n PreparedStatement pstm = database.getCon().prepareStatement(sql);\r\n pstm.setString(1, value.getSlno());\r\n pstm.setString(2, value.getCustomername());\r\n pstm.setString(10,value.getContact());\r\n pstm.setString(3, value.getDestination());\r\n pstm.setString(4, value.getTime());\r\n pstm.setString(5, value.getFare());\r\n pstm.setString(6, value.getComment());\r\n pstm.setString(7, value.getDate());\r\n pstm.setString(8, value.getPayment());\r\n pstm.setString(9, value.getSeat());\r\n pstm.setString(11, value.getType());\r\n pstm.setString(12, value.getBusname());\r\n \r\n \r\n pstm.executeUpdate();\r\n pstm.close();\r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(BuyTicketImpl.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n }", "public void save(ReservationDrive reservationDrive){\n reservationDriveRepository.save(reservationDrive);\n }", "void save(Bill bill);", "void insertConfirm(bookingDTO booking) throws DataAccessException;", "private void save(){\n\n this.title = mAssessmentTitle.getText().toString();\n String assessmentDueDate = dueDate != null ? dueDate.toString():\"\";\n Intent intent = new Intent();\n if (update){\n assessment.setTitle(this.title);\n assessment.setDueDate(assessmentDueDate);\n assessment.setType(mAssessmentType);\n intent.putExtra(MOD_ASSESSMENT,assessment);\n } else {\n intent.putExtra(NEW_ASSESSMENT, new Assessment(course.getId(),this.title,mAssessmentType,assessmentDueDate));\n }\n setResult(RESULT_OK,intent);\n finish();\n }", "public void makeBooking (Object booking);", "@Override\n\tpublic void saveBankingDetail(BankingDetail baningDetail) {\n\t\t\n\t}", "public int makeBooking(BookingEventModel booking) {\n\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\tconnection.setAutoCommit(false);\n\t\t\tstatement = connection.createStatement();\n\n\t\t\tString sql = \"insert into bookings (email, checkin, checkout, price) \" +\n\t\t\t\t\tString.format(\"values ('%s', '%s', '%s', %d);\", booking.userEmail, formatter.format(booking.checkIn),\n\t\t\t\t\t\t\tformatter.format(booking.checkOut), booking.payment);\n\t\t\tstatement.executeUpdate(sql);\n\t\t\t//\t\t System.out.println(\"Inserted records into the table...\"+sql);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tstatement.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t//\t\t\ttry {\n\t\t\t//\t\t\t\tconnection.close();\n\t\t\t//\t\t\t} catch (SQLException e) {\n\t\t\t//\t\t\t\te.printStackTrace();\n\t\t\t//\t\t\t}\n\t\t}\n\n\t\tResultSet lastId = null;\n\t\tint bookingNumber = 0;\n\t\tStatement statement2 = null;\n\t\ttry {\n\t\t\t//\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t//\t\t\tconnection.setAutoCommit(false);\n\t\t\tstatement2 = connection.createStatement();\n\t\t\tString sql = \"SELECT last_insert_rowid() FROM bookings\";\n\t\t\tlastId = statement2.executeQuery(sql);\n\n\t\t\tlastId.next();\n\t\t\tbookingNumber = lastId.getInt(1);\n\t\t\t//\t\t System.out.println(\"last id...\"+sql+\" \"+bookingNumber);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tlastId.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tstatement2.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconnection.commit();\n\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tStatement statement3 = null;\n\t\tfor (Room r: booking.rooms) {\n\t\t\ttry {\n\t\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t\tstatement3 = connection.createStatement();\n\n\t\t\t\tString sql = String.format(\"insert into room_booking_junction (room_id, booking_id) values (%d, %d)\",\n\t\t\t\t\t\tr.getId(), bookingNumber);\n\t\t\t\tstatement3.executeUpdate(sql);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tstatement3.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconnection.commit();\n\t\t\t\t\tconnection.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tStatement statement4 = null;\n\t\tfor (HashMap.Entry<ExtraService, Integer> entry : booking.services.entrySet()){\n\t\t\ttry {\n\t\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t\tstatement4 = connection.createStatement();\n\n\t\t\t\tString sql = String.format(\"insert into service_booking_junction (service_id, booking_id, amount) values (%d, %d, %d)\",\n\t\t\t\t\t\tentry.getKey().getId(), bookingNumber, entry.getValue());\n\t\t\t\tstatement4.executeUpdate(sql);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tstatement4.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconnection.commit();\n\t\t\t\t\tconnection.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bookingNumber;\n\t}", "private void saveData() {\n try {\n Student student = new Student(firstName.getText(), lastName.getText(),\n form.getText(), stream.getText(), birth.getText(),\n gender.getText(), Integer.parseInt(admission.getText()),\n Integer.parseInt(age.getText()));\n\n\n if (action.equalsIgnoreCase(\"new\") && !assist.checkIfNull(student)) {\n\n dao.insertNew(student);\n JOptionPane.showMessageDialog(null, \"Student saved !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n\n } else if (action.equalsIgnoreCase(\"update\") && !assist.checkIfNull(student)) {\n dao.updateStudent(student, getSelected());\n JOptionPane.showMessageDialog(null, \"Student Updated !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n prepareTable();\n prepareHistory();\n buttonSave.setVisible(false);\n admission.setEditable(true);\n }catch (Exception e)\n {}\n }", "public Event createBooking(RequestContext context) {\n\tHotel hotel = (Hotel) context.getFlowScope().get(\"hotel\");\n\tUser user = (User) context.getConversationScope().get(\"user\");\n\tBooking booking = new Booking(hotel, user);\n\tEntityManager em = (EntityManager) context.getFlowScope().get(\"entityManager\");\n\tem.persist(booking);\n\tcontext.getFlowScope().put(\"booking\", booking);\n\treturn success();\n }", "@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}", "public void saveAppointment(ActionEvent event) throws IOException {\n if(!validateInputFields()){\n return;\n }\n if(!validateTime()){\n return;\n }\n LocalDate date = startLDT.toLocalDate();\n int customer = customerCombo.getSelectionModel().getSelectedItem().getId();\n overlaps = getSameDateAppointments(customer, date);\n if(overlaps.size() > 0){\n boolean noOverlap = validateOverlap(overlaps);\n if (!noOverlap){\n showError(true, \"Selected time for customer overlaps with another appointment. Please select another time.\");\n return;\n }\n }\n // update db\n String titleField = titleText.getText();\n String descriptionField = descriptionText.getText();\n String loc = locationCombo.getSelectionModel().getSelectedItem().toString();\n int contact = contactCombo.getSelectionModel().getSelectedItem().getId();\n String ty = typeCombo.getSelectionModel().getSelectedItem().toString();\n int user = userCombo.getSelectionModel().getSelectedItem().getId();\n Timestamp start = convertZDT(startZDT);\n Timestamp end = convertZDT(endZDT);\n updateAppointment(selectedRow.getId(), titleField, descriptionField, loc, start, end, ty, user, contact, customer);\n backToMain(event);\n }", "public void setBookingId(int booking_id) {\n this.booking_id = booking_id;\n }", "@PostMapping(value=\"/booking\" , consumes = MediaType.APPLICATION_JSON_VALUE ,\n produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity createBooking(@RequestBody BookingDTO bookingDTO){\n BookingInfoEntity booking = POJOConvertor.covertBookingDTOToEntity(bookingDTO);\n\n BookingInfoEntity savedBooking = bookingService.createBooking(booking);\n\n BookingDTO savedBookingDTO = POJOConvertor.covertBookingEntityToDTO(booking);\n\n return new ResponseEntity(savedBookingDTO , HttpStatus.CREATED);\n }", "@Override\n\tpublic void insertBookData(BookingBus b) {\n\t\tuserdao.insertBookData(b);\n\t}", "void insertBooking(detailDTO detail) throws DataAccessException;", "private void savedeatils() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tgetFromDate = MainActivity.fromdate;\n\t\tgetToDate = MainActivity.todate;\n\t\tgetAddr = etGetAddr.getText().toString();\n\t\tgetPin = sGetPostal.getText().toString();\n\t\teGetTelNo = eGetPhone.getText().toString();\n\t\teGetFaxNO = eGetFax.getText().toString();\n\t\tetGetWeb = etGetWebSite.getText().toString();\n\t\teGetEmail = eGetEmailid.getText().toString();\t\n\t\tetPan = etPanNo.getText().toString();\n\t\tetMVATno = etMVATnum.getText().toString();\n\t\tetServiceTaxno = etServiceTaxnum.getText().toString();\n\t\tetRegNo = etRegNum.getText().toString();\n\t\tRegDate = btnRegDate.getText().toString();\n\t\tetFcraNo = etFcraNum.getText().toString();\n\t\tFcraDate = btnFcraDate.getText().toString();\n\t\t\n\t\torgparams = new Object[]{orgcode,getAddr,selectedCounrty,selectedStateName,selectedCityName,getPin, \n\t\t\t\t\t\teGetTelNo,eGetFaxNO,eGetEmail,etGetWeb,etMVATno,etServiceTaxno,etRegNo,RegDate,etFcraNo,FcraDate ,\n\t\t\t\t\t\tetPan};\n\t\t\t\t\n\t\tsave_edit = (String)org.updateOrg(orgparams, client_id);\n\t\t\n\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\n\t\t\t\tbuilder.setMessage(\"Organisation \"+getOrgName+\" with details saved successfully\")\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"Ok\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\tif(editDetailsflag==false){\n\t\t\t\t\t//To pass on the activity to the next page\n\t\t\t\t\tIntent intent = new Intent(context, menu.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tAlertDialog alert = builder.create();\n\t\t\t\talert.show();\n\t\t}", "public void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tObject HotelID = cbHotelsOptions.getSelectedItem();\n\t\t\t\t\tHotel hotel;\n\t\t\t\t\thotel = (Hotel) HotelID;\n\t\t\t\t\tlong id = hotel.getUniqueId();\n\t\t\t\t\t//\tSystem.out.println(id);\n\t\t\t\t\tString inmonth = txtInMonth.getText();\n\t\t\t\t\tint inMonth = Integer.valueOf(inmonth);\n\t\t\t\t\tString inday = txtInDay.getText();\n\t\t\t\t\tint inDay = Integer.parseInt(inday);\n\t\t\t\t\tString outmonth = txtOutMonth.getText();\n\t\t\t\t\tint outMonth = Integer.valueOf(outmonth);\n\t\t\t\t\tString outday = txtOutDay.getText();\n\t\t\t\t\tint OutDay = Integer.parseInt(outday);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\"Reservation.txt\", true);\n\t\t\t\t\tPrintWriter pw = new PrintWriter(fos);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * i then check the canBook method and according to the canBook method \n\t\t\t\t\t * i check if they can book, and if yes i add the reservation\n\t\t\t\t\t * otherwise it prints so the user may enter different values\n\t\t\t\t\t */\n\t\t\t\t\t{\n\t\t\t\t\t\tif(h.canBook(new Reservation(id,inMonth, inDay, OutDay)) == true) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservation.add(new Reservation (id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\tr = new Reservation (id,inMonth, inDay, OutDay);\n\t\t\t\t\t\t\th.addResIfCanBook(new Reservation(id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\treservationsModel.addElement(r);\n\t\t\t\t\t\t\tpw.println( id + \" - \" + inMonth + \"-\"+ inDay+ \" - \" + outMonth + \"-\" + OutDay);\n\t\t\t\t\t\t\tpw.close();\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\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\tJOptionPane.showMessageDialog(null, \"These dates are already reserved\"\n\t\t\t\t\t\t\t\t\t+ \"\\nPlease try again!\");\t\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\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\t * Then the catch Block checks for file not found exception\n\t\t\t\t */\n\t\t\t\tcatch (FileNotFoundException fnfe) \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found.\");\n\t\t\t\t}\n\t\t\t}", "public void save(Detailreservationroom detail, int selection) {\n conect.open();\n Transaction trans = conect.getSession().beginTransaction();\n switch (selection) {\n case 0:\n conect.getSession().save(detail);\n trans.commit();\n break;\n case 1:\n conect.getSession().update(detail);\n trans.commit();\n break;\n case 2: \n conect.getSession().update(detail);\n trans.commit();\n break;\n }\n conect.close();\n }", "public String customer_request_booking(Customer_Booking cb){\n\t\tIdUser user= new IdUser();\n\t\tTransaction trns1 = null;\n Session session = HibernateUtil.getSessionFactory().openSession(); \n Booking_Request_Master book = new Booking_Request_Master();\n\t\ttry {\n trns1 = session.beginTransaction();\n Pickup_Location_Master pick_source=new Pickup_Location_Master();\n \tpick_source = (Pickup_Location_Master) session.createQuery(\"from Pickup_Location_Master where id=?\").setParameter(0, cb.getSource()).list().get(0);\n \tPickup_Location_Master pick_destin=new Pickup_Location_Master();\n \tpick_destin = (Pickup_Location_Master) session.createQuery(\"from Pickup_Location_Master where id=?\").setParameter(0, cb.getDestination()).list().get(0);\n \n \t\n book.setCreated_at(current_timestamp);\n book.setUpdated_at(current_timestamp);\n book.setProvided_time(cb.getTime()+\":00\");\n book.setSource_id(cb.getSource());\n book.setFrom_id(pick_source.getLocation_id());\n book.setDestination_id(cb.getDestination());\n book.setTo_id(pick_destin.getLocation_id());\n book.setDept_date(java.sql.Date.valueOf(cb.getDate()));\n book.setDept_time(java.sql.Time.valueOf(cb.getTime()+\":00\"));\n book.setNumber_of_booking(cb.getNumber_of_seat());\n book.setUser_id(user.getAuthentic());\n book.setEnabled(true);\n book.setStatus(\"Pending\");\n session.save(book);\n trns1.commit();\n } catch (RuntimeException e) {\n \te.printStackTrace();\n } \n\t\tfinally {\n session.flush();\n session.close();\n }\n\t\treturn \"success\";\n\t}", "public void completeBooking(){\r\n\t\tbookings.putAll(tempBookings);\r\n\t\ttempBookings.clear();\r\n\t}", "public void setMyRoomReservationOK() throws SQLException{\n int guestID = guest[guestIndex].getAccountID();\n int selRoomCount = getSelectedRoomsCounter();\n int[] tempRooms = getGuestSelRooms(); //Selected room by room number\n \n roomStartDate = convertMonthToDigit(startMonth) + \"/\" +startDay+ \"/\" + startYear;\n roomEndDate = convertMonthToDigit(endMonth) + \"/\" +endDay+ \"/\" + endYear; \n \n System.out.println(\"\\nSaving reservation\");\n System.out.println(\"roomStartDate\" + roomStartDate);\n System.out.println(\"roomEndDate:\" + roomEndDate);\n \n //Searching the reserved room number in the hotel rooms\n for(int i=0;i<selRoomCount;i++){\n for(int i2=0;i2<roomCounter;i2++){\n if(myHotel[i2].getRoomNum() == tempRooms[i]){ \n //if room number from array is equal to selected room number by guest\n System.out.println(\"Room Found:\"+tempRooms[i]); \n \n myHotel[i2].setOccupantID(guestID);\n myHotel[i2].setAvailability(false);\n myHotel[i2].setOccupant(guest[guestIndex].getName());\n myHotel[i2].setStartDate(roomStartDate);\n myHotel[i2].setEndDate(roomEndDate);\n }\n }\n }\n \n updateRoomChanges_DB(); //apply changes to the database\n \n //Updates room preference of the current guest \n String sqlstmt = \"UPDATE APP.GUEST \"\n + \" SET ROOMPREF = '\" + guest[guestIndex].getPref()\n + \"' WHERE ID = \"+ guest[guestIndex].getAccountID();\n \n CallableStatement cs = con.prepareCall(sqlstmt); \n cs.execute(); //execute the sql command \n cs.close(); \n }", "private void saveStudent(){\n StudentGroupThrift group = mainWindow.getStudentClient().getStudentGroupByName\n (this.group.getSelectedItem().toString());\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n String birthDate = format.format(jDateChooser.getDate());\n StudentThrift studentThrift = new StudentThrift(\n id,\n getTextID(FIRST_NAME),\n getTextID(LAST_NAME),\n getTextID(MIDDLE_NAME),\n birthDate,\n getTextID(ADDRESS),\n group\n );\n mainWindow.getStudentClient().saveStudent(studentThrift);\n closeDialog();\n }", "protected void Save() {\n\t\tString WareName = txtWareName.getText().trim();\n\t\tint WareCap = Integer.parseInt(txtWareCap.getText().trim());\n\t\tString WareAddress = txtWareAddress.getText().trim();\n\t\tint WareUser = Integer.parseInt(txtWareUser.getText().trim());\n\t\tWareUserDto wud = new WareUserDto();\n\t\t\n\t\twud.setWareID(this.wud.getWareID());\n\t\twud.setWareName(WareName);\n\t\twud.setWareCap(WareCap);\n\t\twud.setWareAddress(WareAddress);\n\t\twud.setWareUser(WareUser);\n\t\t\n\t\tif(service.updateWareUserService(wud)){\n\t\t\tList<WareUserDto> list = service.getWareHouseAllInfo();\n\t\t\t//bwj.setTabDate(list);\n\t\t\tbtnWareJDialog.setTabDate(list);\n\t\t\tthis.dispose();\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(this, \"修改失败\", \"错误\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t}", "public BookingInfoEntity createBooking(BookingInfoEntity bookingInfoEntity) {\n System.out.println(bookingInfoEntity.getFromDate() + \"\\t\" + bookingInfoEntity.getToDate());\n long noOfDays = ChronoUnit.DAYS.between(bookingInfoEntity.getFromDate(), bookingInfoEntity.getToDate());\n bookingInfoEntity.setRoomPrice( 1000 * bookingInfoEntity.getNumOfRooms() * ((int)noOfDays) );\n bookingInfoEntity.setRoomNumbers(getRandomNumber(bookingInfoEntity.getNumOfRooms()));\n bookingInfoEntity = bookingRepository.save(bookingInfoEntity); \n return bookingInfoEntity;\n }", "@Override\r\n\tpublic void storedBook(Book book) {\n\t\tticketDao.insertBook(book);\r\n\t}", "@PostMapping(\"/bookings\")\n @ResponseStatus(HttpStatus.CREATED)\n public Booking addBooking(@RequestBody Booking booking){\n bookingClient.addBooking(booking);\n return booking;\n }", "private void saveBook() {\n // Read the data from the fields\n String productName = productNameEditText.getText().toString().trim();\n String price = priceEditText.getText().toString().trim();\n String quantity = Integer.toString(bookQuantity);\n String supplierName = supplierNameEditText.getText().toString().trim();\n String supplierPhone = supplierPhoneEditText.getText().toString().trim();\n\n // Check if any fields are empty, throw error message and return early if so\n if (productName.isEmpty() || price.isEmpty() ||\n quantity.isEmpty() || supplierName.isEmpty() ||\n supplierPhone.isEmpty()) {\n Toast.makeText(this, R.string.editor_activity_empty_message, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Format the price so it has 2 decimal places\n String priceFormatted = String.format(java.util.Locale.getDefault(), \"%.2f\", Float.parseFloat(price));\n\n // Create the ContentValue object and put the information in it\n ContentValues contentValues = new ContentValues();\n contentValues.put(BookEntry.COLUMN_BOOK_PRODUCT_NAME, productName);\n contentValues.put(BookEntry.COLUMN_BOOK_PRICE, priceFormatted);\n contentValues.put(BookEntry.COLUMN_BOOK_QUANTITY, quantity);\n contentValues.put(BookEntry.COLUMN_BOOK_SUPPLIER_NAME, supplierName);\n contentValues.put(BookEntry.COLUMN_BOOK_SUPPLIER_PHONE_NUMBER, supplierPhone);\n\n // Save the book data\n if (currentBookUri == null) {\n // New book, so insert into the database\n Uri newUri = getContentResolver().insert(BookEntry.CONTENT_URI, contentValues);\n\n // Show toast if successful or not\n if (newUri == null)\n Toast.makeText(this, getString(R.string.editor_insert_book_failed), Toast.LENGTH_SHORT).show();\n else\n Toast.makeText(this, getString(R.string.editor_insert_book_successful), Toast.LENGTH_SHORT).show();\n } else {\n // Existing book, so save changes\n int rowsAffected = getContentResolver().update(currentBookUri, contentValues, null, null);\n\n // Show toast if successful or not\n if (rowsAffected == 0)\n Toast.makeText(this, getString(R.string.editor_update_book_failed), Toast.LENGTH_SHORT).show();\n else\n Toast.makeText(this, getString(R.string.editor_update_book_successful), Toast.LENGTH_SHORT).show();\n\n }\n\n finish();\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tStoredBookDAO storeBookDAO = new StoredBookDAO(BookInfoActivity.this);\n\t\t\tBookStoredEntity testBookBorrowedEntity1 = new BookStoredEntity();\n\t\t\ttestBookBorrowedEntity1.setBookId(\"1\");\n\t\t\ttestBookBorrowedEntity1.setBookText(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookImageUrl(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookPress(\"android\");\n\t\t\ttestBookBorrowedEntity1.setBookPressTime(\"android\");\n\t\t\tstoreBookDAO.insert(testBookBorrowedEntity1);\n\t\t\tToast.makeText(BookInfoActivity.this, R.string.storesuccess, Toast.LENGTH_SHORT).show();\n\t\t}", "private void saveEvent(){\n String event_name = eventName.getText().toString();\r\n String coach = coach_string;\r\n String time = class_time_string;\r\n int nfcID= 4;\r\n\r\n Map<String, Object> data = new HashMap<>();\r\n\r\n data.put(\"event_name\", event_name);\r\n data.put(\"coach\", coach);\r\n data.put(\"class_time\", time);\r\n data.put(\"nfcID\", nfcID);\r\n\r\n Database.writeClassDb(data, time ,date);\r\n startActivity(new Intent(addCalenderEvent.this, CalendarActivity.class));\r\n finish();\r\n }", "private void handleBooking() {\n\t\tString customerID;\n\t\tint recNo = table.getSelectedRow();\n\t\tif(recNo == -1){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcustomerID = JOptionPane.showInputDialog(mainPanel,\n\t\t\t\t\t\"Enter Customer ID (8 Digits)\");\n\t\t\tif (customerID != null) {\t\n\t\t\t\tcontroller.reserveRoom(recNo, customerID);\n\t\n\t\t\t\tupdateTable(nameSearchBar.getText(),\n\t\t\t\t\t\tlocationSearchBar.getText());\n\t\t\t}\n\t\t} catch (final InvalidCustomerIDException icide) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, \"Invalid format!\");\n\t\t} catch (final BookingServiceException bse) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, bse.getMessage());\n\t\t} catch (final ServiceUnavailableException sue) {\n\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public static void AddBooking(Booking booking){\n \n \n try (Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM booking\")){\n \n resultSet.moveToInsertRow();\n resultSet.updateInt(\"BookingNumber\", booking.getBookingNumber());\n resultSet.updateString(\"FlightNumber\", booking.getFlightNumber());\n resultSet.updateDouble(\"Price\", booking.getPrice());\n resultSet.updateString(\"CabinClass\", booking.getCabinClass());\n resultSet.updateInt(\"Quantity\", booking.getQuantity());\n resultSet.updateInt(\"Insurance\", booking.getInsurance());\n resultSet.insertRow();\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n \n \n }", "public void saveAppointment(Appointment appointment) {\n\t\tappointmentDao.saveAppointment(appointment);\n\t}", "public void save(int reservationID, int customerId,String airline, int flightNumber, int HotelId, int carId,\n\t\t\tint numberOfReservedRooms, int numberOfReservedSuites, int numberOfReservedCars, int numberOfreservedSeats,\n\t\t\tint numNightsPerRooms, int numberNightPerSuites, int numDaysPerCars, int numSeats)\n\t\n\t{\n\t}", "void setDataIntoSuppBusObj() {\r\n supplierBusObj.setValue(txtSuppId.getText(),txtSuppName.getText(), txtAbbreName.getText(),\r\n txtContactName.getText(),txtContactPhone.getText());\r\n }", "private void saveToDb() {\r\n ContentValues values = new ContentValues();\r\n values.put(DbAdapter.KEY_DATE, mTime);\r\n if (mPayeeText != null && mPayeeText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_PAYEE, mPayeeText.getText().toString());\r\n if (mAmountText != null && mAmountText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_AMOUNT, mAmountText.getText().toString());\r\n if (mCategoryText != null && mCategoryText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_CATEGORY, mCategoryText.getText().toString());\r\n if (mMemoText != null && mMemoText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_MEMO, mMemoText.getText().toString());\r\n if (mTagText != null && mTagText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_TAG, mTagText.getText().toString());\r\n\r\n \tif (Utils.validate(values)) {\r\n \t\tmDbHelper.open();\r\n \t\tif (mRowId == null) {\r\n \t\t\tlong id = mDbHelper.create(values);\r\n \t\t\tif (id > 0) {\r\n \t\t\t\tmRowId = id;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tmDbHelper.update(mRowId, values);\r\n \t\t}\r\n \t\tmDbHelper.close();\r\n \t}\r\n\t}", "public void bookFlight(){\n //Steps\n //1 Show the available flights. (at least one seat with 0)\n //2 User select a flight, and the system automatically set the seat with his id. he is not able to select the seat\n //3 User confirm the reservation \n //4 Flight reserved\n \n //1\n //FlightRepository.availableFlights();\n //Scanner input = new Scanner(System.in);\n //String flightNumber = input.nextLine();\n \n //2,3 and 4\n Flight flightObject = FlightRepository.getFlight(this.number);\n if (flightObject == null){\n System.out.println(\"Please select a valid flight number\");\n }\n flightObject.setPassengerSeat(this.PassengerID);\n }", "void save(DeliveryOrderForm deliveryOrderForm);", "@Override\n public void onSaveInstanceState(Bundle outState){\n // Save current booking times to outstate\n outState.putInt(BOOKING_HOUR_KEY, bookingHour);\n outState.putInt(BOOKING_MINUTE_KEY, bookingMinute);\n\n super.onSaveInstanceState(outState);\n }", "private void save() {\n Toast.makeText(ContactActivity.this, getString(R.string.save_contact_toast), Toast.LENGTH_SHORT).show();\n\n String nameString = name.getText().toString();\n String titleString = title.getText().toString();\n String emailString = email.getText().toString();\n String phoneString = phone.getText().toString();\n String twitterString = twitter.getText().toString();\n \n if (c != null) {\n datasource.editContact(c, nameString, titleString, emailString, phoneString, twitterString);\n }\n else {\n \tc = datasource.createContact(nameString, titleString, emailString, phoneString, twitterString);\n }\n }", "public void saveBookListInfo(CheckOutForm myForm) {\n\t\tint id=myForm.getFrmViewDetailBook().getBookId();\r\n\t\tBookList myBookList=myBookListDao.getBookListById(id);\r\n\t\tint c=myForm.getFrmViewDetailBook().getNoofcopies();\r\n\t\tint copy=c+myForm.getNoOfcopies();\r\n\t\tmyForm.setNoOfcopies(copy);\r\n\t\tmyBookList.setNoOfCopy(copy);\r\n\t\tmyBookListDao.saveBookInfo(myBookList);\r\n\t\t\r\n\t}", "public void saveOffice(Office office) {\n\t\t\n\t}", "void saveTrip(Trip parTrip);", "public Book save(Book book) {\n return bookRepository.save(book);\n }", "@Override\r\n\t@Transactional\r\n\tpublic Book save(Book book) {\r\n\t\tSession session = getSession();\r\n\r\n\t\tsession.save(book);\r\n\r\n\t\treturn book;\r\n\t}", "AttendanceDTO save(AttendanceDTO attendance);", "@Override\r\n\tpublic void save() {\n\t\tif (section != null && !section.isEmpty()) {\r\n\t\t\tif (gradeLevel == null || gradeLevel.isEmpty()) {\r\n\t\t\t\tSection sec = (Section) Section.extractObject(Section.class.getSimpleName(), section);\r\n\t\t\t\tgradeLevel = sec.gradeLevel;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (course == null && gradeLevel != null && !gradeLevel.isEmpty()) {\r\n\t\t\tGradeLevel lvl = (GradeLevel) GradeLevel.extractObject(GradeLevel.class.getSimpleName(), gradeLevel);\r\n\t\t\tcollege = lvl.college;\r\n\t\t\tcourse = lvl.course;\r\n\t\t}\r\n\t\tif (course!=null && course.startsWith(\"B\")) {\r\n\t\t\tcollege = true;\r\n\t\t}\r\n\t\tif (!isEmptyKey()) {\r\n//\t\t\twe can get the latest enrollment schoolyear\r\n\t\t\ttry {\r\n\t\t\t\tif (\"ENROLLED\".equals(status)) {\r\n\t\t\t\t\tString sc = DBClient.getSingleColumn(BeanUtil.concat(\"SELECT a.schoolYear FROM Enrollment a WHERE a.studentId=\",personId,\" ORDER BY a.schoolYear DESC\")).toString();\r\n\t\t\t\t\tlatestSchoolYear = sc;\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}\r\n\t\tif (schoolYear==null || schoolYear.isEmpty()) {\r\n\t\t\tschoolYear = AppConfig.getSchoolYear();\r\n\t\t}\r\n\t\tpersonType = \"STUDENT\";\r\n\t\tif (isEmptyKey()) {\r\n\t\t\tsuper.save();\r\n new springbean.SchoolDefaultProcess().createAllSubjects(this);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsuper.save();\r\n\t\t}\r\n\t}", "void save(Employee employee);", "public void setBooking(Set<Booking> aBooking) {\n booking = aBooking;\n }", "public void addBooking(Booking b)\r\n {\r\n bookings.add(b);\r\n }", "public Booking makeBooking(Customer customer, Airline flight, int baggage, String type, Date date);", "void addconBooking(detailDTO detail) throws DataAccessException;", "@Override\n\tpublic HotelBooking bookRoom(HotelForm hotelForm, Session session) throws HibernateException, Exception{\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tHotelBooking hotelBooking = setDAOValues(hotelForm);\n\t\tsession.save(hotelBooking);\n\t\t\n\t\treturn null;\n\t}", "private void saveNewBusiness() {\n if(Utils.checkInternet(this)){\n //show dialog\n mProgressDialog.show();\n //get data from views\n final String businessTitle = mBusinessTitle.getText().toString();\n\n final String businessPhone = mBusinessPhone.getText().toString();\n final String businessEmail = mBusinessEmail.getText().toString();\n final String businessDistrict = mBusinessDistrictSpinner.getSelectedItem().toString();\n final String businessCity = mBusinessCitySpinner.getSelectedItem().toString();\n final Category businessCategory = (Category) mBusinessCategorySpinner.getSelectedItem();\n final String businessSpecialization = mBusinessSpecializationSpinner.getSelectedItem().toString();\n String businessAbout = mBusinessAbout.getText().toString();\n\n if (businessTitle.isEmpty()) {\n mBusinessTitle.setError(getResources().getString(R.string.required_field));\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n return;\n }\n else if( mCurrentLocationStr.equals(\"\")){\n showToast(R.string.required_location);\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n return;\n }\n else if(businessDistrict.equals(\"Choose District\")){\n showToast(R.string.required_city);\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n return;\n }\n else if (businessPhone.isEmpty()) {\n mBusinessPhone.setError(getResources().getString(R.string.required_field));\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n return;\n }\n else if (!businessPhone.isEmpty() && businessPhone.length() < 9) {\n mBusinessPhone.setError(getResources().getString(R.string.phone_short));\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n showToast(R.string.phone_short);\n return;\n }else if (!businessEmail.isEmpty() && !android.util.Patterns.EMAIL_ADDRESS.matcher(businessEmail).matches()) {\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();\n showToast(R.string.wrong_email);\n return;\n }\n\n if(businessAbout.isEmpty()){\n businessAbout = getString(R.string.business_about_empty).toString();\n }\n\n final BusinessPlace mBusinessPlace = new BusinessPlace();\n mBusinessPlace.setOwner_id(FirebaseUtil.getCurrentUserId());\n mBusinessPlace.setTitle(businessTitle);\n mBusinessPlace.setImage(businessPicture);\n mBusinessPlace.setPhone(businessPhone);\n mBusinessPlace.setEmail(businessEmail);\n mBusinessPlace.setCategory(businessCategory.getFr_name());\n mBusinessPlace.setSpecialization(businessSpecialization);\n mBusinessPlace.setCity(businessCity);\n mBusinessPlace.setDistrict(businessDistrict);\n mBusinessPlace.setAbout(businessAbout);\n mBusinessPlace.setLocation(mCurrentLocationStr);\n mBusinessPlace.setLatitude(mCurrentLatLng.latitude);\n mBusinessPlace.setLongitude(mCurrentLatLng.longitude);\n mBusinessPlace.setCreated_at(String.valueOf(System.currentTimeMillis()));\n mBusinessPlace.setUpdated_at(String.valueOf(System.currentTimeMillis()));\n mBusinessPlace.setIcon(businessCategory.getIcon());\n\n //add business place to firebase\n final String businessPlaceKey = FirebaseUtil.getBusinessRef().push().getKey();\n\n FirebaseUtil.getBusinessRef().child(businessPlaceKey).setValue(mBusinessPlace, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if(databaseError==null){\n FirebaseUtil.getUserBusinessRef().push().setValue(businessPlaceKey, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError==null){\n showToast(R.string.success_add_place);\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();;\n IntentToMainActivity(mBusinessPlace);\n }else {\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();;\n showToast(R.string.error_add_place);\n }\n\n }\n });\n }else {\n if (mProgressDialog.isShowing())\n mProgressDialog.dismiss();;\n showToast(R.string.error_add_place);\n }\n\n }\n });\n }\n else\n {\n Utils.internetErrorDialog(this);\n }\n\n }", "static void saveBus(Bus bus) {\n\t\t\t\n\t\t}", "public void savePatientDetails(View view){\r\n\t\tsaveToSQLite();\r\n createCalendarEntry();\r\n\t\tToast.makeText(this, \"Saved. Reminder created.\", Toast.LENGTH_SHORT).show();\r\n\t}", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "private void updateBook(){\n String dateStarted = ((EditText)dialogView.findViewById(R.id.input_date_started_reading))\n .getText().toString();\n book.setDateStarted(dateStarted);\n\n String dateCompleted = ((EditText)dialogView.findViewById(R.id.input_date_completed))\n .getText().toString();\n book.setDateCompleted(dateCompleted);\n\n //update the book\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n mDatabase.child(\"books\").child(book.getId()).setValue(book);\n\n //hide dialog\n dismiss();\n }", "public void saveFiAvailableInvoice(FiAvailableInvoice fiAvailableInvoice);", "public void save();", "public void save();", "public void save();", "public void save();", "private void saveBook() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String productName = etTitle.getText().toString().trim();\n String author = etAuthor.getText().toString().trim();\n String price = etPrice.getText().toString().trim();\n String quantity = etEditQuantity.getText().toString().trim();\n String supplier = etSupplier.getText().toString().trim();\n String supplierPhoneNumber = etPhoneNumber.getText().toString().trim();\n\n // If this is a new book and all of the fields are blank.\n if (currentBookUri == null &&\n TextUtils.isEmpty(productName) && TextUtils.isEmpty(author) &&\n TextUtils.isEmpty(price) && quantity.equals(getString(R.string.zero)) &&\n TextUtils.isEmpty(supplier) && TextUtils.isEmpty(supplierPhoneNumber)) {\n // Exit the activity without saving a new book.\n finish();\n return;\n }\n\n // Make sure the book title is entered.\n if (TextUtils.isEmpty(productName)) {\n Toast.makeText(this, R.string.enter_title, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the author is entered.\n if (TextUtils.isEmpty(author)) {\n Toast.makeText(this, R.string.enter_author, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the price is entered.\n if (TextUtils.isEmpty(price)) {\n Toast.makeText(this, R.string.enter_price, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the quantity is entered if it is a new book.\n // Can be zero when editing book, in case the book is out of stock and user wants to change\n // other information, but hasn't received any new inventory yet.\n if (currentBookUri == null && (quantity.equals(getString(R.string.zero)) ||\n quantity.equals(\"\"))) {\n Toast.makeText(this, R.string.enter_quantity, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the supplier is entered.\n if (TextUtils.isEmpty(supplier)) {\n Toast.makeText(this, R.string.enter_supplier, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the supplier's phone number is entered.\n if (TextUtils.isEmpty(supplierPhoneNumber)) {\n Toast.makeText(this, R.string.enter_suppliers_phone_number,\n Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Convert the price to a double.\n double bookPrice = Double.parseDouble(price);\n\n // Convert the quantity to an int, if there is a quantity entered, if not set it to zero.\n int bookQuantity = 0;\n if (!quantity.equals(\"\")) {\n bookQuantity = Integer.parseInt(quantity);\n }\n\n // Create a new map of values, where column names are the keys\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_BOOK_PRODUCT_NAME, productName);\n values.put(BookEntry.COLUMN_BOOK_AUTHOR, author);\n values.put(BookEntry.COLUMN_BOOK_PRICE, bookPrice);\n values.put(BookEntry.COLUMN_BOOK_QUANTITY, bookQuantity);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER, supplier);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_PHONE_NUMBER, supplierPhoneNumber);\n\n // Check if this is a new or existing book.\n if (currentBookUri == null) {\n // Insert a new book into the provider, returning the content URI for the new book.\n Uri newUri = getContentResolver().insert(BookEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the row ID is null, then there was an error with insertion.\n Toast.makeText(this, R.string.save_error, Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful, display a toast.\n Toast.makeText(this, R.string.save_successful, Toast.LENGTH_SHORT).show();\n }\n } else {\n // Check to see if any updates were made if not, no need to update the database.\n if (!bookHasChanged) {\n // Exit the activity without updating the book.\n finish();\n } else {\n // Update the book.\n int rowsUpdated = getContentResolver().update(currentBookUri, values, null,\n null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsUpdated == 0) {\n // If no rows were updated, then there was an error with the update.\n Toast.makeText(this, R.string.update_error, Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful, display a toast.\n Toast.makeText(this, R.string.update_successful,\n Toast.LENGTH_SHORT).show();\n }\n }\n }\n\n // Exit the activity, called here so the user can enter all of the required fields.\n finish();\n }", "protected void saveEarningHistory(EarningHistory earningHistory){\n }", "@Override\n public void onClick(View v) {\n TextView txtDate = (TextView)findViewById(R.id.tvDate);\n TextView txtTime = (TextView)findViewById(R.id.tvTime);\n // Log.v(\"Vidushi:update\", userId);\n helper.insertVolunteerDuty(userId,txtDate.getText().toString(),txtTime.getText().toString());\n Toast.makeText(getApplicationContext(),\"Information Saved\", Toast.LENGTH_SHORT).show();\n\n\n }", "public Flight save(Flight flight);", "public void issueBook() {\n\t\t JTextField callno = new JTextField();\r\n\t\t JTextField name = new JTextField();\r\n\t\t JTextField id = new JTextField(); \r\n\t\t JTextField contact = new JTextField(); \r\n\t\t Object[] issued = {\r\n\t\t\t\t \"Bookcallno:\",callno,\r\n\t\t\t\t \"Student ID:\",id,\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Contact:\",contact\r\n\t\t\t\t\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, issued, \"New issued book\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n\t\t\tint check = checkBook(callno.getText());\r\n\t\t\tif(check==-1) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Wrong book call number\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n\t\t\telse if(check == 0) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Book is not available right now\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n // add to the Book database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Issued(bookcallno,studentId,studentName,studentContact,issued_date)\"\r\n\t\t\t\t +\" values(?,?,?,?,GETDATE())\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, callno.getText());\r\n\t\t s.setInt(2, Integer.parseInt(id.getText()));\r\n\t\t s.setString(3, name.getText());\r\n\t\t s.setString(4, contact.getText());\r\n\t\t \r\n\t\t s.executeUpdate();\r\n\t\t updateIssuedBook(callno.getText());\r\n\t\t JOptionPane.showMessageDialog(null, \"Issue book successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Issue book failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t }", "public void writeToBookingListFile()\r\n {\r\n\ttry(ObjectOutputStream toBookingListFile = \r\n new ObjectOutputStream(new FileOutputStream(\"listfiles/bookinglist.dta\")))\r\n\t{\r\n toBookingListFile.writeObject(bookingList);\r\n bookingList.saveStaticBookingRunNr(toBookingListFile);\r\n\t}\r\n\tcatch(NotSerializableException nse)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Booking objektene er ikke \"\r\n + \"serialiserbare.\\nIngen registrering på fil!\"\r\n + nse.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n\tcatch(IOException ioe)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Det oppsto en feil ved skriving \"\r\n + \"til fil.\\n\" + ioe.getMessage());\r\n\t}\r\n }", "EmployeeDetail save(EmployeeDetail detail) throws DBException;", "@PostMapping(value=\"/booking\")\n public String addBooking(@RequestBody BookingModel data) {\n TrainerModel a = t.getByEmail((data.getEmailTrainerDetail()));\n data.setTrainerDetail(t.getByEmail(data.getEmailTrainerDetail()));\n data.setClientDetail(u.get(data.getEmailClientDetail()));\n if(a.getBookingCount()<5){\n a.setBookingCount(a.getBookingCount()+1);\n t.updateTrainer(a);\n return b.addBooking(data);\n }else{\n return \"Cannot add more than 5 Pets\";\n }\n }", "void save(Athletes athletes);", "public BookedActivity getNewlyAddSavedTrip();", "public void save() {\n }", "private SiteReservation save(SiteReservation reservation){\n try {\n reservation = repo.save(reservation);\n }\n catch (RuntimeException e){\n throw new DayReservedException();\n }\n return reservation;\n }", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "private void saveBleed() {\n\n\n String bleedLocation = SpinnerBleedLocation.getSelectedItem().toString();\n int rating = seekBarRating.getProgress();\n String bleedSide = SpinnerBleedSide.getSelectedItem().toString();\n String bleedSeverity = SpinnerBleedSeverity.getSelectedItem().toString();\n String bleedCause = SpinnerBleedCause.getSelectedItem().toString();\n String bleedDate = textViewDate.getText().toString();\n\n if (!TextUtils.isEmpty(bleedLocation) && !TextUtils.isEmpty(bleedDate)) {\n String id = databaseBleeds.push().getKey();\n\n Bleed bleed = new Bleed(id, bleedLocation, rating, bleedSide, bleedSeverity, bleedCause, bleedDate);\n databaseBleeds.child(id).setValue(bleed);\n\n bleedIntentID = bleed.getBleedIDID();\n\n\n txtAddTreat.setVisibility(View.VISIBLE);\n buttonAddTreatment.setVisibility(View.VISIBLE);\n listviewTreatment.setVisibility(View.VISIBLE);\n //btnSaveImage.setVisibility(View.VISIBLE);\n btnChooseImage.setVisibility(View.VISIBLE);\n imgBleed.setVisibility(View.VISIBLE);\n\n Toast.makeText(this, \"Bleed Saved Successfully\", Toast.LENGTH_LONG).show();\n\n\n } else {\n Toast.makeText(this, \"Bleed Date should not be empty\", Toast.LENGTH_LONG).show();\n }\n }" ]
[ "0.8098624", "0.77744097", "0.77259105", "0.703299", "0.69827133", "0.6968214", "0.6942863", "0.67035216", "0.6660275", "0.6629187", "0.66025966", "0.65760034", "0.6574854", "0.6520561", "0.648061", "0.6463604", "0.645558", "0.644531", "0.64198303", "0.6372323", "0.6369223", "0.63625664", "0.6313034", "0.63034844", "0.62890226", "0.62845266", "0.6268953", "0.6242671", "0.62310266", "0.62301207", "0.6213092", "0.6209022", "0.62045544", "0.6197345", "0.6192256", "0.61873055", "0.61867213", "0.61814475", "0.61794305", "0.6172062", "0.6165373", "0.61312747", "0.61107445", "0.6105733", "0.61039674", "0.6099743", "0.60985434", "0.6097684", "0.60913616", "0.6066764", "0.6066144", "0.6056691", "0.6056585", "0.60397863", "0.6031889", "0.60253537", "0.60180795", "0.6006211", "0.59679437", "0.5957069", "0.59494585", "0.59492797", "0.5933485", "0.59330857", "0.5932907", "0.5931648", "0.59139705", "0.5909198", "0.59038436", "0.5902556", "0.58976734", "0.5893761", "0.5883765", "0.5878755", "0.5876406", "0.58755046", "0.5872864", "0.5854259", "0.585378", "0.58498377", "0.58496356", "0.5847677", "0.5845106", "0.5845106", "0.5845106", "0.5845106", "0.58372635", "0.58367467", "0.5831596", "0.582974", "0.58263445", "0.5819838", "0.5818487", "0.5816617", "0.5812571", "0.58093166", "0.580624", "0.58044636", "0.58033484", "0.5793552" ]
0.8231274
0
to delete pet details
public String deleterPetDetails(int petId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deletePet() {\r\n // Only perform the delete if this is an existing pet.\r\n// if (mCurrentPetUri != null) {\r\n// // Call the ContentResolver to delete the pet at the given content URI.\r\n// // Pass in null for the selection and selection args because the mCurrentPetUri\r\n// // content URI already identifies the pet that we want.\r\n// int rowsDeleted = getContentResolver().delete(mCurrentPetUri, null, null);\r\n// // Show a toast message depending on whether or not the delete was successful.\r\n// if (rowsDeleted == 0) {\r\n// // If no rows were deleted, then there was an error with the delete.\r\n// Toast.makeText(this, getString(R.string.editor_delete_pet_failed),\r\n// Toast.LENGTH_SHORT).show();\r\n// } else {\r\n// // Otherwise, the delete was successful and we can display a toast.\r\n// Toast.makeText(this, getString(R.string.editor_delete_pet_successful),\r\n// Toast.LENGTH_SHORT).show();\r\n// }\r\n// }\r\n\r\n }", "private void deletePet() {\n if (mCurrentPetUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentPetUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentPetUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_pet_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_pet_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "private void deletePet(){\n if(mCurrentPetUri != null){\n int rowsDeleted = getContentResolver().delete(mCurrentPetUri,null,null);\n if(rowsDeleted == 0){\n Toast.makeText(this, \"Error with deleting pet\", Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(this, \"Pet deleted\", Toast.LENGTH_SHORT).show();\n }\n }\n finish();\n }", "int deleteByExample(PetExample example);", "int deleteByPrimaryKey(Integer petid);", "@DeleteMapping(\"/pets/{id}\")\n public ResponseEntity<Void> deletePet(@PathVariable Long id) {\n log.debug(\"REST request to delete Pet : {}\", id);\n petService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "private void deleteEmployee() {\n // Only perform the delete if this is an existing pet.\n if (mCurrentPetUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentPetUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentPetUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_pet_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_pet_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "@Test\n void deletePet_API_TEST() throws Exception {\n mvc.perform(delete(\"/owners/1/pets/2\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk());\n verify(petService, times(1)).deletePet(2, 1);\n }", "@Override\r\n\tpublic void delete(Plate entity) {\n\t\t\r\n\t}", "void deletePokemon(Long pokemonId);", "@Override\r\n\tpublic void delete(Person p) \r\n\t{\n\t\t\r\n\t}", "public void onClick(DialogInterface dialog, int id) {\n deletePet();\n }", "@Override\n\tpublic void delete(Recipe entity) {\n\t\t\n\t}", "@Test\n void delete() {\n petTypeSDJpaService.delete(petType);\n\n //Then\n verify(petTypeRepository).delete(petType);\n }", "private void deleteFun() throws IOException {\n String jsonObject = \"{\\\"age\\\":10,\\\"dateOfBirth\\\":1471455886564,\\\"fullName\\\":\\\"Johan Doe\\\"}\";\n IndexRequest indexRequest = new IndexRequest(\"people\");\n indexRequest.source(jsonObject, XContentType.JSON);\n\n IndexResponse response = client.index(indexRequest, RequestOptions.DEFAULT);\n String id = response.getId();\n\t System.out.println(\"id = \" + id);\n\n GetRequest getRequest = new GetRequest(\"people\");\n getRequest.id(id);\n\n GetResponse getResponse = client.get(getRequest, RequestOptions.DEFAULT);\n System.out.println(getResponse.getSourceAsString());\n\n DeleteRequest deleteRequest = new DeleteRequest(\"people\");\n deleteRequest.id(id);\n\n DeleteResponse deleteResponse = client.delete(deleteRequest, RequestOptions.DEFAULT);\n\t System.out.println(\"deleteResponse = \" + deleteResponse.toString());\n }", "@Override\n\tpublic void delete(Integer deptno) {\n\t\t\n\t}", "@Override\n\tpublic void delete(CorsoDiLaurea corso) {\n\t\t\n\t}", "private void deleteAllPets() {\n// int rowsDeleted = getContentResolver().delete(ArtistsContracts.GenderEntry.CONTENT_URI, null, null);\n// Log.v(\"CatalogActivity\", rowsDeleted + \" rows deleted from pet database\");\n }", "@Transactional\n\tpublic boolean deletePet(long id, String userName) {\n\t\tPet pet = petRepository.findPetById(id);\n\t\tUser user = userRepository.findUserByUserName(userName);\n\t\tif (user == null) {\n\t\t\tthrow new PetException(\"Cannot delete: User does not exist.\");\n\t\t} else if (pet == null) {\n\t\t\tthrow new PetException(\"Cannot delete: Pet does not exist.\");\n\t\t} else if (user.getPets() == null || !(user.getPets().contains(pet))) {\n\t\t\tthrow new PetException(\"Cannot delete: The requester is not the owner of the pet.\");\n\t\t} else {\n\t\t\tAdvertisement petAd = pet.getAdvertisement();\n\t\t\tif (petAd != null) {\n\t\t\t\tadvertisementService.deleteAdvertisement(advertisementService.convertToDTO(petAd));\n\t\t\t}\n\t\t\tSet<Pet> userPet = user.getPets();\n\t\t\tuserPet.remove(pet);\n\t\t\tuser.setPets(userPet);\n\t\t\tuserRepository.save(user);\n\t\t\tpetRepository.delete(pet);\n\n\t\t\treturn true;\n\t\t}\n\t}", "void delete(Entity entity);", "@Test\n void deleteById() {\n petTypeSDJpaService.deleteById(petType.getId());\n\n //Then\n verify(petTypeRepository).deleteById(petType.getId());\n }", "@Override\r\n\tpublic void delete(Plant plant) throws Exception {\n\r\n\t}", "public void delete(NominaPuestoPk pk) throws NominaPuestoDaoException;", "void deletePatient(Patient target);", "@Delete\n Single<Integer> delete(Collection<Plant> plant);", "@DeleteMapping(\"/delete_person/{id}\")\n public void delete(@PathVariable(\"id\") int id ){\n persons.remove(id);\n }", "void delete(T entity);", "void delete(T entity);", "@Override\r\n\tpublic void delete(Person person) {\n\r\n\t}", "void deleteRecipe(RecipeObject recipe);", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "@Test\r\n public void testDelete() throws Exception {\r\n bank.removePerson(p2);\r\n assertEquals(bank.viewAllPersons().size(), 1);\r\n assertEquals(bank.viewAllAccounts().size(), 1);\r\n }", "@Override\r\n\tpublic boolean delete(Pilote obj) {\r\n\t\tboolean succes=true;\r\n\t\tString req = \"delete from \" + TABLE + \" where numPil= ?\" + \";\";\r\n\t\tPreparedStatement pst;\r\n\t\ttry {\r\n\t\t\tpst = Connexion.getInstance().prepareStatement(req);\r\n\t\t\tpst.setInt(1, obj.getNumPil());\r\n\t\t\tpst.executeUpdate();\r\n\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsucces=false;\r\n\t\t\tSystem.out.println(\"Echec de la tentative delete pilote : \" + e.getMessage()) ;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn succes;\r\n\t}", "@Override\n\tpublic void deletePerson(Person p) {\n\n\t}", "int deleteByExample(PrefecturesMtExample example);", "@Override\n\tpublic void delete(MedioPago entidad) {\n\t\t\n\t}", "void delete(int entityId);", "public void delete(PostDTO p) {\n refreshState();\n ctrl.deletePost(p.getId());\n refreshState();\n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"pop.ion@gmail.com\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "@DeleteMapping(\"/produtos/{id}\")\n @Timed\n public ResponseEntity<Void> deleteProduto(@PathVariable Long id) {\n log.debug(\"REST request to delete Produto : {}\", id);\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (PrivilegioService.podeDeletar(cargoRepository, ENTITY_NAME)) {\n produtoRepository.delete(id);\n } else {\n log.error(\"TENTATIVA DE EXCUIR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME + \" : {}\", id);\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"privilegios insuficientes.\", \"Este usuario não possui privilegios sufuentes para deletar esta entidade.\")).body(null);\n }\n//////////////////////////////////REQUER PRIVILEGIOS\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "@Test\n\tvoid testDeletePlant() {\n\t\tList<Plant> plant = service.deletePlant(50);\n\t\tassertFalse(plant.isEmpty());\n\t}", "private void delete() {\n\n\t}", "void delete(E entity);", "void delete(E entity);", "public void delete(Personne pers) {\n\t\ttry{\n\t\t\tString req = \"DELETE FROM PERSONNE WHERE id = ?\";\n\t\t\tPreparedStatement ps = connect.prepareStatement(req);\n\t\t\tps.setInt(1, pers.getId());\n\t\t\tps.executeUpdate();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void delete(Object entity);", "void delete(String id) throws PSDataServiceException, PSNotFoundException;", "@Override\n\tpublic void delete(BatimentoCardiaco t) {\n\t\t\n\t}", "public void delete(ControlAcceso entity) {\n\n\t}", "public void delete(RutaPk pk) throws RutaDaoException;", "@Delete(\"DELETE from patients WHERE id_patient=#{patientId}\")\n void deletePatient(int patientId);", "@Override\r\n public void delete(Vehicle vehicle) {\n }", "@Delete\n Single<Integer> delete(Plant... plant);", "public void deleteParticipacao(Integer id) {\n participacaoRepository.deleteById(id);\n //listClient();\n \n}", "@GetMapping(\"/delete\")\n public RedirectView delete(Long id, Principal p) {\n if(applicationUserRepository.findByUsername(p.getName()).getAdmin()) {\n for (LineItem item : lineItemRepository.findAll()) {\n if (item.getProduct().getId() == id) {\n lineItemRepository.deleteById(item.getId());\n }\n }\n productRepository.deleteById(id);\n }\n return new RedirectView(\"/products\");\n }", "void deletePerson(ReadOnlyPerson target) throws UniquePersonList.PersonNotFoundException;", "void deleteRecipe(Recipe recipe) throws ServiceFailureException;", "void deleteVehicle(String vehicleID);", "public void deletePerson() {\n\t\tSystem.out.println(\"*****Delete the record*****\");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\"Enter phone number for deletion : \");\n\t\tlong PhoneDelete = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == PhoneDelete) {\n\t\t\t\tdetails[i] = null;\n\t\t\t\tSystem.out.println(\"Record deleted successfully\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic String deleteDeal() {\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine headLine = headLineService.load(iId);\r\n\t\t\tString filePath = ServletActionContext.getServletContext().getRealPath(\"/\");\r\n\t\t\tnew File(filePath+headLine.getLineImg()).delete();\r\n\t\t\tLong result=headLineService.delete(iId);\r\n\t\t\tif(result>0) {\r\n\t\t\t\treturn \"go_ok\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn \"go_ok\";\r\n\t}", "void deleteCatFood(Long catId, Long foodId);", "@Override\n\tpublic Patient delete(Patient patient) {\n\t\t// setting logger info\n\t\tlogger.info(\"delete the patient details \");\n\t\tpatientRepo.delete(patient);\n\t\treturn patient;\n\t}", "@Override\n\tpublic void delete(Audit entity) {\n\t\t\n\t}", "@Override\r\n\tpublic void delete(PartyType entity) {\n\t\t\r\n\t}", "public void delete() {\n\n\t}", "@Override\n\tpublic Result delete(CurriculumVitae entity) {\n\t\treturn null;\n\t}", "int deleteByExample(EnterprisePictureExample example);", "@Override\n\tpublic void delete(ExperTypeVO expertypeVO) {\n\n\t}", "public static void scriptDelete() {\n List<BeverageEntity> beverages = (List<BeverageEntity>) adminFacade.getAllBeverages();\n for (int i = 0; i < beverages.size(); i++) {\n System.out.println(\"delete : \" + beverages.get(i));\n adminFacade.removeBeverage(beverages.get(i));\n }\n List<DecorationEntity> decos = (List<DecorationEntity>) adminFacade.getAllDecorations();\n for (int i = 0; i < decos.size(); i++) {\n System.out.println(\"delete : \" + decos.get(i));\n adminFacade.removeDecoration(decos.get(i));\n }\n\n /* Check that there isn't any other cocktails, and delete remaining */\n List<CocktailEntity> cocktails = (List<CocktailEntity>) adminFacade.getAllCocktails();\n if (cocktails.size() > 0) {\n System.err.println(\"Les cocktails n'ont pas été tous supprimés... \"\n + cocktails.size() + \" cocktails restants :\");\n }\n for (int i = 0; i < cocktails.size(); i++) {\n CocktailEntity cocktail = adminFacade.getCocktailFull(cocktails.get(i));\n System.err.println(cocktail.getName() + \" : \"\n + cocktail.getDeliverables());\n adminFacade.removeCocktail(cocktail);\n }\n\n /* Remove client accounts */\n List<ClientAccountEntity> clients = (List<ClientAccountEntity>) adminFacade.getAllClients();\n for (int i = 0; i < clients.size(); i++) {\n adminFacade.removeClient(clients.get(i));\n }\n\n /* Remove addresses */\n List<AddressEntity> addresses = (List<AddressEntity>) adminFacade.getAllAddresses();\n for (int i = 0; i < addresses.size(); i++) {\n adminFacade.removeAddress(addresses.get(i));\n }\n\n /* TODO :\n * * Remove orders\n */\n }", "int deleteByExample(TVmManufacturerExample example);", "public void delete(Contract entity) {\n\r\n\t}", "public boolean deletePalvelupisteet();", "int deleteByExample(PmPostExample example);", "public void delete(int id) \n{ \n\ttvShowRepo.deleteById(id); \n}", "@Override\n\tpublic void delete(T entity) {\n\t}", "@Override\n\tpublic void delete(Field entity) {\n\t\t\n\t}", "@Test\n public void delete() {\n System.out.println(\"\\n--- delete Singer by id=2 ---\");\n\n restTemplate.delete(\"http://localhost:9082/restful-ws/singer/{id}\", 2);\n\n printAllSingers();\n }", "@Delete\n void deleteEggDaily(EggDaily eggDaily);", "public void delete(){\r\n\r\n }", "@Override\n public void delete(SideDishEntity entity) {\n\n }", "void deletePersonById( final Long id );", "@DELETE\n public void delete() {\n try {\n dao.delete(dao.retrieveById(id));\n } catch (EntityInUse eiu) {\n throw new WebApplicationException(WSUtils.buildError(400, EntityInUse.ERROR_MESSAGE));\n }\n }", "@Override\r\npublic int delete(int id) {\n\treturn detalle_pedidoDao.delete(id);\r\n}", "public void delete(RelacionConceptoEmbalajePk pk) throws RelacionConceptoEmbalajeDaoException;", "@Override\n\tpublic PersonelContract Delete(PersonelContract entity) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void delete(Pedido arg0) {\n\n\t}", "int deleteByExample(UserPonumberGoodsExample example);", "private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}", "@DeleteMapping(\"/delete_person\")\n public void delete_user (@RequestParam(\"id\") int id){\n persons.remove(id);\n }", "@Override\n\tpublic void delete(Pessoa arg0) {\n\t\t\n\t}", "public void deleteEntity(AnnexDetail entity) throws Exception {\n\t\t\n\t}", "public void deleteByVaiTroID(long vaiTroId);", "@Override\n\tpublic void delete(Unidade obj) {\n\n\t}", "@Override\r\n public void deleteEntity(String entityName) {\n\r\n }", "int deleteByExample(DeptExample example);", "public void deleteDetalleNominaEmpleado(DetalleNominaEmpleado entity)\n throws Exception;", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "@Override\n\tpublic void deleteCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}", "int deleteByExample(DashboardGoodsExample example);", "public void delete(TipoPk pk) throws TipoDaoException;" ]
[ "0.82250094", "0.81124717", "0.7776931", "0.73641485", "0.73320687", "0.7314019", "0.71241575", "0.69250226", "0.6864955", "0.67868304", "0.67460144", "0.6669034", "0.66620296", "0.6643695", "0.6643664", "0.66055274", "0.6580981", "0.6579643", "0.6574342", "0.65156555", "0.65130913", "0.64815396", "0.64785016", "0.6450651", "0.6448749", "0.6432829", "0.6431449", "0.6431449", "0.64295554", "0.64003074", "0.6398867", "0.6383322", "0.6370373", "0.6367295", "0.6349383", "0.6343106", "0.6339567", "0.6329409", "0.63237387", "0.63146794", "0.6301857", "0.62808704", "0.62589675", "0.62589675", "0.62533104", "0.625162", "0.62462986", "0.6243749", "0.6230398", "0.6216455", "0.62150955", "0.62144405", "0.62001884", "0.6198981", "0.61971855", "0.6192433", "0.6189651", "0.61885226", "0.618793", "0.618762", "0.6187217", "0.6183304", "0.61801374", "0.61799496", "0.6178136", "0.61732215", "0.61669844", "0.61653644", "0.61648697", "0.61544824", "0.61497664", "0.61468405", "0.61445457", "0.6138281", "0.6137046", "0.61306286", "0.6129344", "0.6124682", "0.612467", "0.6122474", "0.611911", "0.6116355", "0.6114858", "0.6109585", "0.61095834", "0.6101898", "0.6099471", "0.60967016", "0.60931957", "0.60870343", "0.6082597", "0.60767853", "0.6075844", "0.6066767", "0.6064283", "0.6061499", "0.60614246", "0.6057264", "0.6054899", "0.6051452" ]
0.82834345
0
region Fragment lifecycle events
@Nullable @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { if( mMainView == null ) { mMainView = inflater.inflate( R.layout.fragment_locationmenu, container ); } return mMainView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void onFragmentCreate(Bundle savedInstanceState) {\n\t}", "@Override\r\n\tpublic void onFragmentStart() {\n\t}", "@Override\r\n\tpublic void onFragmentStop() {\n\t}", "@Override\n public void onFragmentAttached() {\n }", "public interface FragmentLifecycle {\n\n void onPauseFragment();\n void onResumeFragment();\n}", "public interface OnViewFragmentListener {\r\n public void onViewCreated();\r\n}", "@Override\n public void onDestroy() {\n super.onDestroy();\n Log.i(sFragmentName, \"onDestroy()\");\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n if (mHasLoad) {\n return;\n }\n initFragment();\n }", "@Override\r\n\tpublic void onFragmentPaused() {\n\t}", "@Override\n public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment f) {\n }", "@Override\r\n\tpublic void onFragmentResume() {\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tLog.d(\"Fragment02\",\"onDestroy\");\n\t}", "Long onFragmentInteraction();", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n Log.i(sFragmentName, \"onActivityCreated()\");\n }", "void onFragmentInteraction();", "void onFragmentInteraction();", "void onFragmentInteraction();", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\t\n\t\tILog.v(\"MyFragment onActivityCreated\");\n\t}", "@Override\n public void onDestroyView() {\n super.onDestroyView();\n Log.i(sFragmentName, \"onDestroyView()\");\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n //this registers this fragment to recieve any EventBus\n EventBus.getDefault().register(this);\n }", "@Override\n public void refreshFragment() {\n }", "private void initFragments() {\n\t\tZhiBoFragment zhiBoFragment = ZhiBoFragment.newInstance(null);\n\t\tzhiBoFragment.setSquareFragmentListener(this);\n\t\tLiaotianFragment liaotianFragment = LiaotianFragment.newInstance(null);\n\t\tliaotianFragment.setSquareFragmentListener(this);\n\t\tfragments.add(zhiBoFragment);\n\t\tfragments.add(liaotianFragment);\n\t\t\n\t\t\n\t}", "@Override\n protected void onResumeFragments() {\n\n Logger.INSTANCE.LogV(\"LifeCycle\", \"Main.onResumeFragments\");\n\n super.onResumeFragments();\n mOnResumeFragmentsCalled = true;\n\n if (mHandleOpenDocError) {\n handleOpenDocError();\n mHandleOpenDocError = false;\n } else if (mHandleLastTabClosed) {\n handleLastTabClosed();\n mHandleLastTabClosed = false;\n } else if (mTabbedHostBundle != null) {\n startTabHostFragment(mTabbedHostBundle);\n mTabbedHostBundle = null;\n } else if (mNavigationDrawerView != null && mNavigationDrawerView.getMenu() != null) {\n MenuItem menuItem = null;\n if (isFirstTimeRun()) {\n mIsFirstTimeRunConsumed = false; // consumed\n menuItem = mNavigationDrawerView.getMenu().findItem(R.id.item_file_list);\n } else if (mProcessedFragmentViewId != MENU_ITEM_NONE) {\n menuItem = mNavigationDrawerView.getMenu().findItem(mProcessedFragmentViewId);\n }\n if (menuItem != null) {\n selectNavigationItem(menuItem);\n }\n }\n\n if (mReturnFromSettings) {\n mReturnFromSettings = false;\n if (mProcessedFragmentViewId == R.id.item_viewer) {\n if (PdfViewCtrlTabsManager.getInstance().getLatestViewedTabTag(this) != null) {\n startTabHostFragment(null);\n }\n }\n }\n }", "void onFragmentInteraction(Object ref);", "@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 }", "void onFragmentInteractionMain();", "public interface FragMainLife\n{\n\tpublic void onResumeFragMainLife();\n}", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n }", "protected void onViewCreated(@Nullable Bundle savedInstanceState) {\n }", "void onFragmentInteraction(View v);", "void onFragmentInteraction(int position);", "@Override\n public void created(Bundle savedInstance) {\n activity = getActivity();\n //final File methodTracingFile = new File(activity.getExternalFilesDir(\"Caches\"), \"AppStart.trace\");\n //Log.d(TAG, \"methodTracingPath=\" + methodTracingFile.getPath());\n //Debug.startMethodTracing(methodTracingFile.getPath());\n PlayerApp.getRefWatcher(activity).watch(this);\n attachView = this.view;\n\n mMovieFragModel = new MovieFragModel();\n initListener();\n pagerHeader = (ViewPager) getActivity().findViewById(R.id.frag_pagerHeader);\n\n homepage_recommendview_title = (TextView) getActivity().findViewById(R.id.homepage_recommendview_title);\n ci = (CircleIndicator) getActivity().findViewById(R.id.frag_ci);\n initMovieView();\n\n\n\n }", "public interface FragmentListener {\n\n public void callbackEvento(Evento evento);\n public void callbackEventoConfirmados(Evento evento);\n\n public void callbackNoticias();\n}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tLog.d(\"Fragment02\",\"onCreate\");\n\t}", "@Override\n public void onViewCreated(View view , Bundle savedInstanceState) {\n }", "@Override\n public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n }", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tfragment = this;\n\t\tcontext = getActivity();\n\t\tinitData();\n//\t\tplay();\n\t}", "@Override\n public void onDetach() {\n super.onDetach();\n Log.i(sFragmentName, \"onDetach()\");\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n // retain this fragment\n setRetainInstance(true);\n }", "@Override\n\tpublic void onDestroyView() {\n\t\tsuper.onDestroyView();\n\t\tLog.d(\"Fragment02\",\"onDestroyView\");\n\t}", "public interface OnFragmentInteractionListener {\n void onFinishCreatingRequest();\n }", "@Override\r\n public void onActivityCreated(Bundle savedInstanceState) {\n\tsuper.onActivityCreated(savedInstanceState);\r\n\tmFragmentManager = getActivity().getSupportFragmentManager();\r\n\tEventBus.getDefault().register(this);\r\n\r\n\tFilterService server = new FilterService();\r\n\tserver.doThemeFilterWork();\r\n }", "@Override\n public void onPause() {\n super.onPause();\n\n Toast.makeText(getContext(),\"on pause\",Toast.LENGTH_SHORT).show();\n Log.e(\"fragmentlifecycle\",\"on pause\");\n }", "@Override\n public void onFragmentVisible() {\n db = LegendsDatabase.getInstance(getContext());\n\n refreshCursor();\n\n if (emptyView.isShown()) {\n Crossfader.crossfadeView(emptyView, loadingView);\n }\n else {\n Crossfader.crossfadeView(listView, loadingView);\n }\n }", "@Override\n public void onPause() {\n super.onPause();\n Log.i(sFragmentName, \"onPause()\");\n }", "public void initFragments() {\n Log.d(\"initFragments\", \"initFragments: start\");\n if (!focus) {\n Log.d(\"initFragments\", \"initFragments: not focused\");\n return;\n }\n\n if (calendarFragment != null)\n getSupportFragmentManager().beginTransaction().remove(calendarFragment).commit();\n if (scheduleFragment != null)\n getSupportFragmentManager().beginTransaction().remove(scheduleFragment).commit();\n if (userHomeFragment != null)\n getSupportFragmentManager().beginTransaction().remove(userHomeFragment).commit();\n if (medicineFragment != null)\n getSupportFragmentManager().beginTransaction().remove(medicineFragment).commit();\n\n Log.d(\"initFragments\", \"initFragments: new\");\n calendarFragment = new CalendarFragment();\n scheduleFragment = new CheckupFragment();\n userHomeFragment = new UserHomeFragment();\n medicineFragment = new MedicationFragment();\n\n fragmentTransaction = getSupportFragmentManager().beginTransaction();\n Log.d(\"initFragments\", \"initFragments: begin transaction\");\n fragmentTransaction.add(R.id.navigationFrame, calendarFragment);\n fragmentTransaction.hide(calendarFragment);\n fragmentTransaction.add(R.id.navigationFrame, scheduleFragment);\n fragmentTransaction.hide(scheduleFragment);\n fragmentTransaction.add(R.id.navigationFrame, userHomeFragment);\n fragmentTransaction.hide(userHomeFragment);\n fragmentTransaction.add(R.id.navigationFrame, medicineFragment);\n fragmentTransaction.hide(medicineFragment);\n fragmentTransaction.commit();\n\n if (lastFragment == null) {\n Log.d(\"initFragments\", \"initFragments: null last fragment\");\n lastFragment = \"calendarFragment\";\n setFragment(calendarFragment);\n }\n else {\n Log.d(\"initFragments\", \"initFragments: set last fragment\");\n setLastFragment();\n }\n }", "@Override\n public void run() {\n onFragmentListener.onFragmentListener(mRootView);\n }", "public interface ChangeFragmentListener {\n void changeFragment();\n}", "@Override\n\tpublic void onDetach() {\n\t\tsuper.onDetach();\n\t\tLog.d(\"Fragment02\",\"onDetach\");\n\t}", "private void onClick_recargar(){\n this.onDestroy();\n ((principal)getActivity()).loadLastFragment();\n }", "public interface OnFragmentInteractionListener {\n\t\tvoid restUp(IGameState gameState);\n\t\tvoid restartGame();\n\t}", "void onFragmentInteraction(int cursorID);", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n if(savedInstanceState != null) {\n mStepArrayList = savedInstanceState.getParcelableArrayList(STEP_LIST_KEY);\n mListIndex = savedInstanceState.getInt(LIST_INDEX_KEY);\n playWhenReady = savedInstanceState.getBoolean(PLAY_WHEN_READY_KEY);\n if(!(mStepArrayList.get(mListIndex).mVideoUrl.equals(\"\"))) {\n videoPosition = savedInstanceState.getLong(VIDEO_POSITION_KEY);\n }\n }\n\n // Inflate the layout for this fragment\n View rootView = inflater.inflate(R.layout.fragment_step_description, container, false);\n\n ButterKnife.bind(this,rootView);\n\n if(mStepArrayList != null){\n if(mStepArrayList.get(mListIndex).mVideoUrl.equals(\"\")){\n //step does not contain video\n mVideoView.setVisibility(View.GONE);\n if (!(mStepArrayList.get(mListIndex).mThumbnailUrl.equals(\"\"))) {\n //step contains thumbnail image\n mStepThumbnailImageView.setVisibility(View.VISIBLE);\n showImage(mStepArrayList.get(mListIndex).mThumbnailUrl);\n }\n } else {\n //step contains video\n mStepThumbnailImageView.setVisibility(View.GONE);\n initializeExoPlayer(Uri.parse(mStepArrayList.get(mListIndex).mVideoUrl));\n }\n\n mDescriptionTextView.setText(mStepArrayList.get(mListIndex).mDescription);\n\n\n if(DetailsActivity.IS_TABLET) {\n mFabPrev.setVisibility(View.GONE);\n mFabNext.setVisibility(View.GONE);\n } else {\n //goes to next step\n mFabNext.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n if (mListIndex == (mStepArrayList.size() - 1)) {\n if(mToast != null){\n mToast.cancel();\n }\n mToast = Toast.makeText(getActivity(),\n \"This is Last Step\", Toast.LENGTH_SHORT);\n mToast.show();\n\n } else {\n mListIndex++;\n }\n mListener.onFragmentInteraction(mListIndex);\n }\n });\n\n //goes to previous step\n mFabPrev.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (mListIndex == 0) {\n if(mToast != null){\n mToast.cancel();\n }\n mToast = Toast.makeText(getActivity(),\n \"This is First Step\", Toast.LENGTH_SHORT);\n mToast.show();\n\n } else {\n mListIndex--;\n }\n mListener.onFragmentInteraction(mListIndex);\n }\n });\n }\n }\n\n return rootView;\n }", "@Override\n\tpublic void onDestroy() {\n\t\tinstance=null;\n\t\tsuper.onDestroy();\n\t\tLog.v(\"huahua\", \"fragment1-->onDestroy()\");\n\t}", "private void wireUpFragments(Bundle savedInstanceState) { savedInstanceState is non-null when there is fragment state\n // saved from previous configurations of this activity\n // (e.g. when rotating the screen from portrait to landscape).\n // In this case, the fragment will automatically be re-added\n // to its container so we don't need to manually add it.\n // For more information, see the Fragments API guide at:\n //\n // http://developer.android.com/guide/components/fragments.html\n //\n if (savedInstanceState == null) {\n }\n }", "private void initFragmentAutoInjection() {\n BucketApplication app;\n app = (BucketApplication) getApplication();\n\n getSupportFragmentManager().registerFragmentLifecycleCallbacks(new FragmentLifecycleCallbacks() {\n @Override\n public void onFragmentAttached(FragmentManager fm, Fragment f, Context context) {\n super.onFragmentAttached(fm, f, context);\n if(f instanceof ListingFragment) {\n app.getAppComponentInjector().inject((ListingFragment) f);\n } else if (f instanceof ListingPreferencesFragment) {\n app.getAppComponentInjector().inject((ListingPreferencesFragment) f);\n }\n }\n }, false);\n }", "public interface OnFragmentCompleteListener {\n /**\n * This method is used as a callback when an AddTaskTabFragment is opened, in order to\n * pass data back to the calling Activity.\n * @param name The name of the task\n * @param notes The notes of the task\n * @param position The task to be removed from previous task list\n */\n void onNewTaskComplete(String name, String notes, int position);\n\n /**\n * This method is used as a callback when an EditTaskFragment is opened, in order to\n * pass data back to the calling Activity.\n * @param name The updated name of the task\n * @param notes The updated notes of the task\n * @param position The position of the task to be modified.\n */\n void onEditTaskComplete(String name, String notes, int position);\n}", "@Override\n public void onStop() {\n super.onStop();\n Log.i(sFragmentName, \"onStop()\");\n }", "public interface FragmentCallback {\n void addFragment(int container, Class fragment, Bundle params);\n}", "public interface FragmentTransactionListener {\n void setFragmentTitle(String title);\n}", "protected abstract FragmentComponent setupComponent();", "void onFragmentInteraction(String id);", "public void onFragment( Framedata fragment ) {\n\t\tlog.info( \"received fragment: \" + new String( fragment.getPayloadData().array() ) );\n\t}", "@Override\r\n\tpublic void initListener(Bundle savedInstanceState) {\n\r\n\t}", "@Override\r\n\t public void onDestroy() {\r\n\t super.onDestroy();\r\n\t getActivity().finish();\r\n\t }", "@Override\n public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n fragmentView = inflater.inflate(R.layout.fragment_event_friend_list, container, false);\n\n linlaHeaderProgress = (LinearLayout) fragmentView.findViewById(R.id.linlaHeaderProgress);\n\n eventFriendListRelativeLayout = (RelativeLayout) fragmentView.findViewById(R.id.eventFriendListRelativeLayout);\n eventFriendListRelativeLayout.setVisibility(View.GONE);\n\n try {\n checkAndHandleNotification();\n } catch (FaroObjectNotFoundException e) {\n // Event has been deleted.\n Toast.makeText(getActivity(), \"Event has been deleted\", LENGTH_LONG).show();\n Log.e(TAG, MessageFormat.format(\"Event {0} has been deleted\", eventId));\n getActivity().finish();\n }\n\n return fragmentView;\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tSystem.out.println(\"MyCollectShopFragment--create\");\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "private void fragmentsInit(boolean mIsInTwoPanesMode, Bundle savedInstanceBundle) {\n\t\t\n Log.i(TAG, \"DailySelfieMainActivity.fragmentsInit entered\");\n\n\t\tif (mIsInTwoPanesMode) { \n\n // In two-pane mode, list items should be given the\n // 'activated' state when touched.\n ((SelfieListFragment) getFragmentManager()\n .findFragmentById(R.id.selfie_list))\n .setActivateOnItemClick(true);\n \n } else {\n \t\n \t// Check if there is no saved instance before create a new list. If the state is \n \t// saved, the fragment is automatically re-created\n \tif (savedInstanceBundle == null) {\n \t\t\n\t\t\t\t// Create selfie list fragment\n\t\t\t\tmSelfieListFragment = new SelfieListFragment();\n\t\t\t\t// In single pane mode add the selfies' list Fragment to the container\n\t\t\t\tgetFragmentManager()\n\t\t\t\t\t\t.beginTransaction()\n\t\t\t\t\t\t.add(R.id.selfie_fragment_container,\n\t\t\t\t\t\t\t\tmSelfieListFragment).commit();\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Restore Action Bar View Options\n\t\t\t\tgetActionBar().setDisplayOptions(savedInstanceBundle.getInt(ACTIONBAR_DISPLAY_OPTIONS));\n\t\t\t}\n \t\n }\n\t}", "public void createFragment() {\n\n }", "@Override\n\tpublic void onViewCreated(View view, Bundle savedInstanceState) {\n\t\tsuper.onViewCreated(view, savedInstanceState);\n\t}", "@Override\n\tpublic void onViewCreated(View view, Bundle savedInstanceState) {\n\t\tsuper.onViewCreated(view, savedInstanceState);\n\t}", "void onFragmentInteraction(int spotId);", "public interface IFragment {\n void onFragmentRefresh();\n\n void onMenuClick();\n}", "public interface FragmentModellnt {\n void FragmentM(OnFinishListener onFinishListener,String dataId);\n}", "public abstract void updateFragmentUI();", "@Override\n public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {\n }", "@Override\n public void onStop() {\n super.onStop();\n //this unregister this fragment to stop any EventBus messages\n EventBus.getDefault().unregister(this);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n LayoutInflater inflater = getActivity().getLayoutInflater();\n if (mainView == null) {\n mainView = inflater.inflate(R.layout.fragment_mywarrelease, null);\n mContext = inflater.getContext();\n initView();\n }\n }", "@Override\r\n\tpublic void onViewCreated(View view, Bundle savedInstanceState) {\n\t\tsuper.onViewCreated(view, savedInstanceState);\r\n\r\n\t\tviewPager = (ViewPager) view.findViewById(R.id.viewpager);\r\n\t\tviewPager.setOnPageChangeListener(new OnPageChangeListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageSelected(int arg0) {\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrollStateChanged(int arg0) {\r\n\r\n\t\t\t}\r\n\t\t});\r\n//\t\tdoStart();\r\n\t\tif (getActivity() instanceof MainActivity) {\r\n\t\t\t((MainActivity) getActivity()).getSlidingMenu().addIgnoredView(\r\n\t\t\t\t\tviewPager);\r\n\t\t}\r\n\t}", "@Override\n\tprotected void onCreate(Bundle arg0) {\n\t\t if (arg0 != null) {\n\t\t\t arg0.putParcelable(\"android:support:fragments\",null);\n\t }\n\t\t super.onCreate(arg0);\n\t\t requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t setLayout();\n\t\t // 注入控件\n\t ViewUtils.inject(this);\n\t\t init(arg0);\n\t}", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n }", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n }", "@Override\r\n\tpublic void onPageSelected(int newPosition) {\n\t\tLog.e(TAG, \"onpageselected=\" + newPosition);\r\n\t\tFragmentLifeCycle fragmentToShow = (FragmentLifeCycle) mAdapter\r\n\t\t\t\t.getItem(newPosition);\r\n\t\tfragmentToShow.onResumeFragment();\r\n\r\n\t\tFragmentLifeCycle fragmentToHide = (FragmentLifeCycle) mAdapter\r\n\t\t\t\t.getItem(currentPosition);\r\n\t\tfragmentToHide.onPauseFragment();\r\n\r\n\t\tcurrentPosition = newPosition;\r\n\t}", "public void onUPP()\r\n {\r\n Fragment frag = getSupportFragmentManager().findFragmentById(R.id.fragmentSad);\r\n// //android.app.FragmentManager fm = getFragmentManager();\r\n// FragmentTransaction ft = getFragmentManager().beginTransaction();\r\n// ft.remove(frag);\r\n// ft.commit();\r\n//}\r\n\r\n FragmentManager fm = getSupportFragmentManager();\r\n fm.beginTransaction()\r\n .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)\r\n .show(frag)\r\n .commit();\r\n\r\n }", "@Override\n // The onCreateView is where you will create the fragment and all the listeners in the fragment\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n View view = inflater.inflate(R.layout.fragment_tutorial, container, false); //create the view of the fragment\n // the next lines are finding the elements that are inside the fragment to then set the listeners and things\n ((MainActivity)getActivity()).setAddToBackStack(true);\n\n return view; // This returns the view(Fragment) with all the initializers\n }", "@Override\n protected void onSaveInstanceState(Bundle savedInstanceState) {\n //Save the state of the Fragment (true = open , false = closed)\n savedInstanceState.putBoolean(STATE_FRAGMENT ,isFragmentDisplayed);\n super.onSaveInstanceState(savedInstanceState);\n }", "public interface OnFragmentListener {\n\n void onAction(Intent intent);\n}", "private void setupFragments() {\n FragmentManager fm = getSupportFragmentManager();\n sb_frag = (StatusBar)fm.findFragmentById(R.id.statusmarket);\n\n if(sb_frag == null)\n {\n sb_frag = new StatusBar();\n fm.beginTransaction().add(R.id.statusmarket, sb_frag).commit();\n }\n sb_frag.setupInitial(currentPlayer);\n\n ai_frag = (AreaInfo) fm.findFragmentById(R.id.overviewlayout);\n\n //try find the fragment, if it doesnt exist then create it\n if (ai_frag == null) {\n //create the fragment if not exist\n ai_frag = new AreaInfo();\n fm.beginTransaction().add(R.id.overviewlayout, ai_frag).commit();\n }\n\n ai_frag.setCurrentArea(null);\n\n\n\n\n }", "private void setupFragment(Bundle savedInstanceState) {\n if (findViewById(R.id.fl_caller) != null) {\n // However, if we're being restored from a previous state,\n // then we don't need to do anything and should return or else\n // we could end up with overlapping fragments.\n if (savedInstanceState != null) {\n return;\n }\n\n getSupportFragmentManager().beginTransaction()\n .add(R.id.fl_caller, getActiveFragment())\n .commit();\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_product_list, container, false);\n Constants.mMainActivity.setToolBarName(\"Product List\");\n Constants.mMainActivity.setToolBar(VISIBLE,GONE,GONE,GONE);\n Constants.mMainActivity.setNotificationButton(GONE);\n Constants.mMainActivity.OpenProductListSetIcon();\n mSessionManager=new SessionManager(getActivity());\n Constants.mMainActivity.setToolBarPostEnquiryHide();\n\n //Check personal details and business details\n if (mSessionManager.getStringData(Constants.KEY_SELLER_USER_NAME).equals(\"\")||mSessionManager.getStringData(Constants.KEY_SELLER_COUNTRY).equals(\"\")){\n\n // UtilityMethods.showInfoToast(getActivity(),\"Please complete your profile details.\");\n\n\n /*PersonalDetailsFragment personalDetailsFragment=new PersonalDetailsFragment();\n Constants.mMainActivity.ChangeFragments(personalDetailsFragment,\"PersonalDetailsFragment\");*/\n\n Log.e(\"check==========>\",\"PersonalDetailsFragment\");\n\n }else if (mSessionManager.getStringData(Constants.KEY_SELLER_BUSINESS_NAME).equals(\"\")||mSessionManager.getStringData(Constants.KEY_SELLER_BUSINESS_COUNTY).equals(\"\")){\n\n UtilityMethods.showInfoToast(getActivity(),\"Please complete your business details first\");\n\n\n BusinessDetailsFragment businessDetailsFragment=new BusinessDetailsFragment();\n Constants.mMainActivity.ChangeFragments(businessDetailsFragment,\"BusinessDetailsFragment\");\n\n Log.e(\"check==========>\",\"BusinessDetailsFragment\");\n\n }\n\n Bundle bundle = this.getArguments();\n if (bundle != null) {\n\n try {\n Approved = bundle.getString(\"redirect_type\");\n } catch (Exception e) {\n Approved=\"default\";\n e.printStackTrace();\n\n }\n\n try {\n Rejected = bundle.getString(\"redirect_type\");\n } catch (Exception e) {\n Rejected=\"default\";\n e.printStackTrace();\n\n\n }\n\n\n }\n\n ViewPager viewPager = view.findViewById(R.id.viewpager);\n\n FragmentManager fragmentManager = getFragmentManager();\n\n try {\n\n if (Constants.mMainActivity.productListPendingFragment != null) {\n fragmentManager.beginTransaction().remove(Constants.mMainActivity.productListPendingFragment).commit();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n try {\n if (Constants.mMainActivity.productListApprovedFragment != null) {\n fragmentManager.beginTransaction().remove(Constants.mMainActivity.productListApprovedFragment).commit();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n try {\n if (Constants.mMainActivity.productListRejectedFragment != null) {\n fragmentManager.beginTransaction().remove(Constants.mMainActivity.productListRejectedFragment).commit();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n Log.e(\"BackStackEntryCount()\", \"fragmentManager.getBackStackEntryCount() \" + fragmentManager.getBackStackEntryCount());\n\n try {\n mFragmentList.clear();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n\n if (adapter != null) {\n adapter.notifyDataSetChanged();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n adapter = new ViewPagerAdapter(getFragmentManager(), mFragmentList, mFragmentTitleList);\n viewPager.setSaveFromParentEnabled(false);\n\n setupViewPager(viewPager);\n\n TabLayout tabLayout = view.findViewById(R.id.tabs);\n tabLayout.setupWithViewPager(viewPager);\n\n Log.e(\"check\",\"Fragment\"+Constants.mMainActivity.WhichFragmentIsopen);\n\n if (Approved.equalsIgnoreCase(\"Approved\")){\n\n viewPager.setCurrentItem(1);\n\n\n }else if(Rejected.equalsIgnoreCase(\"Rejected\")){\n\n viewPager.setCurrentItem(2);\n }else if(Constants.mMainActivity.WhichFragmentIsopen.equals(\"Fragment Approved\")){\n\n viewPager.setCurrentItem(1);\n }else if(Constants.mMainActivity.WhichFragmentIsopen.equals(\"Fragment Pending\")){\n\n viewPager.setCurrentItem(0);\n }else if(Constants.mMainActivity.WhichFragmentIsopen.equals(\"Fragment Rejected\")){\n\n viewPager.setCurrentItem(2);\n }else {\n\n viewPager.setCurrentItem(0);\n }\n\n return view;\n }", "public interface OnFragmentInteractionListener {\n public void onPlayerSizeChanged(PlayerSize newSize, PlayerSize oldSize);\n }", "@Override\n public void onDestroy(){\n super.onDestroy();\n\n //Previous fragment has no toolbar\n// setToolbarVisibility(false);\n }", "public void onAttach() {\n super.onAttach(getActivity());\n Log.i(sFragmentName, \"onAttach()\");\n }", "void onMainFragmentSelectListner(View view);", "@Override\n public void onFragmentInteraction(Uri uri){\n }", "@Override\n public void onFragmentInteraction(Uri uri){\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n Toast.makeText(getContext(),\"on create view\",Toast.LENGTH_SHORT).show();\n Log.e(\"fragmentlifecycle\",\"on create view \");\n return inflater.inflate(R.layout.fragment_life, container, false);\n\n }", "@Override\n public void onFragmentInteraction(Uri uri) {\n }", "@Override\n public void onFragmentInteraction(Uri uri) {\n }" ]
[ "0.7888414", "0.78174657", "0.7428721", "0.7395532", "0.736567", "0.7115196", "0.7112958", "0.71069723", "0.7088065", "0.7033926", "0.69888437", "0.69875944", "0.69210047", "0.6895135", "0.6877158", "0.6877158", "0.6877158", "0.6862779", "0.67639023", "0.67344993", "0.66857153", "0.6679758", "0.6676221", "0.6664107", "0.66595274", "0.66507614", "0.66400504", "0.66244084", "0.66082364", "0.6583742", "0.6577732", "0.65770906", "0.6563479", "0.65522987", "0.6550112", "0.6547082", "0.65430385", "0.6537762", "0.6529621", "0.6525321", "0.6514082", "0.6510509", "0.6501883", "0.6494589", "0.64811724", "0.64782053", "0.6459909", "0.64591616", "0.64291537", "0.63899374", "0.638601", "0.6385505", "0.6372612", "0.6366939", "0.6361807", "0.63457346", "0.6341886", "0.6336724", "0.6323889", "0.6312579", "0.6296491", "0.62926424", "0.628896", "0.6284661", "0.62798417", "0.62790835", "0.6277361", "0.6273004", "0.62620753", "0.6259935", "0.6254375", "0.6251445", "0.6251445", "0.62502176", "0.62489665", "0.6244835", "0.6243036", "0.62329143", "0.6223795", "0.62111247", "0.62014616", "0.61913866", "0.61883485", "0.61883485", "0.6180728", "0.61799294", "0.617724", "0.61740184", "0.61711925", "0.6169481", "0.61646104", "0.6164089", "0.61634517", "0.6162084", "0.6144249", "0.6142188", "0.6142095", "0.6142095", "0.6135809", "0.6126341", "0.6126341" ]
0.0
-1
Reset the Info view before anything else
void setLocation( final Location location, final Bitmap topImageBitmap, final Bitmap logo, final Route route ) { resetRouteInfoView(); mLocation = location; mVenueImageBitmap = topImageBitmap; final String locationName = mLocation.getName(); mTitleTextView.setText(locationName); mShowRouteButton.setText(mContext.getString(R.string.toolbar_label_directions)); String openinghours = getFieldValue("openinghours", mLocation); String phone = getFieldValue("phone", mLocation); String website = getFieldValue("website", mLocation); final String imageUrl = (String)location.getProperty( LocationPropertyNames.IMAGE_URL ); mLocationImageUrl = imageUrl; loadTopImage(imageUrl, topImageBitmap); final ArrayList<IconTextElement> elements = new ArrayList<>(); // mLastRouteDestinationLocation = mLocation; mLastRouteOriginLocation = mMapControl.getCurrentPosition(); addElement(elements, openinghours, "", R.drawable.ic_access_time_white_24dp, IconTextListAdapter.Objtype.OPENINGHOURS); addElement(elements, phone, "", R.drawable.ic_phone_white_24dp, IconTextListAdapter.Objtype.PHONE); addElement(elements, website, "", R.drawable.ic_web, IconTextListAdapter.Objtype.URL); // String[] catNames = MapsIndoorsHelper.getLocationCategoryNames( mLocation ); if( catNames.length > 0 ) { String poiType = catNames[0].trim(); String roomId = mLocation.getRoomId(); String poiInfo = !TextUtils.isEmpty( roomId ) ? (poiType + "\n" + roomId.trim()) : (poiType); addElement(elements, poiInfo, "", R.drawable.ic_info_poi_type_24dp, IconTextListAdapter.Objtype.PLACE); } // final String locationPlace = MapsIndoorsHelper.composeLocationInfoString( mActivity, mLocation, mActivity.getBuildingCollection(), mActivity.getVenueCollection() ); addElement( elements, locationPlace, "", R.drawable.ic_location_city_white_24dp, IconTextListAdapter.Objtype.PLACE ); // final String locationDescription = mLocation.getStringProperty( LocationPropertyNames.DESCRIPTION ); addElement(elements, locationDescription, "", R.drawable.ic_description_white_24px, IconTextListAdapter.Objtype.PLACE); // calculate the distance to the destination distanceEstimation(); myAdapter = new IconTextListAdapter( mContext ); myAdapter.setTint( "@color/primary" ); myAdapter.setList( elements ); mMainMenuList.setAdapter( myAdapter ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearInfo() {\n helpFocal.setText(null);\n helpLens.setText(null);\n helpObject.setText(null);\n helpImage.setText(null);\n helpPrinciple.setText(null);\n info.setText(null);\n }", "void resetView();", "private void actionResetView ()\r\n\t{\r\n\t\thelperSwitchSelectOff();\r\n\t\thelperSwitchMoveOff();\r\n\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().displayPolygonStop();\r\n\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().resetImagePosition();\r\n\t\t}\r\n\r\n\t}", "private void clearViews()\n {\n prepareNumbers();\n }", "public void resetViews() {\n\t\tmContentView.findViewById(R.id.btn_connect).setVisibility(View.VISIBLE);\n\t\tTextView view = (TextView) mContentView.findViewById(R.id.device_address);\n\t\tview.setText(R.string.empty);\n\t\tview = (TextView) mContentView.findViewById(R.id.device_info);\n\t\tview.setText(R.string.empty);\n\t\tview = (TextView) mContentView.findViewById(R.id.group_owner);\n\t\tview.setText(R.string.empty);\n\t\tview = (TextView) mContentView.findViewById(R.id.status_text);\n\t\tview.setText(R.string.empty);\n//\t\tmContentView.findViewById(R.id.btn_start_client).setVisibility(View.GONE);\n\t\tmContentView.findViewById(R.id.btn_send_data).setVisibility(View.GONE);\n\t\tthis.getView().setVisibility(View.GONE);\n\t\tserver_running = false;\n\t}", "public void updateViews() {\n updateViews(null);\n }", "public void reset() {\n resetData();\n postInvalidate();\n }", "@Override\n public void reset() {\n model.reset();\n view.resetView();\n }", "public static void reset(){\n\t\t\n\t\t// clear hashmap\n\t\tvisitorListMap.clear();\n\t\t\n\t\t// clear visitor list model\n\t\tvisitorListModel.clear();\n\t\t\n\t\t// clear server info\n\t\tlblServerInfoIP.setText(\"IP address: Not connected.\");\n\t\tlblServerInfoPort.setText(\"Port: \");\n\t\t\n\t\t// disable leave room\n\t\tlblLeave.setVisible(false);\n\t\t\n\t}", "private void reset() {\n setContentView(R.layout.activity_main);\n }", "private void clearView() {\n\t\tif (this.viewer != null) {\n\t\t\tthis.viewer.getTable().clearAll();\n\t\t}\n\t\tif (this.iException != null) {\n\t\t\tthis.iException.setText(\"\");\n\t\t}\n\t\tif (this.iBrowser != null) {\n\t\t\tthis.iBrowser.setText(iNoHtmlLog);\n\t\t}\n\t}", "public native void reset(GInfoWindow self, GLatLng point, GInfoWindowTab[] tabs, GSize size, GSize offset)/*-{\r\n\t\tself.reset(point, tabs, size, offset);\r\n\t}-*/;", "void reset() {\n setVisible(false);\n myJumpedOver = false;\n }", "public void performUpdateReset() {\n switchToPage(NavDrawerAdapter.FLUFF_ID);\n\t}", "private void resetDetailView() {\n if (lastDetailView != null) {\n ((TextView) lastDetailView).setSingleLine(true);\n }\n lastDetailView = null;\n currentDetailView = -1;\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 }", "private void reset(){\n plotValues.clear();\n xLabels.clear();\n }", "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 }", "public void reset() {\n super.reset();\n }", "public void resetIsVisible();", "private void hardReset() {\n softReset();\n // variables\n recordLap = 0; // force first query on database after race restart\n trackName = null;\n // ui\n recordLapTView.setText(\"--:--:---\");\n trackTView.setText(\"Track location\");\n carTView.setText(\"Car\");\n Log.d(TAG, \"HARD Reset: main menu\");\n }", "public native void reset(GInfoWindow self, GLatLng point, GInfoWindowTab[] tabs, GSize size)/*-{\r\n\t\tself.reset(point, tabs, size);\r\n\t}-*/;", "protected void reset() {\n\t\t}", "public void resetInfoIds()\n\t{\n\t\tthis.resetSuggestedIds();\n\t\tthis.resetFreeIds();\n\t}", "public void resetInfo() {\n\t\ttry {\n\t\t\tMp3File mp3 = new Mp3File(currSong.getUrl());\n\t\t\tlong tduration = mp3.getLengthInSeconds();\n\t\t\ttotalDuration.setText(secToMin((long) tduration));\n\t\t\tcurrentDuration.setText(\"0:00\");\n\t\t\tplayedTime = 0;\n\t\t}catch(Exception e) {}\n\t}", "protected void init() {\n\t\tview.userName.setText(\"\");\n\t\tview.password.setText(\"\");\n\n\t}", "public native void reset(GInfoWindow self, GLatLng point, GInfoWindowTab[] tabs, GSize size, GSize offset, int selectedTab)/*-{\r\n\t\tself.reset(point, tabs, size, offset, selectedTab);\r\n\t}-*/;", "public void resetText(View view) {\n display();\n }", "public void Reset(View view) {\n\n displayFoulA(0);\n displayScoreA(0);\n displayScoreB(0);\n displayFoulb(0);\n\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n nameTextView.setText(\"\");\n ingredientsTextView.setText(\"\");\n recipeTextView.setText(\"\");\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void resetAll()\n {\n _markers = null;\n setPrefSizeForText();\n repaint();\n }", "public void resetAll(View view){\n quantity = 1;\n displayQuantity(quantity);\n }", "private void initView() {\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerKapfenberg.refresh(true);\r\n\t\tviewerLeoben.refresh(true);\r\n\t\tviewerMariazell.refresh(true);\r\n\t\tviewerWien.refresh(true);\r\n\t}", "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 reset() {\n this.displayHasContent = false;\n this.obscured = false;\n this.syswin = false;\n this.preferredRefreshRate = 0.0f;\n this.preferredModeId = 0;\n }", "public void displayReset(View view) {\r\n\r\n scoreA = 0;\r\n scoreB = 0;\r\n displayForTeamA(scoreA);\r\n displayForTeamB(scoreB);\r\n }", "public void resetStack() {\n\t\tmCurrentViewIndex = 0;\n\t\tremoveAllViewsInLayout();\n\t\trequestLayout();\n\t}", "public void reset(View view) {\r\n homeScore = 0;\r\n visitorScore = 0;\r\n displayHomeScore(homeScore);\r\n displayVisitorScore(visitorScore);\r\n }", "@Override\n\t\tpublic void onRefresh() {\n\t\t\tloadInfo(1, 0);\n\t\t}", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n etTitle.setText(\"\");\n etAuthor.setText(\"\");\n etPrice.setText(\"\");\n etEditQuantity.setText(\"\");\n etSupplier.setText(\"\");\n etPhoneNumber.setText(\"\");\n }", "public void reset() {\n initEntries();\n }", "void resetComponents() {\n Utilitarios.fechaActual(jdcFechaInicio);\n Utilitarios.fechaActual(jdcFechaFin);\n if (oMedicoAtiendeReal != null) {\n oMedicoAtiendeReal = null;\n }\n if (oComprobanteDetalle != null) {\n oComprobanteDetalle = null;\n }\n oModeloRegistrarPagoMedicos.clear();\n personalizaVistaTabla();\n txfMedicoDeriva.setText(\"\");\n txfMedicoAtiende.setText(\"\");\n if(oMedico != null){\n oMedico = null;\n }\n txfMedico.setText(\"\");\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mNameTextView.setText(\"\");\n mQuantityTextView.setText(\"\");\n mPriceTextView.setText(\"\");\n mSupplierTextView.setText(\"\");\n mPhoneTextView.setText(\"\");\n mEmailTextView.setText(\"\");\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n xtasyid.setText(\"\");\n name.setText(\"\");\n email.setText(\"\");\n college.setText(\"\");\n contact.setText(\"\");\n gender.setText(\"\");\n extras.setText(\"\");\n }", "private void reset() {\n\t\tlevel.getLogic().resetBoard();\n\t\tlevelView.refresh();\n\t\tlevelView.clearSelectedWords();\n\t}", "public void reset() {\n next = 0;\n renderList.clear();\n viewList.clear();\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}", "private void clearMetaInfo()\r\n\t{\r\n\t amiMap.clear();\r\n\t}", "@Override\n\tpublic void setUpInfoPanel() {\n\t\t\n\t}", "private void initializeInfo()\n {\n Iterator<node_info> it=this.ga.getV().iterator();\n while (it.hasNext())\n {\n it.next().setInfo(null);\n }\n }", "@Override\n public void reset() {\n super.reset();\n }", "@Override\r\n\tprotected void setLayout() {\n\t\tsetContentView(R.layout.edit_trace_info_activity);\r\n\t}", "private void resetApp() {\n\t\tthis.panelTags.setVisible(false);\n\t\tthis.panelMenu.setVisible(true);\n\t\tthis.model.clear();\n\t\tthis.btnClearAll.doClick(0);\n\t\t// textDestination jest czyszczony osobno, po JOptionPane\n\t\t// this.textDestination.setText(null);\n\t\tthis.btnDeleteAll.setEnabled(false);\n\t\tthis.btnDelete.setEnabled(false);\n\t}", "public void reset(View v) {\n scoreTeamB = 0;\n displayForTeamB(scoreTeamB);\n scoreTeamA = 0;\n displayForTeamA(scoreTeamA);\n questionNumber = 0;\n displayQuestionNumber(questionNumber);\n }", "public void updateInfo() {\n\t}", "private void clearSeenInfo() {\n seenInfo_ = emptyProtobufList();\n }", "public void resetMostrarVuelta()\r\n {\r\n this.mostrarVuelta = null;\r\n }", "@Override\r\n\tpublic void reset() {\r\n\t\tpilots.clear();\r\n\t\tcabinCrew.clear();\r\n\r\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}", "@Override\n public void reset()\n {\n super.reset();\n }", "public void reset(View view) {\r\n scoreA = 0;\r\n scoreB = 0;\r\n foulsA = 0;\r\n foulsB = 0;\r\n displayScoreForTeamA(scoreA);\r\n displayFoulsForTeamA(foulsA);\r\n displayScoreForTeamB(scoreB);\r\n displayFoulsForTeamB(foulsB);\r\n }", "private void resetUI() {\n \t\t\n \t\tString mValue = null;\n \t\t\n \t\t// reset the temperature UI component\n \t\tif(temperatureFormat.equals(\"c\")) {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_celsius);\n \t\t} else if(temperatureFormat.equals(\"f\")) {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_fahrenheit);\n \t\t} else {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_kelvin);\n \t\t}\n \t\t\n temperatureValueView.setText(mValue);\n \n // reset the humidity ui component\n mValue = getString(R.string.readings_ui_lbl_humidity_default);\n humidityValueView.setText(mValue);\n \n // reset the time ui component\n readingTimeView.setText(R.string.readings_ui_lbl_reading_time_default);\n \t}", "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 reset() {\n firstUpdate = true;\n }", "public void reset() {\n\t\tref1Rating.setText(\"Not yet rated\");\n\t\tref2Rating.setText(\"Not yet rated\");\n\t\tref3Rating.setText(\"Not yet rated\");\n\t\trevRating.setText(\"Not yet rated\");\n\t\trevComment.setText(\"\");\n\t}", "public void reset() {\n\t\ttfLogradouro.setText(\"\");\n\t\ttfCidade.setText(\"\");\n\t\ttfBairro.setText(\"\");\n\t\ttfEmail.setText(\"\");\n\t\tftfRg.setText(\"\");\n\t\ttfEmitente.setText(\"\");\n\t\tftfCpf.setText(\"\");\n\t\tftfTipo.setText(\"\");\n\t\tdateChooser.setCalendar(null);\n\t\tftfNumero.setText(\"\");\n\t\tftfTelResidencial.setText(\"\");\n\t\tftfCep.setText(\"\");\n\t\tftfTelCelular.setText(\"\");\n\t\tftfDataCadastro.setText(getDataAtual());\n\t\ttfComplemento.setText(\"\");\n\t\ttfEmitente.requestFocus();\n\t\t\n\t}", "public void resetScreen(){\n\t\tGame_Map_Manager.infoVisible= false;\n\t\tGame_PauseMenu.actorManager.open = false;\n\t\tPlayerGoals.open = false;\n\t\tGame_Shop.actorManager.open = false;\n\t\tTrainDepotUI.actorManager.open = false;\n\t\tGameScreenUI.resourcebarexpanded =false;\n\t\tGoalMenu.open= false;\n\t\t\n\t\t//CARDS\n\t\tGame_CardHand.actorManager.open=false;\n\t\tGame_CardHand.actorManager.cardactors.clear();;\n\t\t\n\t\t//Map\n\t\tGame_StartingSequence.reset();\n\t\tGame_Map_Manager.resetMap();\n\t}", "private void reset() {\n }", "public void reset()\n {\n mine = false;\n revealed = false;\n flagged = false;\n repaint();\n }", "public void reset(){\r\n\t\tdialogToDisplay=0;\r\n\t\tqueuedDialog=0;\r\n\t\toptionSelection=null;\r\n\t\tdone=false;\r\n\t}", "public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 0;\n }", "private void resetSections() {\n\t\tdescription.setVisibility(View.GONE);\n\t\tlocation.setVisibility(View.GONE);\n\t\thighlights.setVisibility(View.GONE);\n\t\tinclusions.setVisibility(View.GONE);\n\t\texclusions.setVisibility(View.GONE);\n\t\tknowBeforeYouBook.setVisibility(View.GONE);\n\t\tcancellation.setVisibility(View.GONE);\n\t}", "@Override\r\n public void reset() {\r\n planetResearchMap.clear();\r\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mEditSymptomText.setText(\"\");\n }", "private void updateInformation(){\n view.getPrompt().setText(getPrompt());\n view.getScore().setText(getScore());\n }", "private void reset() {\n ms = s = m = h = 0;\n actualizar();\n }", "public void reset() {\n cancelTaskLoadOIFits();\n\n userCollection = new OiDataCollection();\n oiFitsCollection = new OIFitsCollection();\n oiFitsCollectionFile = null;\n selectedDataPointer = null;\n\n fireOIFitsCollectionChanged();\n }", "public void reset(){\n star.clear();\n planet.clear();\n }", "private static void resetFields() {\n tf_name.setText(\"\");\n tf_title.setText(\"\");\n tf_info.setText(\"\");\n tf_path.setText(\"\");\n cb_bgColor.setSelectedItem(\"white\");\n cb_titleColor.setSelectedItem(\"black\");\n cb_infoColor.setSelectedItem(\"gray\");\n rb_url.setSelected(false);\n rb_file.setSelected(true);\n b_fileSelect.setEnabled(true);\n }", "public synchronized void resetDetailers() {\n detailers = null;\n }", "public void accountViewReset(){\n\t\taccountNameViewTextField.setText(null);\n\t\tuserRadioButton.setSelected(false);\n\t\tviewerRadioButton.setSelected(false);\n\t\t//\t\tuserClick = false;\n\t\t//\t\tviewerClick = false;\n\t\t//\t\tuserCheckBox.setSelected(userClick);\n\t\t//\t\tviewerCheckBox.setSelected(viewerClick);\n\t}", "public void reset(){\r\n barn.setVisited(Boolean.FALSE);\r\n turkeyTalk.setVisited(Boolean.FALSE);\r\n pigginOut.setVisited(Boolean.FALSE);\r\n seeTheLight.setVisited(Boolean.FALSE);\r\n theGobbling.setVisited(Boolean.FALSE);\r\n youDied1.setVisited(Boolean.FALSE);\r\n threeLittlePigs.setVisited(Boolean.FALSE);\r\n forTheGreaterGood.setVisited(Boolean.FALSE);\r\n farmHouseTurkey.setVisited(Boolean.FALSE);\r\n youWin.setVisited(Boolean.FALSE);\r\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mNameEditText.setText(\"\");\n mAddressEditText.setText(\"\");\n mNumberEditText.setText(\"\");\n mBirthTextView.setText(\"\");\n mImagePathTextView.setText(\"\");\n\n }", "public void resetHitMarker() {}", "void msgViewableChanged() {\n resetViewport(start);\n }", "public void resetView() {\n pause();\n if (spriteView != null) spriteView.setViewport(new Rectangle2D(0, 0, rect.getWidth(), rect.getHeight()));\n }", "public void reset() {\n\n\t}", "private void resetTeaInfo() {\n this.teaIDText.setText(\"\");\n this.teaNameText.setText(\"\");\n this.teaCollegeText.setText(\"\");\n this.teaDepartmentText.setText(\"\");\n this.teaPhoneText.setText(\"\");\n this.teaInterestText.setText(\"\");\n this.teaManRadioButton.setSelected(true);\n this.teaWomanRadioButton.setSelected(false);\n teaSex = this.teaManRadioButton.getText();\n this.teaRadioButton1.setSelected(true);\n this.teaRadioButton2.setSelected(false);\n this.teaRadioButton3.setSelected(false);\n this.teaRadioButton4.setSelected(false);\n teaType = this.teaRadioButton1.getText();\n }", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "public void reset()\n {\n pages.clear();\n ePortfolioTitle = \"\";\n selectedPage = null;\n }", "@Override\n\tpublic void resetLocation() {\n\t\t\n\t}", "@Override\r\n protected void setupViews(Bundle bundle) {\n initPersonalInfo();\r\n }", "private void initial() {\n\t\tsetTitleTxt(getString(R.string.choose_game));\n\t\tLinearLayout contentView = (LinearLayout) findViewById(R.id.contentView);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\n\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tview = View.inflate(this, R.layout.user_choose_game, null);\n\t\tcontentView.addView(view, params);\n\t\tgameGrid = (GridView) view.findViewById(R.id.game_list);\n\t\tgameContent = (LinearLayout) view.findViewById(R.id.game_list_info);\n\t\tview.setVisibility(View.GONE);\n\t}", "protected void reset(){\n inited = false;\n }", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "private void viewInit() {\n }", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}" ]
[ "0.7213696", "0.72125995", "0.69790244", "0.6877269", "0.6720692", "0.6590982", "0.6590819", "0.6583933", "0.6492812", "0.648364", "0.6450513", "0.64214754", "0.64010423", "0.6396093", "0.6353627", "0.6339037", "0.6333218", "0.62966025", "0.6288205", "0.6268566", "0.6261333", "0.62606764", "0.62588644", "0.6247438", "0.6244452", "0.62392676", "0.6229168", "0.62231183", "0.6222524", "0.62147176", "0.62066203", "0.61953205", "0.6186425", "0.61750203", "0.6169093", "0.61666435", "0.61583114", "0.6156424", "0.615143", "0.6149497", "0.6149273", "0.6135588", "0.61254036", "0.61218894", "0.61170036", "0.61124176", "0.6096448", "0.6092843", "0.6090727", "0.6088791", "0.60819393", "0.6079312", "0.6075294", "0.6073665", "0.6072194", "0.60717416", "0.6071696", "0.60640603", "0.60593617", "0.60578626", "0.60513747", "0.6048287", "0.6037023", "0.60328674", "0.6029143", "0.6028475", "0.60273486", "0.6018652", "0.6017913", "0.60103214", "0.6009566", "0.60042447", "0.5995263", "0.5994961", "0.5993687", "0.5988738", "0.59782183", "0.5971553", "0.59674066", "0.5948931", "0.59465706", "0.59391576", "0.5932211", "0.59254986", "0.59188235", "0.5918111", "0.59140813", "0.5913312", "0.5912921", "0.5910336", "0.59051955", "0.5904048", "0.59032583", "0.59016263", "0.5898099", "0.58901083", "0.5888483", "0.58878297", "0.58878297", "0.58878297", "0.58878297" ]
0.0
-1
The given element will only be added if its text field is not empty
private void addElement( ArrayList< IconTextElement > elements, String text, String subText, Integer imgId, IconTextListAdapter.Objtype type ) { if( !TextUtils.isEmpty( text ) ) { if( type == IconTextListAdapter.Objtype.ROUTE ) { elements.add( new IconTextElement( text, subText, imgId, text, type ) ); } else { elements.add( new IconTextElement( text, imgId, text, type ) ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void elementIfNotEmpty(String elementName, String content) {\n if ( isNotBlank(content) )\n element(elementName, content);\n }", "public boolean isFilled() {\n return(!this.getText().trim().equals(\"\"));\n }", "public void validAdd(String element){\n\t\tlist.addLast(element);\n\t}", "public abstract boolean addDataTo(Element element);", "private Boolean isFieldEmpty(EditText field) {\n return field.getText().toString().trim().equals(\"\");\n }", "abstract public E addEmpty();", "protected boolean isFieldEmpty(EditText text) {\n if (text.getText().toString().trim().length() == 0) {\n text.setError(getString(R.string.empty_field));\n text.requestFocus();\n return true;\n }\n return false;\n }", "private boolean isEmptyField (EditText editText){\n boolean result = editText.getText().toString().length() <= 0;\n if (result)\n Toast.makeText(UserSignUp.this, \"Fill all fields!\", Toast.LENGTH_SHORT).show();\n return result;\n }", "public boolean add(Element element) {\n if (addNoNotify(element)) {\n setChanged();\n Message message = Message.makeAdded(element);\n notifyObservers(message);\n return true;\n } else {\n return false;\n }\n\n }", "private boolean isEmpty(EditText etText) {\n return etText.getText().toString().trim().length() <= 0;\n }", "public void addElement() {\n\t\tXmlNode newNode = new XmlNode(rootNode, this);// make a new default-type field\n\t\taddElement(newNode);\n\t}", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "Form addElement(Element element);", "private boolean isEmpty(EditText etText) {\n\t\tif (etText.getText().toString().trim().length() > 0)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "private static boolean isEmpty(EditText etText) {\n if (etText.getText().toString().trim().length() > 0)\n return false;\n\n return true;\n }", "private boolean isEmpty(TextInputEditText textInputEditText) {\n if (textInputEditText.getText().toString().trim().length() > 0)\n return false;\n return true;\n }", "@Test\n\tpublic void addElement() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tassertEquals(XMLTagParser.containsElement(\"Person\"), true);\n\t}", "public TextInput(WebElement element) {\n super(element);\n }", "public void setNotEmpty(){\n this.empty = false;\n }", "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 }", "public boolean textboxIsEmpty(EditText editText) {\n return editText.getText().toString().trim().length() == 0;\n }", "void addElement(FormElement elt);", "boolean isEmpty(EditText text){\n CharSequence check = text.getText().toString().trim();\n return TextUtils.isEmpty(check);\n }", "public boolean isEmpty(EditText etText){\n return etText.getText().toString().length() == 0;\n }", "public boolean isEmpty() {\n return (this.text == null);\n }", "public void emptyTextField(){\n spelerIDField.setText(\"\");\n typeField.setText(\"\");\n codeField.setText(\"\");\n heeftBetaaldField.setText(\"\");\n }", "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 }", "public void addField()\n {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) availableFieldsComp.getTree().getLastSelectedPathComponent();\n if (node == null || !node.isLeaf() || !(node.getUserObject() instanceof DataObjDataFieldWrapper) )\n {\n return; // not really a field that can be added, just empty or a string\n }\n\n Object obj = node.getUserObject();\n if (obj instanceof DataObjDataFieldWrapper)\n {\n DataObjDataFieldWrapper wrapper = (DataObjDataFieldWrapper) obj;\n String sep = sepText.getText();\n if (StringUtils.isNotEmpty(sep))\n {\n try\n {\n DefaultStyledDocument doc = (DefaultStyledDocument) formatEditor.getStyledDocument();\n if (doc.getLength() > 0)\n {\n doc.insertString(doc.getLength(), sep, null);\n }\n }\n catch (BadLocationException ble) {}\n \n }\n insertFieldIntoTextEditor(wrapper);\n setHasChanged(true);\n }\n }", "@Override\r\n public void afterTextChanged(Editable editable) {\n checkFieldsForEmptyValues();\r\n }", "private boolean check()\n\t{\n\t\tComponent[] comp = contentPanel.getComponents();\n\t\tint check=0;\n\t\tfor(Component c:comp)\n\t\t{\n\t\t\tif(c instanceof JTextField)\n\t\t\t{\n\t\t\t\tif(((JTextField)c).getText().trim().equals(\"\"))\n\t\t\t\t\tcheck++;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn check==0 ? true : false;\n\t}", "@Override\n public void afterTextChanged(Editable editable) {\n checkFieldsForEmptyValues();\n }", "@Override\n\t\t\tpublic void focusLost(FocusEvent arg0) {\n\t\t\t\tif(!(txtFieldIme.getText().isEmpty() || txtFieldPrezime.getText().isEmpty() || \n\t\t\t\t\t\ttxtFieldAdresaStanovanja.getText().isEmpty() || txtFieldBrTelefona.getText().isEmpty() || txtFieldEmail.getText().isEmpty() || \n\t\t\t\t\t\ttxtFieldBrIndeksa.getText().isEmpty() || txtFieldGodinaUpisa.getText().isEmpty() || ((String)GodinaStudija.getSelectedItem()).isEmpty() ||\n\t\t\t\t\t\t((String)comboStatus.getSelectedItem()).isEmpty())) \n\t\t\t\t{\n\t\t\t\t\tpotvrdi.setEnabled(true);\n\t\t\t\t}\n\t\t\t}", "private boolean isComboBoxEmpty(String entry){\n return entry == null || entry.isBlank();\n }", "@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 InputTextValidator () {\n isNotNull = !txtCategoryNo.getText().equals(\"\") && !txtCategoryName.getText().equals(\"\");\n }", "protected static void verifyNotEmpty(Text field, String fieldName)\r\n\t\t\tthrows MusicTunesException {\r\n\t\tif (field.getText().length() == 0) {\r\n\t\t\tfield.setFocus();\r\n\t\t\tfield.selectAll();\r\n\t\t\tthrow new MusicTunesException(fieldName\r\n\t\t\t\t\t+ \" field must be filled!\");\r\n\t\t}\r\n\t}", "public void addText(String texto) {\n\t\tthis.texto = texto == null ? \"\" : texto.trim();\n\t}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_acchol.getText().contains(\"xxx\")){\n jTextField_Create_Savings_Acc_acchol.setText(\"\");\n }\n }", "@Test\n public final void testCheckForBlankText() {\n Document testDoc = TestDocHelper.createDocument(\n \"<a></a>\");\n\n Node nonBlank = testDoc.createTextNode(\"a\");\n assertFalse(NodeOps.nodeIsEmptyText(nonBlank));\n\n Node blank = testDoc.createTextNode(\"\");\n assertTrue(NodeOps.nodeIsEmptyText(blank));\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String text = tagIdInsertTextBox.getText();\n if (text != null && text.length() > 0) {\n jTextAreaId.setText(jTextAreaId.getText() + \"\\n\" + text);\n tagIdInsertTextBox.setText(\"\");\n jTextAreaId.setRows(jTextAreaId.getLineCount());\n //f1.validate();\n }\n }", "@Override\n\tpublic boolean estaElemento(String elemento) {\n\t\treturn false;\n\t}", "public org.openxmlformats.schemas.presentationml.x2006.main.CTEmpty addNewPresent()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.presentationml.x2006.main.CTEmpty target = null;\n target = (org.openxmlformats.schemas.presentationml.x2006.main.CTEmpty)get_store().add_element_user(PRESENT$0);\n return target;\n }\n }", "QueryElement addOrNotEmpty(String collectionProperty);", "private void appendText()\n\t{\n\t\tString fieldText = \"\";\n\t\tString newText = \"\";\n\t\tfieldText = entry.getText();\n\t\t\n\t\tif(fieldText.equals (\"0\"))\n\t\t{\n\t\t\tnewText += append;\n\t\t\tfieldText = newText;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfieldText += append;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\t\n\t\tentry.grabFocus ( );\n\t\t\n\t}", "public void CheckEditTextIsEmptyOrNot()\r\n {\r\n ename_holder = name_event.getText().toString();\r\n edesc_holder = desc_event.getText().toString();\r\n eloc_holder = loc_event.getText().toString();\r\n edate_holder = date_event.getText().toString();\r\n etime_holder = time_event.getText().toString();\r\n elat_holder = lat_event.getText().toString();\r\n elong_holder = long_event.getText().toString();\r\n\r\n if(TextUtils.isEmpty(ename_holder) || TextUtils.isEmpty(edesc_holder) || TextUtils.isEmpty(eloc_holder) || TextUtils.isEmpty(edate_holder) || TextUtils.isEmpty(etime_holder) || TextUtils.isEmpty(elat_holder) || TextUtils.isEmpty(elong_holder))\r\n {\r\n CheckEditText = false;\r\n }\r\n else\r\n {\r\n CheckEditText = true;\r\n }\r\n }", "private void addIfEmpty(Element e) {\n Node<Element> new_node = new Node<>(header, e, trailer);\n\n header.setNextNode(new_node);\n trailer.setPrevNode(new_node);\n }", "QueryElement addNotEmpty(String collectionProperty);", "public void tryAdd() {\r\n\t\tif (isDataModified()) {\r\n\t\t\tscrollToMe();\r\n if (getValidator().getUseAlertsForErrors()) {\r\n addConfirmScript(_okToAddQuestion, _okToAddValue);\r\n }\r\n else {\r\n _validator.setErrorMessage(_okToAddQuestion, null, -1, _okToAdd);\r\n }\r\n\t\t}\r\n else {\r\n \t\tdoAdd();\r\n }\r\n\t}", "public boolean add(String element) {\n if (element == null) {\n throw new IllegalArgumentException(\"Null string!\");\n }\n\n Node addNode = getNodeByString(element, true);\n\n if (addNode.isTerminal()) {\n return false;\n }\n\n addNode.setTerminal(true);\n\n return true;\n }", "public boolean check(){\n for(TextField texts:textFields){\n if(texts.getText().isEmpty()){\n return false;\n }\n }\n return true;\n }", "private void validateEmptyElements()\n {\n // Check if something is missing\n if (_dietTreatment.getName().length() < 1)\n {\n getErrors().add(\"Kein Name angegeben.\");\n }\n\n // TODO: check that at least one user is TREATING!\n if (_dietTreatment.getSystemUsers().isEmpty())\n {\n getErrors().add(\"Kein verantwortlicher User angegeben.\");\n }\n\n if (_dietTreatment.getPatientStates().isEmpty())\n {\n getErrors().add(\"Keine Zuweisungsdiagnose angegeben.\");\n }\n }", "public void addTextField(String text, boolean compulsory) {\n EditText field = new EditText(getContext());\n\n if (text.toLowerCase().contains(\"email\"))\n field.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);\n\n if (compulsory)\n addTextChangeListener(field);\n\n String req = compulsory ? required : \"\";\n\n field.setHint(text + req);\n\n mainll.addView(field);\n map.put(field, compulsory);\n }", "public @Override boolean add(E element) {\n \tappend(element);\n \treturn true;\n }", "public boolean add(E element){\n Object result = map.put(element, \"\");\n return (result == null);\n }", "protected boolean isEmpty(String text) {\r\n if (text == null) {\r\n return true;\r\n }\r\n\r\n if (text.trim().length() == 0) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected boolean addNonEmpty(final String key, final String value) {\n if (isEmptyString(value)) {\n final String format = \"Parameter '%s' is required and may not be null or empty!\";\n throw new IllegalArgumentException(String.format(format, key));\n }\n return addParameterValue(key, value);\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_usern.getText().contains(\"xxx\")){\n jTextField_Create_Savings_Acc_usern.setText(\"\");\n }\n }", "public void listAddPage(View v) {\n String listAddList = ((EditText)findViewById(R.id.editText)).getText().toString().trim();\n if(listAddList.isEmpty()){ // **KEEPS EMPTY STRINGS FROM BEING ENTERED TO LIST\n Toast.makeText(MainActivity.this, \"Error, Empty\", Toast.LENGTH_LONG).show(); // ADD TOAST MESSAGE IF EMPTY STRING IS ENTERED \"ERROR, ECT\"\n return;\n }\n arrayAdapterMaster.add(listAddList);\n EditText editText = (EditText)findViewById(R.id.editText);\n editText.setText(\"\"); // **CLEARS EDITTEXT FIELD ON BUTTON CLICK\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_holderName.getText().contains(\"xxx\")){\n jtxt_holderName.setText(\"\");\n }\n }", "public boolean textToBePresentInElementValue(final WebElement element, final String text) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME)\n .until(ExpectedConditions.textToBePresentInElementValue(element, text));\n }", "private void addElem(Document doc, Element parent, String elemName,\r\n String elemValue, boolean required) {\r\n Element elem = doc.createElement(elemName);\r\n elem.appendChild(doc.createTextNode(elemValue));\r\n if (required) {\r\n elem.setAttribute(\"required\", \"true\");\r\n }\r\n parent.appendChild(elem);\r\n }", "public void enterTextinTextbox(WebElement element, String text) {\n\n\t\telement.clear();\n\t\telement.sendKeys(text);\n\t}", "public boolean textToBePresentInElement(WebElement element, String text) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME)\n .until(ExpectedConditions.textToBePresentInElement(element, text));\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 }", "QueryElement addOrEmpty(String collectionProperty);", "public boolean add(Object element);", "public abstract boolean isBlank() throws Exception;", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_bal.getText().contains(\"000\")){\n jTextField_Create_Savings_Acc_bal.setText(\"\");\n }\n }", "private boolean endTagRequired(UAElement element) {\n \t\tString elementName = element.getElementName();\n \t\tif (\"a\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"p\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"div\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"script\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"textarea\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\treturn false;\n \t}", "public boolean isDisplayed_txt_Pick_Up_Text(){\r\n\t\tif(txt_Pick_Up_Text.isDisplayed()) { return true; } else { return false;} \r\n\t}", "public static boolean validarVacio(JTextField text) {\n String vText = text.getText().trim();\n if (\"\".equals(vText)) {\n MensajeSistema.MensajeVarios(\"Este campo no se puede vacio!!!\", MensajeSistema.ERROR_MESSAGE());\n text.setText(null);\n text.grabFocus();\n return false;\n } else {\n text.setText(vText);\n return true;\n }\n }", "@Override\n public void onClick(View view) {\n if (mEdtTask.getText().toString().trim().matches(\"\") && mEdtDuration.getText().toString().trim().matches(\"\")){\n Toast.makeText(MainActivity.this, \"Empty field\", Toast.LENGTH_SHORT).show();\n } else {\n try {\n mSQLiteHelper.insertData(\n mEdtTask.getText().toString().trim(),\n mEdtDuration.getText().toString().trim(),\n mEdtStatus.getText().toString().trim()\n );\n Toast.makeText(MainActivity.this, \"Added successfully\", Toast.LENGTH_SHORT).show();\n //reset views\n mEdtTask.setText(\"\");\n mEdtDuration.setText(\"\");\n mEdtStatus.setText(\"\");\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n }", "private boolean noFieldsEmpty() {\n if ( nameField.getText().isEmpty()\n || addressField.getText().isEmpty()\n || cityField.getText().isEmpty()\n || countryComboBox.getSelectionModel().getSelectedItem() == null\n || divisionComboBox.getSelectionModel().getSelectedItem() == null\n || postalField.getText().isEmpty()\n || phoneField.getText().isEmpty() ) {\n errorLabel.setText(rb.getString(\"fieldBlank\"));\n return false;\n }\n return true;\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 }", "public boolean isBlank() {\n return (tags.length() == 0);\n }", "public boolean hasTextValue() {\r\n return getTextValue() != null;\r\n // return StringUtils.isNotBlank(getTextValue());\r\n }", "@Override\n public boolean isEmpty() {\n return super.isEmpty() && ElementUtil.isEmpty(subsidyCode, programCode, prescriberTypes, notes, cautionaryNotes,\n restriction, commonwealthExManufacturerPrice, manufacturerExManufacturerPrice);\n }", "ElementText createElementText();", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\n\t\t\t\tLog.e(\"dajiayilian\", \"watcher\" + s.toString());\n\t\t\t\tif (TextUtils.isEmpty(s)) {\n\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "public abstract boolean removeTextBox(TextBox tb);", "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 void empty_field() {\n tf_id_kategori.setText(null);\n tf_nama_kategori.setText(null);\n tf_keterangan.setText(null);\n pencarian.setText(null);\n }", "public static void addNodeToDOM(WebElement element)\n\t{\n\t\tString sResult = addNodeToDOM(element, sTempUniqueNode);\n\t\tif (!sResult.equals(\"\"))\n\t\t{\n\t\t\tString sError = \"Javascript execution failed with following message: \" + sResult;\n\t\t\tLogs.logError(new JavaScriptException(sError));\n\t\t}\n\t}", "private boolean checkEmptyEditText(EditText text, TextInputLayout TFB, String massage) {\n\n if (text.getText().toString().isEmpty())\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n\n }", "public static boolean isEditTextEmpty(EditText editText, String warning) {\n\t\treturn isEditTextEmpty(editText, warning, null);\n\t}", "public void validaNulos( JTextField valor, String texto){\n\t\ttry {\n\t\t\tif(valor.getText().length() < 1) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Valor \" + texto + \" nao preenchido\");\n\t\t\t\tvalor.grabFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (NullPointerException ex) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Valor \" + texto + \" nao preenchido\");\n\t\t\treturn;\n\t\t}\n\t}", "@Override\n\t\tprotected boolean isTextValid()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (getField().getText().isEmpty())\n\t\t\t\t\tthrow new AppException(ErrorId.NO_FILTER);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (AppException e)\n\t\t\t{\n\t\t\t\tGuiUtils.setFocus(getField());\n\t\t\t\tJOptionPane.showMessageDialog(this, e, App.SHORT_NAME, JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public void validate_CommentField_NotDisplay() {\n List<WebElement> list = getDriver().findElements(By.xpath(\"//*[@id='ordernotes']/textarea\"));\n Assert.assertTrue(\"=== Comment Field Not Present!\", list.size() == 0);\n }", "@Override\n protected void checkElementNameUnique(Element element)\n {\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_joindate.getText().contains(\"xxx\")){\n jTextField_Create_Savings_Acc_joindate.setText(\"\");\n }\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n if(!txt_codigo.getText().toString().equals(\"\")){\n //LLAMAR AL METODO QUE COMPRUEBA SI EL CODIGO INGRESADO ES VALIDO O NO (TRUE O FALSE)\n //IF(CODIGO ES VALIDO) ENTONCES TOAST = CODIGO AGREGADO ELSE CODIGOERRONEO\n\n //TXT.CODIGO.SETTEXT(\"\");\n }\n }", "public void onClick(View view) {\n if(Ingredient.getText().length()>=0) {\n newRecipe.ingredients.add(Ingredient.getText().toString());\n //erase text box for next usage\n Ingredient.setText(\"\");\n\n }\n else {\n\n }\n\n }", "private void checkEmpty() throws NoSuchElementException\n\t{\n\t\tif (isEmpty())\n\t\t{\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\t}", "public final void addText(final String textContent) {\n\t\tthis.text = textContent.trim();\n\t\tif (this.text.length() == 0) {\n\t\t\tthis.text = null;\n\t\t}\n\t}", "protected void type(WebElement element, String text) {\n waitForElementToBeVisible(element);\n element.clear();\n element.sendKeys(text);\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_accnum.getText().contains(\"xxx\")){\n jTextField_Create_Savings_Acc_accnum.setText(\"\");\n }\n }", "public void inputText(WebElement element, String text) {\r\n\t\twaitForElement(element);\r\n\t\telement.clear();\r\n\t\telement.sendKeys(text);\r\n\t}", "private boolean isNotEmptyAndNotNull(final Node node)\r\n {\r\n if (\"null\".equals(node.getNodeValue()))\r\n {\r\n return false;\r\n }\r\n if (node.getNodeValue().trim().isEmpty())\r\n {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (editText.getTag() == null) {\n hasBeenSetManually = true;\n }\n }", "private boolean isInvalid(JTextField campo) {\n return campo.getText().isEmpty();\n }", "@Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n if (!String.valueOf(charSequence).equals(\"\") && all_ingredients.containsKey(charSequence.toString()))\n add_button.setEnabled(true);\n else\n add_button.setEnabled(false);\n }" ]
[ "0.66168654", "0.61778706", "0.58794117", "0.57952666", "0.57724994", "0.5725958", "0.56943053", "0.5677435", "0.5669163", "0.5666566", "0.5664223", "0.5664161", "0.5641944", "0.56411844", "0.56262857", "0.55830467", "0.5544653", "0.5538948", "0.55132246", "0.549455", "0.5478654", "0.5464001", "0.5456748", "0.5428831", "0.54163736", "0.541585", "0.54131633", "0.5407041", "0.5405509", "0.5403068", "0.53866565", "0.53838724", "0.53689504", "0.53600025", "0.53518915", "0.53502125", "0.53344333", "0.5327205", "0.53037137", "0.5303028", "0.5296984", "0.5295484", "0.52900755", "0.5268203", "0.5256384", "0.5237961", "0.52378505", "0.52312076", "0.52248347", "0.5223974", "0.5222956", "0.52115315", "0.5208434", "0.5204565", "0.5183313", "0.5181731", "0.51778996", "0.51697963", "0.5166471", "0.51561767", "0.5154591", "0.5152115", "0.51466376", "0.5144575", "0.512629", "0.5125728", "0.5118313", "0.5115769", "0.51109445", "0.50917614", "0.5088562", "0.5088312", "0.50853586", "0.50778824", "0.50778013", "0.5076668", "0.50742555", "0.50676465", "0.50625384", "0.5057004", "0.5056163", "0.5054494", "0.5051079", "0.5051053", "0.5049957", "0.5048249", "0.5044845", "0.5041104", "0.5037322", "0.5034793", "0.502492", "0.5013177", "0.5012495", "0.50070626", "0.5005042", "0.49948028", "0.4992358", "0.49886924", "0.4977892", "0.49737266", "0.49716276" ]
0.0
-1
Gets an image using an imageURL and sets the icon to the resulting image.
public void loadImage(final String imageURL) { //ImageUrl seems to contain a link. Load it in a new thread and change the image when loaded. if (imageURL != null) { Picasso.get(). load(imageURL). into(mTopImage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected Bitmap getImage(URL url) {\n\n HttpURLConnection iconConn = null;\n try {\n iconConn = (HttpURLConnection) url.openConnection();\n iconConn.connect();\n int response = iconConn.getResponseCode();\n //if the reponse 200 the successfull\n if (response == 200) {\n return BitmapFactory.decodeStream(iconConn.getInputStream());\n } else {\n return null;\n }\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n } finally {\n if (iconConn != null) {\n iconConn.disconnect();\n }\n }\n }", "private static void downloadIcon(final UrlMetadata urlMetadata) {\n ImageRequest imageRequest = new ImageRequest(urlMetadata.iconUrl, new Response.Listener<Bitmap>() {\n @Override\n public void onResponse(Bitmap response) {\n urlMetadata.icon = response;\n mMetadataResolverCallback.onUrlMetadataIconReceived();\n }\n }, 0, 0, null, null);\n mRequestQueue.add(imageRequest);\n }", "public @Nullable IIconData getIcon(@Nullable URL url);", "void setImageFromURL(String imageURL);", "public ImageIcon createImageIcon(java.net.URL imgURL, String description) {\n\t//\tjava.net.URL imgURL = getClass().getResource(path);\n\t\tif (imgURL != null) {\n\t return new ImageIcon(imgURL, description);\n\t\t\t}\n\t\t\telse { \n\t\t\t return null;\n\t\t\t}\n\t}", "@Nullable\n final public String getIconImageUrl() {\n return mIconImageUrl;\n }", "private ImageIcon getMyImageIcon(String name) {\n\t\tString fullName = \"/images\" + '/' + name + \".gif\";\n\t\treturn getMyImage(fullName);\n\t}", "private void displayImage(String url, ImageView image){\n Ion.with(image)\n .placeholder(R.drawable.fgclogo)\n .error(R.drawable.fgclogo)\n .load(url);\n }", "public static Image imageFromURL(final URL url)\tthrows IOException,\r\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\tNotImageException\r\n\t{\r\n\t\turl.openStream().close(); // throws IOException if url bad\r\n\t\tfinal Image image = TOOLKIT.getImage(url);\r\n\t\tensureImage(image);\r\n\t\treturn image;\r\n\t}", "public ImageIcon getImage(String type) {\n if (type.equals(\"Ant\"))\n return AntImage.getInstance();\n else if (type.equals(\"Bug\"))\n return BugImage.getInstance();\n return null;\n }", "public ImageIcon getImage();", "public static Bitmap getIconBitmap(String imageURLString,\n Resources resources, int bitmapSampleSize) \n {\n Bitmap iconBitmap = null; // create the Bitmap\n try \n {\n // create a URL pointing to the image on WorldWeatherOnline's site\n URL weatherURL = new URL(imageURLString);\n \n BitmapFactory.Options options = new BitmapFactory.Options();\n if (bitmapSampleSize != -1) \n { \n options.inSampleSize = bitmapSampleSize;\n } // end if\n \n // save the image as a Bitmap \n iconBitmap = BitmapFactory.decodeStream(weatherURL.\n openStream(), null, options);\n } // end try\n catch (MalformedURLException e) \n {\n Log.e(TAG, e.toString());\n } // end catch\n catch (IOException e) \n {\n Log.e(TAG, e.toString());\n } // end catch\n \n return iconBitmap; // return the image\n }", "public TailoredImage getImageUrl(String url) throws IOException {\n\t\treturn doProcess(ImageIO.read(new URL(url)));\n\t}", "public static Image getImage(String string) {\n\t Bundle bundle = FrameworkUtil.getBundle(Activator.class);\n\t URL url = FileLocator.find(bundle, new Path(\"icons/\" + string), null);\n\t ImageDescriptor image = ImageDescriptor.createFromURL(url);\n\t return image.createImage();\n\t}", "public byte[] getIcon(String url) {\n return mIconUrlToIconMap.get(url);\n }", "static Image forUrl(String imageType, String url) {\n\t\treturn () -> {\n\t\t\ttry {\n\t\t\t\tURLConnection urlConnection = new URL(url).openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\");\n\t\t\t\tInputStream stream = urlConnection.getInputStream();\n\t\t\t\treturn forStream(imageType, stream).getData();\n\t\t\t} catch (IOException e) {\n\t\t\t\tDiscord4J.LOGGER.error(LogMarkers.UTIL, \"Discord4J Internal Exception\", e);\n\t\t\t}\n\t\t\treturn defaultAvatar().getData();\n\t\t};\n\t}", "private void iconImage() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"icon.jpg\")));\n }", "public void setImage(ImageIcon image) {\n this.image = image;\n }", "public ImageDescriptor getIcon();", "public static ImageIcon getIconImage(String filename){\t\r\n\t\tImageIcon image = new ImageIcon(ServerMain.RUTA+\"img/\"+filename);\r\n\t\tif(image.getImageLoadStatus()==4) return null;\r\n\t\treturn image;\r\n\t}", "@Override\n\tImageIcon getImage() {\n\t\treturn img;\n\t}", "private void setIconImage(ImageIcon imageIcon) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "private void setIconImage(ImageIcon imageIcon) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "protected Image loadIcon() {\n /*\n * Icon by http://www.artua.com/, retrieved here:\n * http://www.iconarchive.com/show/star-wars-icons-by-artua.html\n */\n return new ImageLoader().loadIcon(\"moon.png\");\n }", "public abstract ImageDescriptor getIcon();", "URL getIconURL(String iconId, IconSize medium);", "public void setImage(ImageIcon image){\n\t\tthis.image = image;\n\t}", "@Override\n public Image getIconImage() {\n java.net.URL imgURL = MainWindowAlt.class.getResource(\"images/logo.gif\");\n if (imgURL != null) {\n return new ImageIcon(imgURL).getImage();\n } else {\n return null;\n }\n }", "@Source(\"create.gif\")\n\tpublic ImageResource createIcon();", "public static Image loadImage(URL imagePath)\n {\n Image image = new ImageIcon(imagePath).getImage();\n\n if (image == null)\n System.out.println(\"URL Image not loaded! \" + imagePath);\n\n return image;\n }", "public void setImageUrl(String url){\n\n Glide.with(getContext()).load(url)\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .into(ivImg);\n }", "public Image getImage(URL paramURL) {\n/* 276 */ return getAppletContext().getImage(paramURL);\n/* */ }", "public void setIcon(Image i) {icon = i;}", "public String getImg(String icon)\n {\n // New <img>\n XML img = new XML(\"img\",false);\n \n // Check specified icon property\n if (icon == null) \n { \n icon = \"\"; \n }\n \n // Set src attribute\n img.addAttribute(\"src\",icon);\n \n // return <img>\n return img.toString();\n }", "public Icon getImageIcon() {\r\n\t\treturn lblImageViewer.getIcon();\r\n\t}", "@Override\n public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource(\"imagenes/Icon.jpg\"));\n return retValue;\n }", "@Override\n public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource(\"images/icon.png\"));\n return retValue;\n }", "@Override\n public Bitmap getImage(String url) {\n try {\n if (!taskForUrlAlreadyRunning(url)) {\n imageDownloadTaskMap.put(url, startDownload(url));\n }\n } catch (MalformedURLException e) {\n Log.i(\"ImageDownloadManager\", \"Malformed url\" + url);\n }\n return null;\n }", "public ImageIcon getImageIcon() {\n return animacion.getImagen();\n }", "public URL getIcon()\r\n {\r\n\treturn icon;\r\n }", "Icon getIcon(URI activityType);", "public void addIcon(String url, byte[] icon) {\n mIconUrlToIconMap.put(url, icon);\n }", "public void setImageURL(String imageURL) {\n\t\tthis.imageURL = imageURL;\n\t}", "public static BufferedImage getImage(String name) {\r\n\t\treturn (BufferedImage) getInstance().addResource(name);\r\n\t}", "@Override\n public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().\n getImage(ClassLoader.getSystemResource(\"Images/mainIcon.png\"));\n\n\n return retValue;\n }", "public void displayImage() {\n RealImage real = new RealImage(url);\n real.displayImage();\n }", "Builder addImage(URL value);", "public void Draw() {\n\t\timgIcon = new ImageIcon(imgUrl);\n\t}", "public yandex.cloud.api.containerregistry.v1.ImageOuterClass.Image get(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.GetImageRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetMethod(), getCallOptions(), request);\n }", "private ImageIcon openImageIcon(String name){\n return new ImageIcon(\n getClass().getResource(name)\n );\n }", "private void loadImage(final String url) {\n\t\tnew AsyncTask<Void, Void, Drawable>() {\n\t\t\t@Override\n\t\t\tprotected Drawable doInBackground(Void... none) {\n\t\t\t\treturn NetHelper.getDrawableFromUrl(url);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onPostExecute(Drawable drawable) {\n\t\t\t\tImageView thumbnail = (ImageView) findViewById(R.id.details_image_view_thumbnail);\n\t\t\t\tthumbnail.setImageDrawable(drawable);\n\t\t\t}\n\t\t}.execute();\n\t}", "public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().\n getImage(ClassLoader.getSystemResource(\"Imagenes/Cagliero.png\"));\n return retValue;\n }", "private static Image findImageAt(String url, Settings settings) throws IOException {\n\n String html = new String(URLFetcher.fetchURLData(url, settings.getProxyHost(), settings.getProxyPort()), \"UTF-8\");\n\n List<String> images = new ArrayList<>();\n\n Matcher m = IMAGE_HTML_PATTERN.matcher(html);\n while (m.find()) {\n images.add(m.group(1));\n }\n\n html = new String(URLFetcher.fetchURLData(ROOTURL + images.get((int)(Math.random() * images.size())), settings.getProxyHost(), settings.getProxyPort()), \"UTF-8\");\n\n m = IMAGE_PATTERN.matcher(html);\n if (m.find()) {\n String imageUrl = URLDecoder.decode(m.group(1), \"UTF-8\");\n\n return new ImageIcon(URLFetcher.fetchURLData(imageUrl, settings.getProxyHost(), settings.getProxyPort())).getImage();\n }\n\n throw new IOException(\"Failed to find image\");\n }", "public static BufferedImage loadBufferedImage( URL theUrl )\n\t\tthrows IOException\n\t{\n\t\tBufferedImage im = null;\n\t\ttry\n\t\t{\n\t\t\tim = ImageIO.read( theUrl );\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new IOException( \"Couldn't Load \" + theUrl, e );\n\t\t}\n\t\tcatch (Error e)\n\t\t{\n\t\t\tthrow new IOException( e );\n\t\t}\n\n\t\treturn im;\n\n\t}", "protected static ImageIcon readImageIcon(String filename) {\r\n URL url = Main.class.getResource(\"resources/images/\" + filename);\r\n return new ImageIcon(url);\r\n }", "@Nonnull\n Image getImageFor(@Nonnull LocationRepresentation representation);", "public void get(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.GetImageRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.containerregistry.v1.ImageOuterClass.Image> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver);\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.containerregistry.v1.ImageOuterClass.Image> get(\n yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.GetImageRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetMethod(), getCallOptions()), request);\n }", "public void getImage(final String url, final GetImageListener listener) {\n String localFileName = getLocalImageFileName(url);\n final Bitmap image = loadImageFromFile(localFileName);\n if (image == null) { //if image not found - try downloading it from parse\n firebaseModel.getImage(url, new GetImageListener() {\n @Override\n public void onComplete(String url) {\n //2. save the image localy\n String localFileName = getLocalImageFileName(url);\n //Log.d(\"TAG\",\"save image to cache: \" + localFileName);\n saveImageToFile(image,localFileName);\n //3. return the image using the listener\n listener.onComplete(image.toString());\n }\n\n @Override\n public void fail() {\n listener.fail();\n }\n });\n }else {\n //Log.d(\"TAG\",\"OK reading cache image: \" + localFileName);\n listener.onComplete(image.toString());\n }}", "public void setImage(String path) {\n\t\timageIcon = new ImageIcon(Helper.getFileURL(path));\n\t}", "public abstract ImageIcon getIcon(int size);", "public ImageIcon getImage(String key) throws IOException\n\t{\n\t\tif(map == null)\n\t\t{\n\t\t\tcreateHash();\n\t\t}\n\t\t\n\t\treturn(map.get(key));\n\t}", "public Drawable resolveImage(Uri uri) throws IOException {\n BitmapDrawable resolveImageInternal = resolveImageInternal(uri);\n if (resolveImageInternal == null || resolveImageInternal.getBitmap() == null) {\n throw new IOException(\"resolveImageInternal returned null for uri: \" + uri);\n }\n resolveImageInternal.setBitmap(Icon.scaleDownIfNecessary(resolveImageInternal.getBitmap(), this.mMaxImageWidth, this.mMaxImageHeight));\n return resolveImageInternal;\n }", "public Icon getIcon() {\r\n\r\n if (icon == null && this.getIconString() != null) {\r\n InputStream in = this.getClass().getResourceAsStream(this.getIconString());\r\n BufferedImage img = null;\r\n Image scaledImg = null;\r\n try {\r\n img = ImageIO.read(in);\r\n scaledImg = img.getScaledInstance(this.useToolIconSize ? PirolPlugInSettings.StandardToolIconWidth : PirolPlugInSettings.StandardPlugInIconWidth, this.useToolIconSize ? PirolPlugInSettings.StandardToolIconHeight : PirolPlugInSettings.StandardPlugInIconHeight, img.getType());\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n img = null;\r\n icon = null;\r\n }\r\n if (scaledImg != null) {\r\n icon = new ImageIcon(scaledImg);\r\n }\r\n }\r\n return icon;\r\n }", "public void setImageURL(String imageURL) \r\n\t{\r\n\t\t\r\n\t\tthis.imageURL = imageURL;\r\n\t\t\r\n\t}", "public void setImageUrl(String url) {\n\t\tthis.url = url;\n\t}", "public void setImage(String ref){\n\t ImageIcon ii = new ImageIcon(this.getClass().getResource(ref));\n\t image = ii.getImage();\n\t}", "private Image getImage(String url) {\r\n\t\ttry {\r\n\t\t\treturn ImageIO.read(new URL(url));\r\n\t\t} catch (IOException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public void get(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.GetImageRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.containerregistry.v1.ImageOuterClass.Image> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver);\n }", "private Image getImage(String url) {\n\t\ttry {\n\t\t\treturn ImageIO.read(new URL(url));\n\t\t} catch(IOException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public String getImageUrl();", "public Image getIcon(int type) {\n if ((type == BeanInfo.ICON_COLOR_16x16) || (type == BeanInfo.ICON_MONO_16x16))\n return defaultIcon;\n else\n return defaultIcon32;\n }", "private void setCategoryIcon(String iconUrl) {\n Glide.with(itemView.getContext()).load(iconUrl).apply(new RequestOptions().placeholder(R.mipmap.opm_launcher)).into(productImage);\n\n }", "@Override\n public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().\n getImage(ClassLoader.getSystemResource(\"Imagenes/Sisapre001.png\"));\n return retValue;\n }", "public void setImageUrl(String imageUrl) {\n this.imageUrl = imageUrl;\n }", "public abstract Drawable getIcon();", "public String getImageUrl() {\n return mImageUrl;\n }", "public static void getImageFromUrl(String url, final ImageView imageView,\r\n\t\t\tContext contexte) {\r\n\r\n\t\tVolleySingleton volleyInstance = VolleySingleton.getInstance(contexte);\r\n\t\tImageLoader imageLoader = volleyInstance.getImageLoader();\r\n\t\t\r\n\t\timageLoader.get(url, new ImageListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onErrorResponse(VolleyError error) {\r\n\t\t\t\timageView.setImageResource(R.drawable.ic_launcher);\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onResponse(ImageContainer response, boolean arg1) {\r\n\r\n\t\t\t\tLog.i(\"Api\",\r\n\t\t\t\t\t\t\"Get image url reponse :\" + response.getRequestUrl());\r\n\t\t\t\tif (response.getBitmap() != null) {\r\n\t\t\t\t\timageView.setImageBitmap(response.getBitmap());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "protected static Image getIcon(final String imagePath) {\r\n return new Image(DISPLAY, Thread.currentThread()\r\n .getContextClassLoader().getResourceAsStream(imagePath));\r\n }", "protected void setImageUrl(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{\n\t\t\n\t\tString imageUrl = rs.getString(UiActionTable.COLUMN_IMAGE_URL);\n\t\t\n\t\tif(imageUrl == null){\n\t\t\t//do nothing when nothing found in database\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tuiAction.setImageUrl(imageUrl);\n\t}", "public static ImageIcon getIcon(String path) {\r\n URL url = ResourceManager.class.getResource(path);\r\n if (url != null) {\r\n return new ImageIcon(url);\r\n } else {\r\n throw new RuntimeException(\"Resource file not found: \" + path);\r\n }\r\n }", "@Source(\"create.gif\")\n\tpublic DataResource createIconResource();", "public Drawable fetchDrawable(String urlString) {\n\t\t\t\ttry {\n\t\t\t\t\tInputStream is = fetch(urlString);\n\t\t\t\t\tDrawable drawable = Drawable.createFromStream(is, \"src\");\n\t\t\t\t\tdrawable.setBounds(0, 0, 25 + drawable.getIntrinsicWidth(), 25\n\t\t\t\t\t\t\t+ drawable.getIntrinsicHeight());\n\t\t\t\t\treturn drawable;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}", "private void setUpImage() {\n Bitmap icon = BitmapFactory.decodeResource( this.getResources(), R.drawable.hotel_icon );\n map.addImage( MARKER_IMAGE_ID, icon );\n }", "@NotNull\n SVGResource getIcon();", "public Image getImage() {\n ByteArrayInputStream byteIn = new ByteArrayInputStream(Base64.decodeBase64(this.getImageBase64()));\n\n BufferedImage image;\n\n try {\n image = ImageIO.read(byteIn);\n }\n catch (IOException e) {\n if (this.logger != null) {\n this.logger.warning(\"Error when decoding base64 server icon\");\n }\n\n image = null;\n }\n\n if (image == null) {\n return new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);\n }\n else {\n return image;\n }\n }", "void setImageResource(String imageResource) throws IOException;", "@Override\n public void displayImage(String url, String mimeType, String title, String description,\n String iconSrc, final LaunchListener listener) {\n setMediaSource(new MediaInfo.Builder(url, mimeType)\n .setTitle(title)\n .setDescription(description)\n .setIcon(iconSrc)\n .build(), listener);\n }", "public void setIcon(Icon image)\n {\n getComponent().setIcon(image);\n invalidateSize();\n }", "public ImageIcon getIcon() {\n\t\tswitch (state[2]) {\n\t\tcase \" Sunny\":\n\t\t\treturn new ImageIcon(\"weatherIcons/sunny.png\");\n\t\tcase \" Cloudy\":\n\t\t\treturn new ImageIcon(\"weatherIcons/cloudy.png\");\n\t\tcase \" Light Clouds\":\n\t\t\treturn new ImageIcon(\"weatherIcons/light clouds.png\");\n\t\tcase \" Windy\":\n\t\t\treturn new ImageIcon(\"weatherIcons/windy.png\");\n\t\tcase \" Heavy Rain\":\n\t\t\treturn new ImageIcon(\"weatherIcons/heavy rain.png\");\n\t\tcase \" Light Rain Showers\":\n\t\t\treturn new ImageIcon(\"weatherIcons/rain showers_light rain.png\");\n\t\tcase \" Snow\":\n\t\t\treturn new ImageIcon(\"weatherIcons/snow.png\");\n\t\tcase \" Lightning\":\n\t\t\treturn new ImageIcon(\"weatherIcons/lightning.png\");\n\t\tdefault:\n\t\t\treturn new ImageIcon(\"weatherIcons/default.png\");\n\t\t}\n\t}", "protected void addImageIcon(String text, String token, ImageResource bigImage, ImageResource mobileImage, FlowPanel flowPanel, String tooltip) {\n if (MyWebApp.isSmallFormat()) {\n Image image = new Image(mobileImage);\n addImageIcon(token, text, image, flowPanel, tooltip);\n } else {\n Image image = new Image(bigImage);\n addImageIcon(token, text, image, flowPanel, tooltip);\n }\n }", "void setImageLocation(URL imageLocation) throws IOException;", "public void setIcon(URL icon)\r\n {\r\n\tthis.icon = icon;\r\n }", "private Bitmap loadImageFromNetwork(String url) {\n try {\n InputStream is = new DefaultHttpClient().execute(new HttpGet(url))\n .getEntity().getContent();\n return BitmapFactory.decodeStream(is);\n } catch (Exception e) {\n return null;\n }\n }", "protected Icon getIcon() {\n return getConnection().getIcon(getIconUri());\n }", "public void setImageUrl(String imageUrl) {\n this.imageUrl = imageUrl;\n }", "java.lang.String getGameIconUrl();", "public Builder setIcon(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n icon_ = value;\n onChanged();\n return this;\n }", "@VisibleForTesting\n public BitmapDrawable resolveImageInternal(Uri uri) throws IOException {\n return (BitmapDrawable) LocalImageResolver.resolveImage(uri, this.mContext);\n }", "private void setIcon(){\r\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"images.png\")));\r\n }", "public void setImg( String address, JLabel jlbl ) {\n jlbl.setIcon( new ImageIcon(address) );\n jlbl.setHorizontalAlignment( JLabel.CENTER );\n }" ]
[ "0.6511965", "0.63871145", "0.63694185", "0.63546586", "0.6306869", "0.6289228", "0.6254642", "0.6251884", "0.6241307", "0.6229475", "0.62224764", "0.6210267", "0.6141559", "0.60878754", "0.6077487", "0.6063464", "0.60597014", "0.60571474", "0.605364", "0.60493076", "0.6033192", "0.60060036", "0.60060036", "0.59696937", "0.59563637", "0.5947637", "0.59286886", "0.5921405", "0.59111226", "0.5910818", "0.5903068", "0.5899101", "0.5875404", "0.5860261", "0.5844948", "0.58292043", "0.58238727", "0.5817795", "0.580647", "0.5800537", "0.5770798", "0.5754828", "0.5754111", "0.57468754", "0.57406515", "0.57311106", "0.57273984", "0.57268596", "0.5718962", "0.5709566", "0.56984717", "0.56982404", "0.56943554", "0.5675331", "0.56740135", "0.56739914", "0.56691617", "0.5664874", "0.566423", "0.5663237", "0.5649237", "0.56486684", "0.5647223", "0.5642889", "0.5641963", "0.56407744", "0.56402427", "0.5620684", "0.56198806", "0.56029415", "0.56008625", "0.5600771", "0.56003606", "0.5589907", "0.5584788", "0.55837244", "0.5582711", "0.5571486", "0.55651903", "0.55644506", "0.5563921", "0.55637246", "0.55613744", "0.5541675", "0.5527735", "0.55217505", "0.5517924", "0.5508115", "0.54959965", "0.5495996", "0.5493503", "0.54846174", "0.5479232", "0.54787314", "0.5472192", "0.5468953", "0.5464794", "0.5464306", "0.5448303", "0.5447683", "0.54346883" ]
0.0
-1
get the nearest POI first
void getEstimationInsideBuilding( final Point userCPos, int travelMode, final int vehicleIcon ) { mActivity.getNearestLocationToTheUser( false, ( locations, error ) -> { if( error != null ) { if(error.code == MIError.INVALID_API_KEY){ MapsIndoorsUtils.showInvalidAPIKeyDialogue(getContext()); } mRouteEstimation = mOriginPositionText = null; resetRouteInfoView(); new Handler(mContext.getMainLooper()).post(() -> { noInternetBar.setState(NoInternetBar.MESSAGE_STATE); } ); } else { new Handler( mContext.getMainLooper() ).post( () -> { if( (locations != null) && (locations.size() > 0) ) { mLastRouteOriginLocation = locations.get( 0 ); // get the route estimation after getting the closest POI getRouteEstimation( mLastRouteOriginLocation, mLastRouteDestinationLocation, travelMode, routeEstimationText -> { if( routeEstimationText != null ) { mRouteEstimation = routeEstimationText.toString(); } else { // ... if not, set this guy to null so the route estimation string will fall and align // with the walk/drive icon mRouteEstimation = null; mOriginPositionText = null; } mOriginPositionText = String.format( getString( R.string.from_param ), mLastRouteOriginLocation.getName() ); if( mRouteEstimation != null ) { updateRouteInfoView( mRouteEstimation, mOriginPositionText, vehicleIcon ); } } ); } else { getEstimationOutsideBuilding( userCPos, travelMode, vehicleIcon ); } } ); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n private RangeInfo findNearestRangeInfo() {\n final int caretPosition = myView.getCaretPosition();\n\n for (final RangeInfo range : myRangeInfos) {\n if (range.isWithin(caretPosition)) {\n return range;\n }\n if (range.getFrom() > caretPosition) {\n return range; // Ranges are sorted, so we are on the next range. Take it, if caret is not within range\n }\n }\n\n return myRangeInfos.last();\n }", "private void findNewNearestPub() {\n \t\tevent.SetPubLocation(new PubLocation()/*new nearest found location*/);\n \t\tUpdateFromEvent();\n \t}", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "public Widget findOne(Point p) {\n // we need to deal with scaled points because of zoom feature\n Point2D.Double scaledPos = new Point2D.Double();\n scaledPos.x = (double)p.x;\n scaledPos.y = (double)p.y;\n if (zoomFactor > 1) // transforms are only needed in zoom mode\n inv_at.transform(scaledPos, scaledPos);\n Point2D.Double mappedPos = u.fromWinPoint(scaledPos);\n// System.out.println(\"findOne: Z=\" + zoomFactor + \" p=[\" + p.x + \",\" + p.y + \"] \" \n// + \" s=[\" + scaledPos.getX() + \",\" + scaledPos.getY() + \"]\"\n// + \" m=[\" + mappedPos.getX() + \",\" + mappedPos.getY() + \"]\");\n Widget ret = null;\n for (Widget w : widgets) {\n if (w.contains(mappedPos)) {\n// System.out.println(\"found: \" + w.getKey() + \" p= \" + p + w.getBounded());\n ret = w;\n }\n }\n return ret;\n }", "private PanImageEntry findPanImageEntryClosestToCenter() {\n\t\tfindProjectedZs();\n\t\t\n\t\tPanImageEntry closestEntry = null;\n\t\tfor (int n=0; n<panImageList.length; n++) {\n\t\t\tPanImageEntry entry = panImageList[n];\n\t\t\tif (entry.draw) {\n\t\t\t\tif (closestEntry == null) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ > closestEntry.projectedZ) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ == closestEntry.projectedZ) {\n\t\t\t\t\tif (isSuperiorImageCat(entry.imageListEntry.getImageCategory(), closestEntry.imageListEntry.getImageCategory())) {\n\t\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (selectedPanImageEntry != null) {\n\t\t\tdouble dAz = closestEntry.imageListEntry.getImageMetadataEntry().inst_az_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_az_rover;\n\t\t\tdouble dEl = closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover;\n\t\t\tif ((selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < -85.0 \n\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < 85.0)\n\t\t\t\t\t|| (selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85\n\t\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85)\t\n\t\t\t\t\t) {\n\t\t\t\t// this is a fix because the distance computation doesn't work right at high or low elevations...\n\t\t\t\t// in fact, the whole thing is pretty messed up\n\t\t\t\tclosestEntry = selectedPanImageEntry;\t\t\t\t\n\t\t\t}\n\t\t\telse if ((Math.abs(dAz) < selectTolerance) && (Math.abs(dEl) < selectTolerance)) {\n\t\t\t\tclosestEntry = selectedPanImageEntry;\n\t\t\t}\n\t\t}\n\t\treturn closestEntry;\n\t}", "public OsmPrimitive getNearest(Point p) {\n OsmPrimitive osm = getNearestNode(p);\n if (osm == null)\n {\n osm = getNearestWay(p);\n }\n return osm;\n }", "public Resource findNearestResource(){\n\t\tResource nearestResource = null;\n\t\tfloat distanceToCurrentResource = 0f;\n\t\tfor (Resource resource : MapData.getInstance().getResources()) {\n\t\t\tif(resource.isResourceMaxed()) continue;\n\t\t\tif (resource.getCenter().dst2(getCenter()) < 4000000) {\n\t\t\t\tif (nearestResource == null) {\n\t\t\t\t\tnearestResource = resource;\n\t\t\t\t\tdistanceToCurrentResource = nearestResource\n\t\t\t\t\t\t\t.getCenter().dst2(this.getCenter());\n\t\t\t\t} else {\n\t\t\t\t\tfloat distanceToNewResource = resource.getCenter()\n\t\t\t\t\t\t\t.dst2(this.getCenter());\n\t\t\t\t\tnearestResource = (distanceToNewResource < distanceToCurrentResource) ? resource\n\t\t\t\t\t\t\t: nearestResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestResource;\n\t}", "private GeoPoint getClosestPoint(List<GeoPoint> points, Ray ray) {\r\n\t\tGeoPoint close = points.get(0);\r\n\t\tdouble dist;\r\n\t\tfor (GeoPoint p : points) {\r\n\t\t\tdist = ray.get_p0().distance(p.point);\r\n\t\t\tif (dist < ray.get_p0().distance(close.point))\r\n\t\t\t\tclose = p;\r\n\t\t}\r\n\t\treturn close;\r\n\t}", "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "public Vector2 returnToNearestStockpile(Resource resource){\n\t\tif(myTownHall == null)\n\t\t\treturn new Vector2(0,0);\n\t\treturn myTownHall.getCenter();\n\t}", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "private Position getGoalItemPosition(Set<Item> items) {\n Vector closest = new Vector(0, 0);\n double distance = Double.MAX_VALUE;\n Iterator<Item> it = items.iterator();\n while (it.hasNext()) {\n Item item = it.next();\n Vector center = item.center();\n double currDistance = center.distance(player.center());\n if (currDistance < distance) {\n distance = currDistance;\n closest = center;\n goalItem = item;\n }\n }\n return new Position(closest.x, closest.y);\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "public PolytopeTriangle findClosest(){\n\t\t//OPTIMIZATION MOVE THIS TO THE ADD FUNCTION AND HAVE IT BE THE RETURN VALUE\n\t\tfloat maxDist = faces.get(0).getDistance();\n\t\tint index = 0;\n\t\tfor(int curIndex = 1; curIndex < faces.size(); curIndex++){\n\t\t\tfloat distance = faces.get(curIndex).getDistance();\n\t\t\tif(distance < maxDist){\n\t\t\t\tindex = curIndex;\n\t\t\t\tmaxDist = distance;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn faces.get(index);\n\t}", "private Point lowestFInOpen() {\n\t\tPoint lowestP = null;\n\t\tfor (Point p : openset) {\n\t\t\tif (lowestP == null) \n\t\t\t\tlowestP = p;\n\t\t\telse if (fscores.get(p) < fscores.get(lowestP))\n\t\t\t\tlowestP = p;\n\t\t}\n\t\treturn lowestP;\n\t}", "Position<T> first();", "private GeoPoint findClosestIntersection(Ray ray) {\r\n\t\tList<GeoPoint> temp = _scene.get_geometries().findIntersections(ray);\r\n\t\tif (temp == null)\r\n\t\t\treturn null;\r\n\t\treturn getClosestPoint(temp, ray);\r\n\t}", "private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }", "public void findNearestToMouse(Point2D position) throws NoninvertibleTransformException{\n //Take insets into account when using mouseCoordinates.\n Insets x = getInsets();\n position.setLocation(position.getX(), position.getY()-x.top + x.bottom);\n Point2D coordinates = transformPoint(position);\n Rectangle2D mouseBox = new Rectangle2D.Double(coordinates.getX()-0.005,\n coordinates.getY() -0.005,\n 0.01 , 0.01);\n Collection<MapData> streets = model.getVisibleStreets(mouseBox, false);\n streets.addAll(model.getVisibleBigRoads(mouseBox, false));\n filterRoads(streets); //remove all highways without names.\n\n\n nearestNeighbor = RouteFinder.findNearestHighway(coordinates, streets);\n repaint();\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "private GeoPoint findClosestIntersection(Ray ray) {\n if (ray == null) {\n return null;\n }\n GeoPoint closestPoint = null;\n double closestDistance = Double.MAX_VALUE;\n Point3D ray_p0 = ray.getPo();\n\n List<GeoPoint> intersections = scene.getGeometries().findGeoIntersections(ray);\n if (intersections == null)\n return null;\n\n for (GeoPoint geoPoint : intersections) {\n double distance = ray_p0.distance(geoPoint.getPoint());\n if (distance < closestDistance) {\n closestPoint = geoPoint;\n closestDistance = distance;\n }\n }\n return closestPoint;\n }", "public closest(){\n\t\tthis.pnt = null;\n\t}", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "private static Point getNearest(Collection<Point> centers, Point p) {\n\t\tdouble min = 0;\n\t\tPoint minPoint = null;\n\t\tfor(Point c : centers){\n\t\t\tif(minPoint == null || c.distance(p) < min){\n\t\t\t\tmin = c.distance(p);\n\t\t\t\tminPoint = c;\n\t\t\t}\n\t\t}\n\t\treturn minPoint;\n\t}", "public Point2D nearest(Point2D p) {\n return nearestHelper(root, new RectHV(0,0,1,1), p.x(), p.y(), null);\n }", "public Coordinates closestPoint() {\n return closestPoint;\n }", "public Collection<OsmPrimitive> getNearestCollection(Point p) {\n OsmPrimitive osm = getNearest(p);\n if (osm == null)\n return Collections.emptySet();\n return Collections.singleton(osm);\n }", "private Exemplar nearestExemplar(Instance inst){\n\n if (m_Exemplars == null)\n return null;\n Exemplar cur = m_Exemplars, nearest = m_Exemplars;\n double dist, smallestDist = cur.squaredDistance(inst);\n while (cur.next != null){\n cur = cur.next;\n dist = cur.squaredDistance(inst);\n if (dist < smallestDist){\n\tsmallestDist = dist;\n\tnearest = cur;\n }\n }\n return nearest;\n }", "public final Node getNearestNode(Point p) {\n double minDistanceSq = Double.MAX_VALUE;\n Node minPrimitive = null;\n for (Node n : getData().nodes) {\n if (n.deleted || n.incomplete)\n continue;\n Point sp = getPoint(n.eastNorth);\n double dist = p.distanceSq(sp);\n if (minDistanceSq > dist && dist < snapDistance) {\n minDistanceSq = p.distanceSq(sp);\n minPrimitive = n;\n }\n // prefer already selected node when multiple nodes on one point\n else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)\n {\n minPrimitive = n;\n }\n }\n return minPrimitive;\n }", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"p cannot be null\");\n if (isEmpty()) return null;\n Point2D champ = root.p;\n champ = nearest(p, champ, root, inftyBbox);\n return champ;\n }", "private Point findLeadingPt() {\n\t\tPoint2D.Double pt1 = new Point2D.Double(xs[0], ys[0]);\n\t\tPoint2D.Double pt2 = new Point2D.Double(xs[1], ys[1]);\n\t\tPoint2D.Double pt3 = new Point2D.Double(xs[2], ys[2]);\n\n\t\tPoint leadingPt = new Point((int) pt2.getX(), (int) pt2.getY());\n\t\tdouble smallestRadius = this.findRadiusFromChordAndPt(pt1, pt3, pt2);\n\n\t\tfor (int i = 2; i < xs.length - 1; i++) {\n\t\t\tPoint2D.Double ptA = new Point2D.Double(xs[i - 1], ys[i - 1]);\n\t\t\tPoint2D.Double ptC = new Point2D.Double(xs[i], ys[i]);\n\t\t\tPoint2D.Double ptB = new Point2D.Double(xs[i + 1], ys[i + 1]);\n\t\t\tif (smallestRadius > this.findRadiusFromChordAndPt(ptA, ptB, ptC)) {\n\t\t\t\tsmallestRadius = this.findRadiusFromChordAndPt(ptA, ptB, ptC);\n\t\t\t\tleadingPt = new Point((int) ptC.getX(), (int) ptC.getY());\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * double yArrow = Controller.flowArrow.findCenterOfMass().getY(); for (int i =\n\t\t * 0; i < xs.length; i++) { if (ys[i] == yArrow) { leadingPt = new Point((int)\n\t\t * xs[i], (int) ys[i]); } }\n\t\t */\n\t\treturn leadingPt;\n\t}", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "public FObj findNearestAncestorFObj() {\n FONode par = parent;\n while (par != null && !(par instanceof FObj)) {\n par = par.parent;\n }\n return (FObj) par;\n }", "public Point closestIntersectionToStartOfLine(Rectangle rect) {\r\n List<Point> list = rect.intersectionPoints(this);\r\n if (list.isEmpty()) {\r\n return null;\r\n // there is only one point in list\r\n } else if (list.size() == 1) {\r\n return list.get(0);\r\n // first point in list closer than the second one\r\n } else if (this.start.distance(list.get(0)) < this.start.distance(list.get(1))) {\r\n return list.get(0);\r\n // second point in list closer than the first one\r\n } else {\r\n return list.get(1);\r\n }\r\n }", "private GeoPoint findClosestIntersection(Ray ray)\r\n\t{\r\n\r\n\t\tif (ray == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tList<GeoPoint> intersections = scene.geometries.findGeoIntersections(ray);\r\n\t\treturn ray.findClosestGeoPoint(intersections);\r\n\t}", "public static Point searchNearestEgde(Rectangle bounds, Point first, Point next) {\n\n // One offset needed to avoid intersection with the wrong line.\n if (bounds.x + bounds.width <= first.x)\n first.x = bounds.x + bounds.width - 1;\n else if (bounds.x >= first.x) first.x = bounds.x + 1;\n\n if (bounds.y + bounds.height <= first.y)\n first.y = bounds.height + bounds.y - 1;\n else if (bounds.y >= first.y) first.y = bounds.y + 1;\n\n Line2D relationLine = new Line2D.Float(first.x, first.y, next.x, next.y);\n Line2D lineTop = new Line2D.Float(bounds.x, bounds.y, bounds.x\n + bounds.width, bounds.y);\n Line2D lineRight = new Line2D.Float(bounds.x + bounds.width, bounds.y,\n bounds.x + bounds.width, bounds.y + bounds.height);\n Line2D lineBottom = new Line2D.Float(bounds.x + bounds.width, bounds.y\n + bounds.height, bounds.x, bounds.y + bounds.height);\n Line2D lineLeft = new Line2D.Float(bounds.x, bounds.y + bounds.height,\n bounds.x, bounds.y);\n\n Point2D ptIntersectTop = ptIntersectsLines(relationLine, lineTop);\n Point2D ptIntersectRight = ptIntersectsLines(relationLine, lineRight);\n Point2D ptIntersectBottom = ptIntersectsLines(relationLine, lineBottom);\n Point2D ptIntersectLeft = ptIntersectsLines(relationLine, lineLeft);\n\n // line is to infinite, we must verify that the point find interst the\n // correct edge and the relation.\n int distTop = (int) lineTop.ptSegDist(ptIntersectTop)\n + (int) relationLine.ptSegDist(ptIntersectTop);\n int distRight = (int) lineRight.ptSegDist(ptIntersectRight)\n + (int) relationLine.ptSegDist(ptIntersectRight);\n int distBottom = (int) lineBottom.ptSegDist(ptIntersectBottom)\n + (int) relationLine.ptSegDist(ptIntersectBottom);\n int distLeft = (int) lineLeft.ptSegDist(ptIntersectLeft)\n + (int) relationLine.ptSegDist(ptIntersectLeft);\n\n if (ptIntersectTop != null && distTop == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectTop.getX()),\n (int) ptIntersectTop.getY());\n\n } else if (ptIntersectRight != null && distRight == 0) {\n return new Point((int) ptIntersectRight.getX(),\n RelationGrip.adjust((int) ptIntersectRight.getY()));\n\n } else if (ptIntersectBottom != null && distBottom == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectBottom.getX()),\n (int) ptIntersectBottom.getY());\n\n } else if (ptIntersectLeft != null && distLeft == 0) {\n return new Point((int) ptIntersectLeft.getX(),\n RelationGrip.adjust((int) ptIntersectLeft.getY()));\n\n } else {\n return null; // no point found!\n }\n }", "public Coordinates closestPointB() {\n return closestPointB;\n }", "public Point2D nearest(Point2D p) \n\t {\n\t\t if(p==null)\n\t\t\t throw new java.lang.NullPointerException();\n\t\t if(root == null)\n\t\t\t return null;\n\t\t RectHV rect = new RectHV(0,0,1,1);\n\t\t return nearest(root,p,root.p,rect,true);\n\t }", "public Point getMinPoint() {\r\n int minX = children.get(0).getShapeStartingPoint().getX();\r\n int minY = children.get(0).getShapeStartingPoint().getY();\r\n for(IShape shape: children) {\r\n if(minX > shape.getShapeStartingPoint().getX()) {\r\n minX = shape.getShapeStartingPoint().getX();\r\n }\r\n if(minY > shape.getShapeStartingPoint().getY()) {\r\n minY = shape.getShapeStartingPoint().getY();\r\n }\r\n }\r\n minPoint = new Point(minX,minY);\r\n return minPoint;\r\n }", "private Ship findWhichShip(Point p) {\n int row, col;\n for (Ship s : ships) {\n for (int i = 0; i < s.getShipSize(); i++) {\n row = s.getBodyLocationPoints()[i].x;\n col = s.getBodyLocationPoints()[i].y;\n if (row == p.x && col == p.y) {\n //Point head = s.getHeadCoordinatePoint();\n //touchingView = ivCell[head.x][head.y];\n Log.i(\"VIEW FOUND: \", \"!!!!!!!!!!!!!!!!\");\n return s;\n }\n }\n }\n return null;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new NullPointerException();\n Point2D champion = pointSet.first();\n if (champion == null) return null;\n \n for (Point2D point : pointSet) {\n if (point.distanceSquaredTo(p) < champion.distanceSquaredTo(p)) {\n champion = point;\n }\n }\n return champion;\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "private Outfit getBestWithJacket(double desired_clo) {\n Cursor jacketCursor = mOuterLoaderListener.getCursor();\n Outfit best_outfit = new Outfit();\n Outfit temp_top_bottom;\n Outfit temp_dress;\n double diff = Double.MAX_VALUE;\n double jacket_clo = 0;\n int result_jacket_position = 0;\n if (jacketCursor.moveToFirst()) {\n while (!jacketCursor.isAfterLast()) {\n jacket_clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n temp_top_bottom = getBestTopBottom(desired_clo - jacket_clo);\n temp_dress = getBestDress(desired_clo - jacket_clo);\n\n if (Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_top_bottom;\n }\n if (Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_dress;\n }\n\n jacketCursor.moveToNext();\n }\n\n if (!best_outfit.isEmpty() && jacketCursor.moveToPosition(result_jacket_position)) {\n byte[] imageByteArray = jacketCursor.getBlob(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_IMAGE));\n double clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n\n if (imageByteArray != null && imageByteArray.length > 0)\n {\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, BitmapFactory.decodeStream(imageStream), clo));\n } else {\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, null, clo));\n }\n }\n }\n return best_outfit;\n }", "public Set<? extends Position> findNearest(Position position, int k);", "private int calculateIndexOfClosestPoint(Position[] smoothedPath) {\n double[] distances = new double[smoothedPath.length];\n for (int i = 0/*lastClosestPointIndex*/; i < smoothedPath.length; i++) {\n distances[i] = Functions.Positions.subtract(smoothedPath[i], currentCoord).getMagnitude();\n }\n\n // calculates the index of value in the array with the smallest value and returns that index\n lastClosestPointIndex = Functions.calculateIndexOfSmallestValue(distances);\n return lastClosestPointIndex;\n }", "public Point getClosestPoint(Point p) {\n\t\t// If the node is not diveded and there are no points then we \n\t\t// cant return anything\n\t\tif (!divided && points.keySet().size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Loop through all the points and find the one that is the\n\t\t// closest to the point p\n\t\tdouble smallestDistance = Double.MAX_VALUE;\n\t\tPoint closest = null;\n\t\t\n\t\tfor (Point c : points.keySet()) {\n\t\t\tif (closest == null) {\n\t\t\t\tclosest = c;\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t} else if (p.distance(c) < smallestDistance) {\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t\tclosest = c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closest;\n\t}", "protected static Marker getLowestPoint(List<Marker> points) {\n\n Marker lowest = points.get(0);\n\n for(int i = 1; i < points.size(); i++) {\n\n Marker temp = points.get(i);\n\n if(temp.getPosition().latitude < lowest.getPosition().latitude || (temp.getPosition().latitude == lowest.getPosition().latitude && temp.getPosition().longitude < lowest.getPosition().longitude)) {\n lowest = temp;\n }\n }\n\n return lowest;\n }", "public Point2D nearest(Point2D p)\n {\n if (p != null && !isEmpty())\n {\n Node current = root;\n Node nearest = null;\n while (current != null)\n {\n nearest = current;\n if (current.isVertical()) // compare by x\n {\n if (p.x() < current.getPoint().x())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n else // compare by y\n {\n if (p.y() < current.getPoint().y())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n }\n return nearest.getPoint();\n }\n return null;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n if (root == null) return null;\n nearest = root.point;\n searchForNearest(root, p, new RectHV(0.0, 0.0, 1.0, 1.0));\n return nearest;\n }", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private InfoBundle searchClosestSpot(GpsPoint point) {\n\n\t\tSystem.out.println(\"searchClosestSpot\");\n\t\tList<Spot> spots = spotRepository.getClosestSpot(point.getLatitude(),point.getLongitude());\n\n\t\tdouble minDistance;\n\t\tLong minDistance_spotID;\n\t\t// Center GPS_plus object of the closest spot\n\t\tdouble minDistance_centerGPSdatalat;\n\t\tdouble minDistance_centerGPSdatalong;\n\t\t// indicates if the closest spot is in the range of point\n\t\tboolean inRange = false;\n\n\t\tif (spots != null && spots.size() != 0) {\n\t\t\tminDistance = GPSDataProcessor.calcDistance(spots.get(0).getLatitude(),spots.get(0).getLongitude(), point.getLatitude(), point.getLongitude());\n\t\t\tminDistance_centerGPSdatalat = spots.get(0).getLatitude();\n\t\t\tminDistance_centerGPSdatalong = spots.get(0).getLongitude();\n\t\t\tminDistance_spotID = spots.get(0).getSpotID();\n\n\t\t\tif (minDistance < Spot.stdRadius) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\t\t\tInfoBundle bundle = new InfoBundle(minDistance_spotID, minDistance_centerGPSdatalat, minDistance_centerGPSdatalong, inRange, minDistance);\n\t\t\tbundle.setSpot(spots.get(0));\n\t\t\treturn bundle;\n\t\t} else {\n\t\t\t// if there was no spot within the search\n\t\t\treturn null;\n\t\t}\n\t}", "public Location getNearest(Location src)\r\n {\r\n if(Main.ASSERT) Util.assertion(!src.inside(bl, tr));\r\n // cases: \r\n // 3 6 9 \r\n // 2 x 8\r\n // 1 4 7\r\n if(src.getX()<=bl.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return bl; // case 1\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tl; // case 3\r\n }\r\n else\r\n {\r\n return new Location.Location2D(bl.getX(), src.getY()); // case 2\r\n }\r\n }\r\n else if(src.getX()>=tr.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return br; // case 7\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tr; // case 9\r\n }\r\n else\r\n {\r\n return new Location.Location2D(tr.getX(), src.getY()); // case 8\r\n }\r\n }\r\n else\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return new Location.Location2D(src.getX(), bl.getY()); // case 4\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return new Location.Location2D(src.getX(), tr.getY()); // case 6\r\n }\r\n else\r\n {\r\n throw new RuntimeException(\"get nearest undefined for internal point\");\r\n }\r\n }\r\n }", "private PointDist findNearest(Node curr, RectHV rect, PointDist minP, boolean Isx) {\n double currDist;\n PointDist p1;\n PointDist p2;\n // double currDist = findNearP.distanceSquaredTo(curr.point);\n /*\n if (currDist < pointDist.dist)\n minP = new PointDist(curr.point, currDist);\n else\n minP = pointDist;\n\n */\n if (Isx) {\n if (curr.left != null) {\n RectHV leftRect = new RectHV(rect.xmin(), rect.ymin(), curr.point.x(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.left.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.left.point, currDist);\n if (minP.dist > leftRect.distanceSquaredTo(findNearP)) {\n p1 = findNearest(curr.left, leftRect, minP, false);\n if (p1 != null)\n if (p1.dist < minP.dist)\n minP = p1;\n }\n }\n if (curr.right != null) {\n RectHV rightRect = new RectHV(curr.point.x(), rect.ymin(), rect.xmax(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.right.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.right.point, currDist);\n if (minP.dist > rightRect.distanceSquaredTo(findNearP)) {\n p2 = findNearest(curr.right, rightRect, minP, false);\n if (p2 != null)\n if (p2.dist < minP.dist)\n minP = p2;\n }\n }\n }\n else {\n if (curr.left != null) {\n RectHV leftRect = new RectHV(rect.xmin(), rect.ymin(), rect.xmax(), curr.point.y());\n currDist = findNearP.distanceSquaredTo(curr.left.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.left.point, currDist);\n if (minP.dist > leftRect.distanceSquaredTo(findNearP)) {\n p1 = findNearest(curr.left, leftRect, minP, true);\n if (p1 != null)\n if (p1.dist < minP.dist)\n minP = p1;\n }\n }\n if (curr.right != null) {\n RectHV rightRect = new RectHV(rect.xmin(), curr.point.y(), rect.xmax(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.right.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.right.point, currDist);\n if (minP.dist > rightRect.distanceSquaredTo(findNearP)) {\n p2 = findNearest(curr.right, rightRect, minP, true);\n if (p2 != null)\n if (p2.dist < minP.dist)\n minP = p2;\n }\n }\n }\n return minP;\n }", "private Point findFront(Point[] points) {\n\t\t// Loop through the passed points.\n\t\tdouble[] dists = new double[3];\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Get outer-loop point.\n\t\t\tPoint a = points[i];\n\t\t\t\n\t\t\t// Loop through rest of points.\n\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t// Continue if current outer.\n\t\t\t\tif (i == k) continue;\n\t\t\t\t\n\t\t\t\t// Get inner-loop point.\n\t\t\t\tPoint b = points[k];\n\t\t\t\t\n\t\t\t\t// Add distance between out and inner.\n\t\t\t\tdists[i] += Math.sqrt(\n\t\t\t\t\tMath.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Prepare index and largest holder.\n\t\tint index = 0;\n\t\tdouble largest = 0;\n\t\t\n\t\t// Loop through the found distances.\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Skip if dist is lower than largest.\n\t\t\tif (dists[i] < largest) continue;\n\t\t\t\n\t\t\t// Save the index and largest value.\n\t\t\tindex = i;\n\t\t\tlargest = dists[i];\n\t\t}\n\t\t\n\t\t// Return the largest point index.\n\t\treturn points[index];\n\t}", "private Point getClosestPoint(Point[] mapPoints, Point newPoint) {\n for (int i = 0; i < mapPoints.length; i++) {\n if (ShortestPath.distance(newPoint, mapPoints[i]) < 30) {\n newPoint.x = mapPoints[i].x + 10;\n newPoint.y = mapPoints[i].y + 10;\n return newPoint;\n }\n }\n return null;\n }", "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 GPoint getFirstPoint() {\n return(point1);\n }", "private Map<Geometry, Point3D> getClosestPoint(Map<Geometry, List<Point3D>> intersectionPoints) {\n\n double distance = Double.MAX_VALUE;\n Map<Geometry, Point3D> closestPoint = new HashMap<Geometry, Point3D>();\n Point3D P0 = _scene.getCamera().getP0();\n Map.Entry<Geometry, List<Point3D>> entry;\n Iterator<Entry<Geometry, List<Point3D>>> it = intersectionPoints.entrySet().iterator();\n while (it.hasNext())\n {\n entry = it.next();\n for (Point3D point: intersectionPoints.get(entry.getKey())) {\n if (P0.distance(point) < distance) {\n closestPoint = new HashMap<Geometry, Point3D>();\n closestPoint.put(entry.getKey(), point);\n distance = P0.distance(point);\n }\n }\n }\n return closestPoint;\n }", "public Point2D nearest(Point2D p) {\n if (root == null) {\n return null;\n }\n\n currentNearest = root.p;\n currentMinDistance = root.p.distanceTo(p);\n nearest(root, p, ORIENTATION_VERTICAL);\n return currentNearest;\n }", "protected Coordinates intersectionFromClosestPoints() {\n if (closestPointA != null && closestPointB != null\n && geometry.almostEqual(closestPointA, closestPointB)) {\n return closestPointA;\n } else {\n return null;\n }\n }", "public DecimalPosition getNearestPoint(DecimalPosition point) {\n // Fist check end point\n int endXCorrection = width() > 0 ? 1 : 0;\n int endYCorrection = height() > 0 ? 1 : 0;\n\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.sub(endXCorrection, endYCorrection));\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY() - endYCorrection);\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX() - endXCorrection, start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX() - endXCorrection, point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY() - endYCorrection);\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle. Point: \" + point + \" rectangel: \" + this);\n }", "private Exemplar nearestExemplar(Instance inst, double c){\n\n if (m_ExemplarsByClass[(int) c] == null)\n return null;\n Exemplar cur = m_ExemplarsByClass[(int) c], nearest = m_ExemplarsByClass[(int) c];\n double dist, smallestDist = cur.squaredDistance(inst);\n while (cur.nextWithClass != null){\n cur = cur.nextWithClass;\n dist = cur.squaredDistance(inst);\n if (dist < smallestDist){\n\tsmallestDist = dist;\n\tnearest = cur;\n }\n }\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n\t\tRectHV rect = new RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);\n\t\treturn nearest(root, p, rect, true);\n\t}", "public Point2D nearest(Point2D p) {\n\t\tif (p == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (isEmpty()) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tPoint2D result = null;\n\t\t\tresult = nearest(root, p, result);\n\t\t\treturn result;\n\t\t}\n\t}", "public Coordinates closestPointA() {\n return closestPointA;\n }", "private static PizzaModel getCheapest(ArrayList<PizzaModel> pizzaGroup){\n\t\tPizzaModel cheapestPizza = pizzaGroup.get(0);\n\t\tfor(PizzaModel p : pizzaGroup){\n\t\t\tif(p.getPrice()<= cheapestPizza.getPrice())\n\t\t\t\tcheapestPizza = p;\n\t\t}\n\t\treturn cheapestPizza;\n\t}", "public IPoint getFirstPoint()\n {\n Object[] verticesArray = this.getVertices().toArray();\n IPoint firstPoint = (IPoint)verticesArray[0];\n\n return firstPoint;\n }", "private <T extends Element> T getNearestElement(Element element, Class<T> klass) {\n List elements = element.nearestDescendants(klass);\n if (elements == null || elements.isEmpty()) {\n return null;\n }\n\n return (T) elements.get(0);\n }", "@Nullable\n private static RoutePoint findClosestRoutePoint(BingItineraryItem currentItem, List<RoutePoint> routePoints) {\n\n double pointLat = currentItem.getManeuverPoint().getCoordinates()[0];\n double pointLng = currentItem.getManeuverPoint().getCoordinates()[1];\n\n GeoPoint point = new GeoPoint(pointLat, pointLng);\n\n RoutePoint closestPoint = null;\n double closestDist = Double.MAX_VALUE;\n\n for (RoutePoint rp : routePoints) {\n double currentDist = point.sphericalDistance(rp.getGeoPoint());\n\n if (currentDist < closestDist) {\n if (rp.getStreetName().isEmpty() && rp.getInstruction().isEmpty()) {\n closestDist = currentDist;\n closestPoint = rp;\n }\n }\n }\n return closestPoint;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n return nearestSub(p, root);\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) return null;\n\n Point2D nearestPoint = null;\n double distance = Double.NEGATIVE_INFINITY;\n for (Point2D point : points) {\n if (nearestPoint == null) {\n nearestPoint = point;\n distance = point.distanceSquaredTo(p);\n } else {\n double newDistance = point.distanceSquaredTo(p);\n if (newDistance < distance) {\n nearestPoint = point;\n distance = newDistance;\n }\n }\n }\n return nearestPoint;\n }", "Execution getClosestDistance();", "public DecimalPosition getNearestPointInclusive(DecimalPosition point) {\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.copy());\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY());\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX(), start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX(), point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY());\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle\");\n }", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "static ReadShellPreference nearest() {\n return NEAREST;\n }", "public Balloon acquireTarget() {\r\n\r\n\t\tBalloon closest = null;\r\n\t\tfloat closestDistance = 1000;\r\n\t\tif (balloons != null) {\r\n\t\t\tfor (Balloon balloons : balloons) {\r\n\t\t\t\tif (isInRange(balloons) && findDistance(balloons) < closestDistance && balloons.getHiddenHealth() > 0) {\r\n\t\t\t\t\tclosestDistance = findDistance(balloons);\r\n\t\t\t\t\tclosest = balloons;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (closest != null) {\r\n\t\t\t\ttargeted = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closest;\r\n\r\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"nearest: Point2D is null\");\n mindist = Double.POSITIVE_INFINITY;\n nearestSearch(p, root);\n return nearest;\n }", "private Point calcLocation(String tagID){\t\t\t\n\t\tDate now = new Date();\n\t\tclass referenceDist implements Comparable<referenceDist>{\n\t\t\tString referenceID;\n\t\t\tDouble inverseDistance;\n\t\t\t\n\t\t\tpublic referenceDist(String id, double distance){\n\t\t\t\tthis.referenceID = id;\n\t\t\t\tthis.inverseDistance = new Double(distance);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int compareTo(referenceDist o) {\n\t\t\t\t\n\t\t\t\treturn o.inverseDistance.compareTo(this.inverseDistance);\n\t\t\t}\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tArrayList<referenceDist> referenceList = new ArrayList<referenceDist>();\t\t\n\t\tfor (int i = 0 ; i < (referenceTags.size()); i++){\n\t\t\tString referenceID = referenceTags.get(i);\n\t\t\t//System.err.printf(\"Comparing tag %s with readings: %s\\r\\n\", tagID, tags.get(tagID).toString());\n\t\t\tint distance = tags.get(tagID).calcDiff(tags.get(referenceID));\n\t\t\t//System.err.printf(\"Reference tag %s with readings: %s\\r\\n\", referenceID, tags.get(referenceID).toString());\n\t\t\tdouble power = 0;\n\t\t\tif (distance == 0){\n\t\t\t\tpower = 10;\n\t\t\t} else {\n\t\t\t\tpower = 1.0/distance;\n\t\t\t}\n\t\t\t\n\t\t\treferenceList.add(new referenceDist(referenceID, power));\n\t\t}\n\t\t\n\t\tCollections.sort(referenceList);\n//\t\tIterator<referenceDist> iter = referenceList.iterator();\n//\t\tSystem.out.printf(\"START\\r\\n\");\n//\t\twhile(iter.hasNext()){\n//\t\t\treferenceDist dist = iter.next();\n//\t\t System.out.printf(\"'%s : %s'\", dist.referenceID, dist.inverseDistance.toString());\n//\t\t}\n//\t\tSystem.out.printf(\"\\r\\nEND\\r\\n\");\n\t\tint neighbours = Math.min(maxNeighbours, referenceList.size());\n\t\tdouble total = 0;\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble diff = 0;\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\ttotal += referenceList.get(i).inverseDistance;\n\t\t}\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\tPoint current = tags.get(referenceList.get(i).referenceID).getLoc();\n\t\t\tx += (referenceList.get(i).inverseDistance / total) * current.getX();\n\t\t\ty += (referenceList.get(i).inverseDistance / total) * current.getY();\n\t\t}\n\t\tif (tagID.equals(\"03BD\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-200),2));\n\t\t} else if (tagID.equals(\"03B8\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-300),2));\n\t\t} else if (tagID.equals(\"03D3\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-400),2));\n\t\t}\n\t\tlog(String.valueOf(diff)+ \"\\r\\n\", tagID+ \"_4.log\");\t\t\n\t\t\t\n\n\t\tPoint location = new Point((int )x, (int)y);\n\t\tlog(String.valueOf(now.getTime()) + \"\\r\\n\", \"time.log\");\t\t\t\n\n\t//\tlog(String.valueOf(now.getTime()) + \": Tag=\"+ tagID + \" x=\" + String.valueOf(x) + \" y=\"+String.valueOf(y)+\"\\r\\n\", \"tagLocationLogfile.log\");\n\t\t\n\t\treturn location;\n\t}", "protected MappedPosition nearestMappedCoordinate(DirectPosition dp,\r\n List <MappedPosition> vertices) {\r\n DirectPosition2D x = new DirectPosition2D(dp);\r\n\r\n // Assert.isTrue(vectors.size() > 0);\r\n MappedPosition nearestOne = (MappedPosition) vertices.get(0);\r\n\r\n for (Iterator <MappedPosition> i = vertices.iterator(); i.hasNext();) {\r\n MappedPosition candidate = (MappedPosition) i.next();\r\n\r\n if (((DirectPosition2D) candidate.getSource()).distance(\r\n x.toPoint2D()) < ((DirectPosition2D) nearestOne\r\n .getSource()).distance(x.toPoint2D())) {\r\n nearestOne = candidate;\r\n }\r\n }\r\n\r\n return nearestOne;\r\n }", "private Base findNearestBase(Toroidal2DPhysics space, Ship ship) {\n\t\tdouble minDistance = Double.MAX_VALUE;\n\t\tBase nearestBase = null;\n\n\t\tfor (Base base : space.getBases()) {\n\t\t\tif (base.getTeamName().equalsIgnoreCase(ship.getTeamName())) {\n\t\t\t\tdouble dist = space.findShortestDistance(ship.getPosition(), base.getPosition());\n\t\t\t\tif (dist < minDistance) {\n\t\t\t\t\tminDistance = dist;\n\t\t\t\t\tnearestBase = base;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestBase;\n\t}", "public BeyondarObject getNearestARObject(List<BeyondarObject> list)\n {\n int nearestDistance = 10000;\n BeyondarObject nearest = null;\n for (BeyondarObject beyondarObject : list) {\n if (beyondarObject.getDistanceFromUser() < nearestDistance) {\n nearestDistance = (int) beyondarObject.getDistanceFromUser();\n nearest = beyondarObject;\n }\n }\n return nearest;\n }", "synchronized protected int findNearestPoint(final int x_p, final int y_p, final long layer_id) {\n \t\tint index = -1;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (layer_id != p_layer[i]) continue;\n \t\t\tdouble sq_dist = Math.pow(p[0][i] - x_p, 2) + Math.pow(p[1][i] - y_p, 2);\n \t\t\tif (sq_dist < min_dist) {\n \t\t\t\tindex = i;\n \t\t\t\tmin_dist = sq_dist;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "private static MapLocation getBestPastrLocNearMeBasedOnCowGrowthRate() {\n\t\tif (Clock.getRoundNum() < 1) {\n\t\t\tallCowGrowths = rc.senseCowGrowth();\t\t\t\n\t\t}\n\t\tMapLocation bestLocation = new MapLocation(curLoc.x, curLoc.y);\n\t\tdouble cowGrowthAmount = 0;\n\t\tMapLocation enemyHQLocation = rc.senseEnemyHQLocation();\n\t\tdouble distanceToEnemyHQ = curLoc.distanceSquaredTo(enemyHQLocation);\n\t\tfor (int i = 15; i-- > 0;) {\n\t\t\tfor (int j = 15; j-- > 0;) {\n\t\t\t\t// Check that it's in bounds\n\t\t\t\tif (curLoc.x - i + 8 >= 0 && curLoc.x - i + 8 < rc.getMapWidth() &&\n\t\t\t\t\tcurLoc.y - j + 8 >= 0 && curLoc.y - j + 8 < rc.getMapHeight()) {\n\t\t\t\t\tMapLocation mapLoc = new MapLocation(curLoc.x - i + 8, curLoc.y - j + 8);\n\t\t\t\t\tdouble currentLocGrowth = allCowGrowths[curLoc.x - i + 8][curLoc.y - j + 8];\n\n\t\t\t\t\t// Check that it's behind a perpendicular line and not void\n\t\t\t\t\t// and choose the best point.\n\t\t\t\t\tif (mapLoc.distanceSquaredTo(enemyHQLocation) < distanceToEnemyHQ &&\n\t\t\t\t\t\tcurrentLocGrowth > cowGrowthAmount && rc.senseTerrainTile(mapLoc) != TerrainTile.VOID) {\n\t\t\t\t\t\tcowGrowthAmount = currentLocGrowth;\n\t\t\t\t\t\tbestLocation = mapLoc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bestLocation;\n\t}", "private Point backtrack(Point p){\n\t\t// coordinates of the point\n\t\tint x = (int)p.getX();\n\t\tint y = (int)p.getY();\n\t\t// neigh hold the return value\n\t\tPoint neigh= p;\n\t\t// the lowest score\n\t\tint score=10000;\n\t\t// look at all the neighbor and compare them\n\t\tif(x>0\t && topology[x-1][y]>=0){\n\t\t\tscore = topology[x-1][y];\n\t\t\tneigh = new Point(x-1,y);\n\t\t}\n\t\tif(x<row-1 && topology[x+1][y]>=0 && score > topology[x+1][y]) {\n\t\t\tscore = topology[x+1][y];\n\t\t\tneigh = new Point(x+1,y);\n\t\t}\n\t\tif(y<col-1 && topology[x][y+1]>=0 && score > topology[x][y+1]) {\n\t\t\tscore = topology[x][y+1];\n\t\t\tneigh = new Point(x,y+1);\n\t\t}\n\t\tif(y>0 && topology[x][y-1]>=0 && score > topology[x][y-1]) {\n\t\t\tscore = topology[x][y-1];\n\t\t\tneigh = new Point(x,y-1);\n\t\t}\n\t\treturn neigh;\n\t}", "@Override\n public SquareTile getClosestTile(Point pos, float scale) {\n // The current best tile\n int bestDist = Integer.MAX_VALUE;\n SquareTile best = null;\n\n for (SquareTile tile : tiles) {\n int dist = pos.distance(tile.getPixelCenterLocation(scale));\n\n // Check if this tile is closer\n if (best == null || dist < bestDist) {\n // Update the best tile\n best = tile;\n bestDist = dist;\n }\n }\n\n return best;\n }", "public Point2D nearest(Point2D p) {\n if (p == null)\n throw new IllegalArgumentException(\"Input point is null\");\n if (root == null)\n return null;\n findNearP = p;\n double dist = findNearP.distanceSquaredTo(root.point);\n RectHV rect = new RectHV(0, 0, 1, 1);\n PointDist res = findNearest(root, rect, new PointDist(root.point, dist), true);\n return res.point;\n }", "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "public Position findWeedPosition() {\n int x = 0;\n int y = 0;\n int sum = 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 (!(sum==0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n x = i;\n y = j;\n sum = tmpSum;\n }\n }\n else {\n x = i;\n y = j;\n sum = tmpX + tmpY;\n\n }\n }\n }\n\n }\n }\n return new Position(x,y);\n }", "public GJPoint2D firstPoint() {\n\t\tif (this.segments.isEmpty()) \n\t\t\treturn null;\n\t\treturn this.segments.get(0).controlPoints()[0];\n\t}", "@Override\n public Note getLowest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentLow = new Note(this.low.getDuration(), this.low.getOctave(),\n this.low.getStartMeasure(), this.low.getPitch(), this.low\n .getIsHead(), this.low.getInstrument(), this.low.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentLow.compareTo(n) == 1) {\n currentLow = n;\n }\n }\n }\n return currentLow;\n }", "@Override\n public ITile getClosestTile(int x, int y) {\n return getClosestTile(new Point(x, y), getTileSize());\n }", "@Override\r\n\t@Basic\r\n\tpublic Point getPositionOfSquare(Square square) {\r\n\t\tfor (Map.Entry<Point, Square> e : squares.entrySet()) {\r\n\t\t\tif (e.getValue() == square)\r\n\t\t\t\treturn e.getKey();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Point getPoint(final Point otherPoint)\n\t\t{\n\n\t\t\t//to get the edge point on the shape\n\t\t\tif(shape.equals(\"poly\") || shape.equals(\"ellipse\"))\n\t\t\t\treturn getCentrePoint();\n\n\t\t\tfinal Point cp = getCentrePoint();\n\t\t\tfinal int rise = otherPoint.y-cp.y;\n\t\t\tfinal int run = otherPoint.x-cp.x;\n\n\t\t\tif(shape.equals(\"rect\"))\n\t\t\t{\n\t\t\t\tif(rise == 0)\n\t\t\t\t{\n\t\t\t\t\tif(otherPoint.x >= cp.x)\n\t\t\t\t\t\treturn new Point(coords[0]+coords[2]+4,coords[1]+(coords[3]/2));\n\t\t\t\t\treturn new Point(coords[0]-2,coords[1]+(coords[3]/2));\n\t\t\t\t}\n\t\t\t\telse if(run == 0)\n\t\t\t\t{\n\t\t\t\t\tif(otherPoint.y >= cp.y)\n\t\t\t\t\t\treturn new Point(coords[0]+(coords[2]/2),coords[1]+coords[3]+4);\n\t\t\t\t\treturn new Point(coords[0]+(coords[2]/2),coords[1]-2);\n\t\t\t\t}else\n\t\t\t\t{\n\n\t\t\t\t\tfinal double m = (double)rise / (double)run;\n\t\t\t\t\tfinal double mx = (double)run / (double)rise;\n\n\t\t\t\t\tif(otherPoint.x >= cp.x && otherPoint.y >= cp.y)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]+coords[2]+4,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]+coords[3]+4);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\n\t\t\t\t\t}else if(otherPoint.x < cp.x && otherPoint.y >= cp.y)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(-1*m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]-2,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]+coords[3]+4);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}else if(otherPoint.x < cp.x)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(-1*m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]-2,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(-1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]-2);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]+coords[2]+4,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(-1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]-2);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}else if(shape.equals(\"circle\"))\n\t\t\t{\n\t\t\t\tif(rise != 0 && run != 0)\n\t\t\t\t{\n\t\t\t\t\tfinal double ratio = (coords[2] / Math.sqrt(rise*rise+run*run));\n\n\t\t\t\t\treturn new Point(cp.x+(int)(run*ratio),cp.y+(int)(rise*ratio));\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tif(rise == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(run > 0)\n\t\t\t\t\t\t\treturn new Point(cp.x+coords[2],cp.y);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn new Point(cp.x-coords[2],cp.y);\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tif(rise > 0)\n\t\t\t\t\t\t\treturn new Point(cp.x,cp.y+coords[2]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn new Point(cp.x,cp.y-coords[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t\t//return cp;\n\t\t}", "public Point2D nearest(Point2D p) {\n checkNull(p);\n Node n = nearest(p, root);\n if (n == null) return null;\n return n.p;\n }", "public GeoPoint findClosestGeoPoint(List<GeoPoint> geoPointsList) {\n /**\n * the near point\n */\n GeoPoint result = null;\n /**\n * initialize with a big number that we sure it will change\n */\n double closestDistance = Double.MAX_VALUE;\n\n /**\n * if the point equals to null, it`s mean there\n * is no point that close to it\n */\n if (geoPointsList == null) {\n return null;\n }\n\n for (GeoPoint geo : geoPointsList) {\n double temp = geo.point.distance(_p0);\n if (temp < closestDistance) {\n closestDistance = temp;\n result = geo;\n }\n }\n\n return result;\n }", "private Point[] nearestPointInArray(Point[] strip){\n\t\tint j = 1; // with each point we measure the distance with the following 6 point's\n\t\tPoint[] currentMinPoints = {strip[0],strip[1]};\n\t\tdouble currentMinDistance = Distance(currentMinPoints[0], currentMinPoints[1]);\n\t\tdouble currentDistance;\t\n\t\tfor (int i=0; i< strip.length; i++){\n\t\t\twhile (j<8 && i+j < strip.length){\n\t\t\t\tcurrentDistance = Distance(strip[i], strip[i+j]);\n\t\t\t\tif (currentDistance<currentMinDistance){\n\t\t\t\t\tcurrentMinDistance = currentDistance;\n\t\t\t\t\tcurrentMinPoints[0] = strip[i];\n\t\t\t\t\tcurrentMinPoints[1] = strip[i+j];\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tj=1;\n\t\t}\n\t\treturn currentMinPoints;\n\t}", "public String getNearestStreet() {\n String nearestStreet = \"null\";\n CollisionResults results = new CollisionResults();\n float closestDistance = 101f;\n for(float xDir = -1; xDir <= 1; xDir += .1f) {\n for(float yDir = -1; yDir <= 1; yDir += .1f) {\n for(float zDir = -1; zDir <= 1; zDir += .1f) { \n Ray ray = new Ray(loc, new Vector3f(xDir, yDir, zDir));\n world.collideWith(ray, results);\n for (int i = 0; i < results.size(); i++) {\n float dist = results.getCollision(i).getDistance();\n String name = results.getCollision(i).getGeometry().getParent().getName();\n if (name.startsWith(\"R_\") && dist <= 100 && dist < closestDistance) {\n nearestStreet = name;\n closestDistance = dist;\n }\n }\n }\n }\n }\n\n return nearestStreet;\n \n }" ]
[ "0.6063461", "0.6057029", "0.6033414", "0.6018435", "0.594036", "0.59371424", "0.5908212", "0.5876973", "0.58619225", "0.58610564", "0.5844603", "0.58385056", "0.5834802", "0.5708434", "0.5702156", "0.56957644", "0.5664954", "0.5657184", "0.56485", "0.56451404", "0.5640021", "0.5635676", "0.56310874", "0.56189317", "0.561711", "0.560734", "0.55912226", "0.55870616", "0.5585191", "0.55700856", "0.5563916", "0.55624497", "0.5560779", "0.555117", "0.55463994", "0.5538546", "0.55337036", "0.5529906", "0.55277133", "0.5510925", "0.5506891", "0.55050397", "0.54998696", "0.54991156", "0.54827476", "0.5474381", "0.5471227", "0.54602695", "0.5457571", "0.54526865", "0.5447657", "0.54465175", "0.5434333", "0.54303575", "0.54244083", "0.54229355", "0.5422332", "0.5419236", "0.541634", "0.5407303", "0.53953946", "0.53867894", "0.53836566", "0.5381233", "0.53710055", "0.5364785", "0.53641737", "0.5352571", "0.53508186", "0.5339643", "0.5333754", "0.5331142", "0.53268355", "0.53201", "0.5317422", "0.53062177", "0.52928734", "0.52832353", "0.5274493", "0.5272981", "0.52663076", "0.5244265", "0.5242327", "0.52366805", "0.5229592", "0.5227672", "0.52272934", "0.5226339", "0.5224972", "0.52231514", "0.521955", "0.5212522", "0.5205233", "0.5203814", "0.5200441", "0.51985365", "0.5194965", "0.5188166", "0.51783574", "0.51720554", "0.5170613" ]
0.0
-1
Adds the remaining number from builder if there is one
private void addRemainingNumber(List<String> elements, StringBuilder numberBuilder) { if (numberBuilder.length() != 0) elements.add(numberBuilder.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }", "public void addNumber(int number) {\n totalNumber += number;\n availableNumber += number;\n }", "private void increaseNum() {\n String preStr = pre.getText().toString();\n String number = num.getText().toString();\n String increase = inc.getText().toString();\n if (preStr.isEmpty() || number.isEmpty() || increase.isEmpty())\n {\n Toast.makeText(this, \"Complete required data\", Toast.LENGTH_SHORT).show();\n }\n else if (number.startsWith(\"0\") ||number.startsWith(\"+\"))\n {\n Toast.makeText(this, \"Please don't put prefixes in Numbers field\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n // generate the numbers and store them\n numbers = new ArrayList<>();\n for (int i = 0; i < Integer.parseInt(increase); i++)\n {\n Long numN = i + Long.parseLong(number);\n numbers.add(preStr + numN);\n }\n Intent intent = new Intent(MainActivity.this, SMSender.class);\n startActivity(intent);\n\n\n }\n\n }", "private void increaseOneToQuantity() {\n String previousValueString = mQuantityEditText.getText().toString();\n int previousValue;\n if (previousValueString.isEmpty() || previousValueString.equals(\"0\")) {\n return;\n }\n else {\n previousValue = Integer.parseInt(previousValueString);\n mQuantityEditText.setText(String.valueOf(previousValue + 1));\n }\n }", "public int getRemaining(){\n\t\treturn count+1;\n\t}", "private static List<Integer> addOnePlus(List<Integer> input) {\n\n\t\tint size = input.size();\n\t\tinput.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && input.get(i)==10; i--) {\n\t\t\tinput.set(i, 0);\n\t\t\tinput.set(i-1, input.get(i-1)+1);\n\t\t}\n\n\t\tif(input.get(0) == 10) {\n\t\t\tinput.set(0, 0);\n\t\t\tinput.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn input;//this modifies the original input\n\t}", "public void addLength(int num) {\r\n this.length += num;\r\n }", "public void offer(int num){\n if(tail == fixedSize - 1) {\n List<Object> newList = new ArrayList<>();\n newList.add(num);\n //save next new list at tail\n tailList.add(newList);\n tailList = (List<Object>) tailList.get(tail);\n tail = 0;\n }else{ //not in last index,then directly add it;\n tailList.add(num);\n }\n count++;\n tail++;\n }", "public Builder addItem(int value) {\n ensureItemIsMutable();\n item_.addInt(value);\n onChanged();\n return this;\n }", "private void addTwoNumbers() {\n\t\t\n\t}", "public void addQuantity()\n {\n int quantity = Integer.parseInt(quantityTextField.getText());\n quantity++;\n quantityTextField.setText(\"\" + quantity);\n\n changeSubtotalTextField();\n }", "private SparkplugBPayloadBuilder addBdSeqNum(SparkplugBPayloadBuilder payload) throws Exception {\n\t\tif (payload == null) {\n\t\t\tpayload = new SparkplugBPayloadBuilder();\n\t\t}\n\t\tif (bdSeq == 256) {\n\t\t\tbdSeq = 0;\n\t\t}\n\t\tpayload.addMetric(new MetricBuilder(\"bdSeq\", Int64, (long) bdSeq).createMetric());\n\t\tbdSeq++;\n\t\treturn payload;\n\t}", "protected void add() {\n\t\tfinal float previous = value;\n\t\tvalue = Math.min(max, value + incrementStep);\n\n\t\tif (value != previous) {\n\t\t\tupdateAndAlertListener();\n\t\t}\n\n\t\treturn;\n\t}", "private void grow(){\n\t\tberries.replaceAll((p, v) -> v + 1);\n\t\tapples.replaceAll((p, v) -> v + 1);\n\t}", "private int plusOne(int i) {\n return (i + 1) % capacity;\n }", "protected void increment(View view){\r\n\r\n if (quantity==99){\r\n return;\r\n }\r\n quantity++;\r\n display(quantity);\r\n }", "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}", "public Builder addBlockNums(int value) {\n ensureBlockNumsIsMutable();\n blockNums_.add(value);\n onChanged();\n return this;\n }", "public Builder addBlockNums(int value) {\n ensureBlockNumsIsMutable();\n blockNums_.add(value);\n onChanged();\n return this;\n }", "public void addToBill(int newBill){\n Bill = Bill + newBill;\n }", "public void add()\n {\n set(++ current);\n }", "public Builder clearNumber() {\n \n number_ = getDefaultInstance().getNumber();\n onChanged();\n return this;\n }", "@Override\n public void addNumbers() {\n calculator.add(2, 2);\n }", "public Builder clearNumber() {\n\n\t\t\t\t\tnumber_ = getDefaultInstance().getNumber();\n\t\t\t\t\tonChanged();\n\t\t\t\t\treturn this;\n\t\t\t\t}", "public Builder clearNumber() {\n bitField0_ = (bitField0_ & ~0x00000001);\n number_ = getDefaultInstance().getNumber();\n onChanged();\n return this;\n }", "public void increment(View view) {\n if (quantity == 100){\n return;\n }\n quantity = quantity + 1;\n displayQuantity(quantity);\n }", "private void subtractOneToQuantity() {\n String previousValueString = mQuantityEditText.getText().toString();\n int previousValue;\n if (previousValueString.isEmpty() || previousValueString.equals(\"0\")) {\n return;\n }\n else {\n previousValue = Integer.parseInt(previousValueString);\n mQuantityEditText.setText(String.valueOf(previousValue - 1));\n }\n }", "public Builder addBlockNumbers(int value) {\n ensureBlockNumbersIsMutable();\n blockNumbers_.add(value);\n onChanged();\n return this;\n }", "public void increament(View view) {\n if(!(quantity>=100)) {\n quantity++;\n display(quantity);\n }\n }", "public void increment(View view) {\n if(quantity ==100) {\n Toast.makeText(this, \"You cannot have more than 100 cups of coffee\", Toast.LENGTH_SHORT).show();\n return;\n }\n quantity = quantity + 1;\n displayQuantity(quantity);\n }", "public void add1(View view) {\n num+=1;\n n.setText(\"\"+num);\n }", "@NonNull\n public BasketItemBuilder incrementQuantity() {\n this.quantity++;\n return this;\n }", "public void increment(View view) {\n if(quantity==100) {\n // Show an error message as a toast\n Toast.makeText(this, \"You cannot have more than a 100 coffees\", Toast.LENGTH_SHORT).show();\n //Exit this method early because there is nothing left to do\n return;\n }\n quantity=quantity+1;\n displayQuantity(quantity);\n\n }", "private void addMsg(\n Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(builderForValue.build());\n }", "private void addMsg(\n Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(builderForValue.build());\n }", "@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}", "public Builder addItems(int value) {\n ensureItemsIsMutable();\n items_.add(value);\n onChanged();\n return this;\n }", "@Override\r\n\tpublic int add() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int increase() throws Exception {\n\t\treturn 0;\r\n\t}", "public void addTotalNumberOfCombinations(int nr);", "public void increaseQuantity (View view){\n if(quantity == 100){\n Toast.makeText(this, \"You cannot order more than 100 coffee\", Toast.LENGTH_SHORT).show();\n return;\n }\n quantity = quantity + 1;\n displayQuantity(quantity);\n }", "public void add(){\n contador += 100;\n }", "private static List<Integer> addOne(List<Integer> input) {\n\n\t\tList<Integer> copy = new ArrayList<>();\n\t\tcopy.addAll(input);\n\n\t\tint size = copy.size();\n\t\tcopy.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && copy.get(i)==10; i--) {\n\t\t\tcopy.set(i, 0);\n\t\t\tcopy.set(i-1, copy.get(i-1)+1);\n\t\t}\n\n\t\tif(copy.get(0) == 10) {\n\t\t\tcopy.set(0, 0);\n\t\t\tcopy.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn copy;//this NOT modifies the original input\n\t}", "@Override\n\tpublic void add(int n) {\n\t\tvalues[size] = n; //add value to the list\n\t\tsize++; //increment size\n\t\tif (size == values.length){ //if the list is full expand it\n\t\t\tresize();\n\t\t}\n\t}", "public void increment(View view) {\n if(quantity == 100){\n Toast t = Toast.makeText(this, \"You cannot have more than 100 coffees\", Toast.LENGTH_LONG);\n t.show();\n return;\n }\n\n quantity = quantity + 1;\n displayQuantity(quantity);\n }", "public Builder addActAmount(\n frame.socket.common.proto.Login.ActAmount.Builder builderForValue) {\n if (actAmountBuilder_ == null) {\n ensureActAmountIsMutable();\n actAmount_.add(builderForValue.build());\n onChanged();\n } else {\n actAmountBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "public StringBuilder add(StringBuilder m, StringBuilder n)\n {\n \n int carryover=0 , sum=0;\n StringBuilder result=new StringBuilder();\n if(m.length()>=n.length())\n {\n n=align(n,m.length());\n }\n else{\n m=align(m,n.length());\n }\n \n String temp1=new String();\n String temp2=new String();\n for (int i=m.length()-1;i>=0;i--) {\n \n \n temp1=temp1+m.charAt(i);\n temp2=temp2+n.charAt(i);\n sum=Integer.parseInt(temp1)+Integer.parseInt(temp2)+carryover;\n //sum=(int) m.charAt(i)+(int)n.charAt(i)+carryover;\n if (sum>=10)\n {\n carryover=1;\n sum=sum-10;\n result.insert(0,sum);\n temp1=\"\";\n temp2=\"\";\n }\n else{\n carryover=0;\n result.insert(0,sum);\n temp1=\"\";\n temp2=\"\";\n } \n }\n if (carryover==1) {\n result.insert(0,carryover);\n }\n //int value=Integer.parseInt(result.toString());\n //result.delete(0,result.length());\n //result.append(value);\n //if (result.length()<m.length())\n // result=align(result,m);\n \n return result;\n \n }", "public void increment(View view) {\n String msg = getString(R.string.too_many_message);\n\n if(quantity < 100){\n quantity++;\n } else{\n Toast.makeText(this, msg, Toast.LENGTH_SHORT)\n .show();\n }\n displayQuantity(quantity);\n }", "public void add (int value) {\r\n\t\ttotal = total + value;\r\n\t\thistory = history + \" + \" + value;\r\n\t}", "public Builder addData(int value) {\n ensureDataIsMutable();\n data_.add(value);\n onChanged();\n return this;\n }", "public void addUnreadMessageNumber() {\n this.mUnreadMessageNum++;\n }", "public void increment(View view) {\n if (quantity == 15) {\n // Show an error message as a toast\n Toast.makeText(this, \"You cannot have more than 15 coffees\", Toast.LENGTH_SHORT).show();\n // Exit this method early because there's nothing left to do\n return;\n }\n quantity = quantity + 1;\n displayQuantity(quantity);\n }", "public void showNextNumber(){\r\n int maximumNumberToDisplay = 1000;\r\n this.numberToDisplay++;\r\n resetIfNecessary(maximumNumberToDisplay);\r\n }", "public void plus(View view) {\n liter++;\n botol();\n }", "void increase();", "void increase();", "public void add1() {\r\n value++;\r\n }", "private void addRequests(\n RequestFromSelf.Builder builderForValue) {\n ensureRequestsIsMutable();\n requests_.add(builderForValue.build());\n }", "void testAppend(Tester t) {\n t.checkExpect(ints1.length(), 1);\n t.checkExpect(ints2.length(), 2);\n t.checkExpect(ints3.length(), 2);\n\n ints1.append(ints2);\n\n t.checkExpect(ints1.length(), 3);\n\n ints2.append(ints3);\n\n t.checkExpect(ints1.length(), 5);\n ints2.append(ints4);\n\n t.checkExpect(ints2.length(), 6);\n\n ints4.append(ints4);\n\n // will be infinite\n // t.checkExpect(ints4.length(), -1);\n }", "public int getNewNumber() {\r\n int num;\r\n num=unusedLockers.get(0);\r\n unusedLockers.remove(0);\r\n return num;\r\n }", "@Override\r\n\tpublic int numCurrentsToAdd() {\n\t\treturn 2;\r\n\t}", "public void appendNumber(String number){\n if(currentExp.startsWith(\"0\")&&number.equals(\"0\")&&currentExp.length()==1){\n calculationResult.onExpressionChange(currentExp,true);\n }\n else{\n if(currentExp.length()<=16){\n currentExp += number;\n calculationResult.onExpressionChange(currentExp,true);\n if(count>0){\n performCalculation();\n }\n }\n else{\n calculationResult.onExpressionChange(\"Expression is too long\",false);\n }\n }\n\n }", "private int grabANewNumberForTest() {\n clockPanel.updateTestClock(testNumbersList);\n if (testNumbersList.size() == 0) {\n testOver();\n }\n return testNumbersList.remove((int)(Math.random()*testNumbersList.size()));\n }", "void add(int value) {\n size++;\n\n int[] newItems = new int[size];\n\n System.arraycopy(items, 0, newItems, 0, items.length);\n\n newItems[newItems.length - 1] = value;\n\n items = newItems;\n }", "public frame.socket.common.proto.Login.ActAmount.Builder addActAmountBuilder() {\n return getActAmountFieldBuilder().addBuilder(\n frame.socket.common.proto.Login.ActAmount.getDefaultInstance());\n }", "public boolean increaseBuildings() {\r\n\t\tif ((this.buildings + 1) <= TOTAL_BUILDINGS) {\r\n\t\t\tthis.buildings = this.buildings + 1;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void add (int value) {\n\t\ttotal = total + value;\n\n\t\thistory = history + \" + \" + value;\n\t\t\n\t}", "public Builder clearNum1() {\r\n\t\t\t\tbitField0_ = (bitField0_ & ~0x00000002);\r\n\t\t\t\tnum1_ = 0;\r\n\t\t\t\tonChanged();\r\n\t\t\t\treturn this;\r\n\t\t\t}", "public int incNummerOfMissing() {\n\t\t\treturn numberOfMissings++;\n\t\t}", "public void increment(View view) {\n if(quantity < 100)\n quantity++;\n displayQuantity(quantity);\n }", "public void addDigit(int addMe){\n //Handle the case of user enter digits for the first time\n if (clearFlag){\n output.setText(\"\");\n }\n \n if (isLeft){\n left = (left*10) + addMe;\n output.setText(output.getText() + addMe);\n output.setToolTipText(\"\" + left);\n }\n else{\n right = (right*10) + addMe;\n output.setText(output.getText() + addMe);\n }\n }", "public void refreshQueueCount(){\n queueCountLabel.setText(\"Count: \" + String.valueOf(builder.size()));\n }", "public void addNumbers (View view) {\n errorTrap();\n double sum = Double.parseDouble(num1.getText().toString()) + Double.parseDouble(num1.getText().toString());\n result.setText(\"SUM: \"+sum);\n }", "void add (int value) {\n array[fillLength] = value;\n fillLength++;\n for (int i = fillLength - 1; i > 0; i--) {\n if (array[i - 1] > array[i]) {\n int tempHolder = array[i];\n array[i] = array[i - 1];\n array[i - 1] = tempHolder;\n } else {\n break;\n }\n }\n }", "private void updateQuantity(int number) {\n Log.d(\"Method\", \"updateQuantity()\");\n coffeeCount += number;\n if (coffeeCount < getResources().getInteger(R.integer.min_coffee)) {\n Log.w(\"\", \"coffeeCount < minimum coffee order. Resetting to \" + getResources().getInteger(R.integer.min_coffee) + \".\");\n coffeeCount = getResources().getInteger(R.integer.min_coffee);\n } else if ((coffeeCount > getResources().getInteger(R.integer.high_coffee_count)) && (!quantityAlert)) {\n Log.i(\"\", \"Alerting user about a high coffee count order.\");\n displayMessage(getResources().getString(R.string.high_coffee_message));\n quantityAlert = true;\n } else if (coffeeCount > getResources().getInteger(R.integer.max_coffee)) {\n Log.w(\"\", \"coffeeCount > maximum coffee order. Resetting to \" + getResources().getInteger(R.integer.max_coffee) + \".\");\n coffeeCount = getResources().getInteger(R.integer.max_coffee);\n displayMessage(getResources().getString(R.string.max_coffee_message));\n }\n displayQuantity();\n }", "public org.hl7.fhir.Integer addNewQuantity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Integer target = null;\n target = (org.hl7.fhir.Integer)get_store().add_element_user(QUANTITY$10);\n return target;\n }\n }", "public void setGrowIncrement(int inc) { growInc = inc; }", "private MessageAddMoney(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Builder addItem(\n io.opencannabis.schema.commerce.OrderItem.Item.Builder builderForValue) {\n if (itemBuilder_ == null) {\n ensureItemIsMutable();\n item_.add(builderForValue.build());\n onChanged();\n } else {\n itemBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "CbaTinyInt(Builder builder) {\n super(builder);\n clearField();\n }", "public void addJackpot(int amount){\n this.amount += amount;\n }", "public Builder addReault(\n int index, com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult.Builder builderForValue) {\n if (reaultBuilder_ == null) {\n ensureReaultIsMutable();\n reault_.add(index, builderForValue.build());\n onChanged();\n } else {\n reaultBuilder_.addMessage(index, builderForValue.build());\n }\n return this;\n }", "public void addCount()\n {\n \tcount++;\n }", "@Override\r\n\tpublic int addNo(int a, int b) {\n\t\treturn a+b;\r\n\t}", "public void add(int kn) {\n\t\tif(this.size > this.N-1) {\n\t\t\tsetNDouble(N);\n\t\t}\n//\t\tSystem.out.println(this.n + \" \" + this.size);\n\t\tarray[this.size] = kn;\n\t\tthis.size++;\n\t}", "public Builder addPhone(com.demo.springprotobuff.Demoproto.Student.PhoneNumber.Builder builderForValue) {\n\t\t\t\tif (phoneBuilder_ == null) {\n\t\t\t\t\tensurePhoneIsMutable();\n\t\t\t\t\tphone_.add(builderForValue.build());\n\t\t\t\t\tonChanged();\n\t\t\t\t} else {\n\t\t\t\t\tphoneBuilder_.addMessage(builderForValue.build());\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}", "public void setOneNewWanted () {\r\n numWanted ++;\r\n }", "public void increment(View view) {\n if (quantity < 100) {\n quantity = quantity + 1;\n display(quantity);\n } else {\n Log.i(\"MainActivity\", \"Please select less than one hundred cups of coffee\");\n Context context = getApplicationContext();\n String lowerLimitToast = getString(R.string.too_much_pizza);\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, lowerLimitToast, duration);\n toast.show();\n return;\n }\n }", "public void counterAddup(){\n\t\tfor (int i=0; i<window.size(); i++){\n\t\t\tif ( window.get(i).acked == false ){\n\t\t\t\twindow.get(i).counter = window.get(i).counter+1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn ;\n\t}", "private void addMsg(\n int index, Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(index, builderForValue.build());\n }", "private void addMsg(\n int index, Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(index, builderForValue.build());\n }", "void overflowDigits() {\n for (int i = 0; i < preDigits.length(); i++) {\n char digit = preDigits.charAt(i);\n // This could be implemented with a modulo, but compared to the main\n // loop this code is too quick to measure.\n if (digit == '9') {\n preDigits.setCharAt(i, '0');\n } else {\n preDigits.setCharAt(i, (char)(digit + 1));\n }\n }\n }", "public static long incrementRequestN(long existing, long toAdd) {\n long l = existing + toAdd;\n return l < 0 ? Long.MAX_VALUE : l;\n }", "public void anadir(int num){\n\t\tcantidad+=num;\n\t}", "public Builder addPhone(\n cb.Careerbuilder.Company.PhoneNumber.Builder builderForValue) {\n if (phoneBuilder_ == null) {\n ensurePhoneIsMutable();\n phone_.add(builderForValue.build());\n onChanged();\n } else {\n phoneBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "void add(int val);", "public boolean hasMore() {\n return numLeft.compareTo(BigInteger.ZERO) == 1;\n }", "public void addValue() {\n addValue(1);\n }" ]
[ "0.596097", "0.59580946", "0.58244765", "0.5634626", "0.555166", "0.5546625", "0.5483858", "0.5457774", "0.5417046", "0.54146165", "0.5397819", "0.5375124", "0.5352293", "0.5349286", "0.5343796", "0.53384405", "0.5333822", "0.53258365", "0.53258365", "0.5302838", "0.5291822", "0.5289325", "0.5274589", "0.5255356", "0.52347106", "0.521674", "0.52140564", "0.5203584", "0.5195477", "0.5167706", "0.5157867", "0.5156784", "0.51551676", "0.51528555", "0.51528555", "0.5145219", "0.5145219", "0.5145219", "0.5142568", "0.51391655", "0.5137987", "0.51192194", "0.5106938", "0.51064694", "0.5103217", "0.5097849", "0.5095927", "0.5094871", "0.5091471", "0.50896186", "0.50511485", "0.5048712", "0.50435203", "0.504341", "0.5042756", "0.50351185", "0.503189", "0.503189", "0.5031747", "0.5027973", "0.50226474", "0.50136095", "0.5010667", "0.50078964", "0.50061774", "0.49867013", "0.49731126", "0.4970465", "0.49675447", "0.4967356", "0.49586785", "0.49566713", "0.4953", "0.4952994", "0.4951169", "0.4950968", "0.49280378", "0.4926428", "0.49197757", "0.4917645", "0.49165842", "0.4907758", "0.4906825", "0.49062103", "0.49052656", "0.48998484", "0.48921347", "0.48818856", "0.48745877", "0.4870853", "0.48694837", "0.48684028", "0.48684028", "0.4867125", "0.48670492", "0.48667008", "0.4864062", "0.48571923", "0.4849186", "0.48480302" ]
0.7208027
0
No filtering by sourcesystem in this service so this test is obsolete.
@Override public void testCreateRequestListSomeFilteredBySourceSystem(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void testCreateRequestListAllFilteredBySourceSystem(){\n }", "@Override\n public void getMosSource(String testTest, ArrayList<String> source) {\n\n }", "@Test\n\tpublic void testSingleSourceSelect() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query_singleSource01.rq\", \"/tests/basic/query_singleSource01.srx\", false);\n\t}", "@Test\n public void filter() {\n\n }", "@Test\r\n public void testAssemblyFilter()\r\n {\r\n TestSuiteFilterAssembler assembler = new TestSuiteFilterAssembler();\r\n Collection<String> requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0025\");\r\n assembler.setRequirementsFilter(requirements);\r\n\r\n TestSuiteFilter<FlowStep> filter = assembler.assemblyFilter();\r\n TestSuite<TestCase<FlowStep>> newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 9, newSuite.getTestCases().size());\r\n\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 15, newSuite.getTestCases().size());\r\n\r\n requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(newSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 6, newSuite.getTestCases().size());\r\n }", "@Test\n public void eventFilterTest() {\n // TODO: test eventFilter\n }", "@Override\n public boolean shouldFilter() {\n return true;\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "public void setSource(String source) {\r\n this.source = source;\r\n }", "private FilterByAllCompiler() {\n }", "@Test(dataProvider = \"goodInputVcfs\")\n public void testFsFiltering(final File input) throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs13303033\", \"rs28548431\", \"rs2799066\");\n final File out = testFiltering(input, \".vcf.gz\", 0, 0, 0, 5.0d);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "private CanonizeSource() {}", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n _source = source;\n }", "public FilterSource[] getFilterSources();", "@Override\n\tpublic boolean shouldFilter() {\n\t\treturn true;\n\t}", "public void setSourceId(String source) {\n this.sourceId = sourceId;\n }", "@Test\n\tpublic void testFilteredRequest() {\n\n\t\tHttpRepublisher testerRepublisher = PowerMockito.spy(republisher);\n\t\ttesterRepublisher.setPathFilter(\"^/api.*\");\n\t\tWhitebox.setInternalState(testerRepublisher, ExecutorService.class, executorMock);\n\t\t//force API to not match pattern\n\t\tInvokedRequestDetails dummyRequestDetails = new InvokedRequestDetails(\"/notAPI\", httpRequest, httpHeaders,\n\t\t\t\t\"dummyBody\", false);\n\n\t\twhen(actionedRequest.getRequest()).thenReturn(dummyRequestDetails);\n\t\ttesterRepublisher.submitRequest(actionedRequest);\n\t\t//it should never get onto executor\n\t\tverify(actionedRequest,times(1)).setIgnored();\n\n\t}", "@Test\n\tpublic void testSingleSourceConstruct() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query_singleSource02.rq\", \"/tests/basic/query_singleSource02.ttl\", false);\n\t}", "public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }", "public void setSourceSite(String newsource) {\n sourceSite=newsource;\n }", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "@Test\n @DisplayName(\"Test Filtering of the properties field with no admin privileges\")\n void testFilterPrivilegedFields() throws Exception {\n logger.info(\"Testing filtering of properties field with no admin privileges\");\n\n replaceConfiguration(RESOURCE_DIR\n + \"/exporter/rest_filter_jdbc_privileged.yaml\",\n \"wls_datasource_state%7Bname%3D%22TestDataSource%22%7D%5B15s%5D\",\n \"Running, Suspended, Shutdown, Overloaded, Unknown\", \"TestDataSource\");\n }", "@Override\n public void checkSourcesParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "@Override\n public void checkSourcesParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "@Override\n\tpublic void filterChange() {\n\t\t\n\t}", "@Override\n public void filter(Filter arg0) throws NoTestsRemainException {\n super.filter(getCustomFilter());\n }", "@Test\n public void testDpFilteringToVcf() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs71509448\", \"rs71628926\", \"rs13302979\", \"rs2710876\");\n final File out = testFiltering(INPUT, \".vcf\", 0, 18, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "boolean hasSource();", "@DISPID(-2147412069)\n @PropGet\n java.lang.Object onfilterchange();", "public void setSourceName(java.lang.String param) {\r\n localSourceNameTracker = param != null;\r\n\r\n this.localSourceName = param;\r\n }", "@Test\n\tpublic void testGetDriverExcludeAllocations(){ \n\t\tassertNotNull(driverService.getDriverExcludeAllocations(239537L)); \n\t}", "@Test\n\tpublic void testBooleanTrueSingleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "public void setSource(String source);", "@Test\n public void getLatestScanResults_projectWithoutScans() {\n testMissingResultsCase(\"common-client-test-02-no-scans\");\n }", "protected Filter getFilter() {\n/* 631 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "SourceBuilder createService();", "boolean doFilter() { return false; }", "@Test\n\tpublic void shouldNotReturnResultForServicesEastFilteredByDocumentType()\n\t{\n\t\tlogin(USER_MARK_RIVERS_RUSTIC_HW_COM);\n\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getPagedDocumentsForUnit(\"Services East\",\n\t\t\t\tcreatePageableData(0, 10, StringUtils.EMPTY), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createTypeCriteriaObject(UNKNOWN, StringUtils.EMPTY, FILTER_BY_DOCUMENT_TYPE)));\n\n\t\tTestCase.assertEquals(0, result.getResults().size());\n\t}", "@Test\n public void testDpFiltering() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs71509448\", \"rs71628926\", \"rs13302979\", \"rs2710876\");\n final File out = testFiltering(INPUT, \".vcf.gz\", 0, 18, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "@LargeTest\n public void testBWFilter() {\n TestAction ta = new TestAction(TestName.BW_FILTER);\n runTest(ta, TestName.BW_FILTER.name());\n }", "@Test\n public void testSearchFilter() {\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n \n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"(samaccountname=*)\");\n \n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n \n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "public interface Source {\n\n /**\n * Set the system identifier for this Source.\n * <p>\n * The system identifier is optional if the source does not get its data\n * from a URL, but it may still be useful to provide one. The application\n * can use a system identifier, for example, to resolve relative URIs and to\n * include in error messages and warnings.\n * </p>\n *\n * @param systemId\n * The system identifier as a URL string.\n */\n public void setSystemId(String systemId);\n\n /**\n * Get the system identifier that was set with setSystemId.\n *\n * @return The system identifier that was set with setSystemId, or null if\n * setSystemId was not called.\n */\n public String getSystemId();\n}", "@Override\n protected void mergeBuildBase_Filters( BuildBase target, BuildBase source, boolean sourceDominant,\n Map<Object, Object> context )\n {\n List<String> src = source.getFilters();\n if ( !src.isEmpty() )\n {\n List<String> tgt = target.getFilters();\n Set<String> excludes = new LinkedHashSet<String>( tgt );\n List<String> merged = new ArrayList<String>( tgt.size() + src.size() );\n merged.addAll( tgt );\n for ( String s : src )\n {\n if ( !excludes.contains( s ) )\n {\n merged.add( s );\n }\n }\n target.setFilters( merged );\n }\n }", "public LSPSource[] getSources () {\r\n return sources;\r\n }", "@Override\npublic void setup(TableRefFilterContext context) {\n\t\n}", "private ServiceList serviceSetup()\n {\n SIManager simgr = sm.createSIManager();\n ServiceList services = simgr.filterServices(new ServiceFilter()\n {\n public boolean accept(Service service)\n {\n return !(service instanceof AbstractService);\n }\n });\n try\n {\n services = services.sortByNumber();\n }\n catch (SortNotAvailableException ex)\n {\n // don't sort then\n }\n\n // Check to see if there are arguments\n // If length of one, then sourceID was specified\n // If length of three, then freq/prognum/modformat was specified\n if (args.length == 1)\n {\n String sid = args[0];\n if (args[0].startsWith(\"0x\")) sid = sid.substring(2, sid.length());\n try\n {\n int sourceID = Integer.parseInt(sid, 16);\n OcapLocator[] locs = { new OcapLocator(sourceID) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"SourceID is not in the correct format\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n if (args.length == 3)\n {\n try\n {\n int freq = Integer.parseInt(args[0]);\n int prog = Integer.parseInt(args[1]);\n int mod = Integer.parseInt(args[2]);\n OcapLocator[] locs = { new OcapLocator(freq, prog, mod) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"Freq/prognum/modformat values are not valid\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n\n return services;\n }", "public void setSource (String source);", "public void setSourceDB(String sourceDB) {\n this.sourceDB = sourceDB;\n }", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "@Test\n public void testAbFiltering() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"tf2\", \"rs28566954\", \"rs28548431\");\n final File out = testFiltering(INPUT, \".vcf.gz\", 0.4, 0, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "@Test\r\n public void testAssemblyFilterWithSimilarityFilter()\r\n {\r\n TestSuiteFilterAssembler assembler = new TestSuiteFilterAssembler();\r\n Collection<String> requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0025\");\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n\r\n TestSuiteFilter<FlowStep> filter = null;\r\n TestSuite<TestCase<FlowStep>> newSuite = null;\r\n\r\n try\r\n {\r\n for (int i = 0; i <= 100; i++)\r\n {\r\n assembler.setSimilarityFilter((double) i);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n double expected = Math.round(0.15 * i);\r\n Assert.assertEquals(\"Wrong number of test cases.\", expected, (double) newSuite\r\n .getTestCases().size());\r\n }\r\n }\r\n catch (InvalidSimilarityException e)\r\n {\r\n e.printStackTrace();\r\n Assert.fail(\"An invalid similarity was set.\");\r\n }\r\n\r\n try\r\n {\r\n assembler.setSimilarityFilter(-35.00);\r\n Assert.fail(\"The assembler has accepted an invalid similarity.\");\r\n }\r\n catch (InvalidSimilarityException e)\r\n {\r\n Assert.assertTrue(\"The similarity set was successfully rejected.\", true);\r\n }\r\n }", "public boolean shouldFilter() {\n return true;\n }", "public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }", "public String[] getAllSources() {\n return this.sourceList.toArray(new String[0]);\n }", "boolean isSource();", "public MeasurementEnvironmentDefinition filter(MeasurementEnvironmentDefinition source) {\r\n\t\tdouble metering = Metering.start();\r\n\r\n\t\tParameterNamespace root = recursive(source.getRoot());\r\n\r\n\t\tMeasurementEnvironmentDefinition filteredDefinition = new MeasurementEnvironmentDefinition();\r\n\t\tfilteredDefinition.setRoot(root);\r\n\r\n\t\tMetering.stop(metering);\r\n\t\treturn filteredDefinition;\r\n\t}", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "@Test\n public void testSearchFilter_WithAddedSearchBase() {\n BridgeRequest request = new BridgeRequest();\n\n // Add the fields\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n fields.add(\"sn\");\n request.setFields(fields);\n\n // Set the Structure\n // This gets appended to the filter as (objectClass=STRUCTURE)\n request.setStructure(\"User\");\n\n // Set the Query\n request.setQuery(\"OU=Users(<%=parameter[\\\"Search String\\\"]%>)\");\n\n // Set the Parameters to be replaced in the Query\n Map parameters = new HashMap();\n parameters.put(\"Search String\", \"samaccountname=mary.olowu\");\n request.setParameters(parameters);\n\n BridgeError unexpectedError = null;\n RecordList list = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n\n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "private ProductFilterUtils(){}", "@Test(dataProvider = \"goodInputVcfs\")\n public void testNoFiltering(final File input) throws Exception {\n final File out = testFiltering(input, \".vcf.gz\", 0, 0, 0, Double.MAX_VALUE);\n final VCFFileReader in = new VCFFileReader(out, false);\n for (final VariantContext ctx : in) {\n if (!ctx.filtersWereApplied() || ctx.isFiltered()) {\n Assert.fail(\"Context should not have been filtered: \" + ctx.toString());\n }\n }\n in.close();\n }", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "public abstract String getDefaultFilter ();", "@SneakyThrows\n protected void addSourceResource() {\n if (databaseType instanceof MySQLDatabaseType) {\n try (Connection connection = DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl(\"\"), \"root\", \"root\")) {\n connection.createStatement().execute(\"USE sharding_db\");\n addSourceResource0(connection);\n }\n } else {\n Properties queryProps = ScalingCaseHelper.getPostgreSQLQueryProperties();\n try (Connection connection = DriverManager.getConnection(JDBC_URL_APPENDER.appendQueryProperties(getComposedContainer().getProxyJdbcUrl(\"sharding_db\"), queryProps), \"root\", \"root\")) {\n addSourceResource0(connection);\n }\n }\n List<Map<String, Object>> resources = queryForListWithLog(\"SHOW DATABASE RESOURCES FROM sharding_db\");\n assertThat(resources.size(), is(2));\n }", "@Test\n public void testSearchFilter_WithoutQuery() {\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n\n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"\");\n\n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n\n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "public GroupsOnlySenseFilter() {\n \n }", "@Test\n\tpublic void testFilteredRequestIsExecuted() {\n\n\t\tHttpRepublisher testerRepublisher = PowerMockito.spy(republisher);\n\t\ttesterRepublisher.setPathFilter(\"^/api.*\");\n\t\tWhitebox.setInternalState(testerRepublisher, ExecutorService.class, executorMock);\n\t\t//force API to not match pattern\n\t\tInvokedRequestDetails dummyRequestDetails = new InvokedRequestDetails(\"/api\", httpRequest, httpHeaders,\n\t\t\t\t\"dummyBody\", false);\n\n\t\twhen(actionedRequest.getRequest()).thenReturn(dummyRequestDetails);\n\t\ttesterRepublisher.submitRequest(actionedRequest);\n\t\tverify(executorMock).submit(republisherWorkerCaptor.capture());\n\n\t\tHttpRepublisherWorker resultWorker = republisherWorkerCaptor.getValue();\n\t\tHttpRepublisher publisher = Whitebox.getInternalState(resultWorker, HttpRepublisher.class);\n\t\tActionedRequestDetails requestDetails = Whitebox.getInternalState(resultWorker, ActionedRequestDetails.class);\n\n\t\tassertEquals(actionedRequest, requestDetails);\n\t\tassertEquals(publisher, testerRepublisher);\n\n\t}", "@Test\npublic void testFilter() throws Exception { \n//TODO: Test goes here... \n/* \ntry { \n Method method = VirtualCoinCtrl.getClass().getMethod(\"filter\", VirtualCoin.class, VirtualCoinAddReq.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/ \n}", "public String askDepFilter();", "@Override\n\tpublic List<FilghtDetails> searchFlightBySourceInUser(String source) {\n\t\tArrayList<FilghtDetails> sl = new ArrayList<FilghtDetails>();\n\t\tfor (int i = 0; i <= Repository.FLIGHT_DETAILS.size() - 1; i++) {\n\t\t\tFilghtDetails rf = Repository.FLIGHT_DETAILS.get(i);\n\t\t\tString rfs = rf.getSource();\n\t\t\tif (source.equalsIgnoreCase(rfs)) {\n\t\t\t\tsl.add(rf);\n\t\t\t}\n\t\t}\n\t\tif (sl.size() == 0) {\n\t\t\tthrow new AirlineException(\"Flight not found\");\n\t\t} else {\n\t\t\treturn sl;\n\t\t}\n\t}", "public static String buildTypeSourceWhereFilter() {\n PDCOptionData pcOptions = PDCOptionData.getInstance();\n StringBuilder buffer = new StringBuilder();\n String returnValue = null;\n\n for (int i = 0; i < pcOptions.getTypeSourceChosenList().size(); i++) {\n buffer.append(\" '\" + pcOptions.getTypeSourceChosenList().get(i)\n + \"' \");\n\n if (i != pcOptions.getTypeSourceChosenCount() - 1) {\n buffer.append(\", \");\n }\n }\n\n if (pcOptions.getTypeSourceChosenCount() > 0) {\n returnValue = \" and ts in (\" + buffer.toString() + \") \";\n } else {\n returnValue = \"\";\n }\n\n return returnValue;\n }", "public boolean isSource();", "@Override\n public int filterOrder() {\n return 1;\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "private void defaultCustStatisticsShouldNotBeFound(String filter) throws Exception {\n restCustStatisticsMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restCustStatisticsMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "private static void fillSourceSite() {\r\n\t\tsourceSites.add(\"http://hom.nfe.fazenda.gov.br/portal/WebServices.aspx\");\r\n\t\tsourceSites.add(\"http://www.nfe.fazenda.gov.br/portal/WebServices.aspx\");\r\n\t\tsourceSites.add(\"http://www.cte.fazenda.gov.br/webservices.aspx\");\r\n\t\tsourceSites.add(\"http://hom.cte.fazenda.gov.br/webservices.aspx\");\r\n\t\tsourceSites.add(\"https://mdfe-portal.sefaz.rs.gov.br/Site/Servicos\");\r\n\t}", "@Test\n\tpublic void testGetStreamSourcesByID_02() {\n\t\ttry {\n\t\t\tClass c = Class.forName(\"InternalMemory\");\n\t\t\tMethod method = c.getDeclaredMethod(\"getStreamSourcesByID\", new Class[] { String.class });\n\t\t\tmethod.setAccessible(true);\n\t\t\tObject i = c.newInstance();\n\n\t\t\tConcurrentHashMap<String, ArrayList<String>> map = new ConcurrentHashMap<String, ArrayList<String>>();\n\n\t\t\tField field = c.getDeclaredField(\"_streamerToStreamSourcesMap\");\n\t\t\tfield.setAccessible(true);\n\t\t\tfield.set(i, map);\n\n\t\t\tObject r = method.invoke(i, new Object[] { null });\n\t\t\tassertEquals(r, \"NULL\");\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\n\t}", "@Test(priority = 10, description = \"To verify Status of Vendor HERE\")\n\tpublic void VerifyvendorsStatusinTableDTCVendorHERE() throws Exception {\n\t\tdata = new TPSEE_Syndication_Status_Page(CurrentState.getDriver());\n\t\tExcelHandler wb = new ExcelHandler(\"./data/Filter.xlsx\", \"Syndication\");\n\t\twb.deleteEmptyRows();\n\t\tString LocNum = wb.getCellValue(3, wb.seacrh_pattern(\"Location Number\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is :\" + LocNum);\n\t\tString Vendor = wb.getCellValue(3, wb.seacrh_pattern(\"Vendor\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is :\" + Vendor);\n\t\tdata.getLocationDetailsDTCVendors(LocNum, Vendor);\n\t\taddEvidence(CurrentState.getDriver(), \"To Verify Status of Vendors of DTC\", \"yes\");\n\t}", "public boolean enoughToFilter() {\n/* 468 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void test_01_hgvs_upstream() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr2\", path(\"hgvs_upstream.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000463.2\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Override\n public boolean testPermission(CommandSource source) {\n return source.hasPermission(\"core.tps\");\n }", "@Test\n public void testGetFlowEntries() {\n Collection<FlowEntry> flowEntries = frProgramable.getFlowEntries();\n\n assertNotNull(flowEntries);\n //There will be 12 flow entries\n // 2 for IP Src Address filtering\n // 2 for EVC 7 - one each port\n // 8 for EVC 8 - one for host port, 7 on optics port because of ceVlanMap 12:14,20:22,25\n assertEquals(12, flowEntries.size());\n\n //Test the first Flow Entry\n Iterator<FlowEntry> feIter = flowEntries.iterator();\n while (feIter.hasNext()) {\n FlowEntry fe = feIter.next();\n assertTrue(fe.isPermanent());\n assertEquals(EA1000FlowRuleProgrammable.PRIORITY_DEFAULT, fe.priority());\n\n Set<Criterion> criteria = fe.selector().criteria();\n IPCriterion ipCr = null;\n PortNumber port = null;\n for (Criterion cr:criteria.toArray(new Criterion[criteria.size()])) {\n if (cr.type() == Criterion.Type.IPV4_SRC) {\n ipCr = (IPCriterion) cr;\n } else if (cr.type() == Criterion.Type.IN_PORT) {\n port = ((PortCriterion) cr).port();\n } else if (cr.type() == Criterion.Type.VLAN_VID) {\n VlanId vid = ((VlanIdCriterion) cr).vlanId();\n } else {\n fail(\"Unexpected Criterion type: \" + cr.type().toString());\n }\n }\n if (ipCr != null && (port == null || port.toLong() != 0L)) {\n fail(\"Port number not equal 0 when IP Src Address filter is present\");\n }\n\n List<Instruction> instructions = fe.treatment().allInstructions();\n\n if (fe.tableId() == 1) {\n //Note that in MockNetconf session 10.10.10.10/16 was entered\n //but it has been corrected to the following by the OF implementation\n assertEquals(\"10.10.0.0/16\", ipCr.ip().toString());\n assertEquals(FlowEntryState.ADDED, fe.state());\n } else if (fe.tableId() == 2) {\n //Likewise 20.30.40.50 has been truncated because of the 18 bit mask\n assertEquals(\"20.30.0.0/18\", ipCr.ip().toString());\n assertEquals(FlowEntryState.ADDED, fe.state());\n } else if (fe.tableId() == 7 || fe.tableId() == 8) {\n // 7 and 8 are EVC entries - 2 elements - IN_PORT and VLAN_ID\n assertEquals(2, fe.selector().criteria().size());\n //In MockNetconfSession we're rigged it so that the last two chars of the\n //flow id is the same as the VlanId\n short vlanId = ((VlanIdCriterion) fe.selector().getCriterion(Type.VLAN_VID)).vlanId().toShort();\n long flowId = fe.id().id();\n String flowIdStr = String.valueOf(flowId).substring(String.valueOf(flowId).length() - 2);\n assertEquals(flowIdStr, String.valueOf(vlanId));\n if (((PortCriterion) fe.selector().getCriterion(Type.IN_PORT)).port().toLong() == 1L) {\n assertEquals(Instruction.Type.L2MODIFICATION, instructions.get(0).type());\n }\n } else {\n fail(\"Unexpected Flow Entry Rule \" + fe.tableId());\n }\n }\n }", "@Before\n @Test\n public void testListSensorDataTimestampSource() throws Exception {\n command = \"sensordata SIM_SEA timestamp 2009-11-01T00:00:00.0000\";\n commandProcessor = new CommandProcessor();\n commandList = commandProcessor.parseCommand(command);\n cli = new CommandLineInterface();\n commandProcessor.processCommand(cli, commandList);\n assertTrue(ASSERT_SOURCE_MESSAGE, cli.errorEncountered);\n }", "public void testEventStatusFilter(final String programName) throws ParseException;", "private void defaultSuiviModuleShouldNotBeFound(String filter) throws Exception {\n restSuiviModuleMockMvc.perform(get(\"/api/suivi-modules?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restSuiviModuleMockMvc.perform(get(\"/api/suivi-modules/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@Test(priority = 7, description = \"To verify Status of Vendors processed in DTC\")\n\tpublic void VerifyvendorsStatusinTableDTC() throws Exception {\n\t\tdata = new TPSEE_Syndication_Status_Page(CurrentState.getDriver());\n\t\tExcelHandler wb = new ExcelHandler(\"./data/Filter.xlsx\", \"Syndication\");\n\t\twb.deleteEmptyRows();\n\t\tString LocNum = wb.getCellValue(1, wb.seacrh_pattern(\"Location Number\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is\" + LocNum);\n\t\tdata.getLocationDetailsDTCManualApi(LocNum);\n\t\taddEvidence(CurrentState.getDriver(), \"To Verify Status of Vendors of DTC\", \"yes\");\n\t}", "@Override\n\tpublic String buidWfsURL(WrapperFilter filter) {\n\t\treturn null;\n\t}", "@Test(priority=52)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_ct_user_id() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_ct_user_id\", \"To validate whether user is able to get campaign and its users through campaign/user api with filter for non existing ct_user_id\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_ct_user_id\");\n\t\tString ct_user_id = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"ct_user_id%3d\"+ct_user_id));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for non existing ct_user_id\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t String result_data = json.get(\"result\").toString();\n\t\t Assert.assertEquals(result_data, \"error\", \"API is returning success when non existing ct_user_id is entered for filter\");\n\t\t test.log(LogStatus.PASS, \"API is returning error when non existing ct_user_id is entered for filter\");\n\t\t Assert.assertEquals(json.get(\"err\").toString(), \"no records found\", \"Proper validation is not displayed when non existing ct_user_id is passed.\");\n\t\t test.log(LogStatus.PASS, \"Proper validation is displayed when non existing ct_user_id is passed.\");\n\t\t}\n\t}", "@Test(priority=23)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_camp_ext_id() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_camp_ext_id\", \"To validate whether user is able to get campaign through campaign/user api with filter for non existing campaign_ext_id\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_camp_ext_id\");\n\t\tString camp_ext_id = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"campaign_ext_id%3d\"+camp_ext_id));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/list\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with filter for non existing campaign_ext_id field.\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t // Check whether campaign user returns 0 record non existing campaign_ext_id is passed for filter\n\t\t Assert.assertEquals(array.size(), 0, \"Campaign user returns record when non existing campaign_ext_id is passed for filter.\");\n\t\t test.log(LogStatus.PASS, \"campaign/user does not return record when non existing campaign_ext_id is passed for filter.\");\n\t\t}\n\t}", "public AbstractFilteringTestCase(String testName) {super(testName);}", "public void start(){\n isFiltersSatisfied();\n }", "@Override\r\n\tpublic void sssDoLwTestInit() {\n\r\n\t}", "@Test\n public void serviceCandidateTest() {\n // TODO: test serviceCandidate\n }", "public UTbPayOutsourceAcceptanceDtlExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Test\n public void createFeedSourceWithNoUrlTest() {\n HttpResponse createFeedSourceResponse = TestUtils.makeRequest(\"/api/manager/secure/feedsource\",\n JsonUtil.toJson(feedSourceWithNoUrl),\n HttpUtils.REQUEST_METHOD.POST\n );\n assertEquals(OK_200, createFeedSourceResponse.getStatusLine().getStatusCode());\n assertEquals(0, jobCountForFeed(feedSourceWithNoUrl.id));\n }", "@Test\n public void reset_WithEndsWithRefreshFilterOff_ShoudNotApplyRefreshFilter() throws Exception {\n\n // Replace the LAST_REFRESH singleton\n final RefreshFilter refreshFilter = mock(RefreshFilter.class);\n setFinalStatic(RefreshFilter.class.getDeclaredField(\"LAST_REFRESH\"), refreshFilter);\n\n // Then execute the test\n final File targetFile1 = new File(testFolder.getRoot(), SOURCE_FILENAME + \".page1.txt\");\n\n final PageCounterFilter countFilter = new PageCounterFilter();\n final PageSelectorFilter selectorFilter = new PageSelectorFilter(1);\n\n final DefaultFilterChain chain = new DefaultFilterChain(false, countFilter, selectorFilter);\n LocalConverter.builder()\n .filterChain(chain)\n .build()\n .convert(SOURCE_FILE)\n .to(targetFile1)\n .execute();\n\n // Verify that the\n verify(refreshFilter, times(0))\n .doFilter(isA(OfficeContext.class), isA(XComponent.class), isA(FilterChain.class));\n }", "FeatureHolder filter(FeatureFilter filter);" ]
[ "0.7594563", "0.6172656", "0.59114337", "0.5891979", "0.5768894", "0.5704158", "0.5642957", "0.5564667", "0.5564667", "0.5562957", "0.556114", "0.5530819", "0.55128473", "0.5509013", "0.5509013", "0.54707664", "0.5441936", "0.5425884", "0.54087895", "0.54006577", "0.537239", "0.5367892", "0.53455234", "0.5325996", "0.5319504", "0.5302177", "0.5302177", "0.53008157", "0.5299649", "0.5291399", "0.5266004", "0.5263374", "0.5261444", "0.5256802", "0.52429813", "0.5242945", "0.5233611", "0.52321297", "0.5221868", "0.52108234", "0.52001274", "0.51999724", "0.5197365", "0.51912683", "0.51866436", "0.5171135", "0.51544565", "0.51530915", "0.5152455", "0.51491946", "0.51375777", "0.5133344", "0.512226", "0.51199365", "0.5112303", "0.51119673", "0.5111693", "0.51036614", "0.50992817", "0.50974995", "0.50887954", "0.508873", "0.5071905", "0.5069586", "0.50615937", "0.5061028", "0.50591004", "0.505491", "0.50528055", "0.50519335", "0.50479317", "0.5044848", "0.50340897", "0.5033096", "0.50203425", "0.50203425", "0.50170314", "0.50146574", "0.50094444", "0.5005814", "0.50047046", "0.499968", "0.49950445", "0.49939385", "0.49841684", "0.4978446", "0.49757466", "0.49751508", "0.4974804", "0.49736407", "0.497191", "0.49646193", "0.4962572", "0.49618196", "0.49607438", "0.49583396", "0.49577594", "0.49566537", "0.49555746", "0.4952472" ]
0.73473155
1
No filtering by sourcesystem in this service so this test is obsolete.
@Override public void testCreateRequestListAllFilteredBySourceSystem(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void testCreateRequestListSomeFilteredBySourceSystem(){\n }", "@Override\n public void getMosSource(String testTest, ArrayList<String> source) {\n\n }", "@Test\n\tpublic void testSingleSourceSelect() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query_singleSource01.rq\", \"/tests/basic/query_singleSource01.srx\", false);\n\t}", "@Test\n public void filter() {\n\n }", "@Test\r\n public void testAssemblyFilter()\r\n {\r\n TestSuiteFilterAssembler assembler = new TestSuiteFilterAssembler();\r\n Collection<String> requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0025\");\r\n assembler.setRequirementsFilter(requirements);\r\n\r\n TestSuiteFilter<FlowStep> filter = assembler.assemblyFilter();\r\n TestSuite<TestCase<FlowStep>> newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 9, newSuite.getTestCases().size());\r\n\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 15, newSuite.getTestCases().size());\r\n\r\n requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(newSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 6, newSuite.getTestCases().size());\r\n }", "@Test\n public void eventFilterTest() {\n // TODO: test eventFilter\n }", "@Override\n public boolean shouldFilter() {\n return true;\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "public void setSource(String source) {\r\n this.source = source;\r\n }", "private FilterByAllCompiler() {\n }", "@Test(dataProvider = \"goodInputVcfs\")\n public void testFsFiltering(final File input) throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs13303033\", \"rs28548431\", \"rs2799066\");\n final File out = testFiltering(input, \".vcf.gz\", 0, 0, 0, 5.0d);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "private CanonizeSource() {}", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n _source = source;\n }", "public FilterSource[] getFilterSources();", "@Override\n\tpublic boolean shouldFilter() {\n\t\treturn true;\n\t}", "public void setSourceId(String source) {\n this.sourceId = sourceId;\n }", "@Test\n\tpublic void testFilteredRequest() {\n\n\t\tHttpRepublisher testerRepublisher = PowerMockito.spy(republisher);\n\t\ttesterRepublisher.setPathFilter(\"^/api.*\");\n\t\tWhitebox.setInternalState(testerRepublisher, ExecutorService.class, executorMock);\n\t\t//force API to not match pattern\n\t\tInvokedRequestDetails dummyRequestDetails = new InvokedRequestDetails(\"/notAPI\", httpRequest, httpHeaders,\n\t\t\t\t\"dummyBody\", false);\n\n\t\twhen(actionedRequest.getRequest()).thenReturn(dummyRequestDetails);\n\t\ttesterRepublisher.submitRequest(actionedRequest);\n\t\t//it should never get onto executor\n\t\tverify(actionedRequest,times(1)).setIgnored();\n\n\t}", "@Test\n\tpublic void testSingleSourceConstruct() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query_singleSource02.rq\", \"/tests/basic/query_singleSource02.ttl\", false);\n\t}", "public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }", "public void setSourceSite(String newsource) {\n sourceSite=newsource;\n }", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "@Test\n @DisplayName(\"Test Filtering of the properties field with no admin privileges\")\n void testFilterPrivilegedFields() throws Exception {\n logger.info(\"Testing filtering of properties field with no admin privileges\");\n\n replaceConfiguration(RESOURCE_DIR\n + \"/exporter/rest_filter_jdbc_privileged.yaml\",\n \"wls_datasource_state%7Bname%3D%22TestDataSource%22%7D%5B15s%5D\",\n \"Running, Suspended, Shutdown, Overloaded, Unknown\", \"TestDataSource\");\n }", "@Override\n public void checkSourcesParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "@Override\n public void checkSourcesParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "@Override\n\tpublic void filterChange() {\n\t\t\n\t}", "@Override\n public void filter(Filter arg0) throws NoTestsRemainException {\n super.filter(getCustomFilter());\n }", "@Test\n public void testDpFilteringToVcf() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs71509448\", \"rs71628926\", \"rs13302979\", \"rs2710876\");\n final File out = testFiltering(INPUT, \".vcf\", 0, 18, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "boolean hasSource();", "@DISPID(-2147412069)\n @PropGet\n java.lang.Object onfilterchange();", "public void setSourceName(java.lang.String param) {\r\n localSourceNameTracker = param != null;\r\n\r\n this.localSourceName = param;\r\n }", "@Test\n\tpublic void testGetDriverExcludeAllocations(){ \n\t\tassertNotNull(driverService.getDriverExcludeAllocations(239537L)); \n\t}", "public void setSource(String source);", "@Test\n\tpublic void testBooleanTrueSingleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "@Test\n public void getLatestScanResults_projectWithoutScans() {\n testMissingResultsCase(\"common-client-test-02-no-scans\");\n }", "protected Filter getFilter() {\n/* 631 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "SourceBuilder createService();", "boolean doFilter() { return false; }", "@Test\n\tpublic void shouldNotReturnResultForServicesEastFilteredByDocumentType()\n\t{\n\t\tlogin(USER_MARK_RIVERS_RUSTIC_HW_COM);\n\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getPagedDocumentsForUnit(\"Services East\",\n\t\t\t\tcreatePageableData(0, 10, StringUtils.EMPTY), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createTypeCriteriaObject(UNKNOWN, StringUtils.EMPTY, FILTER_BY_DOCUMENT_TYPE)));\n\n\t\tTestCase.assertEquals(0, result.getResults().size());\n\t}", "@Test\n public void testDpFiltering() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"rs71509448\", \"rs71628926\", \"rs13302979\", \"rs2710876\");\n final File out = testFiltering(INPUT, \".vcf.gz\", 0, 18, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "@LargeTest\n public void testBWFilter() {\n TestAction ta = new TestAction(TestName.BW_FILTER);\n runTest(ta, TestName.BW_FILTER.name());\n }", "@Test\n public void testSearchFilter() {\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n \n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"(samaccountname=*)\");\n \n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n \n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "public interface Source {\n\n /**\n * Set the system identifier for this Source.\n * <p>\n * The system identifier is optional if the source does not get its data\n * from a URL, but it may still be useful to provide one. The application\n * can use a system identifier, for example, to resolve relative URIs and to\n * include in error messages and warnings.\n * </p>\n *\n * @param systemId\n * The system identifier as a URL string.\n */\n public void setSystemId(String systemId);\n\n /**\n * Get the system identifier that was set with setSystemId.\n *\n * @return The system identifier that was set with setSystemId, or null if\n * setSystemId was not called.\n */\n public String getSystemId();\n}", "@Override\n protected void mergeBuildBase_Filters( BuildBase target, BuildBase source, boolean sourceDominant,\n Map<Object, Object> context )\n {\n List<String> src = source.getFilters();\n if ( !src.isEmpty() )\n {\n List<String> tgt = target.getFilters();\n Set<String> excludes = new LinkedHashSet<String>( tgt );\n List<String> merged = new ArrayList<String>( tgt.size() + src.size() );\n merged.addAll( tgt );\n for ( String s : src )\n {\n if ( !excludes.contains( s ) )\n {\n merged.add( s );\n }\n }\n target.setFilters( merged );\n }\n }", "public LSPSource[] getSources () {\r\n return sources;\r\n }", "@Override\npublic void setup(TableRefFilterContext context) {\n\t\n}", "public void setSource (String source);", "private ServiceList serviceSetup()\n {\n SIManager simgr = sm.createSIManager();\n ServiceList services = simgr.filterServices(new ServiceFilter()\n {\n public boolean accept(Service service)\n {\n return !(service instanceof AbstractService);\n }\n });\n try\n {\n services = services.sortByNumber();\n }\n catch (SortNotAvailableException ex)\n {\n // don't sort then\n }\n\n // Check to see if there are arguments\n // If length of one, then sourceID was specified\n // If length of three, then freq/prognum/modformat was specified\n if (args.length == 1)\n {\n String sid = args[0];\n if (args[0].startsWith(\"0x\")) sid = sid.substring(2, sid.length());\n try\n {\n int sourceID = Integer.parseInt(sid, 16);\n OcapLocator[] locs = { new OcapLocator(sourceID) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"SourceID is not in the correct format\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n if (args.length == 3)\n {\n try\n {\n int freq = Integer.parseInt(args[0]);\n int prog = Integer.parseInt(args[1]);\n int mod = Integer.parseInt(args[2]);\n OcapLocator[] locs = { new OcapLocator(freq, prog, mod) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"Freq/prognum/modformat values are not valid\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n\n return services;\n }", "public void setSourceDB(String sourceDB) {\n this.sourceDB = sourceDB;\n }", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "@Test\n public void testAbFiltering() throws Exception {\n final Set<String> fails = CollectionUtil.makeSet(\"tf2\", \"rs28566954\", \"rs28548431\");\n final File out = testFiltering(INPUT, \".vcf.gz\", 0.4, 0, 0, Double.MAX_VALUE);\n final ListMap<String, String> filters = slurpFilters(out);\n Assert.assertEquals(sorted(filters.keySet()), sorted(fails), \"Failed sites did not match expected set of failed sites.\");\n }", "@Test\r\n public void testAssemblyFilterWithSimilarityFilter()\r\n {\r\n TestSuiteFilterAssembler assembler = new TestSuiteFilterAssembler();\r\n Collection<String> requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0025\");\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n\r\n TestSuiteFilter<FlowStep> filter = null;\r\n TestSuite<TestCase<FlowStep>> newSuite = null;\r\n\r\n try\r\n {\r\n for (int i = 0; i <= 100; i++)\r\n {\r\n assembler.setSimilarityFilter((double) i);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n double expected = Math.round(0.15 * i);\r\n Assert.assertEquals(\"Wrong number of test cases.\", expected, (double) newSuite\r\n .getTestCases().size());\r\n }\r\n }\r\n catch (InvalidSimilarityException e)\r\n {\r\n e.printStackTrace();\r\n Assert.fail(\"An invalid similarity was set.\");\r\n }\r\n\r\n try\r\n {\r\n assembler.setSimilarityFilter(-35.00);\r\n Assert.fail(\"The assembler has accepted an invalid similarity.\");\r\n }\r\n catch (InvalidSimilarityException e)\r\n {\r\n Assert.assertTrue(\"The similarity set was successfully rejected.\", true);\r\n }\r\n }", "public String[] getAllSources() {\n return this.sourceList.toArray(new String[0]);\n }", "public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }", "public boolean shouldFilter() {\n return true;\n }", "boolean isSource();", "public MeasurementEnvironmentDefinition filter(MeasurementEnvironmentDefinition source) {\r\n\t\tdouble metering = Metering.start();\r\n\r\n\t\tParameterNamespace root = recursive(source.getRoot());\r\n\r\n\t\tMeasurementEnvironmentDefinition filteredDefinition = new MeasurementEnvironmentDefinition();\r\n\t\tfilteredDefinition.setRoot(root);\r\n\r\n\t\tMetering.stop(metering);\r\n\t\treturn filteredDefinition;\r\n\t}", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "@Test\n public void testSearchFilter_WithAddedSearchBase() {\n BridgeRequest request = new BridgeRequest();\n\n // Add the fields\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n fields.add(\"sn\");\n request.setFields(fields);\n\n // Set the Structure\n // This gets appended to the filter as (objectClass=STRUCTURE)\n request.setStructure(\"User\");\n\n // Set the Query\n request.setQuery(\"OU=Users(<%=parameter[\\\"Search String\\\"]%>)\");\n\n // Set the Parameters to be replaced in the Query\n Map parameters = new HashMap();\n parameters.put(\"Search String\", \"samaccountname=mary.olowu\");\n request.setParameters(parameters);\n\n BridgeError unexpectedError = null;\n RecordList list = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n\n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "private ProductFilterUtils(){}", "@Test(dataProvider = \"goodInputVcfs\")\n public void testNoFiltering(final File input) throws Exception {\n final File out = testFiltering(input, \".vcf.gz\", 0, 0, 0, Double.MAX_VALUE);\n final VCFFileReader in = new VCFFileReader(out, false);\n for (final VariantContext ctx : in) {\n if (!ctx.filtersWereApplied() || ctx.isFiltered()) {\n Assert.fail(\"Context should not have been filtered: \" + ctx.toString());\n }\n }\n in.close();\n }", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "@SneakyThrows\n protected void addSourceResource() {\n if (databaseType instanceof MySQLDatabaseType) {\n try (Connection connection = DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl(\"\"), \"root\", \"root\")) {\n connection.createStatement().execute(\"USE sharding_db\");\n addSourceResource0(connection);\n }\n } else {\n Properties queryProps = ScalingCaseHelper.getPostgreSQLQueryProperties();\n try (Connection connection = DriverManager.getConnection(JDBC_URL_APPENDER.appendQueryProperties(getComposedContainer().getProxyJdbcUrl(\"sharding_db\"), queryProps), \"root\", \"root\")) {\n addSourceResource0(connection);\n }\n }\n List<Map<String, Object>> resources = queryForListWithLog(\"SHOW DATABASE RESOURCES FROM sharding_db\");\n assertThat(resources.size(), is(2));\n }", "public abstract String getDefaultFilter ();", "@Test\n public void testSearchFilter_WithoutQuery() {\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n\n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"\");\n\n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n\n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "public GroupsOnlySenseFilter() {\n \n }", "@Test\n\tpublic void testFilteredRequestIsExecuted() {\n\n\t\tHttpRepublisher testerRepublisher = PowerMockito.spy(republisher);\n\t\ttesterRepublisher.setPathFilter(\"^/api.*\");\n\t\tWhitebox.setInternalState(testerRepublisher, ExecutorService.class, executorMock);\n\t\t//force API to not match pattern\n\t\tInvokedRequestDetails dummyRequestDetails = new InvokedRequestDetails(\"/api\", httpRequest, httpHeaders,\n\t\t\t\t\"dummyBody\", false);\n\n\t\twhen(actionedRequest.getRequest()).thenReturn(dummyRequestDetails);\n\t\ttesterRepublisher.submitRequest(actionedRequest);\n\t\tverify(executorMock).submit(republisherWorkerCaptor.capture());\n\n\t\tHttpRepublisherWorker resultWorker = republisherWorkerCaptor.getValue();\n\t\tHttpRepublisher publisher = Whitebox.getInternalState(resultWorker, HttpRepublisher.class);\n\t\tActionedRequestDetails requestDetails = Whitebox.getInternalState(resultWorker, ActionedRequestDetails.class);\n\n\t\tassertEquals(actionedRequest, requestDetails);\n\t\tassertEquals(publisher, testerRepublisher);\n\n\t}", "@Test\npublic void testFilter() throws Exception { \n//TODO: Test goes here... \n/* \ntry { \n Method method = VirtualCoinCtrl.getClass().getMethod(\"filter\", VirtualCoin.class, VirtualCoinAddReq.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/ \n}", "public String askDepFilter();", "@Override\n\tpublic List<FilghtDetails> searchFlightBySourceInUser(String source) {\n\t\tArrayList<FilghtDetails> sl = new ArrayList<FilghtDetails>();\n\t\tfor (int i = 0; i <= Repository.FLIGHT_DETAILS.size() - 1; i++) {\n\t\t\tFilghtDetails rf = Repository.FLIGHT_DETAILS.get(i);\n\t\t\tString rfs = rf.getSource();\n\t\t\tif (source.equalsIgnoreCase(rfs)) {\n\t\t\t\tsl.add(rf);\n\t\t\t}\n\t\t}\n\t\tif (sl.size() == 0) {\n\t\t\tthrow new AirlineException(\"Flight not found\");\n\t\t} else {\n\t\t\treturn sl;\n\t\t}\n\t}", "public boolean isSource();", "public static String buildTypeSourceWhereFilter() {\n PDCOptionData pcOptions = PDCOptionData.getInstance();\n StringBuilder buffer = new StringBuilder();\n String returnValue = null;\n\n for (int i = 0; i < pcOptions.getTypeSourceChosenList().size(); i++) {\n buffer.append(\" '\" + pcOptions.getTypeSourceChosenList().get(i)\n + \"' \");\n\n if (i != pcOptions.getTypeSourceChosenCount() - 1) {\n buffer.append(\", \");\n }\n }\n\n if (pcOptions.getTypeSourceChosenCount() > 0) {\n returnValue = \" and ts in (\" + buffer.toString() + \") \";\n } else {\n returnValue = \"\";\n }\n\n return returnValue;\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "private void defaultCustStatisticsShouldNotBeFound(String filter) throws Exception {\n restCustStatisticsMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restCustStatisticsMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "private static void fillSourceSite() {\r\n\t\tsourceSites.add(\"http://hom.nfe.fazenda.gov.br/portal/WebServices.aspx\");\r\n\t\tsourceSites.add(\"http://www.nfe.fazenda.gov.br/portal/WebServices.aspx\");\r\n\t\tsourceSites.add(\"http://www.cte.fazenda.gov.br/webservices.aspx\");\r\n\t\tsourceSites.add(\"http://hom.cte.fazenda.gov.br/webservices.aspx\");\r\n\t\tsourceSites.add(\"https://mdfe-portal.sefaz.rs.gov.br/Site/Servicos\");\r\n\t}", "@Test\n\tpublic void testGetStreamSourcesByID_02() {\n\t\ttry {\n\t\t\tClass c = Class.forName(\"InternalMemory\");\n\t\t\tMethod method = c.getDeclaredMethod(\"getStreamSourcesByID\", new Class[] { String.class });\n\t\t\tmethod.setAccessible(true);\n\t\t\tObject i = c.newInstance();\n\n\t\t\tConcurrentHashMap<String, ArrayList<String>> map = new ConcurrentHashMap<String, ArrayList<String>>();\n\n\t\t\tField field = c.getDeclaredField(\"_streamerToStreamSourcesMap\");\n\t\t\tfield.setAccessible(true);\n\t\t\tfield.set(i, map);\n\n\t\t\tObject r = method.invoke(i, new Object[] { null });\n\t\t\tassertEquals(r, \"NULL\");\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\n\t}", "@Test(priority = 10, description = \"To verify Status of Vendor HERE\")\n\tpublic void VerifyvendorsStatusinTableDTCVendorHERE() throws Exception {\n\t\tdata = new TPSEE_Syndication_Status_Page(CurrentState.getDriver());\n\t\tExcelHandler wb = new ExcelHandler(\"./data/Filter.xlsx\", \"Syndication\");\n\t\twb.deleteEmptyRows();\n\t\tString LocNum = wb.getCellValue(3, wb.seacrh_pattern(\"Location Number\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is :\" + LocNum);\n\t\tString Vendor = wb.getCellValue(3, wb.seacrh_pattern(\"Vendor\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is :\" + Vendor);\n\t\tdata.getLocationDetailsDTCVendors(LocNum, Vendor);\n\t\taddEvidence(CurrentState.getDriver(), \"To Verify Status of Vendors of DTC\", \"yes\");\n\t}", "public boolean enoughToFilter() {\n/* 468 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void test_01_hgvs_upstream() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr2\", path(\"hgvs_upstream.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000463.2\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Override\n public boolean testPermission(CommandSource source) {\n return source.hasPermission(\"core.tps\");\n }", "@Test\n public void testGetFlowEntries() {\n Collection<FlowEntry> flowEntries = frProgramable.getFlowEntries();\n\n assertNotNull(flowEntries);\n //There will be 12 flow entries\n // 2 for IP Src Address filtering\n // 2 for EVC 7 - one each port\n // 8 for EVC 8 - one for host port, 7 on optics port because of ceVlanMap 12:14,20:22,25\n assertEquals(12, flowEntries.size());\n\n //Test the first Flow Entry\n Iterator<FlowEntry> feIter = flowEntries.iterator();\n while (feIter.hasNext()) {\n FlowEntry fe = feIter.next();\n assertTrue(fe.isPermanent());\n assertEquals(EA1000FlowRuleProgrammable.PRIORITY_DEFAULT, fe.priority());\n\n Set<Criterion> criteria = fe.selector().criteria();\n IPCriterion ipCr = null;\n PortNumber port = null;\n for (Criterion cr:criteria.toArray(new Criterion[criteria.size()])) {\n if (cr.type() == Criterion.Type.IPV4_SRC) {\n ipCr = (IPCriterion) cr;\n } else if (cr.type() == Criterion.Type.IN_PORT) {\n port = ((PortCriterion) cr).port();\n } else if (cr.type() == Criterion.Type.VLAN_VID) {\n VlanId vid = ((VlanIdCriterion) cr).vlanId();\n } else {\n fail(\"Unexpected Criterion type: \" + cr.type().toString());\n }\n }\n if (ipCr != null && (port == null || port.toLong() != 0L)) {\n fail(\"Port number not equal 0 when IP Src Address filter is present\");\n }\n\n List<Instruction> instructions = fe.treatment().allInstructions();\n\n if (fe.tableId() == 1) {\n //Note that in MockNetconf session 10.10.10.10/16 was entered\n //but it has been corrected to the following by the OF implementation\n assertEquals(\"10.10.0.0/16\", ipCr.ip().toString());\n assertEquals(FlowEntryState.ADDED, fe.state());\n } else if (fe.tableId() == 2) {\n //Likewise 20.30.40.50 has been truncated because of the 18 bit mask\n assertEquals(\"20.30.0.0/18\", ipCr.ip().toString());\n assertEquals(FlowEntryState.ADDED, fe.state());\n } else if (fe.tableId() == 7 || fe.tableId() == 8) {\n // 7 and 8 are EVC entries - 2 elements - IN_PORT and VLAN_ID\n assertEquals(2, fe.selector().criteria().size());\n //In MockNetconfSession we're rigged it so that the last two chars of the\n //flow id is the same as the VlanId\n short vlanId = ((VlanIdCriterion) fe.selector().getCriterion(Type.VLAN_VID)).vlanId().toShort();\n long flowId = fe.id().id();\n String flowIdStr = String.valueOf(flowId).substring(String.valueOf(flowId).length() - 2);\n assertEquals(flowIdStr, String.valueOf(vlanId));\n if (((PortCriterion) fe.selector().getCriterion(Type.IN_PORT)).port().toLong() == 1L) {\n assertEquals(Instruction.Type.L2MODIFICATION, instructions.get(0).type());\n }\n } else {\n fail(\"Unexpected Flow Entry Rule \" + fe.tableId());\n }\n }\n }", "@Before\n @Test\n public void testListSensorDataTimestampSource() throws Exception {\n command = \"sensordata SIM_SEA timestamp 2009-11-01T00:00:00.0000\";\n commandProcessor = new CommandProcessor();\n commandList = commandProcessor.parseCommand(command);\n cli = new CommandLineInterface();\n commandProcessor.processCommand(cli, commandList);\n assertTrue(ASSERT_SOURCE_MESSAGE, cli.errorEncountered);\n }", "public void testEventStatusFilter(final String programName) throws ParseException;", "private void defaultSuiviModuleShouldNotBeFound(String filter) throws Exception {\n restSuiviModuleMockMvc.perform(get(\"/api/suivi-modules?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restSuiviModuleMockMvc.perform(get(\"/api/suivi-modules/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@Test(priority = 7, description = \"To verify Status of Vendors processed in DTC\")\n\tpublic void VerifyvendorsStatusinTableDTC() throws Exception {\n\t\tdata = new TPSEE_Syndication_Status_Page(CurrentState.getDriver());\n\t\tExcelHandler wb = new ExcelHandler(\"./data/Filter.xlsx\", \"Syndication\");\n\t\twb.deleteEmptyRows();\n\t\tString LocNum = wb.getCellValue(1, wb.seacrh_pattern(\"Location Number\", 0).get(0).intValue());\n\t\tSystem.out.println(\"The Location Number is\" + LocNum);\n\t\tdata.getLocationDetailsDTCManualApi(LocNum);\n\t\taddEvidence(CurrentState.getDriver(), \"To Verify Status of Vendors of DTC\", \"yes\");\n\t}", "@Override\n\tpublic String buidWfsURL(WrapperFilter filter) {\n\t\treturn null;\n\t}", "@Test(priority=52)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_ct_user_id() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_ct_user_id\", \"To validate whether user is able to get campaign and its users through campaign/user api with filter for non existing ct_user_id\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_ct_user_id\");\n\t\tString ct_user_id = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"ct_user_id%3d\"+ct_user_id));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for non existing ct_user_id\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t String result_data = json.get(\"result\").toString();\n\t\t Assert.assertEquals(result_data, \"error\", \"API is returning success when non existing ct_user_id is entered for filter\");\n\t\t test.log(LogStatus.PASS, \"API is returning error when non existing ct_user_id is entered for filter\");\n\t\t Assert.assertEquals(json.get(\"err\").toString(), \"no records found\", \"Proper validation is not displayed when non existing ct_user_id is passed.\");\n\t\t test.log(LogStatus.PASS, \"Proper validation is displayed when non existing ct_user_id is passed.\");\n\t\t}\n\t}", "@Test(priority=23)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_camp_ext_id() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_camp_ext_id\", \"To validate whether user is able to get campaign through campaign/user api with filter for non existing campaign_ext_id\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_camp_ext_id\");\n\t\tString camp_ext_id = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"campaign_ext_id%3d\"+camp_ext_id));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/list\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with filter for non existing campaign_ext_id field.\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t // Check whether campaign user returns 0 record non existing campaign_ext_id is passed for filter\n\t\t Assert.assertEquals(array.size(), 0, \"Campaign user returns record when non existing campaign_ext_id is passed for filter.\");\n\t\t test.log(LogStatus.PASS, \"campaign/user does not return record when non existing campaign_ext_id is passed for filter.\");\n\t\t}\n\t}", "public AbstractFilteringTestCase(String testName) {super(testName);}", "@Override\r\n\tpublic void sssDoLwTestInit() {\n\r\n\t}", "public void start(){\n isFiltersSatisfied();\n }", "public UTbPayOutsourceAcceptanceDtlExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Test\n public void createFeedSourceWithNoUrlTest() {\n HttpResponse createFeedSourceResponse = TestUtils.makeRequest(\"/api/manager/secure/feedsource\",\n JsonUtil.toJson(feedSourceWithNoUrl),\n HttpUtils.REQUEST_METHOD.POST\n );\n assertEquals(OK_200, createFeedSourceResponse.getStatusLine().getStatusCode());\n assertEquals(0, jobCountForFeed(feedSourceWithNoUrl.id));\n }", "@Test\n public void reset_WithEndsWithRefreshFilterOff_ShoudNotApplyRefreshFilter() throws Exception {\n\n // Replace the LAST_REFRESH singleton\n final RefreshFilter refreshFilter = mock(RefreshFilter.class);\n setFinalStatic(RefreshFilter.class.getDeclaredField(\"LAST_REFRESH\"), refreshFilter);\n\n // Then execute the test\n final File targetFile1 = new File(testFolder.getRoot(), SOURCE_FILENAME + \".page1.txt\");\n\n final PageCounterFilter countFilter = new PageCounterFilter();\n final PageSelectorFilter selectorFilter = new PageSelectorFilter(1);\n\n final DefaultFilterChain chain = new DefaultFilterChain(false, countFilter, selectorFilter);\n LocalConverter.builder()\n .filterChain(chain)\n .build()\n .convert(SOURCE_FILE)\n .to(targetFile1)\n .execute();\n\n // Verify that the\n verify(refreshFilter, times(0))\n .doFilter(isA(OfficeContext.class), isA(XComponent.class), isA(FilterChain.class));\n }", "@Test\n public void serviceCandidateTest() {\n // TODO: test serviceCandidate\n }", "FeatureHolder filter(FeatureFilter filter);" ]
[ "0.7346696", "0.617284", "0.59130645", "0.5891409", "0.57699525", "0.57034194", "0.56410646", "0.5565663", "0.5565663", "0.556361", "0.5560921", "0.55303746", "0.55129987", "0.5509618", "0.5509618", "0.54713047", "0.5442282", "0.5424066", "0.5409543", "0.53994566", "0.5373897", "0.5368159", "0.53458977", "0.5326701", "0.5320501", "0.53025484", "0.53025484", "0.5298921", "0.5298764", "0.5289951", "0.52676016", "0.5262248", "0.52621615", "0.5256884", "0.52439654", "0.5243895", "0.52340996", "0.52309215", "0.5219137", "0.5209093", "0.5199126", "0.51987207", "0.5197063", "0.5190918", "0.5188109", "0.5170241", "0.5155234", "0.5152117", "0.5150206", "0.51499796", "0.5138676", "0.5132561", "0.5121661", "0.5120388", "0.51132", "0.5112736", "0.5110638", "0.510526", "0.5099759", "0.5096689", "0.5088757", "0.50876415", "0.50720114", "0.5070836", "0.5061779", "0.5059632", "0.5058583", "0.50531423", "0.50515723", "0.5051061", "0.50465024", "0.50440377", "0.50347745", "0.5034484", "0.5018338", "0.5018338", "0.5017854", "0.5013578", "0.50095224", "0.50072616", "0.50052017", "0.4998633", "0.49949956", "0.4994646", "0.49851555", "0.49795055", "0.4975585", "0.49755663", "0.4975109", "0.49728483", "0.497249", "0.4964973", "0.49622422", "0.49609727", "0.4960856", "0.49567577", "0.49563515", "0.4955771", "0.4955212", "0.4950643" ]
0.7594482
0
Special for this service is that the parameter HealthcareFacility in the request should be changed to the LogicalAddress. This test will test it
@Test public void testHealthcareFacilityInRequestIsChanged() { MessageContentsList messageContentsList = TestDataUtil.createRequest(LOGISK_ADRESS, testDataGenerator.createRequest( TEST_RR_ID_MANY_HITS_NO_ERRORS, "NotUsedInThisService")); FindContentResponseType eiResponse = eiResponseDataHelper.getResponseForPatient(TEST_RR_ID_MANY_HITS_NO_ERRORS); List<MessageContentsList> requestList = agpServiceFactory.createRequestList(messageContentsList, eiResponse); assertEquals(3, requestList.size()); final List<String> healthCareFacilities = requestList.stream() .map(mcl -> ((GetSubjectOfCareScheduleType) mcl.get(2)).getHealthcareFacility()).collect(Collectors.toList()); assertTrue("HealtCareFacility not updated correctly", healthCareFacilities.contains(TEST_LOGICAL_ADDRESS_4)); assertTrue("HealtCareFacility not updated correctly", healthCareFacilities.contains(TEST_LOGICAL_ADDRESS_5)); assertTrue("HealtCareFacility not updated correctly", healthCareFacilities.contains(TEST_LOGICAL_ADDRESS_6)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void requestDataForCustomer12212_checkAddressCity_expectBeverlyHills() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "public String changeContactDetails(final EmployeeAddressDTO employeeAddressDTO) throws ApplicationCustomException;", "@Test\n public void testEmergencyAddress() {\n // TODO: test EmergencyAddress\n }", "public void setAddress(java.lang.String param) {\r\n localAddressTracker = param != null;\r\n\r\n this.localAddress = param;\r\n }", "@Test\r\n\tvoid testContactServiceUpdatAddress() {\r\n\t\t// update contact address\r\n\t\tcontactService.updateContactAddress(id, id);\r\n\t\tassertTrue(contactService.getContactAddress(id).equals(id));\r\n\t}", "public void addFacility(Facility someFacility);", "@Test\n public void modifyAddressByCaseIdDifferentUPRN() throws Exception {\n\n CollectionCase rmCase = collectionCase.get(0);\n String caseId = rmCase.getId();\n AddressChangeDTO addressChange = addressChangeDTO.get(0);\n addressChange.getAddress().getUprn().setValue(0L);\n\n when(dataRepo.readCollectionCase(caseId)).thenReturn(Optional.of(rmCase));\n\n boolean exceptionThrown = false;\n try {\n caseSvc.modifyAddress(addressChange);\n } catch (CTPException e) {\n assertEquals(CTPException.Fault.BAD_REQUEST, e.getFault());\n exceptionThrown = true;\n }\n\n verify(dataRepo, times(1)).readCollectionCase(caseId);\n verify(eventPublisher, times(0)).sendEvent(any(), any(), any(), any());\n\n assertTrue(exceptionThrown);\n }", "@Test\n public void testAddTravel_InvalidCountryCodeExceptionEndpoint() throws Exception {\n dto.getEndpoint().setCountry(\"DTO\");\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testEditTravel_InvalidCountryCodeExceptionStartpoint() throws Exception {\n dto.getStartpoint().setCountry(\"DTO\");\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "public void setThisFacility(Facility thisFacility) {\n this.thisFacility = thisFacility;\n }", "public void setRegaddress(java.lang.String param) {\r\n localRegaddressTracker = param != null;\r\n\r\n this.localRegaddress = param;\r\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "public void setHospitalAddress(String hospitalAddress) {\n this.hospitalAddress = hospitalAddress == null ? null : hospitalAddress.trim();\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddress() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n address.setSelected(true);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNotNull(result.getData());\n Assert.assertTrue(result.isSuccess());\n }", "public String getHospitalAddress() {\n return hospitalAddress;\n }", "@Test\n public void testHandleKnownAddress() {\n final long startRange = 3L;\n final long endRange = 7L;\n\n RequestMsg request = getRequestMsg(\n getBasicHeader(ClusterIdCheck.CHECK, EpochCheck.CHECK),\n getKnownAddressRequestMsg(startRange, endRange)\n );\n\n final Set<Long> rKnown = LongStream.rangeClosed(startRange, endRange).boxed().collect(Collectors.toSet());\n when(mStreamLog.getKnownAddressesInRange(startRange, endRange)).thenReturn(rKnown);\n ArgumentCaptor<ResponseMsg> responseCaptor = ArgumentCaptor.forClass(ResponseMsg.class);\n logUnitServer.handleMessage(request, mChannelHandlerContext, mServerRouter);\n\n // Assert that the payload has a KNOWN_ADDRESS response and that the\n // base header fields have remained the same.\n verify(mServerRouter).sendResponse(responseCaptor.capture(), eq(mChannelHandlerContext));\n ResponseMsg response = responseCaptor.getValue();\n assertTrue(compareBaseHeaderFields(request.getHeader(), response.getHeader()));\n assertTrue(response.getPayload().hasKnownAddressResponse());\n\n // Assert that the response contains the expected addresses.\n assertEquals(rKnown, new HashSet<>(response.getPayload().getKnownAddressResponse().getKnownAddressList()));\n }", "public void setAddress(String address) { this.address = address; }", "@Test\n public void testAddTravel_InvalidCountryCodeExceptionStartpoint() throws Exception {\n dto.getStartpoint().setCountry(\"DTO\");\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n\tpublic void testPatient() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/edit-patient?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "private void createFacilities(LocationManagement client,\n String siteGUID,\n String userId) throws FVTUnexpectedCondition\n {\n final String activityName = \"createFacilities\";\n\n FixedLocationProperties fixedLocationProperties = new FixedLocationProperties();\n fixedLocationProperties.setTimeZone(\"GMT\");\n\n LocationProperties locationProperties;\n \n try\n {\n Map<String, String> additionalProperties = new HashMap<>();\n additionalProperties.put(facility1AdditionalPropertyName, facility1AdditionalPropertyValue);\n\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility1Name);\n locationProperties.setIdentifier(facility1Identifier);\n locationProperties.setDisplayName(facility1DisplayName);\n locationProperties.setDescription(facility1Description);\n locationProperties.setAdditionalProperties(additionalProperties);\n \n String facility1GUID = client.createLocation(userId, null, null, locationProperties);\n\n if (facility1GUID == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no GUID for Create of definition 1)\");\n }\n\n client.setLocationAsFixedPhysical(userId, null, null, facility1GUID, fixedLocationProperties);\n client.setupNestedLocation(userId, null, null, siteGUID, facility1GUID, null);\n \n LocationElement retrievedElement = client.getLocationByGUID(userId, facility1GUID);\n LocationProperties retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from Retrieve)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Retrieve of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Retrieve of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Retrieve of 1)\");\n }\n if (retrievedProperties.getAdditionalProperties() == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(null additionalProperties from Retrieve of 1)\");\n }\n else if (! facility1AdditionalPropertyValue.equals(retrievedProperties.getAdditionalProperties().get(facility1AdditionalPropertyName)))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(bad additionalProperties from Retrieve of 1)\");\n }\n\n List<LocationElement> facilityList = client.getLocationsByName(userId, facility1Name, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility for RetrieveByName of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty facility list for RetrieveByName of 1)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Facility list for RetrieveByName of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no Facility 1 from Retrieve)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Facility 1 RetrieveByName of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Facility 1 RetrieveByName of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Facility 1 RetrieveByName of 1)\");\n }\n \n facilityList = client.findLocations(userId, searchString, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for findLocations of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for findLocations of 1)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for findLocations of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of 1)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n else\n {\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n }\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from RetrieveOfMembers)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveOfMembers of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveOfMembers of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveOfMembers of 1)\");\n }\n\n /*\n * Check that not possible to create an element with the same qualified name.\n */\n try\n {\n client.createLocation(userId, null, null, locationProperties);\n\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(duplicate create of facility allowed)\");\n }\n catch (InvalidParameterException okResult)\n {\n // nothing to do\n }\n\n /*\n * Now do the second value\n */\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility2Name);\n locationProperties.setIdentifier(facility2Identifier);\n locationProperties.setDisplayName(facility2DisplayName);\n locationProperties.setDescription(facility2Description);\n locationProperties.setAdditionalProperties(additionalProperties);\n String facility2GUID = client.createLocation(userId, null, null, locationProperties);\n\n if (facility2GUID == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no GUID for Create of definition 2)\");\n }\n\n client.setupNestedLocation(userId, null, null, siteGUID, facility2GUID, new NestedLocationProperties());\n\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 2 from Retrieve)\");\n }\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Retrieve of 2)\");\n }\n if (! facility2DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Retrieve of 2)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from Retrieve of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Retrieve of 2)\");\n }\n\n facilityList = client.getLocationsByName(userId, facility2Name, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for RetrieveByName of 2)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for RetrieveByName of 2)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for RetrieveByName of 2 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveByName of 2)\");\n }\n if (! facility2DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveByName of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveByName of 2)\");\n }\n\n facilityList = client.findLocations(userId, searchString, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for findLocations of all)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for findLocations of all)\");\n }\n else if (facilityList.size() != 3)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for findLocations of all contains\" + facilityList.size() +\n \" elements)\");\n }\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of both)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of both)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations of both contains\" + facilityList.size() +\n \" elements)\");\n }\n\n /*\n * Add the new name\n */\n locationProperties = new LocationProperties();\n locationProperties.setDisplayName(facility2NameUpdate);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveUpdate of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2)\");\n }\n\n /*\n * Update location 2 with location 1's qualified name - this should fail\n */\n try\n {\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility1Name);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Duplicate update allowed)\");\n }\n catch (InvalidParameterException expectedResult)\n {\n // all ok\n }\n\n /*\n * Location 2 should be exactly as it was\n */\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName \" + retrievedProperties.getDisplayName() + \" from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2)\");\n }\n\n /*\n * Update location 2 with a new qualified name - this should work ok\n */\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility2NameUpdate);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n\n /*\n * Location 2 should be updated\n */\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2NameUpdate.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2 after qualified name change)\");\n }\n\n /*\n * By detaching definition 2, then should only get value 1 back from the set membership request.\n */\n client.clearNestedLocation(userId, null, null, siteGUID, facility2GUID);\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of 1 after detach)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of 1 after detach)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations after detach of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n else\n {\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n }\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from RetrieveOfMembers of 1 after detach)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveOfMembers of 1 after detach)\");\n }\n \n /*\n * Now reattach value 2 and check it reappears in the set.\n */\n client.setupNestedLocation(userId, null, null, siteGUID, facility2GUID, null);\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for RetrieveSetMembers of both after reattach)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for RetrieveSetMembers of of both after reattach)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for RetrieveSetMembers of both after reattach contains\" + facilityList.size() +\n \" elements)\");\n }\n }\n catch (FVTUnexpectedCondition testCaseError)\n {\n throw testCaseError;\n }\n catch (Exception unexpectedError)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError);\n }\n }", "@Test\n public void iPAddressIsThreatTest() throws Exception {\n String value = null;\n IPThreatResponse response = api.iPAddressIsThreat(value);\n\n // TODO: test validations\n }", "public void testupdateAddress1() throws Exception {\r\n try {\r\n this.dao.updateAddress(null, false);\r\n fail(\"IllegalArgumentException expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "@Test\n\tpublic void searhEmpIdtoAddress() {\n\t\tEmployee employee = employeeService.searhEmpIdtoAddress();\n\t\tAssert.assertEquals(id.intValue(), employee.getId().intValue());\n\t\n\t}", "@Test\n\tpublic void useResponseSpecification() {\n\t\t\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\t\tget(\"/2014/1/circuits.json\").\n\t\tthen().\n\t\t\tspec(responseSpec).\n\t\tand().\n\t\t\tbody(\"MRData.CircuitTable.Circuits.Location[0].locality\",equalTo(\"Melbourne\"));\n\t}", "@Test\n public void sipAddressTest() {\n // TODO: test sipAddress\n }", "abstract void addressValidity();", "public void setExternalAddress(String address);", "public void setInternalAddress(String address);", "@Test\n public void iPAddressGeolocateStreetAddressTest() throws Exception {\n String value = null;\n GeolocateStreetAddressResponse response = api.iPAddressGeolocateStreetAddress(value);\n\n // TODO: test validations\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.AddressWithDeliverability addNewAddressHistory();", "private ApplicationAddressReqType buildUpdateApplicationAddressChangeRequest(\n UpdateApplicationAddressForm updateApplicationAddressForm) {\n System.out.println(\"inside buildUpdateApplicationAddressChangeRequest\");\n ApplicationAddressReqType applicationAddressReqType = new ApplicationAddressReqType();\n AuditAdmin audit = new AuditAdmin();\n audit.setLastModifiedUser(\"erinkklein FQT Attor\");\n applicationAddressReqType.setAudit(audit);\n System.out.println(audit.getLastModifiedUser());\n \n LifecycleAdmin lifecycle= new LifecycleAdmin();\n lifecycle.setBeginDate(\"1595704744\");\n lifecycle.setEndDate(\"1595704744\");\n applicationAddressReqType.setLifeCycle(lifecycle);\n applicationAddressReqType.setChangeCustomerNumber(updateApplicationAddressForm.getCustomerNumber());\n applicationAddressReqType.setNoticeActionCd(\"addressChange\");\n applicationAddressReqType.setRegistrationNumber(updateApplicationAddressForm.getRegistrationNumber());\n applicationAddressReqType.setRequestIdentifier(updateApplicationAddressForm.getPairId());\n \n List<AddressChangeSupportData> addressSupportingDataArray = new ArrayList<AddressChangeSupportData>();\n \n AddressChangeSupportData addressSupportingData = new AddressChangeSupportData();\n addressSupportingData.setNameLineText(updateApplicationAddressForm.getCommonName());\n \n addressSupportingData.setSignature(updateApplicationAddressForm.getSubmitterSignature());\n addressSupportingDataArray.add(addressSupportingData);\n applicationAddressReqType.setSupportData(addressSupportingDataArray);\n System.out.println(applicationAddressReqType.getChangeCustomerNumber());\n \n return applicationAddressReqType;\n }", "public void testSetCountry() {\r\n try {\r\n address.setCountry(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "@Test\n public void iPAddressPostTest() throws Exception {\n String value = null;\n GeolocateResponse response = api.iPAddressPost(value);\n\n // TODO: test validations\n }", "@Override\n\tpublic void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] arg0) {\n\n\t}", "public void ClickOnPhysicalAddressCheckbox()\n\t\t{\n\t\t\tPhysicalAddressCheckbox.click();\n\t\t}", "public void setLocalPharmacyDetails() {\n\n\t\tlocalFacilityDetails.setPharmacyName(txtPharmacyName.getText());\n\t\tlocalFacilityDetails.setPharmacist(txtPharmacistName1.getText());\n\t\tlocalFacilityDetails.setAssistantPharmacist(txtPharmacyAssistant.getText());\n\t\tlocalFacilityDetails.setModified(true);\n\n\t\tlocalFacilityDetails.setStreet(txtStreetAdd.getText());\n\t\tlocalFacilityDetails.setCity(txtCity.getText());\n\t\tlocalFacilityDetails.setContactNo(txtTel.getText());\n\n\t}", "public void setAddress(String address) {\n this.address = address;\n }", "public void testAddAddress1() throws Exception {\r\n try {\r\n this.dao.addAddress(null, false);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "@Test\n\tpublic void displayAddressTest() {\n\t\tassertNotNull(\"Address is not null\", instance.displayAddress());\n\t}", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "@Override\n\t\t\t\tpublic void OnUpdateTrafficFacility(\n\t\t\t\t\t\tAMapNaviTrafficFacilityInfo[] arg0) {\n\t\t\t\t\t\n\t\t\t\t}", "StatePacBuilder administrativeControl(AdministrativeControl administrativeControl);", "@Test\r\n public void getStreetNameTest()\r\n {\r\n Assert.assertEquals(stub.getStreetName(), STREETNAME);\r\n }", "@Test\n public void testReceiverRegionEndpointBloodType() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "@Test\n public void modifyAddressByCaseIdNotFound() throws Exception {\n\n CollectionCase rmCase = collectionCase.get(0);\n String caseId = rmCase.getId();\n AddressChangeDTO addressChange = addressChangeDTO.get(0);\n\n when(dataRepo.readCollectionCase(caseId)).thenReturn(Optional.empty());\n\n boolean exceptionThrown = false;\n try {\n caseSvc.modifyAddress(addressChange);\n } catch (CTPException e) {\n assertEquals(CTPException.Fault.RESOURCE_NOT_FOUND, e.getFault());\n exceptionThrown = true;\n }\n\n verify(dataRepo, times(1)).readCollectionCase(caseId);\n verify(eventPublisher, times(0)).sendEvent(any(), any(), any(), any());\n\n assertTrue(exceptionThrown);\n }", "public void testSetAddressType() {\r\n try {\r\n address.setAddressType(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "private void defaultIndContactCharShouldBeFound(String filter) throws Exception {\n restIndContactCharMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$.[*].id\").value(hasItem(indContactChar.getId().intValue())))\n .andExpect(jsonPath(\"$.[*].type\").value(hasItem(DEFAULT_TYPE)))\n .andExpect(jsonPath(\"$.[*].streetOne\").value(hasItem(DEFAULT_STREET_ONE)))\n .andExpect(jsonPath(\"$.[*].streetTwo\").value(hasItem(DEFAULT_STREET_TWO)))\n .andExpect(jsonPath(\"$.[*].city\").value(hasItem(DEFAULT_CITY)))\n .andExpect(jsonPath(\"$.[*].stateOrProvince\").value(hasItem(DEFAULT_STATE_OR_PROVINCE)))\n .andExpect(jsonPath(\"$.[*].country\").value(hasItem(DEFAULT_COUNTRY)))\n .andExpect(jsonPath(\"$.[*].postCode\").value(hasItem(DEFAULT_POST_CODE.intValue())))\n .andExpect(jsonPath(\"$.[*].phoneNumber\").value(hasItem(DEFAULT_PHONE_NUMBER.intValue())))\n .andExpect(jsonPath(\"$.[*].emailAddress\").value(hasItem(DEFAULT_EMAIL_ADDRESS)))\n .andExpect(jsonPath(\"$.[*].faxNumber\").value(hasItem(DEFAULT_FAX_NUMBER.intValue())))\n .andExpect(jsonPath(\"$.[*].latitude\").value(hasItem(sameNumber(DEFAULT_LATITUDE))))\n .andExpect(jsonPath(\"$.[*].longitude\").value(hasItem(sameNumber(DEFAULT_LONGITUDE))))\n .andExpect(jsonPath(\"$.[*].svContactId\").value(hasItem(DEFAULT_SV_CONTACT_ID.intValue())))\n .andExpect(jsonPath(\"$.[*].isEmailValid\").value(hasItem(DEFAULT_IS_EMAIL_VALID.booleanValue())))\n .andExpect(jsonPath(\"$.[*].isAddressValid\").value(hasItem(DEFAULT_IS_ADDRESS_VALID.booleanValue())))\n .andExpect(jsonPath(\"$.[*].indConId\").value(hasItem(DEFAULT_IND_CON_ID.intValue())));\n\n // Check, that the count call also returns 1\n restIndContactCharMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"1\"));\n }", "@Test\n public void testTransplantListEndpointQueryRegion() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,null,\"Auckland\",upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "@Test\n public void testSetLocalExtendedCircuitId() throws Exception {\n isisNeighbor.setLocalExtendedCircuitId(1);\n result = isisNeighbor.localExtendedCircuitId();\n assertThat(result, is(1));\n }", "@Test\n public void testSetAddress() {\n System.out.println(\"setAddress\");\n user.setAddress(\"Tiquipaya\");\n assertEquals(\"Tiquipaya\", user.getAddress());\n }", "@Test(timeout = 10000L)\n public void testSetLoadBalancerInformation() throws Exception {\n CommonDriverAdminTests.testSetLoadBalancerInformation(client);\n }", "public abstract LinphoneAddress getAddress();", "@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}", "@Test\n\t// @Disabled\n\tvoid testViewCustomerbyVehicleLocation() {\n\n\t\tCustomer customer1 = new Customer(1, \"tommy\", \"cruise\", \"951771122\", \"tom@gmail.com\");\n\t\tVehicle vehicle1 = new Vehicle(101, \"TN02J0666\", \"bus\", \"A/C\", \"prime\", \"chennai\", \"13\", 600.0, 8000.0);\n\t\tVehicle vehicle2 = new Vehicle(102, \"TN02J0776\", \"car\", \"nonA/C\", \"prime\", \"chennai\", \"13\", 600.0, 8000.0);\n\t\tList<Vehicle> vehicleList =new ArrayList<>();\n\t\tvehicleList.add(vehicle1);\n\t\tvehicleList.add(vehicle2);\n\t\tcustomer1.setVehicle(vehicleList);\n\t\tList<Customer> customerList = new ArrayList<>();\n\t\tcustomerList.add(customer1);\n\t\tMockito.when(custRep.findbyVehicleLocation(\"chennai\")).thenReturn(customerList);\n\t\tList<Customer> cust3 = custService.findbyVehicleLocation(\"chennai\");\n\t\tassertEquals(1, cust3.size());\n\t}", "@Test\r\n public void getStreetNumberTest()\r\n {\r\n Assert.assertEquals(stub.getStreetNumber(), STREETNUMBER);\r\n }", "void setAddress(String address) throws IllegalArgumentException;", "public void setAddress(String _address){\n address = _address;\n }", "public interface HealthBlockRecordsDataService extends MotechDataService<HealthBlock> {\n\n /**\n * finds the Health Block details by its parent code\n *\n * @param stateCode\n * @param districtCode\n * @param talukaCode\n * @param healthBlockCode\n * @return HealthBlock\n */\n @Lookup\n HealthBlock findHealthBlockByParentCode(@LookupField(name = \"stateCode\") Long stateCode, @LookupField(name = \"districtCode\") Long districtCode,\n @LookupField(name = \"talukaCode\") Long talukaCode, @LookupField(name = \"healthBlockCode\") Long healthBlockCode);\n\n}", "@Test\n public void testSetLocalCircuitId() throws Exception {\n isisNeighbor.setLocalCircuitId((byte) 1);\n result4 = isisNeighbor.localCircuitId();\n assertThat(result4, is((byte) 1));\n }", "@Test\n public void recipientCountryCodeTest() {\n // TODO: test recipientCountryCode\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "@Test\n public void iPAddressIpIntelligenceTest() throws Exception {\n String value = null;\n IPIntelligenceResponse response = api.iPAddressIpIntelligence(value);\n\n // TODO: test validations\n }", "public abstract void setCustomerAddress(Address address);", "void addHasAddress(String newHasAddress);", "@Test\n\tpublic void testIndividualSettersAddress() {\n\t\tassertTrue(beanTester.testSetterForField(\"zipcode\"));\n\t}", "@Test(priority = 5)\n\tpublic void verify_Weather_Data_Appears_OnSearching_By_City_StateCodeAndCountryCode() {\n\t\tWeatherAPI.getWeatherInfo(ReadWrite.getProperty(\"Noida_City_State_Country\"),\n\t\t\t\tConfigFileReader.getProperty(\"appid\"), 200);\n\n\t}", "@RequestMapping(value = \"/addBillingAddress\", method = RequestMethod.POST)\r\n @ResponseBody\r\n public String addBillingAddress(\r\n \t\t@RequestParam(\"fullName\") String fullName, \r\n \t\t@RequestParam(\"landMark\") String landMark, \r\n \t\t@RequestParam(\"mobileNumber\") String mobileNumber,\r\n \t\t@RequestParam(\"city\") String city,\r\n \t\t@RequestParam(\"type\") String type)\r\n {\r\n OrderItem orderItem = simpleWorksDashboardManager.addBillingAddress(fullName, landMark, mobileNumber, city, type);\r\n return \"{\\\"status\\\": true}\";\r\n }", "@Test\r\n\tvoid testContactServiceUpdatPhone() {\r\n\t\t// update contact phone\r\n\t\tcontactService.updateContactPhone(id, \"9876543210\");\r\n\t\tassertTrue(contactService.getContactPhone(id).equals(\"9876543210\"));\r\n\t}", "public void setAddressCity(String addressCity) {\n this.addressCity = addressCity;\n }", "@Test\n\tpublic void displayAddressTestLabel() {\n\t\tassertNotNull(\"Address Label is not null\", instance.displayAddressLabel());\n\t}", "private void setValueForEditAddrss() {\n ServiceCaller serviceCaller = new ServiceCaller(context);\n serviceCaller.callGetAllAddressByIdService(addressid, new IAsyncWorkCompletedCallback() {\n @Override\n public void onDone(String workName, boolean isComplete) {\n if (isComplete) {\n if (!workName.trim().equalsIgnoreCase(\"no\") && !workName.equalsIgnoreCase(\"\")) {\n ContentDataAsArray contentDataAsArray = new Gson().fromJson(workName, ContentDataAsArray.class);\n for (Data data : contentDataAsArray.getData()) {\n if (data != null) {\n edt_name.setText(data.getName());\n edt_phone.setText(data.getPhone());\n edt_landmark.setText(data.getLandmark());\n edt_address.setText(data.getAddress());\n edt_city.setText(data.getCity());\n edt_state.setText(data.getState());\n }\n }\n }\n }\n }\n });\n\n }", "void setSpecimen(org.hl7.fhir.ResourceReference specimen);", "public CallForService(String address, Date serviceRequestDate, String probDescrip, int ageOfwaterHeater){\n this.address = address;\n this.serviceRequestDate = serviceRequestDate;\n this.probDescrip = probDescrip ;\n this.ageOfwaterHeater = ageOfwaterHeater;\n }", "public void setLogicalFlightID(int value) {\n this.logicalFlightID = value;\n }", "@Test\n public void testLocalExtendedCircuitId() throws Exception {\n isisNeighbor.setLocalExtendedCircuitId(1);\n result = isisNeighbor.localExtendedCircuitId();\n assertThat(result, is(1));\n }", "public void testAddAddress4() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.getCountry().setId(-1);\r\n this.dao.addAddress(address, false);\r\n fail(\"IPE expected\");\r\n } catch (InvalidPropertyException e) {\r\n //good\r\n }\r\n }", "@Test\n public void testIsEntityAllowedIpOnly() throws Exception {\n // EmbeddedBigDBService bigdb = floodlightService.getBigDBService();\n expect(topology.isAttachmentPointPort(anyLong(), anyShort())).andReturn(true)\n .anyTimes();\n replay(topology);\n\n Entity e1 =\n new Entity(1L,\n null,\n IPv4.toIPv4Address(\"0.0.0.1\"),\n 1L,\n 1,\n null);\n Entity e2 = new Entity(1L, null, null, 1L, 1, null);\n Entity e3 = new Entity(2L, null, 1, 1L, 1, null);\n Entity[] entities = new Entity[] { e1, e2, e3 };\n\n // no rules. all entities allowed in all address-spaces.\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_AS1);\n\n // progressively populate ip to mac anti-spoofing rules for AS1.\n // we check address-space foobar to ensure it's unaffected by the rules.\n\n // lock IP2 to Mac 3 in AS1. Doesn't affect our entities\n HostSecurityIpAddressRow r3 =\n new HostSecurityIpAddressRow(ADDRESS_SPACE_AS1,\n null,\n 3L,\n 2,\n EnumSet.of(DeviceField.MAC));\n r3.writeToStorage();\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_AS1);\n\n // lock IP1 to Mac 1 in AS1. Entity e3 violates this rule and\n // should thus be disallowed.\n HostSecurityIpAddressRow r4 =\n new HostSecurityIpAddressRow(ADDRESS_SPACE_AS1,\n null,\n 1L,\n 1,\n EnumSet.of(DeviceField.MAC,\n DeviceField.IPV4));\n r4.writeToStorage();\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { true, true, false },\n entities,\n ADDRESS_SPACE_AS1);\n r4.removeFromStorage();\n\n // Lock Ip1 to Mac 3 in AS1. Not both e1 and e3 violate this rule.\n\n HostSecurityIpAddressRow r5 =\n new HostSecurityIpAddressRow(ADDRESS_SPACE_AS1,\n null,\n 3L,\n 1,\n EnumSet.of(DeviceField.MAC));\n r5.writeToStorage();\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { false, true, false },\n entities,\n ADDRESS_SPACE_AS1);\n\n // previous rule still in force. Now we also allow IP1 on Mac 1.\n // e1 becomes valid again\n HostSecurityIpAddressRow r6 =\n new HostSecurityIpAddressRow(ADDRESS_SPACE_AS1,\n null,\n 1L,\n 1,\n EnumSet.of(DeviceField.MAC));\n r6.writeToStorage();\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { true, true, false },\n entities,\n ADDRESS_SPACE_AS1);\n\n // previous rules still in force. Now we also allow IP1 on Mac 2.\n // e3 is valid again (i.e., all entities are now allowed)\n HostSecurityIpAddressRow r7 =\n new HostSecurityIpAddressRow(ADDRESS_SPACE_AS1,\n null,\n 2L,\n 1,\n EnumSet.of(DeviceField.MAC));\n r7.writeToStorage();\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_FOOBAR);\n verifyEntityAllowed(new boolean[] { true, true, true },\n entities,\n ADDRESS_SPACE_AS1);\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void testIsValidAuthorityPositiveRequeryInList() throws IOException {\n final FileMockContext context = new FileMockContext(androidx.test.platform.app.InstrumentationRegistry.getInstrumentation().getContext());\n final Discovery discovery = new Discovery(context);\n final URL endpointFull = new URL(\"https://login.windows-ppe.net/common\");\n\n final HttpURLConnection mockedConnection = Mockito.mock(HttpURLConnection.class);\n HttpUrlConnectionFactory.setMockedHttpUrlConnection(mockedConnection);\n Util.prepareMockedUrlConnection(mockedConnection);\n\n final String response = \"{\\\"tenant_discovery_endpoint\\\":\\\"valid endpoint\\\"}\";\n Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(response));\n Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK);\n\n try {\n discovery.validateAuthority(endpointFull);\n } catch (final AuthenticationException e) {\n fail();\n } finally {\n HttpUrlConnectionFactory.setMockedHttpUrlConnection(null);\n }\n\n HttpUrlConnectionFactory.setMockedHttpUrlConnection(null);\n // case sensitivity check\n final URL endpointCaseDifferent = new URL(\"https://logiN.Windows-PPE.Net/Common\");\n try {\n discovery.validateAuthority(endpointCaseDifferent);\n } catch (final AuthenticationException e) {\n fail();\n }\n\n final HttpURLConnection mockedConnection2 = Mockito.mock(HttpURLConnection.class);\n HttpUrlConnectionFactory.setMockedHttpUrlConnection(mockedConnection2);\n Util.prepareMockedUrlConnection(mockedConnection);\n\n final String addHostResponse = \"{\\\"tenant_discovery_endpoint\\\":\\\"valid endpoint\\\"}\";\n Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(addHostResponse));\n Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK);\n\n final URL endpointTest = new URL(\"https://login.test-direct-add.net/common\");\n try {\n discovery.validateAuthority(endpointTest);\n\n HttpUrlConnectionFactory.setMockedHttpUrlConnection(null);\n discovery.validateAuthority(endpointTest);\n } catch (final AuthenticationException e) {\n fail();\n }\n }", "@Test\n public void test() {\n\n /*\n * Testing to find all list of Offices\n */\n List<Employee> all = employeeDao.findAll();\n Assert.assertNotNull(all);\n for (Employee eml : all) {\n System.out.println(eml.toString());\n }\n Assert.assertEquals(5, all.size());\n\n /*\n * Testing to find Employee by ID\n */\n Employee employeeById = employeeDao.findById(3);\n Assert.assertNotNull(employeeById);\n Assert.assertEquals(\"Борис\", employeeById.getFirstName());\n Assert.assertEquals(3, employeeById.getOffice().getId().longValue());\n\n /*\n * Testing to find Employee by Filter without REQUIRED PARAMETER: OFFICE_ID\n */\n EmployeeFilter filterWithoutRequiredOfficeId = new EmployeeFilter();\n filterWithoutRequiredOfficeId.firstName = \"и\";\n List<Employee> employeeListWithoutRequiredOfficeId = employeeDao.findByFilter(filterWithoutRequiredOfficeId);\n Assert.assertNull(employeeListWithoutRequiredOfficeId);\n\n /*\n * Testing to find Employee by Filter with REQUIRED PARAMETER: OFFICE_ID + potential parameter firstNAme and citizenshipCode\n */\n EmployeeFilter filter = new EmployeeFilter();\n filter.officeId = 3;\n filter.firstName = \"рис\";\n List<Employee> employeeByFilterList = employeeDao.findByFilter(filter);\n Assert.assertNotNull(employeeByFilterList);\n for (Employee emp : employeeByFilterList) {\n System.out.println(emp.toString());\n }\n Assert.assertEquals(3, employeeByFilterList.get(0).getId().longValue());\n\n EmployeeFilter filter1 = new EmployeeFilter();\n filter1.officeId = 1;\n filter1.citizenshipCode = \"601\";\n List<Employee> employeeList = employeeDao.findByFilter(filter1);\n Assert.assertNotNull(employeeList);\n for (Employee emp : employeeList) {\n System.out.println(emp.toString());\n }\n Assert.assertEquals(1, employeeList.size());\n Assert.assertEquals(\"Российская Федерация\", employeeList.get(0).getCountry().getName());\n Assert.assertEquals(\"Никита\", employeeList.get(0).getFirstName());\n\n /*\n * Testing to save(add) new Employee\n */\n Office setableOffice = officeDao.findById(1);\n Document setableDocument = documentDao.findByCode(String.valueOf(21));\n Country setableCountry = countryDao.findByCode(String.valueOf(601));\n Assert.assertNotNull(setableOffice);\n Employee savableEmployee = new Employee();\n savableEmployee.setOffice(setableOffice);\n savableEmployee.setFirstName(\"Евгений\");\n savableEmployee.setPosition(\"программист\");\n savableEmployee.setDocument(setableDocument);\n savableEmployee.setCountry(setableCountry);\n employeeDao.save(savableEmployee);\n Employee empl2 = employeeDao.findById(6);\n System.out.println(empl2.toString());\n Assert.assertEquals(\"Евгений\", empl2.getFirstName());\n\n /*\n * Testing to update Employee by ID\n */\n Employee updatebleEmployee = employeeDao.findById(6);\n updatebleEmployee.setFirstName(\"Евгения\");\n updatebleEmployee.setSecondName(\"Лоськова\");\n updatebleEmployee.setPosition(\"младший программист\");\n updatebleEmployee.setIsIdentified(true);\n employeeDao.update(updatebleEmployee);\n System.out.println(employeeDao.findById(6).toString());\n Assert.assertEquals(\"Лоськова\", employeeDao.findById(6).getSecondName());\n }", "@When(\"^I send the request to Address Management API 'GET AddressUnitId' endpoint$\")\n public void getAddressUnitId() {\n RequestSpecBuilder request = (RequestSpecBuilder) scenarioSession.getData(SessionKey.REQUEST);\n\n //send the request and get the response\n Response response = addressManagementApi.getAddressUnitId(request);\n\n //store the response for use in later steps\n scenarioSession.putData(SessionKey.LATEST_RESPONSE, response);\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "@HTTP(\n method = \"PATCH\",\n path = \"/apis/config.openshift.io/v1/infrastructures/{name}\",\n hasBody = true\n )\n @Headers({ \n \"Content-Type: application/merge-patch+json\",\n \"Accept: */*\"\n })\n KubernetesCall<Infrastructure> patchInfrastructure(\n @Path(\"name\") String name, \n @Body Infrastructure body, \n @QueryMap PatchInfrastructure queryParameters);", "public static void assignFacilityToUse(Facility f, UseRequest useRequest)\n {\n Database.db.get(f).getFacilityUse().getSchedule().getSchedule().put(useRequest, useRequest.getIntervalSlot());\n }", "@Test\n public void test_getFacilities() throws Exception {\n ResponseEntity<FacilityResponse> response = restTemplate.getForEntity(\"/v1/facilities\", FacilityResponse.class);\n\n // assert\n Assertions.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n Assertions.assertThat(Collections.singletonList(Objects.requireNonNull(response.getBody()).getFacilities()));\n Assertions.assertThat(response.getBody().getFacilities().get(0).getName()).isEqualTo(\"p1\");\n // response structure: //{\"facilities\":[{\"id\":101,\"name\":\"p1\",\"address\":\"testAddress\"}]}\n }", "public void testRetrieveAddress() throws Exception {\r\n try {\r\n this.dao.retrieveAddress(-1);\r\n fail(\"IllegalArgumentException expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void test8(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getParameter(\"domain\"));\n\n if(addr.getCanonicalHostName().endsWith(\"trustme.com\")){ /* BUG */\n\n }\n }", "public void setHouseAddr(String houseAddr) {\n this.houseAddr = houseAddr == null ? null : houseAddr.trim();\n }", "org.hl7.fhir.ResourceReference addNewSpecimen();", "@Test\n public void getLatestAddressValidCaseNoneHIByUPRNOnly() throws Exception {\n\n final Date earliest = new Date();\n final Date mid = DateUtils.addDays(new Date(), 1);\n final Date latest = DateUtils.addDays(new Date(), 2);\n collectionCase.get(0).setCreatedDateTime(mid);\n collectionCase.get(0).setCaseType(\"HH\");\n collectionCase.get(0).setAddressInvalid(Boolean.TRUE); // INVALID\n collectionCase.get(1).setCreatedDateTime(latest);\n collectionCase.get(1).setCaseType(\"HI\"); // INVALID\n collectionCase.get(2).setCreatedDateTime(earliest);\n collectionCase.get(2).setCaseType(\"HH\"); // VALID / EXPECTED\n when(dataRepo.readNonHILatestCollectionCaseByUprn(Long.toString(UPRN.getValue()), true))\n .thenReturn(Optional.of(collectionCase.get(2)));\n CaseDTO result = caseSvc.getLatestValidNonHICaseByUPRN(UPRN);\n\n assertEquals(\n \"Resultant Case created date should match expected case with latest date and Valid Address\",\n UUID.fromString(collectionCase.get(2).getId()),\n result.getCaseId());\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void SetCheckoutRegistrationHousenumber(String hosuenumber){\r\n\t\tString Hosuenumber = getValue(hosuenumber);\r\n\t\tString countrygroup_houseno = \"Netherland\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+Hosuenumber);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration House number should be entered as '\"+Hosuenumber+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_houseno).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationhousenumber\"),Hosuenumber);\r\n\t\t\t\tSystem.out.println(\"Registration house number is entered as '\"+Hosuenumber+\"' \");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Registration house number is entered as '\"+Hosuenumber+\"' \");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{ \r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationaddress\"),Hosuenumber);\r\n\t\t\t\tSystem.out.println(\"Registration Address is entered as \"+Hosuenumber);\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Address is entered as \"+Hosuenumber);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration house number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationhousenumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }" ]
[ "0.54055834", "0.5393165", "0.51129395", "0.50588626", "0.4975873", "0.49357194", "0.49248314", "0.49247274", "0.4914324", "0.48620078", "0.48192063", "0.479978", "0.47870332", "0.47756705", "0.47701246", "0.4769295", "0.4749556", "0.47375315", "0.47232115", "0.4689704", "0.4685635", "0.46746287", "0.46735632", "0.46665058", "0.46444523", "0.46422553", "0.46238768", "0.46166506", "0.46133658", "0.46073005", "0.4592348", "0.45756987", "0.45658207", "0.4564728", "0.4560427", "0.45531064", "0.45511898", "0.45409948", "0.4540599", "0.45296577", "0.45296577", "0.45296577", "0.45296577", "0.45287767", "0.4514056", "0.4507224", "0.45020828", "0.4498649", "0.44891277", "0.44850856", "0.44793215", "0.44792455", "0.44785774", "0.44765022", "0.44761667", "0.4465094", "0.44632047", "0.44570422", "0.44284862", "0.44245768", "0.44176555", "0.44106507", "0.44085202", "0.44023636", "0.43946612", "0.43937084", "0.43929878", "0.43873143", "0.43791896", "0.43775523", "0.43772987", "0.43766522", "0.43752903", "0.4371112", "0.43682027", "0.4363483", "0.43619198", "0.43616515", "0.43612984", "0.43612957", "0.4357003", "0.43520167", "0.43520132", "0.4346156", "0.4346156", "0.4346156", "0.43416238", "0.4339181", "0.43339828", "0.4333796", "0.43312812", "0.4329722", "0.43281162", "0.43261632", "0.43253785", "0.43253785", "0.43253785", "0.43252936", "0.43246606", "0.43246606" ]
0.6608557
0
TODO Autogenerated method stub
@Override public InternalResultsResponse<ServicoItens> fetchServicoItensById(FetchByIdRequest request) { return null; }
{ "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_main, 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 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 {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, 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 public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@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 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\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\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 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 \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 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\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 boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\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.7249559", "0.7204226", "0.71981144", "0.7180145", "0.7110589", "0.70431244", "0.7041351", "0.70150685", "0.70118093", "0.69832", "0.6947845", "0.69419056", "0.6937257", "0.6920975", "0.6920975", "0.68938893", "0.68867826", "0.6878929", "0.6877472", "0.68656766", "0.68656766", "0.68656766", "0.68656766", "0.68553543", "0.6850232", "0.6822862", "0.68201447", "0.68163574", "0.68163574", "0.6816304", "0.6809227", "0.6803687", "0.6801118", "0.67946446", "0.67919034", "0.67913854", "0.6786644", "0.67618436", "0.6760987", "0.67516655", "0.67475504", "0.67475504", "0.6744612", "0.67433023", "0.6729379", "0.67267543", "0.67261547", "0.67261547", "0.6724336", "0.6714574", "0.67084044", "0.670811", "0.67026806", "0.6701955", "0.670018", "0.6697785", "0.66899645", "0.6687168", "0.6687168", "0.66860044", "0.66835976", "0.6682339", "0.668104", "0.6671387", "0.66706777", "0.6665407", "0.6659777", "0.6659777", "0.6659777", "0.6659032", "0.6658105", "0.6658105", "0.6658105", "0.66553104", "0.6654278", "0.6654054", "0.66521645", "0.6650613", "0.66495895", "0.6649238", "0.66490036", "0.6648245", "0.66481483", "0.6646514", "0.6646321", "0.6645122", "0.66418123", "0.6638334", "0.6636035", "0.6635416", "0.6635416", "0.6635416", "0.6635411", "0.66325295", "0.6631742", "0.66299105", "0.6629049", "0.6627932", "0.66237384", "0.662195", "0.662195" ]
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(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); final SharedPreferences.Editor editor = prefs.edit(); //noinspection SimplifiableIfStatement if (id == R.id.action_change_setup) { editor.putString("INIT_SETUP", "1"); editor.apply(); Intent intent = new Intent(MainActivity.this, SetupActivity.class); startActivity(intent); finish(); 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 // 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 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 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 {\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\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\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 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 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 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\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 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 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.7904454", "0.78056747", "0.77659833", "0.7727365", "0.7631989", "0.76223314", "0.7584553", "0.75306034", "0.7487836", "0.745791", "0.745791", "0.7438328", "0.74220496", "0.74034584", "0.7391494", "0.73866826", "0.73788977", "0.7370167", "0.7362255", "0.73555887", "0.7345252", "0.734152", "0.73303276", "0.7328559", "0.73255897", "0.73185426", "0.73165184", "0.73132133", "0.7303868", "0.7303868", "0.7301464", "0.7297915", "0.72930884", "0.72863466", "0.72832656", "0.72807384", "0.7278446", "0.72596914", "0.7259592", "0.7259592", "0.7259592", "0.7259204", "0.72497207", "0.7225063", "0.7219175", "0.7216816", "0.720443", "0.7201328", "0.71997535", "0.71924156", "0.71846914", "0.7177496", "0.7168223", "0.7167547", "0.7153918", "0.7153812", "0.71360034", "0.7135014", "0.7135014", "0.7129386", "0.7129096", "0.7124025", "0.7123219", "0.7122818", "0.71221405", "0.7117256", "0.71171826", "0.71171826", "0.71171826", "0.71171826", "0.71166563", "0.7116579", "0.71148115", "0.7112163", "0.71096337", "0.7109013", "0.7105877", "0.70992535", "0.70982933", "0.7095853", "0.7093862", "0.7093862", "0.70863163", "0.7082383", "0.7080991", "0.7080324", "0.7073529", "0.7068395", "0.7061839", "0.7060443", "0.7060233", "0.7051591", "0.70377344", "0.70377344", "0.7035971", "0.7035638", "0.7035638", "0.7032344", "0.7030622", "0.7029514", "0.70190036" ]
0.0
-1
Retrieve the Node Value
public V value() { return _value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNodeValue ();", "public String getNodeValue(Node node) throws Exception;", "public String value() {\n return node.getTextContent();\n }", "public AbstractNode getValue()\n\t\t{\n\t\t\treturn value;\n\t\t}", "public String getTextValue (Node node);", "public E value()\r\n\t// post: returns value associated with this node\r\n\t{\r\n\t\treturn val;\r\n\t}", "public String getValue(Node node) {\n return (node == null) ? null : node.getTextContent();\n }", "public static String getNodeValue(Node node)\r\n\t{\r\n\t\treturn node.getFirstChild().getNodeValue();\r\n\t}", "public String getNodeValue(Element elem)\n {\n NodeList nlList= elem.getChildNodes();\n Node nValue = (Node) nlList.item(0);\n\n return nValue.getNodeValue();\n }", "public abstract Object \t\tgetNodeValue(int nodeIndex,int nodeColumn);", "@Override\r\n\t\tpublic String getNodeValue() throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public XPath getValue()\n {\n return m_valueExpr;\n }", "public Integer nodeValue(String id)\n\t{\n\t\treturn getNode(id).value;\n\t}", "Object get(Node node);", "public int getNode() {\r\n\t\t\treturn data;\r\n\t\t}", "public Node getNode (){\n if (_node == null){\n Label label = new Label(_value);\n label.setFont(DEFAULT_FONT);\n _node = label;\n }\n return _node;\n }", "Node getVariable();", "public String getNode() {\n return node;\n }", "public final XmlTextInfo value ()\r\n {\r\n return _value;\r\n }", "@Override\r\n public Object getValueFromNode(Node node_p) throws Exception\r\n {\n return null;\r\n }", "public synchronized String getValueOfNode(String path)\n throws ProcessingException {\n String value = null;\n\n path = this.createPath(path); // correct path\n value = DOMUtil.getValueOf(data, path, this.xpathProcessor);\n\n return value;\n }", "public String getNode()\n {\n return node;\n }", "public String get(String key) {\n \ttmp = getNode(key);\n \tif (tmp != null) { \n \t\treturn tmp.getVal();\n \t}\n \treturn null;\n }", "public String getNode() {\n return node;\n }", "public V getValueOfNode(Integer id) {\n\t\treturn nodes.get(id);\n\t}", "public @Override E get(int index) {\n \treturn getNode(index).data;\n }", "public T getValue(String key) {\r\n\t\tNode node = getNode(root, key, 0);\r\n\t\treturn node == null ? null : node.value;\r\n\t}", "public Object getValue() {\n return element == null ? null : element.getValue();\n }", "public String getValue() {\n\t\treturn (String) get_Value(\"Value\");\n\t}", "public Node getNode();", "@Override\n\tpublic java.lang.String getNode_1() {\n\t\treturn _dictData.getNode_1();\n\t}", "public final IRNode getNode() {\r\n return f_node;\r\n }", "Node getNode();", "public Object getValue(){\n \treturn this.value;\n }", "@AutoEscape\n\tpublic String getNode_1();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "public T getValue() {\n\t\t\treturn this.entry.value;\n\t\t}", "@Override\n\tpublic java.lang.String getNode_2() {\n\t\treturn _dictData.getNode_2();\n\t}", "public static String getNodeValue(Element node)\n {\n StringBuilder sb = new StringBuilder();\n NodeList children = node.getChildNodes();\n int numNodes = children.getLength();\n for (int i = 0; i < numNodes; i++)\n {\n Node next = children.item(i);\n if (next instanceof Text)\n {\n sb.append(next.getNodeValue());\n }\n }\n return sb.toString();\n }", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "@AutoEscape\n\tpublic String getNode_3();", "public short getNode() {\n return node;\n }", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "public String getValue () { return value; }", "String getNodeMetadataValue(int node, String key);", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "public Value getValue(){\n return this.value;\n }", "public Object getValue() { return this.value; }", "public Node getNode() {\r\n return channel.attr(NetworkConstants.ATTRIBUTE_NODE).get();\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue(){\n\t\treturn this.value;\n\t}", "public java.lang.String getValue()\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(VALUE$12);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public Object getValue() {\n\t\t\treturn value;\n\t\t}", "String getValueOfNode(String path)\n throws ProcessingException;", "private static String getNodeValue(String property,Element e) {\n try {\n NodeList nodes;\n nodes = e.getElementsByTagName(property).item(0).getChildNodes();\n Node node = (Node)nodes.item(0);\n return node.getNodeValue();\n }\n catch (NullPointerException err) {\n JOptionPane.showMessageDialog(gameboard, \"Error reading XML node: \"+property+\" of \"+e.getNodeName()+\"\\n\"+err.getMessage());\n }\n return null;\n }", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public String getValue()\r\n\t{\r\n\t\treturn value;\r\n\t}", "@AutoEscape\n\tpublic String getNode_2();", "@Override\r\n\tpublic String getValue() {\r\n\t\t//\r\n\t\treturn this.elementWrapper.getAttribute(this.attribute);\r\n\t}", "public String getValue()\n {\n return value;\n }", "public String getValue(){\n\t\treturn _value;\n\t}", "public Object getValue()\r\n\t{\r\n\t\treturn m_value;\r\n\t}", "public Object getValue(JmmNode node) {\n Object left = (node.getNumChildren() > 0) ? getValue(node.getChildren().get(0)) : null;\n Object right = (node.getNumChildren() > 1) ? getValue(node.getChildren().get(1)) : null;\n\n switch (node.getKind()) {\n case \"Add\":\n return ((left == null) || (right == null)) ? null : (Integer) left + (Integer) right;\n case \"Sub\":\n return ((left == null) || (right == null)) ? null : (Integer) left - (Integer) right;\n case \"Mul\":\n return ((left == null) || (right == null)) ? null : (Integer) left * (Integer) right;\n case \"Div\":\n return ((left == null) || (right == null)) ? null : (Integer) left / (Integer) right;\n case \"LessThan\":\n return ((left == null) || (right == null)) ? null : (Integer) left < (Integer) right;\n case \"And\":\n return ((left == null) || (right == null)) ? null : (Boolean) left && (Boolean) right;\n case \"Not\":\n return (left == null) ? null : !(Boolean) left;\n case \"Int\":\n return Integer.parseInt(node.get(\"value\"));\n case \"False\":\n return false;\n case \"True\":\n return true;\n case \"Var\":\n return getVariableValue(getVariableSymbol(node.get(\"name\")));\n default:\n return null;\n }\n }", "public String getValue() {\n return value;\n }", "public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }", "public S getValue() { return value; }", "public Object getValue() {\n\t\treturn value;\n\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public Node getNode() {\n return node;\n }", "public Node getNode() {\n return node;\n }", "E getValue();", "public Object getValue()\n {\n\treturn value;\n }", "public String getValue()\n {\n return this.value;\n }", "@Override\n\tpublic String visitValue(ValueContext ctx) {\n\t \n\t\t\n\t return ctx.getChild(0).getText();\n\t\t\n\t\t\n\t}" ]
[ "0.85006595", "0.81513065", "0.8002506", "0.79738593", "0.7914975", "0.7441603", "0.73991454", "0.7356222", "0.73072535", "0.72455126", "0.71122736", "0.69395", "0.69282967", "0.6923818", "0.6852354", "0.68012625", "0.6741634", "0.6711332", "0.6702723", "0.6694946", "0.6693214", "0.6690819", "0.66855747", "0.6663842", "0.66596156", "0.66401726", "0.6637954", "0.65823907", "0.65658903", "0.6563231", "0.65563554", "0.65563065", "0.6516566", "0.64960164", "0.64903754", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.6485249", "0.648349", "0.64818096", "0.64699864", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6468749", "0.6447189", "0.64470595", "0.6446807", "0.6445208", "0.6439536", "0.64310735", "0.64310735", "0.64310735", "0.64310735", "0.64310735", "0.64310735", "0.64310735", "0.6415199", "0.6412175", "0.6398356", "0.63953483", "0.63903606", "0.63869125", "0.6386863", "0.6382266", "0.63820416", "0.63752854", "0.63752854", "0.63752854", "0.63752854", "0.63752854", "0.6374521", "0.6370623", "0.63692594", "0.6367527", "0.6364341", "0.6360561", "0.6355588", "0.6349381", "0.6348309", "0.63463527", "0.63431764", "0.63431764", "0.6342088", "0.6342088", "0.6339095", "0.6333295", "0.6330961", "0.6330312" ]
0.0
-1
Retrieve the Next Node
public ListNode<V> next() { return _next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Node getNext() { return next; }", "public Node getNext(){\n\t\t\treturn next;\n\t\t}", "public node getNext() {\n\t\t\treturn next;\n\t\t}", "public Node getNext(){\n\t\treturn next;\n\t}", "public DNode getNext() { return next; }", "Node<T> getNext() {\n\t\t\treturn nextNode;\n\t\t}", "public Node<E> getNext() { return next; }", "public Node getNext()\r\n\t{\r\n\t\treturn next;\r\n\t}", "public Node getNext()\r\n\t{\r\n\t\treturn next;\r\n\t}", "public Node getNext()\n\t{\n\t\treturn next;\n\t}", "public Node getNext()\n\t{\n\t\treturn next;\n\t}", "public Node getNext() {\r\n\t\treturn next;\r\n\t}", "public Node getNext() {\n\t\treturn next;\n\t}", "public LLNode<T> getNext() {\n return next;\n }", "public Node<S> getNext() { return next; }", "public Node<D> getNext(){\n\t\treturn next;\n\t}", "public Node<T> getNext() {\n\t\treturn next;\n\t}", "public Node getNext() {\n\t\treturn this.next;\n\t}", "public Node getNext() {\n return next;\n }", "public Node<E> getNext() {\r\n\t\treturn next;\r\n\t}", "public Node getNextNode() {\n return nextNode;\n }", "public Node getNext() {\n return next;\n }", "public Node getNext()\n {\n return this.next;\n }", "public Node<T> getNext()\n\t{\treturn this.next; }", "public SimpleNode getNext() {\n return next;\n }", "public Node getNext() {\t\t//O(1)\n\t\treturn next;\n\t}", "public Node<T> getNext() {\n return this.next;\n }", "public Node<T> getNextNode() {\n\t\treturn nextNode;\n\t}", "public Nodo getnext ()\n\t\t{\n\t\t\treturn next;\n\t\t\t\n\t\t}", "protected final Node<N> getNext() {\n return this.next;\n }", "public MyNode<? super E> getNext()\n\t{\n\t\treturn this.next;\n\t}", "public LinearNode<T> getNext() {\r\n\t\t\r\n\t\treturn next;\r\n\t\r\n\t}", "public SlideNode getNext() {\n\t\treturn next;\n\t}", "public LinkedNode<T> getNext() {\n\t return myNextNode;\n }", "public ListNode<T> getNext();", "public GameNode getNext() {\n return this.next;\n }", "public ListNode<E> getNext()\n {\n return nextNode;\n }", "public ListNode<Item> getNext() {\n return this.next;\n }", "public ElectionNode getNextNode() {\r\n return nextNode;\r\n }", "public ListNode getNext()\r\n {\r\n return next;\r\n }", "public CommitNode getNext(){\r\n\t\treturn next;\r\n\t}", "public com.Node<T> getNextRef() {\n\t\treturn null;\n\t}", "public ListElement<T> getNext()\n\t{\n\t\treturn next;\n\t}", "public IDLink<T> getNext(){\n \treturn npointer;\n }", "public ShapeNode getNext()\n {\n return next;\n }", "int getNext(int node_index) {\n\t\treturn m_list_nodes.getField(node_index, 2);\n\t}", "ListNode getNext() { /* package access */ \n\t\treturn next;\n\t}", "public Variable getNext(){\n\t\treturn this.next;\n\t}", "public ListElement getNext()\n\t {\n\t return this.next;\n\t }", "public NodeT getNext() {\n String nextItemKey = queue.poll();\n if (nextItemKey == null) {\n return null;\n }\n return nodeTable.get(nextItemKey);\n }", "@Override\n\t\tpublic Node next() {\n\t\t\tif (this.next == null) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tNode element = this.next;\n\t\t\t\tthis.next = (Node) this.next.getNextNode();\n\t\t\t\treturn (Node) element;\n\t\t\t}\n\t\t}", "public DoublyLinkedNode<E> getNext() {\n return nextNode;\n }", "public DoubleNode<T> getNext()\n {\n\n return next;\n }", "public Node<T> next() {\r\n return next;\r\n }", "public Node<E> nextNode() {\n\t\treturn next_node;\n\t}", "public E next(){\r\n E data = node.getData();\r\n node = node.getNext();\r\n return data;\r\n }", "public SortedLinkedListNode getNext() {\n return next;\n }", "public HL7DataTree next() {\n final int size = Util.size(this.list), i = this.next == null ? size : this.list.indexOf(this.next) + 1;\n final HL7DataTree curr = this.next;\n \n this.next = i == size ? more() : this.list.get(i);\n \n return curr;\n }", "public ObjectListNode getNext() {\n return next;\n }", "private Object getNextElement()\n {\n return __m_NextElement;\n }", "public Vertex getNext() {\n\t\treturn next;\n\t}", "HNode getNextSibling();", "public E next() {\r\n\r\n\t\tE result = null;\r\n\t\tif (hasNext()) {\r\n\t\t\tresult = links.get(counter);\r\n\t\t\tcounter++;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override \r\n\tpublic LLNode<T> next() throws NoSuchElementException{\r\n\t\tLLNode<T> node = nodeptr;\r\n\t\tif (nodeptr == null)\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\tnodeptr = nodeptr.getNext();\r\n\t\treturn node;\r\n\t}", "public T getNextElement();", "@Override\n public Node next() {\n if (next == null) {\n throw new NoSuchElementException();\n }\n Node current = next;\n next = next.getNextSibling();\n return current;\n }", "@Override\r\n\t\tpublic T next() {\r\n\t\t\tNode<T> temp = currentNode;\r\n\t\t\tcurrentNode = currentNode.nextNode;\r\n\t\t\treturn temp.content;\r\n\t\t}", "public BSCObject next()\n {\n if (ready_for_fetch)\n {\n // the next sibling is waiting to be returned, so just return it\n ready_for_fetch = false;\n return sibling;\n }\n else if (hasNext())\n {\n // make sure there is a next sibling; if so, return it\n ready_for_fetch = false;\n return sibling;\n }\n else\n throw new NoSuchElementException();\n }", "public C getNext();", "public Object getNext() {\n\t\tif (current != null) {\n\t\t\tcurrent = current.next; // Get the reference to the next item\n\t\t}\n\t\treturn current == null ? null : current.item;\n\t}", "@Override\r\n\t\tpublic Node getNextSibling()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public T next()\n\t\t{\n\t\t\tif(hasNext())\n\t\t\t{\n\t\t\t\tT currentData = current.getData(); //the data that will be returned\n\t\t\t\t\n\t\t\t\t// must continue to keep track of the Node that is in front of\n\t\t\t\t// the current Node whose data is must being returned , in case\n\t\t\t\t// its nextNode must be reset to skip the Node whose data is\n\t\t\t\t// just being returned\n\t\t\t\tbeforePrevious = previous;\n\t\t\t\t\n\t\t\t\t// must continue keep track of the Node that is referencing the\n\t\t\t\t// data that was just returned in case the user wishes to remove()\n\t\t\t\t// the data that was just returned\n\t\t\t\t\n\t\t\t\tprevious = current; // get ready to point to the Node with the next data value\n\t\t\t\t\n\t\t\t\tcurrent = current.getNext(); // move to next Node in the chain, get ready to point to the next data item in the list\n\t\t\t\t\n\t\t\t\tthis.removeCalled = false;\n\t\t\t\t// it's now pointing to next value in the list which is not the one that may have been removed\n\t\t\t\t\n\t\t\t\treturn currentData;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\t}\n\t\t}", "public E getNext() {\n\t\tif (!super.isEmpty()) {\n\t\t\tif (index >= this.size() - 1)\n\t\t\t\tindex = -1;\n\t\t\treturn this.get(++index);\n\t\t}\n\t\treturn null;\n\t}", "public Content getNavLinkNext() {\n Content li;\n if (next != null) {\n Content nextLink = getLink(new LinkInfoImpl(configuration,\n LinkInfoImpl.Kind.CLASS, next)\n .label(nextclassLabel).strong(true));\n li = HtmlTree.LI(nextLink);\n }\n else\n li = HtmlTree.LI(nextclassLabel);\n return li;\n }", "public E next()\r\n {\r\n E valueToReturn;\r\n\r\n if (!hasNext())\r\n throw new NoSuchElementException(\"The lister is empty\");\r\n \r\n // get the string from the node\r\n valueToReturn = cursor.getData();\r\n \r\n // advance the cursor to the next node\r\n cursor = cursor.getLink();\r\n \r\n return valueToReturn;\r\n }", "public Node returnNextChild(){\n try{\n return children.get(counter);\n }catch(Exception ex){\n return null;\n }\n }", "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 Cell getNext()\n { return next; }", "public Item next() throws XPathException {\n while (true) {\n NodeInfo next = (NodeInfo)iterator.next();\n if (next == null) {\n current = null;\n position = -1;\n return null;\n }\n if (current != null && next.isSameNodeInfo(current)) {\n continue;\n } else {\n position++;\n current = next;\n return current;\n }\n }\n }", "public Tile getNext(){\n\t\treturn this.next;\n\t}", "public E next() \n {\n \tfor(int i = 0; i < size; i++)\n \t\tif(tree[i].order == next) {\n \t\t\tnext++;\n \t\t\ttree[i].position = i;\n \t\t\treturn tree[i].element;\n \t\t}\n \treturn null;\n }", "@Override\r\n\tpublic String next() {\n\t\tString nx;\r\n\r\n\t\tnx = p.getNext();\r\n\r\n\t\tif (nx != null) {\r\n\t\t\tthisNext = true;\r\n\t\t\tinput(nx);\r\n\t\t}\r\n\t\treturn nx;\r\n\t}", "public Level getNext() {\n\t\treturn next;\n\t}", "public Wagon<T> getNext() {\n\t\treturn next;\n\t}", "public HIR\n getNextExecutableNode();", "@Override\n\tpublic Node getNextSibling() {\n\t\treturn null;\n\t}", "Entry getNext()\n {\n return (Entry) m_eNext;\n }", "public T getNext()\n {\n T elem = handler.getTop();\n handler.pop();\n return elem;\n }", "public T next()\r\n { \r\n if (next == null)\r\n throw new NoSuchElementException(\"Attempt to\" +\r\n \" call next when there's no next element.\");\r\n\r\n prev = next;\r\n next = next.next;\r\n return prev.data;\r\n }", "public T next() {\n T temp = this.curr.next.getData();\n this.curr = this.curr.next;\n return temp;\n }", "public T next() {\n T temp = this.curr.getData();\n this.curr = this.curr.getNext();\n return temp;\n }", "public MainNode getMainNodeNextPointer(MainNode node) {\n return node.mainNext;\n }", "public T next()\n {\n T data = current.item;\n current = current.next;\n return data;\n }", "public MapElement getNext() {\n return next;\n }", "public final Node<N> next() {\n final Node<N> sink = this.next;\n this.prepareNext();\n return sink;\n }", "public static Node NextNode(Node curr) {\r\n\t\treturn curr.next;\r\n\t}", "public Element<T> getNextElement() \n\t{\n\t\treturn nextElement;\n\t}", "public int next() {\n TreeNode iter = dq.pop();\n int val = iter.val;\n if(iter.right!=null)\n process(iter.right);\n return val;\n }", "public NextNode getNextNodeNextPointer(MainNode node) {\n return node.next;\n }", "Node currentNode();" ]
[ "0.8314488", "0.83022547", "0.8262895", "0.82509923", "0.8250448", "0.819176", "0.8187992", "0.81756663", "0.81756663", "0.8145896", "0.8145896", "0.8138233", "0.8134141", "0.8117825", "0.81159824", "0.8092315", "0.80901664", "0.8082506", "0.8074693", "0.80580205", "0.8049493", "0.8043692", "0.80363506", "0.80150914", "0.8008206", "0.79676014", "0.79601115", "0.7959212", "0.79494923", "0.79448456", "0.79443353", "0.7934237", "0.788549", "0.7823801", "0.7797542", "0.778018", "0.7738655", "0.7655721", "0.7651021", "0.76316404", "0.7627106", "0.7546294", "0.7515405", "0.75151753", "0.75075895", "0.7487597", "0.74565715", "0.7450264", "0.7442745", "0.7432461", "0.7415341", "0.7413312", "0.73965317", "0.73935443", "0.7385663", "0.73835915", "0.73826754", "0.73727155", "0.7349313", "0.73447925", "0.7265596", "0.7265187", "0.7263608", "0.72433054", "0.72305506", "0.7201491", "0.7159273", "0.71489465", "0.71470416", "0.71214694", "0.70738095", "0.70503396", "0.704925", "0.7049085", "0.70409495", "0.7035267", "0.7032623", "0.7001975", "0.6999971", "0.69690704", "0.6962007", "0.69495124", "0.6948963", "0.6930198", "0.6929143", "0.69261104", "0.69099295", "0.69087774", "0.6900616", "0.68937665", "0.6892636", "0.6879931", "0.6872376", "0.6859697", "0.68325764", "0.6828999", "0.68203044", "0.68201417", "0.6755132", "0.6751076" ]
0.69551307
81
Set the Next Node
public boolean setNext ( final ListNode<V> next) { _next = next; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Node setNextNode(Node node);", "public void setNext(Node n) { next = n; }", "public void setNext(Node<E> next) { this.next = next; }", "public void setNextNode(Node nextNode) {\n this.nextNode = nextNode;\n }", "public void setNextNode(Node<T> nextNode) {\n\t\tthis.nextNode = nextNode;\n\t}", "public void setNext(Node next){\n\t\tthis.next = next;\n\t}", "public void setNext(Node<T> next) {\n this.next = next;\n }", "public void setNext(Node n) {\n next = n;\n }", "public void setNext(Node<D> n){\n\t\tnext = n;\n\t}", "public void setNext(Node<T> next) {\r\n this.next = next;\r\n }", "public void setNextNode(Node<T> next) {\n itsNext = next;\n }", "public void setNext(Node next) {\n this.next = next;\n }", "public void setNext(Node<T> next) {\n\t\tthis.next = next;\n\t}", "private void setNext(Node n) {\n\t\t\tnext = n;\n\t\t}", "public void setNext(Node next) {\n\t\tthis.next = next;\n\t}", "public void setNext(Node next)\r\n\t{\r\n\t\tthis.next = next;\r\n\t}", "public void setNext(Node n)\r\n\t{\r\n\t\tnext = n;\r\n\t}", "public void setNext(final LinkedNode<T> theNode) {\n\t myNextNode = theNode;\n }", "public void setNext(Node next)\n\t{\n\t\tthis.next = next;\n\t}", "public void setNext(GameNode next) {\n this.next = next;\n }", "public void setNext(DNode newNext) { next = newNext; }", "public void setNext(SimpleNode next) {\n this.next = next;\n }", "public void setNext(Node newNode){\n\t\t\tnext = newNode;\n\t\t}", "public void setNext(LinearNode<T> node) {\r\n\t\t\r\n\t\tnext = node;\r\n\t\t\r\n\t}", "public void setNext(MyNode<? super E> _next)\n\t{\n\t\tthis.next = _next;\n\t\t//this.next = _next;\n\t}", "public void setNextNode(Node newnext)\n {\n next = newnext;\n }", "public void setNext(Node<T> another)\n\t{\tthis.next = another; }", "public void setNext(ListNode<E> next)\n {\n nextNode = next;\n }", "public void setNext(Node n)\n {\n n.prev = this.next.prev;\n n.next = this.next;\n this.next.prev = n;\n this.next = n;\n }", "public void setNext(LLNode<T> next) {\n this.next = next;\n }", "public void setNext(CommitNode x){\r\n\t\tnext = x;\r\n\t}", "void setNext(HashNode newNext){\n\t\tnext = newNext; \n\t}", "@Override public void setNextNode(BTreeNode nextNode) {\n // no required in case of non leaf node\n }", "public void setNextNode(ElectionNode nextNode) {\r\n this.nextNode = nextNode;\r\n }", "public void setNext(ListNode<Item> next) {\n this.next = next;\n }", "public void setNext(ListNode next)\r\n {\r\n this.next = next;\r\n }", "public void setNext(SlideNode node) {\n\t\tthis.next = node;\n\t}", "public void setNext(Variable next){\n\t\tthis.next = next;\n\t}", "public void setNext(SortedLinkedListNode pNode) {\n next = pNode;\n }", "public void setNext(Cell link)\n { next = link; }", "public void setNext()\n {\n\t int currentIndex = AL.indexOf(currentObject);\n\t currentObject = AL.get(currentIndex +1);\n\t \n\t// never let currentNode be null, wrap to head\n\tif (currentObject == null)\n\t\tcurrentObject = firstObject;\n }", "public void setNext(Linkable nextObject);", "public void setNext(DoublyLinkedNode<E> next) {\n this.nextNode = next;\n }", "public void setNext(Tile next){\n\t\tthis.next=next;\n\t}", "void setNext(Cell next) {\n if (this.next == null) {\n this.next = next;\n }\n }", "public void setNext(DoubleNode<T> node)\n {\n\n next = node;\n }", "public void setNext(Vertex next) {\n\t\tthis.next = next;\n\t}", "public void setNext(ListElement<T> next)\n\t{\n\t\tthis.next = next;\n\t}", "public void setNext(ObjectListNode p) {\n next = p;\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t\tprivate void setNext(k key, v value) {\n\t\t\tnext = new Node (key, value, null);\n\t\t}", "void setNext (ListNode newNext) { /* package access */ \n\t\tnext = newNext;\n\t}", "public void setNext(Node node)\n\t{\n\t\tnodeLinks.setNext(node);\n\t}", "public void setNext(IDLink<T> c){\n \tnpointer = c;\n }", "public void setNext(ListElement next)\n\n\t {\n\t this.next = next;\n\t }", "public void setNext(Level next) {\n\t\tthis.next = next;\n\t}", "public void setNextCell(Cell next)\r\n {\r\n this.next = next;\r\n }", "public void setNext(DListNode2 next1){\r\n this.next = next1;\r\n }", "public void setNext(DependencyElement next) {\n\t\tthis.next = next;\n\t}", "public void setNext(ListEntry next) {\n if (next != null)\n this.next = next;\n else\n this.next = null;\n }", "public void setNextElement(Element<T> nextElement) \n\t{\n\t\tthis.nextElement = nextElement;\n\t}", "public void setNext(Version next){\n\t\tif (next == null){\n\t\t\tLog.e(NAME, \"Invalid parameters for 'setNext' method!\");\n\t\t\treturn;\n\t\t}\n\t\tthis.next = next;\n\t}", "void setNext(MapElement next) {\n this.next = next;\n }", "@Override\n public void setNextElement(helpDesk next) {\n this.next = next;\n }", "void setNext(Entry entry)\n {\n m_eNext = entry;\n }", "public void setNode(SubscriptionYear next) {\n\t\tthis.next = next;\n\t}", "public SkipListNode<K> setNext(int i, SkipListNode<K> node)\n {\n\treturn next.set(i,node);\n }", "public DNode getNext() { return next; }", "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 Node getNext() { return next; }", "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 }", "public void setNextValue(final String nextValue);", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }", "public boolean SetNext(List v_next){\n\tnext = v_next ;\n\treturn true ;\n }" ]
[ "0.87739336", "0.8700226", "0.8579684", "0.85468906", "0.85288", "0.8431373", "0.84137976", "0.84000134", "0.8390239", "0.8378172", "0.8365038", "0.834066", "0.83393013", "0.8324167", "0.8241185", "0.8219237", "0.82097846", "0.82079065", "0.82029176", "0.81667244", "0.8158232", "0.807302", "0.8067466", "0.8012715", "0.7997578", "0.7968406", "0.7963277", "0.7956026", "0.79433787", "0.7900464", "0.78692", "0.7824359", "0.7806736", "0.78045344", "0.7795898", "0.7783973", "0.77635986", "0.77426183", "0.77242386", "0.7681729", "0.7665849", "0.7656449", "0.7648773", "0.7635705", "0.7614515", "0.7591577", "0.7591014", "0.7585319", "0.75465006", "0.7490538", "0.74865425", "0.7462249", "0.7436785", "0.74082273", "0.7388586", "0.73523986", "0.7307503", "0.7244234", "0.7183812", "0.71266997", "0.71125764", "0.70587444", "0.70230645", "0.6946621", "0.6911181", "0.69045144", "0.6842386", "0.6791533", "0.676613", "0.6716137", "0.67025393", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700719", "0.6700049", "0.6700049", "0.6700049", "0.6700049" ]
0.69483906
63
Set the Node Value
public boolean setValue ( final V value) { _value = value; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(int node, Type value) {\n\t\tvalues[node] = value;\n\t}", "@Override\n public void setValue(Node value) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }", "void setValueOfNode(String path, String value)\n throws ProcessingException;", "public void nodeValue(String id, int value)\n\t{\n\t\tgetNode(id).value = value;\n\t}", "@Override\r\n\t\tpublic void setNodeValue(String nodeValue) throws DOMException\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "public synchronized void setValueOfNode(String path, String value)\n throws ProcessingException {\n path = this.createPath(path); // correct path\n\n Node node = DOMUtil.selectSingleNode(data, path, this.xpathProcessor);\n if (node.getNodeType() == Node.ATTRIBUTE_NODE) {\n Attr attr = (Attr)node;\n attr.setNodeValue(value);\n\n } else {\n\n // remove old childs\n while (node.hasChildNodes() == true) {\n node.removeChild(node.getFirstChild());\n }\n\n node.appendChild(node.getOwnerDocument().createTextNode(value));\n }\n }", "public void setNode_1(String node_1);", "public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }", "public void setValue(Object value) { this.value = value; }", "void setElementValue(SetElementValue cmd);", "public void setValue(XPath v)\n {\n m_valueExpr = v;\n }", "public void setNode(int _data ) {\r\n\t\t\tdata = _data;\r\n\t\t}", "public void setValue(int value)\n {\n if(this.valueInt == value)\n {\n return;\n }\n this.valueInt = value;\n treeModel.nodeChanged(this.treeNode);\n }", "private Node(T value) {\n\t\t\tthis.value = value;\n\t\t}", "public void setValue(Value value) {\n this.value = value;\n }", "public Node(T value) {\n\t\tthis.value = value;\n\t}", "public void setNode_5(String node_5);", "public void setValue(Object value);", "public void setValue (String Value);", "@Override\n public void setValueAt( Object aValue, Object node, int column )\n {\n }", "public Node(T value) {\n this.value = value;\n }", "public void setValue(Object val);", "public void setValue(Object value) {\n this.value = value;\n }", "public Node(int value) {\n\t\tthis.value = value;\n\t}", "void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}", "public void setValue(T value) \n\t{\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n this.value = value;\n }", "public void setValue(int n) {\n\t\t\tthis.value = n;\n\t}", "public void setNode_2(String node_2);", "public V setValue(V value);", "public void setValue(final Object value) { _value = value; }", "void setValue(V value);", "void setNode(String path, Node node)\n throws ProcessingException;", "void setValue(Object value);", "public void set_nodeid(short value) {\n setUIntBEElement(offsetBits_nodeid(), 8, value);\n }", "@Override\n public void set(T value) throws Exception {\n _curator.setData().forPath(_zkPath, toZkBytes(value));\n }", "protected abstract void setValue(V value);", "public void setNode_4(String node_4);", "public Node(T val) {\r\n\t\tthis.val = val;\r\n\t}", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "protected void setValue(T value) {\r\n this.value = value;\r\n }", "public void setData(T val) {\r\n\t\tthis.val = val;\r\n\t}", "void setValue(T value);", "void setValue(T value);", "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 }", "public void setValue(Object value)\r\n\t{\r\n\t\tm_value = value;\r\n\t}", "public void setNode_3(String node_3);", "void setNode(int nodeId, double lat, double lon, double ele);", "public void setNode(String node)\n {\n this.node = node;\n }", "public void setValue(Object o){\n \tthis.value = o;\n }", "@Override\n\tpublic void setValue(Object value) {\n\t\t\n\t}", "public abstract void setValue(T value);", "public void setValue(int new_value){\n this.value=new_value;\n }", "private void setNode(DefaultMutableTreeNode node){\n\t\t\n\t\tthis.node = node;\n\t\t\n\t}", "public void setEncodedBy( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), ENCODEDBY, value);\r\n\t}", "public void setValue(Number value) {\n this.value = value;\n }", "public void setValue(Object value)\r\n {\r\n m_value = value;\r\n }", "protected void f_set(Long eID, int flowValue) {\n\t\tincreaseAccess(); // Zugriff auf den Graphen\n\t\tgraph.setValE(eID, flowAttr, flowValue);\n\t}", "public Node(int val) {\n this.val = val;\n }", "public void setValue(int value);", "public void setPersistidoGraf(Node value) {\n persistidoGraf.set(value);\n }", "public void setNodeA(int x){\n this.nodeA = x;\n }", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public static void setValue(Object tree, Object root, Object value)\n throws OgnlException {\n setValue(tree, createDefaultContext(root), root, value);\n }", "public void setValue(Entity value) {\r\n\t\t\tthis.value = value;\r\n\t\t}", "String setValue();", "void setValue(int value);", "public static void setValue(Object tree,Map context,Object root,Object value) throws OgnlException{\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null){\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "@Override\n\tprotected void setValue(String name, TipiValue tv) {\n\t}", "public Builder setNode(entities.Torrent.NodeId value) {\n if (nodeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n node_ = value;\n onChanged();\n } else {\n nodeBuilder_.setMessage(value);\n }\n\n return this;\n }", "public Builder setNode(entities.Torrent.NodeId value) {\n if (nodeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n node_ = value;\n onChanged();\n } else {\n nodeBuilder_.setMessage(value);\n }\n\n return this;\n }", "public void setValue(T v){\n \telement = v;\n }", "@SuppressWarnings(\"unchecked\")\n public void setValue(Object value) {\n if (element != null) {\n element.setValue((V)value);\n }\n }", "public void setDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "public void setCurrentNode(int node) {\n\t\tthis.currentNode = node;\n\t}", "public Builder setNode(\n int index, uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureNode value) {\n if (nodeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureNodeIsMutable();\n node_.set(index, value);\n onChanged();\n } else {\n nodeBuilder_.setMessage(index, value);\n }\n return this;\n }", "public TreeNodeImpl(N value) {\n this.value = value;\n }", "public void setNode(String node) {\n this.node = node;\n }", "public void set(T pValue) {\n mValue = pValue;\n }", "public void setValue(int val)\r\n {\r\n value = val;\r\n }", "private Node set(int pos, int value) {\n if (pos != 0) {\n return new Node(this.value, this.nextNode.set(pos - 1, value));\n } else {\n this.value = value;\n return this;\n }\n }", "public Builder setNode(\n entities.Torrent.NodeId.Builder builderForValue) {\n if (nodeBuilder_ == null) {\n node_ = builderForValue.build();\n onChanged();\n } else {\n nodeBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public Builder setNode(\n entities.Torrent.NodeId.Builder builderForValue) {\n if (nodeBuilder_ == null) {\n node_ = builderForValue.build();\n onChanged();\n } else {\n nodeBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public void setValue(int value) {\r\n this.value = value;\r\n }", "private MsoSmartArtNodePosition(int value) { this.value = value; }", "void setToValue(int val);", "public void setValue (int newValue) {\n myValue = newValue;\n }", "public void setTime( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), TIME, value);\r\n\t}", "public abstract void setValue(int value);", "public void setValue(Object value) {\n setValue(value.toString());\n }", "public Node(T value) {\n\t\t\tthis.value = value; // initializing\n\t\t\tnext = null;\n\t\t}", "public void setTargetValue(int idx, Object value);", "public void setValue(String value)\n {\n if(this.valueString.compareTo(value) == 0)\n {\n return;\n }\n this.valueString = value;\n treeModel.nodeChanged(this.treeNode);\n }", "public static void setValue(Object tree, Map context, Object root, Object value)\n throws OgnlException {\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null) {\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "public void setValue(AXValue value) {\n this.value = value;\n }", "public @Override E set(int index, E element) {\n \tNode n = getNode(index);\n \tE result = n.data;\n \tn.data = element;\n \treturn result;\n }" ]
[ "0.7672227", "0.7569534", "0.7472617", "0.7373302", "0.7292952", "0.70246524", "0.6781523", "0.6758596", "0.6707763", "0.66954553", "0.66901064", "0.6655234", "0.6647105", "0.6615348", "0.6613963", "0.6611068", "0.65951914", "0.6583785", "0.65690994", "0.65565", "0.6555659", "0.65152395", "0.65148884", "0.64931846", "0.64697325", "0.64696056", "0.6463977", "0.6463977", "0.64497", "0.64408576", "0.6426321", "0.64254105", "0.6423975", "0.64194745", "0.64075094", "0.64051306", "0.6394062", "0.6379369", "0.6374849", "0.63631296", "0.6359134", "0.634799", "0.6343121", "0.6316391", "0.6308818", "0.6308818", "0.630778", "0.63037103", "0.62979543", "0.62971944", "0.6294822", "0.62930834", "0.6288293", "0.6286646", "0.6284817", "0.62774146", "0.62770694", "0.6260134", "0.625762", "0.62569445", "0.62559736", "0.625412", "0.6242019", "0.624186", "0.62410396", "0.62410396", "0.62410396", "0.62410396", "0.6233818", "0.622999", "0.62265474", "0.622147", "0.6221086", "0.621829", "0.62173694", "0.62173694", "0.62133116", "0.6198882", "0.6183171", "0.6181115", "0.6171136", "0.6168458", "0.6165081", "0.6159807", "0.61565703", "0.61552566", "0.6151358", "0.6151358", "0.61512697", "0.6149585", "0.61450887", "0.6142703", "0.61417514", "0.6141017", "0.6129904", "0.61297506", "0.6127713", "0.6125518", "0.6115945", "0.61157346", "0.61053073" ]
0.0
-1
Given a linked list, rotate the list to the right by k places, where k is nonnegative.
public static <V> ListNode<V> Rotate ( final ListNode<V> head, final int k) { if (null == head || 0 >= k) { return null; } int rotationCount = 0; ListNode<V> prevNode = null; ListNode<V> currentNode = head; ListNode<V> nextNode = head.next(); while (++rotationCount < k) { if (null == nextNode) { return null; } prevNode = currentNode; currentNode = nextNode; nextNode = nextNode.next(); } if (!prevNode.setNext ( null )) { return null; } ListNode<V> rotatedHead = currentNode; nextNode = currentNode.next(); while (null != nextNode) { currentNode = nextNode; nextNode = nextNode.next(); } return currentNode.setNext ( head ) ? rotatedHead : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ListNode rotateRight(ListNode head, int k) {\r\n\t\tint size = listSize(head);\r\n\t\tif (head == null || k <= 0 || k == size) return head;\r\n\t\tif (k > size) k %= size;\r\n\t\tint count = 1;\r\n\t\tListNode curr = head;\r\n\t\tk = size - k;\r\n\t\twhile (count < k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "public ListNode rotateLeft(ListNode head, int k) {\r\n\t\tif (k <= 0) return head;\r\n\t\tListNode curr = head;\r\n\t\tint count = 1;\r\n\t\twhile (count++ < k && curr != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tif (curr == null) return head;\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "public ListNode SolveByMovingPointers(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Calculate list length + actual number of rotations\n int listLength = FindLength(head);\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate to the node before the node with number that needs to be rotated to beginning...\n ListNode oldHeadIterator = head;\n int counter = listLength - numberOfRotations - 1;\n while (counter != 0)\n {\n counter -= 1;\n oldHeadIterator = oldHeadIterator.next;\n }\n\n // ... Then make the following node be the beginning of new head + nullify tail of old head\n ListNode newHead = oldHeadIterator.next;\n oldHeadIterator.next = null;\n\n // Iterate to end of the new head, then simply add the old head contents to the tail\n ListNode newHeadIterator = newHead;\n while (newHeadIterator.next != null)\n newHeadIterator = newHeadIterator.next;\n newHeadIterator.next = head;\n\n return newHead;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public ListNode SolveUsingAdditionalLinkedList(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Create blank list to store new result\n ListNode result = new ListNode(-1, null);\n\n // Find the length of the list\n int listLength = FindLength(head);\n\n // Calculate the actual number of rotations (since k can be greater than list length)\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate through list until we get to the numbers that need to be moved to beginning...\n int counter = listLength - numberOfRotations;\n ListNode temp = head;\n while (counter != 0)\n {\n temp = temp.next;\n counter -= 1;\n }\n\n // ... Then add the rotated numbers to list\n while (temp != null)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n }\n\n // Lastly, reset counters and add the remaining numbers to the back\n counter = listLength - numberOfRotations;\n temp = head;\n while (counter != 0)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n counter -= 1;\n }\n\n // Since result is dummy node, return result.next\n return result.next;\n }", "private static void rightRotate(int[] nums, int k) {\r\n\t if (nums.length == 0) return;\r\n\t \r\n\t k %= nums.length;\r\n\t \r\n\t if (k == 0) return;\r\n\t \r\n\t int left=0, right=nums.length-1, tmp;\r\n\t \r\n\t while(left < right) {\r\n\t tmp = nums[left];\r\n\t nums[left] = nums[right];\r\n\t nums[right] = tmp;\r\n\t \r\n\t left++;\r\n\t right--;\r\n\t }\r\n\t \r\n\t left=0;\r\n\t right=k-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t \r\n\t left=k;\r\n\t right=nums.length-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t }", "public ListNode rotateKplace(ListNode head, int n) {\n if (head == null) return head;\n\n int len = getLen(head);\n int half = n % len;\n if (half == 0) return head;\n\n int index = len - half; // index to rotate\n ListNode curr = head;\n\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n } // curr is last node before rotate\n\n ListNode h1 = curr.next;\n curr.next = null;\n\n ListNode tail = h1;\n while (tail.next != null) {\n tail = tail.next;\n }\n tail.next = head;\n return h1;\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public ListNode rotateRight(ListNode head, int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tif (null == head) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode p = head;\r\n\t\tint length = 0;\r\n\t\twhile (null != p) {\r\n\t\t\tp = p.next;\r\n\t\t\tlength++;\r\n\t\t}\r\n\t\tif (n % length == 0) {\r\n\t\t\treturn head;\r\n\t\t} else {\r\n\t\t\tn = n % length;\r\n\t\t}\r\n\t\tint num = n;\r\n\t\tListNode first = head;\r\n\t\tListNode second = head;\r\n\t\twhile (num > 0) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tnum--;\r\n\t\t}\r\n\r\n\t\twhile (null != first.next) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tsecond = second.next;\r\n\t\t}\r\n\r\n\t\tListNode newHead = second.next;\r\n\t\tsecond.next = null;\r\n\t\tfirst.next = head;\r\n\t\treturn newHead;\r\n\t}", "public static ListNode reverseKGroup(ListNode head, int k) {\n\t\tListNode runner = head;\n\t\tint counter = 0;\n\t\twhile(runner != null){\n\t\t\trunner = runner.next;\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter < k){return head;}\n\t\t\n\t\t// reverse first k nodes\n\t\tListNode dummy = new ListNode(0);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode oriHead = head;\n\t\tListNode prev = null;\n\t\t\n\t\tfor(int i=0; i<k; i++){\n\t\t\tListNode temp = head.next;\n\t\t\thead.next = prev;\n\t\t\tprev = head;\n\t\t\thead = temp;\n\t\t}\n\t\t\n\t\t// append rest nodes by recur\n\t\tdummy.next = prev;\n\t\toriHead.next = reverseKGroup(head, k);\n\t\t\n\t\treturn dummy.next;\n\t\n\t}", "public void rotate() { // rotate the first element to the back of the list\n // TODO\n if ( tail != null){\n tail = tail.getNext();\n }\n\n }", "public void rotate2(int[] nums, int k) {\n int start = 0, n = nums.length;\n k %= n;\n while (n > 0 && k > 0) {\n // Swap the last k elements with the first k elements.\n // The last k elements will be in the correct positions\n // but we need to rotate the remaining (n - k) elements\n // to the right by k steps.\n for (int i = 0; i < k; i++) {\n swap(nums, i + start, n - k + i + start);\n }\n n -= k;\n start += k;\n k %= n;\n }\n }", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "public void rotateReverse(int[] nums, int k){\n int n = nums.length;\n \n //in case k is greater than the length\n k = k % n;\n \n reverse(nums, 0, n-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, n-1);\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head == null || head.next == null || k < 2)\n return head;\n \n ListNode dummy = new ListNode(0);\n ListNode curr = dummy;\n ListNode tail = head;\n int count = 0;\n while(head != null) {\n count++;\n if(count == k) {\n // Reverse nodes \n // Store location of head next\n // Store location of rear, this will be used to know where to continue next\n ListNode temp = head.next;\n ListNode last = tail;\n \n // Move pointers around to reverse the nodes\n ListNode next = tail;\n while(next != temp) {\n ListNode prev = tail;\n tail = next == tail ? tail.next : next;\n next = tail.next;\n tail.next = prev;\n }\n curr.next = head;\n curr = last;\n head = temp;\n tail = temp;\n count = 0;\n }\n else {\n head = head.next;\n }\n }\n curr.next = tail;\n return dummy.next;\n }", "public void rotate(int[] nums, int k) {\n \n k = k % nums.length;\n reverse(nums, 0, nums.length-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, nums.length-1);\n }", "ListNode kAltReverse(ListNode head, int k) {\r\n\t\tListNode curr = head, next = null, prev = null;\r\n\t\tint count = 0;\r\n\t\t/*1) LL Revese Alg: reverse first k nodes of the linked list */\r\n\t\twhile (curr != null && count < k) {\r\n\t\t\tnext = curr.next;\r\n\t\t\tcurr.next = prev;\r\n\t\t\tprev = curr;\r\n\t\t\tcurr = next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 2) Now head points to the kth node. So change next of head to (k+1)th node*/\r\n\t\tif (head != null) {\r\n\t\t\thead.next = curr;\r\n\t\t}\r\n\t\t/* 3) We do not want to reverse next k nodes. So move the curr pointer to skip next k nodes */\r\n\t\tcount = 0;\r\n\t\twhile (count < k - 1 && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 4) Recursively call for the list starting from curr->next. \r\n\t\tAnd make rest of the list as next of first node */\r\n\t\tif (curr != null) {\r\n\t\t\tcurr.next = kAltReverse(curr.next, k);\r\n\t\t}\r\n\t\t/* 5) prev is new head of the input list */\r\n\t\treturn prev;\r\n\t}", "public ListNode reverseKGroup(ListNode head, int k) {\n int len = getLength(head);\n ListNode dummy = new ListNode(-1);\n dummy.next = head;\n ListNode prepare = dummy;\n\n for (int i = 0; i <= len - k; i = i + k) {\n prepare = reverse(prepare, k);\n }\n return dummy.next;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head==null || head.next==null || k==0)\n return head;\n ListNode left = head;\n ListNode right = head;\n int count = 1;\n while(count<=k && right!=null){\n right = right.next;\n count++;\n }\n if(count-1!=k && right==null)\n return left;\n ListNode pre = null;\n ListNode cur = left;\n while(cur!=right){\n ListNode next = cur.next;\n cur.next = pre;\n pre = cur;\n cur = next;\n }\n left.next = reverseKGroup(cur, k);\n return pre;\n }", "public static void rotate(int[] nums, int k) {\n // get the kth index from the end to rotate\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, tmp = 0;\n\t\tfor(int i = 0 ; i < k ; i++) {\n\t\t\tprev = nums[n - 1];\n\t\t\tfor(int j = 0 ; j < nums.length ; j++) {\n\t\t\t\ttmp = nums[j];\n\t\t\t\tnums[j] = prev;\n\t\t\t\tprev = tmp;\n\t\t\t}\n\t\t}\n }", "public void rotateold2(int[] a, int k) {\n\n\t\tif (a == null || a.length == 0)\n\t\t\treturn;\n\n\t\tint jump = 0, len = a.length, cur = a[0], next, count = 0;\n\n\t\tk %= len; \n\t\tif (k == 0) return;\n\n\t\tif (len % k != 0 || k == 1)\n\t\t{ \n\t\t\tint i = 0;\n\t\t\twhile (i < len)\n\t\t\t{\n\t\t\t\tjump = (jump + k) % len;\n\t\t\t\tnext = a[jump];\n\t\t\t\ta[jump] = cur;\n\t\t\t\tcur = next;\n\t\t\t\ti++;\n\t\t\t} \n\t\t} \n\t\telse\n\t\t{\n\t\t\tfor (int i = 0; i <= len/k; i ++)\n\t\t\t{\n\t\t\t\tint start = 0;\n\t\t\t\tjump = i;\n\t\t\t\tnext = a[jump];\n\t\t\t\tcur = a[i];\n\t\t\t\twhile (start <= len/k)\n\t\t\t\t{\n\t\t\t\t\tjump = (jump + k) % len;\n\t\t\t\t\tnext = a[jump];\n\t\t\t\t\ta[jump] = cur;\n\t\t\t\t\tcur = next;\n\t\t\t\t\tstart++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public ListNode reverseKGroup(ListNode head, int k) {\r\n\t\tif (head == null) return head;\r\n\t\tint count = 0;\r\n\t\tListNode curr = head, prev = null, next = null;\r\n\t\t// Find the k+1 node\r\n\t\twhile (count != k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\r\n\t\tif (count != k) return head;\r\n\t\t// reverse list with k+1 node as head\r\n\t\tprev = reverseKGroup(curr, k);\r\n\t\t// LL Reversal Alg: reverse current k-group from head ptr\r\n\t\twhile (count-- > 0) {\r\n\t\t\tnext = head.next;\r\n\t\t\thead.next = prev;\r\n\t\t\tprev = head;\r\n\t\t\thead = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}", "public void rotate(int[] nums, int k) {\n\t\tif(nums == null || nums.length == 0 || k <= 0){\n\t\t\treturn;\n\t\t}\n\t\tint n = nums.length, count = 0;\n\t\tk %= n;\n\t\tfor(int start = 0; count < n; start++){\n\t\t\tint cur = start;\n\t\t\tint prev = nums[start];\n\t\t\tdo{\n\t\t\t\tint next = (cur + k) % n;\n\t\t\t\tint temp = nums[next];\n\t\t\t\tnums[next] = prev;\n\t\t\t\tcur = next;\n\t\t\t\tprev = temp;\n\t\t\t\tcount++;\n\t\t\t}while(start != cur);\n\t\t}\n\t}", "public static ListNode reverse(ListNode head, int k) {\n\t\tListNode curr = head;\n\t\tListNode prev = null;\n\t\twhile (true) {\n\t\t\tListNode prevLast = prev; // null for head,1 for 4,5,6\n\t\t\tListNode first = curr;\n\n\t\t\t// reversing\n\t\t\tprev = null;\n\t\t\tfor (int i = 0; i < k && curr != null; i++) {\n\t\t\t\tListNode temp = curr.next;\n\t\t\t\tcurr.next = prev;\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = temp;\n\t\t\t}\n\n\t\t\t// setting prevElement next pointer\n\t\t\tif (prevLast == null) {\n\t\t\t\thead = prev;\n\n\t\t\t} else {\n\t\t\t\tprevLast.next = prev;\n\t\t\t}\n\n\t\t\tif (curr == null)\n\t\t\t\tbreak;\n\n\t\t\tprev = first;\n\n\t\t}\n\n\t\treturn head;\n\n\t}", "public void rotateNoSpace(int[] nums, int k){\n //in case k is greater than the length\n k = k % nums.length;\n \n for(int i = 0; i < k; i++){\n int last = nums[nums.length-1];\n for(int j = nums.length - 1; j >= 1; j--){\n nums[j] = nums[j-1];\n }\n nums[0] = last;\n }\n }", "public static void main(String[] args) {\n\t\tNode current=new Node(10);\r\n\t\tcurrent.next = new Node(20); \r\n\t\tcurrent.next.next = new Node(30); \r\n\t\tcurrent.next.next.next = new Node(40); \r\n\t\tcurrent.next.next.next.next = new Node(50); \r\n Node r=Rotatelinkedlistbyk(current,2);\r\n if(r==null)\r\n {\r\n \t System.out.print(\"no element to return\");\r\n }\r\n while(r != null)\r\n {\r\n \t System.out.print(r.data);\r\n \t r=r.next;\r\n }\r\n\r\n\t}", "public void rotateReverse(int[] nums, int k) {\n\t\tint n = nums.length;\n\t\tk %= n;\n\t\treverse(nums, 0, n - 1);\n\t\treverse(nums, 0, k - 1);\n\t\treverse(nums, k, n - 1);\n\t}", "public void rotateLeftWithReverse(int arr[], int n, int k) {\n reverse(arr, 0, k-1);\n\n //reverse last k elements\n reverse(arr, n-k-1, n-1);\n\n //reverse all array\n reverse(arr, 0, n-1);\n printArray(arr);\n\n /*\n * Time Complexity : O(n) loop ran for k times\n * Space Complexity : O(1)\n */\n }", "LinkList rotate(int numberOfRotations){\n\t\twhile(numberOfRotations!=0){\n\t\t\tNode temp=this.head;\n\t\t\twhile(temp.getNext()!=null){\n\t\t\t\ttemp=temp.getNext();\n\t\t\t}\n\t\t\ttemp.setNext(head);\n\t\t\thead=head.getNext();\n\t\t\ttemp.getNext().setNext(null);\n\t\t\tnumberOfRotations--;\n\t\t}\n\t\t\n\t\treturn this;\n\t}", "public static void rotate(java.util.List arg0, int arg1)\n { return; }", "private AvlNode<E> rotateWithRightChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.right;\n k1.right = k2.left;\n k2.left = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(k1.height, height(k2.right)) + 1;\n return k2;\n }", "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public MyListNode reverseKGroup(MyListNode head, int k) {\n if (k == 1)\n return head;\n MyListNode H = new MyListNode(0);\n H.next = head;\n MyListNode q = H;\n for (MyListNode p = head; p != null; p = p.next) {\n p = reverseK(q, k);\n if (p == null)\n break;\n q = p;\n }\n return H.next;\n }", "public static int[] rotate(int[] nums, int k) {\n int[] temp = new int[k];\n int acc = k % nums.length;\n for (int i = 0; i < acc; i++) {\n temp[i] = nums[(nums.length - acc) + i];\n }\n for (int i = nums.length - acc - 1; i >= 0; i--) {\n nums[i + acc] = nums[i];\n }\n for (int i = 0; i < acc; i++) {\n nums[i] = temp[i];\n }\n return nums;\n }", "public void rotate(int[] nums, int k) {\n int[] tmp = new int[nums.length];\n for (int i = 0; i < nums.length; ++i) {\n tmp[(i + k) % nums.length] = nums[i];\n }\n\n for (int i = 0; i < nums.length; ++i) {\n nums[i] = tmp[i];\n }\n }", "public void rightRotate(Node n) {\r\n\t\tNode y = n.left;\r\n\t\tn.left = y.right;\r\n\t\tif(!y.right.isNil)\r\n\t\t\ty.right.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.right)\r\n\t\t\tn.parent.right = y;\r\n\t\telse\r\n\t\t\tn.parent.left = y;\r\n\t\ty.right = n;\r\n\t\tn.parent = y;\r\n\t}", "protected Node<E> rotateRight(Node<E> root) {\r\n\t\tNode<E> temp = root.left;\r\n\t\troot.left = temp.right;\r\n\t\ttemp.right = root;\r\n\t\treturn temp;\r\n\t}", "private void rotateRightDel (WAVLNode z) {\n\t WAVLNode x = z.left;\r\n\t WAVLNode d = x.right;\r\n\t x.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=x;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=x;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=x;\r\n\t }\r\n\t x.right = z;\r\n\t x.rank++;\r\n\t z.parent=x;\r\n\t z.left = d;\r\n\t z.rank--;\r\n\t if(d.rank>=0) {\r\n\t\t d.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.right.sizen+d.sizen+1;\r\n\t x.sizen = z.sizen+x.left.sizen+1;\r\n }", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "private Node rotateRight() {\n Node left = this.leftChild;\n this.leftChild = left.rightChild;\n left.rightChild = this;\n\n this.updateHeight();\n left.updateHeight();\n\n return left;\n }", "private static SLLNode removeKthLast(SLLNode node, int k) {\n\n if (node == null) {\n throw new IllegalArgumentException(\"Node is empty\");\n }\n\n SLLNode first = node;\n while (k + 1 > 0) {\n first = first.next;\n k = k - 1;\n }\n\n SLLNode second = node;\n while (first != null) {\n second = second.next;\n first = first.next;\n }\n\n if (second != null && second.next != null) {\n second.next = second.next.next;\n }\n return node;\n }", "public static void rotate1 (int [] nums, int k ) {\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, currIndex = 0, temp = 0, count = 0;\n\t\tfor(int start = 0 ; count < nums.length ; start++) {\n\t\t\tprev = nums[start];\n\t\t\tcurrIndex = start;\n\t\t\t// keep rotating till reach the initial point\n\t\t\tdo {\n\t\t\t\tint nextIndex = (currIndex + k) % n;\n\t\t\t\ttemp = nums[nextIndex];\n\t\t\t\tnums[nextIndex] = prev;\n\t\t\t\tprev = temp;\n\t\t\t\tcurrIndex = nextIndex;\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t} while(start != currIndex);\n\t\t}\n\t}", "private BTNode<T> rotateRight(BTNode<T> p){\n\t\tBTNode<T> q = p.getLeft();\n\t\tp.setLeft(q.getRight());\n\t\tq.setRight(p);\n\t\tfixHeight(p);\n\t\tfixHeight(q);\n\t\treturn q;\n\t}", "private void doubleRotateright(WAVLNode x) {\n\t WAVLNode z=x.left;\r\n\t rightRotate(z);\r\n\t z.rank+=1;\r\n\t leftRotate(z);\r\n }", "public Node reverse(Node headNode, int k) {\n\n Node currNode = headNode;\n Node next = null;\n Node prev = null;\n\n int count = 0;\n\n /* reverse first k nodes of the linked list */\n while (currNode != null && count < k) {\n next = currNode.getNextNode();\n currNode.setNextNode(prev);\n prev = currNode;\n currNode = next;\n count++;\n }\n if (next != null) {\n headNode.setNextNode(reverse(next, k));\n }\n\n return prev;\n }", "private void rotateRight(Node tree) {\n assert tree != null;\n assert tree.left != null;\n\n Node temp = tree.left;\n tree.left = temp.right;\n if(temp.right != null) { //no null pointers\n temp.right.parent = tree;\n }\n temp.parent = tree.parent;\n if(temp.parent != null) { //am i at the root?\n if(temp.parent.left == tree) {\n temp.parent.left = temp;\n } else if (temp.parent.right == tree) {\n temp.parent.right = temp;\n }\n }\n tree.parent = temp;\n temp.right = tree;\n if(tree == root) { root = temp; } //rewrite the root\n rotations += 1;\n }", "public static void removeKthToLast(Node head, int k) {\n if (head == null) return;\n if (k <= 0) return;\n\n Node first = head;\n Node second = head;\n int i = 0;\n while (i < k) {\n if (first == null) return;\n first = first.next;\n i++;\n }\n\n while (first != null) {\n first = first.next;\n second = second.next;\n }\n Node next = second.next;\n if (next == null) {\n second.next = null;\n } else {\n second.data = next.data;\n second.next = next.next;\n }\n }", "public Node rotateRight(Node n)\r\n\t{\r\n\t\tNode target = n.left;//rotate target to node\r\n\t\tNode subTree = target.right;//get its subtree\r\n\t\t\r\n\t\ttarget.right = n; //set targets old sub tree to nodes sub tree\r\n\t\tn.left =subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "public static ListNode swapNodes(ListNode head, int k) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode tail = head;\n int begin = k;\n int len = 0;\n int index = 1;\n Map<Integer,Integer> map = new HashMap<>();\n while(tail != null){\n len++;\n map.put(index++,tail.val);\n tail = tail.next;\n }\n int end = len - k + 1;\n tail = head;\n index = 1;\n while(tail != null){\n if(index == begin){\n tail.val = map.get(end);\n }\n if(index == end){\n tail.val = map.get(begin);\n }\n index++;\n tail = tail.next;\n }\n return head;\n }", "public void rotate(int [] a, int k)\n\t{\n\t\tif (a == null || k == 0)\n\t\t\treturn;\n\n\t\tint [] b = new int[a.length];\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t{\n\t\t\tint jump = (i + k) % a.length;\n\t\t\tb[jump] = a[i];\n\t\t}\n\t\tfor (int i = 0; i <a.length;i++)\n\t\t{\n\t\t\ta[i] = b[i];\n\t\t}\n\t}", "private void rightRotate(int[] nums, int n) {\n\t\tint temp;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttemp = nums[nums.length - 1];\n\t\t\tfor (int j = nums.length - 1; j > 0; j--) {\n\t\t\t\tnums[j] = nums[j - 1];\n\n\t\t\t}\n\n\t\t\tnums[0] = temp;\n\n\t\t}\n\t\tSystem.out.println(Arrays.toString(nums));\n\n\t}", "public static ListNode swapNodes2(ListNode head, int k) {\n ListNode KthFromStart = head, out = head, KthFromLast = head;\n for (int i = 1; i < k; i++) {\n KthFromStart = KthFromStart.next;\n }\n ListNode temp_Node = KthFromStart;\n while (temp_Node.next != null) {\n temp_Node = temp_Node.next;\n KthFromLast = KthFromLast.next;\n }\n int temp = KthFromLast.val;\n KthFromLast.val = KthFromStart.val;\n KthFromStart.val = temp;\n return out;\n }", "protected Node<E> rotateRight( Node<E> root ) {\n\n if( root == null || root.left == null ) {\n return null;\n }\n\n Node<E> tempNode = root.left;\n root.left = tempNode.right;\n tempNode.right = root;\n return tempNode;\n\n }", "public void rotate1(int[] nums, int k) {\n k %= nums.length;\n reverse(nums, 0, nums.length - 1);\n reverse(nums, 0, k - 1);\n reverse(nums, k, nums.length - 1);\n }", "public Node<T> rightRotate(Node<T> node){\n\n Node<T> temp = node.left;//pointer set to the nodes left child\n node.left = temp.right;//node.left set to the right child\n temp.right = node;//temp.right equal to the node that is rotating\n return temp;\n }", "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "Boolean modifyList(int leftIndex,int rightIndex,int numberOfRotations){\n\t\tif(head == null || rightIndex < leftIndex || this.size < leftIndex || this.size < rightIndex || leftIndex==rightIndex ){\n\t\t\treturn false;\n\t\t}\n\t\tLinkList sublist=this.subList(leftIndex, rightIndex);\n\t\tLinkList rotatedList=sublist.rotate(numberOfRotations);\n\t\tNode temp1=this.head;\n\t\tNode temp2=rotatedList.head;\n\t\tint count=1;\n\t\t\n\t\twhile(temp1!=null&&temp2!=null){\n\t\t\tif(count>=leftIndex && count<=rightIndex){\n\t\t\t\ttemp1.setValue(temp2.getValue());\n\t\t\t\ttemp2=temp2.getNext();\n\t\t\t}\n\t\t\ttemp1=temp1.getNext();\n\t\t\tcount++;\n\t\t}\n\t\treturn true;\n\t}", "public List<Integer> rotateEfficiently(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> newList = new ArrayList<>(a);\n int counter=0;\n int size = a.size();\n for (int count=k;count<k+size;count++) {\n newList.set(counter++, a.get(count%size));\n }\n\n return putInSpecifiedQueries(newList,queries);\n }", "private ListNode kthNodeInReverseOrder(ListNode head, int k) {\n if (k == 0 || head == null) {\n return head;\n }\n\n ListNode node = head;\n for (int i = 1; i <= k-1; i++) {\n if (node.next != null) {\n node = node.next;\n } else {\n return null;\n }\n }\n\n ListNode kthNodeInReverse = head;\n\n while (node.next != null) {\n kthNodeInReverse = kthNodeInReverse.next;\n node = node.next;\n }\n\n return kthNodeInReverse;\n }", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n for(int count = 0; count < d; count++) {\n shiftElements(a);\n }\n return a;\n }", "ListNode<Integer> rearrangeLastN(ListNode<Integer> l, int n) {\r\n\t\t\r\n\r\n\t\t\r\n\t\tListNode<Integer> result = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> head_result = result;\r\n\t\t\r\n\t\tListNode<Integer> temp = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> pointer = temp;\r\n\t\t\r\n\t/* 1. */\r\n\t\tint size = (listSize(l) - n);\r\n\t\t\r\n\t/* 2. */\r\n\t\tfor(int i = 0;i < size; i++)\t{\r\n\t\t\tresult.next = l;\r\n\t\t\tresult = result.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\tresult.next = null;\r\n\t\tresult = head_result.next;\r\n\t/*3.*/ \r\n\t\twhile(l != null)\t{\r\n\t\t\ttemp.next = l;\r\n\t\t\ttemp = temp.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\ttemp.next = head_result.next;\r\n\t\ttemp = pointer.next;\r\n\t\tresult = temp;\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public void rotateRight(int numberOfTurns);", "static void rotate_right(int[] arr, int rotate){\n for (int j = 0; j < rotate; j++) {\n int temp = arr[j];\n for (int i = j; i < arr.length+rotate; i+=rotate) {\n if(i-rotate < 0)\n temp = arr[i];\n else if(i >= arr.length)\n arr[i-rotate] = temp;\n else\n arr[i-rotate] = arr[i]; \n }\n }\n }", "private RedBlackNode rotateRight(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode BSubTree = x.left.right;\n\t RedBlackNode y = x.left;\n\t y.right = x;\n\t x.parent = y;\n\t x.left = BSubTree;\n\t //Need to anlayse whether Nil check need to have or Not\n\t BSubTree.parent = x;\n\t if( xParent == this.Nil){\n\t\t this.root = y;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t }else{\n\t\t xParent.right = y;\n\t }\n\t y.parent = xParent;\n\t return y;\n }", "public void rotateNextPlayer(){\n\t\t\n\t\tif(this.toRight)\n\t\t\tthis.nextElem = (this.nextElem + 1) % players.size();\n\t\telse\t\t\t\n\t\t\tthis.nextElem = (this.nextElem - 1 + players.size()) % players.size();\n\t}", "private Node<T> rotateWithRight(Node<T> a) {\n Node<T> b = a.getRight();\n a.setRight(b.getLeft());\n b.setLeft(a);\n int aH = Math.max(findHeight(a.getLeft()),\n findHeight(a.getRight())) + 1;\n a.setHeight(aH);\n int bH = Math.max(findHeight(b.getRight()), aH) + 1;\n b.setHeight(bH);\n hAndBF(a);\n hAndBF(b);\n return b;\n }", "public void rightRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.leftChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// if the pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be to the left of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t} else if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be to the right of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent\r\n\t\t\telse {\r\n\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private AVLNode<T> rotateRight(AVLNode<T> node) {\n AVLNode<T> substiute = node.left;\n node.left = substiute.right;\n substiute.right = node;\n\n // node = substitute;\n\n return substiute;\n }", "public abstract void rotateRight();", "private long removeHelper(long r, int k) throws IOException {\n if (r == 0) {\r\n return 0;\r\n }\r\n long ret = r;\r\n Node current = new Node(r);\r\n if (current.key == k) {\r\n if (current.left == 0) {\r\n ret = current.right;\r\n addToFree(r);\r\n }\r\n else if (current.right == 0) {\r\n ret = current.left;\r\n addToFree(r);\r\n }\r\n else {\r\n current.left = replace(current.left, current);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n }\r\n else if (current.key > k) {\r\n current.left = removeHelper(current.left, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n else {\r\n current.right = removeHelper(current.right, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return ret;\r\n }", "private Node rotateRight(Node h) {\n Node x = h.left;\n h.left = x.right;\n x.right = h;\n x.color = x.right.color;\n x.right.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "private void rightRotate(WAVLNode x) {\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=x.right;\r\n\t WAVLNode y=x.parent;\r\n\t WAVLNode c=y.right;\r\n\t x.right=y;\r\n\t y.left=b;\r\n\t if (y.parent!=null) {\r\n\t\t WAVLNode d=y.parent;\r\n\t\t String side=parentside(d,y);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t x.parent=null;\r\n\t\t this.root=x;\r\n\t }\r\n\t y.parent=x;\r\n\t b.parent=y;\r\n\t y.rank=y.rank-1;\r\n\t \r\n\t y.sizen=b.sizen+c.sizen+1;\r\n\t x.sizen=a.sizen+y.sizen+1;\r\n\t \r\n }", "static public ListNode reorder(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\tListNode one = head;\n\t\tListNode mid = findMidle(head);\n\t\tSystem.out.println(\"mid: \"+ mid.val);\n\t\tListNode two = reverse(mid.next);\n\t\tmid.next = null;\n\t\tListNodeUtils.printList(head);\n\t\tListNodeUtils.printList(two);\n\t\tListNode curr = one;\n\t\twhile (one != null && two != null) {\n\t\t\tone = one.next;\n\t\t\tcurr.next = two;\n\t\t\tcurr = curr.next;\n\n\t\t\ttwo = two.next;\n\t\t\tcurr.next = one;\n\t\t\tcurr = curr.next;\n\t\t}\n\t\tif (one != null) {\n\t\t\tcurr.next = null;\n//\t\t curr = curr.next; \n\t\t}\n\n\t\t// curr.next = null;\n\t\treturn head;\n\t}", "private void LRRotation(IAVLNode node)\r\n\t{\r\n\r\n\t\tRRRotation(node.getLeft());\r\n\t\tLLRotation(node);\r\n\t}", "public void rotateRight(Node node){\n\t\tNode ptrLeft = node.left;\n\t\tnode.left = ptrLeft.right;\n\t\t\n\t\tif(ptrLeft.right != nil){\n\t\t\tptrLeft.right.parent = node;\n\t\t}\n\t\t\n\t\tptrLeft.parent = node.parent;\n\t\t\n\t\tif(ptrLeft.parent==nil){\n\t\t\troot = ptrLeft;\n\t\t}else if(node == node.parent.left){\n\t\t\tnode.parent.left = ptrLeft;\n\t\t}else{\n\t\t\tnode.parent.right = ptrLeft;\n\t\t}\n\t\t\n\t\tptrLeft.right = node;\n\t\tnode.parent = ptrLeft;\n\t}", "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "public List<Integer> rotate(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> arrAfterRotation = new ArrayList<>(a);\n\n List<Integer> lastArrAfterRotation = new ArrayList<>(a);\n\n //Set the last one after rotation equal to provided array at initialization\n lastArrAfterRotation = a;\n\n for(int i=0; i<k; i++) {\n arrAfterRotation.set(0,lastArrAfterRotation.get(lastArrAfterRotation.size()-1));\n int counter=1;\n for (int elem=1; elem<lastArrAfterRotation.size();elem++ ) {\n arrAfterRotation.set(counter++, lastArrAfterRotation.get(elem-1));\n }\n List<Integer> tempList = new ArrayList<>(arrAfterRotation);\n lastArrAfterRotation= tempList;\n }\n printList(lastArrAfterRotation);\n\n List<Integer> returnList = new ArrayList<>(lastArrAfterRotation);\n\n for (int i : queries) {\n returnList.set(i,lastArrAfterRotation.get(i));\n }\n\n return returnList;\n\n }", "private void singleRotateRight(Node n) {\n Node l = n.mLeft, lr = l.mRight, p = n.mParent;\n n.mLeft = lr;\n lr.mParent = n;\n l.mRight = n;\n if (n == mRoot) {\n mRoot = l;\n l.mParent = null;\n }\n else if (p.mLeft == n) {\n p.mLeft = l;\n l.mParent = p;\n }\n else {\n p.mRight = l;\n l.mParent = p;\n }\n n.mParent = l;\n }", "private void doubleRotateRightDel (WAVLNode z) {\n\t WAVLNode a = z.left.right;\r\n\t WAVLNode y = z.left;\r\n\t WAVLNode c = z.left.right.right;\r\n\t WAVLNode d = z.left.right.left;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.right=z;\r\n\t a.left=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.right=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.left=c;\r\n\t z.rank=z.rank-2;\r\n\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "private void doubleRotateleft(WAVLNode x) {\n\t WAVLNode z=x.right;\r\n\t leftRotate(z);\r\n\t z.rank+=1;\r\n\t rightRotate(z);\r\n }", "private void rightRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.right != null)\n\t\t\tgetSplay(child.right).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.left = child.right;\n\t\tchild.right = p;\n\t\t\t\t\n\t}", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n\t\tint len = a.size();\n\t\t// 1,2,3,4,5\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\tresult.addAll(a);\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\t// i = 0 , 1, 2, 3, 4\n\t\t\t// j = 1 , 2, 3, 4, 0\n\t\t\tint j = (i + (len - d)) % len;\n\t\t\tresult.set(j, a.get(i));\n\t\t}\n\t\treturn result;\n\t}", "public void insertRight( long j ) {\n if ( end == max - 1 ) {\n end = -1;\n }\n Array[++end] = j;\n nItems++;\n }", "public AVLNode rotateRight(AVLNode pt) {\n\t\tAVLNode node = pt.getLeft();\n\t\t\n\t\tpt.setLeft(node.getRight());\n\t\tnode.setRight(pt);\n\t\t\n\t\treturn node;\n\t}", "private Node rightRotate(Node a) {\n Node b = a.getLeftChild();\n Node n3 = b.getRightChild();\n b.setRightChild(a);\n a.setLeftChild(n3);\n setHeights(a, b);\n return b;\n }", "static Node reserveIterativeTraversal(MyLinkedList l, int k) {\n\t\tNode p1 = l.getHead();\n\t\tNode p2 = l.getHead();\n\t\t\n\t\tfor(int i = 0; i < k; i++) \n\t\t\tp1 = p1.getNext();\n\t\t\t\n\t\twhile(p1.getNext() != null) {\n\t\t\tp1 = p1.getNext();\n\t\t\tp2 = p2.getNext();\n\t\t}\n\t\t\n\t\treturn p2;\n\t}", "public static void quicksort(int l, int r, List<CustomCharacter> list)\n throws InterruptedException {\n\n // handle edge cases\n if(l >= r){\n return;\n }\n if(l >= list.size()){\n return;\n }\n if(r >= list.size()){\n r = list.size() - 1;\n }\n\n\n\n // partition smaller elements on left // and larger on right // with respect to the originalPosition of the rth element (pivot)\n int smallElementEnd = l-1;\n System.out.println(\"Deciding for : \" + list.get(r).key);\n\n CustomCharacter rth = list.get(r);\n for (int i = l; i < r; i++) {\n CustomCharacter curr = list.get(i);\n if(curr.originalPosition < rth.originalPosition){\n swap(list, ++smallElementEnd, i);\n }\n }\n\n // place rth element at correct position\n swap(list, ++smallElementEnd, r);\n\n Thread.sleep(1500);\n printList(list);\n\n // sort the remaining two halves\n quicksort(l, smallElementEnd-1, list);\n quicksort(smallElementEnd + 1, r, list);\n }", "public static void rotateArray(final int[] nums, final int k) {\n final var rot = k % nums.length;\n\n int temp, previous;\n for (int i = 0; i < rot; i++) {\n previous = nums[nums.length - 1];\n for (int j = 0; j < nums.length; j++) {\n temp = nums[j];\n nums[j] = previous;\n previous = temp;\n }\n }\n }", "private void rotateLeftDel (WAVLNode z) {\n\t WAVLNode y = z.right;\r\n\t WAVLNode a = y.left;\r\n\t y.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=y;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=y;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=y;\r\n\t }\r\n\t \r\n\t y.left = z;\r\n\t y.rank++;\r\n\t z.parent=y;\r\n\t z.right = a;\r\n\t z.rank--;\r\n\t if(a.rank>=0) {\r\n\t\t a.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.left.sizen+a.sizen+1;\r\n\t y.sizen = z.sizen+y.right.sizen+1;\r\n }", "private static void rotate(int[][] a, start, end){\n for (int current = 0; start+current < end; current++){\n int temp = a[start][start+current]; // save the top \n a[start][start+current] = a[end-current][start]; // left to top moveing left elemnt to top\n a[end-current][start] = a[end][end-current]; // bottom element to left \n a[end][end-current] = a[start+current][end]; // right element to bottom \n a[start+current][end] = temp; // top elemrnt to right\n }\n}", "@Override\r\n public void rotateClockwise() {\r\n super.rotateClockwise(); //To change body of generated methods, choose Tools | Templates.\r\n // TODO: Fix me\r\n undo.push('c');\r\n redo = new LinkedListStack();\r\n }", "public void reorderList(ListNode head) {\n\tif (head == null || head.next == null) {\n\t return;\n\t}\n\n\tDeque<Integer> dq = new LinkedList<>();\n\tListNode cur = head;\n\twhile (cur != null) {\n\t dq.add(cur.val);\n\t cur = cur.next;\n\t}\n\n\tListNode cur1 = head;\n\twhile (cur1 != null && cur1.next != null) {\n\t cur1.val = dq.pollFirst();\n\t cur1.next.val = dq.pollLast();\n\t cur1 = cur1.next.next;\n\t}\n\n\tif (cur1 != null) {\n\t cur1.val = dq.poll();\n\t}\n }", "private Node rotateRight(Node h){\n\t\tNode x = h.left;\n\t\th.left = x.right;\n\t\tx.right = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "public void reorderList(ListNode head) {\n if (head == null) {\n return;\n } else if (head.next == null) {\n return;\n }\n \n ListNode pre = findMidPre(head);\n \n // cut the two list.\n ListNode right = pre.next;\n pre.next = null;\n \n // reverse the right link.\n right = reverse(right);\n \n merge(head, right);\n }" ]
[ "0.8503024", "0.82849723", "0.7529185", "0.7421512", "0.7393354", "0.7362919", "0.72623026", "0.7159837", "0.7076005", "0.7016568", "0.6957061", "0.69511503", "0.69392145", "0.68544555", "0.65239674", "0.65170026", "0.6490881", "0.64857495", "0.6382969", "0.63385135", "0.62630653", "0.6251596", "0.6212221", "0.61977696", "0.6128926", "0.61281866", "0.6127355", "0.610237", "0.60832596", "0.6072055", "0.6051788", "0.60313356", "0.6030429", "0.60135645", "0.60114855", "0.59978056", "0.59697044", "0.59633225", "0.5893404", "0.5884693", "0.58609366", "0.5854039", "0.583091", "0.5817178", "0.58138794", "0.57897174", "0.5777479", "0.57743025", "0.5762207", "0.57559425", "0.5741192", "0.5732476", "0.5731405", "0.5730186", "0.5717875", "0.5715", "0.57120657", "0.56804216", "0.56754035", "0.5673465", "0.56531966", "0.56464404", "0.5634956", "0.5627774", "0.5608477", "0.56077456", "0.5601794", "0.5597444", "0.55754983", "0.5558398", "0.5537841", "0.55170023", "0.5510302", "0.5504183", "0.54978055", "0.54923403", "0.5489273", "0.54887205", "0.54863733", "0.5475825", "0.5475141", "0.54731745", "0.5438955", "0.5434022", "0.54219747", "0.5414869", "0.54063094", "0.53916264", "0.5390761", "0.53841066", "0.5368003", "0.53584844", "0.5357382", "0.5344505", "0.5342809", "0.53295064", "0.5324137", "0.5316148", "0.53150743", "0.52933055" ]
0.6978626
10
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.
public static <V> boolean OddEvenNodeShuffle ( final ListNode<V> head) { ListNode<V> even = head.next(); ListNode<V> prevOdd = head; ListNode<V> firstEven = even; while (null != even) { ListNode<V> nextOdd = even.next(); if (null == nextOdd) { prevOdd.setNext (firstEven); break; } ListNode<V> nextEven = nextOdd.next(); prevOdd.setNext (nextOdd); nextOdd.setNext (firstEven); even.setNext (nextEven); even = nextEven; prevOdd = nextOdd; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void segregateEvenAndOddNodes() {\r\n\t\tif(header == null)\r\n\t\t\treturn;\r\n\t\tNode<Integer> evenItr = null;\r\n\t\tNode<Integer> oddItr = null;\r\n\t\t\r\n\t\tNode<Integer> evenHeader = null;\r\n\t\tNode<Integer> oddHeader = null;\r\n\t\t\r\n\t\tNode<Integer> itr = header;\r\n\t\tNode<Integer> prevItr;\r\n\t\t\r\n\t\twhile(itr != null) {\r\n\t\t\tInteger data = itr.data;\r\n\t\t\tif(data % 2 == 0) {\r\n\t\t\t\tif(evenItr == null) {\r\n\t\t\t\t\tevenItr = itr;\r\n\t\t\t\t\tevenHeader = itr;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tevenItr.next = itr;\r\n\t\t\t\t\tevenItr = itr;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif(oddItr == null) {\r\n\t\t\t\t\toddItr = itr;\r\n\t\t\t\t\toddHeader = itr;\r\n\t\t\t\t} else {\r\n\t\t\t\t\toddItr.next = itr;\r\n\t\t\t\t\toddItr = itr;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprevItr = itr;\r\n\t\t\titr = itr.next;\r\n\t\t\tprevItr.next = null;\r\n\t\t}\r\n\t\tif(evenItr == null) {\r\n\t\t\t//only odd nodes\r\n\t\t\theader = oddHeader;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(oddItr == null) {\r\n\t\t\t//only even nodes\r\n\t\t\theader = evenHeader;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//both odd and even nodes\r\n\t\theader = evenHeader;\r\n\t\tevenItr.next = oddHeader;\r\n\t}", "public ListNode oddEvenList(ListNode head) {\n if(head == null)return head;\n ListNode dummyNode = new ListNode(-1);\n dummyNode.next = head;\n ListNode odd = head;\n ListNode even = head.next;\n ListNode start = even;\n while(odd.next != null && even.next != null){\n odd.next = even.next;\n odd = odd.next;\n even.next = odd.next;\n even = even.next;\n }\n odd.next = start;\n return dummyNode.next;\n }", "public ListNode oddEvenList(ListNode head) {\n\t\tif (head == null || head.next == null)\n\t\t\treturn head;\n\n\t\tListNode oddHead = new ListNode(0);\n\t\tListNode evenHead = new ListNode(0);\n\t\toddHead.next = head;\n\t\tevenHead.next = head;\n\t\tListNode odd = oddHead, even = evenHead;\n\t\tListNode cur = head;\n\t\tint count = 1;\n\t\twhile (cur != null) {\n\t\t\tif (count % 2 == 0) {\n\t\t\t\teven.next = cur;\n\t\t\t\teven = even.next;\n\t\t\t} else {\n\t\t\t\todd.next = cur;\n\t\t\t\todd = odd.next;\n\t\t\t}\n\t\t\tcount++;\n\t\t\tcur = cur.next;\n\t\t}\n\t\teven.next = null;\n\t\todd.next = evenHead.next;\n\t\treturn oddHead.next;\n\t}", "public ListNode oddEvenListOnValue(ListNode head) {\n\t\tif (head == null || head.next == null)\n\t\t\treturn head;\n\n\t\tListNode oddHead = new ListNode(0);\n\t\tListNode evenHead = new ListNode(0);\n\t\toddHead.next = head;\n\t\tevenHead.next = head;\n\t\tListNode odd = oddHead, even = evenHead;\n\t\tListNode cur = head;\n\t\twhile (cur != null) {\n\t\t\tif (cur.val % 2 == 0) {\n\t\t\t\teven.next = cur;\n\t\t\t\teven = even.next;\n\t\t\t} else {\n\t\t\t\todd.next = cur;\n\t\t\t\todd = odd.next;\n\t\t\t}\n\t\t\tcur = cur.next;\n\t\t}\n\t\teven.next = null;\n\t\todd.next = evenHead.next;\n\t\treturn oddHead.next;\n\t}", "public static Node createEvenListFromOriginal(Node head){\n Node previous = null;\n Node current = head;\n Node newHead = null;\n Node newCurrent = null;\n while(current != null){\n if(current.data % 2 == 0){\n if(newHead == null){\n newHead = new Node(current.data);\n newCurrent = newHead;\n }\n else{\n Node next = new Node(current.data);\n newCurrent.next = next;\n newCurrent = next;\n }\n if(previous != null){\n previous.next = current.next;\n }\n }\n previous = current;\n current = current.next;\n }\n return newHead;\n }", "static Node getEvenOdd(Node head){\n\t if(head == null)\n\t return null;\n\t Node tempEven = head, tempOdd = head.next, tempHead = head, tempOddHead = tempOdd;\n\t while(tempOdd != null && tempEven != null) {\n\t\tif(tempOdd.next == null) {\n\t\t\ttempEven.next = tempOddHead;\n\t\t\tbreak;\n\t\t}\n\t\ttempEven.next = tempOdd.next;\n\t\ttempEven = tempEven.next;\n\t if(tempEven.next != null) {\n\t \ttempOdd.next = tempEven.next;\n\t }\n\t else{\n\t \ttempOdd.next = null;\n\t \ttempEven.next = tempOddHead;\n\t\t\tbreak;\n\t }\n\t tempOdd = tempOdd.next;\n\t }\n\t return tempHead;\n\t}", "public static void printEvenNodes(Node head){\n Node current = head;\n while(current != null){\n if(current.data % 2 == 0){\n System.out.print(current.data);\n System.out.print(\"->\");\n }\n current = current.next;\n }\n System.out.println();\n }", "public static LinkListPlay oddEven(LinkListPlay input) {\n if (input == null || input.getHead() == null || input.getHead().getNextNode() == null) {\n return input;\n }\n\n Node node = input.getHead();\n Node prev = null;\n LinkListPlay evenData = new LinkListPlay();\n int count = 1;\n\n while (node != null) {\n if (count % 2 == 0) {\n evenData.insertAtHead(new Node(node.getData()));\n prev.setNextNode(node.getNextNode());\n }\n prev = node;\n node = node.getNextNode();\n count++;\n\n }\n\n return mergeNode(input, evenData);\n //System.out.println(\"\");\n }", "public static void main(String[] args) {\n\t\tListNode head = new ListNode(17);\n\t\thead.next = new ListNode(15);\n\t\thead.next.next = new ListNode(8);\n\t\thead.next.next.next = new ListNode(12);\n\t\thead.next.next.next.next = new ListNode(5);\n\t\thead.next.next.next.next.next = new ListNode(7);\n\t\t\n\t\tListNode res = new SegregateEvenAndOdd().segregate(head);\n\t\twhile(res != null){\n\t\t\tSystem.out.print(res.val+\" \");\n\t\t\tres = res.next;\n\t\t}\n\t\t\n\t}", "public static void deleteAllOddPositionNodes(Node head) {\n int len = length(head);\n if (len < 2) {\n return;\n }\n Node current = head;\n do {\n Node toBeDeleted = current.next;\n // Note: current.next.next can not be null in circular list.\n current.next = current.next.next;\n toBeDeleted.next = null;\n current = current.next;\n } while(current != head && current.next != head);\n }", "private ListNode split2(ListNode head) {\n ListNode res = head.next;\n ListNode p1 = head;\n while (p1 != null) {\n ListNode p2 = p1.next;\n p1.next = p2.next;\n p1 = p1.next;\n if (p2.next != null) {\n p2.next = p1.next;\n }\n }\n return res;\n }", "public static void deleteAlternateNodes(Node<Integer> head) {\n int size=0;\n Node temp=head;\n while(head!=null && head.next!=null )\n {\n if(size%2!=0)\n {\n Node t=head.next;\n head.next=t.next;\n head=t.next;\n }\n size++;\n }\n }", "public static Node deleteAllEvenPositionNodes(Node head) {\n int len = length(head);\n // if list have single node\n // then return\n if (len < 2) {\n // do not forget to lose link on head\n return null;\n }\n Node newHead = deleteFirst(head);\n deleteAllOddPositionNodes(newHead);\n return newHead;\n }", "private static void test1() {\n ListNode listOne = new ListNode(1);\n listOne.next = new ListNode(2);\n listOne.next.next = new ListNode(3);\n listOne.next.next.next = new ListNode(4);\n listOne.next.next.next.next = new ListNode(5);\n\n ListNode listTwo = new ListNode(1);\n listTwo.next = new ListNode(3);\n listTwo.next.next = new ListNode(4);\n\n ListNode listThree = new ListNode(2);\n listThree.next = new ListNode(6);\n\n ListNode[] lists = {listOne, listTwo, listThree};\n\n mergeKLists(lists);\n }", "public void reorderList(ListNode head) {\n\n if(head == null||head.next == null) return;\n int len = 0;\n\n for (ListNode cur = head; cur!= null; cur = cur.next) len++;\n\n int middle = (len%2 == 1) ? len/2 + 1: len/2 ;\n\n ListNode midNode = head;\n for (int i = 0; i < middle - 1; i++)\n midNode = midNode.next;\n\n ListNode head1 = head;\n ListNode head2 = midNode.next;\n midNode.next = null;\n head2 = revertListAndReturnHead(head2);\n\n //MERGE\n ListNode cur1 = head1;\n ListNode cur2 = head2;\n while (cur1 != null && cur2 != null) {\n ListNode nextCur1 = cur1.next;\n ListNode nextCur2 = cur2.next;\n cur1.next = cur2;\n cur2.next = nextCur1;\n cur1 = nextCur1;\n cur2 = nextCur2;\n }\n\n }", "public static IntNode copyOdd( IntNode head ) {\r\n\t\t\r\n\t\t// if head is not null, method should copy all the odd elements in the linked list starting from\r\n\t\t// the given head, create a new linked list with all these odd numbers, and return the linked list with the new head\r\n\t\tif( head != null ) {\r\n\t\t\tIntNode odd = new IntNode();\r\n\t\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\t\tif( (cursor.data % 2) != 0 ) {\r\n\t\t\t\t\tif( odd.data == 0 )\r\n\t\t\t\t\t\todd.setNode(cursor.data);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\todd.addNodeAfterThis(cursor.data);\r\n\t\t\t\t} // end if\r\n\t\t\t} // end for\r\n\t\t\treturn odd;\r\n\t\t} // end if\r\n\t\treturn null;\r\n\t}", "private ListNode split(ListNode head) {\n ListNode res = head.next;\n ListNode p1 = head, p2 = res;\n while (p1.next.next != null) {\n ListNode p1next = p2.next;\n ListNode p2next = p2.next.next;\n p1.next = p1next;\n p2.next = p2next;\n p1 = p1.next;\n p2 = p2.next;\n }\n p1.next = null;\n return res;\n }", "public static ArrayList<Integer> oddValues(ArrayList<Integer> initialList){\n\t\tfor (Iterator<Integer> i = initialList.iterator(); i.hasNext();) {\n\t\t\tif(i.next()%2 == 0) {\n\t\t\t\ti.remove();\n\t\t\t}\n\t\t}\n\t\treturn initialList;\n\t}", "public ListNode mergeKLists(ListNode[] lists) {\n LinkedList<Integer> a= new LinkedList<Integer>();\n \n for(int i=0;i<lists.length;i++) {\n ListNode temp = lists[i];\n \n while(temp!=null) {\n // System.out.println(temp.val);\n a.add(temp.val);\n temp=temp.next;\n }\n }\n Collections.sort(a);\n //copy all the elements into ListNode linked list.\n if(a.size()==0) { return null; }\n ListNode head = new ListNode(a.get(0));\n ListNode res = head;\n if(head== null) {\n head = new ListNode(a.get(0));\n }\n for(int j=1;j<a.size();j++) {\n \n res.next = new ListNode(a.get(j));\n res=res.next;\n \n }\n res=head;\n \n return res;\n \n \n \n \n }", "private int[] sortByEvenOdd(int[] numbers) {\n\t\tint nextEven=0, nextOdd = numbers.length-1;\n\t\twhile(nextEven<nextOdd) {\n\t\t\tif(numbers[nextEven]%2==0) {\n\t\t\t\tnextEven++;\n\t\t\t}else {\n\t\t\t\tint temp = numbers[nextEven];\n\t\t\t\tnumbers[nextEven]= numbers[nextOdd];\n\t\t\t\tnumbers[nextOdd--]=temp;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn numbers;\n\t}", "public static int listEvenNumber( IntNode head ) {\r\n\t\tif( head == null )\r\n\t\t\treturn 0;\r\n\t\t\r\n\t\tint eCnt = 0;\r\n\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\tif( cursor.data % 2 == 0 )\r\n\t\t\t\teCnt++;\r\n\t\t} // end for\r\n\t\treturn eCnt;\t\t\r\n\t}", "public static LLList getAllOdds(LLList vals) {\r\n LLList odd = new LLList();\r\n int j = 0;\r\n for (int i = 0; i < vals.length(); i++) {\r\n int val = (int) vals.getItem(i);\r\n if (val % 2 == 1) {\r\n odd.addItem(val, j);\r\n j++;\r\n }\r\n }\r\n return odd;\r\n }", "static List<Integer> oddNumbers(int l, int r) {\n List<Integer> output = new ArrayList<Integer>();\n if (l % 2 == 0) {\n l = l + 1;\n }\n while (l <= r) {\n output.add(l);\n l = l + 2;\n }\n return output;\n }", "public DoubleLinkedSeq everyOther(){\r\n\t DoubleLinkedSeq everyOther = new DoubleLinkedSeq(); \r\n\t int count = 2; \r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t if(count % 2 == 0){\r\n\t\t\t everyOther.addAfter(this.getCurrent());\r\n\t\t }\r\n\t\t else {}\r\n\t\t \r\n\t\t count += 1; \r\n\t }\r\n\t return everyOther; \r\n\t \r\n}", "public OddEvenLinkedList() {\n this.head = null;\n this.tail = null;\n }", "public void deleteEven(){\n\t\tNode temp = this.head;\n\t\tint cnt = 0;\n\t\twhile(cnt != this.length()){\n\t\t\tif(cnt%2 == 0){\n\t\t\t\tthis.deleteAtPos(cnt);\n\t\t\t}\n\t\t\tcnt++;\n\t\t}\n\t}", "static List<String> packNumbers(List<Integer> arr) {\n List<String> result = new ArrayList<>();\n for (int i = 0; i < arr.size(); i++) {\n Integer item = arr.get(i);\n\n int numSibling = 1;\n for (int j = i+1; j < arr.size(); j++) {\n Integer nextItem = arr.get(j);\n if (item.equals(nextItem)) {\n numSibling++;\n i++;\n } else {\n break;\n }\n }\n\n if (numSibling == 1) {\n result.add(String.valueOf(item));\n } else {\n result.add(item + \":\" + numSibling);\n }\n }\n return result;\n }", "public void removeOddSubtrees () {\n\t\t// TODO\n\t\tif (root == null) return; \n if (root.key % 2 != 0) {\n root = null;\n }\n removeOddSubtrees(root);\n }", "public Node method2(Node head)\n {\n Node[] linkedList = new Node[100];\n int index = 0;\n while (head != null)\n {\n linkedList[index] = head;\n head = head.next;\n index++;\n }\n\n return linkedList[index/2];\n }", "static <T> ListNode<T> listZipping(ListNode<T> list) {\n int size = 1;\n\n ListNode<T> current = list;\n while (current.next != null) {\n size++;\n current = current.next;\n }\n\n if (size < 2) return list;\n\n current = list;\n for (int i = 0; i < (size - 1) / 2; i++) current = current.next;\n\n ListNode<T> secondHalf = current.next;\n current.next = null;\n\n // reverse the second half\n current = secondHalf;\n while (current.next != null) {\n ListNode<T> tmp = current.next;\n current.next = tmp.next;\n tmp.next = secondHalf;\n secondHalf = tmp;\n }\n\n // merge\n ListNode<T> firstHalf = list;\n for (int i = 0; i < size / 2; i++) {\n ListNode<T> firstHalfNext = firstHalf.next;\n firstHalf.next = secondHalf;\n ListNode<T> secondHalfNext = secondHalf.next;\n secondHalf.next = firstHalfNext;\n\n firstHalf = firstHalfNext;\n secondHalf = secondHalfNext;\n }\n\n\n return list;\n }", "private static ListNode removeDuplicates(ListNode head) {\n\n if (head == null)\n return head;\n\n // Initialize result node\n ListNode result = new ListNode(0);\n\n // Assuming that, if LinkedList has no duplicates\n result.next = head;\n\n //Iterate curr and next values.\n ListNode curr = result;\n ListNode next = result.next;\n\n boolean isDupFound = false;\n while (next != null) {\n\n //if next value is same as curr value. don't update current\n if (next.next != null && next.val == next.next.val) {\n isDupFound = true;\n }\n else if(isDupFound){\n curr.next = next.next;\n isDupFound = false;\n }\n else {\n curr = curr.next;\n }\n next = next.next;\n\n }\n return result.next;\n }", "Node[] merge(List<Node> nodeList1, List<Node> nodeList2, List<Node> exhaustedNodes);", "private ListNode iterateMergeTwoRankedList(ListNode head5, ListNode head6) {\n\n if (head5 == null) {\n return head6;\n } else if (head6 == null) {\n return head5;\n }\n\n ListNode mergedHead = null;\n ListNode node = mergedHead;\n\n while (head5 != null && head6 != null) {\n node = head5.val <= head6.val ? head5 : head6;\n\n if (mergedHead == null) {\n mergedHead = node;\n }\n\n node = node.next;\n head5 = head5.next;\n head6 = head6.next;\n }\n\n if (head5 == null) {\n node = head6;\n }else if (head6 == null) {\n node = head5;\n }\n\n return mergedHead;\n }", "private List<NodePair> allNodePairs(List<Node> nodes) {\n List<NodePair> nodePairs = new ArrayList<>();\n for (int j = 0; j < nodes.size() - 1; j++) {\n for (int k = j + 1; k < nodes.size(); k++) {\n nodePairs.add(new NodePair(nodes.get(j), nodes.get(k)));\n }\n }\n return nodePairs;\n }", "public ListNode mergeTwoListsIterative(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n else{\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n }\n while(l1!=null){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "private static Node createLoopedList()\n {\n Node n1 = new Node(1);\n Node n2 = new Node(2);\n Node n3 = new Node(3);\n Node n4 = new Node(4);\n Node n5 = new Node(5);\n Node n6 = new Node(6);\n Node n7 = new Node(7);\n Node n8 = new Node(8);\n Node n9 = new Node(9);\n Node n10 = new Node(10);\n Node n11 = new Node(11);\n\n n1.next = n2;\n n2.next = n3;\n n3.next = n4;\n n4.next = n5;\n n5.next = n6;\n n6.next = n7;\n n7.next = n8;\n n8.next = n9;\n n9.next = n10;\n n10.next = n11;\n n11.next = n5;\n\n return n1;\n }", "public ListNode swapPairs(ListNode head) {\n if(head == null)\n return head;\n \n \n int count = 0;\n ListNode h = head;\n ListNode end = head;\n ListNode preH = null;\n\n // we prefer to track a linked list using a head and a tail\n ListNode newHead = null;\n ListNode newTail = null;\n \n while(end != null)\n {\n count = 0;\n while(count < 2 && end != null)\n {\n count++;\n end = end.next;\n }\n \n if(count == 2)\n {\n ListNode temp = helper(preH, h, end);\n if(newHead == null)\n {\n newHead = temp;\n newTail = h;\n }else\n {\n newTail.next = temp; //link to the existing linked list\n }\n \n newTail = h; // !!! update tail pointer\n h = end;\n \n }\n if(count < 2 && end == null)\n {\n break;\n }\n \n /*\n if(count == 2 && end == null)\n {\n ListNode temp = helper(preH, h, end);\n if(newHead == null)\n {\n newHead = temp;\n newTail = h;\n }else\n {\n newTail.next = temp;\n \n }\n \n newTail = h; \n h = end;\n }\n */\n }\n \n if(newHead != null)\n return newHead;\n return head;\n }", "public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy,temp;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n temp=new ListNode(l1.val);\n l1=l1.next;\n }\n else{\n temp=new ListNode(l2.val);\n l2=l2.next;\n }\n curr.next=temp;\n curr=curr.next;\n }\n while(l1!=null){\n curr.next=new ListNode(l1.val);\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=new ListNode(l2.val);\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public static void sortByOddAndEven(int[] array) {\n\n // int [] arraySample = {2, 1, 3, 5, 4, 9, 8, 11};\n\n int length = array.length - 2;\n\n for (int i = 0; i < length; i++) {\n int j = i + 1;\n\n while ((array[i] % 2) == (array[j] % 2)) {\n j++;\n if (j >= length) {\n// print(array);\n return;\n }\n }\n\n if (j > i + 1) {\n swap(array, i + 1, j);\n }\n }\n }", "public static void reorder(ListNode head) {\n ListNode preHead = new ListNode(0), p1 = preHead, p2 = preHead;\n preHead.next = head;\n// head.print();\n// System.out.println(\"\");\n// System.out.println(\"--------\");\n\n while (p2 != null && p2.next != null) {\n p1 = p1.next;\n p2 = p2.next.next;\n }\n// System.out.println(\"p1: \" + p1.val);\n// p1 = p1.next;\n// head.print();\n// System.out.println();\n// System.out.println(\"secondHalfReversed\");\n ListNode secondHalfReversed = reverseList(p1.next); // even number is good\n p1.next = null;\n// head.print();\n// secondHalfReversed.print();\n\n mergeLists(head, secondHalfReversed);\n//\n// System.out.println(\"\");\n// System.out.println(\"printing head \");\n// head.print();\n\n }", "public static ArrayList getAllOdds(ArrayList vals) {\r\n ArrayList odd = new ArrayList(vals.length());\r\n int j = 0;\r\n for (int i = 0; i < vals.length(); i++) {\r\n int val = (int) vals.getItem(i);\r\n if (val % 2 == 1) {\r\n odd.addItem(val, j);\r\n j++;\r\n }\r\n }\r\n return odd;\r\n }", "ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode curL1 = l1;\n ListNode curL2 = l2;\n int add = 0;\n while (curL1 != null && curL2 != null) {\n int result = 0;\n int total = curL1.val + curL2.val + add;\n if (total >= 10) {\n result = total % 10;\n add = 1;\n } else {\n result = total;\n add = 0;\n }\n curL1.val = result;\n if (curL2.next != null && curL1.next == null) {\n curL2.next.val += add;\n curL1.next = curL2.next;\n break;\n }\n if (curL1.next != null && curL2.next == null) {\n curL1.next.val += add;\n break;\n }\n if (curL1.next == null && curL2.next == null && add == 1) {\n curL1.next = new ListNode(1);\n break;\n }\n curL1 = curL1.next;\n curL2 = curL2.next;\n }\n if (curL1 != null && curL1.next != null) {\n curL1 = curL1.next;\n }\n while (curL1 != null) {\n if (curL1.val >= 10) {\n curL1.val = curL1.val % 10;\n if (curL1.next == null) {\n curL1.next = new ListNode(1);\n curL1 = curL1.next;\n } else {\n curL1 = curL1.next;\n curL1.val += 1;\n }\n\n } else {\n break;\n }\n }\n return l1;\n }", "ListNode addTwoNumbers2(ListNode l1, ListNode l2) {\n ListNode c1 = l1;\n ListNode c2 = l2;\n ListNode sentinel = new ListNode(0);\n ListNode d = sentinel;\n int sum = 0;\n while (c1 != null || c2 != null) {\n sum /= 10;\n if (c1 != null) {\n sum += c1.val;\n c1 = c1.next;\n }\n if (c2 != null) {\n sum += c2.val;\n c2 = c2.next;\n }\n d.next = new ListNode(sum % 10);\n d = d.next;\n }\n if (sum / 10 == 1) {\n d.next = new ListNode(1);\n }\n return sentinel.next;\n }", "public ListNode swapPairs(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode dummy = new ListNode(0);\n ListNode l1 = dummy;\n ListNode l2 = head;\n while (l2 != null && l2.next != null) {\n ListNode nextStart = l2.next.next;\n l1.next = l2.next;\n l2.next.next = l2;\n l2.next = nextStart;\n l1 = l2;\n l2 = nextStart;\n }\n return dummy.next;\n }", "void bellford(ArrayList<Integer> nlist){\n\n int stval = nlist.get(0);\n dlist.get(stval).setval(stval);\n dlist.get(stval).setDist(0);\n\n for(int i = 0; i < nlist.size()-1; i++){\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(key);\n dlist.get(val).setDist(odist+we);\n }\n }\n }\n }\n }\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n System.out.println(\"Negative cycles at:\");\n //iisue should run n-1 times:\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(-999);\n dlist.get(val).setDist(odist+we);\n System.out.println(val);\n }\n }\n }\n }\n }", "private void removeDuplicates() {\n ListNode current = head;\n while (current != null && current.next != null) {\n if (current.data == current.next.data) {\n current.next = current.next.next;\n } else {\n current = current.next;\n }\n }\n }", "static int[] sortArray(int[] array) {\n if (array.length == 0) {\n return array;\n }\n\n //transform the array in a list which, in the end will hold sorted odds\n List<Integer> myList = new ArrayList<>(array.length);\n for (int i : array) {\n myList.add(i);\n }\n\n //i need a hash map for the evens so i can store them and their indexes\n Map<Integer, Integer> evensIndexes = new HashMap<>();\n //i need a new array to hold the result\n int[] result = new int[array.length];\n\n //put evens and their indexes in the hash map\n for (int i = 0; i < array.length; i++) {\n for (Integer x : myList) {\n if (x % 2 == 0 && x.equals(array[i])) {\n evensIndexes.put(i, x);\n }\n }\n }\n\n System.out.println(\"evensIndexes \" + evensIndexes);\n\n //sort the list and remove evens\n myList.sort(Integer::compareTo);\n\n for (Integer i : evensIndexes.values()) {\n myList.remove(i);\n }\n\n //put evens from the hash map into the result array\n for (int i = 0; i < result.length; i++) {\n for (Map.Entry<Integer, Integer> set : evensIndexes.entrySet()) {\n if (i == set.getKey()) {\n result[i] = set.getValue();\n break;\n }\n }\n }\n\n System.out.println(\"result after evens added \" + Arrays.toString(result));\n\n //use an iterator to get odd values from the list and add them in the result array\n Iterator<Integer> odd = myList.iterator();\n\n for (int i = 0; i < result.length; i++) {\n if (result[i] == 0 && array[i] != 0) {\n while (odd.hasNext()) {\n result[i] = odd.next();\n odd.remove();\n break;\n }\n }\n }\n\n return result;\n\n }", "public static void printlist( LinkedList list)\r\n\t\t{\r\n\t\t Node current = list.head;\t\r\n\t\t System.out.println(\"LinkedList: \"); \r\n\t\t \r\n\t\t while (current != null)\r\n\t\t {\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t //even check\r\n\t\t\t if (current.data %2 ==0)\r\n\t\t\t {\r\n\t\t\t\t System.out.println(\"Even\" + current.data + \" \"); \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t System.out.println(\"all\" + current.data + \" \");\r\n\t\t\t current = current.next;\r\n\t\t\t \r\n\t\t\t //\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t}", "private static List<Integer> reorganize(List<Integer> result){\n List<Integer> outcome=new ArrayList<>();\n result.sort(Comparator.comparingInt(o -> o));\n if(!result.isEmpty()){\n outcome.add(result.get(0));\n for(int i=1;i<result.size();i++){\n if(!result.get(i).equals(result.get(i-1)))\n outcome.add(result.get(i));\n }\n }\n return outcome;\n }", "public ListNode mergeNodesV3(ListNode head) {\n /**\n * this step is very important.\n * head point at the first non-zero node.\n */\n head = head.next;\n ListNode start = head;\n while (start != null) {\n ListNode end = start;\n int sum = 0;\n while (end.val != 0) {\n sum += end.val;\n end = end.next;\n }\n if (sum > 0) {\n start.val = sum;\n start.next = end.next;\n start = start.next;\n }\n }\n return head;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> s1 = new Stack<>();\n Stack<Integer> s2 = new Stack<>();\n while (l1 != null) {\n s1.push(l1.val);\n l1 = l1.next;\n }\n while (l2 != null) {\n s2.push(l2.val);\n l2 = l2.next;\n }\n ListNode current = new ListNode(0);\n int overflow = 0;\n while (!s1.empty() || !s2.empty()) {\n int x = (!s1.empty()) ? s1.pop() : 0;\n int y = (!s2.empty()) ? s2.pop() : 0;\n int value = overflow + x + y;\n overflow = value / 10;\n current.val = value % 10;\n ListNode temp = new ListNode(overflow);\n temp.next = current;\n current = temp;\n }\n return current.val == 0 ? current.next : current;\n}", "public static void oddarray() {\n ArrayList<Integer> y = new ArrayList<Integer>();\n for (int i =1; i<256; i++){\n if (i%2 != 0){\n y.add(i);\n }\n }\n System.out.println(y);\n }", "public static void main(String args[]){\n ListNode one=new ListNode(1);\n one.next=new ListNode(3);\n one.next.next=new ListNode(2);\n one=partition(one,3);\n while (one!=null){\n System.out.print(one.val);\n one=one.next;\n }\n }", "public static ListNode mergeKLists(ListNode[] lists) {\n ListNode result = new ListNode(-1);\n ListNode curr = result;\n boolean []isEnd = new boolean[lists.length];\n int isEndSum = 0;\n for (int i = 0; i < lists.length; i++) {\n if(list[i]==null)\n {\n isEnd[i] = true;\n isEndSum++;\n }\n }\n while(isEndSum<lists.length){\n int min_index=-1;\n int min=Integer.MAX_VALUE;\n for (int i = 0; i < lists.length; i++) {\n if(isEndSum==lists.length-1)\n {\n break;\n }\n if(lists[i]==null&&!isEnd[i])\n {\n isEnd[i]=true;\n isEndSum++;\n }\n if(!isEnd[i] && (min>lists[i].val))\n {\n min_index = i;\n min = lists[i].val;\n }\n }\n if(min_index!=-1)\n {\n curr.next = new ListNode(min);\n lists[min_index] = lists[min_index].next;\n curr = curr.next;\n }\n if(isEndSum==lists.length-1)\n {\n for (int i = 0; i < lists.length; i++) {\n if(!isEnd[i])\n {\n ListNode tmp = lists[i];\n while(tmp!=null)\n {\n curr.next = tmp;\n tmp = tmp.next;\n curr = curr.next;\n\n }\n isEndSum++;\n break;\n }\n \n }\n }\n\n }\n return result.next;\n }", "static public Node[] createAlternateSplits(Node head, Node[] heads){ //TC: O(n), SC: O(1)\r\n if(!(head == null) || !(head.next == null)){ //we cannot create a split with one node or with an empty list\r\n heads[0] = head;\r\n heads[1] = head.next;\r\n Node p = head, temp;\r\n while(p != null){\r\n temp = p.next;\r\n p.next = (temp != null)? temp.next:temp;\r\n p = temp;\r\n }\r\n }\r\n \r\n return heads;\r\n \r\n }", "public static ListNode deleteDuplicates(ListNode head) {\n\n if(head == null || head.next == null)\n return head;\n\n ListNode fakehead = new ListNode(0);\n fakehead.next = head;\n ListNode p1 = fakehead;\n ListNode p2 = head;\n\n while(p2 != null && p2.next != null){\n if(p2.val != p2.next.val){\n p1 = p1.next;\n p2 = p2.next;\n }\n else{\n while(p2 != null && p2.next != null && p2.val == p2.next.val){\n p2 = p2.next;\n }\n p2 = p2.next;\n p1.next = p2;\n }\n }\n\n return fakehead.next;\n }", "public boolean isEven(Node Nd){\n while(Nd!=null && Nd.next!=null){\n Nd = Nd.next.next;\n }\n if(Nd==null)\n return true;\n else\n return false;\n }", "public static long taskOfPairing(List<Long> freq) {\n // Write your code here\n long pairs = 0;\n boolean isOdd = false;\n boolean hasRemained = false;\n long curNum = 0;\n for (int weight = 1; weight <= freq.size(); weight++) {\n curNum = freq.get(weight - 1);\n pairs += (curNum / 2);\n if (curNum % 2 != 0) {\n if (hasRemained) {\n pairs++;\n hasRemained = false;\n } else {\n hasRemained = true;\n }\n isOdd = true;\n } else {\n if (!isOdd) {\n hasRemained = false;\n }\n isOdd = false;\n }\n\n }\n\n return pairs;\n\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nint n=sc.nextInt();\r\n\r\nList<Integer> l=new ArrayList<Integer>();\r\nfor(int i=1;i<=n;i++){\r\n\tif(i%2!=0)\r\n\t{\r\n\t\tl.add(i);\r\n\t}\r\n}\r\n\tSystem.out.println(l);\r\n\tint n1=l.get(0);\r\n\tfor(int i=0;i<l.size();i++){\r\n\tif(i%2==0)\r\n\t\r\n\t\tn1=n1-l.get(i);\r\n\t//System.out.println(s);\r\n\telse\r\n\t\tn1=n1+l.get(i);\r\n\t}\r\n\tSystem.out.println(n1+1);\r\n\t}", "private static void segrateNumbers(int[] arr, int left, int right) {\n\n while (left < right) {\n // keep moving towards right, until find an odd number\n while (arr[left] % 2 != 1) {\n left++;\n }\n\n // keep moving towards left, until find an even number\n while (arr[right] % 2 != 0) {\n right--;\n }\n\n // if so, swap them\n if (left < right) {\n int temp = arr[left];\n arr[left] = arr[right];\n arr[right] = temp;\n }\n }\n }", "public ArrayList<Integer> enLigeListe(ArrayList<Integer> list) {\r\n ArrayList<Integer> ligeListe = new ArrayList<>();\r\n for (int i = 0; i < list.size(); i++) {\r\n if (list.get(i) % 2 != 1) {\r\n ligeListe.add(list.get(i));\r\n }\r\n }\r\n return ligeListe;\r\n }", "private static List<List<String>> groupIsomorphic(List<String> strs) {\n Map<String, List<String>> map = new HashMap<>();\n\n for (String str : strs) {\n if (!addToExistGroup(map, str)) {\n // no matching isomorphic\n // use str as key of new group\n List<String> val = new ArrayList<>();\n // add key to its own group\n val.add(str);\n map.put(str, val);\n }\n }\n\n List<List<String>> res = new ArrayList<>(map.values());\n\n return res;\n }", "private static void removeDuplicates(Node head) {\n if (head == null)\n return;\n\n Node current = head;\n while (current != null) {\n Node runner = current;\n while (runner.next != null) {\n if (runner.next.value == current.value)\n runner.next = runner.next.next;\n else\n runner = runner.next;\n }\n current = current.next;\n }\n }", "private static ListNode sortList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode mid = getMid(head);\n ListNode left = sortList(head);\n ListNode right = sortList(mid);\n return merge(left, right);\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "public List<List<Integer>> permute(int[] nums) {\n if (nums.length < 2) {\n LinkedList<List<Integer>> res = new LinkedList<>();\n List<Integer> list = Arrays.stream(nums).boxed().collect(Collectors.toList());\n res.add(list);\n return res;\n }\n\n ArrayList<List<Integer>> result = new ArrayList<>();\n ArrayList<Set<Integer>> setList = new ArrayList<>();\n\n //The base set that all the other sets will be \"cloned\" from\n Set<Integer> numSetBase = Arrays.stream(nums).boxed().collect(Collectors.toSet());\n\n //Initialize the custom map-thingy\n for (int i = 0; i < nums.length; i++) {\n List<Integer> temp = new LinkedList<>();\n temp.add(nums[i]);\n result.add(temp); //Key - the list\n\n Set<Integer> newSet = new HashSet<>(numSetBase);\n newSet.remove(nums[i]);\n\n setList.add(newSet); //Add to the set of stuff left\n }\n\n //Iterate\n for (int i = 1; i < nums.length; i++) {\n //Iterate over the whole list\n int initialSize = result.size();\n for (int j = 0; j < initialSize; j++) {\n boolean isFirstElem = true;\n int firstElem = 0;\n //For each unused int in the set entry\n for (int unused: setList.get(j)) {\n if (isFirstElem) {\n firstElem = unused;\n isFirstElem = false;\n } else {\n //Add new entries for the unused nums\n Set<Integer> newSet = new HashSet<>(setList.get(j));\n List<Integer> newList = new LinkedList<>(result.get(j));\n newList.add(unused);\n newSet.remove(unused);\n //Add the new entry\n result.add(newList);\n setList.add(newSet);\n }\n }\n //Modify the first element\n if (!setList.get(j).isEmpty()) {\n result.get(j).add(firstElem);\n setList.get(j).remove(firstElem);\n }\n }\n }\n return result;\n }", "public void solution2(LinkedListNode head){\n if(head==null)\n return;\n LinkedListNode current=head;\n while(current!=null){\n LinkedListNode runner=current;\n while(runner.next!=null){\n if(runner.next.data==current.data)\n runner.next=runner.next.next;\n else\n runner=runner.next;\n }\n current=current.next;\n }\n }", "public static void fold(ListNode head) {\n if (head == null || head.next == null)\n return;\n\n ListNode mid = midNode(head);\n ListNode nhead = mid.next;\n mid.next = null;\n nhead = reverse(nhead);\n\n ListNode c1 = head, c2 = nhead;\n\n while (c2 != null) {\n ListNode f1 = c1.next, f2 = c2.next;\n\n c1.next = c2;\n c2.next = f1;\n\n c1 = f1;\n c2 = f2;\n }\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public static ListNode detectCycle2(ListNode head){\n if(head == null) return null;\n\n ListNode intersectNode = getIntersection(head);\n if(intersectNode == null) return null;\n\n ListNode currNode = head;\n while(currNode != intersectNode) {\n currNode = currNode.next;\n intersectNode = intersectNode.next;\n }\n return intersectNode;\n }", "public static void main(String[] args) {\n\n ListNode l1 = new ListNode(5);\n// l1.next = new ListNode(8);\n// l1.next.next = new ListNode(3);\n//\n ListNode l2 = new ListNode(5);\n// l2.next=new ListNode(6);\n// l2.next.next = new ListNode(4);\n addTwoNumbers(l1, l2);\n\n\n }", "public static ArrayList<Integer> getOddNumberList(int number) {\n\n\t\tArrayList<Integer> oddNumberList = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i <= number; i++) {\n\n\t\t\tif (i % 2 == 1) {\n\n\t\t\t\toddNumberList.add(i);\n\t\t\t}\n\t\t}\n\n\t\treturn oddNumberList;\n\t}", "public static void rearrangeOddAndEven(int arr[]) {\n System.out.println(Arrays.toString(arr));\n Arrays.sort(arr);\n for(int i=0; i < arr.length-1; i+=2) {\n int temp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1] = temp;\n }\n System.out.println(Arrays.toString(arr));\n System.out.println();\n }", "public static <E> void separateArrToOddEvenArr(\n ArrayList<E> inArr, ArrayList<E> oddArr, ArrayList<E> evenArr)\n {\n boolean isOddDone = false;\n\n for(E str : inArr) {\n if (!isOddDone) {\n oddArr.add(str);\n isOddDone = true;\n } else {\n evenArr.add(str);\n isOddDone = false;\n }\n } //for\n\n }", "public ListNode merge(ListNode left, ListNode right){\n ListNode head = new ListNode(0);\n ListNode p = head;\n while(left!=null&&right!=null){\n if(left.val<right.val){\n p.next = left;\n left = left.next;\n }\n else{\n p.next = right;\n right = right.next;\n }\n p = p.next;\n }\n if(left!=null){\n p.next = left;\n }\n if(right!=null){\n p.next = right;\n }\n // p.next=null;//不需要,原始节点会有next null信息\n return head.next;\n\n\n }", "public ListNode swapPairs2(ListNode head) {\n if ((head == null)||(head.next == null))\n return head;\n ListNode n = head.next;\n head.next = swapPairs2(head.next.next);\n n.next = head;\n return n;\n }", "private Entry<T> mergeSort(Entry<T> head,int n){\n if(n<2){\n head.next = null;\n return head;\n }\n Entry<T> mid = head;\n for(int i=0;i<n/2;i++)\n mid = mid.next;\n head = mergeSort(head, n/2);\n mid = mergeSort(mid, n - n/2);\n return merge(head,mid);\n }", "public ListNode swapNodes(ListNode head, int v1, int v2) {\n ListNode start = new ListNode(0);\n start.next = head;\n ListNode preOne = null;\n ListNode preTwo = null;\n\n ListNode search = start;\n\n while (search.next != null) {\n ListNode next = search.next;\n if (next.val == v1) {\n preOne = search;\n }\n if (next.val == v2) {\n preTwo = search;\n }\n search = next;\n }\n if (preOne == null || preTwo == null) {\n return start.next;\n }\n\n\n ListNode one = preOne.next;\n ListNode two = preTwo.next;\n if (two.next == one) {\n preTwo.next = one;\n two.next = one.next;\n one.next = two;\n return start.next;\n } else if (one.next == two) {\n preOne.next = two;\n one.next = two.next;\n two.next = one;\n return start.next;\n }\n ListNode befone = preOne.next.next;\n ListNode beftwo = preTwo.next.next;\n one.next = beftwo;\n two.next = befone;\n preOne.next = two;\n preTwo.next = one;\n return start.next;\n }", "public ListNode deleteDuplicates(ListNode head) {\n ListNode newhead = new ListNode(0);\n ListNode curr=head;\n ListNode prev = newhead;\n newhead.next = curr;\n if(curr==null) return null;\n while(curr!=null && curr.next!=null){\n ListNode next = curr.next;\n if(next.val == curr.val){\n while(next!=null && next.val == curr.val){\n next = next.next;\n }\n prev.next = next;\n }\n else{\n prev = curr;\n }\n curr = next;\n \n }\n return newhead.next;\n }", "@Test\n public void pairNumbersDivisibleBy3_passTwoListsNumbers_returnListsOfPairs() {\n List<int[]> output = Java8Streams.pairNumbersDivisibleBy3(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(3, 4)));\n assertThat(output).containsExactly(new int[]{2, 4}, new int[]{3, 3});\n }", "public static ListNode swapNodes2(ListNode head, int k) {\n ListNode KthFromStart = head, out = head, KthFromLast = head;\n for (int i = 1; i < k; i++) {\n KthFromStart = KthFromStart.next;\n }\n ListNode temp_Node = KthFromStart;\n while (temp_Node.next != null) {\n temp_Node = temp_Node.next;\n KthFromLast = KthFromLast.next;\n }\n int temp = KthFromLast.val;\n KthFromLast.val = KthFromStart.val;\n KthFromStart.val = temp;\n return out;\n }", "public void addToListWithCycle(T value) {\n Node<T> tmp = lastNode;\n Node<T> node = new Node<>(value, firstNode);\n lastNode = node;\n if (tmp == null) {\n firstNode = node;\n } else {\n tmp.next = node;\n }\n size++;\n }", "abstract ArrayList<Pair<Integer,Double>> adjacentNodes(int i);", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "private static void test02() {\n\t ListNode n1 = new ListNode(1);\n\t ListNode n2 = new ListNode(2);\n\t ListNode n3 = new ListNode(3);\n\t ListNode n4 = new ListNode(4);\n\t ListNode n5 = new ListNode(5);\n\t ListNode n6 = new ListNode(6);\n\n\t n1.next = n2;\n\t n2.next = n3;\n\t n3.next = n4;\n\t n4.next = n5;\n\t n5.next = n6;\n\t n6.next = n3;\n\n\t System.out.println(meetingNode(n1));\n\t }", "public void reorderList(ListNode head) {\n if (head == null || head.next == null)\n return;\n\n // step 1. cut the list to two halves\n // prev will be the tail of 1st half\n // slow will be the head of 2nd half\n ListNode prev = null, slow = head, fast = head, l1 = head;\n while (fast != null && fast.next != null) {\n prev = slow;\n slow = slow.next;\n fast = fast.next.next;\n }\n prev.next = null;\n // step 2. reverse the 2nd half\n ListNode l2 = reverse(slow);\n // step 3. merge the two halves\n merge(l1, l2);\n }", "@Test\n public void TestIfNoCycle() {\n final int NUMBER_OF_ELEMENTS = 100;\n TripleList<Integer> tripleList = new TripleList<>();\n for (int i = 0; i < NUMBER_OF_ELEMENTS; ++i) {\n tripleList.add(i);\n }\n /**\n * Created 2 TripleLists, first jumps every single element, another\n * every two elements, in out case every two elements means every\n * NextElement*\n */\n TripleList<Integer> tripleListEverySingleNode = tripleList;\n TripleList<Integer> tripleListEveryTwoNodes = tripleList.getNext();\n for (int i = 0; i < NUMBER_OF_ELEMENTS * NUMBER_OF_ELEMENTS; ++i) {\n Assert.assertNotSame(tripleListEverySingleNode, tripleListEveryTwoNodes);\n //JumpToNextElement(ref tripleListEverySingleNode);\n if (null == tripleListEveryTwoNodes.getNext()) {\n // if list has end means there are no cycles\n break;\n } else {\n tripleListEveryTwoNodes = tripleListEveryTwoNodes.getNext();\n }\n }\n }", "private IndividualGroupList adaptativeSplitIntoGroups(List<Individual> individuals) \n {\n int individualCount = individuals.size();\n\n IndividualGroupList groups = new IndividualGroupList();\n IndividualGroup group = new IndividualGroup();\n int currentGroupSize = 8;\n \n for (int i = 0; i < individualCount; i++)\n {\n Individual individual = individuals.get(i);\n\n int individualGroupSize = getGroupSize(individual.getPositiveProbability());\n\n if (individualGroupSize != currentGroupSize || group.countIndividuals() == currentGroupSize)\n {\n groups.add(group);\n group = new IndividualGroup();\n currentGroupSize = individualGroupSize;\n }\n\n group.add(individual);\n }\n\n if (group.countIndividuals() > 0)\n groups.add(group);\n \n return groups;\n }", "public static void main(String[] args) {\n MyLinkedList<Integer> list = new MyLinkedList<>();\n IntStream.rangeClosed(1, 10).forEach(i -> list.add(i));\n\n\n // for (int i = 0; i < list.size(); i++) {\n // System.out.println(list.get(i));\n // }\n\n list.add(4, 100);\n\n list.add(0, 200);\n list.add(0, 300);\n list.add(0, 400);\n list.add(0, 500);\n\n for (int i = 0; i < list.size(); i++) {\n System.out.println(list.get(i));\n }\n\n list.remove(0);\n list.remove(0);\n list.remove(2);\n\n list.remove();\n list.remove();\n for (int i = 0; i < list.size(); i++) {\n System.out.print(list.get(i) + \" \");\n }\n System.out.println();\n }", "public static void main(String[] args) throws IOException {\n File file = new File(\"E:\\\\MyOwnProject\\\\data\\\\test.txt\");\n Scanner scanner = new Scanner(file);\n \t\n// \tint[] values = {1,2,2,3,4,5,5,5,6,7,7,7,8,9,9,9,9,10};\n// \tSinglyLinkedList llist = new SinglyLinkedList();\n// for (int val:values){\n// llist.insertNode(val);\n// }\n// SinglyLinkedListNode result = removeDuplicates(llist.head);\n// printSinglyLinkedList(result);\n //BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(\"OUTPUT_PATH\")));\n\n// int tests = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int testsItr = 0; testsItr < tests; testsItr++) {\n// int index = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// SinglyLinkedList llist1 = new SinglyLinkedList();\n//\n// int llist1Count = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int i = 0; i < llist1Count; i++) {\n// int llist1Item = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// llist1.insertNode(llist1Item);\n// }\n// \n// \tSinglyLinkedList llist2 = new SinglyLinkedList();\n//\n// int llist2Count = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int i = 0; i < llist2Count; i++) {\n// int llist2Item = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// llist2.insertNode(llist2Item);\n// }\n// \n// \tSinglyLinkedListNode ptr1 = llist1.head;\n// SinglyLinkedListNode ptr2 = llist2.head;\n//\n// for (int i = 0; i < llist1Count; i++) {\n// if (i < index) {\n// ptr1 = ptr1.next;\n// }\n// }\n//\n// for (int i = 0; i < llist2Count; i++) {\n// if (i != llist2Count-1) {\n// ptr2 = ptr2.next;\n// }\n// }\n//\n// ptr2.next = ptr1;\n//// printSinglyLinkedList(llist1.head);\n//// printSinglyLinkedList(llist2.head);\n// int result = findMergeNode(llist1.head, llist2.head);\n// System.out.println(String.valueOf(result));\n// }\n// scanner.close();\n// int[] arr = {3,-7,0};\n// System.out.println(minimumAbsoluteDifference(arr));\n// int money = 5;\n// int[] cost = {2, 1, 3, 5, 6};\n// whatFlavors(cost,money);\n// List<List<Integer>> queries = new ArrayList<>();\n// List<Integer> query = new ArrayList<>();\n// query.add(1);query.add(3);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(2);query.add(3);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(1);query.add(4);\n// queries.add(query); \n// query = new ArrayList<>();\n// query.add(1);query.add(5);\n// queries.add(query); \n// query = new ArrayList<>();\n// query.add(1);query.add(5);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(1);query.add(4);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(2);query.add(4);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// int[][] queries = {{1, 5},{1, 6},{3, 2},{1, 10},{1, 10},{1, 6},{2, 5},{3, 2}};\n// List<Integer> res = freqQuery(queries);\n// for(Integer i:res){\n// \t System.out.println(i);\n// }\n String s1 = \"OUDFRMYMAW\";\n String s2 = \"AWHYFCCMQX\";\n System.out.println(commonChild(s1,s2));\n \n \n }", "public static void removeDups (Node head){\n\n Node i = head;\n Node j;\n Node previous;\n\n while (i != null) {\n previous = i;\n j = i.next;\n while (j != null) {\n if (i.val == j.val){\n previous.next = j.next;\n } else {\n previous = j;\n }\n j = j.next;\n }\n\n i = i.next;\n }\n }", "public static Pair<Node, Node> splitAndReverse(Node head){\n\t\tNode f = head; //fast\n\t\tNode s = head; //slow\n\t\tint pos = 0;\n\t\t\n\t\tNode next = null;\n\t\t\n\t\tdo{\n\t\t\tif(pos == 0){\n\t\t\t\tnext = s.next;\n\t\t\t}else if(pos % 2 == 0){\n\t\t\t\tNode prev = s;\n\t\t\t\ts = next;\n\t\t\t\tnext = next.next;\n\t\t\t\ts.next = prev;\n\t\t\t}\n\t\t\t\n\t\t\tpos++;\n\t\t\tf = f.next;\n\t\t}while(f != null);\n\t\t\n\t\thead.next = null;\n\t\t\n\t\tSystem.out.println(s != null ? s.value : null);\n\t\t\n\t\tNode firstHalfInReverese = s;\n\t\t\n\t\t\n\t\t//process the 2nd half\n\t\ts = next; \n\t\tnext = s.next;\n\t\ts.next = null;//breaking link between 1st and 2nd halves\n\t\t\n\t\twhile(next != null){\n\t\t\tNode prev = s;\n\t\t\ts = next;\n\t\t\tnext = next.next;\n\t\t\ts.next = prev;\n\t\t}\n\t\t\n\t\tSystem.out.println(s != null ? s.value : null);\n\t\t\n\t\tNode secondHalfInReverse = s;\n\t\t\n\t\treturn new Pair<>(firstHalfInReverese, secondHalfInReverse);\n\t}", "public Node findSumOfNumbers(Node l1, Node l2) {\n\t\tint carry =0;\n \n\t\tNode newHead = null;\n\t\tNode tempNodeForIteration=null;\n\t\tint sum=0;\n \n\t\tint count=0;\n\t\twhile(l1!=null || l2!=null)\n\t\t{\n\t\t\tcount++;\n\t\t\tsum=carry;\n\t\t\tif(l1!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l1.value;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n \n\t\t\tif(l2!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l2.value;\n\t\t\t\tl2=l2.next;\n\t\t\t}\n \n \n\t\t\tcarry=sum/10;\n\t\t\tsum=sum%10;\n\t\t\t// Check if it first node for the result\n\t\t\tif(count==1)\n\t\t\t{ \n\t\t\t\ttempNodeForIteration = new Node(sum);\n\t\t\t\tnewHead=tempNodeForIteration;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1-->5 -->7\n\t\t\t\t//tempNodeForIteration first node is =1\n\t\t\t\tNode tempSumNode=new Node(sum);\n\t\t\t\t//tempNodeForIteration second node is =5\n\t\t\t\ttempNodeForIteration.next=tempSumNode;\n\t\t\t\t//tempNodeForIteration node holding last node =5\n\t\t\t\ttempNodeForIteration=tempNodeForIteration.next;\n\t\t\t}\n \n\t\t}\n\t\tif(carry!=0)\n\t\t{\n\t\t\tNode tempNode=new Node(carry);\n\t\t\ttempNodeForIteration.next=tempNode;\n\t\t}\n\t\treturn newHead;\n\t}", "static public ListNode reorder(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\tListNode one = head;\n\t\tListNode mid = findMidle(head);\n\t\tSystem.out.println(\"mid: \"+ mid.val);\n\t\tListNode two = reverse(mid.next);\n\t\tmid.next = null;\n\t\tListNodeUtils.printList(head);\n\t\tListNodeUtils.printList(two);\n\t\tListNode curr = one;\n\t\twhile (one != null && two != null) {\n\t\t\tone = one.next;\n\t\t\tcurr.next = two;\n\t\t\tcurr = curr.next;\n\n\t\t\ttwo = two.next;\n\t\t\tcurr.next = one;\n\t\t\tcurr = curr.next;\n\t\t}\n\t\tif (one != null) {\n\t\t\tcurr.next = null;\n//\t\t curr = curr.next; \n\t\t}\n\n\t\t// curr.next = null;\n\t\treturn head;\n\t}", "public ListNode swapPairs(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode result = head.next;\n ListNode tempNode = null;\n while (swapTwoNodes(head, tempNode)) {\n tempNode = head;\n head = head.next;\n }\n return result;\n }", "public static List<SimpleSSBNNode>[] individualizeDisconnectedNetworks(\r\n\t\t\tList<SimpleSSBNNode> simpleSSBNNodeList){\r\n\t\t\r\n\t\tList<SimpleSSBNNodeNetworkAssociation> nodeNetAssociationList = \r\n\t\t\tnew ArrayList<SimpleSSBNNodeNetworkAssociation>(); \r\n\t\t\r\n\t\tfor(SimpleSSBNNode simpleSSBNNode: simpleSSBNNodeList){\r\n\t\t\tSimpleSSBNNodeNetworkAssociation nodeNetAssociation = \r\n\t\t\t\tnew SimpleSSBNNodeNetworkAssociation(simpleSSBNNode); \r\n\t\t\tnodeNetAssociationList.add(nodeNetAssociation); \r\n\t\t}\r\n\t\t\r\n\t\tint nextNetworkId = 0; \r\n\t\t\r\n\t\tfor(SimpleSSBNNodeNetworkAssociation nodeNetAssociation: nodeNetAssociationList){\r\n\t\t\t\r\n\t\t\tif(nodeNetAssociation.getNetworkId() == -1){\r\n\t\t\t\tnodeNetAssociation.setNetworkId(nextNetworkId); \r\n\t\t\t\tnextNetworkId++; \r\n\t\t\t\tsetNetIdToAdjacentNodes(nodeNetAssociation, nodeNetAssociationList); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tList<SimpleSSBNNode>[] nodesPerNetworkArray = new List[nextNetworkId]; \r\n\t\t\r\n\t\tfor(int i = 0; i < nodesPerNetworkArray.length; i++){\r\n\t\t\tnodesPerNetworkArray[i] = new ArrayList<SimpleSSBNNode>(); \r\n\t\t}\r\n\t\t\r\n\t\tfor(SimpleSSBNNodeNetworkAssociation nodeNetAssociation: nodeNetAssociationList){\r\n\t\t\tnodesPerNetworkArray[nodeNetAssociation.getNetworkId()].add(nodeNetAssociation.getNode()); \r\n\t\t}\r\n\t\t\r\n\t\treturn nodesPerNetworkArray; \r\n\t}", "public static void removeDuplicateSample() {\n Node ll1 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll2 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(4, null)))));\n Node ll3 = new Node(1, new Node(1, new Node(3, new Node(4, new Node(5, null)))));\n Node ll4 = new Node(1, new Node(1, new Node(1, new Node(4, new Node(5, null)))));\n\n System.out.println(\"1===\");\n ll1.printList();\n ll1 = ll1.removeDuplicate();\n ll1.printList();\n\n System.out.println(\"2===\");\n ll2.printList();\n ll2 = ll2.removeDuplicate();\n ll2.printList();\n\n System.out.println(\"3===\");\n ll3.printList();\n ll3 = ll3.removeDuplicate();\n ll3.printList();\n\n System.out.println(\"4===\");\n ll4.printList();\n ll4 = ll4.removeDuplicate();\n ll4.printList();\n\n }", "public static ListNode swapPairs(ListNode head) {\n\t\t ListNode dummy = new ListNode(-1);\n\t\t dummy.next = head;\n\t\t \n\t\t // move 3 pointer together until all or two of them are null\n\t\t ListNode p1 = dummy;\n\t\t ListNode p2 = p1 != null ? p1.next : null;\n\t\t ListNode p3 = p2 != null? p2.next: null;\n\t\t \n\t\t while(p2 != null && p3 != null) {\n\t\t\t //swap p2 & p3\n\t\t\t p1.next = p3;\n\t\t\t p2.next = p3.next;\n\t\t\t p3.next = p2;\n\t\t\t \n\t\t\t // p1 moves two steps forward\n\t\t\t p1 = p1.next;\n\t\t\t p1 = p1 != null ? p1.next : null;\n\t\t\t p2 = p1 != null ? p1.next : null;\n\t\t\t p3 = p2 != null? p2.next: null;\n\t\t }\n\t\t \n\t\t return dummy.next;\n\t }", "public static void removedEvenLength(LinkedList<String> list){ //ARRAY AND LINKED \r\n\t\t\r\n\t\tIterator< String> i = list.iterator();// call iterator\r\n\t\twhile ( i.hasNext()){\r\n\t\t\tString element = i.next();\r\n\t\t\tif (element.length()%2 == 0){// even\r\n\t\t\t\ti.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\t}", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}" ]
[ "0.73254037", "0.690032", "0.67767054", "0.6760622", "0.6576211", "0.6565004", "0.65368867", "0.6353141", "0.5984879", "0.5848937", "0.58325434", "0.577932", "0.57768184", "0.5675821", "0.5588414", "0.5570492", "0.5552065", "0.5546883", "0.55312824", "0.55117524", "0.5508985", "0.54666287", "0.54303586", "0.541063", "0.5406821", "0.5405053", "0.5376726", "0.537312", "0.5363276", "0.5317315", "0.5285091", "0.5279629", "0.5271095", "0.5260078", "0.5243466", "0.52417135", "0.5238464", "0.52180827", "0.5204918", "0.51974", "0.51908684", "0.51819557", "0.51698536", "0.51551074", "0.5151494", "0.51506", "0.51344556", "0.5118259", "0.51160306", "0.5113313", "0.5094982", "0.5092279", "0.50775325", "0.5072595", "0.50666004", "0.50277966", "0.5025697", "0.5014638", "0.5008142", "0.49488497", "0.49344036", "0.49130204", "0.4911826", "0.49064848", "0.490578", "0.49021238", "0.48985797", "0.48965663", "0.48776662", "0.48702365", "0.48700187", "0.48672375", "0.4866963", "0.48657617", "0.48586598", "0.48474964", "0.48441628", "0.48435563", "0.48351708", "0.48267424", "0.4815907", "0.48155218", "0.48102394", "0.48084006", "0.4804794", "0.4800082", "0.47969657", "0.47956917", "0.47918114", "0.478777", "0.47708336", "0.47618586", "0.4761782", "0.4761051", "0.47581613", "0.47557715", "0.47528517", "0.4751578", "0.47465476", "0.4746498" ]
0.4978093
59
Write a program to find the node at which the intersection of two singly linked lists begins.
public static <V> ListNode<V> IntersectingNode ( final ListNode<V> headNode1, final ListNode<V> headNode2) { ListNode<V> node1 = headNode1; ListNode<V> node2 = headNode2; java.util.HashSet<ListNode<V>> nodeHashSet = new java.util.HashSet<ListNode<V>>(); while (null != node1) { if (nodeHashSet.contains (node1)) return node1; nodeHashSet.add (node1); node1 = node1.next(); } while (null != node2) { if (nodeHashSet.contains (node2)) return node2; node2 = node2.next(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n int[] listA = {4,1,8,4,5};\n int[] listB = {5,0,1,8,4,5};\n int intersectVal = 8;\n int skipA = 2, skipB = 3;\n ListNode headA = new ListNode(listA[0]);\n ListNode headB = new ListNode(listB[0]);\n ListNode nodeA = headA;\n for (int i = 1; i < skipA; i++) {\n nodeA.next = new ListNode(listA[i]);\n nodeA = nodeA.next;\n }\n ListNode nodeB = headB;\n for (int i = 1; i < skipB; i++) {\n nodeB.next = new ListNode(listB[i]);\n nodeB = nodeB.next;\n }\n\n nodeA.next = new ListNode(listA[skipA]);\n nodeB.next = nodeA.next;\n nodeA = nodeA.next;\n for (int i = skipA + 1; i < listA.length; i++) {\n nodeA.next = new ListNode(listA[i]);\n nodeA = nodeA.next;\n }\n\n\n ListNode intersectionNode = getIntersectionNode(headA, headB);\n System.out.println(intersectionNode.val);\n }", "private void findIntersection(Node head1, Node head2) {\n if (head1 == null || head2 == null) {\n System.out.println(\"No intersection found\");\n return;\n }\n Set<Node> set = new HashSet<Node>();\n boolean flag = false;\n\n for (Node temp = head1; temp != null; temp = temp.next)\n set.add(temp);\n for (Node temp = head2; temp != null; temp = temp.next)\n if (!set.add(temp)) {\n System.out.println(\"Intersection found at \" + temp.data);\n flag = true;\n break;\n }\n if (!flag) {\n System.out.println(\"No intersection found\");\n }\n }", "public static ListNode getIntersectionNode(ListNode headA, ListNode headB) {\n int lenA = 0;\n int lenB = 0;\n for (ListNode n = headA; n != null; n = n.next)\n ++lenA;\n for (ListNode n = headB; n != null; n = n.next)\n ++lenB;\n ListNode a = headA;\n ListNode b = headB;\n int diff = lenA - lenB;\n if (diff > 0) {\n for (int i = 0; i < diff; ++i)\n a = a.next;\n } else if (diff < 0) {\n diff = -diff;\n for (int i = 0; i < diff; ++i)\n b = b.next;\n }\n while (a != b && a != null && b != null) {\n a = a.next;\n b = b.next;\n }\n if (a != b)\n return null;\n return a;\n }", "public ListNode getIntersectionNode(ListNode headA, ListNode headB) {\n \n ListNode first = headA;\n ListNode second = headB;\n \n //iterate till both pointer point to null\n while(first != null || second != null){\n if(first == null)\n headB = headB.next;\n else\n first = first.next;\n \n if(second == null)\n headA= headA.next;\n else\n second = second.next;\n } \n while(headA != headB){\n headB = headB.next;\n headA= headA.next;\n }\n \n return headA;\n }", "static int find_intersection(LinkedListNode l1, LinkedListNode l2)\n {\n int N1 = get_size(l1); \t\n // Size of second linked list.\n int N2 = get_size(l2); \t\n while (N1 > N2) \n {\n l1 = l1.next;\n N1--;\n }\n while (N2 > N1) \n {\n l2 = l2.next;\n N2--;\n }\n // Comparing address.\n while (l1 != null && l1 != l2) \n {\n l1 = l1.next;\n l2 = l2.next;\n }\n // If we have reached end.\n if (l1 == null) \n {\n return -1;\n }\n // Intersection at node pointed by current value of l1.\n return l1.val; \t\n }", "public ListNode getIntersectionNode(ListNode headA, ListNode headB) {\r\n\t\tHashSet<ListNode> hashSet = new HashSet<ListNode>();\r\n\t\tListNode head = headA;\r\n\t\twhile (head != null) {\r\n\t\t\thashSet.add(head);\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\thead = headB;\r\n\t\twhile (head != null) {\r\n\t\t\tif (hashSet.contains(head)) {\r\n\t\t\t\treturn head;\r\n\t\t\t}\r\n\t\t\thashSet.add(head);\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args) {\n\t\tLL l1 = new LL();\n\t\tLL l2 = new LL();\n\t\tl1.insert(15);\n\t\tl1.insert(25);\n\t\tl1.insert(35);\n\t\tl1.insert(45);\n\t\tl1.insert(55);\n\t\t\n\t\tl2.insert(10);\n\t\tl2.insert(17);\n\t\tl2.insert(35);\n\t\tl2.insert(47);\n\t\tl2.insert(11);\n\t \t\n\t\t\n//\t\tl1.print();\n//\t\tl2.print();\n\t\t\n\t\tSystem.out.println(getIntersection(l1.head,l2.head));\n\t\t\n\t}", "public static void main(String[] args) {\n\t Node n = new Node(7); // --> 7,[1],6\n\t n.appendToEnd(1);\n\t n.appendToEnd(6);\n\t \n\t Node m = new Node(2);\n\t m.appendToEnd(0);\n\t m.appendToEnd(5);\n\t m.appendNodeToEnd(n.next); // ---> m = 2, 0, [1], 6 here we append an existing node coming from n to m, to join both list at (1)\n\t //m.appendToEnd(8);\n\t \n\t Node intersection = MyLinkedList.getIntersection(m,n); // get the intersection if there's one.\n\t if(intersection != null)\n\t System.out.println(intersection.data); // null if theres no intersection, Node if an intersection was found\n\t else \n\t System.out.println(\"There's no intersecion between these lists.\");\n \n // Print both linked list \n\t MyLinkedList.print(n);\n\t System.out.println(\"\\n\");\n\t MyLinkedList.print(m);\n\t}", "public static MyLinkedList getIntersection(MyLinkedList list1, MyLinkedList list2)\n {\n HashSet<Integer> set = new HashSet<>();\n Node temp = list1.getStart();\n while(temp != null)\n {\n set.add(temp.key);\n temp = temp.next;\n }\n\n temp = list2.getStart();\n MyLinkedList intersection = (temp == null) ? null : new MyLinkedList();\n\n while(temp != null)\n {\n if(set.contains(temp.key))\n {\n Node temp1 = new Node();\n temp1.key = temp.key;\n intersection.addNode(temp1);\n }\n temp = temp.next;\n }\n return intersection;\n }", "public static void main(String[] args) {\n SinglyListNode<Integer> node9 = new SinglyListNode<Integer>(9);\n SinglyListNode<Integer> node8 = new SinglyListNode<Integer>(8, node9);\n SinglyListNode<Integer> node4 = new SinglyListNode<Integer>(4, node8);\n SinglyListNode<Integer> node3 = new SinglyListNode<Integer>(3, node4);\n SinglyListNode<Integer> node2 = new SinglyListNode<Integer>(2, node3);\n SinglyListNode<Integer> node1 = new SinglyListNode<Integer>(1, node2);\n \n //6 -> 7 -> 8 -> 9\n SinglyListNode<Integer> node7 = new SinglyListNode<Integer>(7, node8);\n SinglyListNode<Integer> node6 = new SinglyListNode<Integer>(6, node7);\n \n FirstCommonNode fcn = new FirstCommonNode();\n SinglyListNode<Integer> result = fcn.find(node1, node6);\n System.out.println(\"The first common node is \" + result.data);\n }", "public static <T extends Comparable<? super T>>\n void intersection(SLL<T> list1, SLL<T> list2, SLL<T> result) {\n\n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n\n T itemlist1=null, itemlist2=null;\n\n // get first item in each list\n if ( iterlist1 != null && iterlist2 != null ) {\n itemlist1 = iterlist1.info;\n itemlist2 = iterlist2.info;\n }\n\n while ( itemlist1 != null && itemlist2 != null ) {\n int compareResult = itemlist1.compareTo(itemlist2);\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //append to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n }\n }", "public intersection(){}", "public static ListNode detectCycle2(ListNode head){\n if(head == null) return null;\n\n ListNode intersectNode = getIntersection(head);\n if(intersectNode == null) return null;\n\n ListNode currNode = head;\n while(currNode != intersectNode) {\n currNode = currNode.next;\n intersectNode = intersectNode.next;\n }\n return intersectNode;\n }", "private List<BinaryTreeNode> findAncestor(BinaryTreeNode head, BinaryTreeNode node1, BinaryTreeNode node2) {\n if (head == null) {\n return new ArrayList<BinaryTreeNode>();\n }\n\n List<BinaryTreeNode> leftSearch = findAncestor(head.getLeft(), node1, node2);\n List<BinaryTreeNode> rightSearch = findAncestor(head.getRight(), node1, node2);\n\n leftSearch.addAll(rightSearch);\n if (leftSearch.contains(node1) && leftSearch.contains(node2)) {\n if (leftSearch.size() == 2) {\n leftSearch.add(head);\n }\n return leftSearch;\n }\n\n if (head.getValue() == node1.getValue() || head.getValue() == node2.getValue()) {\n leftSearch.add(head);\n }\n return leftSearch;\n }", "public static void main(String[] args) {\n\t\tIntersection l5=new Intersection(5,null);\n\t\tIntersection l4=new Intersection(4,l5);\n\t\tIntersection l3=new Intersection(3,l4);\n\t\tIntersection l2=new Intersection(2,l3);\n\t\tIntersection l1=new Intersection(1,l2);\n\t\t\n\t\tIntersection m7=new Intersection(7,l3);\n\t\tIntersection m6=new Intersection(6,m7);\n\t\tint flag=0;\n\t\twhile(m6!=null && l1!=null){\n\t\t\tif(m6!=l1){\n\t\t\t\tm6=m6.next;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tflag=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag==1){\n\t\t\tSystem.out.println(\"They Intersect!\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"They don't!\");\n\t\t}\n\t}", "private double intersect(double start0, double end0, double start1, double end1)\n {\n double length = Double.min(end0, end1) - Double.max(start0, start1);\n return Double.min(Double.max(0, length), 1.0);\n }", "public static ListNode mockIntersectionList(ListNode head) {\n\t\tListNode head3 = null;\n\t\thead3 = insertAtEnd(head3, 9);\n\t\thead3 = insertAtEnd(head3, 10);\n\t\thead3 = insertAtEnd(head3, 12);\n\t\tListNode temp = head3;\n\t\twhile (temp.next != null)\n\t\t\ttemp = temp.next;\n\t\ttemp.next = head.next.next;\n\t\treturn head3;\n\t}", "@Test\n public void test1() {\n final List<String> listA = Arrays.asList(\"Fremont\", \"Dublin\", \"anamole\", \"San Jose\" , \"SFO\", \"Dublin\", \"San Jose\", \"paramount\", \"y\");\n final List<String> listB = Arrays.asList(\"Dublin\", \"san mateo\", \"los angeles\", \"san mateo\", \"fremont\", \"anamole\", \"x\", \"x\", \"Y\");\n final List<String> common = FindIntersection.findCommonLists(listA, listB);\n System.out.println(Arrays.toString(FindIntersection.findCommonLists(listA, listB).toArray()));\n\n }", "Node commonAncestor(Node one, Node two);", "public static void main (String[] args) {\n System.out.println(findIntersection(new String[] {\"1, 3, 4, 7, 13\", \"1, 2, 4, 13, 15\"})); \n System.out.println(findIntersection(new String[] {\"2, 3, 4\", \"3\"})); \n System.out.println(findIntersection(new String[] {\"1, 5, 6, 7, 10, 11, 12\", \"5, 6, 8, 11, 17\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 3, 4, 5\", \"6, 7, 8, 9, 10\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 4, 5, 6, 9\", \"2, 3, 4, 8, 10\"})); \n System.out.println(findIntersection(new String[] {\"21, 22, 23, 25, 27, 28\", \"21, 24, 25, 29\"})); \n }", "private static Point2D getIntersectionFromParallel(LineSegment A, LineSegment B)\r\n\t{\r\n\t\t// Assume two lines are parallel at this point, return the highest end point (relative) of the two lines\r\n\t\tPoint2D Alow = Utilities.isBelow(A.startPoint, A.endPoint) ? A.startPoint : A.endPoint;\r\n\t\tPoint2D Blow = Utilities.isBelow(B.startPoint, B.endPoint) ? B.startPoint : B.endPoint;\r\n\t\treturn Utilities.isBelow(Alow, Blow) ? Blow : Alow;\r\n\t\t\r\n\t}", "public ListNode findCycleStart(ListNode head) {\n int cycleLength = findCycleLength(head);\n\n ListNode current = head;\n for(int i = 0; i < cycleLength; i++) {\n current = current.next;\n }\n\n ListNode slow = head;\n ListNode fast = current;\n while(slow != fast) {\n slow = slow.next;\n fast = fast.next;\n }\n return slow;\n }", "@Override\n\tpublic SetLinkedList<T> intersection(SetLinkedList<T> otherSet) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented yet!\");\n\t}", "@Test\n public void testIntersectionOfLists() {\n System.out.println(\"IntersectionOfLists\");\n ArrayList<Integer> arr1 = new ArrayList<>();\n arr1.add(12);\n arr1.add(10);\n arr1.add(23);\n ArrayList<Integer> arr2 = new ArrayList<>();\n arr2.add(23);\n arr2.add(10);\n Collections.sort(arr2);\n ArrayListRecursive instance = new ArrayListRecursive(arr1, arr2);\n List result = instance.IntersectionOfLists();\n Collections.sort(result);\n assertEquals(arr2, result);\n }", "public void getIntersection(int[] A, int[] B, ArrayList<int[]> intersections) \n {\n if (A[0] >= B[0] && A[0] <= B[1]) \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take the entirety of A\n intersections.add(A);\n } \n else \n {\n // Take the start of A to end of B\n int[] intersection = new int[]{A[0], B[1]};\n intersections.add(intersection);\n }\n } \n else \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take start of B to end of A\n int[] intersection = new int[]{B[0], A[1]};\n intersections.add(intersection);\n } \n else \n {\n if (A[0] < B[0] && A[1] > B[1]) \n {\n // Take the entirety of B\n intersections.add(B);\n } \n else \n {\n // No intersection at all\n return;\n }\n }\n }\n }", "public static void main(String[] args) {\r\n\t\tListNode head = new ListNode(1);\r\n\t\thead.next = new ListNode(2);\r\n\t\thead.next.next = new ListNode(3);\r\n\t\thead.next.next.next = new ListNode(4);\r\n\t\thead.next.next.next.next = new ListNode(5);\r\n\t\tSystem.out.println(\"Middle Node : 3 got : \" + findMiddle(head).value);\r\n\t\thead.next.next.next.next.next = new ListNode(6);\r\n\t\tSystem.out.println(\"Middle Node : 4 got : \" + findMiddle(head).value);\r\n\t\thead.next.next.next.next.next.next = new ListNode(7);\r\n\t\tSystem.out.println(\"Middle Node : 4 got : \" + findMiddle(head).value);\r\n\t}", "public static int[] intersection(int[] nums1, int[] nums2) {\n if(nums1 == null || nums2 == null){\n return null;\n }\n HashSet<Integer> set = new HashSet<>();\n for (int aNubs1 : nums1) {\n set.add(aNubs1);\n }\n HashSet<Integer> result = new HashSet<>();\n for (int aNubs2 : nums2) {\n if (set.contains(aNubs2) && !result.contains(aNubs2)) {\n result.add(aNubs2);\n }\n }\n int [] intersection = new int[result.size()];\n int index = 0;\n for(int temp : result){\n intersection[index++] = temp;\n }\n return intersection;\n }", "private static PhyloTreeNode findLeastCommonAncestor(PhyloTreeNode node1, PhyloTreeNode node2) {\n if(node1 == null || node2 == null) {\n return null;\n }\n else{\n String label1 = node1.getLabel();\n String label2 = node2.getLabel();\n if(label1.contains(label2) && (label2.contains(\"+\") || label1.equals(label2)))\n return node1;\n else if(label2.contains(label1) && (label2.contains(\"+\") || label2.equals(label1)))\n return node2;\n else{\n return findLeastCommonAncestor(node1.getParent(), node2.getParent());\n }\n }\n }", "Node MergeLists(Node headA, Node headB) { \n \n if(headA==null && headB==null) return null;\n if(headA==null) return headB;\n if(headB==null) return headA;\n\t\n\tNode start = new Node();\n\tNode curr = start;\n \n while(headA!=null && headB!=null) {\n if(headA.data < headB.data) {\n curr.next = headA;\n headA = headA.next;\n } else {\n curr.next = headB;\n headB = headB.next;\n }\n curr = curr.next;\n }\n \n if(headB!=null) curr.next=headB;\n if(headA!=null) curr.next=headA;\n\treturn start.next;\n}", "public DoublyLinkedList<T>.ListNode\r\n \t\t\t\t\t getContainingListNode(DoublyLinkedList<T> lst);", "public static void main(String[] args) {\n\t\tint[] nums1 = {4,9,5};\r\n\t\tint[] nums2 = {9,4,9,8,4};\r\n\t\t//System.out.println(intersection(nums1, nums2));\r\n\t\tArrays.sort(nums1);\r\n\t\tArrays.sort(nums2);\r\n\t\tif (nums1.length>nums2.length) {\r\n\t\t\tint[] temp = nums2;\r\n\t\t\tnums2 = nums1;\r\n\t\t\tnums1 = temp;\r\n\t\t}\r\n\t\tHashSet<Integer> mSet1 = new HashSet<Integer>();\r\n\t\tHashSet<Integer> mSet2 = new HashSet<Integer>();\r\n\t\tfor (Integer i : nums2) {\r\n\t\t\tmSet1.add(i);\r\n\t\t}\r\n\t\tfor (Integer x: nums1) {\r\n\t\t\tif (mSet1.contains(x)) {\r\n\t\t\t\tmSet2.add(x);\r\n\t\t\t}\r\n\t\t}\r\n\t\tint[] r = new int[mSet2.size()];\r\n\t\tint index = 0;\r\n\t\tfor (Integer g: mSet2) {\r\n\t\t\tr[index] = g;\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "public int searchMid() {\n Node p=head, q=head;\n while(p.next!=null && q.next!=null && q.next.next !=null) {\n p = p.next;\n q = q.next.next;\n }\n System.out.println(\"Mid:\"+q.data);\n return p.data;\n\n }", "public static void main(String[] args) {\n\t\tListNode h1 = new ListNode(2);\n\t\tListNode h2 = new ListNode(1);\n\t\tListNode re = mergeTwoLists(h1,h2);\n\t\tSystem.out.println(re.val);\n\t\tSystem.out.println(re.next.val);\n\t}", "public static void main(String[] args) {\n boolean found = false;\r\n \r\n\t\t\r\n\t\tLinkedList<Integer> ll = new LinkedList<>(new ArrayList<Integer>(Arrays.asList(34,90,56,12)));\r\n\t\tLinkedList<Integer> ll2 = new LinkedList<>(new ArrayList<Integer>(Arrays.asList(34,91)));\r\n\t\tfor(int i=0;i<=ll2.size()-1;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<=ll.size()-1;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(ll2.get(i));\r\n\t\t\t\tSystem.out.println(ll.get(j));\r\n\t\t\t\tif(ll2.get(i)==ll.get(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tfound = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(found)\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"here\");\r\n\t\t\t\tfound = false;\r\n\t\t\t\tSystem.out.println(\"Not sublist\");\r\n\t\t\t\tbreak;\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}\r\n\t\tif(found)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"sublist\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public ListNode findMergePointIn_Time_Order_N_(ListNode list1,ListNode list2 ){\n\t\t\n\t\tif(list1==null || list2==null)\n\t\t\treturn null;\n//\t\telse if((list1!=null && list1.next==null) && (list2!=null && list2.next==null) && (list1.val==list2.val) )) {\n//\t\t return list1;\n//\t\t}\t\n//\t\n\t\telse{\n\t\t\tint length1=0,length2=0,diff = 0;\n\t\t\tListNode head1 =list1;\n\t\t\tListNode head2 = list2;\n\t\t\twhile(head1!=null){\n\t\t\t\tlength1++;\n\t\t\t\thead1=head1.getNextNode();\n\t\t\t}\n\t\t\twhile(head2!=null){\n\t\t\t\tlength1++;\n\t\t\t\thead2=head2.getNextNode();\n\t\t\t}\n\t\t\tif(length1<length2){\n\t\t\t\thead1=list2;//bigger list in h1\n\t\t\t\thead2=list1;//smaller in h2\n\t\t\t\tdiff= length2-length1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thead1=list1;//bigger list in h1\n\t\t\t\thead2=list2;//smaller list in h2\n\t\t\t\tdiff= length2-length1;\n\t\t\t}\n\t\t\tint pos =0;\n\t\t\twhile(pos<diff){ //till we are at (diff+1) position in larger list \n\t\t\t\thead1=head1.getNextNode();\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\twhile(head1!=null && head2!=null){//increase till end of link list \n\t\t\t\tif(head1==head2){\n\t\t\t\t\treturn head1;\n\t\t\t\t}\n\t\t\t\thead1=head1.getNextNode();\n\t\t\t\thead2=head2.getNextNode();\n\t\t\t}\n\t\t\treturn head1.getNextNode();\n\t\t}\n\t}", "private List<V> intersectGraphPaths(GraphPath<V, E> p1, GraphPath<V, E> p2)\n {\n List<V> res = new LinkedList<>();\n res.addAll(p1.getVertexList());\n res.retainAll(p2.getVertexList());\n return res;\n }", "private static void commonNodesInOrdSuc(Node r1, Node r2)\n {\n Node n1 = r1, n2 = r2;\n \n if(n1==null || n2==null)\n return;\n \n while(n1.left != null)\n n1 = n1.left;\n \n while(n2.left!= null)\n n2 = n2.left;\n \n while(n1!=null && n2!=null)\n {\n if(n1.data < n2.data)\n n1 = inOrdSuc(n1);\n \n else if(n1.data > n2.data)\n n2 = inOrdSuc(n2);\n \n else\n {\n System.out.print(n1.data+\" \"); n1 = inOrdSuc(n1); n2 = inOrdSuc(n2);\n }\n }\n \n System.out.println();\n }", "public ArrayList<Integer> intersect(final List<Integer> a, final List<Integer> b) {\n\t ArrayList<Integer> res = new ArrayList<>();\n\t \n\t int i1 = 0, i2 = 0;\n\t while (i1 < a.size() && i2 < b.size()) {\n\t //System.out.println(i1 + \" \" + i2 + \" \" + a.get(i1) + \" \" + b.get(i2));\n\t if (a.get(i1).equals(b.get(i2))) {\n\t res.add(a.get(i1));\n\t i1++;\n\t i2++;\n\t } else if (a.get(i1) < b.get(i2)) {\n\t i1++;\n\t } else if (a.get(i1) > b.get(i2)) {\n\t i2++;\n\t }\n\t }\n\t \n\t return res;\n\t}", "public static ListNode midNode(ListNode head) {\n if (head == null || head.next == null)\n return head;\n\n ListNode slow = head, fast = head;\n while (fast.next != null && fast.next.next != null) {\n fast = fast.next.next;\n slow = slow.next;\n\n }\n return slow;\n }", "private Set<String> intersection(Set<String> s1, Set<String> s2) {\n Set<String> intersection = new HashSet<>(s1);\n intersection.retainAll(s2);\n return intersection;\n }", "private Set<String> getIntersection( Set<String> a, Set<String> b ) {\n\t\tSet<String> intersection = new HashSet<String>(a);\n\t\tintersection.retainAll(b);\n\t\treturn intersection;\n\t}", "public static void findIntersection(int[] ip1, int[] ip2) {\n int[] smaller, bigger;\n if (ip1.length <= ip2.length) {\n smaller = ip1;\n bigger = ip2;\n } else {\n smaller = ip2;\n bigger = ip1;\n }\n\n\n //O(n)\n for (int i = 0; i < smaller.length; ) {\n for (int j = 0; j < bigger.length; ) {\n\n if (smaller[i] == bigger[j]) {\n System.out.print(smaller[i]+\" \");\n i++;\n j++;\n } else if (smaller[i] < bigger[j]) {\n i++;\n } else {\n j++;\n }\n\n\n }\n }\n\n\n }", "public static ListNode getPreNode(ListNode head, ListNode end){\n ListNode prevEnd = head;\n while(prevEnd.next != end){\n prevEnd = prevEnd.next;\n }\n return prevEnd;\n }", "public static <T> List<T> intersection(List<T> a, List<T> b) {\n\t\tList<T> acc = new ArrayList<T>();\n\t\tfor (T t : a)\n\t\t\tif (b.contains(t))\n\t\t\t\tacc.add(t);\n\t\treturn acc;\n\t}", "public int[] intersection(int[] nums1, int[] nums2) {\n \n HashSet<Integer> set = new HashSet<>();\n ArrayList<Integer> inter = new ArrayList<>();\n if(nums1.length > nums2.length)\n {\n for(int i = 0; i < nums1.length ;i ++)\n set.add(nums1[i]);\n\n for(int i = 0; i < nums2.length ;i ++)\n if(set.contains(nums2[i])&& !inter.contains(nums2[i]))\n inter.add(nums2[i]);\n }\n else {\n for(int i = 0; i < nums2.length ;i ++)\n set.add(nums2[i]);\n\n for(int i = 0; i < nums1.length ;i ++)\n if(set.contains(nums1[i]) && !inter.contains(nums1[i]))\n inter.add(nums1[i]);\n }\n\n int [] arr = new int[inter.size()];\n for(int i = 0; i < arr.length ;i ++)\n arr[i] = inter.get(i);\n return arr;\n\n }", "public List<Node> findPath(Node start);", "public static void main(String[] args) {\n\t\t\r\n\t\tint arr1[] = {3,2,11,4,6,7};\r\n\t\tint arr2[] = {1,2,8,4,9,7};\r\n\t\t\r\n\t\tList<Integer> list1 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tList<Integer> list2 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor (int a : arr1) {\r\n\t\t\tlist1.add(a);\r\n\t\t}\r\n\t\tfor (int b : arr2) {\r\n\t\t\tlist2.add(b);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(list1);\r\n System.out.println(list2);\r\n \r\n list1.retainAll(list2);\r\n System.out.println(\"The Intersection values : \" + list1);\r\n \r\n\t}", "@Test\n\tpublic void lowestCommonAncestorTest1()\n\t{\n\t\tNodeList n1=xmlDocument.getElementsByTagName(\"b\");\n\t\tNodeList n2=xmlDocument.getElementsByTagName(\"i\");\n\t\tassertEquals(\"p\",Manipulator.lowestCommonAncesstor(n1.item(0),n2.item(0)).getNodeName());\n\t}", "public static void main(String[] args) {\n\t\tint [] a = {3,4,5,6};\n\t\tint [] b = {1,2,3};\t\n\t\tint [] c = {7,8,9};\t\n\t\tint [] d = {};\n\t\tSystem.out.println(intersection(a,b)); //true\n\t\tSystem.out.println(intersection(b,c)); //false\n\t\tSystem.out.println(intersection(a,c)); //false\n\t\tSystem.out.println(intersection(a,d)); //false\n\t\t}", "private HashSet<List<String>> overlapPath(LinkedList<String> _path1, LinkedList<String> _path2) {\n LinkedList<String> shortpath = new LinkedList<String>();\n LinkedList<String> longpath = new LinkedList<String>();\n if (_path1.size() >= _path2.size()) {\n shortpath.addAll(_path2);\n longpath.addAll(_path1);\n } else {\n shortpath.addAll(_path1);\n longpath.addAll(_path2);\n }\n HashSet<List<String>> results = new HashSet<List<String>>();\n List<String> overlap = new LinkedList<String>();\n int length = 1, pointer = 0;\n // complexity: looping only once by increasing / decreasing i and j\n for (int i = 0, j = 0; i < shortpath.size() && j < longpath.size(); ) {\n String node = shortpath.get(i);\n if (node.equals(longpath.get(j))) {\n overlap.add(node);\n i++;\n j++;\n } else {\n if (!overlap.isEmpty()) {\n List<String> newoverlap = new LinkedList<String>();\n newoverlap.addAll(overlap);\n if (newoverlap.size() > length) length = newoverlap.size();\n results.add(newoverlap);\n overlap.clear();\n i = pointer;\n } else {\n if (i != (shortpath.size() - 1) && j == (longpath.size() - 1)) {\n i = i + length;\n pointer = i;\n j = 0;\n length = 1;\n } else j++;\n }\n }\n }\n if (!overlap.isEmpty()) results.add(overlap);\n PathSimilarity.log.info(\"Results: \" + results);\n return results;\n }", "@Test(expected=NullPointerException.class)\n\tpublic void lowestCommonAncestorTest2()\n\t{\n\t\tNodeList n1=xmlDocument.getElementsByTagName(\"c\");\n\t\tNodeList n2=xmlDocument.getElementsByTagName(\"i\");\n\t\tManipulator.lowestCommonAncesstor(n1.item(0),n2.item(0));\n\t}", "public ListNode loopDetection1(ListNode head) {\r\n\r\n if (head == null || head.next == null) return null;\r\n\r\n ListNode curr = head;\r\n HashSet<ListNode> list = new HashSet<ListNode>();\r\n\r\n while (curr.next != null) {\r\n if (list.contains(curr)) return curr;\r\n\r\n list.add(curr);\r\n curr = curr.next;\r\n }\r\n\r\n return null;\r\n\r\n }", "public static Node middleNode(Node start, Node last) { \n if (start == null) \n return null; \n \n Node slow = start; \n Node fast = start.next; \n \n while (fast != last) \n { \n fast = fast.next; \n if (fast != last) \n { \n slow = slow.next; \n fast = fast.next; \n } \n } \n return slow; \n }", "public T findStartOfCircle() {\n \tNode<T> current = head;\n \tList<T> seen = new ArrayList<>();\n \twhile (true) {\n \t\tseen.add(current.val);\n \t\tif (seen.contains(current.next.val)) return current.next.val;\n \t\telse current = current.next;\n\t\t}\n }", "private static void commonNodesIterInOrd(Node root1,Node root2)\n {\n if(root1 == null || root2 == null) return;\n \n LinkedList<Node> stack1 = new LinkedList<>();\n LinkedList<Node> stack2 = new LinkedList<>();\n \n Node n1 = root1, n2 = root2;\n \n while(true)\n {\n if(n1!=null)\n {\n stack1.push(n1); n1 = n1.left;\n }\n if(n2!=null)\n {\n stack2.push(n2); n2 = n2.left;\n } \n \n if(n1 == null && n2 == null)\n {\n if(stack1.size() == 0 || stack2.size() == 0)\n break;\n \n n1 = stack1.peekFirst(); n2 = stack2.peekFirst();\n \n if(n1.data < n2.data)\n {\n stack1.pop(); n1 = n1.right; n2 = null;\n }\n else if(n1.data > n2.data)\n {\n stack2.pop(); n2 = n2.right; n1 = null;\n }\n else\n {\n stack1.pop(); stack2.pop(); \n System.out.print(n1.data+\" \");\n n1 = n1.right; n2 = n2.right;\n }\n }\n }\n }", "@Test\n\tpublic void lowestCommonAncestorTest3()\n\t{\n\t\tNodeList n1=xmlDocument.getElementsByTagName(\"b\");\n\t\tNodeList n2=xmlDocument.getElementsByTagName(\"p\");\n\t\tassertEquals(\"#document\",Manipulator.lowestCommonAncesstor(n1.item(0),n2.item(0)).getNodeName());\n\t}", "TreeNode findFirstCommonAncestor(TreeNode other) {\n\t\tSet<TreeNode> ancestors = buildOtherAncestor(other,\n\t\t\t\tnew HashSet<TreeNode>());\n\t\treturn firstNodeInSet(ancestors);\n\t}", "public static List<Integer> computeIntersection(int[] A, int[] B){\n List<Integer> result = new ArrayList<>();\n int i=0;\n int j=0;\n while((i<A.length) && (j<B.length)){\n if((A[i] == B[j]) && ((i == 0) || (A[i] != A[i-1]))){\n result.add(A[i]);\n i++;\n j++;\n }\n else if(A[i] < B[j]){\n i++;\n }\n else{\n j++;\n }\n }\n return result;\n }", "public Object[] getStartNodes ();", "public static void main(String[] args) {\n\t\tNode headA = new Node();\r\n\t\tNode second1 = new Node();\r\n\t\tNode third1 = new Node();\r\n\t\theadA.data=1;\r\n\t\tsecond1.data=3;\r\n\t\tthird1.data=5;\r\n\t\theadA.next=second1;\r\n\t\tsecond1.next=third1;\r\n\t\t\r\n\t\tNode headB = new Node();\r\n\t\tNode second2 = new Node();\r\n\t\tNode third2 = new Node();\r\n\t\theadB.data=2;\r\n\t\tsecond2.data=4;\r\n\t\tthird2.data=6;\r\n\t\theadB.next=second2;\r\n\t\tsecond2.next=third2;\r\n\t\t\r\n\t\tdisplay(headA);\r\n\t\tdisplay(headB);\r\n\t\t\r\n\t\tNode head3 = MergeLists(headA, headB);\r\n\t\tdisplay(head3);\r\n\t}", "public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n final ListNode vituralHead = new ListNode(0);\n vituralHead.next = list1;\n\n ListNode cursor = vituralHead;\n int index = 0;\n\n ListNode aNode = null;\n ListNode bNode = null;\n while (cursor != null) {\n\n if (index == a) {\n aNode = cursor;\n }\n\n if (index == b + 1) {\n bNode = cursor;\n break;\n }\n\n index++;\n cursor = cursor.next;\n }\n\n ListNode tailOfList2 = list2;\n while (tailOfList2.next != null) {\n tailOfList2 = tailOfList2.next;\n }\n\n aNode.next = list2;\n tailOfList2.next = bNode.next;\n return vituralHead.next;\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "@Test(expected = NullPointerException.class)\r\n\t\tpublic void testIntersectionWithNullInput() {\r\n\t\t\ttestingSet = new IntegerSet(null);\r\n\t\t\ttestingSet2= new IntegerSet(null); \r\n\t\t\t\r\n\t\t\t// union of 2 null sets \r\n\t\t\ttestingSet3= testingSet.intersection(testingSet, testingSet2);\r\n\t\t}", "private <T> ArrayList<T> intersection(ArrayList<T> list1, ArrayList<T> list2) {\n ArrayList<T> list = new ArrayList<T>();\n\n for (T t : list1) {\n if (list2.contains(t)) {\n list.add(t);\n }\n }\n\n return list;\n }", "public static void main(String[] args) {\n\t\t\n\tint[] firstArr =\t{1,2,3,4,5};\n\tint[] secondArr =\t{2,3,4,9,6,10};\n\tSet<Integer> set = new HashSet<Integer>();\n\tfor(int i=0; i<secondArr.length; i++) {\n\t\tset.add(secondArr[i]);\n\t}\n\tfor(int i=0; i<firstArr.length; i++) {\n\t\tboolean status =set.add(firstArr[i]);\n\t\tif(status==false) {\n\t\t\tSystem.out.println(\"Intersection Elements :\"+firstArr[i]);\n\t }\n\t}\n }", "public static <T> node_t<T> \n overlapping_no_cycle_lists(node_t<T> L1, node_t<T> L2) {\n int L1_len = count_len(L1);\n int L2_len = count_len(L2);\n\n Ref<node_t<T>> RL1 = new Ref<node_t<T>>(L1);\n Ref<node_t<T>> RL2 = new Ref<node_t<T>>(L2);\n\n // Advance the longer list.\n advance_list_by_k(L1_len > L2_len ? RL1 : RL2, Math.abs(L1_len - L2_len));\n\n while (RL1.value != null && RL2.value != null && RL1.value != RL2.value) {\n RL1.value = RL1.value.next;\n RL2.value = RL2.value.next;\n }\n return RL1.value; // nullptr means no overlap between L1 and L2.\n }", "private final void setPredecessor(_Node end, _Node start)\r\n {\r\n \tList<_Node> listNodes = null;\r\n \tif(predecessors.containsKey(end))\r\n \t{\r\n \t\tif(!predecessors.get(end).contains(start))\r\n \t\t{\r\n \t\t\tpredecessors.get(end).add(start);\r\n \t\t\tlistNodes = predecessors.get(end);\r\n \t\t\tpredecessors.put(end, listNodes);\r\n \t\t}\r\n \t}\r\n \telse\r\n \t{\r\n \t\tlistNodes = new ArrayList<_Node>();\r\n \t\tlistNodes.add(start);\r\n \t\tpredecessors.put(end, listNodes);\r\n \t}\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Arrays.toString(intersect(new int[]{1, 2, 3, 4}, new int[]{1, 2, 3, 4, 1, 2, 3, 4})));\n\t}", "private static ListNode findPreMiddle(ListNode head) {\n\t\t\n\t\tif(head.next == null){return head;}\n\t\t\n\t\tListNode fast = head.next;\n\t\tListNode slow = head;\n\t\t\n\t\twhile(fast.next != null && fast.next.next != null){\n\t\t\tfast = fast.next.next;\n\t\t\tslow = slow.next;\n\t\t}\n\t\t\n\t\treturn slow;\n\t}", "public static void main(String[] args) {\n\t\t\t\t\r\n\t\tListNode list1 =new ListNode(1, new ListNode(2, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode list2 =new ListNode(1, new ListNode(3, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode result = new MergeTwoSortedLists().mergeTwoLists(list1, list2);\r\n\t\t\r\n\t\twhile(result!=null) {\r\n\t\t\tSystem.out.print(\" \"+result.val);\r\n\t\t\tresult=result.next;\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "TreeNode commonAncestor(TreeNode p, TreeNode q) {\n\t// find depths of the two nodes \n\tint depthP = depth(p);\n\tint depthQ = depth(q);\n\t// find difference in depths \n\tint diffDepths = depthP - depthQ;\n\t// q is more shallow\n\tTreeNode first = diffDepths > 0 ? q : p; \n\t// p is more deep\n\tTreeNode second = diffDepths > 0 ? p : q; \n\t// Bring the second one up \n\tsecond = goUpBy(second, Math.abs(delta));\n\n\t// FIND INTERSECTING PATH BY GOING UP ONE AT A TIME\n\t// WHILE THEY ARE NOT THE SAME AND BOTH NOT NULL \n\twhile (first != second && first != null && second != null) {\n\t\tfirst = first.parent;\n\t\tsecond = second.parent; \n\t}\n\t// if either is null, no common, therefore return null\n\t// else we can return one of the two bc they are the same\n\treturn first == null || second == null ? null : first; \n\n}", "public static void main(String[] args) {\n ListNode head = null;\n\n // Use push() function to con\n // the below list 8 . 23 . 11 . 29 . 12 /\n head = push(head, 12);\n head = push(head, 29);\n head = push(head, 11);\n head = push(head, 23);\n head = push(head, 8);\n head = push(head, 2);\n findMiddleNode llist = new findMiddleNode();\n int middleNode = 0;\n int middleNode2 = 0;\n for (ListNode temp = head; temp != null; temp = temp.next) {\n middleNode = (llist.findTheMiddleNode(head)).data;\n middleNode2 = (llist.findTheMiddleNode2(head)).data;\n }\n System.out.println(middleNode);\n System.out.println(middleNode2);\n }", "public int[] intersection1(int[] nums1, int[] nums2) {\n Set<Integer> nums1Set = new HashSet<>();\n Set<Integer> nums2Set = new HashSet<>();\n\n for (int i = 0; i < nums1.length; i++) {\n nums1Set.add(nums1[i]);\n }\n for (int i = 0; i < nums2.length; i++) {\n nums2Set.add(nums2[i]);\n }\n\n nums1Set.retainAll(nums2Set);\n\n int[] res = new int[nums1Set.size()];\n int i = 0;\n for (int s: nums1Set) {\n res[i++] = s;\n }\n return res;\n }", "public ArrayList<Integer> intersect(\n final List<Integer> A, final List<Integer> B) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n int M = A.size();\n int N = B.size();\n if (M == 0 || N == 0) {\n return res;\n }\n int i = 0;\n int j = 0;\n while (i < M && j < N) {\n int a = A.get(i);\n int b = B.get(j);\n if (a == b) {\n res.add(a);\n i++;\n j++;\n } else if (a < b) {\n i++;\n } else {// a > b\n j++;\n }\n }\n return res;\n }", "public VertexSet intersection(VertexSet ot) {\r\n\t\tVertexSet ans = new VertexSet();\r\n\t\tint i1=0,i2=0;\r\n\t\twhile(i1<this.size() & i2 < ot.size()) {\r\n\t\t\tint a1=this.at(i1), a2 = ot.at(i2);\r\n\t\t\tif(a1==a2) {\r\n\t\t\t\tans.add(a1); i1++; i2++;}\r\n\t\t\telse if(a1<a2) {i1++;}\r\n\t\t\telse i2++;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public void start(Node n) {}", "public static void main(String[] args) {\n\t\tList list = new List(1);\n\t\tlist.next = new List(2);\n\t\tlist.next.next = new List(3);\n\t\tlist.next.next.next = new List(4);\n//\t\tlist.next.next.next.next = new List(5);\n\t\tSystem.out.println(list.toString());\n\t\tSystem.out.println();\n//\t\tSystem.out.println(reverse(list).toString());\n\t\tSystem.out.println(findMiddleElement(list));\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tListNode L1 = new ListNode(1);\r\n\t\tListNode L2 = new ListNode(2);\r\n\t\tListNode L3 = new ListNode(3);\r\n\t\tListNode L4 = new ListNode(4);\r\n\t\tListNode L5 = new ListNode(5);\r\n\t\tL1.next=L2;\r\n\t\tL2.next=L3;\r\n\t\tL3.next=L4;\r\n\t\tL4.next=L5;\r\n\t\t\r\n\t\tListNode L6 = new ListNode(1);\r\n\t\tListNode L7 = new ListNode(3);\r\n\t\tListNode L8 = new ListNode(4);\r\n\t\tListNode L9 = new ListNode(7);\r\n\t\tListNode L10 = new ListNode(9);\r\n\t\tL6.next=L7;\r\n\t\tL7.next=L8;\r\n\t\tL8.next=L9;\r\n\t\tL9.next=L10;\r\n\t\t\r\n\t\tprintListNode(mergeTwoLists( L1, L6));\r\n\t}", "public BinaryTreeNode getCommonAncestor(BinaryTreeNode head, BinaryTreeNode node1, BinaryTreeNode node2) {\n if (head == null || node1 == null || node2 == null) {\n return null;\n }\n\n List<BinaryTreeNode> nodes = findAncestor(head, node1, node2);\n if (nodes.contains(node1) && nodes.contains(node2)) {\n return nodes.get(nodes.size() -1);\n }\n\n return null;\n }", "public ListNode findMiddle(ListNode head) {\n\t\tListNode fast,slow;\n\t\tfast=slow=head;\n\t\twhile(fast!=null & fast.next()!=null) {\n\t\t\tfast=fast.next().next();\n\t\t\tslow=slow.next();\t\t\n\t\t}\n\t\treturn slow;\n\t}", "public static void main(String[] args) {\n\n\t\tSearchElementInLinkedList list = new SearchElementInLinkedList();\n\t\tlist.addAtBeginnning(5);\n\t\tlist.addAtBeginnning(4);\n\t\tlist.addAtBeginnning(3);\n\t\tlist.addAtBeginnning(2);\n\t\tlist.addAtBeginnning(1);\n\t\t\n\t\tlist.printLinkedList();\t\t\n\t\tSystem.out.println();\n\t\tlist.searchElementIterative(4);\n\t\t\n\t\tSystem.out.println();\n\t\tboolean isFound = list.searchElementsRecursive(list.head, 4);\n\t\tSystem.out.println(\"Is Element Found via Recursive: \" + isFound);\n\t\t\n\t}", "public Point intersectionWith(Line other) {\r\n double m1 = this.lineSlope();\r\n double m2 = other.lineSlope();\r\n double b1 = this.intercept();\r\n double b2 = other.intercept();\r\n double interX, interY;\r\n if (m1 == m2) {\r\n return null;\r\n // this line is vertical\r\n } else if (m1 == Double.POSITIVE_INFINITY || m1 == Double.NEGATIVE_INFINITY) {\r\n interX = this.start.getX();\r\n if ((Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.end().getX(), other.start().getX()))) {\r\n // y value of intersection point\r\n interY = interX * m2 + b2;\r\n if (Math.min(this.start().getY(), this.end().getY()) <= interY\r\n && interY <= Math.max(this.start().getY(), this.end().getY())) {\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // other line is vertical\r\n } else if (m2 == Double.POSITIVE_INFINITY || m2 == Double.NEGATIVE_INFINITY) {\r\n interX = other.start.getX();\r\n if ((Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.end().getX(), this.start().getX()))) {\r\n // y value of intersection point\r\n interY = interX * m1 + b1;\r\n if (Math.min(other.start().getY(), other.end().getY()) <= interY\r\n && interY <= Math.max(other.start().getY(), other.end().getY())) {\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // this line is horizontal\r\n } else if (m1 == 0) {\r\n // y value of potential intersection point\r\n interY = this.start.getY();\r\n if ((Math.min(other.start().getY(), other.end().getY()) <= interY\r\n && interY <= Math.max(other.end().getY(), other.start().getY()))) {\r\n interX = ((interY - other.start.getY()) / other.lineSlope()) + other.start.getX();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.start().getX(), this.end().getX())) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // other line is horizontal\r\n } else if (m2 == 0) {\r\n // y value of potential intersection point\r\n interY = this.start.getY();\r\n if ((Math.min(this.start().getY(), this.end().getY()) <= interY\r\n && interY <= Math.max(this.end().getY(), this.start().getY()))) {\r\n interX = ((interY - this.start.getY()) / this.lineSlope()) + this.start.getX();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.start().getX(), other.end().getX())) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // lines are not horizontal or vertical\r\n } else {\r\n interX = (b1 - b2) / (m2 - m1);\r\n interY = (m1 * (interX - this.start.getX())) + this.start.getY();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.start().getX(), other.end().getX())\r\n || (Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.start().getX(), this.end().getX()))) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n }", "public static int lca(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraylist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Return the last common element from behind in ArrayList\r\n return path1.get(i+1);\r\n }", "boolean intersect(BST<T> t) {\n for (Node x = minimum(t.root); x != null; x = successor(x)) {\n if (x.value.compareTo(search(x.value).value) == 0) return true;\n }\n return false;\n }", "public ListNode swapNodes(ListNode head, int v1, int v2) {\n ListNode start = new ListNode(0);\n start.next = head;\n ListNode preOne = null;\n ListNode preTwo = null;\n\n ListNode search = start;\n\n while (search.next != null) {\n ListNode next = search.next;\n if (next.val == v1) {\n preOne = search;\n }\n if (next.val == v2) {\n preTwo = search;\n }\n search = next;\n }\n if (preOne == null || preTwo == null) {\n return start.next;\n }\n\n\n ListNode one = preOne.next;\n ListNode two = preTwo.next;\n if (two.next == one) {\n preTwo.next = one;\n two.next = one.next;\n one.next = two;\n return start.next;\n } else if (one.next == two) {\n preOne.next = two;\n one.next = two.next;\n two.next = one;\n return start.next;\n }\n ListNode befone = preOne.next.next;\n ListNode beftwo = preTwo.next.next;\n one.next = beftwo;\n two.next = befone;\n preOne.next = two;\n preTwo.next = one;\n return start.next;\n }", "public static void main(String[] args) {\n\t\tInteger[] firstArray = {0,2,4,6,8};\n\t Integer[] secondArray = {1,3,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray, secondArray);\n\n\t System.out.println();\n\t \n\t // Array with duplicate elements in the array\n\t Integer[] firstArray1 = {0,2,2,4,6,6,8};\n\t Integer[] secondArray2 = {1,3,10,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray1, secondArray2);\n\t}", "public static <T> List<T> intersection(List<T> list1, List<T> list2) {\n List<T> list = new ArrayList<T>();\n\n for (T t : list1) {\n if(list2.contains(t)) {\n list.add(t);\n }\n }\n\n return list;\n }", "Iterable<T> followNodeAndSelef(T start) throws NullPointerException;", "public PhyloTreeNode findLeastCommonAncestor(String label1, String label2) {\n PhyloTreeNode node1 = findTreeNodeByLabel(label1);\n PhyloTreeNode node2 = findTreeNodeByLabel(label2);\n return findLeastCommonAncestor(node1, node2);\n }", "public static void main(String[] args) {\n addNode(3);\n Node ans = lowestCommonAncestorFast(root.left, root.left.right.right);\n System.out.print(ans.val);\n }", "public ListNode findTheMiddleNode2(ListNode head) {\n if (head == null)\n return null;\n ListNode slow = head;\n ListNode fast = head;\n\n while (fast != null && fast.next != null && (fast.next).next != null) {\n fast = (fast.next).next;\n slow = slow.next;\n }\n return slow;\n }", "public ArrayList<Student> intersection(Student[] class1,Student[] class2){\n ArrayList<Student> list = new ArrayList<>();\n //alter this method to conform to the expected test result in AdministrationTest in the case of an empty list\n \n for (Student stud1: class1){\n for (Student stud2: class2){\n\n if(stud1.equals(stud2) && !list.contains(stud1)){\n list.add(stud1);\n }\n\n }\n }\n\n return list.size() > 0 ? list : null;\n }", "@Override\n\tpublic IPredicate intersection(final IPredicate state1, final IPredicate state2) {\n\n\t\tfinal Set<HcPredicateSymbol> state1PredSymbols = new HashSet<>();\n\t\tstate1PredSymbols.addAll(((HCPredicate) state1).getHcPredicateSymbols());\n//\t\tassert state1PredSymbols.size() == 1 : \"what does this mean??\";\n\n//\t\tfinal Term conjoinedFormula = mSimplifier.getSimplifiedTerm(\n//\t\t\t\tSmtUtils.and(mBackendSmtSolverScript.getScript(), state1.getFormula(), state2.getFormula()));\n\t\tfinal IPredicate conjoinedPred = mPredicateFactory.and(state1, state2);\n\n\t\tif (mPredicateFactory.isDontCare(conjoinedPred)) {\n\t\t\treturn mPredicateFactory.newPredicate(state1PredSymbols, conjoinedPred.getFormula(),\n\t\t\t\tCollections.emptyList());\n//\t\t\treturn conjoinedPred;\n\t\t}\n\n\t\tfinal Term conjoinedFormula = new CommuhashNormalForm(mServices, mMgdScript.getScript())\n\t\t\t\t.transform(conjoinedPred.getFormula());\n\n//\t\tfinal Set<IPredicate> ps = new HashSet<>();\n//\t\tps.add(state1);\n//\t\tps.add(state2);\n\n\t\treturn mPredicateFactory.newPredicate(state1PredSymbols, conjoinedFormula,\n\t\t\t\tArrays.asList(state1.getFormula().getFreeVars()));\n\t}", "public int[] intersect(int[] nums1, int[] nums2) {\n Arrays.sort(nums1);\n Arrays.sort(nums2);\n List<Integer> li = new ArrayList<>();\n int index=0;\n for(int num : nums1){\n int bsIndex = binarySearch(nums2, num, index, nums2.length-1);\n if(bsIndex!=-1){\n li.add(num);\n index=bsIndex+1;\n }\t\n }\n int []ar = new int[li.size()];\n for(int i=0;i<ar.length;i++){\n ar[i]=li.get(i);\n }\n return ar;\n }", "public BSTSet intersection(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n int[] interArray = justDuplicates(thisArray, sArray);\n\n sortArray(interArray);\n\n return new BSTSet(interArray);\n }", "public PostingsList intersect(PostingsList l1, PostingsList l2){\n\n PostingsList intersection = new PostingsList();\n\n // Counters to iterate docIDs\n int count1 = 0;\n int count2 = 0;\n\n // First posting\n PostingsEntry p1 = l1.get(0);\n PostingsEntry p2 = l2.get(0);\n\n while(true){\n // Match - EUREKA! //\n if (p1.docID == p2.docID){\n // Add match\n intersection.insert(p1.docID);\n // Increase counters\n count1++;\n count2++;\n // Go to next postings (check for nullpointer)\n if (count1<l1.size() && count2<l2.size()){\n p1 = l1.get(count1);\n p2 = l2.get(count2);\n }\n else\n break;\n }\n // No match\n else if (p1.docID < p2.docID){\n count1++;\n if (count1<l1.size())\n p1 = l1.get(count1);\n else\n break;\n }\n // No match\n else{\n count2++;\n if (count2<l2.size())\n p2 = l2.get(count2);\n else\n break;\n }\n }\n\n return intersection;\n }", "public static Interval intersection(Interval in1, Interval in2){\r\n double a = in1.getFirstExtreme();\r\n double b = in1.getSecondExtreme();\r\n double c = in2.getFirstExtreme();\r\n double d = in2.getSecondExtreme();\r\n char p1 = in1.getFEincluded();\r\n char p2 = in1.getSEincluded();\r\n char p3 = in2.getFEincluded();\r\n char p4 = in2.getSEincluded();\r\n \r\n if (a==c && b==d){\r\n if (a==b){\r\n if (p1=='[' && p3=='[' && p2==']' && p4==']'){\r\n return new Interval(in1);\r\n }else{\r\n return new Interval(0,0,'(',')');\r\n }\r\n }else{\r\n return new Interval(a,b,p1==p3?p1:'(',p2==p4?p2:')');\r\n }\r\n }else if (a<c && b<=c){\r\n if (b==c && p2==']' && p3=='['){\r\n return new Interval(b,b,p3,p2);\r\n }else{\r\n return new Interval(0,0,'(',')');\r\n }\r\n }else if (a<=c && b<d){\r\n if (a==c){\r\n return new Interval(a,b,p1==p3?p1:'(',p2);\r\n }else{\r\n return new Interval(c,b,p3,p2);\r\n }\r\n }else if(a<c && b==d){\r\n return new Interval(c,b,p3,p2==p4?p2:')');\r\n }else if(a<=c && b>d){\r\n if (a==c){\r\n return new Interval(a,d,p1==p3?p1:'(',p4);\r\n }else{\r\n return new Interval(in2);\r\n }\r\n }else if (a>c && b<=d){\r\n if (b==d){\r\n return new Interval(a,b,p1,p2==p4?p2:')');\r\n }else{\r\n return new Interval(in1);\r\n }\r\n }else if (a<=d && b>d){\r\n if (a==d){\r\n if (p1=='[' && p4==']'){\r\n return new Interval(a,a,p1,p4);\r\n }else{\r\n return new Interval(0,0,'(',')');\r\n }\r\n }else{\r\n return new Interval(a,d,p1,p4);\r\n }\r\n }else{\r\n return new Interval(0,0,'(',')');\r\n }\r\n }", "public ListNode findTheMiddleNode(ListNode head) {\n\n ListNode slow = head;\n ListNode fast = head;\n if (head == null) {\n return null;\n } else {\n while (fast != null && fast.next != null) {\n fast = (fast.next).next;\n slow = slow.next;\n }\n\n }\n return slow;\n }", "LinkedList<Loop> getCommonEnclosingLoops();" ]
[ "0.7474758", "0.73914605", "0.7110246", "0.70689845", "0.6875356", "0.68702453", "0.6846891", "0.6677615", "0.6635925", "0.63432616", "0.6120125", "0.60568243", "0.59358734", "0.5806012", "0.5766083", "0.57303125", "0.56379896", "0.56025165", "0.5582508", "0.55736184", "0.5556764", "0.55238277", "0.54988027", "0.5494492", "0.5481274", "0.5477363", "0.54654604", "0.54638785", "0.5457659", "0.5452843", "0.54522663", "0.54322845", "0.5429091", "0.5402047", "0.53731054", "0.5366252", "0.53652525", "0.53629863", "0.53486776", "0.5341268", "0.5340749", "0.5327349", "0.53209716", "0.53202", "0.52890867", "0.52768964", "0.52757514", "0.52690417", "0.5268431", "0.52415854", "0.5228278", "0.52268267", "0.5225889", "0.52231646", "0.5214645", "0.5179312", "0.51708907", "0.51655465", "0.5160465", "0.51492375", "0.5148439", "0.5146526", "0.5132643", "0.5130308", "0.5125837", "0.512432", "0.5116719", "0.51163137", "0.51047426", "0.50943244", "0.5093997", "0.50904846", "0.50871086", "0.5081708", "0.5068697", "0.50657773", "0.5064958", "0.5064498", "0.5062352", "0.50581425", "0.50562", "0.50487316", "0.50376344", "0.50306576", "0.5022678", "0.5020964", "0.5013867", "0.49959198", "0.49951437", "0.49943113", "0.49908304", "0.4987352", "0.4980753", "0.4978408", "0.49713323", "0.49712873", "0.4970642", "0.49672082", "0.49670574", "0.49655706" ]
0.6934871
4
You are given two nonempty linked lists representing two nonnegative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself.
public static final ListNode<java.lang.Integer> Add ( final ListNode<java.lang.Integer> headNode1, final ListNode<java.lang.Integer> headNode2) { int carry = 0; ListNode<java.lang.Integer> node1 = headNode1; ListNode<java.lang.Integer> node2 = headNode2; ListNode<java.lang.Integer> additionHeadNode = null; ListNode<java.lang.Integer> additionPrevNode = null; while (null != node1 && null != node2) { int sum = carry + node1.value() + node2.value(); ListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null); if (null != additionPrevNode) additionPrevNode.setNext (additionNode); if (null == additionHeadNode) additionHeadNode = additionNode; additionPrevNode = additionNode; carry = sum / 10; node1 = node1.next(); node2 = node2.next(); } while (null != node1) { int sum = carry + node1.value(); ListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null); if (null != additionPrevNode) additionPrevNode.setNext (additionNode); if (null == additionHeadNode) additionHeadNode = additionNode; additionPrevNode = additionNode; carry = sum / 10; node1 = node1.next(); } while (null != node2) { int sum = carry + node2.value(); ListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null); if (null != additionPrevNode) additionPrevNode.setNext (additionNode); if (null == additionHeadNode) additionHeadNode = additionNode; additionPrevNode = additionNode; carry = sum / 10; node2 = node2.next(); } return additionHeadNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ListNode addTwoNumbers2(ListNode l1, ListNode l2) {\n ListNode c1 = l1;\n ListNode c2 = l2;\n ListNode sentinel = new ListNode(0);\n ListNode d = sentinel;\n int sum = 0;\n while (c1 != null || c2 != null) {\n sum /= 10;\n if (c1 != null) {\n sum += c1.val;\n c1 = c1.next;\n }\n if (c2 != null) {\n sum += c2.val;\n c2 = c2.next;\n }\n d.next = new ListNode(sum % 10);\n d = d.next;\n }\n if (sum / 10 == 1) {\n d.next = new ListNode(1);\n }\n return sentinel.next;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> stack1 = new Stack<>(), stack2 = new Stack<>();\n if(l1 == null) return l2;\n if(l2 == null) return l1;\n int carry = 0;\n ListNode tmp1 = l1, tmp2 = l2;\n while(tmp1 != null){\n \tstack1.push(tmp1.val);\n \ttmp1 = tmp1.next;\n } \n while(tmp2 != null){\n \tstack2.push(tmp2.val);\n \ttmp2 = tmp2.next;\n }\n int val1 = 0, val2 = 0, sum = 0;\n while(!stack1.isEmpty() || !stack2.isEmpty()){\n \tif(!stack1.isEmpty()){\n \t\tval1 = stack1.pop();\n \t}else{\n \t\tval1 = 0;\n \t}\n \tif(!stack2.isEmpty()){\n \t\tval2 = stack2.pop();\n \t}else{\n \t\tval2 = 0;\n \t}\n \tsum = val1 + val2 + carry;\n \tcarry = sum / 10;\n \ttmp1 = new ListNode(sum % 10);\n \ttmp1.next = tmp2;\n \ttmp2 = tmp1;\n }\n if(carry != 0){\n tmp1 = new ListNode(carry);\n tmp1.next = tmp2;\n tmp2 = tmp1;\n }\n return tmp1;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> s1 = new Stack<>();\n Stack<Integer> s2 = new Stack<>();\n while (l1 != null) {\n s1.push(l1.val);\n l1 = l1.next;\n }\n while (l2 != null) {\n s2.push(l2.val);\n l2 = l2.next;\n }\n ListNode current = new ListNode(0);\n int overflow = 0;\n while (!s1.empty() || !s2.empty()) {\n int x = (!s1.empty()) ? s1.pop() : 0;\n int y = (!s2.empty()) ? s2.pop() : 0;\n int value = overflow + x + y;\n overflow = value / 10;\n current.val = value % 10;\n ListNode temp = new ListNode(overflow);\n temp.next = current;\n current = temp;\n }\n return current.val == 0 ? current.next : current;\n}", "public static Node addTwoNumbers(Node l1, Node l2) {\n int carry = 0;\n Node dummyHead = new Node(0, null);\n Node current = dummyHead;\n\n while (l1 != null || l2 != null) {\n int x = (l1 != null) ? l1.getData() : 0;\n int y = (l2 != null) ? l2.getData() : 0;\n int sum = x + y + carry;\n carry = sum / 10;\n current.next = new Node(sum % 10, null);\n current = current.next;\n // Next index\n if (l1 != null) {\n l1 = l1.next;\n }\n if (l2 != null) {\n l2 = l2.next;\n }\n }\n if (carry > 0) {\n current.next = new Node(carry, null);\n }\n return dummyHead.next;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\tListNode dummyHead = new ListNode(0);\n\t\tListNode p = l1, q = l2, curr = dummyHead;\n\t\tint carry = 0;\n\t\twhile (p != null || q != null) {\n\t\t\tint x = (p != null) ? p.val : 0;\n\t\t\tint y = (q != null) ? q.val : 0;\n\t\t\tint sum = carry + x + y;\n\t\t\tcarry = sum / 10;\n\t\t\tcurr.next = new ListNode(sum % 10);\n\t\t\tcurr = curr.next;\n\t\t\tif (p != null)\n\t\t\t\tp = p.next;\n\t\t\tif (q != null)\n\t\t\t\tq = q.next;\n\t\t}\n\t\tif (carry > 0) {\n\t\t\tcurr.next = new ListNode(carry);\n\t\t}\n\t\treturn dummyHead.next;\n\t}", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n if (l1 == null) return l2;\n if (l2 == null) return l1;\n\n // create results head pointer with dummy node\n final ListNode results = new ListNode(0);\n // create and point results pointer to the head\n ListNode resultsPointer = results;\n\n // value to keep reminder from previous sum operation\n int carry = 0;\n\n // iterate numbers until we process both completely\n while (l1 != null || l2 != null) {\n // one of the numbers can be longer, that's why adding zeros to shorter number\n final int digit1 = l1 != null ? l1.val : 0;\n final int digit2 = l2 != null ? l2.val : 0;\n // just simple math https://en.wikipedia.org/wiki/Carry_(arithmetic)\n final int sum = digit1 + digit2 + carry;\n final int result = sum % 10;\n carry = sum / 10;\n\n // save result in results list\n resultsPointer.next = new ListNode(result);\n resultsPointer = resultsPointer.next;\n\n // move numbers to the next digits, if number has more digits\n if (l1 != null) l1 = l1.next;\n if (l2 != null) l2 = l2.next;\n }\n\n // if there is carry left, just add it to result\n if (carry > 0) {\n resultsPointer.next = new ListNode(carry);\n }\n\n // remove first dummy node\n return results.next;\n }", "public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\r\n\t\tif (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n\t\tif (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode pre=new ListNode(0);\r\n ListNode head=pre;\r\n int temp=0;\r\n //temp不等于0就是为了处理进位\r\n while(l1!=null||l2!=null||temp!=0){\r\n \tListNode cur = new ListNode(0);\r\n \tint sum=((l1==null)?0:l1.val)+((l2==null)?0:l2.val)+temp;\r\n \tcur.val=sum%10;\r\n \ttemp=sum/10;\r\n \tpre.next=cur;\r\n \tpre=cur;\r\n \tl1=(l1==null)?l1:l1.next;\r\n \tl2=(l2==null)?l2:l2.next;\r\n }\r\n return head.next;\r\n }", "public static ListAdd.ListNode addTwoNumbers(ListAdd.ListNode l1, ListAdd.ListNode l2) {\n if (l1 == null)\n return l2;\n if (l2 == null)\n return l1;\n ListAdd.ListNode res = null, head = null;\n int total = 0;\n int carry = 0;\n while (l1 != null && l2 != null) {\n if (res == null) {\n total = (l1.val + l2.val);\n carry = total / 10;\n res = new ListAdd.ListNode(total % 10); //13 % 10 = 3\n head = res;\n } else {\n total = (l1.val + l2.val + carry);\n carry = total / 10;\n\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n }\n l1 = l1.next;\n l2 = l2.next;\n }\n while (l1 != null) {\n total = (l1.val + carry);\n carry = total / 10;\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n l1 = l1.next;\n }\n while (l2 != null) {\n total = (l2.val + carry);\n carry = total / 10;\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n l2 = l2.next;\n }\n if (carry > 0) {\n res.next = new ListAdd.ListNode(carry);\n }\n return head;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n \tif(l1==null && l2==null)\n\t\treturn null;\n\tif(l1==null)\n\t\treturn l2;\n\tif(l2==null)\n\t\treturn l1;\n\t\n\tint sum =0;\n\tint carry = 0;\n\tListNode resList = new ListNode(0);\n ListNode dummy = resList;\n\twhile(l1!=null && l2!=null){\n\t\tsum = l1.val + l2.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl1=l1.next;\n\t\tl2=l2.next;\n\t}\n\twhile(l1!=null){\n\t\tsum = l1.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl1=l1.next;\n\t}\n\twhile(l2!=null){\n\t\tsum = l2.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl2=l2.next;\n\t}\n\tif(carry!=0){\n\t\tListNode newNode = new ListNode(carry);\n\t\tresList.next = newNode;\n\t}\n return dummy.next;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\t \n\t\t ListNode result = null;\n\t\t \n\t\t ListNode temp = null;\n\t\t \n\t\t int sum = 0;\n\t\t \n\t\t int carryOver = 0;\n\t\t \n\t\t while(l1 != null || l2 != null)\n\t\t {\n\t\t\t int l1Num = 0;\n\t\t\t int l2Num = 0;\n\t\t\t \n\t\t\t if(l1 != null)\n\t\t\t {\n\t\t\t\t l1Num = l1.val;\n\t\t\t\t l1 = l1.next;\n\t\t\t }\n\t\t\t \n\t\t\t if(l2 != null)\n\t\t\t {\n\t\t\t\t l2Num = l2.val;\n\t\t\t\t l2 = l2.next;\n\t\t\t }\n\t\t\t \n\t\t\t sum = carryOver + l1Num + l2Num;\n\t\t\t \n\t\t\t carryOver = sum / 10;\n\t\t\t \n\t\t\t ListNode node = new ListNode(sum % 10);\n\t\t\t \n\t\t\t if(result == null)\n\t\t\t {\n\t\t\t\t result = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t temp.next = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t if(carryOver > 0)\n\t\t {\n\t\t\t ListNode carryNode = new ListNode(carryOver);\n\t\t\t temp.next = carryNode;\n\t\t }\n\t\t // Find out the sum , have a carry over in case \n\t\t \n\t\t // create output links \n\t\t return result;\n\t }", "ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode curL1 = l1;\n ListNode curL2 = l2;\n int add = 0;\n while (curL1 != null && curL2 != null) {\n int result = 0;\n int total = curL1.val + curL2.val + add;\n if (total >= 10) {\n result = total % 10;\n add = 1;\n } else {\n result = total;\n add = 0;\n }\n curL1.val = result;\n if (curL2.next != null && curL1.next == null) {\n curL2.next.val += add;\n curL1.next = curL2.next;\n break;\n }\n if (curL1.next != null && curL2.next == null) {\n curL1.next.val += add;\n break;\n }\n if (curL1.next == null && curL2.next == null && add == 1) {\n curL1.next = new ListNode(1);\n break;\n }\n curL1 = curL1.next;\n curL2 = curL2.next;\n }\n if (curL1 != null && curL1.next != null) {\n curL1 = curL1.next;\n }\n while (curL1 != null) {\n if (curL1.val >= 10) {\n curL1.val = curL1.val % 10;\n if (curL1.next == null) {\n curL1.next = new ListNode(1);\n curL1 = curL1.next;\n } else {\n curL1 = curL1.next;\n curL1.val += 1;\n }\n\n } else {\n break;\n }\n }\n return l1;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode iter1=l1,iter2=l2,newHead=new ListNode(0),newTail;\n newTail=newHead;\n int res=0;\n int addition=0;\n while(l1!=null || l2!=null){\n int temp;\n if(l1==null){\n temp=l2.val+addition;\n l2=l2.next;\n }\n else if(l2==null){\n temp=l1.val+addition;\n l1=l1.next;\n }\n else{\n temp=l1.val+l2.val+addition;\n l1=l1.next;\n l2=l2.next;\n }\n addition=temp/10;\n temp=temp%10;\n newTail.next=new ListNode(temp);\n newTail=newTail.next;\n }\n if(addition!=0){\n newTail.next=new ListNode(addition);\n }\n return newHead.next;\n \n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2){\r\n\t\tint sum=0,carry=0;\r\n\t\tListNode prebefore=new ListNode(0),run=prebefore;\r\n\t\twhile(!(l1==null && l2 ==null && carry==0)){\r\n\t\t\tsum=(l1==null?0:l1.val)+(l2==null?0:l2.val)+carry;\r\n\t\t\tcarry=sum/10;\r\n\t\t\trun.next=new ListNode(sum%10);\r\n\t\t\trun=run.next;\r\n\t\t\tl1=(l1==null?null:l1.next);\r\n\t\t\tl2=(l2==null?null:l2.next);\r\n\t\t\t\r\n\t\t}\r\n\t\tListNode res=prebefore.next;//and it is better to delete the prebefore node\r\n\t\tprebefore=null;\r\n\t\treturn res;\r\n\t}", "public static Node addStraightNumbersHelper(Node num1,Node num2){\n if(num1 == null){\n return null;\n }\n int carry = 0;\n Node result = addStraightNumbersHelper(num1.next,num2.next);\n if(result!=null) {\n carry = result.value / 10;\n result.value = result.value % 10;\n }\n Node superResult = new Node(num1.value+num2.value+carry);\n superResult.next=result;\n return superResult;\n\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n \tint sum = 0;\n \tListNode l3 = new ListNode(0);\n \tListNode l = l3;\n \twhile (l1 != null || l2 != null || sum != 0) {\n \t\tif (l1 != null && l2 != null) {\n \t\t\tsum = l1.val + l2.val + sum;\n \t\t\tl1 = l1.next;\n \t\t\tl2 = l2.next;\n \t\t} else if (l2 != null) {\n \t\t\tsum = l2.val + sum;\n \t\t\tl2 = l2.next;\n \t\t} else if (l1 != null) {\n \t\t\tsum = l1.val + sum;\n \t\t\tl1 = l1.next;\n \t\t}\n \t\tint val;\n \t\tif (sum > 9) {\n \t\t\tval = sum % 10;\n \t\t\tsum = sum/10;\n \t\t} else {\n \t\t\tval = sum;\n \t\t\tsum = 0;\n \t\t}\n \t\tl3.next = new ListNode (val);\n \t\tl3 = l3.next;\n \t}\n return l.next;\n }", "public static ListNode addTwoNumbersHelper(ListNode l1, ListNode l2, int carry) {\n // If both lists are null and carry is 0, then return 0.\n if(l1 == null && l2 == null && carry == 0){\n return null;\n }\n\n // Initialize value\n int value = carry;\n\n // Add both list node values if exists\n if(l1 != null){\n value += l1.val;\n }\n if(l2 != null){\n value += l2.val;\n }\n\n // Calculate the remainder and carry\n int rem = value % 10;\n carry = value / 10;\n\n // Create the result head node of the list\n ListNode resultNode = new ListNode(rem);\n\n // Set the next node if exists, using recursion\n if(l1 != null || l2 != null){\n ListNode nextNode = addTwoNumbersHelper( (l1 == null ? null : l1.next), (l2 == null ? null : l2.next), carry);\n resultNode.next = nextNode;\n }\n\n // Return the head of the list\n return resultNode;\n }", "public static void main(String[] args) {\n\t\tString s1 = \"9999\", s2 = \"999\";\n\t\tListNode l1 = new ListNode(0), l2 = new ListNode(0), cur = l1;\n\t\tint i;\n\t\tfor (i = s1.length() - 1, cur = l1; i >= 0; i --, cur = cur.next)\n\t\t\tcur.next = new ListNode((int) s1.charAt(i) - (int) '0');\n\t\tfor (i = s2.length() - 1, cur = l2; i >= 0; i --, cur = cur.next)\n\t\t\tcur.next = new ListNode((int) s2.charAt(i) - (int) '0');\n\t\tfor (cur = l1.next; cur != null; cur = cur.next)\n\t\t\tSystem.out.printf(\"%d\", cur.val);\n\t\tSystem.out.println(\" (l1)\");\n\t\tfor (cur = l2.next; cur != null; cur = cur.next)\n\t\t\tSystem.out.printf(\"%d\", cur.val);\n\t\tSystem.out.println(\" (l2)\");\n\t\tListNode sum = new Solution().addTwoNumbers(l1.next, l2.next);\n\t\tfor (cur = sum; cur != null; cur = cur.next)\n\t\t\tSystem.out.printf(\"%d\", cur.val);\n\t\tSystem.out.println(\" (sum)\");\n\t}", "public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n return addTwoNumbersHelper(l1, l2, 0);\n }", "public static MyLinkedList add(MyLinkedList list1, MyLinkedList list2){\n //first reverse both the list, so that unit place can come to head\n list1.reverse();\n list2.reverse();\n MyLinkedList resposne = new MyLinkedList();\n int carry = 0;\n Node cursor1 = list1.head;\n Node cursor2 = list2.head;\n while(cursor1 != null || cursor2 != null) {\n\n int sum = carry ;\n if(cursor1!=null){\n sum += cursor1.data;\n cursor1 = cursor1.next;\n }\n\n if(cursor2!=null) {\n sum += cursor2.data;\n cursor2 = cursor2.next;\n }\n\n carry = sum / 10;\n resposne.insert(sum % 10);\n\n }\n //very important to remember\n if(carry!=0){\n resposne.insert(carry);\n }\n\n resposne.reverse();\n return resposne;\n }", "public static LinkedList sumTwoLinkedLists(LinkedList LL1, LinkedList LL2) {\n\n int multiplier = 1;\n int total = 0;\n\n LinkedList.Node currNodeLL1 = LL1.head;\n\n while (currNodeLL1 != null) {\n int subtotal = multiplier * currNodeLL1.data;\n total += subtotal;\n multiplier *= 10;\n currNodeLL1 = currNodeLL1.next;\n }\n\n LinkedList.Node currNodeLL2 = LL2.head;\n\n multiplier = 1;\n\n while (currNodeLL2 != null) {\n int subtotal = multiplier * currNodeLL2.data;\n total += subtotal;\n multiplier *= 10;\n currNodeLL2 = currNodeLL2.next;\n }\n\n String totalString = Integer.toString(total);\n\n System.out.println(totalString);\n\n int lenTotal = totalString.length();\n\n// Initiate the new linked list, with the data of the head node being the last digit in the total\n// that we've calculated.\n\n LinkedList LLsum = new LinkedList(getIntAt(total, lenTotal - 1));\n\n// Add the other nodes in turn, going backwards through the digits of the total.\n\n for (int i = lenTotal - 2; i >= 0; i--) {\n LLsum.appendToTail(getIntAt(total, i));\n }\n\n return LLsum;\n }", "public ListNode addTwoH(ListNode num1, ListNode num2, boolean carry) {\n // Base Case: both numbers empty, check for carried value\n if(num1 == null && num2 == null) {\n return carry ? new ListNode(1) : null;\n }\n // One number has terminated, call addOneH\n if(num1 == null) {\n return carry ? addOneH(num2, carry) : num2;\n }\n if(num2 == null) {\n return carry ? addOneH(num1, carry) : num1;\n }\n\n // Both numbers still contain values\n int sum = num1.val + num2.val + (carry ? 1 : 0);\n ListNode result = new ListNode(sum % 10);\n // Recursive call for next digit place\n result.next = addTwoH(num1.next, num2.next, sum > 9);\n return result;\n }", "public static void main(String[] args) {\n\t\t// 987 + 12 = 789 + 21=> 810 -> 018\n\t\tListNode head1 = new ListNode(0);\n//\t\thead1 = head1.insert(4);\n//\t\thead1 = head1.insert(2);\n\n\t\tListNode head2 = new ListNode(1);\n//\t\thead2 = head2.insert(6);\n//\t\thead2 = head2.insert(5);\n\n\t\tListNode output = addTwoNumbers(head1, head2);\n\t\t// ListNode toReturn = reverseList(output);\n\t\tSystem.out.println(output);\n\t}", "public static void main(String[] args) {\n\n ListNode l1 = new ListNode(5);\n// l1.next = new ListNode(8);\n// l1.next.next = new ListNode(3);\n//\n ListNode l2 = new ListNode(5);\n// l2.next=new ListNode(6);\n// l2.next.next = new ListNode(4);\n addTwoNumbers(l1, l2);\n\n\n }", "public static SinglyLinkedList<Poly> addition(SinglyLinkedList.Entry<Poly> list1,\n\t\t\tSinglyLinkedList.Entry<Poly> list2) {\n\n\t\tSinglyLinkedList<Poly> ans = new SinglyLinkedList();\n\t\twhile (list1 != null && list2 != null) {\n\t\t\tPoly p = new Poly(0, 0);\n\t\t\tPoly p1 = list1.element;\n\t\t\tPoly p2 = list2.element;\n\t\t\tif (p1.pow == p2.pow) {\n\t\t\t\tp.pow = p1.pow;\n\t\t\t\tp.num = p1.num + p2.num;\n\t\t\t\tlist1 = list1.next;\n\t\t\t\tlist2 = list2.next;\n\t\t\t} else if (p1.pow > p2.pow) {\n\t\t\t\tp.pow = p1.pow;\n\t\t\t\tp.num = p1.num;\n\t\t\t\tlist1 = list1.next;\n\t\t\t} else {\n\t\t\t\tp.pow = p2.pow;\n\t\t\t\tp.num = p2.num;\n\t\t\t\tlist2 = list2.next;\n\t\t\t}\n\t\t\tif (p.num != 0)\n\t\t\t\tans.add(p);\n\t\t}\n\t\twhile (list1 != null) {\n\t\t\tans.add(list1.element);\n\t\t\tlist1 = list1.next;\n\t\t}\n\t\twhile (list2 != null) {\n\t\t\tans.add(list2.element);\n\t\t\tlist2 = list2.next;\n\t\t}\n\t\treturn ans;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tListNode l1 = new ListNode(1);\r\n\t\tListNode l2 = new ListNode(8);\r\n\t\tl1.next = l2;\r\n\t\t\r\n\t\tListNode r1 = new ListNode(0);\r\n\t\t\r\n\t\tListNode r = new AddTwoNumbers().addTwoNumbers(l1,r1);\r\n\t\twhile(r.next != null) {\r\n\t\t\tSystem.out.println(r.val);\r\n\t\t\tr = r.next;\r\n\t\t}\r\n\t}", "public static LinkedList addLinkedLists(LinkedList lhs, LinkedList rhs) {\r\n\t\t// Check to see if either of the lists is null\r\n\t\tif (lhs != null && rhs == null) {\r\n\t\t\treturn lhs;\r\n\t\t} else if (lhs == null && rhs != null) {\r\n\t\t\treturn rhs;\r\n\t\t} else if (lhs == null && rhs == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tLinkedList result = new LinkedList();\r\n\t\tIntegerNode iter1 = lhs.getHead();\r\n\t\tIntegerNode iter2 = rhs.getHead();\r\n\r\n\t\tint sum = 0;\r\n\t\tint carry = 0;\r\n\r\n\t\twhile (iter1 != null && iter2 != null) {\r\n\t\t\tsum = iter1.getData() + iter2.getData() + carry;\r\n\t\t\tcarry = sum / 10;\r\n\t\t\tsum = sum % 10;\r\n\r\n\t\t\tresult.addToTail(new IntegerNode(sum));\r\n\t\t\titer1 = iter1.getNext();\r\n\t\t\titer2 = iter2.getNext();\r\n\t\t}\r\n\r\n\t\t// At least one of the iters is null now\r\n\t\twhile (iter1 != null) {\r\n\t\t\tsum = iter1.getData() + carry;\r\n\t\t\tcarry = sum / 10;\r\n\t\t\tsum = sum % 10;\r\n\r\n\t\t\tresult.addToTail(new IntegerNode(sum));\r\n\t\t\titer1 = iter1.getNext();\r\n\t\t}\r\n\r\n\t\twhile (iter2 != null) {\r\n\t\t\tsum = iter2.getData() + carry;\r\n\t\t\tcarry = sum / 10;\r\n\t\t\tsum = sum % 10;\r\n\r\n\t\t\tresult.addToTail(new IntegerNode(sum));\r\n\t\t\titer2 = iter2.getNext();\r\n\t\t}\r\n\r\n\t\tif (carry > 0) {\r\n\t\t\tresult.addToTail(new IntegerNode(carry));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public static void main(String[] args) {\n Node l1 = new Node(2, new Node(4, new Node(3, null)));\n Node l2 = new Node(5, new Node(6, new Node(4, null)));\n Node result = AddTwoNumbers.addTwoNumbers(l1, l2);\n while (result != null) {\n System.out.println(result.getData());\n result = result.next;\n }\n }", "public static void main(String[] args) {\n\n ListNode l1 = new ListNode(9);\n l1.next = new ListNode(9);\n ListNode l2 = new ListNode(1);\n\n Solution solution = new Solution();\n ListNode result = solution.addTwoNumbers(l1, l2);\n System.out.format(\"%s\", result.val);\n while (result.next != null) {\n result = result.next;\n System.out.format(\" -> %s\", result.val);\n }\n }", "public LLNode solveAddLinkedList(LLNode l0, LLNode l1) {\n\t\tint carry = 0;\n\t\tLLNode head = null;\n\t\tLLNode node = null;\n\n\t\tint sum = l0.val + l1.val + carry;\n\t\tcarry = sum / 10;\n\t\tsum = sum % 10;\n\t\thead = new LLNode();\n\t\thead.val = sum;\n\t\tnode = head;\n\n\t\tl0 = l0.next;\n\t\tl1 = l1.next;\n\n\t\twhile (l0 != null || l1 != null) {\n\t\t\tsum = (l0 != null ? l0.val : 0) + (l1 != null ? l1.val : 0) + carry;\n\t\t\tcarry = sum / 10;\n\t\t\tsum = sum % 10;\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = sum;\n\n\t\t\tif (l0 != null)\n\t\t\t\tl0 = l0.next;\n\t\t\tif (l1 != null)\n\t\t\t\tl1 = l1.next;\n\t\t}\n\n\t\tif (carry > 0) {\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = carry;\n\t\t}\n\n\t\treturn node;\n\t}", "public static void main(String[] args){\n System.out.println(\"Test 1: Lengths of numbers are equal\");\n int[] number1 = new int[]{2, 4, 3};\n int[] number2 = new int[]{5, 6, 4};\n // Create lists from digit arrays\n ListNode listNumber1 = createListFromDigitArray(number1);\n ListNode listNumber2 = createListFromDigitArray(number2);\n // Print contents of both lists\n printDigitListContents(listNumber1);\n printDigitListContents(listNumber2);\n // Add the lists\n ListNode listSum = addTwoNumbers(listNumber1, listNumber2);\n printDigitListContents(listSum);\n\n // Test 2: Lengths of numbers are unequal\n // (1->2->4->3) + (5->6->4) = (6->8->8->3) ... => 3421 + 465 = 3886\n System.out.println(\"Test 2: Lengths of numbers are unequal\");\n int[] number3 = new int[]{1, 2, 4, 3};\n int[] number4 = new int[]{5, 6, 4};\n // Create lists from digit arrays\n ListNode listNumber3 = createListFromDigitArray(number3);\n ListNode listNumber4 = createListFromDigitArray(number4);\n // Print contents of both lists\n printDigitListContents(listNumber3);\n printDigitListContents(listNumber4);\n // Add the lists\n ListNode listSum2 = addTwoNumbers(listNumber3, listNumber4);\n printDigitListContents(listSum2);\n }", "public Node findSumOfNumbers(Node l1, Node l2) {\n\t\tint carry =0;\n \n\t\tNode newHead = null;\n\t\tNode tempNodeForIteration=null;\n\t\tint sum=0;\n \n\t\tint count=0;\n\t\twhile(l1!=null || l2!=null)\n\t\t{\n\t\t\tcount++;\n\t\t\tsum=carry;\n\t\t\tif(l1!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l1.value;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n \n\t\t\tif(l2!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l2.value;\n\t\t\t\tl2=l2.next;\n\t\t\t}\n \n \n\t\t\tcarry=sum/10;\n\t\t\tsum=sum%10;\n\t\t\t// Check if it first node for the result\n\t\t\tif(count==1)\n\t\t\t{ \n\t\t\t\ttempNodeForIteration = new Node(sum);\n\t\t\t\tnewHead=tempNodeForIteration;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1-->5 -->7\n\t\t\t\t//tempNodeForIteration first node is =1\n\t\t\t\tNode tempSumNode=new Node(sum);\n\t\t\t\t//tempNodeForIteration second node is =5\n\t\t\t\ttempNodeForIteration.next=tempSumNode;\n\t\t\t\t//tempNodeForIteration node holding last node =5\n\t\t\t\ttempNodeForIteration=tempNodeForIteration.next;\n\t\t\t}\n \n\t\t}\n\t\tif(carry!=0)\n\t\t{\n\t\t\tNode tempNode=new Node(carry);\n\t\t\ttempNodeForIteration.next=tempNode;\n\t\t}\n\t\treturn newHead;\n\t}", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummy = new ListNode(-1), cur = dummy;\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n cur.next = l1;\n l1 = l1.next;\n } else {\n cur.next = l2;\n l2 = l2.next;\n }\n cur = cur.next;\n }\n cur.next = (l1 != null) ? l1 : l2;\n return dummy.next;\n }", "public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy,temp;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n temp=new ListNode(l1.val);\n l1=l1.next;\n }\n else{\n temp=new ListNode(l2.val);\n l2=l2.next;\n }\n curr.next=temp;\n curr=curr.next;\n }\n while(l1!=null){\n curr.next=new ListNode(l1.val);\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=new ListNode(l2.val);\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public static void twoSum(Node x, Node y) {\n int lenX = x.getlength();\n int lenY = y.getlength();\n int lenLong = Math.max(lenX, lenY);\n Node result = new Node();\n int carryOn = 0;\n\n for (int i = 0; i < lenLong; i++) {\n int curposX = lenX - i - 1;\n int curposY = lenY - i - 1;\n int digitX = 0;\n int digitY = 0;\n if (curposX < 0) {\n digitX = 0;\n } else {\n digitX = x.get(curposX);\n }\n if (curposY < 0) {\n digitY = 0;\n } else {\n digitY = y.get(curposY);\n }\n // System.out.printf(\"x: %d y: %d \\n\", digitX, digitY);\n result = result.add(digitX + digitY, 0);\n\n }\n // result.printList();\n result = twoSumRegulate(result);\n System.out.println(\"the two sum result is:\");\n result.printList();\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode head = new ListNode(0);\n ListNode l3 = head;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n l3.next = l1;\n l1 = l1.next;\n } else {\n l3.next = l2;\n l2 = l2.next;\n }\n l3 = l3.next;\n }\n\n while (l1 != null) {\n l3.next = l1;\n l1 = l1.next;\n l3 = l3.next;\n }\n\n while (l2 != null) {\n l3.next = l2;\n l2 = l2.next;\n l3 = l3.next;\n }\n return head.next;\n }", "public static void main(String[] args) {\n// ListNode listNode = linkedList.reverseList(linkedList.getHead());\n// linkedList.setHead(listNode);\n// linkedList.list();\n LinkedList list1 = new LinkedList();\n LinkedList list2 = new LinkedList();\n list1.add(2);\n list1.add(4);\n list1.add(3);\n\n list2.add(5);\n list2.add(6);\n list2.add(4);\n\n ListNode listNode = list1.addTwoNumbers(list1.getHead(), list2.getHead());\n System.out.println(listNode);\n\n }", "public static String addBinaryNumbers(String num1, String num2) {\r\n\t\tif (num1 == null || num2 == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tint index1 = num1.length() - 1;\r\n\t\tint index2 = num2.length() - 1;\r\n\t\tboolean carry = false;\r\n\t\tString result = \"\";\r\n\t\t\r\n\t\twhile(index1 >= 0 && index2 >= 0) {\r\n\t\t\tint sum = Integer.parseInt(num1.substring(index1, index1 + 1)) + Integer.parseInt(num2.substring(index2, index2 + 1));\r\n\t\t\tif (sum == 0) {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else if (sum == 1) {\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t} else { // sum == 2\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\telse {\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\t\tcarry = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex1--;\r\n\t\t\tindex2--;\r\n\t\t}\r\n\t\t\r\n\t\twhile(index1 >= 0) {\r\n\t\t\tif (num1.charAt(index1) == '0') {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else { // num1.charAt(index1) == '1'\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex1--;\r\n\t\t}\r\n\t\t\r\n\t\twhile(index2 >= 0) {\r\n\t\t\tif (num2.charAt(index2) == '0') {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else { // num2.charAt(index2) == '1'\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex2--;\r\n\t\t}\r\n\t\t\r\n\t\tif (carry)\r\n\t\t\tresult += '1';\r\n\t\t\r\n\t\t// reverse result string\r\n\t\tString reverseResult = \"\";\r\n\t\tfor (int i = result.length() - 1; i >= 0; i--)\r\n\t\t\treverseResult += result.charAt(i);\r\n\t\t\r\n\t\treturn reverseResult;\r\n\t}", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\r\n if (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n if (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode result=new ListNode(0);\r\n ListNode head=result;\r\n while(l1!=null&&l2!=null){\r\n \tif (l1.val<=l2.val) {\r\n\t\t\t\thead.next=l1;\r\n\t\t\t\tl1=l1.next;\r\n\t\t\t}else {\r\n\t\t\t\thead.next=l2;\r\n\t\t\t\tl2=l2.next;\r\n\t\t\t}\r\n \thead=head.next;\r\n }\r\n if (l1!=null) {\r\n\t\t\thead.next=l1;\r\n\t\t}\r\n if (l2!=null) {\r\n\t\t\thead.next=l2;\r\n\t\t}\r\n \r\n return result.next;\r\n }", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if (l1 == null || l2 == null)\n return l1 != null ? l1 : l2;\n\n ListNode dummy = new ListNode(-1);\n ListNode prev = dummy, c1 = l1, c2 = l2;\n\n while (c1 != null && c2 != null) {\n if (c1.val <= c2.val) {\n prev.next = c1;\n c1 = c1.next;\n } else {\n prev.next = c2;\n c2 = c2.next;\n }\n prev = prev.next;\n }\n\n prev.next = c1 != null ? c1 : c2;\n ListNode head = dummy.next;\n dummy.next = null; // delete dummy;\n return head;\n }", "public String addStrings(String num1, String num2) {\n int prev = 0, i = num1.length() - 1, j = num2.length() - 1;\n StringBuilder res = new StringBuilder();\n\n while (i >= 0 || j >= 0) {\n int cur = prev;\n if (i >= 0) cur += num1.charAt(i--) - '0';\n if (j >= 0) cur += num2.charAt(j--) - '0';\n prev = cur / 10;\n cur %= 10;\n res.append(cur);\n }\n if (prev != 0) res.append(prev);\n return res.reverse().toString();\n }", "public ListNode mergeTwoLists(ListNode a, ListNode b) {\r\n\t\tListNode merged = new ListNode(0);\r\n\r\n\t\tListNode first = a;\r\n\t\tListNode second = b;\r\n\t\tListNode third = merged;\r\n\r\n\t\twhile (first != null && second != null) {\r\n\t\t\tif (first.val <= second.val) {\r\n\t\t\t\tthird.next = first;\r\n\t\t\t\tfirst = first.next;\r\n\t\t\t} else {\r\n\t\t\t\tthird.next = second;\r\n\t\t\t\tsecond = second.next;\r\n\t\t\t}\r\n\t\t\tthird = third.next;\r\n\t\t}\r\n\r\n\t\tif (first != null) {\r\n\t\t\tthird.next = first;\r\n\t\t}\r\n\t\tif (second != null) {\r\n\t\t\tthird.next = second;\r\n\t\t}\r\n\r\n\t\treturn merged.next;\r\n\t}", "public static ListNode mergeTwoLists2(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n }", "public static void main(String[] args) {\n\t\tAddTwoLinkedLists list1= new AddTwoLinkedLists();\n\t\tlist1.insertNode(9);\t\t\n\t\tlist1.insertNode(9);\n\t\tlist1.insertNode(9);\n\t\t\n\t\t\n\t\t//list1.reverseLinkedList();\n\t\t\n\t\tAddTwoLinkedLists list2= new AddTwoLinkedLists();\n\t\tlist2.insertNode(9);\n\t\tlist2.insertNode(9);\n\t\tlist2.insertNode(9);\n\t\t\n\t\t//list2.reverseLinkedList();\n\t\t\n\t\tAddTwoLinkedLists result= new AddTwoLinkedLists();\n\n\t\tresult.head = addTwoNumbers(list1.head, list2.head, list1.size, list2.size);\n\t\tresult.printLinkedList();\n\t\t\n\t}", "public static void main(String a[]){\n TwoSumLeet s = new TwoSumLeet();\n ListNode b0=new ListNode(5);\n ListNode b1=new ListNode(6);\n ListNode b2=new ListNode(4);\n ListNode a0=new ListNode(2);\n ListNode a1=new ListNode(4);\n ListNode a2=new ListNode(3);\n a0.next=a1;\n a1.next=a2;\n b0.next=b1;\n b1.next=b2;\n\n final ListNode answ = s.addTwoNumbers(a0, b0);\n\n for (ListNode y =answ; y != null; y=y.next)\n System.out.print(y.val+\" \");\n System.out.println();\n }", "private void addTwoNumbers() {\n\t\t\n\t}", "public static String addStrings(String nums1, String nums2) {\n int i = nums1.length() - 1;\n int j = nums2.length() - 1;\n StringBuilder sb = new StringBuilder();\n int carry = 0;\n\n while (i >= 0 || j >= 0) {\n int sum = carry;\n if (i >= 0) {\n sum += nums1.charAt(i--) - '0';\n }\n if (j >= 0) {\n sum += nums2.charAt(j--) - '0';\n }\n sb.append(sum % 10);\n carry = sum / 10;\n }\n if (carry != 0) {\n sb.append(carry);\n }\n return sb.reverse().toString();\n }", "public static ListNode mergeTwoList(ListNode list1, ListNode list2){\n if (list1 == null) return list2;\n if (list2 == null) return list1;\n\n ListNode head = null;\n ListNode p = list1;\n ListNode q = list2;\n\n if (p.val <= q.val) {\n head = p;\n p = p.next;\n }\n else {\n head = q;\n q = q.next;\n }\n ListNode point = head;\n\n while (p != null && q != null){\n if (p.val <= q.val){\n point.next = p;\n p = p.next;\n\n }else {\n point.next = q;\n q = q.next;\n\n }\n point = point.next;\n }\n\n if (p == null){\n point.next = q;\n }else {\n point.next = p;\n }\n\n return head;\n }", "public static String addStrings(String num1, String num2) {\n\t\tif (num1 == null || num1.length() == 0 || num2 == null || num2.length() == 0) return null;\n char[] c1 = num1.toCharArray();\n char[] c2 = num2.toCharArray();\n int n1 = c1.length;\n int n2 = c2.length;\n \n StringBuilder sb = new StringBuilder();\n int i, j;\n int add = 0;\n for (i = n1 - 1, j = n2 - 1; i >= 0 && j >= 0; i--, j--) {\n \tint sum = (c1[i] - '0') + (c2[j] - '0') + add;\n \tsb.append(sum % 10);\n \tadd = sum / 10;\n }\n if (j > 0) {\n \tc1 = c2;\n }\n for (i = Math.max(i, j); i >= 0; i--) {\n \t\tint v = c1[i] - '0' + add;\n \t\tsb.append(v % 10);\n \t\tadd = v / 10;\n \t}\n \tif (add > 0) {\n \t sb.append(add);\n \t}\n \t\n \treturn sb.reverse().toString();\n }", "int merge(int list1, int list2) {\n\t\t\n\t\t// Get values of the lists\n\t\t\n\t\tComparable c1 = array[list1];\n\t\tComparable c2 = array[list2];\n\n\t\t// compare values\n\t\t\n\t\tint small = list1, big = list2;\n\t\tif (c1 != c2 && c1 != null && c1.compareTo(c2) > 0) {\n\n\t\t\tsmall = list2;\n\t\t\tbig = list1;\n\t\t}\n\n\t\t/*\n\t\t * If small list has no tail - set big list to be small list tail\n\t\t * If small list has tail - merge it with the big list and set result to be small list tail\n\t\t */\n\t\t\n\t\tif (next[small] == NIL)\n\t\t\tnext[small] = big;\n\t\telse\n\t\t\tnext[small] = merge(next[small], big);\n\t\t\n\t\t// return small list with new tail\n\t\t\n\t\treturn small;\n\t}", "public static void main(String[] args) {\n ListNode l1 = new ListNode(5);\n ListNode l2 = new ListNode(5);\n Solution solution = new Solution();\n StdOut.println(Tool.linkListToString(solution.addTwoNumbers(l1, l2)));\n }", "private List<Integer> merge(List<Integer> firstList, List<Integer> secondList) {\n List<Integer> resultList = new ArrayList<>();\n\n if (firstList.size() == 1 && secondList.size() == 1) {\n resultList.add(Math.min(firstList.get(0), secondList.get(0)));\n resultList.add(Math.max(firstList.get(0), secondList.get(0)));\n return resultList;\n }\n\n int firstIndex = 0;\n int secondIndex = 0;\n\n while (firstIndex < firstList.size() && secondIndex < secondList.size()) {\n if (firstList.get(firstIndex) < secondList.get(secondIndex)) {\n resultList.add(firstList.get(firstIndex));\n firstIndex++;\n } else {\n resultList.add(secondList.get(secondIndex));\n secondIndex++;\n }\n }\n\n if (firstIndex < firstList.size()) {\n for (int i = firstIndex; i < firstList.size(); i++) {\n resultList.add(firstList.get(i));\n }\n }\n\n if (secondIndex < secondList.size()) {\n for (int i = secondIndex; i < secondList.size(); i++) {\n resultList.add(secondList.get(i));\n }\n }\n\n return resultList;\n }", "public static void main(String[] args) {\n\t\tListNode l11 = new ListNode(2);\n\t\tListNode l12 = new ListNode(4);\n\t\tListNode l13 = new ListNode(3);\n\t\tl11.next = l12;\n\t\tl12.next = l13;\n\n\t\tListNode l21 = new ListNode(5);\n\t\tListNode l22 = new ListNode(6);\n\t\tListNode l23 = new ListNode(4);\n\t\tl21.next = l22;\n\t\tl22.next = l23;\n\t\tListNode ret = addTwoNumbers(l11,l21);\n\t\tdo {\n\t\t\tSystem.out.println(ret.val);\n\t\t\tret = ret.next;\n\t\t}while(ret != null);\n\t}", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummyHead = new ListNode(0);\n ListNode endOfSortedList = dummyHead;\n\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n endOfSortedList.next = l1;\n l1 = l1.next;\n } else {\n endOfSortedList.next = l2;\n l2 = l2.next;\n }\n\n endOfSortedList = endOfSortedList.next;\n }\n\n if (l1 != null) {\n endOfSortedList.next = l1;\n }\n\n if (l2 != null) {\n endOfSortedList.next = l2;\n }\n\n return dummyHead.next;\n }", "public static void main(String[] args) {\n\t\tint[] p = { 9 };\n\t\tint[] q = { 1, 9, 9, 9, 9, 9, 9, 9, 9, 9 };\n\t\tListNode l = new ListNode(2);\n\t\tListNode pp = l;\n\t\tListNode l2 = new ListNode(2);\n\t\tListNode pp2 = l2;\n\n\t\tfor (int i : p) {\n\t\t\tl.next = new ListNode(i);\n\t\t\tl = l.next;\n\t\t}\n\t\tfor (int i : q) {\n\t\t\tl2.next = new ListNode(i);\n\t\t\tl2 = l2.next;\n\t\t}\n\n\t\taddTwoNumbers(pp.next, pp2.next);\n\n\t}", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n\t\t//The base condition if one of the list is empty so then return the other list as it is.\n\t\tif (l1 == null) return l2;\n\t\tif (l2 == null) return l1;\n\t\t//Intializing the head of the ans\n\t\tListNode ans = l1;\n\t\tif (l2.val < l1.val) {\n\t\t\tans = l2;\n\t\t\tl2 = l2.next;\n\t\t} else l1 = l1.next;\n\t\t//Initializing ans in another variable so that it should'nt get lost.\n\t\tListNode ans2 = ans;\n\t\twhile (l1 != null && l2 != null) {\n\t\t\tif (l1.val <= l2.val) {\n\t\t\t\tans.next = l1;\n\t\t\t\tl1 = l1.next;\n\t\t\t\tans = ans.next;\n\t\t\t} else {\n\t\t\t\tans.next = l2;\n\t\t\t\tl2 = l2.next;\n\t\t\t\tans = ans.next;\n\t\t\t}\n\t\t}\n\t\t//if list are not same then one list will be left to traverse\n\t\tif (l1 == null && l2 != null) ans.next = l2;\n\t\tif (l2 == null && l1 != null) ans.next = l1;\n\t\treturn ans2;\n\t}", "private static BigInteger forceAdd(BigInteger first, BigInteger second) {\n\t\tBigInteger i = new BigInteger();\n\t\tint sign1 = first.sign(), sign2 = second.sign();\n\t\ti.front = new DigitNode(0, null); // dummy\n\t\tfor(DigitNode n1 = first.front, n2 = second.front, n = i.front; n1 != null || n2 !=null; n = n.next) {\n\t\t\tint value = 0;\n\t\t\tif (n1 != null) {\n\t\t\t\tvalue += n1.digit*sign1;\n\t\t\t\tn1 = n1.next;\n\t\t\t}\n\t\t\tif (n2 != null) {\n\t\t\t\tvalue += n2.digit*sign2;\n\t\t\t\tn2 = n2.next;\n\t\t\t}\n\t\t\tn.next = new DigitNode(value, null);\n\t\t\tif (value != 0) i.negative = (value < 0);\n\t\t\ti.numDigits++;\n\t\t}\n\t\ti.front = i.front.next; //skip the dummy\n\t\treturn i;\n\t}", "public static Node twoSumRegulate(Node n) {\n int len = n.getlength();\n for (int i = 0; i < len; i++) {\n int curpos = len - i - 1;\n int curvalue = n.get(curpos);\n\n if (curvalue > 9) {\n if (curpos == 0) {\n n.set(curpos, curvalue - 10);\n n = n.add(1, 0);\n } else {\n n.set(curpos, curvalue - 10);\n n.set(curpos - 1, n.get(curpos - 1) + 1);\n }\n }\n }\n return n;\n }", "public ListNode mergeTwoListsIterative(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n else{\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n }\n while(l1!=null){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public static void main(String[] args) {\n\n Node n1 = new Node(5);\n n1.next = new Node(5);\n n1.next.next = new Node(5);\n\n Node n2 = new Node(5);\n n2.next = new Node(5);\n n2.next.next = new Node(5);\n\n AddTwoNumbers addTwoNumbers = new AddTwoNumbers();\n Node result = addTwoNumbers.add(n1,n2);\n\n while(result != null){\n System.out.println(result.data);\n result = result.next;\n }\n\n }", "public StringNum add(StringNum n1, StringNum n2) {\n\t\tint emptyArr[];\n\t\ttry {\n\t\t\tString addends[] = {n1.getNumber(), n2.getNumber()};\n\t\t\tif(n1.getNumber().length() > n2.getNumber().length()) {\n\t\t\t\temptyArr = new int[n1.getNumber().length()];\n\t\t\t\tint j = 0;\n\t\t\t\tfor(int i = n1.getNumber().length()-1; i >= 0; i--) {\n\t\t\t\t\temptyArr[i] = getSumOfCol(addends, j);\n\t\t\t\t\tif(i < n1.getNumber().length()-1) {\n\t\t\t\t\t\temptyArr[i] += emptyArr[i+1]/10;\n\t\t\t\t\t\tString ans = Integer.toString(emptyArr[i+1]);\n\t\t\t\t\t\temptyArr[i+1] = Character.getNumericValue(ans.charAt(ans.length()-1));\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(n2.getNumber().length() > n1.getNumber().length()) {\n\t\t\t\temptyArr = new int[n2.getNumber().length()];\n\t\t\t\tint j = 0;\n\t\t\t\tfor(int i = n2.getNumber().length()-1; i >= 0; i--) {\n\t\t\t\t\temptyArr[i] = getSumOfCol(addends, j);\n\t\t\t\t\tif(i < n2.getNumber().length()-1) {\n\t\t\t\t\t\temptyArr[i] += emptyArr[i+1]/10;\n\t\t\t\t\t\tString ans = Integer.toString(emptyArr[i+1]);\n\t\t\t\t\t\temptyArr[i+1] = Character.getNumericValue(ans.charAt(ans.length()-1));\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\temptyArr = new int[n2.getNumber().length()+1];\n\t\t\t\tint j = 0;\n\t\t\t\tfor(int i = n2.getNumber().length()-1; i >= 0; i--) {\n\t\t\t\t\temptyArr[i+1] = getSumOfCol(addends, j);\n\t\t\t\t\tif(i < n2.getNumber().length()-1) {\n\t\t\t\t\t\temptyArr[i+1] += emptyArr[i+2]/10;\n\t\t\t\t\t\tString ans = Integer.toString(emptyArr[i+2]);\n\t\t\t\t\t\temptyArr[i+2] = Character.getNumericValue(ans.charAt(ans.length()-1));\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn new StringNum();\n\t\t}\n\t\treturn stripLeadingZeros(new StringNum(emptyArr));\n\t}", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n ListNode newList;\n\n if(l1.val < l2.val) {\n newList = l1;\n\n l1 = l1.next;\n } else {\n newList = l2;\n l2 = l2.next;\n }\n\n ListNode head = newList;\n\n while (l1 != null && l2 != null) {\n if(l1.val < l2.val) {\n newList.next = l1;\n newList = newList.next;\n l1 = l1.next;\n } else {\n newList.next = l2;\n newList = newList.next;\n l2 = l2.next;\n }\n }\n\n if(l1 == null){\n newList.next = l2;\n } else {\n newList.next = l1;\n }\n\n return head;\n }", "public static int twoNumbers(int a, int b) {\n if ( a == b) {\n return ((a+2)+(b+2));\n }\n else {\n return ((a+1)+(b+1));\n }\n\n }", "public static List<Integer> merge2(List<Integer> left, List<Integer> right) {\n ArrayList<Integer> result = new ArrayList<>();\n int leftIndex = 0;\n int rightIndex = 0;\n\n while (leftIndex < left.size() && rightIndex < right.size()) {\n if (left.get(leftIndex) < right.get(rightIndex)) {\n result.add(left.get(leftIndex));\n leftIndex++;\n } else {\n result.add(right.get(rightIndex));\n rightIndex++;\n }\n }\n List<Integer> leftRemaining = left.subList(leftIndex, left.size());\n List<Integer> rightRemaining = right.subList(rightIndex, right.size());\n\n result.addAll(leftRemaining);\n result.addAll(rightRemaining);\n\n return result;\n }", "public static MySimpleLinkedList orderList(MySimpleLinkedList list1,\n\t\t\tMySimpleLinkedList list2) {\n\t\t\n\t\tMySimpleLinkedList aux = new MySimpleLinkedList();\n\t\t\n\t\tIteratorMySimpleLinkedList it1 = list1.iterator();\n\t\tIteratorMySimpleLinkedList it2 = list2.iterator();\n\t\t\n\t\tint val1, val2;\n\t\t\n\t\twhile(it1.hasNext() && it2.hasNext()) {\n\t\t\t\n\t\t\tval1 = (int) it1.get();\n\t\t\tval2 = (int) it2.get();\n\t\t\t\n\t\t\tif(val1 == val2) {\n\t\t\t\taux.insertLast(val1);\n\t\t\t\tit1.next();\n\t\t\t\tit2.next();\n\t\t\t}else if(val1 < val2) {\n\t\t\t\tit1.next();\n\t\t\t}else {\n\t\t\t\tit2.next();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn aux;\n\t}", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n\n ListNode head = null;\n ListNode current = null;\n while(l1 != null && l2 != null) {\n\n if(l1.val < l2.val) {\n if(head == null) {\n head = current = l1;\n } else {\n current.next = l1;\n current = current.next;\n }\n l1 = l1.next;\n } else {\n if(head == null) {\n head = current = l2;\n } else {\n current.next = l2;\n current = current.next;\n }\n l2 = l2.next;\n }\n }\n\n if(l1 == null) {\n current.next = l2;\n }\n\n if(l2 == null) {\n current.next = l1;\n }\n\n return head;\n }", "public static void main(String[] args) {\n\t\tListNode h1 = new ListNode(2);\n\t\tListNode h2 = new ListNode(1);\n\t\tListNode re = mergeTwoLists(h1,h2);\n\t\tSystem.out.println(re.val);\n\t\tSystem.out.println(re.next.val);\n\t}", "public static void main(String[] args) {\n\t\tLinkedListOperation<Integer> opr1 = new LinkedListOperation<>();\r\n\t\tLinkedListOperation<Integer> opr2 = new LinkedListOperation<>();\r\n\t\t\r\n\t\tNode<Integer> node1 = new Node<>(1);\r\n\t\tNode<Integer> node2 = new Node<>(2);\r\n\t\tNode<Integer> node3 = new Node<>(3);\r\n\t\tNode<Integer> node4 = new Node<>(4);\r\n\t\tNode<Integer> node5 = new Node<>(5);\r\n\t\tNode<Integer> node6 = new Node<>(6);\r\n\t\t\r\n\t\topr1.addInLast(node1);\r\n\t\topr1.addInLast(node2);\r\n\t\topr1.addInLast(node3);\r\n\t\topr1.addInLast(node4);\r\n\t\topr1.addInLast(node5);\r\n\t\topr1.addInLast(node6);\r\n\t\t\r\n\t\topr2.addInLast(node1);\r\n\t\topr2.addInLast(node2);\r\n\t\topr2.addInLast(node3);\r\n\t\topr2.addInLast(node4);\r\n\t\topr2.addInLast(node5);\r\n\t\topr2.addInLast(node6);\r\n\t\t\r\n\t\topr1.reverse();\r\n\t\topr1.print();\r\n\t\tSystem.out.println(\"*********\");\r\n\t\topr2.reverse();\r\n\t\topr2.print();\r\n\t\t\r\n\t\t\r\n\t\t//add(opr1.start,opr2.start);\r\n\t}", "public static ListNode mergeSortedList(ListNode headOne, ListNode headTwo){\n\t\tListNode dummy = new ListNode(-1);\n\t\tListNode current = dummy;\n\t\t\n\t\twhile(headOne != null && headTwo != null){\n\t\t\tif(headOne.value < headTwo.value){\n\t\t\t\tcurrent.next = headOne;\n\t\t\t\theadOne = headOne.next;\n\t\t\t}else{\n\t\t\t\tcurrent.next = headTwo;\n\t\t\t\theadTwo = headTwo.next;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif(headOne != null){\n\t\t\tcurrent.next = headOne;\n\t\t}else{\n\t\t\tcurrent.next = headTwo;\n\t\t}\n\t\t\n\t\treturn current.next;\n\t}", "public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n final ListNode vituralHead = new ListNode(0);\n vituralHead.next = list1;\n\n ListNode cursor = vituralHead;\n int index = 0;\n\n ListNode aNode = null;\n ListNode bNode = null;\n while (cursor != null) {\n\n if (index == a) {\n aNode = cursor;\n }\n\n if (index == b + 1) {\n bNode = cursor;\n break;\n }\n\n index++;\n cursor = cursor.next;\n }\n\n ListNode tailOfList2 = list2;\n while (tailOfList2.next != null) {\n tailOfList2 = tailOfList2.next;\n }\n\n aNode.next = list2;\n tailOfList2.next = bNode.next;\n return vituralHead.next;\n }", "public List<Integer> merge(List<Integer> S1, List<Integer> S2) {\n\t\tList<Integer> S = new ArrayList<Integer>();\n\t\twhile(!(S1.isEmpty() || S2.isEmpty())){\n\t\t\tif(comps(S1.get(0), S2.get(0)) && S1.get(0) < S2.get(0)) {\t\t\t\t\t\n\t\t\t\tS.add(S1.remove(0));\n\t\t\t} else {\n\t\t\t\tS.add(S2.remove(0));\n\t\t\t}\n\t\t}\n\t\twhile(!(S1.isEmpty())){\n\t\t\tS.add(S1.remove(0));\n\t\t}while(!(S2.isEmpty())){\n\t\t\tS.add(S2.remove(0));\n\t\t}\n\t\treturn S;\n\t}", "public static String add(String num1,String num2)\n\t{\n\t\t\n\t\tString num3=\"\";\n\t\tint res, carry=0;\n\t\t\n\t\t\n\t\t//appending zeros to num1 if length of num1 is less\n\t\tif(num1.length()<num2.length())\n\t\t{\n\t\t\tint n=num2.length()-num1.length();\n\t\t\twhile(n!=0)\n\t\t\t{\n\t\t\t\tnum1=\"0\"+num1;\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//appending zeros to num2 if length of num2 is less\n\t\telse if(num2.length()<num1.length())\n\t\t{\n\t\t\tint n=num1.length()-num2.length();\n\t\t\twhile(n!=0)\n\t\t\t{\n\t\t\t\tnum2=\"0\"+num2;\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//running the loop till strings are not null\n\t\twhile(num1.length()!=0)\n\t\t{\n\t\t\t\n\t\t\tchar c1=num1.charAt(num1.length()-1);\n\t\t\tchar c2=num2.charAt(num2.length()-1);\n\t\t\t\n\t\t\t//convert c1 and c2 into integer and then add\n\t\t\tres=Integer.parseInt(\"\"+c1)+ Integer.parseInt(\"\"+c2)+carry;\t\t\n\t\t\t\n\t\t\t//if we get a 2 digit number after addition then breaking the carry and storing the units part\n\t\t\tif(res/10!=0)\n\t\t\t{\n\t\t\t\tnum3=(res%10)+num3;\n\t\t\t\tcarry=res/10;\n\t\t\t}\n\t\t\t\n\t\t\telse\t\n\t\t\t{\n\t\t\t\tnum3=res+num3;\t\n\t\t\t\tcarry=0;\n\t\t\t}\n\t\t\n\t\t\t//truncating the last digit of num1 and num2\n\t\t\tnum1=num1.substring(0,num1.length()-1);\n\t\t\tnum2=num2.substring(0,num2.length()-1);\n\t\t}\n\t\t\n\t\tif(carry!=0)\n\t\tnum3=carry+num3;\n\t\t//System.out.println(\"num3= \"+num3);\n\t\treturn num3;\n\t}", "public static ListNode merge2(ListNode l1,ListNode l2){\n if(l1==null) return l2;\n if(l2==null) return l1;\n if(l1.getVal()<l2.getVal()){\n l1.next=merge2(l1.next,l2);\n return l1;\n }else{\n l2.next=merge2(l1,l2.next);\n return l2;\n }\n }", "public void add(LinkedListInt other) {\nthis.size += other.size;\nNode current = head;\nif(head == null) {\nhead = other.head;\nreturn;\n}\nwhile(current.next != null)\ncurrent = current.next;\ncurrent.next = other.head;\n}", "public static void main(String[] args) {\n// link.deleteAtIndex(1);\n// System.out.println(link.get(1));\n\n ListNode l1 = new ListNode(3);\n l1.add(9).add(9).add(9).add(9).add(9).add(9).add(9).add(9).add(9);\n ListNode l2 = new ListNode(7);\n N445TwoNumSum2 su = new N445TwoNumSum2();\n su.addTwoNumbers(l1,l2);\n }", "public static LinkedList.LL merge(LinkedList.LL ll1, LinkedList.LL ll2) {\n LinkedList.Node n1 = ll1.head;\n LinkedList.Node n2 = ll2.head;\n LinkedList.Node prev = null;\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n ll2.print();\n while (n1.next != null || n2 != null) {\n if (n1.data <= n2.data && n1.next != null) {\n prev = n1;\n n1 = n1.next;\n } else if (n1.data > n2.data) {\n if (prev != null) {\n prev.next = n2;\n } else {\n ll1.head = n2;\n }\n LinkedList.Node next = n2.next;\n n2.next = n1;\n prev = n2;\n n2 = next;\n } else if (n1.next == null) {\n n1.next = n2;\n break;\n }\n }\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n System.out.println(\"-------------------------------------------------\"); \n return ll1;\n }", "public void swapNodes(int data1, int data2) {\n\t\tif(head == null || size == 1) {\n\t\t\tSystem.out.println(\"List is empty or only one node present!!\");\n\t\t\treturn;\n\t\t}\n\t\tNode node1 = null;\n\t\tNode node1Prev = null;\n\t\tNode node2 = null;\n\t\tNode node2Prev = null;\n\t\tNode start = head;\n\t\tif(start.data == data1) {\n\t\t\tnode1Prev = null;\n\t\t\tnode1 = start;\n\t\t}\n\t\tif(start.data == data2) {\n\t\t\tnode2Prev = null;\n\t\t\tnode2 = start;\n\t\t}\n\t\twhile(start.next != null) {\n\t\t\tif(start.next.data == data1) {\n\t\t\t\tnode1Prev = start;\n\t\t\t\tnode1 = start.next;\n\t\t\t}\n\t\t\tif(start.next.data == data2) {\n\t\t\t\tnode2Prev = start;\n\t\t\t\tnode2 = start.next;\n\t\t\t}\n\t\t\tstart = start.next;\n\t\t}\n\n\t\tif(node1 != null && node2 != null) {\n\t\t\tif(node1Prev == null) {\n\t\t\t\thead = node2;\n\t\t\t}\n\t\t\tif(node2Prev == null) {\n\t\t\t\thead = node1;\n\t\t\t}\n\t\t\tNode tempNext = node2.next;\n\t\t\tif(node1Prev != null)\n\t\t\t\tnode1Prev.next = node2;\n\t\t\tnode2.next = node1.next;\n\n\t\t\tif(node2Prev != null)\n\t\t\t\tnode2Prev.next = node1;\n\t\t\tnode1.next = tempNext;\n\t\t}\n\t}", "public static int getSum(int b, int n1, int n2) {\n int carry = 0;\r\n int pos = 1;\r\n int num = 0;\r\n while (n1 != 0 || n2 != 0 || carry != 0) {\r\n int a = n1 % 10;\r\n int d = n2 % 10;\r\n int c = a + d + carry;\r\n \r\n // if (c >= b)\r\n // c = c % b;\r\n carry = c/ b;\r\n c=c%b;\r\n num = num + pos * (c);\r\n \r\n pos *= 10;\r\n n1 /= 10;\r\n n2 /= 10;\r\n }\r\n\r\n return num;\r\n }", "Node merge(Node first, Node second) {\n // If first linked list is empty\n if (first == null) {\n return second;\n }\n \n // If second linked list is empty\n if (second == null) {\n return first;\n }\n \n // Pick the smaller value\n if (first.data < second.data) {\n first.next = merge(first.next, second);\n first.next.prev = first;\n first.prev = null;\n return first;\n } else {\n second.next = merge(first, second.next);\n second.next.prev = second;\n second.prev = null;\n return second;\n }\n }", "public static List<Integer> multiply(List<Integer> a1, List<Integer> a2) {\n if (a1.size() == 1 && a1.get(0) == 0\n || a2.size() == 1 && a2.get(0) == 0) {return Arrays.asList(0);}\n\n Integer[] arr = new Integer[a1.size() + a2.size()];\n Arrays.fill(arr, 0);\n List<Integer> res = Arrays.asList(arr);\n List<Integer> res2 = new ArrayList<>();\n\n Collections.reverse(a1);\n Collections.reverse(a2);\n\n for (int i = 0; i < a1.size(); i++) {\n for (int j = 0; j < a2.size(); j++) {\n res.set(i + j, res.get(i + j) + a1.get(i) * a2.get(i));\n res.set(i + j + 1, res.get(i + j + 1) + res.get(i + j) / 10);\n res.set(i + j, res.get(i + j) % 10);\n }\n }\n\n Collections.reverse(res);\n\n for (int i = 0; i < res.size(); i++) {\n if (res.get(i) != 0) {\n res2.add(res.get(i));\n }\n }\n\n return res2;\n }", "public ListNode mergeTwoListsRecursion(ListNode l1, ListNode l2) {\n if(l1==null)return l2;\n if(l2==null)return l1;\n if(l1.val<l2.val){\n l1.next=mergeTwoListsRecursion(l1.next,l2);\n return l1;\n }\n else{\n l2.next=mergeTwoLists(l1,l2.next);\n return l2;\n }\n }", "public static void main(String[] args) {\n\t\t\t\n\t\tLinkedList<Integer> l1 = new LinkedList<Integer>();\n\t\tLinkedList<Integer> l2 = new LinkedList<Integer>();\n\t\tl1.add(34);\n\t\tl1.add(67);\n\t\tl2.add(89);\n\t\tl2.add(45);\n\t\tl1.addAll(l2);\n\t\tSystem.out.println(l1);\n\n }", "public int addTwoNumbers(int a, int b) {\n return a + b;\n }", "public ListNode merge(ListNode left, ListNode right){\n ListNode head = new ListNode(0);\n ListNode p = head;\n while(left!=null&&right!=null){\n if(left.val<right.val){\n p.next = left;\n left = left.next;\n }\n else{\n p.next = right;\n right = right.next;\n }\n p = p.next;\n }\n if(left!=null){\n p.next = left;\n }\n if(right!=null){\n p.next = right;\n }\n // p.next=null;//不需要,原始节点会有next null信息\n return head.next;\n\n\n }", "public static void main(String[] args) {\n\t\t\t\t\r\n\t\tListNode list1 =new ListNode(1, new ListNode(2, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode list2 =new ListNode(1, new ListNode(3, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode result = new MergeTwoSortedLists().mergeTwoLists(list1, list2);\r\n\t\t\r\n\t\twhile(result!=null) {\r\n\t\t\tSystem.out.print(\" \"+result.val);\r\n\t\t\tresult=result.next;\r\n\t\t}\r\n\t\t\r\n\t}", "void merge(ListNode curr1, ListNode curr2) {\n while (curr1 != null) {\n ListNode next1 = curr1.next, next2 = curr2.next;\n curr1.next = curr2;\n if (next1 == null)\n break;\n curr2.next = next1;\n curr1 = next1;\n curr2 = next2;\n }\n }", "public static ListNode mergeSorted(ListNode l1, ListNode l2){\n \n// if(l1==null){\n// return l2;\n// }\n// \n// if(l2==null)\n// return l1;\n// \n// if(l1.val<l2.val){\n// l1.next = mergeSorted(l1.next,l2);\n// return l1;\n// }else{\n// l2.next = mergeSorted(l1,l2.next);\n// return l2;\n// }\n \t\n \tListNode dummy = new ListNode(0);\n \tListNode tail = dummy;\n \t\n \twhile(l1!=null&&l2!=null){\n \t\tif(l1.val<l2.val){\n \t\t\ttail.next = l1;\n \t\t\tl1=l1.next;\n \t\t}else{\n \t\t\ttail.next = l2;\n \t\t\tl2=l2.next;\n \t\t}\n \t\ttail = tail.next;\n \t}\n \t\n \tif(l1!=null){\n \t\ttail.next=l1;\n \t}else if(l2!=null){\n \t\ttail.next=l2;\n \t}\n \t\n \treturn dummy.next;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tListNode l1 = int2ListNode(342);\n\t\tListNode l2 = int2ListNode(465);\n\t\toutPutListNode(add(l1,l2));\n\t}", "public static void Program()\n\t{\n\t\t\n\t\tSystem.out.print(\"\\n\\n\\nEnter the first number: \");\n\t\tinput_string_1 = console.next();\n\t\t\n\t\tSystem.out.print(\"Enter the second number: \");\n\t\tinput_string_2 = console.next();\n\t\t\n\t\t// initializing the quantity of slots in the arrays~lists:\n\t\t\n\t\tinput_integerlist_1 = new int[input_string_1.length()];\n\t\tinput_integerlist_2 = new int[input_string_2.length()];\n\t\t\n\t\t// copying the strings into integer arrays, in reverse order\n\t\t// \t\t(1's digit first, to, Nth digit):\n\t\t\n\t\tfor (int count = 0; count < input_string_1.length(); count++)\n\t\t{\n\t\t\tinput_integerlist_1[count] = Character.getNumericValue(\n\t\t\t\tinput_string_1.charAt(input_string_1.length() - 1 - count));\n\t\t}\n\t\t\n\t\tfor (int count = 0; count < input_string_2.length(); count++)\n\t\t{\n\t\t\tinput_integerlist_2[count] = Character.getNumericValue(\n\t\t\t\tinput_string_2.charAt(input_string_2.length() - 1 - count));\n\t\t}\n\t\t\n\t\t// calculating and returning string of the sum of the two integer\n\t\t//\t\tarrays, and displayment:\n\t\t\n\t\tSystem.out.println(\"\\n\\n \" + input_string_1);\n\t\tSystem.out.println(\"+ \" + input_string_2);\n\t\tSystem.out.println(\"= \" + Calculate(input_integerlist_1,\n\t\t\tinput_integerlist_2) + \"\\n\");\n\t}", "Node MergeLists(Node headA, Node headB) { \n \n if(headA==null && headB==null) return null;\n if(headA==null) return headB;\n if(headB==null) return headA;\n\t\n\tNode start = new Node();\n\tNode curr = start;\n \n while(headA!=null && headB!=null) {\n if(headA.data < headB.data) {\n curr.next = headA;\n headA = headA.next;\n } else {\n curr.next = headB;\n headB = headB.next;\n }\n curr = curr.next;\n }\n \n if(headB!=null) curr.next=headB;\n if(headA!=null) curr.next=headA;\n\treturn start.next;\n}", "public static void main(String[] args) {\n\t\tListNode node1 = new ListNode(5);\n node1.next = new ListNode(6);\n node1.next.next = new ListNode(7);\n\n ListNode node2 = new ListNode(5);\n node2.next = new ListNode(6);\n node2.next.next = new ListNode(7);\n\n ListNode result = new MergeTwoSortedLists().mergeTwoLists(node1, node2);\n\t}", "public Node mergeTwoSortedLinkedList(Node h1, Node h2) {\n if (h1 == null || h2 == null) {\n return h1 != null ? h1 : h2;\n }\n Node S, P, Q;\n if (h1.data > h2.data) {\n S = h2;\n P = h1;\n Q = S.next;\n } else {\n S = h1;\n P = S.next;\n Q = h2;\n }\n Node dummyNode = new Node(S.data);\n Node current = dummyNode;\n while (P != null && Q != null) {\n if (P.data > Q.data) {\n S = Q;\n Q = Q.next;\n } else {\n S = P;\n P = P.next;\n }\n current.next = S;\n current = current.next;\n }\n Node remainingNode = (P == null) ? Q : P;\n while (remainingNode != null) {\n current.next = remainingNode;\n current = current.next;\n remainingNode = remainingNode.next;\n }\n return dummyNode;\n }", "public static SinglyLinkedList merge(SinglyLinkedList list1, SinglyLinkedList list2)\n\t{\n\t\tSinglyLinkedList list3 = new SinglyLinkedList();\n\t\tint i = 0;\n\t\tint j = 0;\n\t\twhile((i < list1.size()) && (j < list2.size()))\n\t\t{\n\t\t\tif(list1.getElementAt(i) < list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(i));\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) > list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) == list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tif(i == list1.size())\n\t\t{\n\t\t\tfor(int k = j; k < list2.size(); k++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(k));\n\t\t\t}\n\t\t}\n\t\telse if(j == list2.size())\n\t\t{\n\t\t\tfor(int l = i; l < list1.size(); l++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(l));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list3;\n\t}", "@SuppressWarnings(\"squid:S2259\")\n private void mergeInto(RootListNode<K> head, RootListNode<K> tail) {\n // if root list empty, just copy\n if (rootList.head == null) {\n rootList.head = head;\n rootList.tail = tail;\n return;\n }\n\n // initialize\n RootListNode<K> resultHead;\n RootListNode<K> resultTail;\n RootListNode<K> resultTailPrev = null;\n RootListNode<K> cur1 = rootList.head;\n RootListNode<K> cur2 = head;\n\n // add first node\n if (cur1.root.rank <= cur2.root.rank) {\n resultHead = cur1;\n resultTail = cur1;\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n cur1 = cur1next;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n } else {\n resultHead = cur2;\n resultTail = cur2;\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n cur2 = cur2next;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n }\n\n // merge\n int rank1; \n int rank2;\n while (true) {\n int resultRank = resultTail.root.rank;\n\n // read rank1\n if (cur1 != null) {\n rank1 = cur1.root.rank;\n } else {\n if (cur2 != null && cur2.root.rank <= resultRank) {\n rank1 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n // read rank2\n if (cur2 != null) {\n rank2 = cur2.root.rank;\n } else {\n if (cur1 != null && cur1.root.rank <= resultRank) {\n rank2 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n if (rank1 <= rank2) {\n switch (Integer.compare(rank1, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur1.root, resultTail.root);\n // remove cur1\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case -1:\n // can happen if three same ranks\n cur1next = cur1.next;\n // add before tail into result\n cur1.next = resultTail;\n resultTail.prev = cur1;\n cur1.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur1;\n } else {\n resultHead = cur1;\n }\n resultTailPrev = cur1;\n // advance cur1\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case 1:\n // append into result\n resultTail.next = cur1;\n cur1.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur1;\n // remove cur1\n cur1 = cur1.next;\n resultTail.next = null;\n if (cur1 != null) {\n cur1.prev = null;\n }\n break;\n default:\n break;\n }\n } else {\n // symmetric case rank2 < rank1\n switch (Integer.compare(rank2, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur2.root, resultTail.root);\n // remove cur2\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case -1:\n // can happen if three same ranks\n cur2next = cur2.next;\n // add before tail into result\n cur2.next = resultTail;\n resultTail.prev = cur2;\n cur2.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur2;\n } else {\n resultHead = cur2;\n }\n resultTailPrev = cur2;\n // advance cur2\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case 1:\n // append into result\n resultTail.next = cur2;\n cur2.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur2;\n // remove cur2\n cur2 = cur2.next;\n resultTail.next = null;\n if (cur2 != null) {\n cur2.prev = null;\n }\n break;\n default: \n break;\n }\n\n }\n }\n\n // record up to which point a suffix minimum update is needed\n RootListNode<K> updateSuffixFix = resultTail;\n\n // here rank of cur1 is more than result rank\n if (cur1 != null) {\n cur1.prev = resultTail;\n resultTail.next = cur1;\n resultTail = rootList.tail;\n }\n\n // here rank of cur2 is more than result rank\n if (cur2 != null) {\n cur2.prev = resultTail;\n resultTail.next = cur2;\n resultTail = tail;\n }\n\n // update suffix minimum\n updateSuffixMin(updateSuffixFix);\n\n // store final list\n rootList.head = resultHead;\n rootList.tail = resultTail;\n }", "Node merge(Node first, Node second) {\r\n\t\t// If first linked list is empty\r\n\t\tif (first == null) {\r\n\t\t\treturn second;\r\n\t\t}\r\n\r\n\t\t// If second linked list is empty\r\n\t\tif (second == null) {\r\n\t\t\treturn first;\r\n\t\t}\r\n\r\n\t\t// Pick the smaller value\r\n\t\tif (first.data < second.data) {\r\n\t\t\tfirst.next = merge(first.next, second);\r\n\t\t\tfirst.next.prev = first;\r\n\t\t\tfirst.prev = null;\r\n\t\t\treturn first;\r\n\t\t} else {\r\n\t\t\tsecond.next = merge(first, second.next);\r\n\t\t\tsecond.next.prev = second;\r\n\t\t\tsecond.prev = null;\r\n\t\t\treturn second;\r\n\t\t}\r\n\t}", "public ListNode merge(ListNode h1, ListNode h2){\r\n if(h1 == null){\r\n return h2;\r\n }\r\n if(h2 == null){\r\n return h1;\r\n }\r\n \r\n if(h1.val < h2.val){\r\n h1.next = merge(h1.next, h2);\r\n return h1;\r\n }\r\n else{\r\n h2.next = merge(h1, h2.next);\r\n return h2;\r\n }\r\n \r\n }", "public void merge(ListNode head1, ListNode head2) {\n ListNode dummy = new ListNode(0);\n \n ListNode cur = dummy;\n \n while (head1 != null && head2 != null) {\n // 注意这里容易出错。head1要先指向它的下一个,再处理head2,否则cur.next=head2这里会改掉\n // head1的指向.\n cur.next = head1;\n cur = cur.next;\n head1 = head1.next;\n \n cur.next = head2;\n cur = cur.next;\n head2 = head2.next;\n }\n \n if (head1 != null) {\n cur.next = head1;\n } else {\n cur.next = head2;\n }\n }", "static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {\n\n List<Integer> result = new ArrayList<Integer>(2);\n result.add(0, 0);\n result.add(1, 0);\n for (int i = 0; i < a.size(); i++) {\n if (a.get(i) > b.get(i)) {\n result.set(0, result.get(0) + 1);\n } else if (a.get(i) < b.get(i)) {\n result.set(1, result.get(1) + 1);\n } else if (a.get(i) == b.get(i)) {\n result.set(0, result.get(0) + 1);\n result.set(1, result.get(1) + 1);\n }\n }\n return result;\n }", "public static Node merge(Node a, Node b)\n {\n // Base cases\n if (a == null) {\n return b;\n }\n\n if (b == null) {\n return a;\n }\n\n // Pick either a or b, and recur\n if (a.data.getEmp_No() <= b.data.getEmp_No())\n {\n a.next = merge(a.next, b);\n a.next.prev = a;\n a.prev = null;\n return a;\n }\n else\n {\n b.next = merge(a, b.next);\n b.next.prev = b;\n b.prev = null;\n return b;\n }\n }", "public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }" ]
[ "0.8228967", "0.8085188", "0.8084215", "0.8047017", "0.8020531", "0.7959488", "0.7952435", "0.7896233", "0.78775126", "0.78335273", "0.7821586", "0.7787653", "0.77304214", "0.7661174", "0.75536835", "0.7492628", "0.7468531", "0.7391874", "0.7233853", "0.7177722", "0.7153308", "0.7065541", "0.6894128", "0.681271", "0.67928404", "0.6763189", "0.66982836", "0.664311", "0.6575628", "0.65658265", "0.65132535", "0.65110683", "0.6508924", "0.64918506", "0.6458585", "0.645836", "0.6413236", "0.64020604", "0.6394571", "0.6387089", "0.6374583", "0.63739175", "0.6369893", "0.6352082", "0.6352021", "0.6318194", "0.62817216", "0.62758243", "0.62754047", "0.62469715", "0.6235348", "0.6235279", "0.6228527", "0.6225698", "0.62152815", "0.6206709", "0.6176923", "0.61718905", "0.6170806", "0.61621106", "0.61559874", "0.6127262", "0.60993254", "0.60842055", "0.60072434", "0.6002126", "0.59649336", "0.5964708", "0.5957536", "0.59396374", "0.5904212", "0.5888211", "0.58640707", "0.5861878", "0.585552", "0.5848387", "0.58427864", "0.5817167", "0.58096504", "0.5809556", "0.5807641", "0.580263", "0.58008516", "0.5788945", "0.5775151", "0.5771673", "0.5767558", "0.57674575", "0.5765911", "0.57501376", "0.571322", "0.57117385", "0.56966364", "0.5686619", "0.5663358", "0.5662036", "0.5640043", "0.5627829", "0.5627438", "0.5619831" ]
0.7032648
22
Imagine a small store that has exactly one turnstile. It can be used by customers either as an entrance or an exit. Sometimes multiple customers want to pass through the turnstile and their directions can be different. The ith customer comes to the turnstile at time[i] and wants to either exit the store if direction [i] = 1 or enter the store if direction[i] = 0. Customers form 2 queues, one to exit and one to enter. They are ordered by the time when they came to the turnstile and, if the times are equal, by their indices. If one customer wants to enter the store and another customer wants to exit at the same moment, there are three cases: If in the previous second the turnstile was not used (maybe it was used before, but not at the previous second), then the customer who wants to exit goes first. If in the previous second the turnstile was used as an exit, then the customer who wants to leave goes first. If in the previous second the turnstile was used as an entrance, then the customer who wants to enter goes first. Passing through the turnstile takes 1 second. Write an algorithm to find the time for each customer when they will pass through the turnstile.
public static final int[] TurnstilePassingTimeArray ( final int[] arrivalTimeArray, final int[] directionArray) { int prevDirection = -1; int time = arrivalTimeArray[0]; int[] turnstilePassingTimeArray = new int[arrivalTimeArray.length]; java.util.TreeMap<Integer, java.util.List<Integer>> exitListMap = new java.util.TreeMap<Integer, java.util.List<Integer>>(); java.util.TreeMap<Integer, java.util.List<Integer>> entryListMap = new java.util.TreeMap<Integer, java.util.List<Integer>>(); for (int i = 0; i < arrivalTimeArray.length; ++i) { if (0 == directionArray[i]) { if (entryListMap.containsKey (arrivalTimeArray[i])) entryListMap.get (arrivalTimeArray[i]).add (i); else { java.util.List<Integer> entryIndexList = new java.util.ArrayList<Integer>(); entryIndexList.add (i); entryListMap.put (arrivalTimeArray[i], entryIndexList); } } else if (1 == directionArray[i]) { if (exitListMap.containsKey (arrivalTimeArray[i])) exitListMap.get (arrivalTimeArray[i]).add (i); else { java.util.List<Integer> exitIndexList = new java.util.ArrayList<Integer>(); exitIndexList.add (i); exitListMap.put (arrivalTimeArray[i], exitIndexList); } } } while (0 != entryListMap.size() || 0 != exitListMap.size()) { if (-1 == prevDirection || 1 == prevDirection) { boolean exitListNotEmpty = 0 != exitListMap.size(); java.util.Map.Entry<Integer, java.util.List<Integer>> firstElement = exitListNotEmpty ? exitListMap.firstEntry() : entryListMap.firstEntry(); int key = firstElement.getKey(); java.util.List<Integer> firstIndexList = firstElement.getValue(); int index = firstIndexList.get (0); firstIndexList.remove (0); if (exitListNotEmpty) { if (0 == firstIndexList.size()) exitListMap.remove (key); } else { if (0 == firstIndexList.size()) entryListMap.remove (key); } time = key > time ? key : time; prevDirection = exitListNotEmpty ? 1 : 0; turnstilePassingTimeArray[index] = time; } else if (0 == prevDirection) { boolean entryListNotEmpty = 0 != entryListMap.size(); java.util.Map.Entry<Integer, java.util.List<Integer>> firstElement = entryListNotEmpty ? entryListMap.firstEntry() : exitListMap.firstEntry(); int key = firstElement.getKey(); java.util.List<Integer> firstIndexList = firstElement.getValue(); int index = firstIndexList.get (0); firstIndexList.remove (0); if (entryListNotEmpty) { if (0 == firstIndexList.size()) entryListMap.remove (key); } else { if (0 == firstIndexList.size()) exitListMap.remove (key); } time = key > time ? key : time; prevDirection = entryListNotEmpty ? 0 : 1; turnstilePassingTimeArray[index] = time; } ++time; } return turnstilePassingTimeArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runSim(int stoppingTime)\r\n {\r\n CustomerEvent e = null;\r\n double customerserviceLength; //customer's service length\r\n //Fill the event queue with arrivals\r\n fillArrivals(stoppingTime);\r\n\r\n while(!eventSet.isEmpty())\r\n {\r\n //Remove the head of the priority queue--starts at the first customer\r\n e = eventSet.remove();\r\n //ask if the an arrival event time is past stopping time--if yes continue to next leaving event to makes sure everyone who goes into the store before the end of the day gets served\r\n if(e.what == CustomerEvent.ENTER && e.time >= stoppingTime){continue;}\r\n\r\n //if the cutsomer left, updated available Cashiers, remove from Line\r\n Customer UpcomingCustomer = null;\r\n if(e.what == CustomerEvent.LEAVE) //LEAVE\r\n {\r\n System.out.printf(\"Customer %d leaves the store at time %.2f \\n\",e.customer,e.time);\r\n availableCashiers++;\r\n Customers.get(e.customer).setdepartTime(e.time); //set the customer's departure time to be his leaving time\r\n\r\n } else if(e.what == CustomerEvent.ENTER) { //ENTER\r\n //define what it means to be a full/not full queue\r\n if(Line.size() >= 8*numCashiers)\r\n {\r\n Line.setFull();\r\n } else {\r\n Line.setnotFull();\r\n }\r\n \r\n if(!Line.isFull()){ //if the line is not full, he can join the line\r\n System.out.printf(\"Customer \" + e.customer + \" arrives at the store at time %.2f mins. He joins the line \\n\",e.time);\r\n //create customer object and add to the line/customer list\r\n Customer newCustomer = new Customer(e.customer, e.time);\r\n //add a customer to the line \r\n Line.add(newCustomer);\r\n Customers.add(newCustomer); //add to list\r\n } else {\r\n //If the line is full, the customer does not enter\r\n System.out.printf(\"Customer \" + e.customer + \" arrives at the store at time %.2f but decides not to enter-OVERFLOW! \\n\",e.time);\r\n //create a new customer and add him to the list--keep track of overdraft \r\n Customer newCustomer = new Customer(e.customer, e.time);\r\n newCustomer.setserveTime(0); //no service time \r\n newCustomer.setwaitTime(0); //no wait time\r\n newCustomer.setdepartTime(e.time); //no depart time\r\n Customers.add(newCustomer);\r\n overflowCustomers.add(newCustomer); //also add these customers to their special list\r\n }\r\n }\r\n\r\n //Poll from the line if there are available cashiers and if there are customers to poll\r\n if(Line.size()>0 && availableCashiers>0) \r\n {\r\n UpcomingCustomer = Line.poll();\r\n availableCashiers--; //the customer will go to the Cashier\r\n //calculate service time and give print out\r\n customerserviceLength = -Math.log(random.nextFloat())/serviceRate; \r\n System.out.printf(\"Customer \" + UpcomingCustomer.getCustomerNum() + \" is now at the cashier. He must be served for %.2f mins. \\n\",customerserviceLength); //print out\r\n\r\n UpcomingCustomer.setserveTime(customerserviceLength); //Set the customer's service time to to the poisson distribtution\r\n\r\n //the customer's total waiting time in the store is the time it takes for the customer to get to the cashier minus his arrival time\r\n UpcomingCustomer.setwaitTime(e.time-UpcomingCustomer.getarrivalTime()); \r\n \r\n //create a new leaving event for the customer in question (UpcomingCustomer)\r\n //the leaving time is e.time+customerserviceLength\r\n CustomerEvent leave = new CustomerEvent(UpcomingCustomer.getCustomerNum(), e.time+customerserviceLength,CustomerEvent.LEAVE);\r\n eventSet.add(leave); //add event back to the priority queue \r\n } \r\n }\r\n }", "public static void main(String[] args) {\n\r\n int x = 0;\r\n int xLanes = 0;\r\n int nLanes = 0;\r\n\r\n int[] express; //stores time taken by each customer in express lane\r\n int[] normal; // stores time taken by each customer in normal lane\r\n\r\n LinkedQueue<Customer>[] expressLine;\r\n LinkedQueue<Customer>[] normalLine;\r\n\r\n final String filename = \"src/CustomerData_Example.txt\";\r\n final String file = \"src/CustomerData.txt\";\r\n\r\n // ============= Part A ==============\r\n\r\n List results = checkout(filename);\r\n normal = (int[]) results.get(2);\r\n express = (int[]) results.get(0);\r\n\r\n expressLine = (LinkedQueue<Customer>[]) results.get(1);\r\n normalLine = (LinkedQueue<Customer>[]) results.get(3);\r\n\r\n xLanes = ((int[]) results.get(4))[0];\r\n nLanes = ((int[]) results.get(4))[1];\r\n\r\n int maxTimeLane = normal[0];\r\n int totalCheckoutLanes = 1; //counts amount of total checkout lines for display\r\n\r\n //==== EXPRESS CHECKOUT LINES ====//\r\n for (int i = 0; i < xLanes; i++) {\r\n\r\n System.out.println(\"CheckOut(Express) # \" + (totalCheckoutLanes) + \" (Est Time = \" + express[i] + \" s) =\" + expressLine[i]);\r\n totalCheckoutLanes++;\r\n\r\n if (express[i] > maxTimeLane) {\r\n maxTimeLane = express[i];\r\n }\r\n }\r\n\r\n //==== NORMAL CHECKOUT LINES ====//\r\n for (int i = 0; i < nLanes; i++) {\r\n System.out.println(\"CheckOut (Normal) # \" + (totalCheckoutLanes) + \" (Est Time = \" + normal[i] + \" s) =\" + normalLine[i]);\r\n totalCheckoutLanes++;\r\n if (normal[i] > maxTimeLane) {\r\n maxTimeLane = normal[i];\r\n }\r\n }\r\n\r\n System.out.printf(\"Time to serve all customers = %d s\\n\\n\", maxTimeLane);\r\n\r\n\r\n try {\r\n\r\n\r\n // ============= Part B ==============\r\n\r\n Scanner fin = new Scanner(new File(file));\r\n\r\n results = checkout(file);\r\n\r\n express = new int[xLanes];\r\n normal = new int[nLanes];\r\n\r\n normal = (int[]) results.get(2);\r\n express = (int[]) results.get(0);\r\n\r\n expressLine = (LinkedQueue<Customer>[]) results.get(1);\r\n normalLine = (LinkedQueue<Customer>[]) results.get(3);\r\n\r\n xLanes = ((int[]) results.get(4))[0];\r\n nLanes = ((int[]) results.get(4))[1];\r\n maxTimeLane = normal[0];\r\n\r\n for(int i = 0; i < xLanes; i++){\r\n if(express[i] > maxTimeLane)\r\n maxTimeLane = express[i];\r\n }\r\n for(int i = 0; i < nLanes; i++)\r\n if(normal[i] > maxTimeLane)\r\n maxTimeLane = normal[i];\r\n\r\n int SIMULATION_STEP = 30;\r\n\r\n System.out.printf(\"t(s)\");\r\n for (int i = 0; i < xLanes + nLanes; i++) {\r\n System.out.printf(\" Line \" + (i + 1));\r\n }\r\n System.out.println(\"\");\r\n\r\n for (int i = 0; i < expressLine.length; i++)\r\n express[i] = expressLine[i].peek().calculateTime();\r\n\r\n\r\n for (int i = 0; i < normalLine.length; i++)\r\n normal[i] = normalLine[i].peek().calculateTime();\r\n\r\n for (int i = 0; i <= maxTimeLane; i++) {\r\n for (int j = 0; j < express.length; j++) {\r\n if (express[j] == 0) {\r\n if (!expressLine[j].isEmpty())\r\n expressLine[j].dequeue();\r\n if (!expressLine[j].isEmpty())\r\n express[j] = ((expressLine[j]).peek()).calculateTime();\r\n }\r\n }\r\n\r\n for (int j = 0; j < normal.length; j++) {\r\n if (normal[j] == 0) {\r\n if (!normalLine[j].isEmpty())\r\n normalLine[j].dequeue();\r\n if (!normalLine[j].isEmpty())\r\n normal[j] = ((normalLine[j]).peek()).calculateTime();\r\n }\r\n }\r\n\r\n if ((i % SIMULATION_STEP == 0 && i > 0) || i == maxTimeLane) {\r\n System.out.printf(\"%3d\", i);\r\n for (int j = 0; j < express.length; j++) {\r\n System.out.printf(\"%10d\", expressLine[j].size());\r\n }\r\n for (int j = 0; j < normal.length; j++)\r\n System.out.printf(\"%10d\", normalLine[j].size());\r\n System.out.println(\"\");\r\n System.out.println(\"========================================= JUST FOLLOWING SOCIAL DISTANCING RULES ==========================================\");\r\n }\r\n\r\n for (int j = 0; j < express.length; j++) {\r\n if (express[j] > 0)\r\n express[j]--;\r\n }\r\n for (int j = 0; j < normal.length; j++)\r\n if (normal[j] > 0)\r\n normal[j]--;\r\n }\r\n\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"Error loading file. \" + ex.getMessage());\r\n }\r\n\r\n }", "private Obs findTrips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY, int dist_th,\n\t\t\tint time_th) {\n\t\t/**\n\t\t * Marks array contain index of the towers that represent the starting\n\t\t * observation of a new trip.\n\t\t */\n\t\tboolean[] marks = new boolean[tstamps.length];\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\t\t/**\n\t\t * add 0 as the start of the first tower in this seq.\n\t\t */\n\t\t// int mIndex = 0;\n\t\t// marks[mIndex++] = 0;\n\n\t\tint current = 0;\n\t\tfor (int i = 1; i < tstamps.length; i++) {\n\t\t\ttry {\n\t\t\t\tString tstamp = tstamps[i];\n\n\t\t\t\t/**\n\t\t\t\t * if the time exceeds timing threshold, then check the distance\n\t\t\t\t * between towers. If this distance less than the distance\n\t\t\t\t * threshold, then previous tower is the end of the current\n\t\t\t\t * trip.\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tDate sTime = formatter.parse(tstamps[current]);\n\t\t\t\tDate eTime = formatter.parse(tstamp);\n\t\t\t\tcal.setTime(sTime);\n\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tcal.setTime(eTime);\n\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tint diff = (ehour - hour) * HOUR + (eminute - minute);\n\t\t\t\t/**\n\t\t\t\t * check time difference with time threshold whatever the\n\t\t\t\t * distance between the starting tower\n\t\t\t\t */\n\t\t\t\tif (diff > time_th) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Check distance, if it distance less than distance\n\t\t\t\t\t * threshold mark the current tower as the start of a new\n\t\t\t\t\t * trip.\n\t\t\t\t\t */\n\t\t\t\t\tVertex sTower = towersXY.get(Integer.parseInt(towers[i - 1]));\n\t\t\t\t\tVertex tower = towersXY.get(Integer.parseInt(towers[i]));\n\n\t\t\t\t\tif (eculidean(sTower.getX(), tower.getX(), sTower.getY(), tower.getY()) < dist_th) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Update the trip sequences\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmarks[i] = true;\n\t\t\t\t\t\tcurrent = i;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * construct observations and time stamps\n\t\t */\n\t\tString time = \"\";\n\t\tString obs = \"\";\n\t\t// time += tstamps[0];\n\t\t// obs += towers[0];\n\t\tfor (int i = 0; i < marks.length; i++) {\n\t\t\tif (marks[i]) {\n\n\t\t\t\ttime += RLM + tstamps[i];\n\t\t\t\tobs += RLM + towers[i];\n\t\t\t} else {\n\t\t\t\t// if (towers[i].equals(towers[i - 1])) {\n\t\t\t\t// System.out.println(towers[i] + \"\\t=\\t\" + towers[i - 1]);\n\t\t\t\t// continue;\n\t\t\t\t// }\n\t\t\t\t/**\n\t\t\t\t * Add comma separators\n\t\t\t\t */\n\t\t\t\tif (!time.isEmpty()) {\n\t\t\t\t\ttime += CLM;\n\t\t\t\t\tobs += CLM;\n\t\t\t\t}\n\t\t\t\ttime += tstamps[i];\n\t\t\t\tobs += towers[i];\n\t\t\t}\n\n\t\t}\n\t\treturn new Obs(obs, time);\n\t}", "private void compareMove(int next){\n moveBuffer[0] = moveBuffer[1];//moveBuffer[0]=currentLocation,1 is next;\n moveBuffer[1] = next;\n if(moveBuffer[0]==moveBuffer[1]){\n flagbuffer0=0;\n return;\n }\n int currenti=0;int currentj=0;\n for ( int i = 0; i < 3; ++i ) {\n for ( int j = 0; j < 3; ++j ) {\n if ( maze[i][j] == moveBuffer[0] ) {\n currenti=i;\n currentj=j;\n break;// Found the correct i,j - print them or return them or whatever\n }\n }\n }\n int nexti=0;int nextj=0;\n for ( int i = 0; i < 3; ++i ) {\n for ( int j = 0; j < 3; ++j ) {\n if ( maze[i][j] == moveBuffer[1] ) {\n nexti=i;\n nextj=j;\n break;// Found the correct i,j - print them or return them or whatever\n }\n }\n }\n\n if( currenti== nexti){\n if(nextj > currentj && flagbuffer0==0){\n /*uiShowToast(\"Going right\");\n System.out.println(\"Going right\");\n this.sendCarMovement(\"R\");*/\n uiShowToast(\"Going right\");\n this.sendCarMovement(\"R\");\n try {\n Thread.sleep(550);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\"); flagbuffer0=1;\n }\n else if(nextj < currentj && flagbuffer0==0){\n uiShowToast(\"Going left\");\n this.sendCarMovement(\"L\");\n try {\n Thread.sleep(550);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\"); flagbuffer0=1;\n }\n else if(flagbuffer0==1){\n this.sendCarMovement(\"U\");\n }\n }\n if( currentj== nextj){\n if(nexti > currenti){\n /*uiShowToast(\"Going down\");\n System.out.println(\"Going down\");\n this.sendCarMovement(\"D\");*/\n uiShowToast(\"Going down\");\n flagbuffer0=0;\n this.sendCarMovement(\"L\");\n try {\n Thread.sleep(1100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\");\n\n }\n else if(nexti < currenti){\n /*uiShowToast(\"Going up\");\n System.out.println(\"Going up\");\n this.sendCarMovement(\"U\");*/\n uiShowToast(\"Going up\");\n flagbuffer0=0;\n this.sendCarMovement(\"U\");\n try {\n Thread.sleep(550);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\");\n }\n }\n /*if(movebuffer[0]==mvebuffer[1]){\n uiShowToast(\"Going up\");\n this.sendCarMovement(\"U\");\n try {\n Thread.sleep(550);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\");\n }else{\n\n }\n\n /*\n */\n /* Damon movement code\n if(moveBuffer[1] == 100 && moveBuffer[0] == 200){\n uiShowToast(\"Going left\");\n System.out.println(\"Going left\");\n this.sendCarMovement(\"L\");\n try {\n Thread.sleep(550);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n this.sendCarMovement(\"U\");\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }else{\n uiShowToast(\"Going up\");\n //Toast.makeText(getApplicationContext(), \"Going up\", Toast.LENGTH_LONG).show();\n System.out.println(\"Going up\");\n this.sendCarMovement(\"U\");\n try {\n Thread.sleep(2000);//wait 2 sec to next command;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n */\n return;\n }", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "long getTimeUntilNextTransit(Coordinates coord, long time) throws AstrometryException;", "private Vector<Vector<BusStopInfo>> findRek (BusStopInterface from, BusStopInterface to, Vector <BusStopInfo> toInfo, Vector<BusStopInfo> visited, int swaps, int transfers )\r\n {\r\n Vector<Vector<BusStopInfo>> sciezka = new Vector<Vector<BusStopInfo>>();\r\n \r\n if(from.getName()==to.getName())\r\n {\r\n sciezka.add(toInfo);\r\n return sciezka;\r\n }\r\n\r\n for(BusStopInfo vis: visited)\r\n {\r\n if(vis.awtobus.busLine.getBusStop(vis.pozycja).getName()==from.getName())\r\n return sciezka;\r\n }\r\n\r\n Vector <BusStopInfo> fromInfo = findStopInfo(from);\r\n\r\n fromInfo = infoFilter(fromInfo, toInfo);\r\n\r\n for(BusStopInfo info: fromInfo)\r\n {\r\n int swapsNow = swaps;\r\n if(visited.size()>0 && info.awtobus.bus.getBusNumber()!=visited.lastElement().awtobus.bus.getBusNumber())\r\n {\r\n swapsNow++;\r\n }\r\n\r\n if(swapsNow <= transfers)\r\n {\r\n int nextPosition = info.pozycja +1; //ide do przodu linii\r\n int prevPosition = info.pozycja -1; //ide do tyłu linii\r\n\r\n Vector<BusStopInfo> temp = new Vector<BusStopInfo>(visited);\r\n temp.add(info);\r\n Vector<Vector<BusStopInfo>> result ;\r\n if(nextPosition<info.awtobus.busLine.getNumberOfBusStops())\r\n {\r\n BusStopInterface nextStop = info.awtobus.busLine.getBusStop(nextPosition);\r\n result = findRek(nextStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n if(prevPosition >= 0)\r\n {\r\n BusStopInterface prevStop = info.awtobus.busLine.getBusStop(prevPosition);\r\n result = findRek(prevStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return sciezka;\r\n }", "long getTimeUntilNextSet(Coordinates coord, double horizon, long time) throws AstrometryException;", "@Override\r\n public Collection<OptimizedItinerary> getBestItineraryByTime(String origin, Collection<RouteNode> routes) throws OptimizedItineraryStrategyException {\r\n log.info(String.format(\"** Getting best itineraries (based on time) from %s, using Dijkstra algorithm. **\", origin));\r\n \r\n if (!isOriginPresent(routes, origin))\r\n \tthrow new OptimizedItineraryStrategyException(String.format(\"Origin city: %s is not present.\", origin));\r\n \t\r\n Set<String> allDestinations = getDestinations(routes, origin);\r\n HipsterDirectedGraph<String,Long> graph = doGraphWithTimes(routes);\r\n \r\n // call Dijkstra for the same origen and all the destinations ...\r\n Collection<OptimizedItinerary> results = allDestinations.stream()\r\n .map(destination -> doDijkstra(graph, origin, destination))\r\n .collect(Collectors.toList());\r\n \r\n return results;\r\n }", "public Obs algorithm2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * trips sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\t\ttry {\n\n\t\t\tdouble max_distance = 0;\n\t\t\tint time_diff = 0;\n\t\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (NumberFormatException numberFormatException) {\n\t\t\tSystem.err.println(\"NumberFormatException\\t\" + numberFormatException.getMessage());\n\t\t} catch (ParseException parseException) {\n\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t}\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\n\t\t}\n\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t}", "public static void main(String[] args) {\n\r\n\t\tCounter fcSecurity1 = new Counter(true);\r\n\t\tCounter ccSecurity1 = new Counter(false);\r\n\t\tCounter ccSecurity2 = new Counter(false);\r\n\t\tScanner inscan = new Scanner(System.in);\r\n\r\n\t\tLineQueue<Passenger> internationalLeaving = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> checkFirstQ = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> checkComQ = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> securityFirstQ = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> securityComQ = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> gateComQ = new LineQueue<Passenger>();\r\n\t\tdouble[] interArray = new double[2];\r\n\t\tLineQueue<Passenger> interArrival = new LineQueue<Passenger>();\r\n\t\tLineQueue<Passenger> commuterArrival = new LineQueue<Passenger>();\r\n\t\tint days = 0;\r\n\t\t/*\r\n\t\t * Get inputs from user to run simulation (days, number of desks)\r\n\t\t */\r\n\t\twhile (true) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(\"How many days to run the simulation?\");\r\n\t\t\t\tdays = inscan.nextInt();\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\tSystem.out.println(\"Incorrect input type. Please enter an integer\");\r\n\t\t\t\tinscan.next();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tdouble TIME = 60 * 60 * 24 * days;\r\n\t\tint numOfCoachAgents = 3;\r\n\t\tint numOfFirstAgents = 1;\r\n\t\tint totalAgents = 0;\r\n\t\tint checker;\r\n\t\tSystem.out.println(\"There can be a maximum of 6 desks:\");\r\n\t\tdo {\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"How many coach class check-in desks will there be? (enter 0 for default)\");\r\n\t\t\t\t\tchecker = inscan.nextInt();\r\n\t\t\t\t\tif (checker > 0) {\r\n\t\t\t\t\t\tnumOfCoachAgents = checker;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\tSystem.out.println(\"Incorrect input type. Please enter an integer\");\r\n\t\t\t\t\tinscan.next();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"How many first class check-In desks will there be? (enter 0 for default)\");\r\n\t\t\t\t\tchecker = inscan.nextInt();\r\n\t\t\t\t\tif (checker > 0) {\r\n\t\t\t\t\t\tnumOfFirstAgents = checker;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\tSystem.out.println(\"Incorrect input type. Please enter an integer\");\r\n\t\t\t\t\tinscan.next();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\ttotalAgents = numOfFirstAgents + numOfCoachAgents;\r\n\t\t\tif (totalAgents > 6) {\r\n\t\t\t\tSystem.out.println(\"You can have a maximum of 6 counters, enter new numbers\");\r\n\t\t\t}\r\n\r\n\t\t} while (totalAgents > 6);\r\n\r\n\t\tdouble curInt = 0;\r\n\t\tdouble curCom = 0;\r\n\t\t// check in counters\r\n\t\tCounter[] coachCounter = new Counter[numOfCoachAgents];\r\n\t\tCounter[] firstCounter = new Counter[numOfFirstAgents];\r\n\t\tfor (int i = 0; i < firstCounter.length; i++) {\r\n\t\t\tCounter fcCounter1 = new Counter(true);\r\n\t\t\tfirstCounter[i] = fcCounter1;\r\n\t\t}\r\n\t\tfor (int i = 0; i < coachCounter.length; i++) {\r\n\t\t\tCounter ccCounter1 = new Counter(false);\r\n\t\t\tcoachCounter[i] = ccCounter1;\r\n\t\t}\r\n\t\tint flightRate = 3600;\r\n\r\n\t\tint numberOfCoachC = 0;\r\n\t\tdouble totalCoachCheckQ = 0;\r\n\t\tdouble totalCoachCheck = 0;\r\n\t\tdouble totalCoachSecurityQ = 0;\r\n\t\tdouble totalCoachS = 0;\r\n\t\tdouble totalGate = 0;\r\n\r\n\t\tint numberOfFirst = 0;\r\n\t\tint numberOfCoachI = 0;\r\n\t\tdouble totalFirstCheckQ = 0;\r\n\t\tdouble totalFirstCheck = 0;\r\n\t\tdouble totalFirstSecurityQ = 0;\r\n\t\tdouble totalFirstSecurity = 0;\r\n\r\n\t\tint firstMissedFlight = 0;\r\n\t\tint coachMissedFlight = 0;\r\n\t\tint coachRefund = 0;\r\n\t\tint firstRefund = 0;\r\n\r\n\t\tPassenger nextCommuter = null;\r\n\t\tPassenger nextInternational = null;\r\n\r\n\t\t// keep going until timeElapsed has reached TIME running\r\n\t\twhile (timeElapsed != TIME) {\r\n\t\t\t// System.out.println(\"while\");\r\n\t\t\t/*\r\n\t\t\t * First part of the program, generating commuters that are arriving\r\n\t\t\t * to the airport, then queueing them in the appropriate check in\r\n\t\t\t * location\r\n\t\t\t * \r\n\t\t\t * \r\n\t\t\t */\r\n\r\n\t\t\t// check if commuter should be generated\r\n\t\t\tif (timeElapsed % flightRate == 1800) {\r\n\t\t\t\tcommuterArrival = makeCommuter();\r\n\t\t\t\tnextCommuter = commuterArrival.dequeue();\r\n\t\t\t\tcurCom = timeElapsed;\r\n\t\t\t} // end if\r\n\r\n\t\t\t// check if international should be generated and get the first\r\n\t\t\t// person that will arrive\r\n\t\t\tif (timeElapsed % 21600 == 0) {\r\n\t\t\t\tinterArrival = makeInter();\r\n\t\t\t\tnextInternational = interArrival.dequeue();\r\n\t\t\t\tcurInt = timeElapsed;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (nextCommuter != null && curCom - nextCommuter.arrival() <= timeElapsed) {\r\n\t\t\t\tnextCommuter.setCurrentTime(timeElapsed);\r\n\t\t\t\tg++;\r\n\t\t\t\tcheckComQ.enqueue(nextCommuter);\r\n\t\t\t\tif (!commuterArrival.isEmpty()) {\r\n\t\t\t\t\tnextCommuter = commuterArrival.dequeue();\r\n\t\t\t\t\tcurCom = timeElapsed;\r\n\t\t\t\t}\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (curInt - 21600 - nextInternational.arrival() <= timeElapsed) {\r\n\t\t\t\tge++;\r\n\t\t\t\tif (nextInternational.isFirstClass()) {\r\n\t\t\t\t\tnextInternational.setCurrentTime(timeElapsed);\r\n\t\t\t\t\tcheckFirstQ.enqueue(nextInternational);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnextInternational.setCurrentTime(timeElapsed);\r\n\t\t\t\t\tcheckComQ.enqueue(nextInternational);\r\n\t\t\t\t}\r\n\t\t\t\t// nextInternational.flightIsLeaving(curInt+(21600-nextInternational.arrival()));\r\n\t\t\t\tif (!interArrival.isEmpty()) {\r\n\t\t\t\t\tnextInternational = interArrival.dequeue();\r\n\t\t\t\t\tcurInt = timeElapsed;\r\n\t\t\t\t}\r\n\t\t\t} // end if\r\n\r\n\t\t\t/*\r\n\t\t\t * second part of the process, dequeuing from the bag line, and\r\n\t\t\t * servicing them at the bag counter\r\n\t\t\t */\r\n\r\n\t\t\t// first class counter\r\n\r\n\t\t\tfor (int i = 0; i < coachCounter.length; i++) {\r\n\t\t\t\tcheckCounter(checkComQ, securityComQ, coachCounter[i], timeElapsed);\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < firstCounter.length; i++) {\r\n\t\t\t\tcheckCounter(checkFirstQ, securityFirstQ, firstCounter[i], timeElapsed);\r\n\t\t\t}\r\n\r\n\t\t\tcheckSecurity(securityFirstQ, gateComQ, fcSecurity1, internationalLeaving);\r\n\t\t\tcheckSecurity(securityComQ, gateComQ, ccSecurity1, internationalLeaving);\r\n\t\t\tcheckSecurity(securityComQ, gateComQ, ccSecurity2, internationalLeaving);\r\n\r\n\t\t\tif (timeElapsed > 0 && timeElapsed % 3600 == 1800) {\r\n\t\t\t\tfor (int i = 0; i < 50 && !gateComQ.isEmpty(); i++) {\r\n\t\t\t\t\tPassenger gettingOn = gateComQ.dequeue();\r\n\t\t\t\t\tgettingOn.atGate(timeElapsed);\r\n\t\t\t\t\t// System.out.println(\"i: \"+i);\r\n\t\t\t\t\tnumberOfCoachC++;\r\n\t\t\t\t\ttotalCoachCheckQ = totalCoachCheckQ + gettingOn.counterQTime();\r\n\t\t\t\t\ttotalCoachCheck = totalCoachCheck + gettingOn.counterTime();\r\n\t\t\t\t\ttotalCoachSecurityQ = totalCoachSecurityQ + gettingOn.securityQTime();\r\n\t\t\t\t\ttotalCoachS = totalCoachS + gettingOn.securityTime();\r\n\t\t\t\t\ttotalGate = totalGate + gettingOn.gateTime();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\twhile (!internationalLeaving.isEmpty()) {\r\n\t\t\t\tPassenger gettingOn = internationalLeaving.dequeue();\r\n\r\n\t\t\t\tif (gettingOn.isFirstClass()) {\r\n\t\t\t\t\tnumberOfFirst++;\r\n\t\t\t\t\ttotalFirstCheckQ = totalFirstCheckQ + gettingOn.counterQTime();\r\n\t\t\t\t\ttotalFirstCheck = totalFirstCheck + gettingOn.counterTime();\r\n\t\t\t\t\ttotalFirstSecurityQ = totalFirstSecurityQ + gettingOn.securityQTime();\r\n\t\t\t\t\ttotalFirstSecurity = totalFirstSecurity + gettingOn.securityTime();\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tnumberOfCoachI++;\r\n\t\t\t\t\ttotalCoachCheckQ = totalCoachCheckQ + gettingOn.counterQTime();\r\n\t\t\t\t\ttotalCoachCheck = totalCoachCheck + gettingOn.counterTime();\r\n\t\t\t\t\ttotalCoachSecurityQ = totalCoachSecurityQ + gettingOn.securityQTime();\r\n\t\t\t\t\ttotalCoachS = totalCoachS + gettingOn.securityTime();\r\n\t\t\t\t\tif (timeElapsed > gettingOn.getFlightLeavingTime()) {\r\n\t\t\t\t\t\tcoachMissedFlight++;\r\n\t\t\t\t\t\tif (gettingOn.onTime()) {\r\n\t\t\t\t\t\t\tcoachRefund++;\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\ttimeElapsed++;\r\n\t\t} // end of while\r\n\r\n\t\t/*\r\n\t\t * print out statistics\r\n\t\t */\r\n\t\tint allCoach = numberOfCoachC + numberOfCoachI;\r\n\r\n\t\tSystem.out.println(\"There were \" + allCoach + \" coach class passengers that made it through the airport\");\r\n\t\tSystem.out.println(\r\n\t\t\t\t\"\\t\" + numberOfCoachI + \" were international fliers\\n\\t\" + numberOfCoachC + \" were commuter fliers\");\r\n\t\tSystem.out.printf(\"\\tTheir average time in the check in queue was %.2f minutes\\n\",\r\n\t\t\t\t((double) ((int) totalCoachCheckQ / allCoach) / 60));\r\n\t\tSystem.out.println(\"\\tTheir average time at the check in counter \" + (double) ((int) totalCoachCheck / allCoach)\r\n\t\t\t\t+ \" seconds\");\r\n\t\tSystem.out.println(\"\\tTheir average time in the security queue was \" + (int) (totalCoachSecurityQ / allCoach)\r\n\t\t\t\t+ \" seconds\");\r\n\t\tSystem.out.println(\"\\tTheir average time in security was \" + (int) (totalCoachS / allCoach) + \" seconds\");\r\n\r\n\t\tSystem.out\r\n\t\t\t\t.println(\"\\nTheir were \" + numberOfFirst + \" first class passengers that made it through the airport \");\r\n\t\tSystem.out.printf(\"\\tTheir average time in the check in queue was %.2f minutes\\n\",\r\n\t\t\t\t((double) ((int) totalFirstCheckQ / numberOfFirst) / 60));\r\n\t\tSystem.out.println(\"\\tTheir average time at the check in counter \"\r\n\t\t\t\t+ (double) ((int) totalFirstCheck / numberOfFirst) + \" seconds\");\r\n\t\tSystem.out.println(\"\\tTheir average time in the security queue was \"\r\n\t\t\t\t+ (int) (totalFirstSecurityQ / numberOfFirst) + \" seconds\");\r\n\t\tSystem.out.println(\r\n\t\t\t\t\"\\tThere average time in security was \" + (int) (totalFirstSecurity / numberOfFirst) + \" seconds\\n\");\r\n\r\n\t\tSystem.out\r\n\t\t\t\t.println(firstMissedFlight + \" first class passengers missed flights \" + firstRefund + \" got a refund\");\r\n\t\tSystem.out\r\n\t\t\t\t.println(coachMissedFlight + \" coach class passengers missed flights \" + coachRefund + \" got a refund\");\r\n\t\tSystem.out.println(\"There were \" + totalAgents + \" agents, making a total of \" + totalAgents * days * 24 * 25);\r\n\t\tSystem.out.println(\"The airport made $\" + 500 * numberOfCoachI + \" from coach class international fliers\");\r\n\t\tSystem.out.println(\"The airport made $\" + 1000 * numberOfFirst + \" from first class international fliers\");\r\n\t\tSystem.out.println(\"The airport made $\" + 200 * numberOfCoachC + \" from coach class commute fliers\");\r\n\t\tSystem.out.println(\"It cost $\" + 10000 * days * 4 + \" to run the international flights\");\r\n\t\tSystem.out.println(\"It cost $\" + 1000 * days * 24 + \" to run the commute flights\");\r\n\r\n\t}", "public Obs algorithm2_3(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tstamps[i]);\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff >= time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public Obs algorithm2_2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public void move(){\n\t\tint y, z;\n\t\t\n\t\tif(queueArrayGetValue(1) == null && (queueArrayGetValue(2) == null || queueArrayGetValue(3) == null)){\n\t\t\tif(queueArrayGetValue(2) == null && queueArrayGetValue(3) != null){\n\t\t\t\tqueueArraySetKeyValue(1, queueArrayGetKey(3), queueArrayGetValue(3));\n\t\t\t\tqueueArraySetKeyValue(3, null, null);\n\t\t\t}else if(queueArrayGetValue(2) != null && queueArrayGetValue(3) == null){\n\t\t\t\tqueueArraySetKeyValue(1, queueArrayGetKey(2), queueArrayGetValue(2));\n\t\t\t\tqueueArraySetKeyValue(2, null, null);\n\t\t\t}\n\t\t}else{\n\t\t\touterloop:\n\t\t\tfor(int i = 1; i < queueArrayLength(); i++){\n\t\t\t\tif(queueArrayGetValue(i) == null){\n\t\t\t\t\ty = i * 2;\n\t\t\t\t\tz = i * 2 + 1;\n\t\t\t\t\tif(y >= queueArrayLength()){\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}else if(z >= queueArrayLength()){\n\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(y), queueArrayGetValue(y));\n\t\t\t\t\t\tqueueArraySetKeyValue(y, null, null);\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(lessThan(y,z)){\n\t\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(y), queueArrayGetValue(y));\n\t\t\t\t\t\t\tqueueArraySetKeyValue(y, null, null);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(z), queueArrayGetValue(z));\n\t\t\t\t\t\t\tqueueArraySetKeyValue(z, null, null);\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 Obs algorithm2_4(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public void findTheWay(int x, int y) {\n\n Queue<Tile> elements = new LinkedList<Tile>();\n\n if (!getTile(x, y).canTileMove()) {\n System.out.println(\"Impossible to move\");\n return;\n }\n\n elements.add(getTile(x, y));\n getTile(x, y).setVisited(true);\n\n System.out.println(\"The starting tile is \" + getTile(x, y).getX() + \" \" + getTile(x, y).getY());\n\n while (!elements.isEmpty()) {\n Tile current = elements.poll();\n System.out.println(\"Current tile \" + current.getX() + \" \" + current.getY() + \" from the queue\");\n if (current.getX() == MAX && current.getY() == MAX) {\n System.out.println(\"Reached bottom right corner\");\n return;\n }\n\n for (int i = 0; i < ALLX.length; i++) {\n int newX = current.getX() + ALLX[i];\n int newY = current.getY() + ALLY[i];\n\n if (isInside(newX, newY)) {\n if (!getTile(newX, newY).isVisited()) {\n\n getTile(newX, newY).setVisited(true);\n System.out.println(\"Next added tile to the queue is \" + newX + \" \" + newY);\n\n elements.add(getTile(newX, newY));\n }\n }\n }\n }\n\n }", "public static void main(String[] args) {\n Queue<Queue<Integer>> queues = new Queue<>(QUEUE_COUNT);\n // create and insert game queues\n for (int i = 0; i < QUEUE_COUNT; i++) {\n // our capacity is 7\n Queue<Integer> q = new Queue<>(QUEUE_CAPACITY);\n queues.enqueue(q);\n }\n\n boolean turn = true; // true -> player 1, false -> player 2\n boolean allFull;\n while (true) {\n allFull = true; // reset\n\n // user plays\n int randomQueue = randQueue();\n int randomNumber = randNumber();\n\n // if random selected queue is full, select another\n while (queues.elementAt(randomQueue).isFull())\n randomQueue = randQueue();\n\n // enqueue number to selected queue\n queues.elementAt(randomQueue).enqueue(randomNumber);\n\n // print current state to screen\n System.out.println(\"\\nUser\" + (turn ? 1 : 2) + \":\");\n for (int qi = 0; qi < QUEUE_COUNT; qi++) {\n Queue<Integer> q = queues.elementAt(qi);\n System.out.println(\"Q\" + (qi + 1) + \" \" + q.toString());\n }\n\n // SEQUENCES\n // =========\n\n // flag for indicating if any sequence is encountered during search\n boolean hasSequence = false;\n\n // HORIZONTAL SEQUENCES\n for (int i = 0; i < QUEUE_COUNT; i++) {\n Queue<Integer> q = queues.elementAt(i);\n if (q.size() < 3)\n continue;\n\n for (int j = 1; j < q.size() - 1; j++) {\n // skip first and last element and check through windows across queue, sized 3\n if (isSequence(q.elementAt(j - 1), q.elementAt(j), q.elementAt(j + 1))) {\n hasSequence = true;\n break;\n }\n }\n\n // already found a sequence? stop.\n if (hasSequence)\n break;\n }\n\n // no need to play further or check the terminal conditions\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // VERTICAL SEQUENCES\n\n // find smallest queue\n int minLength = 999;\n for (int i = 0; i < QUEUE_COUNT; i++)\n if (queues.elementAt(i).size() < minLength)\n minLength = queues.elementAt(i).size();\n\n for (int i = 0; i < minLength; i++) {\n if (isSequence(queues.elementAt(0).elementAt(i), queues.elementAt(1).elementAt(i), queues.elementAt(2).elementAt(i))) {\n hasSequence = true;\n break;\n }\n }\n\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // are queues full?\n for (int i = 0; i < QUEUE_COUNT; i++) {\n allFull = allFull && queues.elementAt(i).isFull();\n }\n\n if (allFull) {\n break;\n }\n\n turn = !turn;\n }\n\n System.out.println();\n if (allFull) {\n System.out.println(\"Tie!\");\n } else {\n System.out.println(\"winner: User\" + (turn ? 1 : 2));\n }\n }", "public Obs algorithm2_5(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tstamps[i]);\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "long getTimeUntilNextRise(Coordinates coord, double horizon, long time) throws AstrometryException;", "int getWaitTime(int arrival_time, QNode temp) {\r\n\t \t //1. this is the case when the first person arrives before 9 a.m.\r\n\t \t if (arrival_time <32400) {\r\n\t \t\t //for the wait time of the first person\r\n\t\t \t if (size== maxSize) {\r\n\t\t \t\t\t this.front.wait_time = 32400-arrival_time;\r\n\t\t \t\t\t this.front.service_timeEnding = 32700;\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \r\n\t\t \t }\r\n\t\t \t //for the rest of them\r\n\t\t \t else {\r\n\t\t \t\t //if there is no waiting\r\n\t\t \t\t if (temp.service_timeEnding< arrival_time) {\r\n\t\t \t\t\t this.front.wait_time= 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t if (this.front.arrival_time+this.front.wait_time+300 !=this.front.service_timeEnding) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t\t\t \r\n\t\t \t\t }\r\n\t\t \t\t //if there is waiting and there is person before you\r\n\t\t \t\t else {\r\n\t\t\t\t \tthis.front.wait_time = temp.service_timeEnding - arrival_time;\r\n\t\t\t\t \tthis.front.service_timeEnding = arrival_time +this.front.wait_time +300;\r\n\t\t\t\t \tif (this.front.service_timeEnding< this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t\t\t \t//save wait time\r\n\t\t\t\t \tsavewait.add(this.front.wait_time);\r\n\t\t\t\t \treturn this.front.wait_time;\r\n\t\t \t\t \r\n\t\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 //this is the case when the first person arrives after 9\r\n\t \t else {\r\n\t \t\t //for the first person arriving\r\n\t\t \t if (size ==maxSize ) {\r\n\t\t \t\t\t this.front.wait_time = 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t }\r\n\t\t \t //for the rest of them\r\n\t\t \t else {\r\n\t\t \t\t //if there is no waiting\r\n\t\t \t\t if (temp.service_timeEnding< arrival_time) {\r\n\t\t \t\t\t this.front.wait_time= 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t if (this.front.service_timeEnding!= this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t\t\t \r\n\t\t \t\t }\r\n\t\t \t\t //if there is a waiting\r\n\t\t \t\t else {\r\n\t\t\t\t \tthis.front.wait_time = temp.service_timeEnding - arrival_time;\r\n\t\t\t\t \tthis.front.service_timeEnding = arrival_time +this.front.wait_time +300;\r\n\t\t\t\t \tif (this.front.service_timeEnding!= this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t\t\t \tsavewait.add(this.front.wait_time);\r\n\t\t\t\t \treturn this.front.wait_time;\r\n\t\t \t\t\r\n\t\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 }\r\n\t \t }\r\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 }", "public void checkDataOrder(Double[] times) {\n Double[] longitudes;\n Double[] latitudes;\n try {\n longitudes = getSampleLongitudes();\n latitudes = getSampleLatitudes();\n } catch ( Exception ex ) {\n // Messages about problems getting the longitudes or latitudes should already have been generated\n return;\n }\n TreeSet<DataLocation> orderedSet = new TreeSet<DataLocation>();\n for (int rowIdx = 0; rowIdx < numSamples; rowIdx++) {\n if ( times[rowIdx] != null ) {\n DataLocation dataLoc = new DataLocation();\n // Messages about missing longitude, latitude, or times should already have been generated\n if ( (times[rowIdx] == null) || (longitudes[rowIdx] == null) || (latitudes[rowIdx] == null) )\n continue;\n dataLoc.setDataDate(new Date(Math.round(times[rowIdx] * 1000.0)));\n dataLoc.setLongitude(longitudes[rowIdx]);\n dataLoc.setLatitude(latitudes[rowIdx]);\n dataLoc.setRowNumber(rowIdx + 1);\n if ( !orderedSet.add(dataLoc) )\n throw new RuntimeException(\"Unexpected duplicate data location with row number\");\n }\n }\n\n // TODO: needs a better method of figuring out which rows are actually misordered\n // the following works okay if there is only one block of misordered data\n // or if multiple blocks are consistent in the \"direction\" they are misordered.\n\n double[] maxSpeeds = DashboardConfigStore.getMaxCalcSpeedsKnots();\n double[] maxTimeGaps = DashboardConfigStore.getMaxTimeGapsDays();\n\n // The following will say:\n // 4,5,6 are misordered in 1,2,3,7,8,9,4,5,6,10,11,12;\n // 1,2 are misordered in 3,4,1,2,5,6\n // 3 is misordered in 1,2,4,5\n TreeSet<Integer> forwardErrs = new TreeSet<Integer>();\n ArrayList<ADCMessage> forwardSpeedMsgs = new ArrayList<ADCMessage>();\n ArrayList<ADCMessage> forwardTimeGapMsgs = new ArrayList<ADCMessage>();\n int lastRowNum = 0;\n int expectedRowNum = 1;\n for (DataLocation dataLoc : orderedSet) {\n int actualRowNum = dataLoc.getRowNumber();\n while ( expectedRowNum < actualRowNum ) {\n forwardErrs.add(expectedRowNum);\n expectedRowNum += 1;\n }\n if ( expectedRowNum == actualRowNum ) {\n if ( lastRowNum > 0 ) {\n double kmdelta = DashboardServerUtils.distanceBetween(longitudes[actualRowNum - 1],\n latitudes[actualRowNum - 1], longitudes[lastRowNum - 1], latitudes[lastRowNum - 1]);\n double hourdelta = (times[actualRowNum - 1] - times[lastRowNum - 1]) / 3600.0;\n double speed = 0.539957 * kmdelta / hourdelta;\n if ( (speed < 0.0) || (hourdelta < 0.0) ) {\n // Just to make sure the calculation was done correctly\n throw new RuntimeException(\"Negative calculated speed or time gap obtained\");\n }\n else if ( speed > maxSpeeds[1] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.ERROR);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"calculated speed exceeds %g knots\", maxSpeeds[1]));\n msg.setDetailedComment(String.format(\n \"calculated speed of %g knots exceeds %g knots\", speed, maxSpeeds[1]));\n forwardSpeedMsgs.add(msg);\n }\n else if ( speed > maxSpeeds[0] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.WARNING);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"calculated speed exceeds %g knots\", maxSpeeds[0]));\n msg.setDetailedComment(String.format(\n \"calculated speed of %g knots exceeds %g knots\", speed, maxSpeeds[0]));\n forwardSpeedMsgs.add(msg);\n }\n else if ( hourdelta > 24.0 * maxTimeGaps[1] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.ERROR);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"time between consecutive measurements exceeds %g days\", maxTimeGaps[1]));\n msg.setDetailedComment(String.format(\n \"time between consecutive measurements %g days exceeds %g days\",\n hourdelta / 24.0, maxTimeGaps[1]));\n forwardTimeGapMsgs.add(msg);\n }\n else if ( hourdelta > 24.0 * maxTimeGaps[0] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.WARNING);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"time between consecutive measurements exceeds %g days\", maxTimeGaps[0]));\n msg.setDetailedComment(String.format(\n \"time between consecutive measurements %g days exceeds %g days\",\n hourdelta / 24.0, maxTimeGaps[0]));\n forwardTimeGapMsgs.add(msg);\n }\n }\n lastRowNum = actualRowNum;\n expectedRowNum += 1;\n }\n }\n // The following will say:\n // 7,8,9 are misordered in 1,2,3,7,8,9,4,5,6,10,11,12;\n // 3,4 are misordered in 3,4,1,2,5,6\n // 3 is misordered in 1,2,4,5\n TreeSet<Integer> reverseErrs = new TreeSet<Integer>();\n ArrayList<ADCMessage> reverseSpeedMsgs = new ArrayList<ADCMessage>();\n ArrayList<ADCMessage> reverseTimeGapMsgs = new ArrayList<ADCMessage>();\n lastRowNum = 0;\n expectedRowNum = numSamples;\n for (DataLocation dataLoc : orderedSet.descendingSet()) {\n int actualRowNum = dataLoc.getRowNumber();\n while ( expectedRowNum > actualRowNum ) {\n reverseErrs.add(expectedRowNum);\n expectedRowNum -= 1;\n }\n if ( expectedRowNum == actualRowNum ) {\n if ( lastRowNum > 0 ) {\n double kmdelta = DashboardServerUtils.distanceBetween(longitudes[lastRowNum - 1],\n latitudes[lastRowNum - 1], longitudes[actualRowNum - 1], latitudes[actualRowNum - 1]);\n double hourdelta = (times[lastRowNum - 1] - times[actualRowNum - 1]) / 3600.0;\n double speed = 0.539957 * kmdelta / hourdelta;\n if ( (speed < 0.0) || (hourdelta < 0.0) ) {\n // Just to make sure the calculation was done correctly\n throw new RuntimeException(\"Negative calculated speed or time gap obtained\");\n }\n else if ( speed > maxSpeeds[1] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.ERROR);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"calculated speed exceeds %g knots\", maxSpeeds[1]));\n msg.setDetailedComment(String.format(\n \"calculated speed of %g knots exceeds %g knots\", speed, maxSpeeds[1]));\n reverseSpeedMsgs.add(msg);\n }\n else if ( speed > maxSpeeds[0] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.WARNING);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"calculated speed exceeds %g knots\", maxSpeeds[0]));\n msg.setDetailedComment(String.format(\n \"calculated speed of %g knots exceeds %g knots\", speed, maxSpeeds[0]));\n reverseSpeedMsgs.add(msg);\n }\n else if ( hourdelta > 24.0 * maxTimeGaps[1] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.ERROR);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"time between consecutive measurements exceeds %g days\", maxTimeGaps[1]));\n msg.setDetailedComment(String.format(\n \"time between consecutive measurements %g days exceeds %g days\",\n hourdelta / 24.0, maxTimeGaps[1]));\n reverseTimeGapMsgs.add(msg);\n }\n else if ( hourdelta > 24.0 * maxTimeGaps[0] ) {\n // Add one message at this time - later repeat with all the columns\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.WARNING);\n msg.setRowNumber(actualRowNum);\n msg.setGeneralComment(String.format(\n \"time between consecutive measurements exceeds %g days\", maxTimeGaps[0]));\n msg.setDetailedComment(String.format(\n \"time between consecutive measurements %g days exceeds %g days\",\n hourdelta / 24.0, maxTimeGaps[0]));\n reverseTimeGapMsgs.add(msg);\n }\n }\n lastRowNum = actualRowNum;\n expectedRowNum -= 1;\n }\n }\n // Guess that the set with fewer errors is the correct one\n TreeSet<Integer> errorRowsNums;\n ArrayList<ADCMessage> speedMsgs;\n ArrayList<ADCMessage> timeGapMsgs;\n if ( (forwardErrs.size() + forwardSpeedMsgs.size() + forwardTimeGapMsgs.size())\n <= (reverseErrs.size() + reverseSpeedMsgs.size() + reverseTimeGapMsgs.size()) ) {\n errorRowsNums = forwardErrs;\n speedMsgs = forwardSpeedMsgs;\n timeGapMsgs = forwardTimeGapMsgs;\n }\n else {\n errorRowsNums = reverseErrs;\n speedMsgs = reverseSpeedMsgs;\n timeGapMsgs = reverseTimeGapMsgs;\n }\n for (Integer rowNum : errorRowsNums) {\n for (Integer colIdx : indicesForTime) {\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(Severity.CRITICAL);\n msg.setRowNumber(rowNum);\n msg.setColNumber(colIdx + 1);\n msg.setColName(userColNames[colIdx]);\n String comment = \"time-misordered data row\";\n msg.setGeneralComment(comment);\n msg.setDetailedComment(comment);\n stdMsgList.add(msg);\n }\n }\n for (ADCMessage spdmsg : speedMsgs) {\n // Speed problems could be in longitude ...\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(spdmsg.getSeverity());\n msg.setRowNumber(spdmsg.getRowNumber());\n msg.setColNumber(longitudeIndex + 1);\n msg.setColName(userColNames[longitudeIndex]);\n msg.setGeneralComment(spdmsg.getGeneralComment());\n msg.setDetailedComment(spdmsg.getDetailedComment());\n stdMsgList.add(msg);\n // ... or latitude ...\n msg = new ADCMessage();\n msg.setSeverity(spdmsg.getSeverity());\n msg.setRowNumber(spdmsg.getRowNumber());\n msg.setColNumber(latitudeIndex + 1);\n msg.setColName(userColNames[latitudeIndex]);\n msg.setGeneralComment(spdmsg.getGeneralComment());\n msg.setDetailedComment(spdmsg.getDetailedComment());\n stdMsgList.add(msg);\n // ... or time\n for (Integer colIdx : indicesForTime) {\n msg = new ADCMessage();\n msg.setSeverity(spdmsg.getSeverity());\n msg.setRowNumber(spdmsg.getRowNumber());\n msg.setColNumber(colIdx + 1);\n msg.setColName(userColNames[colIdx]);\n msg.setGeneralComment(spdmsg.getGeneralComment());\n msg.setDetailedComment(spdmsg.getDetailedComment());\n stdMsgList.add(msg);\n }\n }\n for (ADCMessage tgmsg : timeGapMsgs) {\n for (Integer colIdx : indicesForTime) {\n ADCMessage msg = new ADCMessage();\n msg.setSeverity(tgmsg.getSeverity());\n msg.setRowNumber(tgmsg.getRowNumber());\n msg.setColNumber(colIdx + 1);\n msg.setColName(userColNames[colIdx]);\n msg.setGeneralComment(tgmsg.getGeneralComment());\n msg.setDetailedComment(tgmsg.getDetailedComment());\n stdMsgList.add(msg);\n }\n }\n }", "public Obs findtrips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\tboolean marks[] = new boolean[towers.length];\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t\tmarks[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\t// else {\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t// }\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\tmarks[marks.length - 1] = true;\n\t\t}\n\n\t\t/**\n\t\t * User trips buffers.\n\t\t */\n\t\tString trips = towers[0];\n\t\tString tstrips = tstamps[0];\n\n\t\tfor (int i = 1; i < marks.length; i++) {\n\t\t\tboolean mark = marks[i];\n\t\t\ttrips += CLM + towers[i];\n\t\t\ttstrips += CLM + tstamps[i];\n\n\t\t\t/**\n\t\t\t * The end of the previous trip is the start of the new trip.\n\t\t\t */\n\t\t\tif (mark && i != marks.length - 1) {\n\t\t\t\ttrips += RLM + towers[i];\n\t\t\t\ttstrips += RLM + tstamps[i];\n\t\t\t}\n\n\t\t}\n\t\treturn new Obs(trips, tstrips);\n\n\t}", "public Obs findStops(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tString stops = \"\";\n\t\tString tstops = \"\";\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add buffer mode to the stops\n\t\t\t\t\t\t */\n\t\t\t\t\t\tint index = modeIndex(buffer);\n\t\t\t\t\t\tif (index != -1) {\n\t\t\t\t\t\t\t// System.out.println(\"Find stop\");\n\t\t\t\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\t\t\t\tstops += CLM;\n\t\t\t\t\t\t\t\ttstops += CLM;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstops += buffer.get(index);\n\t\t\t\t\t\t\ttstops += tbuffer.get(index);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// else {\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t// }\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\t/**\n\t\t\t * Add buffer mode to the stops\n\t\t\t */\n\t\t\tint index = modeIndex(buffer);\n\t\t\tif (index != -1) {\n\t\t\t\t// System.out.println(\"Find from the remaining buffer\");\n\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\tstops += CLM;\n\t\t\t\t\ttstops += CLM;\n\t\t\t\t}\n\t\t\t\tstops += buffer.get(index);\n\t\t\t\ttstops += tbuffer.get(index);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + stops);\n\t\t// System.out.println(\"time stamps:\\t\" + tstops);\n\t\treturn new Obs(stops, tstops);\n\n\t}", "@Override\n\tpublic boolean drive2Exit() throws Exception {\n\t\tint[][] timesVisited = new int[width][height];\n\t\tfor (int i = 0; i < timesVisited.length; i++) {\n\t\t\tfor (int j = 0; j < timesVisited[0].length; j++) {\n\t\t\t\ttimesVisited[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (robot.isAtExit() == false) {\n\t\t\t/* start a list of potential positions to move to. */\n\t\t\tLinkedList<CardinalDirectionNumVisitsPair> possibleDirections = new LinkedList<CardinalDirectionNumVisitsPair>();\n\t\t\t\n\t\t\t/* get the directions and number of visits to all accessible adjacent spaces. */\n\t\t\tint robotX = robot.getCurrentPosition()[0];\n\t\t\tint robotY = robot.getCurrentPosition()[1];\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX + 1, robotY, CardinalDirection.East, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX - 1, robotY, CardinalDirection.West, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX, robotY + 1, CardinalDirection.North, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX, robotY - 1, CardinalDirection.South, possibleDirections, timesVisited);\n\t\t\t\n\t\t\t/* find the minimum number of visits. */\n\t\t\tint minVisits = Integer.MAX_VALUE;\n\t\t\tfor (CardinalDirectionNumVisitsPair pair : possibleDirections) {\n\t\t\t\tif (pair.numVisits < minVisits) {\n\t\t\t\t\tminVisits = pair.numVisits;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* remove all pairs that do NOT have minVisits visits from the list. */\n\t\t\tfor (Iterator<CardinalDirectionNumVisitsPair> iterator = possibleDirections.listIterator(); iterator.hasNext(); ) {\n\t\t\t CardinalDirectionNumVisitsPair pair = iterator.next();\n\t\t\t if (pair.numVisits != minVisits) {\n\t\t\t iterator.remove();\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t/* the list now contains only spaces that have the minimum number of visits. */\n\t\t\t/* pick randomly from the list. */\n\t\t\tint randomIndex = (int) Math.floor(Math.random() * possibleDirections.size());\n\t\t\tCardinalDirectionNumVisitsPair randomPair = possibleDirections.get(randomIndex);\n\t\t\t\n\t\t\t/* turn to face that direction. */\n\t\t\trobot.turnToDirection(randomPair.cardinalDirection);\n\t\t\t\n\t\t\t/* move. */\n\t\t\trobot.move(1, false);\n\t\t\t\n\t\t\t/* update the numVisits array. */\n\t\t\ttimesVisited[robot.getCurrentPosition()[0]][robot.getCurrentPosition()[1]]++;\n\t\t}\n\t\t\n\t\treturn robot.stepOutOfExit();\n\t}", "long getTimeSinceLastTransit(Coordinates coord, long time) throws AstrometryException;", "public int driveQueue(int speedL, int speedR, int distanceL, int distanceR);", "private boolean thereispath(Move m, Tile tile, Integer integer, Graph g, Board B) {\n\n boolean result = true;\n boolean result1 = true;\n\n int start_dest_C = tile.COLUMN;\n int start_dest_R = tile.ROW;\n\n int move_column = m.getX();\n int move_row = m.getY();\n\n int TEMP = 0;\n int TEMP_ID = 0;\n int TEMP_ID_F = tile.id;\n int TEMP_ID_FIRST = tile.id;\n\n int final_dest_R = (integer / B.width);\n int final_dest_C = (integer % B.width);\n\n //System.out.println(\"* \" + tile.toString() + \" \" + integer + \" \" + m.toString());\n\n // Y ROW - X COLUMN\n\n for (int i = 0; i != 2; i++) {\n\n TEMP_ID_FIRST = tile.id;\n\n // possibility 1\n if (i == 0) {\n\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result != false; c++) {\n\n if (c == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n // System.out.println(\"OK\");\n\n } else {\n\n result = false;\n\n // System.out.println(\"NOPE\");\n\n\n }\n }\n\n for (int r = 0; r != Math.abs(move_row) && result != false; r++) {\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n // System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n\n } else {\n\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == true) {\n return true;\n }\n\n\n }\n\n TEMP_ID = 0;\n\n if (i == 1) {\n\n result = true;\n\n start_dest_C = tile.COLUMN;\n start_dest_R = tile.ROW;\n // first move row\n for (int r = 0; r != Math.abs(move_row) && result1 != false; r++) {\n\n if (r == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n\n //System.out.println(\"NOPE\");\n\n result = false;\n\n }\n\n\n }\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result1 != false; c++) {\n\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == false) {\n return false;\n\n }\n\n\n }\n\n\n }\n\n\n return true;\n }", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "void reachedCashierAt(int time) {\n reachedCashier = true;\n timeSpentInQueue = time - timeCreated;\n }", "public static int findPath(int currentTime[],int tLeave[], int timeStation[][], int transferTime[][], int totalStations) {\n\t\tint numofLines = currentTime.length;\n\t\tif(numofLines != 2){\n\t\t\tSystem.err.println(\"Only two assembly line supported\");\n\t\t\treturn -1;\n\t\t}\n\t\t//Cost function array\n\t\tint f[][] = new int[numofLines][totalStations];\n\t\t//Station index back track array\n\t\tint i[][] = new int[numofLines][totalStations];\n\t\t\n\t\t//Final Cost and Final Station\n\t\tint finalCost = 0;\n\t\tint lastStation = 0;\n\t\t\n\t\t//Time for first station\n\t\tf[0][0] = currentTime[0]+timeStation[0][0];\n\t\tf[1][0] = currentTime[1]+timeStation[1][0];\n\t\t\n\t\t\n\t\tfor (int j = 1; j < totalStations; j++) {\n\t\t\t\n\t\t\t\n\t\t\tif((f[0][j-1] + timeStation[0][j]) <= (f[1][j-1]+ transferTime[1][j-1]+timeStation[0][j])){\n\t\t\t\tf[0][j]= f[0][j-1]+ timeStation[0][j];\n\t\t\t\ti[0][j] = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tf[0][j]= f[1][j-1]+ transferTime[1][j-1]+timeStation[0][j];\n\t\t\t\ti[0][j]=1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(f[1][j-1] + timeStation[1][j] <= f[0][j-1]+ transferTime[0][j-1]+timeStation[1][j]){\n\t\t\t\tf[1][j]= f[1][j-1]+ timeStation[1][j];\n\t\t\t\ti[1][j] = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tf[1][j]= f[0][j-1]+ transferTime[0][j-1]+timeStation[1][j];\n\t\t\t\ti[1][j] = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif((f[0][totalStations-1]+tLeave[0]) <= (f[1][totalStations-1]+tLeave[1] )){\n\t\t\tfinalCost = f[0][totalStations-1]+tLeave[0];\n\t\t\tlastStation = 0;\n\t\t}\n\t\telse{\n\t\t\tfinalCost = f[1][totalStations-1]+tLeave[1] ;\n\t\t\tlastStation = 1;\n\t\t}\t\n\t\n\t\tprintStation(lastStation,finalCost, i, totalStations);\n\t\treturn finalCost;\n\t}", "public int orangesRotting(int[][] grid) {\n /**\n 经典的bfs 队列模拟\n 要注意的是 记录层数即为times的消耗 用queue.size 来遍历 每次先记录queue的大小 若size减为0 则说明当前层遍历完\n\n 这题要注意几个corner case\n 1.有永远新鲜的水果 1的周围都是0\n 2.原本就没有水果 全是空格0\n\n **/\n int time=0;\n if(grid==null||grid.length==0)return 0;\n\n Queue<int[]> queue=new LinkedList<>();\n\n\n int flag=0;\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==2)\n queue.add(new int[]{i,j});\n if(grid[i][j]==1)\n flag=1;\n }\n }\n if(queue.isEmpty()&&flag==0)return 0;\n\n int dir[][]={{0,1},{0,-1},{1,0},{-1,0}};\n\n\n\n while(!queue.isEmpty()){\n int size=queue.size();\n while(size>0){\n int[] cur=queue.poll();\n\n for(int i=0;i<4;i++){\n int x=cur[0]+dir[i][0];\n int y=cur[1]+dir[i][1];\n if(x<0||x>=grid.length||y<0||y>=grid[0].length)continue;\n if(grid[x][y]==1){\n grid[x][y]=2;\n queue.add(new int[]{x,y});\n }\n\n }\n size--;\n }\n\n time++;\n\n }\n\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==1)\n return -1;\n }\n }\n\n\n return time-1;\n }", "public void calculateTimeDifferences() {\n\n findExits();\n\n try {\n\n\n if (accumulate.size() > 0) {\n\n for (int i = 1; i < accumulate.size() - 1; i++) {\n if (accumulate.get(i).value > accumulate.get(i - 1).value\n && timeOfExists.size() > 0) {\n\n double timeOfEntry = accumulate.get(i).timeOfChange;\n double timeOfExit = timeOfExists.get(0);\n\n timeOfExists.remove(timeOfExit);\n timeOfChanges.add(timeOfExit - timeOfEntry);\n }\n\n }\n }\n } catch (IndexOutOfBoundsException exception) {\n LOG_HANDLER.logger.severe(\"calculateTimeDifferences \"\n + \"Method as thrown an OutOfBoundsException: \"\n + exception\n + \"Your timeOfChanges seems to be null\");\n }\n }", "private void makeSubPlan(Plan plan,Time currentTime,ArrayList<POI> POIs,Time timeEnd,Trip trip,Plan mPlan,boolean skip){\n if(mPlan!=null) \n plan.makeCalculations(trip.getStartTime(),trip.getEndTime(),mPlan.getFullCost(),mPlan);\n else\n plan.makeCalculations(trip.getStartTime(),trip.getEndTime(),0,mPlan);\n POI last=plan.getLastPOI();\n for(int i=0; i< POIs.size();i++){\n // Check if iam in Time range or not\n if(!currentTime.compare(timeEnd))\n break;\n else{\n if(canInsertLast(plan, POIs.get(i), trip, currentTime,mPlan,skip)){\n // update current time & plan\n Time from = new Time (0,0);\n Time to = new Time (0,0);\n if(last!=null){\n // cal travel time\n currentTime.add(last.getShortestPath(POIs.get(i).getId()));\n // cal waste time\n int x = Time.substract(currentTime, POIs.get(i).getOpenTime());\n if(skip&&x!=-1)\n currentTime.add(x);\n \n from.hour = currentTime.hour;\n from.min = currentTime.min;\n // cal poi duration \n currentTime.add(POIs.get(i).getDuration());\n to.hour = currentTime.hour;\n to.min = currentTime.min;\n }\n else{\n if(mPlan==null){\n int x = Time.substract(currentTime, POIs.get(i).getOpenTime());\n if(skip&&x!=-1)\n currentTime.add(x);\n from.hour = currentTime.hour;\n from.min = currentTime.min;\n currentTime.add(POIs.get(i).getDuration());\n to.hour = currentTime.hour;\n to.min = currentTime.min;\n }\n else{\n POI mLast = mPlan.getLastPOI();\n if(mLast!=null)\n currentTime.add(mLast.getShortestPath(POIs.get(i).getId()));\n int x = Time.substract(currentTime, POIs.get(i).getOpenTime());\n if(skip&&x!=-1)\n currentTime.add(x);\n from.hour = currentTime.hour;\n from.min = currentTime.min;\n currentTime.add(POIs.get(i).getDuration());\n to.hour = currentTime.hour;\n to.min = currentTime.min;\n }\n }\n plan.insert(POIs.get(i), plan.getNOV(),from,to,null);\n if(mPlan!=null)\n plan.makeCalculations(trip.getStartTime(), trip.getEndTime(),mPlan.getFullCost(),mPlan);\n else\n plan.makeCalculations(trip.getStartTime(),trip.getEndTime(),0,mPlan);\n last=POIs.get(i);\n // Remove poi from POIs\n POIs.remove(i);\n i--;\n }\n }\n }\n }", "public int[] solver(int startPlayerId, int curplayer, int[][] oneP, int[][][] memory, int count) {\n\r\n int[][] one = oneP.clone(); // OnePlay Input\r\n int[] k; // onePlay points\r\n int j = curplayer;\r\n int[][][] m = memory.clone();\r\n int[] minCard = new int[3];\r\n int[] t;\r\n ArrayList<int[]> store = new ArrayList<>();\r\n minCard[2] = 100000;\r\n t = new int[3];\r\n for (int i = 0; i < 4; i++) { // 4 types of cards\r\n for (int l = 2; l < cardPerPlayer + 2; l++) {\r\n if (m[j][i][l] == 1 || m[j][i][l] == 2) {\r\n one[j][0] = i;\r\n one[j][1] = l;\r\n remove(new int[] { i, l }, m);\r\n if ((j + 1) % players != startPlayerId) {\r\n t = solver(startPlayerId, (j + 1) % players, one, m, count);\r\n one[(j + 1) % players][0] = t[0];\r\n one[(j + 1) % players][1] = t[1];\r\n }\r\n // } else if ((j + 2) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 2) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // } else if ((j + 3) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 3) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // }\r\n\r\n k = onePlay(one, startPlayerId);\r\n int curpoint = 0;\r\n if (count != cardPerPlayer - 1) { // cardPerPlayer - 1 = 12\r\n t = solver(k[0], k[0], new int[4][2], m, count++);\r\n curpoint = t[2];\r\n }\r\n\r\n if (k[0] == myID) {\r\n curpoint += k[1] + k[2] * 12;\r\n }\r\n store.add(new int[] { i, l, curpoint });\r\n if (curpoint < minCard[2]) {\r\n minCard[2] = curpoint;\r\n minCard[0] = i;\r\n minCard[1] = l;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return minCard;\r\n }", "public LinkedList<Pair<DirType, Location>> getMove(int curX, int curY) {\n // find the shortest path to each coin from this current position (we don't actually care about\n // coins that we don't have a path to)\n // then, find the shortest path from each of those coins to each other coin\n\n // then, we want all Hamiltonian paths (and all subpaths?) Traveling Salesman Problem\n // i.e. we care about paths for as long as the number of steps it takes to complete\n // is less than or equal to the number of turns we have remaining\n\n // convert the Location[][] we have into David and Austin's LocationsToNode\n LocationsToNode graph = new LocationsToNode(maze);\n // knownCoins are ONLY the coins we have paths to. we will calculate the\n // shortest paths later. there are repeat calculations below.\n LinkedList<Node> coins = bfsFindCoins(graph, curX, curY);\n for (Node coinFrom : coins) {\n Location coinFromLoc = graph.getLocation(coinFrom);\n LinkedList<LinkedList<Location>> pathsToOthers = new LinkedList<LinkedList<Location>>();\n for (Node coinTo : coins) {\n Location coinToLoc = graph.getLocation(coinTo);\n LinkedList<Location> path = getShortestPath(coinFrom, coinTo, graph);\n pathsToOthers.add(path);\n }\n paths.put(coinFromLoc,pathsToOthers);\n }\n\n // calculating all possible Hamiltonian paths....\n // this is A LOT of paths we're talking about\n // i.e. we want every path that visits every single coin\n // so if we know 20 coins, starting at point 1, we have 19 choices\n // for the second point, 18 for the third, and so on (this is on the order of\n // n! total paths without dynamic programming, and might be too much brute force)\n // https://en.wikipedia.org/wiki/Hamiltonian_path#Properties\n // https://en.wikipedia.org/wiki/Travelling_salesman_problem#Heuristic_and_approximation_algorithms\n // https://stackoverflow.com/questions/16555978/example-of-a-factorial-time-algorithm-o-n\n // then, we will decide which Hamiltonian is the best for the number of\n // moves we have available to us\n\n // instead, i am going to try only calculating the paths we can actually make with our current number\n // of turns because we want the most coins in the fewest turns\n\n // WE ONLY CARE ABOUT THE LONGEST (COIN) PATH WITH THE SAME NUMBER OF TURNS\n\n return new LinkedList<Pair<DirType, Location>>();\n }", "public static int largestIslandChain(Scanner sc) {\n int islands=sc.nextInt();\r\n boolean graph[][] = new boolean[islands][islands];\r\n\r\n //System.out.print(\"How many ziplines? \");\r\n int ziplines=sc.nextInt();\r\n\r\n for (int edge=0; edge<ziplines; edge++) {\r\n int from=sc.nextInt();\r\n int to=sc.nextInt();\r\n graph[from][to]=true;\r\n }\r\n\r\n\r\n /* Find the SCCs... */\r\n\r\n //Utility Data Structures\r\n Stack<Integer> stack = new Stack<Integer>(); \r\n\r\n\r\n //First DFS\r\n boolean[] visited01 = new boolean[islands];\r\n int exitTimeTicker=0;\r\n int[] exitTimes = new int[islands];\r\n int[] exitPoints = new int[islands];\r\n for (int island=0; island<islands; island++) {\r\n int source;\r\n if (!visited01[island])\r\n {\r\n visited01[island]=true;\r\n stack.push(island);\r\n source=island;\r\n\r\n int destination=0;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n destination=0;\r\n while (destination<islands)\r\n {\r\n if (graph[source][destination] && !visited01[destination])\r\n {\r\n stack.push(destination);\r\n visited01[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n }\r\n }\r\n exitTimes[stack.peek()]=exitTimeTicker;\r\n exitPoints[exitTimeTicker]=stack.peek();\r\n stack.pop();\r\n exitTimeTicker++;\r\n }\r\n }\r\n }\r\n\r\n\r\n boolean graphTransposeUsingExits[][] = new boolean[islands][islands];\r\n for (int i=0; i<islands; i++)\r\n {\r\n for (int j=0; j<islands; j++)\r\n {\r\n if (graph[i][j])\r\n graphTransposeUsingExits[exitTimes[j]][exitTimes[i]]=true;\r\n }\r\n }\r\n\r\n\r\n //Second DFS\r\n boolean[] visited02 = new boolean[islands];\r\n int[] numberOfSCC = new int[islands];\r\n int currSCCnum=0;\r\n for (int exitTime=islands-1; exitTime>=0; exitTime--)\r\n {\r\n if (!visited02[exitTime])\r\n {\r\n //entryPointToScc=exitTime;\r\n visited02[exitTime]=true;\r\n numberOfSCC[exitPoints[exitTime]]=++currSCCnum;\r\n stack.push(exitTime);\r\n int source=exitTime;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n int destination=0;\r\n while (destination<islands)\r\n {\r\n if (graphTransposeUsingExits[source][destination] && !visited02[destination])\r\n {\r\n if (numberOfSCC[exitPoints[destination]]==0) {\r\n numberOfSCC[exitPoints[destination]]=currSCCnum;\r\n }\r\n stack.push(destination);\r\n visited02[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n } \r\n }\r\n stack.pop();\r\n } \r\n }\r\n }\r\n\r\n\r\n int[] sizeOfSCCs = new int[currSCCnum];\r\n for (int i=0; i<islands; i++) {\r\n sizeOfSCCs[numberOfSCC[i]-1]++;\r\n }\r\n \r\n int sccsMax = Integer.MIN_VALUE;\r\n for(int i=0; i<sizeOfSCCs.length; ++i) {\r\n \tif(sizeOfSCCs[i] > sccsMax) {\r\n \t\tsccsMax = sizeOfSCCs[i];\r\n \t}\r\n }\r\n return sccsMax;\r\n \r\n // Java 8\r\n //return Arrays.stream(sizeOfSCCs).summaryStatistics().getMax();\r\n }", "long getTimeSinceLastSet(Coordinates coord, double horizon, long time) throws AstrometryException;", "public static List<MapTile> findPath(MovableObject mO, GameObject destination) {\n List<MapTile> openList = new LinkedList<>();\n List<MapTile> closedList = new LinkedList<>();\n List<MapTile> neighbours = new ArrayList<>();\n Point objectTileCoord = mO.getGridCoordinates();\n Point destinationTileCoord = destination.getGridCoordinates();\n MapTile currentTile;\n try {\n currentTile = mapGrid.mapGrid[objectTileCoord.x][objectTileCoord.y];\n } catch (ArrayIndexOutOfBoundsException e) {\n System.out.print(\"Error while getting current tile for pathfinding. Trying to adapt coords.\");\n if (mO.getX() >= MapManager.getWorldWidth()) {\n objectTileCoord.x -= 1;\n }\n if (mO.getY() >= MapManager.getWorldHeight()) {\n objectTileCoord.y -= 1;\n }\n if (mO.getY() >= MapManager.getWorldHeight() && mO.getX() >= MapManager.getWorldWidth()) {\n objectTileCoord.x -= 1;\n objectTileCoord.y -= 1;\n }\n currentTile = mapGrid.mapGrid[objectTileCoord.x][objectTileCoord.y];\n }\n\n currentTile.setParentMapTile(null);\n currentTile.totalMovementCost = 0;\n openList.add(currentTile);\n\n boolean notDone = true;\n\n while (notDone) {\n neighbours.clear();\n currentTile = getLowestCostTileFromOpenList(openList, currentTile);\n closedList.add(currentTile);\n openList.remove(currentTile);\n\n //ReachedGoal?\n if ((currentTile.xTileCoord == destinationTileCoord.x) && (currentTile.yTileCoord == destinationTileCoord.y)) {\n try {\n return getResultListOfMapTiles(currentTile);\n } catch (Exception e) {\n System.out.println(\"closed list size: \" + closedList.size());\n throw e;\n }\n }\n\n neighbours.addAll(currentTile.getNeighbourTiles());\n neighbours.removeAll(closedList);\n\n for (MapTile mapTile : neighbours) {\n if (openList.contains(mapTile)) {\n // compare total movement costs.\n if (mapTile.totalMovementCost > currentTile.getMovementCostToTile(mapTile) + currentTile.totalMovementCost) {\n mapTile.setParentMapTile(currentTile);\n mapTile.totalMovementCost = currentTile.getMovementCostToTile(mapTile) + currentTile.totalMovementCost;\n }\n } else {\n mapTile.setParentMapTile(currentTile);\n mapTile.totalMovementCost = currentTile.totalMovementCost + currentTile.getMovementCostToTile(mapTile);\n openList.add(mapTile);\n }\n }\n }\n return null;\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tn = in.nextInt();\n\t\tm = in.nextInt();\n\t\tt = in.nextInt();\n\t\ttime = new char[n+1][t];\n\t\tfor(int i =1;i<=n;i++)\n\t\t{\n\t\t\tString next = in.next();\n\t\t\tfor(int j =0;j<t;j++)\n\t\t\t{\n\t\t\t\ttime[i][j] = next.charAt(j);\n\t\t\t}\n\t\t}\n\t\tboolean[][] mat = new boolean[n+1][n+1];\n\t\tfor(int i =0;i<m;i++)\n\t\t{\n\t\t\tint p = in.nextInt();\n\t\t\tint q = in.nextInt();\n\t\t\tmat[p][q] = true;\n\t\t\tmat[q][p] = true;\n\t\t}\n\t\tfor(int i =1;i<=n;i++)\n\t\t{\n\t\t\tfor(int s=1;s<=n;s++)\n\t\t\t{\n\t\t\t\tif(mat[s][i])\n\t\t\t\t\tfor(int e =1;e<=n;e++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(mat[i][e])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmat[s][e] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\td = new int[n+1];\n\t\tArrays.fill(d, Integer.MAX_VALUE);\n\t\t//BFS\n\t\tBFS(mat, 1, 0);\n\t\t//System.out.println(Arrays.toString(d));\n\t\tif(d[n]==Integer.MAX_VALUE)\n\t\t\tans=0;\n\t\telse\n\t\t\tans=d[n];\n\t\tSystem.out.println(ans-1);\n\t}", "public Object computeWave(Object arg_time) {\n\t\ttime = ((Integer) arg_time).intValue();\n\t\t// move the previous return values to my neighbors[].\n\t\tif (getInMessages() != null) {\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tif (getInMessages()[i] != null) {\n\t\t\t\t\tneighbors[i] = ((Double) getInMessages()[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (myX == 0 || myX == sizeX - 1 || myY == 0 || myY == sizeY) {\n\t\t\t// this cell is on the edge of the Wave2D matrix\n\t\t\tif (time == 0) {\n\t\t\t\twave[0] = 0.0; //current\n\t\t\t}\n\t\t\tif (time == 1) {\n\t\t\t\twave[1] = 0.0; //previous\n\t\t\t} else if (time >= 2) {\n\t\t\t\twave[2] = 0.0; //previous2\n\t\t\t}\n\t\t} else {\n\t\t\t// this cell is not on the edge\n\t\t\tif (time == 0) {\n\t\t\t\t// create an initial high tide in the central square area\n\t\t\t\twave[0] = (sizeX * 0.4 <= myX && myX <= sizeX * 0.6 &&\n\t\t\t\t\t\tsizeY * 0.4 <= myY && myY <= sizeY * 0.6) ? 20.0 : 0.0;\n\t\t\t\t//start w/ wave[0]\n\t\t\t\twave[1] = wave[2] = 0.0; // init wave[1] and wave[2] as 0.0\n\t\t\t} else if (time == 1) {\n\t\t\t\t// simulation at time 1\n\t\t\t\twave[1] = wave[0] + c * c / 2.0 * dt * dt / (dd * dd) *\n\t\t\t\t\t\t(neighbors[north] + neighbors[east] + neighbors[south] +\n\t\t\t\t\t\t\t\tneighbors[west] - 4.0 * wave[0]); //wave[1] based on wave[0]\n\t\t\t} else if (time >= 2) {\n\t\t\t\t// simulation at time 2 and onwards\n\t\t\t\twave[2] = 2.0 * wave[1] - wave[0] + c * c * dt * dt / (dd * dd) *\n\t\t\t\t\t\t(neighbors[north] + neighbors[east] + neighbors[south]\n\t\t\t\t\t\t\t\t+ neighbors[west] - 4.0 * wave[1]);\n\t\t\t\t//wave two based on wave[1] and wave[0]\n\t\t\t\twave[0] = wave[1];\n\t\t\t\twave[1] = wave[2];\n\t\t\t\t//shift wave[] measurements, prepare for a new wave[2]\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void findTurnaroundTime(int wt[], int tat[]) {\n\t\tfor(int i=0;i<n;i++)\r\n\t\ttat[i] = processList.get(i).getBurstTime() + wt[i];\r\n\t}", "@Override\n public float distanceAdjacent(int x1, int y1, int x2, int y2) {\n float duration = 0;\n\n if (x1 == x2 || y1 == y2) {\n MapTile.Instance fromTile = getTileData(x1, y1);\n MapTile.Instance toTile = getTileData(x2, y2);\n assert fromTile != null && toTile != null;\n\n Direction move = Direction.get(x2 - x1, y2 - y1);\n\n int fromHeight = fromTile.heightOf(move);\n int toHeight = toTile.heightOf(move.inverse());\n\n // steepness\n float t1inc = (fromHeight - fromTile.getHeight()) / (TILE_SIZE / 2);\n float t2inc = (toHeight - toTile.getHeight()) / (TILE_SIZE / 2);\n\n // actual duration of walking\n float walkSpeedT1 = (1f / hypoLength(t1inc)) * walkSpeed;\n float walkSpeedT2 = (1f / hypoLength(t2inc)) * walkSpeed;\n\n // duration += walkspeed(steepness_1) * dist + walkspeed(steepness_2) * dist\n duration += (walkSpeedT1 + walkSpeedT2) * TILE_SIZE;\n\n // height difference on the sides of the tiles\n float cliffHeight = (toHeight - fromHeight) * TILE_SIZE_Z;\n\n // climbing if more than 'an acceptable height'\n if (cliffHeight > 0) {\n duration += (cliffHeight / climbSpeed);\n }\n\n } else {\n // TODO allow diagonal tracing\n Logger.WARN.print(String.format(\n \"Pathfinding (%s) asked for non-adjacent tiles (%d, %d) (%d, %d)\",\n getClass(), x1, y1, x2, y2\n ));\n\n return Float.POSITIVE_INFINITY;\n }\n\n return duration;\n }", "public void timeToMove(int worker) {\n for (int i = 0; i < getOnlinePlayers().size(); i++) {\n if (getOnlinePlayers().get(i).equals(getCurrentTurn().getCurrentPlayer())) {\n if (getStateList().get(i).getEffect()) {\n if (getCurrentTurn().getCurrentPlayer().isHasTwoInputMove()) {\n notifyTimeToMoveTwoInput(worker, this.getCurrentTurn().getCurrentPlayer().getNickname());\n } else {\n notifyCanMoveThisWorker(worker, this.getCurrentTurn().getCurrentPlayer().getNickname(), this.getCurrentTurn().getCurrentPlayer().availableCellsToMove(this.getCurrentTurn().getCurrentPlayer().getWorkerRef().get(worker-1)));\n }\n } else {\n notifyCanMoveThisWorker(worker, this.getCurrentTurn().getCurrentPlayer().getNickname(), this.getCurrentTurn().getCurrentPlayer().availableCellsToMove(this.getCurrentTurn().getCurrentPlayer().getWorkerRef().get(worker-1)));\n }\n break;\n }\n }\n\n }", "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 Obs findStops_trips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY)\n\t\t\tthrows ParseException {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tString stops = towers[0];\n\t\tString tstops = tstamps[0];\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\t/**\n\t\t\t\t * if the time exceeds timing threshold, then check the distance\n\t\t\t\t * between towers. If this distance less than the distance\n\t\t\t\t * threshold, then previous tower is the end of the current\n\t\t\t\t * trip.\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\tcal.setTime(sTime);\n\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tcal.setTime(eTime);\n\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t// if (buffer.size() >= trip_length) {\n\t\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\t\tstops += CLM;\n\t\t\t\t\t\ttstops += CLM;\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Add start and end of the trips to the stop sequences\n\t\t\t\t\t */\n\t\t\t\t\tstops += buffer.get(buffer.size() - 1);\n\t\t\t\t\ttstops += tbuffer.get(tbuffer.size() - 1);\n\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\t// else {\n\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t/**\n\t\t\t\t * Reset maximum distances\n\t\t\t\t */\n\t\t\t\tmax_distance = 0;\n\t\t\t\t// }\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\t// if (buffer.size() >= trip_length) {\n\t\t\tif (!stops.isEmpty()) {\n\t\t\t\tstops += CLM;\n\t\t\t\ttstops += CLM;\n\t\t\t}\n\t\t\t/**\n\t\t\t * Add start and end of the trips to the stop sequences\n\t\t\t */\n\t\t\tstops += buffer.get(buffer.size() - 1);\n\t\t\ttstops += tbuffer.get(tbuffer.size() - 1);\n\n\t\t\t// }\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + stops);\n\t\t// System.out.println(\"time stamps:\\t\" + tstops);\n\t\treturn new Obs(stops, tstops);\n\n\t}", "public int CalcDistance ( )\r\n\t{\r\n\t\tfor ( int i = 0; i<size; i++ )\r\n\t\t{\r\n\t\t\tfor ( int offR = 0; offR <= size/2; offR++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( int offR = size-1; offR >= size/2; offR-- )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\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 maze [currentRow] [currentCol].getDistanceToExit();\r\n\t}", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "private void goKnight(Board B, Graph G) {\n\n int start = B.knight;\n int end = B.gold;\n\n Queue<Integer> q = new Queue<Integer>();\n for (int v = 0; v < G.V(); v++)\n distTo[v] = INFINITY;\n\n int v = -1;\n distTo[start] = 0;\n marked[start] = true;\n q.enqueue(start);\n\n while (!q.isEmpty() && end != v) {\n v = q.dequeue();\n\n\n int tl_dest_R = (v / B.width);\n int tl_dest_C = (v % B.width);\n\n ArrayList<Integer> destinations = new ArrayList<Integer>();\n\n for (Move M : G.moves) {\n\n\n if (validateMove(M, v, G, B)) {\n\n if (true) {\n\n //System.out.println(thereispath(M, B.a.get(tl_dest_R).get(tl_dest_C), newDestination(M, v, G, B), G, B));\n\n if (!marked[newDestination(M, v, G, B)]) {\n\n\n q.enqueue(newDestination(M, v, G, B));\n marked[newDestination(M, v, G, B)] = true;\n edgeTo[newDestination(M, v, G, B)] = v;\n distTo[newDestination(M, v, G, B)] = distTo[v] + 1;\n\n // System.out.println(newDestination(M, v, G, B) + \" \" + edgeTo[newDestination(M, v, G, B)]);\n\n }\n\n\n }\n\n // System.out.println();\n\n }\n\n }\n\n\n //break;\n }\n\n System.out.println();\n\n Stack<Integer> reverse = new Stack<Integer>();\n\n\n int temp = end;\n reverse.push(temp);\n\n while (true) {\n\n\n temp = edgeTo[temp];\n reverse.push(temp);\n\n if (temp == start)\n break;\n }\n\n int last = 0;\n\n int temp_row = 0, temp_column = 0;\n\n String te = \"\";\n\n while (!reverse.isEmpty()) {\n\n if (last != 0) {\n te += \" -> \";\n }\n\n\n last = reverse.pop();\n\n\n temp_row = last / B.width;\n temp_column = last % B.width;\n\n\n te += B.a.get(temp_row).get(temp_column).toT();\n\n\n }\n\n if (distTo[last] == INFINITY) {\n System.out.println(\"No path to the target.\");\n } else {\n\n int a = 0, b = 0;\n\n a = B.gold / B.width;\n b = B.gold % B.width;\n int c = 0, d = 0;\n\n c = B.knight / B.width;\n d = B.knight % B.width;\n\n System.out.println(distTo[last] + \" steps\");\n System.out.println(B.a.get(c).get(d).toT() + \" to \" + B.a.get(a).get(b).toT() + \": \" + te);\n\n }\n\n\n }", "private static void test(int xy, int si, int sj, int ei, int ej, int[][] blocked){\n System.out.println(\"\\n\\nTest Case #\"+tCase);tCase++;\n //Reset\n long start_time = System.nanoTime();\n grid = new Cell[xy][xy];\n closed = new boolean[xy][xy];\n open = new PriorityQueue<>((Object o1, Object o2) -> {\n Cell c1 = (Cell)o1;\n Cell c2 = (Cell)o2;\n\n return Integer.compare(c1.finalCost, c2.finalCost);\n });\n //Set start position\n setStartCell(si, sj); //Setting to 0,0 by default\n\n //Set End Location\n setEndCell(ei, ej);\n\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n grid[i][j] = new Cell(i, j);\n grid[i][j].heuristicCost = Math.abs(i-endI)+Math.abs(j-endJ);\n //System.out.print(grid[i][j].heuristicCost+\" \");\n }\n //System.out.println();\n }\n grid[si][sj].finalCost = 0;\n\n //Set blocked cells to null\n for (int bX = 0; bX < blocked.length; bX++) {\n for (int bY = 0; bY < blocked.length; bY++)\n if (blocked[bX][bY] == 1)\n setBlocked(bX, bY);\n }\n\n String[][] maze = new String[xy][xy];\n //Display initial map\n System.out.println(\"Grid: \");\n char block = '▋';\n String open = \"[]\";\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n if(i==si&&j==sj){ System.out.print(\"SO \"); //Source\n maze[i][j] = \"SO \"; }\n else if(i==ei && j==ej){ System.out.print(\"DE \"); //Destination\n maze[i][j] = \"DE \"; }\n else if(grid[i][j]!=null){ System.out.print(open + \" \");\n maze[i][j] = open + \" \"; }\n else{ System.out.print(block + \" \");\n maze[i][j] = block + \" \"; }\n }\n System.out.println();\n }\n System.out.println();\n\n AStar();\n System.out.println(\"\\nScores for cells: \");\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n if(grid[i][j]!=null)System.out.printf(\"%-4d \", grid[i][j].finalCost);\n else System.out.print(block + \" \");\n }\n System.out.println();\n }\n System.out.println();\n\n if(closed[endI][endJ]){\n //Trace back the path\n System.out.println(\"Path: \");\n Cell current = grid[endI][endJ];\n System.out.print(current);\n ArrayList<Cell> path = new ArrayList<>();\n path.add(current);\n while(current.parent!=null){\n System.out.print(\" -> \"+current.parent);\n current = current.parent;\n path.add(current);\n }\n System.out.println(\"\\n\");\n\n Collections.reverse(path);\n\n for (Cell index : path) {\n if (path.contains(index))\n maze[index.i][index.j] = \"- \";\n }\n\n //Display final path\n System.out.println(\"Final Path: \");\n System.out.println(path.toString() + \"\\n\");\n\n for(int i=0;i<xy;++i) {\n for (int j = 0; j < xy; ++j) {\n if(i==si&&j==sj)System.out.print(\"SO \"); //Source\n else if(i==ei && j==ej)System.out.print(\"DE \"); //Destination\n else System.out.print(maze[i][j]);\n }\n System.out.println();\n }\n\n System.out.println();\n }else System.out.println(\"No possible path\");\n\n long end_time = System.nanoTime();\n double difference = (end_time - start_time) / 1e6;\n\n System.out.println(difference + \"ms\\n\");\n\n }", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "public List<flight> timeSwich(List<flight> FlightInfo, List<airportInformation> airport){\n\t flight ThisInfo = new flight();\n\t airportInformation ai = new airportInformation();\n\t Iterator AllInfo = FlightInfo.iterator();\n\t \n\t SimpleDateFormat OTime = new SimpleDateFormat(\"yyyy_MM_dd HH:mm\");\n\t OTime.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t SimpleDateFormat NTime = new SimpleDateFormat(\"yyyy_MM_dd HH:mm\");\n\t String[] parts;\n\t String ThisTime;\n\t String[] airportName = ai.sortAirportName(airport);\n\t \n\t while (AllInfo.hasNext())\n\t { \n\t ThisInfo= (flight)AllInfo.next();//From this we can get the arriving airport and departing airport\n\t String date = ThisInfo.getDepartingDate()+\" \"+ThisInfo.getDepartingTime();\n\t Date FTime = null;\n\t switch (ai.getAirportRank(airportName, ThisInfo.getDepartingAirport())){\n\t case 0:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Anchorage\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 1:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 2:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 3:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 4:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 5:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 6:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Chicago\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 7:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Chicago\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 8:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 9:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 10:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 11:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 12:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Denver\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 13:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Detroit\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 14:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 15:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 16:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 17:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"Pacific/Honolulu\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 18:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 19:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 20:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Indiana/Indianapolis\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 21:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 22:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 23:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Los_Angeles\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 24:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 25:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 26:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 27:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 28:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 29:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 30:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 31:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 32:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 33:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 34:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 35:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 36:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Phoenix\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 37:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 38:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 39:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 40:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Mountain\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 41:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 42:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 43:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 44:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 45:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Paciifc\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 46:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 47:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 48:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 49:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t case 50:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTime= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTime);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setDepartingDate(parts[0]);\n\t ThisInfo.setDepartingTime(parts[1]);\n\t break;\n\t \n\t }\n\t }\n\t Iterator AllInf = FlightInfo.iterator(); \n\t while (AllInf.hasNext())\n\t { ThisInfo=(flight)AllInf.next();\n\t String date = ThisInfo.getArrivingDate()+\" \"+ThisInfo.getArrivingTime();\n\t Date FTim = null;\n\t switch (ai.getAirportRank(airportName, ThisInfo.getArrivingAirport())){\n\t case 0:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Anchorage\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 1:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 2:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 3:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 4:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 5:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 6:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Chicago\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 7:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Chicago\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 8:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 9:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 10:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 11:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 12:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Denver\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 13:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Detroit\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 14:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 15:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 16:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 17:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"Pacific/Honolulu\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 18:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 19:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 20:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Indiana/Indianapolis\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 21:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 22:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 23:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Los_Angeles\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 24:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 25:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 26:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 27:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 28:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 29:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 30:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 31:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 32:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 33:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 34:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 35:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 36:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"America/Phoenix\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 37:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 38:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 39:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 40:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Mountain\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 41:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 42:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 43:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 44:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 45:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Paciifc\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 46:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Pacific\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 47:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 48:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 49:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t case 50:\n\t NTime.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t try{\n\t FTim= OTime.parse(date);\n\t } catch (ParseException e) {\n\t e.printStackTrace();\n\t }\n\t ThisTime = NTime.format(FTim);\n\t parts = ThisTime.split(\" \");\n\t ThisInfo.setArrivingDate(parts[0]);\n\t ThisInfo.setArrivingTime(parts[1]);\n\t break;\n\t \n\t }\n\t }\n\t \n\t return FlightInfo;\n\t }", "public void fillArrivals(int stoppingTime)\r\n {\r\n //schedule the first customer entering \r\n nextarrivalTime += -Math.log(random.nextFloat())/arrivalRate;\r\n CustomerEvent firstEvent = new CustomerEvent(customerNum++, nextarrivalTime , CustomerEvent.ENTER);\r\n //add that customer to the event queue\r\n eventSet.add(firstEvent);\r\n //next Customer's arrivalTime (Customer 2)\r\n nextarrivalTime += -Math.log(random.nextFloat())/arrivalRate;\r\n \r\n while(nextarrivalTime<stoppingTime){\r\n //add in rest of customer arrival events\r\n CustomerEvent nextArrival = new CustomerEvent(customerNum++, nextarrivalTime, CustomerEvent.ENTER);\r\n nextarrivalTime += -Math.log(random.nextFloat())/arrivalRate;\r\n eventSet.add(nextArrival);\r\n }\r\n }", "public void done(Customer c){\n String output_done = String.format(\"%.3f\", c.getLeavingTime())+\" \"+c.getID()+\" done\";\n System.out.println(output_done);\n\n scheduler.arrivals.removeFirst();\n cc = null;\n\n //System.out.println(\"the first customer now should be nc, and will become cc \"+nc.getID()==scheduler.arrivals.get(0).getID());\n //System.out.println(scheduler.arrivals.size());//sth wrong here\n\n //run();\n\n }", "public static void execute(StringBuffer path, HashMap<String, Zpair> stores\n , HashSet<Zpair> visited, List<String> q111\n , List<Integer> sortedQueue) {\n\n //System.out.println(\" \" + executeCounter++);\n //System.out.println(\"This is the path : \" + path);\n int size = path.length(); // size of current path\n StringBuffer oldPath = new StringBuffer(path.substring(0,size-1));\n\n Zpair tuple = stores.get(oldPath.toString()); // (q1,s1) = stores[oldPath]\n List<Integer> q = new ArrayList<Integer>(tuple.first); // q = q1.copy()\n List<Integer> s = new ArrayList<Integer>(tuple.second); // s = s1.copy()\n\n char qORs = path.charAt(size - 1);\n\n if (qORs == 'Q') {\n if (!moveQ1(q, s)) {\n return;\n }\n } else if (qORs == 'S') {\n if (!moveS1(q, s)) {\n return;\n }\n }\n if (size % 2 == 0) {\n if (q.equals(sortedQueue)) {\n //printList(q);\n //printList(s);\n System.out.println(path);\n System.exit(1);\n }\n }\n\n Zpair tuple1 = new Zpair(ZMethods.listCopyOfIntegers(q)\n , ZMethods.listCopyOfIntegers(s));\n\n stores.put(path.toString(), tuple1);\n if (!visited.contains(tuple1)) {\n visited.add(tuple1);\n if (q.size() != 0 && s.size() != 0) {\n if (q.get(0) == s.get(s.size() - 1)) {\n q111.add(path + \"Q\");\n return;\n }\n }\n if (q.size() != 0) {\n q111.add(path + \"Q\");\n }\n if (s.size() != 0) {\n q111.add(path + \"S\");\n }\n //printList(q111);\n }\n }", "public static void main(String args[]) throws IOException {\n int[] distance = new int[999 * 999]; // 999 is the max size of rows and cols\n int[] grid = new int[999 * 999];\n int tests = Integer.parseInt(getLine().trim());\n for (int i = 1; i <= tests; i++) {\n int rows = Integer.parseInt(getLine().trim());\n int cols = Integer.parseInt(getLine().trim());\n for (int r = 0; r < rows; r++) {\n StringTokenizer st = new StringTokenizer(getLine());\n for (int c = 0; c < cols; c++) {\n grid[r * cols + c] = Integer.parseInt(st.nextToken());\n }\n }\n\n int goal = (rows - 1) * cols + (cols - 1);\n int start = 0;\n Arrays.fill(distance, 0, rows * cols, INFINITY);\n distance[start] = grid[0];\n CustomPriorityQueue pq = new CustomPriorityQueue();\n pq.add(new Tuple(grid[0], start), grid[0]);\n while (!pq.isEmpty()) {\n Tuple current = pq.remove();\n if (distance[current.cell] < current.d); // we know shorter path already\n if (current.cell == goal) break;\n int r = current.cell / cols;\n int c = current.cell % cols;\n for (int j = 0; j < DELTA_R.length; j++) {\n int nr = r + DELTA_R[j];\n int nc = c + DELTA_C[j];\n if (nr < 0 || nr >= rows || nc < 0 || nc >= cols) continue; // out of bounds\n int next = nr * cols + nc;\n if (distance[next] > distance[current.cell] + grid[next]) {\n distance[next] = distance[current.cell] + grid[next];\n pq.add(new Tuple(distance[next], next), grid[next]);\n }\n }\n }\n\n out.println(distance[goal]);\n }\n out.close();\n }", "public static void main(String[] args) {\n\n long preTime = System.currentTimeMillis();\n System.out.println(\"Possible moves to traverse Grid -> \" + gridMemo(15, 15));\n long postTime = System.currentTimeMillis();\n System.out.println(\"Time taken to compute in milliseconds-> \" + (postTime - preTime));\n\n// long preTime = System.currentTimeMillis();\n// System.out.println(\"Possible moves to traverse Grid -> \" + gridBottomUp(15, 15));\n// long postTime = System.currentTimeMillis();\n// System.out.println(\"Time taken to compute in milliseconds-> \" + (postTime - preTime));\n\n }", "private void findWaitingTime(int wt[]) {\n\t\tint rt[] = new int[n];\r\n\t\t\r\n\t\tfor(int i=0;i<n;i++) {\r\n\t\t\trt[i] = processList.get(i).getBurstTime();\r\n\t\t}\r\n\t\t\r\n\t\tint completed = 0,t=0,minm = Integer.MAX_VALUE;\r\n\t\tint shortest = 0, finish_time;\r\n\t\t\r\n\t\tboolean check = false;\r\n\t\t\r\n\t\twhile(completed!=n) {\r\n\t\t\t// find process with min rmaining time\r\n\t\t\tfor(int i=0; i<n ;i++) {\r\n\t\t\t\tif (processList.get(i).getArrivalTime()<=t && rt[i]<minm && rt[i]>0) {\r\n\t\t\t\t\tminm = rt[i];\r\n\t\t\t\t\tshortest = i;\r\n\t\t\t\t\tcheck = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(check == false) {\r\n\t\t\t\tt++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trt[shortest]--;\r\n\t\t\t\r\n\t\t\tif (minm == 0) {\r\n\t\t\t\tminm = Integer.MAX_VALUE;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (rt[shortest]==0) {\r\n\t\t\t\tcompleted++;\r\n\t\t\t\tcheck=false;\r\n\t\t\t\t\r\n\t\t\t\tfinish_time = t+1;\r\n\t\t\t\t\r\n\t\t\t\twt[shortest] = finish_time - processList.get(shortest).getBurstTime() - processList.get(shortest).getArrivalTime();\r\n\t\t\t\t\r\n\t\t\t\tif (wt[shortest]<0) {\r\n\t\t\t\t\twt[shortest] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tt++;\r\n\t\t}\r\n\t}", "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 void findShortestPath() {\r\n\t\t\r\n\t\t//Create a circular array that will store the possible next tiles in the different paths.\r\n\t\tOrderedCircularArray<MapCell> path = new OrderedCircularArray<MapCell>();\r\n\t\t\r\n\t\t//Acquire the starting cell.\r\n\t\tMapCell starting = cityMap.getStart();\r\n\t\t\r\n\t\t//This variable is to be updated continuously with the cell with the shortest distance value in the circular array.\r\n\t\tMapCell current=null;\r\n\t\t\r\n\t\t//This variable is to check if the destination has been reached, which is initially false.\r\n\t\tboolean destination = false;\r\n\t\t\r\n\t\t//Add the starting cell into the circular array, and mark it in the list.\r\n\t\tpath.insert(starting, 0);\r\n\t\t\r\n\t\tstarting.markInList(); \r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//As long as the circular array isn't empty, and the destination hasn't been reached, run this loop.\r\n\t\t\twhile(!path.isEmpty()&&!destination) {\r\n\t\t\t\t\r\n\t\t\t\t//Take the cell with the shortest distance out of the circular array, and mark it accordingly.\r\n\t\t\t\tcurrent = path.getSmallest();\r\n\t\t\t\tcurrent.markOutList();\r\n\t\t\t\t\r\n\t\t\t\tMapCell next;\r\n\t\t\t\tint distance;\r\n\t\t\t\t\r\n\t\t\t\tif(current.isDestination()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tdestination = true; //If the current cell is the destination, end the loop.\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\tnext = nextCell(current); //Acquire the next possible neighbour of the current cell.\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Don't run if next is null, meaning there is no other possible neighbour in the path for the current cell.\r\n\t\t\t\t\twhile(next!=null) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdistance = current.getDistanceToStart() + 1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//If the distance of the selected neighbouring cell is currently more than 1 more than the current cell's \r\n\t\t\t\t\t\t//distance, update the distance of the neighbouring cell. Then, set the current cell as its predecessor.\r\n\t\t\t\t\t\tif(next.getDistanceToStart()>distance) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnext.setDistanceToStart(distance);\r\n\t\t\t\t\t\t\tnext.setPredecessor(current);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdistance = next.getDistanceToStart(); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(next.isMarkedInList() && distance<path.getValue(next)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpath.changeValue(next, distance); //If the neighbouring cell is in the circular array, but with a \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //larger distance value than the new updated distance, change its value.\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else if(!next.isMarkedInList()){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpath.insert(next, distance); //If the neighbouring cell isn't in the circular array, add it in.\r\n\t\t\t\t\t\t\tnext.markInList();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tnext = nextCell(current); //Look for the next possible neighbour, if any.\r\n\t\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\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Catch all the possible exceptions that might be thrown by the method calls. Print the appropriate messages.\r\n\t\t} catch (EmptyListException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (InvalidNeighbourIndexException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"The program tried to access an invalid neighbour of a tile.\");\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (InvalidDataItemException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage()+\" Path finding execution has stopped.\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//If a path was found, print the number of tiles in the path.\r\n\t\tif(destination) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Number of tiles in path: \" + (current.getDistanceToStart()+1));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"No path found.\"); //Otherwise, indicate that a path wasn't found.\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public void printSimulationState(){\n\n boolean flagActive = false;\n\n //boolean unloadPassengersNow = false;\n \n boolean timeHasArrived = false;\n \n //sleeps for 20 to allow threads to run\n try{\n Thread.sleep(20);\n }catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n \n //configures flags\n for(int i = 0; i< a; i++){ \n if(flagActive != true)\n flagActive = (elevatorArray[i].getScanCompleteFlag() || elevatorArray[i].getScannedBuildingFloorFlag());\n\n \n //System.out.println(\"====\" + SimClock.getTime());\n //System.out.println(\"====\" + elevatorArray[i].getMoveQueue().get(0).getExpectedArrival());\n \n if(timeHasArrived != true){\n if ((SimClock.getTime() >= nextArrivalTime) && (nextArrivalTime != -2)){\n timeHasArrived = true;\n }\n \n if (elevatorArray[i].getMoveQueue().size() > 0){\n nextArrivalTime = elevatorArray[i].getMoveQueue().get(0).getExpectedArrival();\n }else{\n nextArrivalTime = -2;\n }\n }\n \n if (flagActive && timeHasArrived){\n break;\n }\n }\n\n \n if(flagActive || timeHasArrived){\n System.out.println(\"********************** @\" + (SimClock.getTime()) + \" Simulated Seconds **********************\"); \n \n System.out.println(\"Building Floors:\");\n for(int i = 0; i < aBuildingManager.getFloors().length; i++){\n int[] passengerRequestArray = aBuildingManager.getFloors()[i].getPassengerRequests();\n System.out.println(\" \" + \"Floor \" + (i+1) + \": \" + Arrays.toString(passengerRequestArray));\n }\n System.out.println();\n \n for (int i = 0; i< a; i++){\n System.out.println();\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \"\\n\" + \"# of Passengers: \" + Arrays.toString(elevatorArray[i].getPassengerDestinations()) + \"\\n\" + \"Current Floor: \" + (elevatorArray[i].getCurrentFloor()+1) + \n \"\\nTotal Unloaded Passengers: \" + elevatorArray[i].getTotalUnloadedPassengers() + \"\\n\" + \"Total Loaded Passengers: \" + elevatorArray[i].getTotalLoadedPassengers() );\n System.out.println(\"=============================================================\");\n } \n \n\n \n for (int i = 0; i < a; i++){\n //checking to see if there exists passengersToUnload and prints corresponding output\n\n if(elevatorArray[i].getPassengersToUnload() != 0){ \n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" to unload passengers.\\n - \" + \n elevatorArray[i].getPassengersToUnload() + \" passengers are exiting the elevator.\");\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetPassengersToUnload();\n }\n \n if(elevatorArray[i].getScanCompleteFlag()){\n \n //prevFloorArray[i] = -1;\n //floorChanged = false;\n \n System.out.println();\n System.out.println(\"=============================================================\");\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" and picked up \" + elevatorArray[i].getNumPassengers() + \" passenger(s).\");\n \n // iterating through each PassengerDestination in the Elevator to specify each floor's destination and amount\n // of passengers wanting to go to said floor\n for (int k = 0; k < elevatorArray[i].getPassengerDestinations().length; k++){\n if (elevatorArray[i].getPassengerDestinations()[k] != 0)\n System.out.println(\" - \" + elevatorArray[i].getPassengerDestinations()[k] + \" passenger(s) will go to Floor \" + (k+1));\n \n }\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetScanCompleteFlag();\n continue;\n \n // checking if ScanBuildingFloorFlag() triggered\n }else if(elevatorArray[i].getScannedBuildingFloorFlag()){\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" will go to Floor \" + (elevatorArray[i].getMoveQueue().get(0).getDestination()+1) + \" to load passengers.\");\n \n //prevFloorArray[i] = -2;\n elevatorArray[i].resetScannedBuildingFloorFlag();\n continue;\n }\n }\n \n flagActive = false;\n timeHasArrived = false; \n System.out.println();\n }\n \n\n}", "private static void checkForOppositeAlreadyPlacedOrders(Stock stock,\n List<Order> oppositeAlreadyPlacedOrders,\n Order arrivedOrder,\n AtomicBoolean arrivedOrderWasTreated,\n AtomicLong serialTime) {\n for (Iterator<Order> it = oppositeAlreadyPlacedOrders.iterator();\n it.hasNext(); ) {\n Order oppositeAlreadyPlacedOrder = it.next();\n\n /*\n * check if the 'arrivedOrder' is a 'Sell' Order.\n * compare orders: if 'buy' >= 'sell':\n */\n if (checkForOppositeBuyAlreadyPlacedOrders(stock, arrivedOrder, it,\n oppositeAlreadyPlacedOrder, arrivedOrderWasTreated,\n serialTime)) {}\n\n /*\n * check if the 'arrivedOrder' is a 'Buy' Order.\n * compare orders: if 'buy' >= 'sell':\n */\n else if (checkForOppositeSellAlreadyPlacedOrders(stock,\n arrivedOrder, it, oppositeAlreadyPlacedOrder,\n arrivedOrderWasTreated, serialTime)) {}\n\n /*\n * we found that there are no matching 'opposite already placed' Orders,\n * so we do not make a Transaction,\n * and the 'arrived' Order stays as it was in the data-base.\n */\n }\n }", "private static void AStar(){\n open.add(grid[startI][startJ]);\n\n Cell current;\n\n while(true){\n current = open.poll();\n if(current==null)break;\n closed[current.i][current.j]=true;\n\n if(current.equals(grid[endI][endJ])){\n return;\n }\n\n Cell t;\n if(current.i-1>=0){\n t = grid[current.i-1][current.j];\n checkAndUpdateCost(current, t, current.finalCost+V_H_COST);\n\n if(current.j-1>=0){\n t = grid[current.i-1][current.j-1];\n checkAndUpdateCost(current, t, current.finalCost+DIAGONAL_COST);\n }\n\n if(current.j+1<grid[0].length){\n t = grid[current.i-1][current.j+1];\n checkAndUpdateCost(current, t, current.finalCost+DIAGONAL_COST);\n }\n }\n\n if(current.j-1>=0){\n t = grid[current.i][current.j-1];\n checkAndUpdateCost(current, t, current.finalCost+V_H_COST);\n }\n\n if(current.j+1<grid[0].length){\n t = grid[current.i][current.j+1];\n checkAndUpdateCost(current, t, current.finalCost+V_H_COST);\n }\n\n if(current.i+1<grid.length){\n t = grid[current.i+1][current.j];\n checkAndUpdateCost(current, t, current.finalCost+V_H_COST);\n\n if(current.j-1>=0){\n t = grid[current.i+1][current.j-1];\n checkAndUpdateCost(current, t, current.finalCost+DIAGONAL_COST);\n }\n\n if(current.j+1<grid[0].length){\n t = grid[current.i+1][current.j+1];\n checkAndUpdateCost(current, t, current.finalCost+DIAGONAL_COST);\n }\n }\n }\n }", "long getTimeSinceLastRise(Coordinates coord, double horizon, long time) throws AstrometryException;", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public void addCustomer(Customer customer, double time){\n if(numCustomers == cMaxCustomerQueue) {\n System.out.println(\"Queue is full\");\n System.exit(1);\n }\n customerArray[inIndex] = customer;\n length = inIndex - outIndex;\n timeSpent += time - prevTime;\n average += ((time - prevTime) * length)/time;\n prevTime = time;\n inIndex++;\n length = inIndex - outIndex;\n totalLength += length;\n\n if(longestQueue < length){\n longestQueue = length;\n }\n if(inIndex == cMaxCustomerQueue) inIndex = 0;\n numCustomers++;\n totCustomersInQueue++;\n }", "public Double[] placeaDomino(Player p, Domino d, int decision) {\r\n double rotation = 0;\r\n double x0 = 0;\r\n double y0 = 0;\r\n int e = 0;\r\n System.out.println(\"Moving domino \" + d.toString() + \"in table \" + this.getName());\r\n System.out.println(\"End1: \" + end[0] + \" End2: \" + end[1]);\r\n int[] aux = new int[2];\r\n //First tile\r\n if (end[0] == 100) {\r\n end[0] = d.getNumber1();\r\n end[1] = d.getNumber2();\r\n\r\n x0 = endx[0];\r\n y0 = endy[0];\r\n if (!d.isDoble()) {\r\n rotation = 90.0;\r\n endx[0] += 40;\r\n endx[1] -= 40;\r\n } else {\r\n endx[0] += 20;\r\n endx[1] -= 20;\r\n\r\n }\r\n aux[1] = 1;\r\n playedDominoes.add(d);\r\n } else {\r\n // get current end\r\n aux = findend(d);\r\n e = aux[0];\r\n if (aux[1] == 2 && decision != 10) {\r\n e = decision;\r\n System.out.println(\"Choosed End \" + decision);\r\n aux[1]=1;\r\n }\r\n if (aux[1] != 2) {\r\n end[e] = d.getOppositeNumber(d.getMatch(end[e]+1));\r\n rotation = getRotation(e, d.isDoble());\r\n if (end[e] == d.getNumber1()) {\r\n rotation += 180;\r\n }\r\n translate(e, d.isDoble());\r\n x0 = endx[e];\r\n y0 = endy[e];\r\n\r\n // calculate coordinates for next move\r\n translate(e, d.isDoble());\r\n drive(e);\r\n playedDominoes.add(d);\r\n\r\n }\r\n }\r\n //1 when it is the regular \r\n //2 you can choose the end \r\n //0 ended round\r\n //4 ended Game\r\n //3 blocked\r\n if (p.makeaMove(d)) {\r\n if (!this.endGame(p)) {\r\n return new Double[]{x0, y0, rotation, 0.0};\r\n } else {\r\n return new Double[]{x0, y0, rotation, 4.0};\r\n }\r\n } else if (this.blockedGame()) {\r\n if (!this.endGame(p)) {\r\n return new Double[]{x0, y0, rotation, 3.0};\r\n } else {\r\n return new Double[]{x0, y0, rotation, 4.0};\r\n }\r\n }\r\n System.out.println(aux[1] + \" times\");\r\n /**\r\n * *\r\n */\r\n return new Double[]{x0, y0, rotation, (double) aux[1]};\r\n }", "public int maxEvents(int[] arrival, int[] duration) {\n int[][] events = new int[arrival.length][2];\n for (int i = 0; i < arrival.length; i++) {\n events[i] = new int[] {arrival[i], arrival[i] + duration[i]};\n }\n\n // events = [[1, 3], [3, 5], [3, 4], [5, 7], [7, 8]]\n // use start as a sweep line, from left to right\n // 1. create arrays to record all start points, and ends points\n // 2. sort starts and ends \n // 3. sweep starts and ends from left to right\n // time: O(nlogn), space: O(n)\n\n int[] starts = new int[events.length];\n int[] ends = new int[events.length];\n for (int i = 0; i < events.length; i++) {\n starts[i] = events[i][0];\n ends[i] = events[i][1];\n }\n\n Arrays.sort(starts);\n Arrays.sort(ends);\n\n int results = 0;\n int end = 0;\n for (int i = 0; i < events.length; i++) {\n if (starts[i] < ends[end]) {\n results++;\n } else {\n end++;\n }\n }\n return results;\n}", "@SuppressWarnings(\"unused\")\n private void notSoLazyPathfinder(final Coords dest, final MoveStepType type,\n final int timeLimit) {\n final long endTime = System.currentTimeMillis() + timeLimit;\n\n MoveStepType step = type;\n if (step != MoveStepType.BACKWARDS) {\n step = MoveStepType.FORWARDS;\n }\n\n final MovePathComparator mpc =\n new MovePathComparator(dest, step == MoveStepType.BACKWARDS);\n\n MovePath bestPath = clone();\n\n // A collection of paths we have already explored\n final HashMap<MovePath.Key, MovePath> discovered =\n new HashMap<MovePath.Key, MovePath>();\n discovered.put(bestPath.getKey(), bestPath);\n\n // A collection of hte possible next-moves\n final PriorityQueue<MovePath> candidates =\n new PriorityQueue<MovePath>(110, mpc);\n candidates.add(bestPath);\n\n boolean keepLooping = getFinalCoords().distance(dest) > 1;\n int loopcount = 0;\n\n // Keep looping while we have candidates to explore, and certain stop\n // conditions aren't met (time-limit, destination found, etc)\n while ((candidates.size() > 0) && keepLooping) {\n final MovePath candidatePath = candidates.poll();\n final Coords startingPos = candidatePath.getFinalCoords();\n final int startingElev = candidatePath.getFinalElevation();\n\n // Check to see if we have found the destination\n if (candidatePath.getFinalCoords().distance(dest) == 0) {\n bestPath = candidatePath;\n keepLooping = false;\n break;\n }\n\n // Get next possible steps\n final Iterator<MovePath> adjacent =\n candidatePath.getNextMoves(step == MoveStepType.BACKWARDS,\n step == MoveStepType.FORWARDS).iterator();\n // Evaluate possible next steps\n while (adjacent.hasNext()) {\n final MovePath expandedPath = adjacent.next();\n\n if (expandedPath.getLastStep().isMovementPossible(getGame(),\n startingPos, startingElev)) {\n\n if (discovered.containsKey(expandedPath.getKey())) {\n continue;\n }\n candidates.add(expandedPath);\n discovered.put(expandedPath.getKey(), expandedPath);\n // Make sure the candidate list doesn't get too big\n if (candidates.size() > 100) {\n candidates.remove(candidates.size() - 1);\n }\n }\n }\n // If we're doing a special movement, like charging or DFA, we will\n // have to take extra steps to see if we can finish off the move\n // this is because getNextMoves only considers turning and\n // forward/backward movement\n if (type == MoveStepType.CHARGE ||\n type == MoveStepType.DFA){\n MovePath expandedPath = candidatePath.clone();\n expandedPath.addStep(type);\n if (expandedPath.getLastStep().isMovementPossible(getGame(),\n startingPos, startingElev)) {\n\n if (discovered.containsKey(expandedPath.getKey())) {\n continue;\n }\n candidates.add(expandedPath);\n discovered.put(expandedPath.getKey(), expandedPath);\n // Make sure the candidate list doesn't get too big\n if (candidates.size() > 100) {\n candidates.remove(candidates.size() - 1);\n }\n }\n }\n\n\n loopcount++;\n if (((loopcount % 256) == 0) && keepLooping\n && (candidates.size() > 0)) {\n final MovePath front = candidates.peek();\n if (front.getFinalCoords().distance(dest) < bestPath\n .getFinalCoords().distance(dest)) {\n bestPath = front;\n }\n if (System.currentTimeMillis() > endTime) {\n keepLooping = false;\n System.out.println(\"Time limit reached searching \" +\n \"for path!\");\n }\n }\n } // end while\n //System.out.println(\"iteration count: \" + loopcount);\n if (getFinalCoords().distance(dest) > bestPath.getFinalCoords().distance(dest)) {\n // Make the path we found, this path.\n steps = bestPath.steps;\n }\n if (!getFinalCoords().equals(dest)) {\n lazyPathfinder(dest, type);\n }\n }", "public static void compareAStarW(List<Position> places, double start, double end, double step) {\n if (end < start) {\n double tmp = end;\n end = start;\n start = tmp;\n }\n Node startNode = graph.findClosest(places.get(0), false);\n Node endNode = graph.findClosest(places.get((1)), false);\n System.out.println(\"==================================================\");\n System.out.println(\"Benchmark A-Star with weighted h\");\n System.out.println(\"From \" + start + \" to \" + end + \" steps \" + step);\n System.out.println(distance.calcDist(startNode, endNode));\n System.out.println(\"==================================================\");\n System.out.println();\n\n // Vergleichs A-Stern mit w = 1\n AStarResult compareResult;\n try {\n compareResult = AStarAlgorithm.search(graph, startNode, endNode, \"Compare\", 1);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n return;\n }\n\n //\n double curr;\n for (curr = start; curr <= end; curr += step) {\n Path path = new Path(\"\");\n AStarResult result;\n try {\n result = AStarAlgorithm.search(graph, startNode, endNode, \"Compare \" + curr, curr);\n path.addSegment(result.getPath());\n FileWriter fstream = new FileWriter(curr + \".gpx\");\n BufferedWriter out = new BufferedWriter(fstream);\n String gpx = GPXBuilder.build(path.getGeoLineString(true), path.getName());\n out.write(gpx);\n out.close();\n fstream.close();\n System.out.println(\"Result for w=\" + curr);\n System.out.println(\"Expanded Nodes: \" + result.getExpandedNodesCount() + \" (\" + (result.getExpandedNodesCount() - compareResult.getExpandedNodesCount()) + \")\");\n System.out.println(\"Path Length: \" + result.getPath().getLength() + \" (\" + (result.getPath().getLength() - compareResult.getPath().getLength()) + \")\");\n System.out.println(\"SortTime: \" + result.getSorttime() + \" (\" + (result.getSorttime() - compareResult.getSorttime()) + \")\");\n System.out.println(\"Runtime: \" + result.getRuntime() + \" (\" + (result.getRuntime() - compareResult.getRuntime()) + \")\");\n System.out.println();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }", "public static void main(String[] args)\n\t\t\tthrows CloneNotSupportedException, SQLException, ClassNotFoundException, DAOException, IOException, CustomException {\n\t\tif(GeneralDAO.getRooms().size()<2){\n\t\t\tTransactionStatus.setStatusMessage(\"There must be atleast 2 rooms !\");\n\t\t\tthrow new CustomException(\"\");\n\t\t}\n\t\tTimeTableEndSem TT = new TimeTableEndSem();\n\t\tSet<Integer> set = new HashSet<>();// stores batch numbers of\n\t\t\t\t\t\t\t\t\t\t\t// timeinterval2 of odd slots\n\t\t// Running main algorithm for all the slots.It creates timetable of all\n\t\t// the slots separately.\n\t\tfor (int h = 0; h < TT.getSlot().length; h++)//\n\t\t{\n\t\t\tSystem.out.println(\"**************************SLOT NO: \" + (h + 1) + \"****************************\");\n\t\t\t// System.out.println(\"Room No Course ID Course Name\");\n\n\t\t\t// if((h+1)%2==0)\n\t\t\t// {\n\t\t\t// set.removeAll(set);//clear set for reuse\n\t\t\t// }\n\t\t\t//\n\n\t\t\tTimeInterval time1 = new TimeInterval(1);\n\t\t\tTimeInterval time2 = new TimeInterval(2);\n\t\t\tint flag = 0;// a flag to use to forcibly exit loops or restarting\n\t\t\t\t\t\t\t// loops.\n\t\t\tTimeInterval[] array = { time1, time2 };\n\t\t\tint p = 0;\n\t\t\tSlot slot = TT.getSlot()[h];\n\n\t\t\tif (h == 0) {\n\n\t\t\t\tHashSet<Integer> set2 = new HashSet<>();\n\t\t\t\tfor (Course course : GeneralDAO.getCourses(2)) {\n\t\t\t\t\tset2.add(Integer.parseInt(course.getBatch()));\n\t\t\t\t}\n\t\t\t\tfor (Course course : slot.getCourses()) {\n\t\t\t\t\tif (set2.contains(Integer.parseInt(course.getBatch()))) {\n\t\t\t\t\t\tcourse.setSlot1priority(1);\n\t\t\t\t\t}\n\t\t\t\t//\tSystem.out.println(course + \" and priority: \" + course.getSlot1priority());\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\"set2\"+set2);\n\t\t\t\t// for(Course course:slot.getSlot2courses())\n\t\t\t\t// System.out.println(course);\n\t\t\t} else if (h != 0) {\n\t\t\t\tfor (Course course : slot.getCourses()) {\n\t\t\t\t\tif (set.contains(Integer.parseInt(course.getBatch()))) {\n\t\t\t\t\t\tcourse.setFlag_clash(1);\n\t\t\t\t\t\t// System.out.println(\"setting flag_clash=1:::\"+course);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tset.removeAll(set);\n\t\t\tint k = 1;\n\t\t\t\n\t\t\tbuffer=new ArrayList<>();\n\t\t\twhile (slot.slotProcessed())// if all the courses are processed,\n\t\t\t\t\t\t\t\t\t\t// then loop breaks.\n\t\t\t{\n\t\t\t\t\n\t\t\t\tCourse tempCourse = slot.chosingCourse();// refer slot class for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// details\n\t\t\t\tbuffer.add(new Course(tempCourse));//copy of new course so that initial state is always fresh even if \n\t\t\t\t//source ArrayList in slot class is updated(when course is processed=true).\n\t\t\t\tCollections.sort(buffer, new CourseComparatorByCapacity());//reassigning priorities in descending order.\n\t\t\t\tSystem.out.println(\"Buffer:\");\n\t\t\t\tfor(Course course:buffer)\n\t\t\t\t\tSystem.out.println(course);\n\t\t\t\t//System.out.println(\"Address of:\"+tempCourse.getCourse_name()+\"\"+tempCourse);\n\t\t\t\tTimeInterval[] array2=null;\n\t\t\t\t\n\t\t\t\tbuffer_copy=new ArrayList<>();\n//\t\t\t\tfor(Course course:buffer)\n//\t\t\t\t{\n//\t\t\t\t\tCourse course_copy=new Course(course);\n//\t\t\t\t\tbuffer_copy.add(course_copy);\n//\t\t\t\t}\n\t\t\t\tUtility1 utility=null;\n\t\t\t\tboolean flag_failed_verified=false;\n\t\t\t\t\n\t\t\t\tif(true)//Except slot 1,all the slots are getting processed through buffer concept.\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tfor(Course course:buffer)\n\t\t\t\t\t{//\tSystem.out.println(\"buffer size:\"+buffer.size());\n\t\t\t\t\t\t//Course course=buffer.get(i);\n\t\t\t\t\t\t//System.out.println(\"Going bhaiuiiiiiiiiiiiiiiiiiiiii\");\n\t\t\t\t\t\t//System.out.println(course.hashCode());\n\t\t\t\t\tutility=TT.dynamicAllot(array2, course, slot, TT, 1,0,\"buffer\");\n\t\t\t\t\t//System.out.println(course.hashCode());\n\t\t\t\t\t//System.out.println(course.getProcessed());\n\t\t\t\t\t//System.out.println(\"Going bhaiuiiiiiiiiiiiiiiiiiiiii55555555\");\n\t\t\t\t//\tk=utility.k;//useless in this case.\n\t\t\t\t\tarray2=utility.array;//restoring array and slot after processing in above function.\n\t\t\t\t\tslot=utility.slot;\n\t\t\t\t\t//System.out.println(\"********************\");\n\t\t\t\t\tbuffer_copy.add(utility.course);// Storing all the courses of this buffer. This buffer_copy contains\n\t\t\t\t\t//Courses when all the courses from buffer have been processed and this needs to be updated to chosingCourse()\n\t\t\t\t\t//so that it choses next prior course.\n//\t\t\t\t\tarray2[0].print();\n//\t\t\t\t\tarray2[1].print();\n\t\t\t\t\tSystem.out.println(utility.course.getUnallocated_strength());\n\t\t\t\t\t\tif(utility.flag_failed==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"Flag Failed is verified\");\n\t\t\t\t\t\t\tflag_failed_verified=true;\n\t\t\t\t\t\t//\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t//\tSystem.out.println(course);\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//For first slot, no buffer concept and if a course could not be processed or it lead to alter the existing ti 2\n\t\t\t\t//structure, undo it and reallocate it in normal case. below is normal case as for slot1. Check TimeTable class\n\t\t\t\t//for CourseIntact. \n\t\t\t\t//NORMAL ALLOTMENT OPTION\n\t\t\t\tif(!TT.courseIntact(array, array2) || flag_failed_verified==true) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(tempCourse+\"finally going to ti2\");\n//\t\t\t\t\tif(!TT.courseIntact(array, array2))\n//\t\t\t\t\t\tk=1;//always gives k=0 if slot is not 1. Basically, I have ruled out alternating k from slot >1\n\t\t\t\t\t//System.out.println(\"In normal case,\"+buffer.get(0).getUnallocated_strength());\n\t\t\t\tUtility1 utility2=TT.dynamicAllot(array, tempCourse, slot, TT, 1,1,\"normal\");// normal case.\n\t\t\t//\tk=utility2.k;\n\t\t\t\tarray=utility2.array;\n\t\t\t\tslot=utility2.slot;\n\t\t\t\t//pass on course\n\t\t\t\t//System.out.println(\"----------\"+utility2.course+\" \"+utility2.course.getProcessed());\n\t\t\t\t\t\n\t\t\t\t//updating course in the source ArrayList of Slot class which chosingCourse() uses.\n\t\t\t\tfor(int n=0;n<slot.getCourses().size();n++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCourse course2=slot.getCourses().get(n);\n\t\t\t\t\t\t\tif(course2.getCourse_id().equals(utility2.course.getCourse_id()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tslot.getCourses().set(n, utility2.course);\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\telse\n\t\t\t\t{//if courseIntact is true, it means our buffer is successfully processed. Now, replace the existing \n\t\t\t\t\t//timeinterval with new one with updated data.\n\t\t\t\t\tarray=array2;\n\t\t\t\t\t\n\t\t\t\t\t//Further, update all the courses from buffer with modified state in buffer_copy to source arraylist\n\t\t\t\t\t//of slot class.\n\t\t\t\t\tfor(int n=0;n<slot.getCourses().size();n++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCourse course2=slot.getCourses().get(n);\n\t\t\t\t\t\tfor(Course course3:buffer_copy)\n\t\t\t\t\t\t\tif(course2.getCourse_id().equals(course3.getCourse_id()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tslot.getCourses().set(n, course3);\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\tslot.updateProcessCount(); //One iteration of while loop processes one course \n\t\t\t\t//fully irrespective of the fact that it has been failed, allocated in one go or in different buffer.\n\t\t\t\t\n\t\t\t}\n\t\t\tarray[0].print();\n\t\t\tarray[1].print();\n\t\t\tTT.getStore().put(h + 1, new StoreTT(h + 1, array[0], array[1]));\n\t\t\t//System.out.println(\"It's really painful************\");\n//\t\t\tSet<Course> set1 = new HashSet<>();\n//\t\t\tfor (ArrayList<OccupationData> od : array[0].getMap().values()) {\n//\t\t\t\tfor (int hh = 0; hh < od.size(); hh++) {\n//\t\t\t\t\tset1.add(od.get(hh).getCourse());\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t//System.out.println(\"set1\" + set1 + \"for k=\" + k);\n\t\t\t// System.out.println(set);\n\t\t\tif (!array[0].getMap().isEmpty())// if time2 has some courses\n\t\t\t\t\t\t\t\t\t\t\t\t// allocated\n\t\t\t{//System.out.println(\"Printingggg\"+array[0].getMap().size());\n\t\t\t\tfor (ArrayList<OccupationData> od : array[0].getMap().values())// stores\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// all\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// batches\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// time2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// in\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\"Printing\"+od.size());\n\t\t\t\t \tfor (int hh = 0; hh < od.size(); hh++) {\n\t\t\t\t\t\tset.add(Integer.parseInt(od.get(hh).getCourse().getBatch()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(set);\n\t\t}\n\t\t// It prints data in excel sheet and exports a .xlsx file\n\t\t// PrintExcel excel=new PrintExcel();\n\t\tPrintExcelEndSem excel = new PrintExcelEndSem();\n\n\t\tSystem.out.println(\"Following courses Failed\");\n\t\tfailedCourses = TT.getFailed();\n\t\tfor(Course course:failedCourses)\n\t\t{\n\t\t\tSystem.out.println(course.getCourse_name());\n\t\t}\n\t\texcel.createExcelSheet(TT);\n\t\t// Map<Course,Integer> map=GenerateTT.printUnallocatedStudents(TT);\n\t}", "public HashMap<CarPosition, Passenger[]> openDoors() { \n //Disembarking\n LinkedList<Passenger> retPas = new LinkedList<Passenger>();\n Passenger[] temp = new Passenger[currentPassengers.size()];\n for (int i = 0; i < currentPassengers.size(); i++) {\n temp[i] = currentPassengers.get(i);\n }\n \n //(Disembarking) Update queue, elevator and fill return list\n for (int i = 0; i < temp.length; i++) {\n if (temp[i].getDestination() == currentFloor) {\n if (!currentPassengers.remove(temp[i])) { //Remove from elevator\n throw new RuntimeException(\"Could not find dismebarking passenger in elevator.\");\n }\n retPas.add(temp[i]); //Add to return list\n passengersServed = passengersServed.add(new BigInteger(\"1\")); //Update service counter\n \n boolean removed = false;\n for (int j = 0; j < queue.size(); j++) {\n ElevatorQueueObject q = queue.get(j);\n if (q.getPassenger() == temp[i] && q.getActionType() == ElevatorAction.DROPOFF) {\n \tremoved = true;\n queue.remove(q); //Remove from queue\n break;\n }\n }\n if (!removed) { //Could not find queue object\n throw new RuntimeException(\"Could not find dismebarking passenger in queue.\");\n }\n }\n }\n \n //Embarking\n while (currentPassengers.size() < specs.getCarryCapacity() && queue.size() > 0) {\n ElevatorQueueObject q = queue.getFirst();\n if (q.getActionType() == ElevatorAction.PICKUP) {\n if(q.getPassenger().getOrigin() == currentFloor) {\n currentPassengers.add(q.getPassenger());\n queue.removeFirst();\n } else {\n break;\n }\n } else {\n break;\n }\n }\n \n //Format disembarking passengers as an array\n Passenger[] retArr = new Passenger[retPas.size()];\n for (int i = 0; i < retPas.size(); i++) {\n retArr[i] = retPas.get(i);\n }\n \n //Return disembarking passengers as a HashMap\n HashMap<CarPosition, Passenger[]> retMap = new HashMap<CarPosition, Passenger[]>(1);\n retMap.put(CarPosition.NULL, retArr);\n \n return retMap;\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 }", "public boolean hasReachedGoal(List<Integer> collectTime);", "public Obs filter(Obs obs, int time_th, int L) {\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\t\tString seq = obs.getSeq();\n\t\tString stamps = obs.getTimeStamp();\n\n\t\tString fseq = \"\";\n\t\tString fstamps = \"\";\n\n\t\tString[] towerSubseqs = new String[] { seq };\n\t\tString[] stampSubseqs = new String[] { stamps };\n\t\tif (seq.contains(RLM)) {\n\t\t\ttowerSubseqs = seq.split(RLM);\n\t\t\tstampSubseqs = stamps.split(RLM);\n\t\t}\n\n\t\tfor (int i = 0; i < towerSubseqs.length; i++) {\n\n\t\t\tString[] towers = towerSubseqs[i].trim().split(CLM);\n\t\t\tString[] tstamps = stampSubseqs[i].trim().split(CLM);\n\n\t\t\t// System.out.println(towers.length + \"\\t\" +\n\t\t\t// Arrays.toString(towers));\n\t\t\t/**\n\t\t\t * If the trip length less than specific length ignore it.\n\t\t\t */\n\t\t\tif (towers.length < L) {\n\t\t\t\t// System.out.println(\"towers.length <= L\");\n\t\t\t\ttowerSubseqs[i] = \"-\";\n\t\t\t\tstampSubseqs[i] = \"-\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tboolean[] marks = new boolean[towers.length];\n\n\t\t\tfor (int j = 1; j < towers.length; j++) {\n\t\t\t\ttry {\n\n\t\t\t\t\tif (!towers[j - 1].equals(towers[j])) {\n\t\t\t\t\t\t// System.out.println(\"! \" + towers[j - 1] + \" equals( \"\n\t\t\t\t\t\t// + towers[j] + \" )\");\n\t\t\t\t\t\tmarks[j] = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tDate sTime = formatter.parse(tstamps[j - 1]);\n\t\t\t\t\tDate eTime = formatter.parse(tstamps[j]);\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tint diff = (ehour - hour) * HOUR + (eminute - minute);\n\t\t\t\t\t/**\n\t\t\t\t\t * check time difference with time threshold whatever the\n\t\t\t\t\t * distance between the starting tower\n\t\t\t\t\t */\n\t\t\t\t\tif (diff < time_th) {\n\t\t\t\t\t\t// System.out.println(\"diff < time_th\");\n\t\t\t\t\t\tmarks[j] = false;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * construct sequences from towers: <\\n If the length of the trinp\n\t\t\t * after removing the repeated values less than L ignore it else\n\t\t\t * construct a trip from the non-removed observations.>\n\t\t\t */\n\t\t\t// System.out.println(\"length\\t\" + length);\n\t\t\t// if (length <= L) {\n\t\t\t// System.out.println(\"length <= L\\t\" + length);\n\t\t\t// towerSubseqs[i] = \"-\";\n\t\t\t// stampSubseqs[i] = \"-\";\n\t\t\t// } else {\n\n\t\t\tString tmpObs = \"\";\n\t\t\tString tmpTime = \"\";\n\n\t\t\tfor (int j = 0; j < marks.length; j++) {\n\t\t\t\tboolean mark = marks[j];\n\t\t\t\tif (mark) {\n\t\t\t\t\tif (!tmpObs.isEmpty()) {\n\t\t\t\t\t\ttmpObs += CLM;\n\t\t\t\t\t\ttmpTime += CLM;\n\t\t\t\t\t}\n\t\t\t\t\ttmpObs += towers[j];\n\t\t\t\t\ttmpTime += tstamps[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"last \\t\" + tmpObs.split(CLM).length + \"\\t\" +\n\t\t\t// Arrays.toString(tmpObs.split(CLM)));\n\t\t\tif (tmpObs.split(CLM).length > L) {\n\t\t\t\ttowerSubseqs[i] = tmpObs;\n\t\t\t\tstampSubseqs[i] = tmpTime;\n\t\t\t}\n\n\t\t\t// }\n\t\t}\n\t\t/**\n\t\t * Construct trips\n\t\t */\n\t\tfor (int i = 0; i < towerSubseqs.length; i++) {\n\t\t\tif (!towerSubseqs[i].equals(\"-\")) {\n\t\t\t\tif (!fseq.isEmpty()) {\n\t\t\t\t\tfseq += RLM;\n\t\t\t\t\tfstamps += RLM;\n\t\t\t\t}\n\n\t\t\t\tfseq += towerSubseqs[i];\n\t\t\t\tfstamps += stampSubseqs[i];\n\t\t\t}\n\t\t}\n\n\t\treturn new Obs(fseq, fstamps);\n\t}", "public static void main(String[] args)\n {\t\t\n\t\t\tFastTimer timer = new FastTimer();\n\t\t\n\t\t\n\t\t\tGameGrid loaded_grid = new GameGrid(7,7);\n\t\t\t\tboolean isSuccess = loaded_grid.LoadFromFile(\"test.puzzle\");\n\t\t\tif(isSuccess == true){\n\t\t\t\tSystem.out.print(\"Solution initiale\\n\");\n\t\t\t\tloaded_grid.PrintToCmd();\t\t\t\n\t\t\t}\n\t\t\tList<GameMove> found_moves = loaded_grid.GetAvailableMove(); \n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\nInitial possible moves\\n\");\n\t\t\tfor(GameMove current_move :found_moves){\n\t\t\t\tcurrent_move.PrintOutCmd();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tList<GameMove> solution_move = new LinkedList();\n\t\t\tloaded_grid.ResetMonitoring();\n\t\t\t\n\t\t\ttimer.StartTime();\n\t\t\t\tboolean result = loaded_grid.FindSolution(solution_move);\n\t\t\ttimer.StopTime();\n\t\t\t\n\t\t\tSystem.out.println(\"\\n**************************\");\n\t\t\tSystem.out.println(\"File name : \" + loaded_grid.loaded_file_name+\"\\n\");\n\t\t\tif(result == false){\n\t\t\t\tSystem.out.println(\"Pas de solution\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Solution in \" +solution_move.size() +\" moves\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\tTime : \"+timer.LastDelta + \" millsec\");\n\t\t\tSystem.out.println(\"\tNode visited :\"+loaded_grid.node_visited_cpt);\n\t\t\tSystem.out.println(\"\tDept require :\"+loaded_grid.max_dept);\n\t\t\tSystem.out.println(\"\tDept limitation :\"+loaded_grid.dept_limit);\n\t\t\t\n\t\t\tif(solution_move.size() > 0){\n\t\t\t\tSystem.out.println(\"\\nMove from last to first\\n\");\n\t\t\t\tfor(GameMove current_move :solution_move){\n\t\t\t\t\tcurrent_move.PrintOutCmd();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\\n**************************\\n\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Final grid\\n\");\n\t\t\tloaded_grid.PrintToCmd();\n }", "@Override\n public void runMovingTest() {\n long now;\n int count, search;\n elapsedTime.clear();\n expandedCells.clear();\n GraphPath<Integer,DefaultWeightedEdge> agentPath=null;\n GraphPath<Integer,DefaultWeightedEdge> targetPath=null;\n //Integer agentNode, targetNode;\n List<Integer> pathToFollow = null;\n for(Point[] p : points){\n pathfinder = new LazyMovingTargetAdaptiveAStarShortestPath<Integer, DefaultWeightedEdge>(map);\n count=0;\n search=0;\n agentNode = p[0].toNode();\n targetNode = p[1].toNode();\n LinkedList<Integer> movingExpCell = new LinkedList<>();\n LinkedList<Long> movingElapsTime = new LinkedList<>();\n targetThread r = new targetThread();\n evadeThread = new Thread(r);\n evadeThread.start();\n while(!agentNode.equals(targetNode)){\n if(pathToFollow==null || !agentPath.getEndVertex().equals(targetNode)) {\n agentPath = pathfinder.getShortestPath(agentNode, targetNode, new OctileDistance());\n if(pathfinder.getElapsedTime() > Long.valueOf(1900))\n continue;\n movingElapsTime.add(pathfinder.getElapsedTime());\n movingExpCell.add(pathfinder.getNumberOfExpandedNodes());\n search++;\n }\n Integer targetNext = null;\n Integer agentNext = null;\n if(count%2==0) {\n /*targetPath = new Trailmax<Integer,DefaultWeightedEdge>(map).getShortestPath(agentNode,targetNode,null);\n pathToFollow = Graphs.getPathVertexList(targetPath);\n if (!pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n if (targetNext.equals(targetNode) && !pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n targetNode = targetNext;*/\n synchronized(moveTarget) {\n moveTarget = new Boolean(true);\n }\n\n try {\n Thread.sleep(12);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n pathToFollow=Graphs.getPathVertexList(agentPath);\n if(!pathToFollow.isEmpty()){\n int i = pathToFollow.lastIndexOf(agentNode);\n agentNext=pathToFollow.remove(i+1);\n }\n agentNode = agentNext;\n count++;\n //System.out.println(agentNode+\",\"+targetNode);\n\n }\n\n r.terminate();\n try {\n evadeThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n pathToFollow=null;\n movingElapsedTime.put(p, movingElapsTime);\n movingExpandedCells.put(p, movingExpCell);\n movesMap.put(p, count);\n searchesMap.put(p, search);\n if(verbose) {\n Long totElaps = Long.valueOf(0);\n Integer totExp = 0;\n for (Long l : movingElapsTime) totElaps += l;\n for (Integer i : movingExpCell) totExp += i;\n System.out.println(\"total elapsed: \" + totElaps + \" total expanded \" + totExp);\n }\n }\n }", "public void run(DataAccessor data) {\n boolean cocktail = true;\n \n int loc = 0;\n //continue till sorted\n while (cocktail) {\n //set to false, until true\n cocktail = false;\n //goes through array one way to sort\n //drunk is 'i'\n for (int drunk = loc; drunk <= data.size() - loc - 2; drunk++) {\n //if it has found where it is more than the next one, it switches it\n if (data.get(drunk) > data.get(drunk + 1)) {\n //switches and returns true\n //wasted is the temp\n int wasted = data.get(drunk);\n data.set(drunk, data.get(drunk + 1));\n data.set(drunk + 1, wasted);\n cocktail = true;\n }\n }\n //breaks if it is never true\n if (!cocktail) {\n break;\n }\n //set to false (again), until true\n cocktail = false;\n //goes through other way to sort\n //twerk is 'i'\n for (int twerk = data.size() - loc - 2; twerk >= loc; twerk--) {\n //if it has found where it is more than the next one, it switches it\n if (data.get(twerk) > data.get(twerk + 1)) {\n //switches and returns true\n //club is temp\n int club = data.get(twerk);\n data.set(twerk, data.get(twerk + 1));\n data.set(twerk + 1, club);\n cocktail = true;\n }\n }\n loc++;\n }\n\n data.done();\n }", "private void timeSearch(ServerAccess sa, List<String> sports) {\r\n Collections.shuffle(sports);\r\n \r\n final long starttime = 1399986000; //13-5-2014 15:00:00\r\n final long endtime = 1431522000; //13-5-2015 15:00:00\r\n final long hourdif = 3600;\r\n final long daydif = 86400;\r\n final long weekdif = 7*daydif;\r\n \r\n final List<String> sports1 = new ArrayList<>();\r\n for (int i = 0; i < (int) Math.floor(sports.size() / 2); i++) {\r\n sports1.add(sports.get(i));\r\n }\r\n \r\n //Collections.reverse(sports1);\r\n firstSearch.add(false);\r\n final Runnable r1 = () -> timeSearchSports(1, sports1, sa, getAuth());\r\n \r\n \r\n final List<String> sports2 = new ArrayList<>();\r\n for (int i = (int) Math.floor(sports.size() / 2); i < sports.size(); i++) {\r\n sports2.add(sports.get(i));\r\n }\r\n //Collections.reverse(sports2);\r\n firstSearch.add(false);\r\n final Runnable r2 = () -> timeSearchSports(2, sports2, sa, getAuth2());\r\n \r\n final Thread t1 = new Thread(r1);\r\n final Thread t2 = new Thread(r2);\r\n t1.start();\r\n t2.start();\r\n \r\n try {\r\n t1.join();\r\n } catch (InterruptedException ex) {\r\n }\r\n try {\r\n t2.join();\r\n } catch (InterruptedException ex) {\r\n }\r\n \r\n storeRest();\r\n DBStore.getInstance().setDone();\r\n }", "public void testTieBreakerSubmissionTime() throws Exception{\n\n // Sort order:\n // Primary Sort = number of solved problems (high to low)\n // Secondary Sort = score (low to high)\n // Tertiary Sort = earliest submittal of last submission (low to high)\n // Forth Sort = teamName (low to high)\n // Fifth Sort = clientId (low to high)\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"5,5,A,12,No\",\n \"6,5,A,12,Yes\", \n \n \"7,6,A,12,No\",\n \"8,6,A,12,Yes\",\n \n // Both solve 1 score 32 (no for 20, 12 min)\n\n \"15,5,B,21,No\",\n \"16,5,B,22,Yes\", \n \n \"25,6,B,21,No\",\n \"26,6,B,22,Yes\", \n \n // Both solve 2 score 42 (no for 20 and 22 min)\n // total 74 each\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n // must identical score, sort by team display name, identical ranks.\n \"1,team5,2,74\",\n \"1,team6,2,74\",\n \"3,team1,0,0\",\n \"3,team2,0,0\",\n \"3,team3,0,0\",\n \"3,team4,0,0\",\n };\n \n scoreboardTest (6, runsData, rankData);\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}", "private void computerMove() {\r\n int move = 0;\r\n int tempMove = 0;\r\n String loseHistoricalMoves = \"\";\r\n \r\n loseHistoricalMoves = getLoseHistoricalMoves(); //Get all the next moves leading to existing loses\r\n\r\n Random rand = new Random();\r\n tempMove = rand.nextInt(MAX_MOVE_NUMBER - moveRecord.length() - loseHistoricalMoves.length()) + 1;\r\n\r\n move = 0;\r\n for(int ii=0; ii<tempMove; ii++) {\r\n move++;\r\n while ( (moveRecord.indexOf(String.valueOf(move)) >= 0) || //skip existing moves\r\n\t (loseHistoricalMoves.indexOf(String.valueOf(move)) >= 0) ) { //skip lose moves \r\n if (loseHistoricalMoves.indexOf(String.valueOf(move)) >= 0) { \r\n\t System.out.println(\"Skip a historical lose move: \" + move);\r\n\t}\r\n\tmove++;\r\n }\r\n }\r\n\r\n System.out.println(\"Computer move: \" + String.valueOf((move - ((move - 1) % 3)) / 3 + 1) + \",\" +\r\n\t\t String.valueOf((move - 1) % 3 + 1));\r\n moveRecord = moveRecord + String.valueOf(move); \r\n }", "private long finTime(){\n \n long result = 0, time = 0;\n Integer[] temp;\n \n while(!this.prior.isEmpty()){\n \n // getting the head of the queue and removing it\n temp = this.prior.poll();\n \n // printing some temp. results\n //System.out.println(\"weight \" + temp[0] + \" length/time \" + temp[1]);\n \n // callculate the finishing time\n time += temp[1];\n \n // calculate the weighted time, we want to minimise\n result += (temp[0]*time);\n }\n return result;\n }", "public static void triathlon(Scanner data) {\n String name = data.next();\n int winnerTime = data.nextInt() + data.nextInt() + data.nextInt();\n System.out.println(name + \": \" + winnerTime + \" min\");\n\n while (data.hasNext()) {\n name = data.next();\n int time = data.nextInt() + data.nextInt() + data.nextInt();\n System.out.println(name + \": \" + time + \" min (+\" + (time - winnerTime) + \" min)\");\n }\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 int compare(Object o1, Object o2)\r\n/* 237: */ {\r\n/* 238:196 */ DisgustingMoebiusTranslator.ThingTimeTriple x = (DisgustingMoebiusTranslator.ThingTimeTriple)o1;\r\n/* 239:197 */ DisgustingMoebiusTranslator.ThingTimeTriple y = (DisgustingMoebiusTranslator.ThingTimeTriple)o2;\r\n/* 240:198 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.stop)\r\n/* 241: */ {\r\n/* 242:199 */ if (x.to > y.to) {\r\n/* 243:200 */ return 1;\r\n/* 244: */ }\r\n/* 245:203 */ return -1;\r\n/* 246: */ }\r\n/* 247:206 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.start)\r\n/* 248: */ {\r\n/* 249:207 */ if (x.from > y.from) {\r\n/* 250:208 */ return 1;\r\n/* 251: */ }\r\n/* 252:211 */ return -1;\r\n/* 253: */ }\r\n/* 254:214 */ return 0;\r\n/* 255: */ }", "public void findTour( int x, int y, int moves )\n {\n delay(50); //slow it down enough to be followable\n if (solved) System.exit(0);\n\n //primary base case: tour completed\n if (moves == (sideLength * sideLength)) {\n solved = true;\n }\n //other base case: stepped off board or onto visited cell\n if ( board[x][y] != 0 ) {\n return;\n }\n //otherwise, mark current location\n //and recursively generate tour possibilities from current pos\n else {\n board[x][y] = moves;\n System.out.println(this);\n delay(10); //uncomment to slow down enough to view\n\n /*======================================\n Recursively try to solve (find tour) from\n each of knight's available moves.\n . e . d .\n f . . . c\n . . @ . .\n g . . . b\n . h . a .\n ======================================*/\n // right and down\n findTour(x + 1, y + 2, moves + 1);\n // left and down\n findTour(x - 1, y + 2, moves + 1);\n // down and right\n findTour(x + 2, y + 1, moves + 1);\n // up and left\n findTour(x - 2, y - 1, moves + 1);\n // right and up\n findTour(x + 1, y - 2, moves + 1);\n // left and up\n findTour(x - 1, y - 2, moves + 1);\n // up and right\n findTour(x + 2, y - 1, moves + 1);\n // down and left\n findTour(x - 2, y + 1, moves + 1);\n\n //If made it this far, path did not lead to tour, so back up.\n board[x][y] = 0;\n System.out.println(this);\n }\n }", "private Board moveTo(int direction) {\n Board newBoard = new Board(this.state);\n int oZ = this.zero;\n int nZ = oZ;\n switch (direction) {\n case Board.LEFT: nZ = oZ - 1; break;\n case Board.RIGHT: nZ = oZ + 1; break;\n case Board.UP: nZ = oZ - Board.dim; break;\n case Board.DOWN: nZ = oZ + Board.dim; break;\n default: return null;\n }\n newBoard.state[oZ] = state[nZ];\n newBoard.state[nZ] = 0;\n newBoard.zero = nZ;\n\n // update heuristic iteratively except for MAN\n switch(Board.heuristic) {\n case HAM:\n if (state[nZ] == oZ) newBoard.dist = this.dist - 1;\n else if (state[nZ] == nZ) newBoard.dist = this.dist + 1;\n else newBoard.dist = this.dist;\n break;\n case INT: // iterative update the interference\n // this is the most logically complicated code I have\n // done in a while\n int moved = state[nZ];\n int oC;\n newBoard.inter = inter;\n switch (direction) {\n case Board.LEFT:\n case Board.RIGHT: // LEFT AND RIGHT\n if (Board.colOf[state[nZ]] == Board.colOf[nZ]) {\n // we've replaced a piece on its col with a zero\n // interference can only decrease since we know\n // the piece didn't belong to its old column\n //System.out.println(\"Took \" + state[nZ] + \" out of its col\");\n for (int i = Board.colOf[nZ]; i < nZ; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[nZ] &&\n state[i] > state[nZ])\n newBoard.inter--;\n for (int i = nZ + Board.dim; i < state.length; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[nZ] &&\n state[i] < state[nZ])\n newBoard.inter--;\n \n } else if (Board.colOf[state[nZ]] == Board.colOf[oZ]) {\n // we've put a piece on its col that was a zero\n // interference can only increase since we know\n // the piece didn't below to its old column\n //System.out.println(\"Put \" + state[nZ] + \" into its col\");\n for (int i = Board.colOf[oZ]; i < oZ; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[oZ] &&\n state[i] > state[nZ])\n newBoard.inter++;\n for (int i = oZ + Board.dim; i < state.length; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[oZ] &&\n state[i] < state[nZ])\n newBoard.inter++;\n }\n break;\n default: // UP AND DOWN\n if (Board.rowOf[state[nZ]] == Board.rowOf[nZ]) {\n // we've replaced a piece on its row with a zero\n // interference can only decrease since we know\n // the piece didn't belong to its old row\n //System.out.println(\"Took \" + state[nZ] + \" out of its row\");\n for (int i = Board.dim*Board.rowOf[nZ]; i < nZ; i++)\n if (Board.rowOf[state[i]] == Board.rowOf[nZ] &&\n state[i] > state[nZ])\n newBoard.inter--;\n for (int i = nZ+1; i < Board.dim*(Board.rowOf[nZ]+1); i++)\n if (Board.rowOf[state[i]] == Board.rowOf[nZ] &&\n state[i] < state[nZ])\n newBoard.inter--;\n } else if (Board.rowOf[state[nZ]] == Board.rowOf[oZ]) {\n // we've put a piece on its row that was a zero\n // interference can only increase since we know\n // the piece didn't belong to its old row\n //System.out.println(\"Put \" + state[nZ] + \" into its row\");\n for (int i = Board.dim*Board.rowOf[oZ]; i < oZ; i++)\n if (Board.rowOf[state[i]] == Board.rowOf[oZ] &&\n state[i] > state[nZ])\n newBoard.inter++;\n for (int i = oZ+1; i < Board.dim*(Board.rowOf[oZ]+1); i++)\n if (Board.rowOf[state[i]] == Board.rowOf[oZ] &&\n state[i] < state[nZ])\n newBoard.inter++;\n }\n } \n default: // update the manhattan distance\n newBoard.dist = this.dist - \n Board.manhattanTable[state[nZ]][nZ] +\n Board.manhattanTable[state[nZ]][oZ];\n }\n return newBoard;\n }", "public void timeLogic(int time){\n //Add logic to decide time increments at which tickets will be granted\n }", "public static void main(String[] args) {\r\n\t\tPosition p2 = new Position(47.984393, 0.236012);\r\n\t\t/*graine*/\r\n\t\tPosition p1 = new Position(47.987444,0.253475);\r\n\t\t\r\n\t\tFourmi fourmi = new Fourmi();\r\n\t\tChemin trackAllerGraine1;\r\n\t\tChemin trackRetourGraine1;\r\n\t\t\r\n\t\tChemin c = new Chemin();\r\n\t\tChemin c1 = new Chemin();\r\n\t\ttry {\r\n\t\t\tc.calculItineraire(p2,p1);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tc.add(p1);\r\n\t\ttrackAllerGraine1 = fourmi.creerTrack(c);\r\n\t\r\n\t\t\r\n\r\n\t\tfor(int i=0;i<trackAllerGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackAllerGraine1.get(i).lat+\",\"+trackAllerGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackAllerGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackAllerGraine1.get(i),trackAllerGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackAllerGraine1.size()-1)+\" : \"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lat+\",\"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackAllerGraine1.get(trackAllerGraine1.size()-1).getTimestamp());\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc1.calculItineraire(p1, p2);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tc1.add(p2);\r\n\t\ttrackRetourGraine1=fourmi.creerTrack(c1);\r\n\t\t\r\n\t\tfor(int i=0;i<trackRetourGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackRetourGraine1.get(i).lat+\",\"+trackRetourGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackRetourGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackRetourGraine1.get(i),trackRetourGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackRetourGraine1.size()-1)+\" : \"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lat+\",\"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackRetourGraine1.get(trackRetourGraine1.size()-1).getTimestamp());\r\n\t}", "public static void benchmarkMenu() {\n List<Position> places = new ArrayList<Position>();\n places.add(new Position(-10.99845000, 49.39349500));\n places.add(new Position(-11.18493167, 49.49496333));\n boolean quit = false;\n do {\n System.out.println(\"==================================================\");\n System.out.println(\"Benchmarks\");\n System.out.println(\"==================================================\");\n System.out.println();\n System.out.println(\"Please Make a selection:\");\n System.out.println(\"[1] Weighted A-Star\");\n System.out.println(\"[2] A-Star with limited OpenList\");\n System.out.println(\"[3] TSP Methodes\");\n System.out.println(\"[4] Genetic TSP Generations\");\n System.out.println(\"[0] exit\");\n\n System.out.print(\"Selection: \");\n int menu = scan.nextInt();\n switch (menu) {\n case 1:\n System.out.print(\"Start W: \");\n double wStart = scan.nextDouble();\n System.out.print(\"End W: \");\n double wEnd = scan.nextDouble();\n System.out.print(\"Steps: \");\n double wStep = scan.nextDouble();\n compareAStarW(places, wStart, wEnd, wStep);\n break;\n case 2:\n System.out.print(\"Start Limit: \");\n int lStart = scan.nextInt();\n System.out.print(\"End Limit: \");\n int lEnd = scan.nextInt();\n System.out.print(\"Steps: \");\n int lStep = scan.nextInt();\n compareAStarLimitedOpen(places, lStart, lEnd, lStep);\n break;\n case 3:\n System.out.print(\"Number of Points: \");\n int points = scan.nextInt();\n compareTSP(points);\n break;\n case 4:\n System.out.print(\"Number of Points: \");\n int gpoints = scan.nextInt();\n System.out.print(\"Start Generations: \");\n int gStart = scan.nextInt();\n System.out.print(\"End Generations: \");\n int gEnd = scan.nextInt();\n System.out.print(\"Steps: \");\n int gStep = scan.nextInt();\n compareGeneticGens(gpoints, gStart, gEnd, gStep);\n break;\n case 0:\n quit = true;\n break;\n default:\n System.out.println(\"Invalid Entry!\");\n }\n }\n while (!quit);\n }", "private static int minTime(Map<Integer, Map<Integer, Integer>> graph, int s, int d) {\n //System.out.println(\"minTime: \" + s + \",\" + d);\n int min = Integer.MAX_VALUE;\n int[] minAr = new int[3];\n boolean found = false;\n LinkedList<Integer> queue = new LinkedList<>();\n HashSet<Integer> visited = new HashSet<>(graph.size());\n\n queue.add(s);\n visited.add(s);\n\n while (queue != null && queue.peek() != null) {\n int i = queue.poll();\n Map<Integer, Integer> map = graph.get(i);\n if(map!=null){\n for (Integer key : map.keySet()) {\n if (!visited.contains(key)) {\n queue.add(key);\n visited.add(key);\n\n if (min > map.get(key)) {\n min = map.get(key);\n minAr[0] = i;\n minAr[1] = key;\n minAr[2] = min;\n\n //System.out.println( \"minAr inside: \" + minAr[0] + \"-\"+ minAr[1] + \"-\" +minAr[2]);\n }\n\n if (key == d) {\n found = true;\n queue = null;\n break;\n\n }\n }\n }\n }\n }\n if (found) {\n //System.out.println(\"minAr: \" + minAr[0] + \"-\" + minAr[1] + \"-\" + minAr[2]);\n Map<Integer, Integer> map1 = graph.get(minAr[0]);\n map1.remove(minAr[1]);\n graph.put(minAr[0], map1);\n Map<Integer, Integer> map2 = graph.get(minAr[1]);\n map2.remove(minAr[0]);\n graph.put(minAr[1], map2);\n System.out.println(\"min : \" + min);\n\n min = (min == Integer.MAX_VALUE) ? 0 : min;\n } else {\n System.out.println(\"no connection\");\n min = 0;\n }\n return min;\n }", "private Queue<Position> pathToClosest(MyAgentState state, Position start, int goal) {\n\t\tQueue<Position> frontier = new LinkedList<Position>();\n\t\tSet<String> enqueued = new HashSet<String>();\n\t\tMap<Position, Position> preceedes = new HashMap<Position, Position>();\n\t\tfrontier.add(start);\n\t\tenqueued.add(start.toString());\n\n\t\twhile (!frontier.isEmpty()) {\n\t\t\tPosition pos = frontier.remove();\n\t\t\tif (state.getTileData(pos) == goal) {\n\t\t\t\treturn toQueue(preceedes, pos, start);\n\t\t\t}\n\t\t\t\n\t\t\tfor (Position neighbour : pos.neighbours()) {\n\t\t\t\tif (!enqueued.contains(neighbour.toString()) && state.getTileData(neighbour) != state.WALL) {\n\t\t\t\t\tpreceedes.put(neighbour, pos);\n\t\t\t\t\tfrontier.add(neighbour);\n\t\t\t\t\tenqueued.add(neighbour.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static void reEnter(ListArrayBasedGeneric<Runway> runwayList) throws IOException // Option 3\r\n\t{\r\n\t\tString flightNumber = \"\";\r\n\t\tString flightWaitingForTakeOff = \"\";\r\n\t\tString runway = \"\";\r\n\t\tboolean found = false;\r\n\t\tint sizeOfPurgatory = runwayList.get(0).getListOfPlanes().size();\r\n\t\tint indexToAddAt = 0;\r\n\r\n\t\tif(sizeOfPurgatory > 0)\r\n\t\t{\r\n\t\t\twhile(found == false) // No initial match found\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"\\tEnter the flight number: \"); // Get the flight number\r\n\t\t\t\tflightNumber = stdin.readLine().trim();\r\n\t\t\t\tSystem.out.println(flightNumber);\r\n\r\n\t\t\t\t// Search purgatory if there are any matches for the flight number\r\n\t\t\t\tfor(int i = 0; i < sizeOfPurgatory && found == false; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tflightWaitingForTakeOff = runwayList.get(0).getListOfPlanes().get(i).getFlightNumber(); // Get each flight number from purgatory\r\n\r\n\t\t\t\t\tif(flightWaitingForTakeOff.compareToIgnoreCase(flightNumber) == 0) // If it's a match, then add it back to the queue\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\trunway = runwayList.get(0).getListOfPlanes().get(i).getRunway(); // Get the runway of the found plane\r\n\r\n\t\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" is now waiting for takeoff on runway \" + runway);\r\n\r\n\t\t\t\t\t\tindexToAddAt = search(runway, runwayList); // Returns the index of the runway found\r\n\r\n\t\t\t\t\t\t// Add it to the original runway\r\n\t\t\t\t\t\trunwayList.get(indexToAddAt).addPlane(runwayList.get(0).removeFromRunway(i));\r\n\t\t\t\t\t} // END IF\r\n\t\t\t\t} // END FOR\r\n\r\n\t\t\t\tif(found == false) // If not found, then notify the user that the plane isn't waiting for clearance\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" is not waiting for clearance\");\r\n\t\t\t\t} // END IF\r\n\t\t\t} // END WHILE\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\tThere are no planes waiting for clearance\");\r\n\t\t} // END IF/ELSE\r\n\r\n\t\tSystem.out.println();\r\n\t}", "public void MovesRemainingExists() {\n InsideMovesRemainingExists = 1;\n NoMovesRemaining = 1;\n Beginning:\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n previousX = i;\n previousY = j + 1;\n if ((i + 1) < 9) {\n ValidSwitch(i + 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the right\n ResetState();\n break Beginning; //breaks the loop\n }\n }\n\n if ((i - 1) >= 0) {\n ValidSwitch(i - 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the left\n ResetState();\n break Beginning;\n }\n }\n\n if ((j + 1) < 9) {\n ValidSwitch(i, j + 2);\n if (NoMovesRemaining == 0) { //checks the candies on the bottom\n ResetState();\n break Beginning;\n }\n }\n\n if ((j - 1) >= 0) {\n ValidSwitch(i, j);\n if (NoMovesRemaining == 0) { //checks the candies at the top\n ResetState();\n break Beginning;\n }\n }\n }\n\n }\n InsideMovesRemainingExists = 0;\n\n}", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "private Route calculate(String fromStation, String toStation) {\n\t\tif (stations==null){\r\n\t\t\tSystem.out.println(\"DEBUG RUN OF DIJKSTRA.\");\r\n\t\t\tstations = new ArrayList<Station>();\r\n\t\t\tcreateDebugMap(stations);\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Check if the stations exists\r\n\t\t */\r\n\t\tStation startStation = null, endStation = null;\r\n\r\n\t\t// Find starting station\r\n\t\tfor (Station thisStation : stations) {\r\n\t\t\tif (thisStation.stationName.equals(fromStation)) {\r\n\t\t\t\tSystem.out.println(\"Found startStaion in the Database\");\r\n\t\t\t\tstartStation = thisStation;\r\n\t\t\t}\r\n\t\t\tif (thisStation.stationName.equals(toStation)) {\r\n\t\t\t\tSystem.out.println(\"Found endStation in the Database\");\r\n\t\t\t\tendStation = thisStation;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Station not found. Break\r\n\t\tif (startStation == null || endStation == null) {\r\n\t\t\tSystem.out.println(\"Shit! One of the stations could not be found\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Declare the variables for the algorithm\r\n\t\t */\r\n\r\n\t\t// ArrayList for keeping track of stations we have visited.\r\n\t\tArrayList<Station> visitedStations = new ArrayList<Station>();\r\n\t\t// Array for the DijkstraStations. This type holds the current best cost and best link to it.\r\n\t\tArrayList<DijkstraStation> dijkstraStations = new ArrayList<DijkstraStation>();\r\n\r\n\t\t// The station we are examining neighbors from.\r\n\t\tDijkstraStation currentStation = new DijkstraStation(new Neighbor(startStation, 0, 0), 0, startStation);\r\n\r\n\t\t// PriorityQueue for sorting unvisited DijkstraStations.\r\n\t\tNeighBorDijktstraComparetor Dijkcomparator = new NeighBorDijktstraComparetor();\r\n\t\tPriorityQueue<DijkstraStation> unvisitedDijkstraStations;\r\n\t\tunvisitedDijkstraStations = new PriorityQueue<DijkstraStation>(100, Dijkcomparator);\r\n\r\n\t\t// Variable to keep track of the goal\r\n\t\tboolean goalFound = false; // did we find the goal yet\r\n\t\tint goalBestCost = Integer.MAX_VALUE; // did we find the goal yet\r\n\r\n\t\t// Add the start staion to the queue so that the loop will start with this staiton\r\n\t\tunvisitedDijkstraStations.add(currentStation);\r\n\t\tdijkstraStations.add(currentStation);\r\n\r\n\t\t/***************************\r\n\t\t * The Dijkstra algorithm loop.\r\n\t\t ***************************/\r\n\r\n\t\twhile (!unvisitedDijkstraStations.isEmpty()) {\r\n\t\t\t// Take the next station to examine from the queue and set the next station as the currentStation\r\n\t\t\tcurrentStation = unvisitedDijkstraStations.poll();\r\n\r\n\t\t\tSystem.out.println(\"\\n============= New loop passtrough =============\");\r\n\t\t\tSystem.out.println(\"Analysing neighbors of \" + currentStation.stationRef.stationName + \". Cost to this station is: \" + currentStation.totalCost);\r\n\r\n\t\t\t// Add visited so we dont visit again.\r\n\t\t\tvisitedStations.add(currentStation.stationRef);\r\n\r\n\t\t\t// break the algorithm if the current stations totalcost if bigger than the best cost of the goal\r\n\t\t\tif (goalBestCost < currentStation.totalCost) {\r\n\t\t\t\tSystem.out.println(\"Best route to the goal has been found. Best cost is: \" + goalBestCost\r\n\t\t\t\t\t\t+ \" (To reach current station is: \" + currentStation.totalCost + \")\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check all neighbors from the currentStation to the neighBorQueue so we can examine them\r\n\t\t\tfor (Neighbor thisNeighbor : currentStation.stationRef.neighbors) {\r\n\r\n\t\t\t\t// Skip stations we have already visited\r\n\t\t\t\tif (!visitedStations.contains(thisNeighbor.stationRef)) {\r\n\t\t\t\t\t// If we havent seen this station before\r\n\t\t\t\t\t// Add it to the list of Dijkstrastations and to the PriorityQueue of unvisited stations\r\n\t\t\t\t\tif (getDijkstraStationByID(thisNeighbor.stationRef.stationid, dijkstraStations) == null) {\r\n\t\t\t\t\t\tDijkstraStation thisDijkstraStation = new DijkstraStation(thisNeighbor, currentStation.totalCost\r\n\t\t\t\t\t\t\t\t+ thisNeighbor.cost, currentStation.stationRef);\r\n\t\t\t\t\t\tdijkstraStations.add(thisDijkstraStation);\r\n\t\t\t\t\t\tunvisitedDijkstraStations.offer(thisDijkstraStation);\r\n\r\n\t\t\t\t\t\tif (thisNeighbor.stationRef.equals(endStation)) {\r\n\t\t\t\t\t\t\tgoalFound = true;\r\n\t\t\t\t\t\t\tgoalBestCost = (int) thisDijkstraStation.totalCost;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Goal station found :) Cost to goal is: \" + goalBestCost);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"New station seen: \" + thisDijkstraStation);\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Station has been seen before.\r\n\r\n\t\t\t\t\t\t// Get the station as a DijkstraStation from the array\r\n\t\t\t\t\t\tDijkstraStation thisDijkstraStation = getDijkstraStationByID(thisNeighbor.stationRef.stationid,\r\n\t\t\t\t\t\t\t\tdijkstraStations);\r\n\r\n\t\t\t\t\t\t// Check if the connection is better than the one we already know\r\n\t\t\t\t\t\tif (currentStation.totalCost + thisNeighbor.cost < thisDijkstraStation.totalCost) {\r\n\r\n\t\t\t\t\t\t\t// New best link found\r\n\t\t\t\t\t\t\tSystem.out.println(\"New best route found for \" + thisNeighbor.stationRef.stationName);\r\n\t\t\t\t\t\t\tSystem.out.println(\"Old cost:\" + thisDijkstraStation.totalCost + \", New cost: \"\r\n\t\t\t\t\t\t\t\t\t+ (currentStation.totalCost + thisNeighbor.cost));\r\n\r\n\t\t\t\t\t\t\t// update the cost and via station on the DijkstraStation\r\n\t\t\t\t\t\t\tthisDijkstraStation.updateBestLink((int) (currentStation.totalCost + thisNeighbor.cost),\r\n\t\t\t\t\t\t\t\t\tcurrentStation.stationRef, thisNeighbor);\r\n\r\n\t\t\t\t\t\t\t// if this is the goal station, update the totalCost\r\n\t\t\t\t\t\t\tif (thisNeighbor.stationRef.equals(endStation)) {\r\n\t\t\t\t\t\t\t\tgoalBestCost = (int) thisDijkstraStation.totalCost;\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Updated cost for the goal to : \" + goalBestCost);\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}\r\n\t\t\t}\r\n\r\n\t\t}// End while\r\n\r\n\t\t// Print the World:\r\n//\t\t System.out.println();\r\n//\t\t System.out.println(\"################# Printing the world ###################\");\r\n//\t\t for (DijkstraStation thisDijkstraStation : dijkstraStations) {\r\n//\t\t System.out.println(thisDijkstraStation.toString());\r\n//\t\t DijkstraStation tempStation = thisDijkstraStation;\r\n//\t\t System.out.print(\"BackTracking route =>\");\r\n//\t\t while (!tempStation.stationRef.equals(startStation)) {\r\n//\t\t System.out.print(\" \" + tempStation.cost + \" to \" + tempStation.viaStation.stationName + \" #\");\r\n//\t\t\r\n//\t\t tempStation = getDijkstraStationByID(tempStation.viaStation.stationid, dijkstraStations);\r\n//\t\t }\r\n//\t\t System.out.print(\" End\");\r\n//\t\t System.out.print(\"\\n\\n\");\r\n//\t\t }\r\n//\r\n\t\tif (goalFound) {\r\n\t\t\tSystem.out.println(\"Generating route to goal\");\r\n\t\t\t// create a route object with all the stations.\r\n\t\t\tRoute routeToGoal = new Route(fromStation, toStation);\r\n\t\t\t// get the goalStation as a DijkstraStation Type\r\n\t\t\tDijkstraStation goalStation = getDijkstraStationByID(endStation.stationid, dijkstraStations);\r\n\r\n\t\t\trouteToGoal.cost = goalStation.totalCost;\r\n\t\t\trouteToGoal.price = (int) goalStation.totalCost;\r\n\r\n\t\t\t// Find the route to the goal\r\n\t\t\tDijkstraStation tempStation = goalStation;\r\n\r\n\t\t\twhile (!tempStation.stationRef.equals(startStation)) {\r\n\t\t\t\t// Add the station to the route table\r\n\t\t\t\tSerializableStation thisStation = new SerializableStation(tempStation.cost, tempStation.cost,\r\n\t\t\t\t\t\ttempStation.stationRef.stationName, tempStation.stationRef.stationid);\r\n\t\t\t\t\r\n\t\t\t\t//Fix region string\r\n\t\t\t\tString regionString=\"\";\r\n\t\t\t\tfor (Integer regionID : tempStation.stationRef.region) {\r\n\t\t\t\t\tregionString.concat(regionID+ \",\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tthisStation.region = regionString.substring(0, regionString.length() - 1);\r\n\t\t\t\t\r\n\t\t\t\t//Add the station\r\n\t\t\t\trouteToGoal.route.add(0, thisStation);\r\n\t\t\t\t// Go to the previous station\r\n\t\t\t\ttempStation = getDijkstraStationByID(tempStation.viaStation.stationid, dijkstraStations);\r\n\t\t\t}\r\n\t\t\t// add the starting station\r\n\t\t\tSerializableStation thisStation = new SerializableStation(tempStation.stationRef.latitude, tempStation.stationRef.longitude, tempStation.stationRef.stationName,\r\n\t\t\t\t\ttempStation.stationRef.stationid);\r\n\t\t\trouteToGoal.route.add(0, thisStation);\r\n\r\n\t\t\t// print the route\r\n\t\t\t//System.out.println(\"Printing best route to the Goal:\\n\" + routeToGoal.toString());\r\n\r\n\t\t\treturn routeToGoal;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public void findValidMoveDirections(){\n\t\t\n\t\tif(currentTile == 2 && (tileRotation == 0 || tileRotation == 180)){ // in vertical I configuration\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S: T E,W: F\");\n\t\t}\n\t\telse if(currentTile == 2 && (tileRotation == 90 || tileRotation == 270)){ // in horizontal I configuration\n\t\t\tcanMoveNorth = false; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S: F E,W: T\");\n\t\t}\n\t\t\n\t\t\n\t\telse if(currentTile == 3 && tileRotation == 0){ // L rotated 0 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,E: T S,W: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 90){ // L rotated 90 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,W: T S,E: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 180){ // L rotated 180 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,W: T N,E: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 270){ // L rotated 270 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,E: T N,W: F\");\n\t\t}\n\t\t\n\t\t\n\t\telse if(currentTile == 4 && tileRotation == 0){ // T rotated 0 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,W,E: T N: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 90){ // T rotated 90 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,E: T W: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 180){ // T rotated 180 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,W,E: T S: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 270){ // T rotated 270 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,W: T E: F\");\n\t\t}\n\t\telse if(currentTile == 5){ //in plus tile\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,W,E: T\");\n\t\t}\n\t\t\n\t}" ]
[ "0.60314846", "0.6006342", "0.5727843", "0.5628562", "0.5607526", "0.56055564", "0.5596534", "0.55657417", "0.5543463", "0.5476751", "0.5434298", "0.53475887", "0.53142184", "0.52971935", "0.52768356", "0.5257497", "0.52486306", "0.5219016", "0.5216525", "0.5198726", "0.51945996", "0.5167637", "0.5161677", "0.5158412", "0.5155258", "0.5151507", "0.5135678", "0.512741", "0.5094144", "0.5084712", "0.5052723", "0.504766", "0.50355107", "0.5032966", "0.5028686", "0.50180334", "0.49793398", "0.49306512", "0.49075985", "0.48991084", "0.48931566", "0.48871297", "0.4886457", "0.48777777", "0.4869136", "0.4846203", "0.483352", "0.48323637", "0.4825683", "0.48253322", "0.48178536", "0.48095787", "0.48091406", "0.48089468", "0.47942364", "0.47932583", "0.47766495", "0.47749275", "0.47613806", "0.47590965", "0.47534505", "0.47528097", "0.47457168", "0.47413385", "0.47344616", "0.47091463", "0.4707626", "0.47074848", "0.47029567", "0.4691835", "0.46911365", "0.46865347", "0.46842572", "0.4684211", "0.46828815", "0.46783805", "0.46752444", "0.46712902", "0.46700406", "0.4669716", "0.46661773", "0.4661752", "0.46613908", "0.465413", "0.46539804", "0.46437514", "0.4642699", "0.46401814", "0.46356007", "0.46344742", "0.46334106", "0.4626012", "0.46256", "0.46253732", "0.4624368", "0.46221933", "0.46211046", "0.4616126", "0.46090972", "0.46003342" ]
0.6141143
0
Find the k post offices located closest to you, given your location and a list of locations of all post offices available. Locations are given in 2D coordinates in [X, Y], where X and Y are integers. Euclidean distance is applied to find the distance between you and a post office. Assume your location is [m, n] and the location of a post office is [p, q], the Euclidean distance between the office and you is SquareRoot((m p) (m p) + (n q) (n q)). K is a positive integer much smaller than the given number of post offices.
public static final java.util.List<int[]> NearestOffices ( final java.util.List<int[]> officeLocationList, final int k) { java.util.HashMap<Double, java.util.ArrayList<int[]>> officeDistanceMap = new java.util.HashMap<Double, java.util.ArrayList<int[]>>(); for (int[] officeLocation : officeLocationList) { double distance = Math.sqrt (officeLocation[0] * officeLocation[0] + officeLocation[1] * officeLocation[1]); if (officeDistanceMap.containsKey (distance)) officeDistanceMap.get (distance).add (officeLocation); else { java.util.ArrayList<int[]> officeList = new java.util.ArrayList<int[]>(); officeList.add (officeLocation); officeDistanceMap.put (distance, officeList); } } java.util.PriorityQueue<Double> nearestOfficeHeap = new java.util.PriorityQueue<Double>((x, y) -> Double.compare (y, x)); for (double distance : officeDistanceMap.keySet()) { if (k < nearestOfficeHeap.size()) { if (nearestOfficeHeap.peek() > distance) nearestOfficeHeap.poll(); } nearestOfficeHeap.offer (distance); } java.util.List<int[]> nearestOfficesList = new java.util.ArrayList<int[]>(); int i = 0; boolean set = false; while (!nearestOfficeHeap.isEmpty()) { java.util.ArrayList<int[]> officeList = officeDistanceMap.get (nearestOfficeHeap.poll()); for (int[] officeLocation : officeList) { if (set) nearestOfficesList.set (i, officeLocation); else nearestOfficesList.add (officeLocation); if (k == ++i) { i = 0; set = true; } } } return nearestOfficesList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<K> findNearestK(LatitudeLongitude current, int k) {\n\n // Find the euclidean distance between this point and others\n List<Tuple2<Double, K>> closest = new ArrayList<>(locations.size());\n for (K l : locations) {\n LatitudeLongitude latlon = l.getLocation();\n if (latlon != null) {\n Double result = euclidean(latlon, current);\n closest.add(new Tuple2<>(result, l));\n }\n }\n\n // Sort the list\n closest.sort((element1, element2) -> {\n return element1._1().compareTo(element2._1());\n });\n\n closest.removeIf(i -> (i._1().equals(0.0)));\n\n // Return the first k records\n if (k > closest.size()) {\n k = closest.size();\n }\n if (k < 0) {\n k = 0;\n }\n List<K> toReturn = new ArrayList<>(k);\n for (int i = 0; i < k; i++) {\n toReturn.add(closest.get(i)._2());\n }\n\n return toReturn;\n }", "public Iterable<Point2D> nearest(Point2D p, int k) {\n if (k == 0) {\n throw new NullPointerException();\n }\n \n if (p == null) {\n throw new NullPointerException();\n }\n MinPQ<Point2D> pq = new<Point2D> MinPQ(p.distanceToOrder());\n \n for (Point2D s: bst.keys()) {\n if (!s.equals(p)) {\n //Point2D near = nearest(p);\n pq.insert(s);\n }\n \n }\n \n Queue kpq = new Queue(); \n \n for (int j = 0; j < k; j++) {\n kpq.enqueue(pq.delMin());\n }\n return kpq;\n }", "public int[][] kClosest(int[][] points, int K) {\n int l = 0, r = points.length - 1;\n while(l <= r) {\n int pivot = quickSort(points, l, r);\n if (pivot == K) break;\n else if (pivot < K)\n l = pivot + 1;\n else\n r = pivot - 1;\n }\n return Arrays.copyOfRange(points, 0, K);\n }", "public int[][] kClosest(int[][] points, int K) {\n int left = 0, right = points.length-1;\n while (left < right) {\n int pivot = partition(points, left, right);\n if (pivot == K) { break; }\n else if (pivot < K) { left = pivot + 1;}\n else { right = pivot - 1;}\n }\n\n return Arrays.copyOfRange(points, 0, K);\n }", "public Point[] kClosest(Point[] points, Point origin, int k) {\n globalOrigin = origin;\n Queue<Point> pq = new PriorityQueue<>(k, new Comparator<Point>() {\n @Override\n public int compare(Point p1, Point p2) {\n int diff = getDistance(globalOrigin, p2) - getDistance(globalOrigin, p1);\n if (diff == 0) {\n diff = p2.x - p1.x;\n }\n if (diff == 0) {\n diff = p2.y - p1.y;\n }\n return diff;\n }\n });\n\n for (int i = 0; i < points.length; i++) {\n pq.offer(points[i]);\n if (pq.size() > k) {\n pq.poll();\n }\n }\n int size = pq.size();\n Point[] results = new Point[size];\n for (int j = size - 1; j >= 0; j--) {\n results[j] = pq.poll();\n }\n return results;\n }", "public Set<? extends Position> findNearest(Position position, int k);", "public int[][] kClosest3(int[][] points, int K) {\n Arrays.sort(points, (w1, w2) ->\n (w2[0]*w2[0] + w2[1]*w2[1]) - (w1[0]*w1[0] + w1[1]*w1[1]));\n\n return Arrays.copyOfRange(points, 0, K);\n }", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k, double distance);", "public static int[] getMinKthNearestN(double[][] pts, int k){\n if(k>= pts.length){\n int[] indexs = new int[k];\n for(int i = 0;i<indexs.length;i++){\n indexs[i] = i;\n }\n return indexs;\n }\n\n double[][] distanceTo = new double[pts.length][pts.length];\n int[][] indexs = new int[pts.length][pts.length];\n for(int i = 0; i<pts.length;i++){\n for(int j = 0; j<pts.length;j++){\n indexs[i][j] = j;\n distanceTo[i][j] = Math.pow(pts[i][0] - pts[j][0],2)+Math.pow(pts[i][1] - pts[j][1],2);\n }\n }\n\n\n for(int i = 0; i<pts.length;i++){\n iSort(indexs[i],distanceTo[i]);\n }\n\n double minKthNearestN = Double.POSITIVE_INFINITY;\n int pos = -1;\n for(int i = 0; i<pts.length;i++){\n if(distanceTo[i][k] < minKthNearestN){\n minKthNearestN = distanceTo[i][k];\n pos = i;\n }\n }\n int[] space = new int[k+1];\n for(int i = 0; i<=k; i++){\n space[i] = indexs[pos][i];\n }\n\n return space;\n }", "static void kClosestPoints(int x[], int y[], \n int n, int k) \n{ \n // Create a priority queue \n PriorityQueue<Pair> pq = new PriorityQueue<Pair>(); \n\n // Pushing all the points \n // in the queue \n for(int i = 0; i < n; i++) \n { \n pq.add(new Pair(x[i], y[i])); \n } \n\n // Print the first K elements \n // of the queue \n for(int i = 0; i < k; i++) \n { \n\n // Remove the top of the queue \n // and store in a temporary pair \n Pair p = pq.poll(); \n\n // Print the first (x) \n // and second (y) of pair \n System.out.println(p.first + \n \" \" + p.second); \n } \n}", "public int[][] kClosest(int[][] points, int K) {\n\t\tif (points.length == 0 || K <= 0) {\n\t\t\treturn new int[0][];\n\t\t}\n\n\t\tPriorityQueue<int[]> pq = new PriorityQueue<>(new Comparator<int[]>(){\n\t\t\tpublic int compare(int[] o1, int[] o2) {\n\t\t\t\treturn o2[0] * o2[0] + o2[1] * o2[1] - o1[0] * o1[0] - o1[1] * o1[1];\n\t\t\t}\n\t\t});\n\n\t\tfor (int[] p: points) {\n\t\t\tpq.offer(p);\n\t\t\tif (pq.size() > K) {\n\t\t\t\tpq.poll();\n\t\t\t}\n\t\t}\n\n\t\tint[][] res = new int[K][2];\n\t\tint idx = K - 1;\n\t\twhile (!pq.isEmpty()) {\n\t\t\tres[idx--] = pq.poll();\n\t\t}\n\n\t\treturn res;\n\t}", "public ArrayList<Pair<Landmark, Double>> nearestLocations(Pair<Double, Double> userLocation, int num){\n ArrayList<Pair<Landmark, Double>> nearestList = new ArrayList<>();\n for(int i = 0; i < this.list.size(); i++){\n Landmark landmark = list.get(i);\n double latitude = landmark.getLatitude();\n double longitude = landmark.getLongitude();\n Pair<Double, Double> coordinate = new Pair<>(latitude, longitude);\n // TODO use latitude and longitude explicitly\n double dist = distanceBetween(userLocation, coordinate);\n int origin = nearestList.size();\n for( int j = 0; j < nearestList.size(); j++ ){\n if( dist < nearestList.get(j).second ){\n nearestList.add(j, new Pair<>(this.list.get(i), dist));\n if(nearestList.size() > num){\n nearestList.remove(num);\n }\n break;\n }\n }\n if( origin == nearestList.size() ){\n if( nearestList.size() < num ){\n nearestList.add(new Pair<>(this.list.get(i), dist));\n }\n }\n }\n return nearestList;\n }", "private static City[] findKNearest(City root, List<City> cities,\r\n\t\t\tint candidateCount) {\r\n\t\t\r\n\t\tList<City> copy = new ArrayList<>();\r\n\t\tcopy.addAll(cities);\r\n\t\t\r\n\t\t// Sort out the array distances\r\n\t\tCollections.sort(copy, new Comparator<City>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(City o1, City o2) {\r\n\t\t\t\t\r\n\t\t\t\tif (o1.equals(root)) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (o2.equals(root)) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdouble d1 = Math.sqrt(\r\n\t\t\t\t\t\tMath.pow(root.x - o1.x, 2) +\r\n\t\t\t\t\t\tMath.pow(root.y - o1.y, 2));\r\n\t\t\t\t\r\n\t\t\t\tdouble d2 = Math.sqrt(\r\n\t\t\t\t\t\tMath.pow(root.x - o2.x, 2) +\r\n\t\t\t\t\t\tMath.pow(root.y - o2.y, 2));\r\n\t\t\t\t\r\n\t\t\t\tif (d1 > d2) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else if (d1 < d2) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tcopy = copy.subList(0, copy.size()-1);\r\n\t\t\r\n\t\t// Get 5 best\r\n\t\tCity[] best = new City[candidateCount];\r\n\t\tfor (int i = 0; i < candidateCount; i++) {\r\n\t\t\tbest[i] = copy.remove(0);\r\n\t\t}\r\n\t\t\r\n\t\t//System.out.println(Arrays.asList(best));\r\n\t\treturn best;\r\n\t}", "public int[][] kClosest1(int[][] points, int K) {\n Arrays.sort(points, (a, b) -> (a[0]*a[0]+a[1]*a[1]-b[0]*b[0]-b[1]*b[1]));\n return Arrays.copyOfRange(points, 0, K);\n }", "public int[][] kClosest2(int[][] points, int K) {\n PriorityQueue<int[]> bigTopHeap = new PriorityQueue<>(K, (w1, w2) ->\n (w2[0]*w2[0] + w2[1]*w2[1]) - (w1[0]*w1[0] + w1[1]*w1[1]));\n\n for (int[] point : points) {\n bigTopHeap.offer(point);\n if (bigTopHeap.size() > K) { bigTopHeap.poll(); }\n }\n\n int[][] res = new int[K][];\n for (int i = res.length - 1; i >= 0; i--) {\n res[i] = bigTopHeap.poll();\n }\n\n return res;\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public int[][] kClosest2(int[][] points, int K) {\n if (points.length == 0) return new int[1][0];\n PriorityQueue<int[]> maxHeap = new PriorityQueue<int[]>((b, a) -> (a[0] * a[0] + a[1] * a[1] - b[0] * b[0] - b[1] * b[1]));\n \n int[][] res = new int[K][2];\n for (int i = 0; i < points.length; i++) {\n maxHeap.add(points[i]);\n if (maxHeap.size() > K) \n maxHeap.poll();\n }\n int i = 0;\n while (!maxHeap.isEmpty()) {\n res[i++] = maxHeap.poll();\n }\n return res; \n }", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k,\n\t\t\tBiFunction<Position, Position, Double> metric);", "public int[][] kClosest2(int[][] points, int K) {\n\t\tint len = points.length, l = 0, r = len - 1;\n\t\twhile (l <= r) {\n\t\t\tint mid = helper(points, l, r);\n\t\t\tif (mid == K) break;\n\t\t\tif (mid < K) {\n\t\t\t\tl = mid + 1;\n\t\t\t} else {\n\t\t\t\tr = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn Arrays.copyOfRange(points, 0, K);\n\t}", "public List<String> kDistance(String[] words, String target, int k)\n\t{\n\t\tList<String> res = new ArrayList<>();\n\t\tint nw = words.length;\n\t\tTrieNode root = new TrieNode();\n\t\tfor(String word : words)\n\t\t\tinsert(word, root);\n\t\tint dp[] = new int[target.length() + 1];\n\t\tfor(int i = 0; i < target.length() + 1; i ++)\n\t\t\tdp[i] = i;\n\t\tfind(target, root, k, dp, res);\n\t\treturn res;\n\t}", "private static void findKClosestNumbersOtherApproach(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Pair<Integer, Integer>> pq = new PriorityQueue<>();\n\t\tint len = arr.length;\n\t\tint absDiff[] = new int[len];\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tabsDiff[i] = Math.abs(arr[i] - key);\n\t\t\tPair p = new Pair<>(absDiff[i], arr[i]);\n\t\t\tpq.add(p);\n\n\t\t}\n\n\t\tint c = 0;\n\t\tSystem.out.println(\"closest numbers\");\n\t\twhile (!pq.isEmpty() && c < k) {\n\t\t\tint k1 = (int) pq.peek().getValue(0);\n\t\t\tint v = (int) pq.peek().getValue(1);\n\n\t\t\tpq.remove();\n\t\t\tc++;\n\t\t\tSystem.out.println( v);\n\t\t}\n\n\t}", "public ArrayList<Record> near()\n {\n int count = 0;\n ArrayList<Record> closest = new ArrayList<>();\n System.out.println(\"Community Centres that are 5km or less to your location are: \");\n for(Record i: cCentres)\n {\n //latitude and longitude for each centre\n double lat2 = Double.parseDouble(i.getValue(4));\n double lon2 = Double.parseDouble(i.getValue(3));\n ;\n //distance\n double dist = calcDist(lat2, lon2, cCentres);\n if(dist<=5)\n {\n System.out.println(i + \", Distance: \" + dist + \" km\");\n closest.add(i);\n }\n }\n return closest;\n }", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "public List<Integer> _closestKValues(TreeNode root, double target, int k) {\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfinal double targetValue = target;\n\t\tQueue<Integer> heap = new PriorityQueue<>(k, new Comparator<Integer>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Integer arg0, Integer arg1) {\n\t\t\t\tif (Math.abs(arg0 - targetValue) > Math.abs(arg1 - targetValue))\n\t\t\t\t\treturn 1;\n\t\t\t\telse if (Math.abs(arg0 - targetValue) < Math.abs(arg1 - targetValue))\n\t\t\t\t\treturn -1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\taddToHeap(root, heap);\n\t\tfor(int i=0; i<k; i++) {\n list.add(heap.poll());\n }\n\t\treturn list;\n\t}", "Execution getClosestDistance();", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "public List<Location> cheapestKDaysDestinationByActivity(String activity, int k) {\n\t\tList<Location> locs = locations.values().parallelStream()\n\t\t\t\t.filter(location->location.containsActivity(activity)).collect(Collectors.toList());\n\t\t\n\t\tCollections.sort(locs, new Comparator<Location>() {\n\t\t\tpublic int compare(Location l1, Location l2) {\n\t\t\t\treturn (int) l2.totalCostForKDays(k) -\n\t\t\t\t\t\t(int) l1.totalCostForKDays(k);\n\t\t\t}\n\t\t});\n\t\t\n\t\tlocs.sort((Location l1, Location l2)->(int) l1.totalCostForKDays(k) - (int) l2.totalCostForKDays(k));\n\t\t\n\t\tList<Location> ret = new ArrayList<Location>();\n\t\tret.add(locs.get(0));\n\t\t\n\t\tFloat minCost = locs.get(0).totalCostForKDays(k);\n\t\tfor (int i = 1; i < locs.size(); i++) {\n\t\t\tif (locs.get(i).totalCostForKDays(k) == minCost) {\n\t\t\t\tret.add(locs.get(i));\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public int predict(int[] testData) {\n /*\n * kNN algorithm:\n * \n * This algorithm compare the distance of every training data to the test data using \n * the euclidean distance algorithm, and find a specfic amount of training data \n * that are closest to the test data (the value of k determine that amount). \n * \n * After that, the algorithm compare those data, and determine whether more of those\n * data are labeled with 0, or 1. And use that to give the guess\n * \n * To determine k: sqrt(amount of training data)\n */\n\n /*\n * Problem:\n * Since results and distances will be stored in different arrays, but in the same order,\n * sorting distances will mess up the label, which mess up the predictions\n * \n * Solution:\n * Instead of sorting distances, use a search algorithm, search for the smallest distance, and then\n * the second smallest number, and so on. Get the index of that number, use the index to \n * find the result, and store it in a new ArrayList for evaluation\n */\n\n // Step 1 : Determine k \n double k = Math.sqrt(this.trainingData.size());\n k = 3.0;\n\n // Step 2: Calculate distances\n // Create an ArrayList to hold all the distances calculated\n ArrayList<Double> distances = new ArrayList<Double>();\n // Create another ArrayList to store the results\n ArrayList<Integer> results = new ArrayList<Integer>();\n for (int[] i : this.trainingData) {\n // Create a temp array with the last item (result) eliminated\n int[] temp = Arrays.copyOf(i, i.length - 1);\n double distance = this.eucDistance(temp, testData);\n // Add both the result and the distance into associated arraylists\n results.add(i[i.length - 1]);\n distances.add(distance);\n }\n\n // Step 3: Search for the amount of highest points according to k\n ArrayList<Integer> closestResultLst = new ArrayList<Integer>();\n for (int i = 0; i < k; i++) {\n double smallestDistance = Collections.min(distances);\n int indexOfSmallestDistance = distances.indexOf(smallestDistance);\n int resultOfSmallestDistance = results.get(indexOfSmallestDistance);\n closestResultLst.add(resultOfSmallestDistance);\n // Set the smallest distance to null, so it won't be searched again\n distances.set(indexOfSmallestDistance, 10.0);\n }\n\n // Step 4: Determine which one should be the result by looking at the majority of the numbers\n int yes = 0, no = 0;\n for (int i : closestResultLst) {\n if (i == 1) {\n yes++;\n } else if (i == 0) {\n no++;\n }\n }\n\n // Step 5: Return the result\n // test code\n // System.out.println(yes);\n // System.out.println(no);\n if (yes >= no) {\n return 1;\n } else {\n return 0;\n }\n }", "private static void findKClosestNumbers(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Integer> pq;\n\t\tint max = findMaxInArr(arr);\n\t\tint min = findMinInArr(arr);\n\n\t\tint maxDiff = Math.abs(key - max);\n\t\tint minDiff = Math.abs(key - min);\n\n\t\tif (maxDiff <= minDiff) {\n\t\t\tpq = new PriorityQueue<>(Collections.reverseOrder());\n\t\t} else {\n\t\t\tpq = new PriorityQueue<>();\n\t\t}\n\n\t\tfor (int e : arr) {\n\t\t\tpq.add(e);\n\t\t}\n\n\t\tint c = 0;\n\n\t\twhile (c < k) {\n\t\t\tSystem.out.println(pq.remove());\n\t\t\tc++;\n\t\t}\n\n\t}", "public int[] kClosestNumbers(int[] A, int target, int k) {\n // write your code here\n if (A == null || A.length == 0) return null;\n int lastLower = findLastLower(A, target);\n int left = lastLower, right = left + 1;\n int[] res = new int[k];\n\n for (int i = 0; i < k; i++) {\n if (isLeftCloser(A, target, left, right)) {\n res[i] = A[left];\n left--;\n }\n else {\n res[i] = A[right];\n right++;\n }\n }\n return res;\n }", "public List<Location> topKDestinationsByTotalPrice(String attribute, String value, int k,\n\t\t\tDate startDate, Date endDate) {\n\t\tList<Location> locs = getByAttribute(attribute, value);\n\t\t\n\t\tCollections.sort(locs, new Comparator<Location>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Location l1, Location l2) {\n\t\t\t\treturn (int) l2.totalCostBetweenDates(startDate, endDate)\n\t\t\t\t\t\t- (int) l1.totalCostBetweenDates(startDate, endDate);\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn k > locs.size() ? locs : locs.subList(0, k);\n\t}", "public List<Integer> closestKValues(TreeNode root, double target, int k) {\n\t\tQueue<Integer> list = new LinkedList<>();\n\t\tStack<TreeNode> stk = new Stack<>();\n\t\twhile (!stk.isEmpty() || root != null) {\n\t\t\tif (root != null) {\n\t\t\t\tstk.push(root);\n\t\t\t\troot = root.left;\n\t\t\t} else {\n\t\t\t\tTreeNode node = stk.pop();\n\t\t\t\tif (list.size() < k) {\n\t\t\t\t\tlist.add(node.val);\n\t\t\t\t} else {\n\t\t\t\t\tint val = list.peek();\n\t\t\t\t\tif (Math.abs(val - target) > Math.abs(node.val - target)) {\n\t\t\t\t\t\tlist.poll();\n\t\t\t\t\t\tlist.add(node.val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\troot = node.right;\n\t\t\t}\n\t\t}\n\t\treturn new ArrayList<>(list);\n\t}", "public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "public static List<String> topKFrequent_pq(String[] words, int k) {\n Map<String, Integer> countMap = new HashMap<>();\n for (String word : words) {\n countMap.put(word, countMap.getOrDefault(word, 0) + 1);\n }\n\n PriorityQueue<String> pq = new PriorityQueue<String>((word1, word2) -> {\n if (countMap.get(word1) == countMap.get(word2)) {\n return word2.compareTo(word1);\n }\n return countMap.get(word1) - countMap.get(word2);\n });\n\n for (String word : countMap.keySet()) {\n pq.offer(word);\n if (pq.size() > k) {\n pq.poll();\n }\n }\n\n List<String> ans = new ArrayList<>();\n while (!pq.isEmpty()) {\n ans.add(pq.poll());\n }\n Collections.reverse(ans);\n return ans;\n }", "public static List<String> topKFrequent_pq_opt(String[] words, int k) {\n Map<String, Integer> countMap = new HashMap<>();\n for (String word : words) {\n countMap.put(word, countMap.getOrDefault(word, 0) + 1);\n }\n\n PriorityQueue<String> pq = new PriorityQueue<String>((word1, word2) -> {\n if (countMap.get(word1).equals(countMap.get(word2))) {\n return word1.compareTo(word2);\n }\n return countMap.get(word2) - countMap.get(word1);\n });\n\n for (String word : countMap.keySet()) {\n pq.offer(word);\n }\n\n List<String> ans = new ArrayList<>();\n for (int i = 0; i < k; i++) {\n ans.add(pq.poll());\n }\n\n return ans;\n }", "private Sim[] findNeighbors(Product p, ArrayList<Product> trainData, int k) {\n\t\tSimComparator sComparator = new SimComparator();\n\t\tPriorityQueue<Sim> pq = new PriorityQueue<Sim>(k, sComparator);\n\t\tfor (Product tp : trainData) {\n\t\t\tSim sim = getSimilarity(p, tp, weights);\n\t\t\tpq.offer(sim);\n\t\t}\n\t\tSim[] neighbors = new Sim[k];\n\t\tfor (int i = 0; i < k; i++)\n\t\t\tneighbors[i] = pq.poll();\n\t\treturn neighbors;\n\t}", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "public int[] kClosest(int[] array, int target, int k) {\n if (array.length==0){\n return new int[] {-1};\n }\n int left=0;\n int right=array.length-1;\n int[] result=new int[k];\n while(left<right-1){\n int mid = left+(right-left)/2;\n if (array[mid]==target){\n left=mid;\n right=mid;\n }else if (array[mid]>target){\n right = mid;\n }else{\n left = mid;\n }\n }\n //post processing\n for(int i=0;i<k;i++){ //逻辑运算符按顺序计算,如果先计算array【left】就有可能出界报错\n if( left<0 || (right<=array.length-1 && Math.abs(array[left]-target)>=Math.abs(array[right]-target))){\n result[i]=array[right];\n right++;\n }else{\n result[i]=array[left];\n left--;\n }\n }\n return result;\n }", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "public ArrayList<Park> getClosestFiveParksFromUser(double latitude, double longitude) {\n return this.bn.shortestParksFromUser(latitude, longitude);\n\n }", "public static void main(String[] args) {\n BrutePointST<Integer> st = new BrutePointST<Integer>();\n double qx = Double.parseDouble(args[0]);\n double qy = Double.parseDouble(args[1]);\n double rx1 = Double.parseDouble(args[2]);\n double rx2 = Double.parseDouble(args[3]);\n double ry1 = Double.parseDouble(args[4]);\n double ry2 = Double.parseDouble(args[5]);\n int k = Integer.parseInt(args[6]);\n Point2D query = new Point2D(qx, qy);\n RectHV rect = new RectHV(rx1, ry1, rx2, ry2);\n int i = 0;\n while (!StdIn.isEmpty()) {\n double x = StdIn.readDouble();\n double y = StdIn.readDouble();\n Point2D p = new Point2D(x, y);\n st.put(p, i++);\n }\n StdOut.println(\"st.empty()? \" + st.isEmpty());\n StdOut.println(\"st.size() = \" + st.size());\n StdOut.println(\"First \" + k + \" values:\");\n i = 0;\n for (Point2D p : st.points()) {\n StdOut.println(\" \" + st.get(p));\n if (i++ == k) {\n break;\n }\n }\n StdOut.println(\"st.contains(\" + query + \")? \" + st.contains(query));\n StdOut.println(\"st.range(\" + rect + \"):\");\n for (Point2D p : st.range(rect)) {\n StdOut.println(\" \" + p);\n }\n StdOut.println(\"st.nearest(\" + query + \") = \" + st.nearest(query));\n StdOut.println(\"st.nearest(\" + query + \", \" + k + \"):\");\n for (Point2D p : st.nearest(query, k)) {\n StdOut.println(\" \" + p);\n }\n }", "private void searchForNearest(KdNode kdNode, Point2D p, RectHV rectangle) {\n int comparison;\n // 2 rectangles that will store the coordinates of the rectangles that are delimited by kdNode's children,\n // used in order to calculate the distance to them and see if it's worth looking down the path inside them as well\n // (i.e. if the distance from point p to the rectangle is less than the distance to an already established nearest)\n RectHV rectLeftBelow, rectRightAbove;\n\n if (kdNode.point.equals(p)) {\n // if the point we're looking at actually equals the query point, we return here,\n // as we can no longer find a distance lower than 0\n nearest = kdNode.point;\n return;\n }\n\n // if the point in the current node is closer to the searched node, we update nearest\n if (p.distanceSquaredTo(kdNode.point) < p.distanceSquaredTo(nearest))\n nearest = kdNode.point;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true), then we have left/right rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n kdNode.point.x(), rectangle.ymax());\n rectRightAbove = new RectHV(kdNode.point.x(), rectangle.ymin(),\n rectangle.xmax(), rectangle.ymax());\n }\n else { // if this KdNode is horizontal (root.dimension == false), then we have below/above rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n rectangle.xmax(), kdNode.point.y());\n rectRightAbove = new RectHV(rectangle.xmin(), kdNode.point.y(),\n rectangle.xmax(), rectangle.ymax());\n }\n // we look at which rectangle is nearest to the query point, in order to go down that path first\n comparison = Double.compare(rectLeftBelow.distanceSquaredTo(p),\n rectRightAbove.distanceSquaredTo(p));\n\n if (comparison < 0) { // if distance to left/lower rectangle is lower than to right/upper\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n // if it's larger than to nearest, the distance to the other\n // rectangle will certainly be even larger, so we return here\n else return;\n }\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n // else return; // return statement not needed, if (comparison < 0) statement terminates here anyway\n }\n }\n else { // comparison < 0, the opposite situation holds: distance to right/upper rectangle is lower than to left/lower\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n else return;\n }\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n }\n\n }\n }", "public static void main(String[] args) \n\t {\n\t\t KdTree kt = new KdTree();\n\t\t Point2D p = new Point2D (0.406360,0.678100);\n\t\t Point2D q = new Point2D(0.740024,0.021714);\n\t\t kt.insert(p);\n\t\t kt.insert(q);\n\t\t p = new Point2D(0.010189,0.742363);\n\t\t kt.insert(p);\n\t\t p = new Point2D(0.147733,0.203388);\n\t\t kt.insert(p);\n\t\t p = new Point2D(0.537098,0.436150);\n\t\t kt.insert(p);\n\t\t Point2D pq = new Point2D(0.37,0.23);\n\t\t kt.draw();\n\t\t Point2D pqr = kt.nearest(pq);\n\t\t pqr.draw();\n\t\t System.out.println(\" x coordinate \"+pqr.x()+ \" y \"+pqr.y()); \n\t }", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public List<Integer> distanceK(TreeNode root, TreeNode target, int K) {\n List<Integer> res = new ArrayList();\n if (root == null || target == null || K < 0)\n return res;\n map = new HashMap();\n buildChildParentMap(root, null);\n\n Queue<TreeNode> q = new LinkedList();\n q.add(null);\n q.add(target);\n\n Set<TreeNode> seen = new HashSet();\n seen.add(target);\n seen.add(null);\n\n int d = 0;\n\n while (!q.isEmpty()) {\n TreeNode n = q.poll();\n if (n == null) {\n if (d == K) {\n while (!q.isEmpty()) {\n res.add(q.poll().val);\n }\n break;\n }\n q.add(null);\n d++;\n } else {\n if (!seen.contains(n.left)) {\n seen.add(n.left);\n q.add(n.left);\n }\n if (!seen.contains(n.right)) {\n seen.add(n.right);\n q.add(n.right);\n }\n TreeNode par = map.get(n);\n if (!seen.contains(par)) {\n seen.add(par);\n q.add(par);\n }\n }\n }\n\n return res;\n }", "public List<List<AlgorithmPoint>> getNeighbours(AlgorithmPoint point, double epsilon, int k)\n {\n List<AlgorithmPoint> neighbours = getNeighbours(point, epsilon);\n\n // first we create a max priority queue\n\n PriorityQueue<PrioPair<AlgorithmPoint,Double>> pq = new PriorityQueue<PrioPair<AlgorithmPoint,Double>>();\n\n for (AlgorithmPoint q : neighbours) {\n double dist = Calculations.distance(point.getPoint(), q.getPoint(), Algorithm.DISTANCE_METRIC);\n\n PrioPair<AlgorithmPoint,Double> pair = new PrioPair<AlgorithmPoint,Double>(q, dist);\n\n if (pq.size() <= k) {\n pq.add(pair);\n } else {\n if (dist < ((Double) pq.peek().getV())) {\n // remove the highest element\n pq.poll();\n pq.add(pair);\n }\n }\n }\n\n // now we make the list\n\n List<AlgorithmPoint> knn = new ArrayList<AlgorithmPoint>();\n PrioPair<AlgorithmPoint,Double> pair;\n\n while ((pair = pq.poll()) != null) {\n knn.add(pair.getT());\n }\n\n List<List<AlgorithmPoint>> result = new ArrayList<List<AlgorithmPoint>>(2);\n\n result.add(knn);\n result.add(neighbours);\n\n return result;\n }", "private void kNN(List<Room> roomList, HashMap<String, Integer> query) {\n resultList.clear();\n kNearestRooms.clear();\n\n calculateDistances(roomList, query);\n initializeKClosest();\n String majority = findMajority();\n setCurrTextView(majority);\n currTextView.setBackgroundColor(Color.parseColor(\"#FFA500\"));\n // textLocate.setText(\"You are in room : \" + majority);\n }", "public int[] getKNearestNeighbors(final int k, final DataPoint point) {\n if (k >= this.getNumPoints()) {\n return null;\n }\n\n int[] nearest = new int[k];\n List<DataPoint> neighbors = ntree.getClosestPoints(k, point);\n for (int i = 0; i < k; i++) {\n nearest[i] = ntree.getIndex(neighbors.get(i));\n }\n\n return nearest;\n }", "private void positionIntersects(LinkedList<TermPositions> p1, LinkedList<TermPositions> p2, int k) {\n if (p1 != null && p2 != null) {\n int df1 = p1.size();\n int df2 = p2.size();\n while (!p1.isEmpty() && !p2.isEmpty()) {\n int tf1 = p1.peek().getPositionList().size();\n int tf2 = p1.peek().getPositionList().size();\n if (p1.peek().getDocId() == p2.peek().getDocId()) {\n LinkedList<Integer> pp1 = p1.peek().getPositionList();\n while (!pp1.isEmpty()) {\n for (Integer integer : p2.peek().getPositionList()) {\n if ((pp1.peek() - integer) < 0 && Math.abs(pp1.peek() - integer) <= (k + 1)) {\n double score = (1 + Math.log(tf1) * Math.log(N / df1)) + (1 + Math.log(tf2) * Math.log(N / df2));\n resultsCollector.add(new DocCollector(p1.peek().getDocId(), score));\n break;\n }\n }\n pp1.pop();\n }\n } else if (p1.peek().getDocId() < p2.peek().getDocId())\n p1.pop();\n else\n p2.pop();\n\n p1.pop();\n p2.pop();\n\n }\n\n }\n\n\n }", "public double[] dist2All(int s, int k){\n\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n\n double[] resultPath = new double[intersection];\n for (int i = 0; i <intersection ; i++) {\n resultPath[i] = INFINITY;\n }\n resultPath[s] = 0;\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,resultPath[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(resultPath[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey = resultPath[extractedVertex] + edge.weight ;\n double currentKey = resultPath[destination];\n if(currentKey>newKey){\n minHeap.updateKey(newKey, destination,resultPath[destination]);\n resultPath[destination] = newKey;\n }\n }\n }\n }\n for(int i =0; i<resultPath.length;i++){\n if(SPT[i]==false)\n resultPath[i]=-1;\n }\n return resultPath;\n }", "public ArrayList<Pair<Landmark, Double>> locationWithDistance(Pair<Double, Double> userLocation) {\n ArrayList<Pair<Landmark, Double>> distanceList = new ArrayList<>();\n for(int i = 0; i < this.list.size(); i++){\n Landmark landmark = list.get(i);\n double latitude = landmark.getLatitude();\n double longitude = landmark.getLongitude();\n Pair<Double, Double> coordinate = new Pair<>(latitude, longitude);\n // TODO use latitude and longitude explicitly\n double dist = distanceBetween(userLocation, coordinate);\n distanceList.add(new Pair<>(this.list.get(i), dist));\n }\n for( int i = 0; i < distanceList.size()-1; i++ ){\n for( int j = i+1; j < distanceList.size(); j++ ){\n if(distanceList.get(i).second > distanceList.get(j).second){\n Collections.swap(distanceList, i, j);\n }\n }\n }\n return distanceList;\n }", "public float minDistancePair(int doc) throws IOException {\n float distance = 0f;\n final SortedSet<Integer> pos = new TreeSet<Integer>();\n final LeafReader reader = this.context.reader();\n if (reader != null && this.terms.size() > 1) {\n // get a sorted list of positions\n for (final TermCountPair term : this.terms) {\n final PostingsEnum posting =\n reader.postings(new Term(this.privateField, term.getTerm()), PostingsEnum.POSITIONS);\n if (posting != null) {\n // move to the document currently looking at\n posting.advance(doc);\n int count = 0;\n final int freq = posting.freq();\n // make sure to add them all\n while (count < freq) {\n pos.add(new Integer(posting.nextPosition()));\n count += 1;\n }\n }\n }\n // now find the closest pairs\n Integer dist = Math.abs(pos.first() - pos.last());\n final Iterator<Integer> it = pos.iterator();\n Integer prev = pos.last();\n Integer current;\n while (it.hasNext()) {\n current = it.next();\n if (Math.abs(current - prev) < dist) {\n dist = Math.abs(current - prev);\n }\n prev = current;\n }\n distance = dist.intValue();\n } else if (this.terms.size() > 1) {\n distance = this.getDocLength(doc);\n }\n return distance;\n }", "private Map<double[], Set<String>> initiateClusters(int k, Set<String> restaurantIDs) {\n // centroids[0] is lattitude and centroids[1] is longitude for a centroid\n // Map assigns restaurants to a specific centroid\n Map<double[], Set<String>> restaurantClusters = new HashMap<double[], Set<String>>();\n\n // Find the min and max latitudes and longitudes\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n\n for (String rID : restaurantIDs) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n\n // Create a number of centroids equal to k\n for (int i = 0; i < k; i++) {\n // generate random centroid based on min and max latitudes\n // and longitudes, with (currently) no assigned restaurants\n HashSet<String> emptySet = new HashSet<String>();\n restaurantClusters.put(this.generateRandomCentroid(minLat, maxLat, minLon, maxLon), emptySet);\n }\n\n // Assign each restaurant to its closest centroid\n\n for (String rID : restaurantIDs) {\n\n double[] newCentroid = null;\n double minDist = Double.MAX_VALUE;\n\n for (double[] centroid : restaurantClusters.keySet()) {\n double distance = this.computeDistance(centroid, this.restaurantMap.get(rID));\n if (distance < minDist) {\n newCentroid = centroid;\n minDist = distance;\n }\n }\n restaurantClusters.get(newCentroid).add(rID);\n }\n return restaurantClusters;\n }", "public static double BruteForceClosestPairs(ArrayList<Point> P) {\n\n\t\t//Assume closest distance is very large\n\t\tdouble distance = Double.POSITIVE_INFINITY;\n\t\t//Size of Arraylist\n\t\tint size = P.size();\n\t\t// New minimum \n\t\tdouble distchange = 0.0;\n\n\t\tfor (int i = 0; i < size - 1; i++) {\n\t\t\tfor (int j = i + 1; j < size; j++) {\n\n\t\t\t\tdistchange = distance;\n\t\t\t\t// Calculate distance between two points\n\t\t\t\tdistance = Math.min(Math.sqrt(Math.pow(P.get(i).getX() - P.get(j).getX(), 2) \n\t\t\t\t\t\t + Math.pow(P.get(i).getY() - P.get(j).getY(), 2)), distance);\n\t\t\t\t\n\t\t\t\tif (distchange != distance) {\n\t\t\t\t\t// If a new min was found, assign the new points \n\t\t\t\t\t// used for output to get \"coordinates of closest pair\"\n\t\t\t\t\tcoordinatepairs = \"(\" + P.get(i).getX() + \", \" + P.get(i).getY()+ \"), \" +\n\t\t\t\t\t\t\t\t \"(\" + P.get(j).getX() + \", \" + P.get(j).getY() + \")\";\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn distance;\t\t\t\n\t}", "private static double divideAndConquer(ArrayList<Point> X, ArrayList<Point> Y) {\n\n\t\t//Assigns size of array\n\t\tint size = X.size();\n\n\t\t//If less than 3 points, efficiency is better by brute force\n\t\tif (size <= 3) {\n\t\t\treturn BruteForceClosestPairs(X);\n\t\t}\n\t\t\n\t\t//Ceiling of array size / 2\n\t\tint ceil = (int) Math.ceil(size / 2);\n\t\t//Floor of array size / 2\n\t\tint floor = (int) Math.floor(size / 2);\n\t\t\n\t\t//Array list for x & y values left of midpoint\n\t\tArrayList<Point> xL = new ArrayList<Point>();\t\n\t\tArrayList<Point> yL = new ArrayList<Point>();\n\t\t\n\t\t//for [0 ... ceiling of array / 2]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = 0; i < ceil; i++) {\n\t\t\t\n\t\t\txL.add(X.get(i));\n\t\t\tyL.add(Y.get(i));\n\t\t}\n\t\t\n\t\t// Array list for x & y values right of midpoint\n\t\tArrayList<Point> xR = new ArrayList<Point>();\n\t\tArrayList<Point> yR = new ArrayList<Point>();\n\t\t\n\t\t//for [floor of array / 2 ... size of array]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = floor; i < size - 1; i++) {\n\n\t\t xR.add(X.get(i));\n\t\t\tyR.add(Y.get(i));\n\t\t}\n\t\t\n\t\t//Recursively find the shortest distance\n\t\tdouble distanceL = divideAndConquer(xL, yL);\n\t\tdouble distanceR = divideAndConquer(xR, xL);\n\t\t//Smaller of both distances\n\t\tdouble distance = Math.min(distanceL, distanceR);\n\t\t//Mid-line\n\t\tdouble mid = X.get(ceil - 1).getX();\n\n\t\tArrayList<Point> S = new ArrayList<Point>();\n\n\t\t//copy all the points of Y for which |x - m| < d into S[0..num - 1]\n\t\tfor (int i = 0; i < Y.size() - 1; i++) {\n\n\t\t\tif (Math.abs(X.get(i).getX() - mid) < distance) {\n\t\t\t\tS.add(Y.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Square minimum distance\n\t\tdouble dminsq = distance * distance;\n\t\t//Counter\n\t\tint k = 0;\n\t\tint num = S.size();\n\n\t\tfor (int i = 0; i < num - 2; i++) {\n\t\t\t\n\t\t\tk = i + 1;\n\t\t\t\n\t\t\twhile (k <= num - 1 && (Math.pow((S.get(k).getY() - S.get(i).getY()), 2) < dminsq)) {\n\n\t\t\t\t//Find distance between points and find the minimum compared to dminsq\n\t\t\t\tdminsq = Math.min(Math.pow(S.get(k).getX() - S.get(i).getX(), 2) \n\t\t\t\t\t\t\t\t+ Math.pow(S.get(k).getY() - S.get(i).getY(), 2), dminsq);\n\n\t\t\t\tk = k + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.sqrt(dminsq);\n\t}", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "private double distantziaKalkulatu() {\r\n\t\tdouble lurrarenRadioa = 6371;// kilometrotan Lurraren radioa\r\n\t\tdouble dLat = Math.toRadians(terLat - latitudea); //\r\n\t\tdouble dLng = Math.toRadians(termLong - longitudea);\r\n\t\tdouble sindLat = Math.sin(dLat / 2);\r\n\t\tdouble sindLng = Math.sin(dLng / 2);\r\n\t\tdouble va1 = Math.pow(sindLat, 2)\r\n\t\t\t\t+ Math.pow(sindLng, 2) * Math.cos(Math.toRadians(terLat)) * Math.cos(Math.toRadians(latitudea));\r\n\t\tdouble va2 = 2 * Math.atan2(Math.sqrt(va1), Math.sqrt(1 - va1));\r\n\t\tdouble distancia = lurrarenRadioa * va2;\r\n\r\n\t\treturn distancia;\r\n\t}", "public void randSelectCenters(int k) {\r\n\t\tif (pointList == null || pointList.isEmpty())\r\n\t\t\treturn;\r\n\r\n\t\tList<Integer> range = IntStream.range(0, pointList.size()).boxed().collect(Collectors.toList());\r\n\t\tCollections.shuffle(range);\r\n\t\tfor (int cid : range.stream().limit(k).collect(Collectors.toList()))\r\n\t\t\tcenterList.add(pointList.get(cid));\r\n\t}", "public List<T> kNearestNeighborsNaive(int numToFind, HasCoordinates searchPos)\n throws IllegalArgumentException {\n if (numToFind < 0) {\n throw new IllegalArgumentException(\"ERROR: Number of nearest \"\n + \"neighbors to find must be a positive integer\");\n }\n List<T> pointsCopy = new ArrayList<>(points);\n Collections.shuffle(pointsCopy);\n Collections.sort(pointsCopy, new PointComparator(searchPos));\n\n if (numToFind >= pointsCopy.size()) {\n return pointsCopy;\n }\n\n return pointsCopy.subList(0, numToFind);\n }", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "private Point calcLocation(String tagID){\t\t\t\n\t\tDate now = new Date();\n\t\tclass referenceDist implements Comparable<referenceDist>{\n\t\t\tString referenceID;\n\t\t\tDouble inverseDistance;\n\t\t\t\n\t\t\tpublic referenceDist(String id, double distance){\n\t\t\t\tthis.referenceID = id;\n\t\t\t\tthis.inverseDistance = new Double(distance);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int compareTo(referenceDist o) {\n\t\t\t\t\n\t\t\t\treturn o.inverseDistance.compareTo(this.inverseDistance);\n\t\t\t}\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tArrayList<referenceDist> referenceList = new ArrayList<referenceDist>();\t\t\n\t\tfor (int i = 0 ; i < (referenceTags.size()); i++){\n\t\t\tString referenceID = referenceTags.get(i);\n\t\t\t//System.err.printf(\"Comparing tag %s with readings: %s\\r\\n\", tagID, tags.get(tagID).toString());\n\t\t\tint distance = tags.get(tagID).calcDiff(tags.get(referenceID));\n\t\t\t//System.err.printf(\"Reference tag %s with readings: %s\\r\\n\", referenceID, tags.get(referenceID).toString());\n\t\t\tdouble power = 0;\n\t\t\tif (distance == 0){\n\t\t\t\tpower = 10;\n\t\t\t} else {\n\t\t\t\tpower = 1.0/distance;\n\t\t\t}\n\t\t\t\n\t\t\treferenceList.add(new referenceDist(referenceID, power));\n\t\t}\n\t\t\n\t\tCollections.sort(referenceList);\n//\t\tIterator<referenceDist> iter = referenceList.iterator();\n//\t\tSystem.out.printf(\"START\\r\\n\");\n//\t\twhile(iter.hasNext()){\n//\t\t\treferenceDist dist = iter.next();\n//\t\t System.out.printf(\"'%s : %s'\", dist.referenceID, dist.inverseDistance.toString());\n//\t\t}\n//\t\tSystem.out.printf(\"\\r\\nEND\\r\\n\");\n\t\tint neighbours = Math.min(maxNeighbours, referenceList.size());\n\t\tdouble total = 0;\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble diff = 0;\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\ttotal += referenceList.get(i).inverseDistance;\n\t\t}\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\tPoint current = tags.get(referenceList.get(i).referenceID).getLoc();\n\t\t\tx += (referenceList.get(i).inverseDistance / total) * current.getX();\n\t\t\ty += (referenceList.get(i).inverseDistance / total) * current.getY();\n\t\t}\n\t\tif (tagID.equals(\"03BD\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-200),2));\n\t\t} else if (tagID.equals(\"03B8\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-300),2));\n\t\t} else if (tagID.equals(\"03D3\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-400),2));\n\t\t}\n\t\tlog(String.valueOf(diff)+ \"\\r\\n\", tagID+ \"_4.log\");\t\t\n\t\t\t\n\n\t\tPoint location = new Point((int )x, (int)y);\n\t\tlog(String.valueOf(now.getTime()) + \"\\r\\n\", \"time.log\");\t\t\t\n\n\t//\tlog(String.valueOf(now.getTime()) + \": Tag=\"+ tagID + \" x=\" + String.valueOf(x) + \" y=\"+String.valueOf(y)+\"\\r\\n\", \"tagLocationLogfile.log\");\n\t\t\n\t\treturn location;\n\t}", "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "private static int getOptimalPoints(double[] dataN, double[] dataK, int count) {\n int posN = 0, posK = 0;\n int points = 0; // points Ken wins\n while (posN < count && posK < count) {\n while (posK < count && dataN[posN] > dataK[posK]) {\n posK++;\n }\n if (posK < count) {\n // Ken earns one point by his strategy\n points++;\n posN++; posK++;\n } else {\n break;\n }\n }\n return count - points; // return points Naomi wins\n }", "public int solve(int[] customers, int[] mood, int k) {\n return calculate_maximumHappyPeople(customers, mood, k);\n }", "public LatLonDistance(Collection<K> locationList) {\n locations = locationList;\n }", "public List<int[]> kSmallestPairs(int[] nums1, int[] nums2, int k) {\n return null;\n }", "public double findDensity() {\n\t\tdouble temp = 0.0;\n\t\tfor (int i = 0; i < neighbors.size(); i++) { //calculate desnity using point and k nearest neighbors\n\t\t\tPoint t = neighbors.get(i);\n\t\t\tArrayList<Double> pa = t.getList();\n\t\t\tArrayList<Double> pb = p.getList();\n\t\t\tdouble sum = 0.0;\n\t\t\tfor (int j = 0; j < pa.size(); j++) {\n\t\t\t\tsum += Math.pow(pa.get(j)- pb.get(j), 2); //use euclidian distance\n\t\t\t}\n\t\t\ttemp += Math.sqrt(sum);\n\t\t}\n\t\treturn ((neighbors.size())/temp);\n\t}", "public static Double getDistanceFromLatLonInKm(Double firstPointLatitude,\n Double firstPointLongitude,\n Double secondPointLatitude,\n Double secondPointLongitude) {\n final int radiusOfEarth = 6371;\n Double latitudeDistance = Math.toRadians(secondPointLatitude - firstPointLatitude);\n Double longitudeDistance = Math.toRadians(secondPointLongitude - firstPointLongitude);\n\n double a = Math.sin(latitudeDistance / 2) * Math.sin(latitudeDistance / 2)\n + Math.cos(Math.toRadians(firstPointLatitude)) * Math.cos(Math.toRadians(secondPointLatitude))\n * Math.sin(longitudeDistance / 2) * Math.sin(longitudeDistance / 2);\n\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n // convert to meters\n\n double distnce = radiusOfEarth * c * 1000;\n distnce = Math.pow(distnce, 2) + Math.pow(0.0, 2);\n\n return Math.sqrt(distnce);\n }", "public static double closestPair(Point[] sortedX) {\n if (sortedX.length <= 1) {\n return Double.MAX_VALUE;\n }\n double mid = sortedX[(sortedX.length) / 2].getX();\n double firstHalf = closestPair(Arrays.copyOfRange(sortedX, 0, (sortedX.length) / 2));\n double secondHalf = closestPair(Arrays.copyOfRange(sortedX, (sortedX.length) / 2, sortedX.length));\n double min = Math.min(firstHalf, secondHalf);\n ArrayList<Point> close = new ArrayList<Point>();\n for (int i = 0; i < sortedX.length; i++) {\n double dis = Math.abs(sortedX[i].getX() - mid);\n if (dis < min) {\n close.add(sortedX[i]);\n }\n }\n // sort by Y coordinates\n Collections.sort(close, new Comparator<Point>() {\n public int compare(Point obj1, Point obj2) {\n return (int) (obj1.getY() - obj2.getY());\n }\n });\n Point[] near = close.toArray(new Point[close.size()]);\n\n for (int i = 0; i < near.length; i++) {\n int k = 1;\n while (i + k < near.length && near[i + k].getY() < near[i].getY() + min) {\n if (min > near[i].distance(near[i + k])) {\n min = near[i].distance(near[i + k]);\n System.out.println(\"near \" + near[i].distance(near[i + k]));\n System.out.println(\"best \" + best);\n\n if (near[i].distance(near[i + k]) < best) {\n best = near[i].distance(near[i + k]);\n arr[0] = near[i];\n arr[1] = near[i + k];\n // System.out.println(arr[0].getX());\n // System.out.println(arr[1].getX());\n\n }\n }\n k++;\n }\n }\n return min;\n }", "double getDistance(Point p);", "public Point3D findClosestPoint(List<Point3D> pointsList) {\n /**\n * the near point\n */\n Point3D result = null;\n /**\n * initialize with a big number that we sure it will change\n */\n double closestDistance = Double.MAX_VALUE;\n\n /**\n * if the point equals to null, it`s mean there\n * is no point that close to it\n */\n if (pointsList == null) {\n return null;\n }\n\n for (Point3D p : pointsList) {\n double temp = p.distance(_p0);\n if (temp < closestDistance) {\n closestDistance = temp;\n result = p;\n }\n }\n\n return result;\n }", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "public static Point[] closestPair(double[] x, double[]y) throws Exception\r\n {\r\n /*if x-coordinates dont match y-coordinates*/\r\n if(x.length != y.length)\r\n {\r\n System.out.println(\"Can't compute closest pair. Input lengths mismatch!\");\r\n throw new Exception();\r\n }\r\n /*if there is one or less points*/\r\n if(x.length <2 || y.length <2)\r\n {\r\n System.out.println(\"Can't compute closest pair. Fewer inputs!\");\r\n throw new Exception();\r\n }\r\n /*if there are two points*/\r\n if(x.length == 2)\r\n {\r\n Point[] closest = {new Point(x[0],y[0]), new Point(x[1],y[1])};\r\n return closest;\r\n }\r\n /*if there are three points*/\r\n if(x.length == 3)\r\n {\r\n double cx1 = x[0], cy1 = y[0], cx2 = x[1], cy2 = y[1];\r\n //P0 and P1\r\n double cdist = Math.pow((cx1-cx2),2) + Math.pow((cy1-cy2),2); //ignoring square root to reduce computation time\r\n //P1 and P2\r\n double dist = Math.pow((x[0]-x[2]),2) + Math.pow((y[0]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[0]; cy1 = y[0]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n //P2 and P3\r\n dist = Math.pow((x[1]-x[2]),2) + Math.pow((y[1]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[1]; cy1 = y[1]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n Point[] closest = {new Point(cx1,cy1), new Point(cx2,cy2)};\r\n return closest;\r\n }\r\n \r\n //sorting based on x values\r\n int i=0;\r\n double z,zz;\r\n while (i < x.length) \r\n \t{\r\n \t\tif (i == 0 || x[i-1] <= x[i])\r\n \t\t\ti++;\r\n \t\telse \r\n \t\t{\r\n \t\t\tz = x[i];\r\n \t\t\tzz = y[i];\r\n \t\t\tx[i] = x[i-1];\r\n \t\t\ty[i] = y[i-1];\r\n \t\t\tx[--i] = z;\r\n \t\t\ty[i] = zz;\r\n \t\t}\r\n \t}\r\n \r\n //finding left closest pair\r\n Point[] closestL = closestPair(Arrays.copyOfRange(x, 0, x.length/2),Arrays.copyOfRange(y, 0, y.length/2));\r\n //finding right closest pair\r\n Point[] closestR = closestPair(Arrays.copyOfRange(x, x.length/2, x.length),Arrays.copyOfRange(y, y.length/2, y.length));\r\n \r\n double distLsq = Math.pow((closestL[0].getX() - closestL[1].getX()),2) + Math.pow((closestL[0].getY() - closestL[1].getY()),2);\r\n double distRsq = Math.pow((closestR[0].getX() - closestR[1].getX()),2) + Math.pow((closestR[0].getY() - closestR[1].getY()),2);\r\n \r\n double minD;\r\n Point[] closest;\r\n if(distLsq<distRsq)\r\n {\r\n minD = distLsq;\r\n closest = closestL;\r\n }\r\n else \r\n {\r\n minD = distRsq;\r\n closest = closestR;\r\n }\r\n \r\n double midLine = ((x[x.length/2-1]) + (x[x.length/2]))/2;\r\n \r\n //System.out.println(Arrays.toString(x));\r\n //System.out.println(\"midline... x = \" + midLine);\r\n \r\n /*looking at points at a horizontal distance of minD from the mid line*/\r\n for(i = 0; i < x.length/2; i++)\r\n {\r\n if(midLine - x[i] < minD)\r\n {\r\n for(int j = x.length/2; j < x.length; j++)\r\n {\r\n /*looking at points at a vertical and horizontal distance of minD from the current point*/\r\n if((x[j] - midLine < minD) && (y[j] - y [i] < minD || y[i] - y [j] < minD))\r\n {\r\n if(Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2) < minD)\r\n {\r\n closest = new Point[]{new Point(x[i],y[i]), new Point(x[j],y[j])};\r\n minD = Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return closest;\r\n \r\n }", "public NearestNeighbourhood(final int k) {\n\t\tsuper();\n\t\tthis.k = k;\n\t}", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "protected static double distance(Point p, Point centroid) {\n Iterator it = centroid.points.entrySet().iterator();\n double tmp = 0;\n while (it.hasNext()) {\n Map.Entry<String,Double> pair = (Map.Entry)it.next();\n// System.out.println(centroid.docNum);\n tmp += Math.pow(centroid.points.get(pair.getKey()) - p.points.get(pair.getKey()), 2);\n it.remove(); // avoids a ConcurrentModificationException\n }\n return Math.sqrt(tmp);\n }", "public scala.Tuple2<java.lang.Object, java.lang.Object> findClosest (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "private static Point getNearest(Collection<Point> centers, Point p) {\n\t\tdouble min = 0;\n\t\tPoint minPoint = null;\n\t\tfor(Point c : centers){\n\t\t\tif(minPoint == null || c.distance(p) < min){\n\t\t\t\tmin = c.distance(p);\n\t\t\t\tminPoint = c;\n\t\t\t}\n\t\t}\n\t\treturn minPoint;\n\t}", "public int kthLargestElement(int k, ArrayList<Integer> numbers) {\n\t\tthis.k = k;\r\n\t\tkthQsort(numbers, 0, numbers.size()-1);\r\n\t\treturn rs;\r\n }", "long closest(double lon, double lat) {\n double smallestDist = Double.MAX_VALUE;\n long smallestId = 0;\n Iterable<Node> v = world.values();\n for (Node n : v) {\n double tempLat = n.getLat();\n double tempLon = n.getLon();\n double tempDist = distance(lon, lat, tempLon, tempLat);\n if (tempDist < smallestDist) {\n smallestDist = tempDist;\n smallestId = n.getId();\n }\n }\n return smallestId;\n }", "public ArrayList<String> top5search(String kw1, String kw2) {\n\t\tkw1 = kw1.toLowerCase();\n kw2 = kw2.toLowerCase();\n ArrayList <String> outArr = new ArrayList <String> ();\n ArrayList <Occurrence> kw1Arr = null;\n ArrayList <Occurrence> kw2Arr = null;\n for(String e: keywordsIndex.keySet()) {\n if(e.equals(kw1) == true) {\n kw1Arr = keywordsIndex.get(e);}\n if(e.equals(kw2) == true) {\n kw2Arr = keywordsIndex.get(e);}}\n int kw1Point = 0;\n int kw2Point = 0;\n for(int inc = 0; inc < 5; inc++) {\n int kw1Value = 0;\n Occurrence kw1Occ = null;\n int kw2Value = 0;\n Occurrence kw2Occ = null;\n if(kw1Arr != null && kw1Point < kw1Arr.size()) {\n kw1Occ = kw1Arr.get(kw1Point);\n kw1Value = kw1Occ.frequency;}\n if(kw2Arr != null && kw2Point < kw2Arr.size()) {\n kw2Occ = kw2Arr.get(kw2Point);\n kw2Value = kw2Occ.frequency;}\n if(kw1Value == 0 && kw2Value == 0) {\n \t//will only occur if the if-statements for 212 and 215 are false\n \t//which means that the array doesn't exist or the pointer has iterated through the whole array\n break;}\n if(kw1Value >= kw2Value) {\n outArr.add(kw1Occ.document);\n kw1Point = kw1Point + 1;}\n else {outArr.add(kw2Occ.document);\n kw2Point = kw2Point + 1;}}\n if(outArr.size() == 0) {//no found matches\n return null;}\n else {return outArr;}//found matches\n\t}", "private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }", "public Iterable<Shop> findClosest(Double selectedLat, Double selectedLong) {\n return this.shopRepository.getClosestShop(selectedLat, selectedLong);\n }", "private static List<Integer> findKLargestElement(List<Integer> a, int k) {\n PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(k);\n int i = 0;\n while (i <= k) {\n minHeap.add(a.get(i)); // O(k)\n i++;\n }\n\n // Not insert rest of the n-k elements .. slowly..\n // We are trying to store all k greatest numbers in heap..\n // with min heap telling us which is the smallest among the k largest.\n for (i = k; i < a.size(); i++) {\n if (a.get(i) > minHeap.peek()) {\n minHeap.remove();\n minHeap.add(a.get(i));\n }\n }\n return Arrays.asList(minHeap.toArray(new Integer[k]));\n }", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "public List<Integer> findClosestElements2(int[] arr, int k, int x) {\r\n List<Integer> res = new LinkedList<>();\r\n int i=0, j=arr.length-k;\r\n while (i<j){\r\n int m = i + (j-i)/2;\r\n if (x-arr[m]>arr[m+k]-x){\r\n i=m+1;\r\n }\r\n else j=m;\r\n }\r\n // System.out.println(i);\r\n while (k>0){\r\n res.add(arr[i++]);\r\n k--;\r\n }\r\n return res;\r\n }", "protected HashMap<String,Double> rank(ArrayList<String> queryPostingLines, ArrayList<String> query){\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = computeTFForQueryWords(queryPostingLines);\n ArrayList<String> retrievedDocuments = new ArrayList<>(queryWordsTFPerDoc.keySet());\n HashMap<String,Double> rankedDocs = new HashMap<>();\n\n for(String doc : retrievedDocuments){\n HashMap<String,Integer> docTFs = queryWordsTFPerDoc.get(doc);\n double rank = 0.3*rankByBM25(query,doc,docTFs) + 0.7*rankByPosition(query,doc,queryPostingLines);// - rankByCosSim(query,doc,docTFs);\n rankedDocs.put(doc,rank);\n }\n rankedDocs = sortByValue(rankedDocs);\n ArrayList<String> docsAfterSort = new ArrayList<>(rankedDocs.keySet());\n HashMap<String,Double> docsToRetrieve = new HashMap<>();\n int i=0;\n for(String doc: docsAfterSort){\n docsToRetrieve.put(documentDetails.get(doc)[0],rankedDocs.get(doc));\n i++;\n if(i == 50)\n break;\n }\n return docsToRetrieve;\n }", "public double getDistance(ArrayList<Integer> e, ArrayList<Integer> f) {\n double distance =0;\n if(e.size()>2 || f.size()>2){\n \n ArrayList<Double> aux = new ArrayList<>();\n aux.add (Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(2), 2) + Math.pow(e.get(1) - f.get(3), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(4), 2) + Math.pow(e.get(1) - f.get(5), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(6), 2) + Math.pow(e.get(1) - f.get(7), 2)));\n Collections.sort(aux);\n distance = aux.get(0);\n \n }\n else{\n\n distance = Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2));\n //distancia entre dois pontos\n }\n return distance;\n\n }", "private Map<Geometry, Point3D> getClosestPoint(Map<Geometry, List<Point3D>> intersectionPoints) {\n\n double distance = Double.MAX_VALUE;\n Map<Geometry, Point3D> closestPoint = new HashMap<Geometry, Point3D>();\n Point3D P0 = _scene.getCamera().getP0();\n Map.Entry<Geometry, List<Point3D>> entry;\n Iterator<Entry<Geometry, List<Point3D>>> it = intersectionPoints.entrySet().iterator();\n while (it.hasNext())\n {\n entry = it.next();\n for (Point3D point: intersectionPoints.get(entry.getKey())) {\n if (P0.distance(point) < distance) {\n closestPoint = new HashMap<Geometry, Point3D>();\n closestPoint.put(entry.getKey(), point);\n distance = P0.distance(point);\n }\n }\n }\n return closestPoint;\n }", "public double computeDistance(cluster c1, cluster c2) {\n\t\tdouble closest = 4000;\n\t\tfor (point p1 : c1.getPoints()) {\n\t\t\tfor (point p2 : c2.getPoints()) {\n\t\t\t\tdouble dist = Math.sqrt(Math.pow( (p1.x() - p2.x()) , 2) + Math.pow( (p1.y() - p2.y()) , 2));\n\t\t\t\tif (dist < closest) {\n\t\t\t\t\tclosest = dist;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn closest;\n\t}", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private int findMaxPt(ArrayList<Point> s, Point p1, Point p2) {\n double maxPt = 0;\n int maxIndex = 0;\n for(int i = 1; i < s.size()-2; i++){\n if(p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y > maxPt) {\n maxPt = p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y;\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "private static double nearestNeighbour(List<Point> points, Point startPoint, Point endPoint) {\n double tentative_distance; // to evaluate nearest neighbour\n double cummulative_distance = 0; // cummulative distance of tour\n double dist; // temporary variable\n Point current = startPoint;\n //System.out.println(\"start at: #\" + current.getId());\n\n int indexToRemove = 0;\n int numberOfLoops = points.size() - 1;\n\n for (int i = 0; i <= numberOfLoops; i++) {\n //System.out.println(\"outerloop #\" + i);\n tentative_distance = Double.MAX_VALUE;\n // evaluate nearest neighbour\n for (int j = 0; j < points.size(); j++) {\n dist = getDistance(points.get(j), current);\n if (dist < tentative_distance) {\n tentative_distance = dist;\n indexToRemove = j;\n }\n }\n //System.out.println(\"next point: #\" + points.get(indexToRemove).getId());\n cummulative_distance += getDistance(points.get(indexToRemove), current);\n current = points.remove(indexToRemove);\n }\n // add distance to endpoint\n cummulative_distance += getDistance(current, endPoint);\n return cummulative_distance;\n }", "public static List<List<Integer>> gen_size_k_candidate(Map<List<Integer>, Float> oldCandidate, Integer k){\n\n List<List<Integer>> sizeKPlusCandidate = new ArrayList<>();\n\n // size 2 candidate\n if( k <= 1){\n List<Integer> size1Candidate = new ArrayList<>();\n for (List<Integer> size1: oldCandidate.keySet()){\n size1Candidate.addAll(size1);\n }\n // sort\n Collections.sort(size1Candidate);\n // Generate\n sizeKPlusCandidate = CombinationGenerator.findsort(size1Candidate, 2);\n\n }else {\n List<List<Integer>> oldList = new ArrayList<>();\n oldList.addAll(oldCandidate.keySet());\n\n for(int iOld = 0; iOld < oldList.size()-1; iOld ++){\n for(int jOld =iOld+1; jOld < oldList.size(); jOld++){\n // check k element of feature is the same\n List<Integer> formerList = new ArrayList<>();\n List<Integer> laterList = new ArrayList<>();\n\n for (int fl=0; fl < k-1; fl++){\n formerList.add(oldList.get(iOld).get(fl));\n laterList.add(oldList.get(jOld).get(fl));\n }\n\n if (formerList.equals(laterList)){\n\n HashSet<Integer> tempCandidate = new HashSet<>();\n\n tempCandidate.addAll(oldList.get(iOld));\n tempCandidate.addAll(oldList.get(jOld));\n\n List<Integer> tempCandidateList = new ArrayList<>();\n tempCandidateList.addAll(tempCandidate);\n\n Collections.sort(tempCandidateList);\n // Prunning\n List<List<Integer>> prunningCandidate = CombinationGenerator.findsort(tempCandidateList, k);\n\n int flag = 0;\n for(List<Integer> checkPrun: prunningCandidate){\n if(oldCandidate.containsKey(checkPrun)){\n flag++;\n }\n }\n if (flag == k+1){\n sizeKPlusCandidate.add(tempCandidateList);\n }\n }\n }\n }\n }\n return sizeKPlusCandidate;\n }", "long closest(double lon, double lat) {\n double closet = Double.MAX_VALUE;\n long vertex = 0;\n\n for (Long v : vertices()) {\n double nodeLon = getNode(v).Lon;\n double nodeLat = getNode(v).Lat;\n double lonDist = nodeLon - lon;\n double latDist = nodeLat - lat;\n double dist = Math.sqrt(lonDist * lonDist + latDist * latDist);\n if (dist < closet) {\n vertex = v;\n closet = dist;\n }\n }\n return vertex;\n }" ]
[ "0.67349136", "0.62982386", "0.60915554", "0.59800166", "0.59764534", "0.59049416", "0.58010024", "0.5796883", "0.57766145", "0.5746946", "0.57447034", "0.5742896", "0.5740122", "0.5672972", "0.5665017", "0.55727285", "0.55330384", "0.55278486", "0.5498111", "0.5463482", "0.54389435", "0.54245096", "0.5396959", "0.53801316", "0.53656113", "0.53603935", "0.534671", "0.5339715", "0.5318842", "0.5302339", "0.527785", "0.526091", "0.52591294", "0.5253015", "0.5251874", "0.52064675", "0.52042305", "0.5197495", "0.5189226", "0.5186331", "0.5157218", "0.5151994", "0.5148788", "0.5138877", "0.51266015", "0.51187056", "0.51107115", "0.5109379", "0.50925875", "0.5079557", "0.5068565", "0.50657845", "0.506373", "0.50325453", "0.50313735", "0.50190485", "0.49997476", "0.4994102", "0.49853048", "0.498235", "0.49738207", "0.4952399", "0.49423742", "0.49314007", "0.4923001", "0.49201226", "0.49150157", "0.49148622", "0.490318", "0.48969617", "0.48568666", "0.48544896", "0.4847778", "0.48410967", "0.48404685", "0.48364267", "0.48271134", "0.4823295", "0.48124537", "0.4809592", "0.4798592", "0.47946405", "0.47914913", "0.47693986", "0.47684154", "0.47618476", "0.4749734", "0.4748537", "0.47461244", "0.4742027", "0.47386584", "0.47383606", "0.47326034", "0.47171125", "0.47123128", "0.47084597", "0.4704438", "0.47038117", "0.46999502", "0.46999446" ]
0.77025133
0
Flag whether to active user or not
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CreateNewUserDetails other = (CreateNewUserDetails) obj; if (bActiveFlag != other.bActiveFlag) return false; if (sAuthMethod == null) { if (other.sAuthMethod != null) return false; } else if (!sAuthMethod.equals(other.sAuthMethod)) return false; if (sEmail == null) { if (other.sEmail != null) return false; } else if (!sEmail.equals(other.sEmail)) return false; if (sFirstName == null) { if (other.sFirstName != null) return false; } else if (!sFirstName.equals(other.sFirstName)) return false; if (sLastName == null) { if (other.sLastName != null) return false; } else if (!sLastName.equals(other.sLastName)) return false; if (sLocale == null) { if (other.sLocale != null) return false; } else if (!sLocale.equals(other.sLocale)) return false; if (sLogin == null) { if (other.sLogin != null) return false; } else if (!sLogin.equals(other.sLogin)) return false; if (sPassword == null) { if (other.sPassword != null) return false; } else if (!sPassword.equals(other.sPassword)) return false; if (sRole == null) { if (other.sRole != null) return false; } else if (!sRole.equals(other.sRole)) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isEnabled() {\n return user.hasBeenActivated;\n }", "Boolean accountIsActivated(Integer userId);", "public void flagUser() {\n\t\tsuper.flagUser();\n\t}", "@Override\n public boolean isUserActive(String userName) {\n User user = getUserInfo(userName);\n if (user != null) {\n return user.isActive();\n }\n return false;\n }", "public boolean isUserActive(String userId) {\n\t\treturn false;\n\t}", "public boolean isActiveUser() {\r\n if (currentProcessInstance == null)\r\n return false;\r\n \r\n String[] states = currentProcessInstance.getActiveStates();\r\n if (states == null)\r\n return false;\r\n \r\n Actor[] users;\r\n for (int i = 0; i < states.length; i++) {\r\n try {\r\n users = currentProcessInstance.getWorkingUsers(states[i]);\r\n for (int j = 0; j < users.length; j++) {\r\n if (getUserId().equals(users[j].getUser().getUserId()))\r\n return true;\r\n }\r\n } catch (WorkflowException ignored) {\r\n // ignore unknown state\r\n continue;\r\n }\r\n }\r\n \r\n return false;\r\n }", "@Action(value = \"user_active\", results = {@Result(name = \"active\", location = \"/WEB-INF/jsp/msg.jsp\")})\n public String active() {\n\n User exsitUser = userService.active(user.getCode());\n\n if (exsitUser == null) {\n\n this.addActionMessage(\"激活失败,验证码无效!\");\n\n } else {\n\n exsitUser.setState(1);\n exsitUser.setCode(null);\n userService.updateState(exsitUser);\n this.addActionMessage(\"激活成功,请登录!\");\n }\n\n return \"active\";\n }", "void updateUserActivateStatus(User user, int newStatus);", "boolean isActive();", "boolean isActive();", "boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive() { return true; }", "@Override\n\tpublic Boolean isActve() {\n\t\treturn active;\n\t}", "public void setIsActive(boolean value) {\r\n this.isActive = value;\r\n }", "public void setActiveflag(Boolean activeflag) {\n this.activeflag = activeflag;\n }", "public boolean isCurrentUserCanChangeAccountStatus() {\r\n return currentUserCanChangeAccountStatus;\r\n }", "public Boolean isActive();", "public boolean getActive();", "public boolean getActive();", "@XmlTransient\n\tpublic boolean isCanActivateUser() {\n\t\treturn (isSecurityAdministrator() && isSelfRegistrationEnabled());\n\t}", "public void setActive(boolean value) {\n this.active = value;\n }", "public boolean activate(){\n mIsActive = true;\n return mIsActive;\n }", "public Boolean getActiveflag() {\n return activeflag;\n }", "public void setUserLogStatus(boolean bValue){\n /*SharedPreferences sharedPreferences = _context.getSharedPreferences(APP_PREFERENCES, PRIVATE_MODE);\n SharedPreferences.Editor editor;\n editor = sharedPreferences.edit();*/\n editor.putBoolean(IS_LOGGED_IN, bValue);\n editor.apply();\n }", "private boolean isUserActivated(DUsers user) {\n return isUserWithMoreHits(user, 30);\n }", "public void active(boolean value) {\n\t\tactive = value;\n\t}", "public boolean isActive() {\n\t\treturn (active_status);\n\t}", "public void setActiveFlag(Boolean activeFlag) {\n\t\tthis.activeFlag = activeFlag;\n\t}", "public void setActiveStatus(Boolean active){ this.status = active; }", "public static boolean hasActiveUserId(Context context) {\r\n\t\tboolean result = false;\r\n\t\tSharedPreferences prefs = PreferenceManager\r\n\t\t\t\t.getDefaultSharedPreferences(context);\r\n\t\tif (prefs != null) {\r\n\t\t\tString activeUserId = prefs.getString(PreferenceKeys.ActiveUserId,\r\n\t\t\t\t\t\"\");\r\n\t\t\treturn !TextUtils.isEmpty(activeUserId);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public boolean isActive(){\n return active;\n }", "public boolean isActive(){\n return active;\n }", "public Boolean isActive(){return status;}", "boolean activateAccount(Integer userId);", "public boolean active(){\r\n\t\treturn active;\r\n\t}", "public boolean isIsActive() {\r\n return isActive;\r\n }", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public static boolean isActive(){\n return active;\n }", "boolean hasActive();", "int isActive();", "public boolean isActive(){\n\t\treturn active;\n\t}", "public boolean isIsActive() {\n return isActive;\n }", "public boolean isActive()\r\n\t{\r\n\t\treturn active;\r\n\t}", "public boolean isActive(){\r\n\t\treturn active_;\r\n\t}", "public Boolean getIsActive() {\r\n return isActive;\r\n }", "@Override\n public boolean isUserActiveByEmail(String email) {\n User user = getUserByEmail(email);\n if (user != null) {\n return user.isActive();\n }\n return false;\n }", "private boolean isLoggedInUser(){\n return true;\n }", "public boolean isActiv(){\r\n\t\treturn this.activ;\r\n\t}", "public boolean getIsActive() {\n return isActive_;\n }", "public boolean isActive()\n {\n return active;\n }", "private void updateUserStatus(boolean online)\n {\n }", "private void verifyActiveUser(){\r\n\t\tif(request.getUserPrincipal() == null)\r\n\t\t{\t\t\r\n\t\t\trequest.getSession().removeAttribute(\"isActive\");\r\n\t\t\trequest.getSession().invalidate();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tresponse.sendRedirect(\"login.jsp\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "boolean hasSelectedUser();", "public void setActive() {\n\t\tactive = true;\n\t}", "public boolean isInactive();", "public Boolean getIsActive() {\n return isActive;\n }", "public Boolean getIsActive() {\n return isActive;\n }", "public boolean isActive() \n {\n return this.active;\n }", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();" ]
[ "0.7382355", "0.7334837", "0.73155105", "0.72298086", "0.7187884", "0.7120514", "0.71018755", "0.6925013", "0.68369687", "0.68369687", "0.68369687", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.67865187", "0.6784005", "0.67778033", "0.6776759", "0.6762112", "0.67351574", "0.67343205", "0.6714055", "0.6714055", "0.67127895", "0.67021614", "0.67021227", "0.66714144", "0.6666099", "0.6646182", "0.66357577", "0.66262364", "0.6613918", "0.6583895", "0.65812", "0.6575912", "0.6575912", "0.6571052", "0.6557264", "0.6541477", "0.6531254", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.65288645", "0.651913", "0.65185535", "0.6513922", "0.6507193", "0.64962137", "0.6495479", "0.6494126", "0.6484481", "0.6478189", "0.6463182", "0.6459235", "0.64480674", "0.64398617", "0.6439195", "0.642477", "0.642367", "0.6414809", "0.64052594", "0.6404764", "0.6404764", "0.6398588", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906", "0.63944906" ]
0.0
-1
Constructor that required fields to create new user
public CreateNewUserDetails(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail) { // No language assume English user set(sLogin, sFirstName, sLastName, sPassword, sEmail, "", "", "", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User() {\r\n this(\"\", \"\");\r\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public User() {\r\n \r\n }", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User(int user_id, String full_name, String address, String postal_code, int mobile_no,\n String snow_zone, String garbage_day, String password){\n this.user_id = user_id;\n this.full_name = full_name;\n this.address = address;\n this.postal_code = postal_code;\n this.mobile_no = mobile_no;\n this.snow_zone = snow_zone;\n this.garbage_day = garbage_day;\n this.password = password;\n\n }", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User(){\n this(null, null);\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "User()\n\t{\n\n\t}", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "public User() {\r\n\r\n\t}", "public User() {\n }", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\r\n\t}", "public User() {\r\n }", "public User() {\n\n\t}", "public User() {}", "public User() {}", "public User() {}", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User(){}", "public User(){}", "public User(){}", "public User() {\n\t}", "public User()\n\t{\n\t}", "public User() {\n log.debug(\"Create a User object\");\n }", "public User(int aId, String aFirstName, String aLastName){\r\n this.id = aId;\r\n this.firstName = aFirstName;\r\n this.lastName = aLastName;\r\n }", "public User() { }", "public TUser() {\n this(\"t_user\", null);\n }", "public User(String firstName, String lastName, String userName, String email, String password) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "protected User() {}", "protected User() {}", "public DbUser() {\r\n\t}", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public User(int id, String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n }", "public User(String username, String nPassword)\n {\n userName = username;\n password = nPassword;\n }", "public User(String username, String password) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty()) {\r\n\t throw new IllegalArgumentException(\"User : username or password passed can not be null.\"); \r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = UserType.USER;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public Users(String username, String password, String email, String phone)\r\n/* 53: */ {\r\n/* 54:67 */ this.username = username;\r\n/* 55:68 */ this.password = password;\r\n/* 56:69 */ this.email = email;\r\n/* 57:70 */ this.phone = phone;\r\n/* 58: */ }", "public User(String n, int a) { // constructor\r\n name = n;\r\n age = a;\r\n }", "public User(long id, String username, String email, String password) {\n this.id = id;\n this.username = username;\n this.email = email;\n this.password = password;\n}", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User(int id,String firstName, String lastName, int age, String gender, String emailId,String password,long phoneNumber,int roleId) {\n\tsuper(); \n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.gender = gender;\n\tthis.emailId=emailId;\n\tthis.password=password;\n\tthis.phoneNumber = phoneNumber;\n\tthis.roleId=roleId;\n}", "public User(String n) { // constructor\r\n name = n;\r\n }", "User(String userID, String password, String firstName, String lastName) {\n this.userID = userID;\n this.password = password;\n this.firstName = firstName;\n this.lastName = lastName;\n }", "public User(long id, String fistname, String secondname, String username, String password, String mail){\n this.id = id;\n this.firstname = fistname;\n this.secondname = secondname;\n this.username = username;\n this.password = password;\n this.email = mail;\n }", "public User(){\n }", "public User() {\n this.firstName = \"Lorenzo\";\n this.lastName = \"Malferrari\";\n this.username = \"malfe.lore@gmail.com\";\n this.email = \"malfe.lore@gmail.com\";\n this.password = \"123456\";\n this.city = \"Bologna\";\n this.country = \"Italia\";\n this.gender = \"Maschio\";\n this.birthdate = new Date();\n this.age = 21;\n this.imgUser = 1;\n this.last_access = new Date();\n this.registration_date = new Date();\n }", "public User() {\n\n }", "public User(){\n\n }", "public User(){\r\n this.id = 0;\r\n this.firstName = null;\r\n this.lastName = null;\r\n }", "public User(int id, String firstName, String lastName, String userName, String email, String password) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n }", "public User(String username,\n String firstname,\n String lastname) {\n //create userId\n int newID = numOfObjects + 1;\n String userId = username + \"_\" + newID;\n\n this.userId = userId;\n this.username = username;\n this.firstname = firstname;\n this.lastname = lastname;\n this.calendarsOwned = new ArrayList<Calendar_>();\n this.eventsOwned = new ArrayList<Event>();\n\n //update object counter\n numOfObjects++;\n }", "public User(String firstName, String lastName, Long userid, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userid = userid;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "public User() {\n name = \"\";\n }", "protected User() {\n }", "public User() {\n\t\tsuper(\"User\", models.DefaultSchema.DEFAULT_SCHEMA);\n\t}", "public User(\n int user_id,\n String phone_number,\n String email_address,\n String first_name,\n String last_name,\n String middle_initial,\n String job_title,\n String freelancer_address,\n String twitter_address,\n String facebook_address,\n String linkedin_address,\n String resume_import_path,\n String user_image_path) {\n this.var_user_id = user_id;\n this.var_email_address = email_address;\n this.var_first_name = first_name;\n this.var_last_name = last_name;\n this.var_middle_initial = middle_initial;\n this.var_job_title = job_title;\n this.var_phone_number = phone_number;\n this.var_freelancer_address = freelancer_address;\n this.var_twitter_address = twitter_address;\n this.var_facebook_address = facebook_address;\n this.var_linkedin_address = linkedin_address;\n this.var_resume_import_path = resume_import_path;\n this.var_user_image_path = user_image_path;\n }", "public User() {\n this.username = \"test\";\n }", "public User(String username, String password, UserType type) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty() || type == null) {\r\n\t throw new IllegalArgumentException(\"User : username or password or user type passed can not be null.\");\r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = type;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public NewMember(String username, String password, String email) {\n this.username = username;\n this.password = password;\n this.email = email;\n this.has_role = \"User\";\n this.signingDate = new Date(System.currentTimeMillis());\n }", "public User(String userName, String role, String fName, String lName, \r\n\t\t\tString emailAddr, String streetAddr, String city, String state, \r\n\t\t\tint zip, String country)\r\n\t{\r\n\t\t\r\n\t\tthis.userName = userName;\r\n\t\tthis.role = role;\r\n\t\tthis.firstName = fName;\r\n\t\tthis.lastName = lName;\r\n\t\tthis.emailAddress = emailAddr;\r\n\t\tthis.streetAddress = streetAddr;\r\n\t\tthis.city = city;\r\n\t\tthis.state = state;\r\n\t\tthis.zip = zip;\r\n\t\tthis.country = country;\r\n\t\t\r\n\t}", "private User() {}", "@Test\n public void userCustomConstructor_isCorrect() throws Exception {\n\n int id = 123456;\n int pin_hash = 98745;\n int pin = 9876;\n String salt = \"test salt\";\n String username = \"testUsername\";\n int firstTime = 0;\n String budget = \"test\";\n int hasPin = 1;\n\n //Create empty user\n User user = new User(id, username, pin_hash, pin, salt, firstTime, budget, hasPin);\n\n // Verify Values\n assertEquals(id, user.getId());\n assertEquals(pin_hash, user.getPin_hash());\n assertEquals(pin, user.getPin());\n assertEquals(salt, user.getSalt());\n assertEquals(username, user.getUsername());\n assertEquals(firstTime, user.getFirstTime());\n assertEquals(budget, user.getBudget());\n assertEquals(hasPin, user.getHasPin());\n }", "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 User(String firstName, String lastName, String username, String email, String password, String city, String country, String gender,Date birthdate, int age, int imgUser, Date last_access, Date registration_date) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.username = username;\n this.email = email;\n this.password = password;\n this.city = city;\n this.country = country;\n this.gender = gender;\n this.birthdate = birthdate;\n this.age = age;\n this.imgUser = imgUser;\n this.last_access = last_access;\n this.registration_date = registration_date;\n }", "public User(TUser tUser) {\n if (tUser.isSetUsername()) {\n username = tUser.getUsername();\n }\n\n if (tUser.isSetPassword()) {\n password = tUser.getPassword();\n }\n\n if (tUser.isSetEnabled()) {\n enabled = tUser.isEnabled();\n }\n\n if (tUser.isSetRoles()) {\n roles = tUser.getRoles().stream().map(tUserRole ->\n new UserRole(tUserRole, this)).collect(Collectors.toSet());\n }\n\n if (tUser.isSetRobots()) {\n robots = tUser.getRobots().stream().map(tRobot -> new Robot(tRobot, this)).collect(Collectors.toSet());\n }\n }", "public User() throws InvalidUserDataException {\n this(DEFAULT_ID, DEFAULT_PASSWORD, DEFAULT_FIRST_NAME, \n DEFAULT_LAST_NAME, DEFAULT_EMAIL_ADDRESS, new Date(), \n new Date(), DEFAULT_TYPE, DEFAULT_ENABLED_STATUS);\n }", "public User(int userid, String firstname, String lastname, String email, String password) {\n\t\tsuper();\n\t\tthis.userid = userid;\n\t\tthis.firstname = firstname;\n\t\tthis.lastname = lastname;\n\t\tthis.email = email;\n\t\tthis.password = password;\n\t}", "public void createUser(User user);", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "public User() {\n /**\n * default Cto'r\n */\n }", "private User() {\n }", "protected User(String username,String password,AccessLevel accessLevel){\n this.username = username;\n this.password = encryptPassword(password);\n this.accessLevel = accessLevel;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n checkRep();\n }", "public UserMember() {\r\n //this.email = \"user@user.com\";\r\n this.email = \"\";\r\n this.firstName = \"\";\r\n this.lastName = \"\";\r\n this.username = \"\";\r\n this.password = \"\";\r\n this.memberId = 0;\r\n }", "public User(String nom, String prenom, String email, String pwd) {\r\n\t\tsuper();\r\n\t\tthis.nom = nom;\r\n\t\tthis.prenom = prenom;\r\n\t\tthis.email = email;\r\n\t\tthis.pwd = pwd;\r\n\t}", "User createUser();", "public User() {\n\tsuper();\n}", "public User(String username, String password, String firstName, String lastName, Short userType) {\r\n this.username = username;\r\n this.password = password;\r\n this.firstName = firstName;\r\n this.lastName = lastName;\r\n this.userType = userType;\r\n }" ]
[ "0.7900854", "0.78050166", "0.7804511", "0.77586067", "0.76910007", "0.767192", "0.76683694", "0.76519346", "0.76519346", "0.76519346", "0.7639391", "0.7636709", "0.76342374", "0.7631833", "0.7587713", "0.7584514", "0.7535684", "0.7531569", "0.7524991", "0.7524991", "0.75034755", "0.74978983", "0.7496576", "0.74903965", "0.74903965", "0.74903965", "0.7480238", "0.7471145", "0.7471145", "0.7471145", "0.7460834", "0.745811", "0.74556214", "0.74413365", "0.7422056", "0.7411215", "0.74078447", "0.7407821", "0.74067366", "0.74067366", "0.74060655", "0.7403227", "0.73991436", "0.7396024", "0.73921067", "0.73900944", "0.7383473", "0.73801625", "0.73766464", "0.7359008", "0.73558825", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7355717", "0.7351461", "0.7348334", "0.732778", "0.7326369", "0.7316297", "0.73148143", "0.7308181", "0.7291261", "0.7272382", "0.726333", "0.725986", "0.7257526", "0.7257497", "0.7255382", "0.7251328", "0.7247908", "0.72230935", "0.7220569", "0.7216529", "0.72110415", "0.720998", "0.72095597", "0.72090244", "0.7189979", "0.7187451", "0.71845406", "0.71801066", "0.7176131", "0.71706754", "0.71669096", "0.71581614", "0.7142499", "0.7137843", "0.71340877", "0.7128156", "0.7125783", "0.7119975" ]
0.0
-1
Constructor that required fields to create new user by defining Role
public CreateNewUserDetails(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail, String sRole) { // No language assume English user set(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, "", "", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User(String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public UserRole() {\n // all persisted classes must define a no-arg constructor with at least package visibility\n }", "public Role() {\n }", "public Role() {\n }", "public Role() {\n\t}", "public Role() {\n\t super();\n }", "public User(int id, String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.id = id;\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public User(String name, String surname, String mail, String phone, Role role) {\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.role = role;\n }", "public User(String username, String password, String firstName, String lastName, String mail, Role role) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t}", "public User(int id,String firstName, String lastName, int age, String gender, String emailId,String password,long phoneNumber,int roleId) {\n\tsuper(); \n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.gender = gender;\n\tthis.emailId=emailId;\n\tthis.password=password;\n\tthis.phoneNumber = phoneNumber;\n\tthis.roleId=roleId;\n}", "public User(String username, String password, String firstName, String lastName, String mail, Role role,\r\n\t\t\tint collegeNum, String department, int organization) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t\tthis.collegeNum = collegeNum;\r\n\t\tthis.department = department;\r\n\t\tthis.organization = organization;\r\n\t}", "public User(String userName, String role, String fName, String lName, \r\n\t\t\tString emailAddr, String streetAddr, String city, String state, \r\n\t\t\tint zip, String country)\r\n\t{\r\n\t\t\r\n\t\tthis.userName = userName;\r\n\t\tthis.role = role;\r\n\t\tthis.firstName = fName;\r\n\t\tthis.lastName = lName;\r\n\t\tthis.emailAddress = emailAddr;\r\n\t\tthis.streetAddress = streetAddr;\r\n\t\tthis.city = city;\r\n\t\tthis.state = state;\r\n\t\tthis.zip = zip;\r\n\t\tthis.country = country;\r\n\t\t\r\n\t}", "public RoleImpl() {}", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, \"\", true);\r\n\t}", "public User(int id, String name, String surname, String mail, String phone, String avatar, Role role) {\n this.id = id;\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.avatar = avatar;\n this.role = role;\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, true);\r\n\t}", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "@Override\n\tpublic UserRole createNew()\n\t{\n\t\treturn new UserRole();\n\t}", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public RoleEntity(){}", "public RoleRequest(String _projectName, String _userName, String _roleName) {\n this.projectName = _projectName;\n this.userName = _userName;\n this.roleName = _roleName; \n }", "public User(int id, String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public NewMember(String username, String password, String email) {\n this.username = username;\n this.password = password;\n this.email = email;\n this.has_role = \"User\";\n this.signingDate = new Date(System.currentTimeMillis());\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "public User(String userType, String userName, String firstName, String lastName, String password, String address, String city, int userRating, LocalDate joinDate) {\n super();\n this.userType = userType;\n this.userName = userName;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password = password;\n this.address = address;\n this.city = city;\n this.userRating = userRating;\n this.joinDate = joinDate;\n }", "private UserRole(String name) {\n\t\tthis.name = name;\n\t}", "public User(Long id, Long userId, String userName, String userFirstName, String userLastName,\n\t\t\tRole role) {\n\t\tthis.id = id;\n\t\t\n\t\tcom.institucion.fm.security.model.User user = new com.institucion.fm.security.model.User(\n\t\t\t\tuserId, userFirstName, userLastName);\n\t\tuser.setName(userName);\n\t\tthis.setUser(user);\n\t\t\n\t\tthis.role = role;\n\t}", "public User() {\r\n \r\n }", "public UserModel(int ID, String firstName, String lastName, String password, String username, int role, int status) {\n this.ID = ID;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password=password;\n this.username = username;\n this.role = role;\n this.status = status;\n }", "public BeanRole() {\r\n }", "public ConcreteUser(Long id, String username, String password,String passwordConfirm,Set<Role> roles) {\r\n this.id = id;\r\n this.username = username;\r\n this.password = password;\r\n this.passwordConfirm = passwordConfirm;\r\n this.roles = roles;\r\n }", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public UserRoleExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public CreateUserCommand() {\n userReceiver = new UserReceiver();\n roleReceiver = new RoleReceiver();\n next = new GetRolesCommand();\n result = new CommandResult();\n }", "public UserPass(String username, String password, String role) {\n\t\tsuper();\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.role = role;\n\t}", "public User() {\n roles = new HashSet<>();\n favorites = new HashSet<>();\n estimates = new HashSet<>();\n }", "User()\n\t{\n\n\t}", "public void createSupplier(User user){\n BCryptPasswordEncoder encoder= new BCryptPasswordEncoder();\n user.setPassword(encoder.encode(user.getPassword()));\n //creating roles\n Role userRole = new Role(\"SUPPLIER\");//we create a role type client\n //a user can then take a list of roles\n List<Role> roles = new ArrayList<>();//list of roles\n roles.add(userRole);//add client role type to the list\n user.setRoles(roles);//set a user to a role type\n userRepository.save(user);//save( save is a crudrepository method) the user to the database.\n }", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "protected User() {}", "protected User() {}", "public User() {\n }", "public User() {\r\n\r\n\t}", "public User(String name, String password) {\n this.userName = name;\n this.password = password;\n this.roles = new ArrayList<>();\n this.id = new ObjectId();\n }", "public User() {\n super();\n }", "public User() {\n super();\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod, boolean bActiveFlag)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, bActiveFlag);\r\n\t}", "public User() {\r\n }", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public User() {}", "public User() {}", "public User() {}", "public User() {\r\n\t}", "public User(TUser tUser) {\n if (tUser.isSetUsername()) {\n username = tUser.getUsername();\n }\n\n if (tUser.isSetPassword()) {\n password = tUser.getPassword();\n }\n\n if (tUser.isSetEnabled()) {\n enabled = tUser.isEnabled();\n }\n\n if (tUser.isSetRoles()) {\n roles = tUser.getRoles().stream().map(tUserRole ->\n new UserRole(tUserRole, this)).collect(Collectors.toSet());\n }\n\n if (tUser.isSetRobots()) {\n robots = tUser.getRobots().stream().map(tRobot -> new Robot(tRobot, this)).collect(Collectors.toSet());\n }\n }", "@Test(expected = IllegalUserRoleException.class)\r\n public void testCtorIllegalRoleNull() throws IllegalUserNameLengthException,\r\n IllegalUserUsernameLengthException, IllegalUserNameException, IllegalUserRoleException,\r\n IllegalUserUsernameException {\r\n new User(\"username\", null, \"name\");\r\n }", "public User() {\n\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 User(){\n this(null, null);\n }", "public User(){}", "public User(){}", "public User(){}", "public User()\n\t{\n\t}", "public User() {\r\n this(\"\", \"\");\r\n }", "public User() {\n\t}", "public DbUser() {\r\n\t}", "public User() {\n log.debug(\"Create a User object\");\n }", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "protected User(String username,String password,AccessLevel accessLevel){\n this.username = username;\n this.password = encryptPassword(password);\n this.accessLevel = accessLevel;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n checkRep();\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "private UserRole(String name, String displayName, Affiliate affiliate, UserRolePrivileges priv) {\n if (name == null) throw new NullPointerException(\"UserRole must have a non-null name\");\n _name = name;\n _displayName = displayName;\n _spProgramAffiliate = affiliate;\n _rolePrivileges = priv;\n }", "public void testConstructor() {\n assertNotNull(\"test role is null\", testRole);\n assertEquals(\"Wrong name\", ROLE_NAME, testRole.getName());\n assertEquals(\"Wrong description\", ROLE_DESCRIPTION,\n testRole.getDescription());\n }", "public User(String username, String password, boolean isTechAgent) {\n // The hashpw method hashes password with a random salt.\n String pw_hash = BCrypt.hashpw(password, BCrypt.gensalt());\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = pw_hash;\n this.isTechAgent = isTechAgent;\n }", "public Role(String name) {\r\n\t\tthis();\r\n\t\tthis.name = name;\r\n\t}", "public RoleAccess() {\n }", "public User() { }", "public SecurityUser() {\n\t\tsuper();\n\t}", "public Role() {\r\n\t\tpermissions = new ArrayList<Permission>();\r\n\t}", "public void createUserAccount(SignupRequest signUpRequest) {\n\t\tApplicationUser user = new ApplicationUser(signUpRequest.getUsername(), \r\n\t\t\t\t\t\t\t signUpRequest.getEmail(),\r\n\t\t\t\t\t\t\t encoder.encode(signUpRequest.getPassword()));\r\n\r\n\t\tSet<String> strRoles = signUpRequest.getRole();\r\n\t\tSet<Role> roles = new HashSet<>();\r\n\r\n\t\tif (strRoles == null || strRoles.isEmpty()) {\r\n\t\t\tRole userRole = roleRepository.findByName(ERole.ROLE_USER)\r\n\t\t\t\t\t.orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\r\n\t\t\troles.add(userRole);\r\n\t\t} else {\r\n\t\t\tstrRoles.forEach(role -> {\r\n\t\t\t\tswitch (role) {\r\n\t\t\t\tcase \"ROLE_ADMIN\":\r\n\t\t\t\t\tRole adminRole = roleRepository.findByName(ERole.ROLE_ADMIN)\r\n\t\t\t\t\t\t\t.orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\r\n\t\t\t\t\troles.add(adminRole);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"ROLE_POC\":\r\n\t\t\t\t\tRole modRole = roleRepository.findByName(ERole.ROLE_POC)\r\n\t\t\t\t\t\t\t.orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\r\n\t\t\t\t\troles.add(modRole);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tRole userRole = roleRepository.findByName(ERole.ROLE_USER)\r\n\t\t\t\t\t\t\t.orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\r\n\t\t\t\t\troles.add(userRole);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tuser.setRoles(roles);\r\n\t\tuserRepository.save(user);\r\n\t}", "private Role(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Employee(String firstName, String lastName, String role) {\n\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.role = role;\n\t}", "public void createUser(String username, String password, String role) {\r\n Optional<User> user = userRepo.findByName(username);\r\n if (!user.isPresent()) {\r\n User newUser = new User();\r\n newUser.setName(username);\r\n newUser.setPassword(password);\r\n newUser.setRole(role);\r\n userRepo.save(newUser);\r\n }\r\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }" ]
[ "0.7451144", "0.7446869", "0.74056786", "0.74056786", "0.7379259", "0.73368955", "0.72666436", "0.7248027", "0.7215163", "0.7158244", "0.71568215", "0.70327824", "0.6995433", "0.69432366", "0.6939764", "0.69070375", "0.68894017", "0.6889257", "0.687643", "0.6872576", "0.68420386", "0.68386203", "0.68227696", "0.6805434", "0.6787817", "0.67714024", "0.67656016", "0.6707303", "0.665403", "0.66157883", "0.6607446", "0.65868706", "0.6585045", "0.6562475", "0.6536555", "0.6536555", "0.6536555", "0.65321505", "0.6526572", "0.65081084", "0.6504498", "0.65043104", "0.6501314", "0.6493407", "0.6488187", "0.64852", "0.6472262", "0.6462646", "0.6458341", "0.6458341", "0.6457708", "0.6456594", "0.64533967", "0.64291805", "0.64291805", "0.64219075", "0.6420329", "0.64191794", "0.6418257", "0.6418257", "0.6418257", "0.64179105", "0.64172894", "0.64134747", "0.64080065", "0.6405591", "0.6396128", "0.6393709", "0.6393709", "0.6393709", "0.639019", "0.63882047", "0.638477", "0.63781023", "0.6375437", "0.63723135", "0.6370618", "0.63700634", "0.6368557", "0.6363105", "0.6362848", "0.63546854", "0.6354631", "0.6349751", "0.6341434", "0.634133", "0.6333821", "0.63108975", "0.63036394", "0.6301864", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871", "0.629871" ]
0.7163419
9
Constructor that required fields to create new user by defining Role, Locale
public CreateNewUserDetails(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail, String sRole, String sLocale) { // No language assume English user set(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, "", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, true);\r\n\t}", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, \"\", \"\", true);\r\n\t}", "public User(String userName, String role, String fName, String lName, \r\n\t\t\tString emailAddr, String streetAddr, String city, String state, \r\n\t\t\tint zip, String country)\r\n\t{\r\n\t\t\r\n\t\tthis.userName = userName;\r\n\t\tthis.role = role;\r\n\t\tthis.firstName = fName;\r\n\t\tthis.lastName = lName;\r\n\t\tthis.emailAddress = emailAddr;\r\n\t\tthis.streetAddress = streetAddr;\r\n\t\tthis.city = city;\r\n\t\tthis.state = state;\r\n\t\tthis.zip = zip;\r\n\t\tthis.country = country;\r\n\t\t\r\n\t}", "public User(String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public UserRole() {\n // all persisted classes must define a no-arg constructor with at least package visibility\n }", "public User(int id,String firstName, String lastName, int age, String gender, String emailId,String password,long phoneNumber,int roleId) {\n\tsuper(); \n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.gender = gender;\n\tthis.emailId=emailId;\n\tthis.password=password;\n\tthis.phoneNumber = phoneNumber;\n\tthis.roleId=roleId;\n}", "public User(String name, String surname, String mail, String phone, Role role) {\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.role = role;\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod, boolean bActiveFlag)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, bActiveFlag);\r\n\t}", "public User(int id, String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.id = id;\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User(String username, String password, String firstName, String lastName, String mail, Role role) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t}", "public LibrarianUser() {\n\t\tsuper();\n\t}", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, \"\", \"\", \"\", true);\r\n\t}", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public User(String username, String password, String firstName, String lastName, String mail, Role role,\r\n\t\t\tint collegeNum, String department, int organization) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t\tthis.collegeNum = collegeNum;\r\n\t\tthis.department = department;\r\n\t\tthis.organization = organization;\r\n\t}", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public NewMember(String username, String password, String email) {\n this.username = username;\n this.password = password;\n this.email = email;\n this.has_role = \"User\";\n this.signingDate = new Date(System.currentTimeMillis());\n }", "public User() {\r\n \r\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }", "User()\n\t{\n\n\t}", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public Role() {\n }", "public Role() {\n }", "public UserLangRecord() {\n super(UserLang.USER_LANG);\n }", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "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 User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public Role() {\n\t}", "public User() {\r\n\r\n\t}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public User() {\n log.debug(\"Create a User object\");\n }", "public User() {\r\n\t}", "public User() {\n }", "public User() {\r\n }", "public User(String userType, String userName, String firstName, String lastName, String password, String address, String city, int userRating, LocalDate joinDate) {\n super();\n this.userType = userType;\n this.userName = userName;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password = password;\n this.address = address;\n this.city = city;\n this.userRating = userRating;\n this.joinDate = joinDate;\n }", "protected User(String username,String password,AccessLevel accessLevel){\n this.username = username;\n this.password = encryptPassword(password);\n this.accessLevel = accessLevel;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n checkRep();\n }", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\n\t}", "public User(){\n this(null, null);\n }", "public User(String userName, String firstName, String lastName, String location, int admin, String league) {\n this.userName = userName;\n this.firstName = firstName;\n this.lastName = lastName;\n this.location = location;\n this.admin = admin;\n this.league = league;\n }", "public User(String username, String password, UserType type) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty() || type == null) {\r\n\t throw new IllegalArgumentException(\"User : username or password or user type passed can not be null.\");\r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = type;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public User(long id, String username, String email, String password) {\n this.id = id;\n this.username = username;\n this.email = email;\n this.password = password;\n}", "public User(int id, String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public User() {\n\t}", "public DbUser() {\r\n\t}", "public User()\n\t{\n\t}", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "public User() {}", "public User() {}", "public User() {}", "public Role() {\n\t super();\n }", "public User() { }", "public User() {\n /**\n * default Cto'r\n */\n }", "protected User() {}", "protected User() {}", "public User(String n) { // constructor\r\n name = n;\r\n }", "public UserModel(int ID, String firstName, String lastName, String password, String username, int role, int status) {\n this.ID = ID;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password=password;\n this.username = username;\n this.role = role;\n this.status = status;\n }", "public UserAccount() {\n\n\t}", "private User() {}", "public User(){}", "public User(){}", "public User(){}", "public Users(String username, String password, String email, String phone)\r\n/* 53: */ {\r\n/* 54:67 */ this.username = username;\r\n/* 55:68 */ this.password = password;\r\n/* 56:69 */ this.email = email;\r\n/* 57:70 */ this.phone = phone;\r\n/* 58: */ }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "private User() {\n }", "public User(String n, int a) { // constructor\r\n name = n;\r\n age = a;\r\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public User(int id, String name, String surname, String mail, String phone, String avatar, Role role) {\n this.id = id;\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.avatar = avatar;\n this.role = role;\n }", "public TUser() {\n this(\"t_user\", null);\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "public UserMember() {\r\n //this.email = \"user@user.com\";\r\n this.email = \"\";\r\n this.firstName = \"\";\r\n this.lastName = \"\";\r\n this.username = \"\";\r\n this.password = \"\";\r\n this.memberId = 0;\r\n }", "User createUser();", "public User(){\n }", "public Menu(IUserAccount user, ResourceBundle languageRB) {\n this.languageRB = languageRB;\n init(user);\n }", "public User() {\n\t\tsuper(\"User\", models.DefaultSchema.DEFAULT_SCHEMA);\n\t}", "public User() {\n\n }" ]
[ "0.7533577", "0.72881943", "0.70479393", "0.6977647", "0.68410134", "0.6838281", "0.6829469", "0.6827934", "0.67610073", "0.6742426", "0.67421716", "0.67261034", "0.67139316", "0.6705804", "0.6694558", "0.6679581", "0.663618", "0.6618461", "0.6592881", "0.6575524", "0.6561879", "0.65567464", "0.65178174", "0.6513165", "0.64852774", "0.6478896", "0.6478896", "0.6477816", "0.6470756", "0.6469412", "0.6462423", "0.645596", "0.645596", "0.645596", "0.6452197", "0.64479524", "0.6420274", "0.6417891", "0.6404903", "0.6404541", "0.63933235", "0.6391254", "0.6389213", "0.63852507", "0.63852507", "0.63810843", "0.6373643", "0.6372935", "0.63693", "0.63684696", "0.6366395", "0.63654053", "0.63362664", "0.63362247", "0.6329922", "0.6329238", "0.6329238", "0.6329238", "0.6323256", "0.6322085", "0.63161784", "0.6298223", "0.6298223", "0.6295969", "0.6293157", "0.62739253", "0.6266959", "0.62617815", "0.62617815", "0.62617815", "0.62600505", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62589186", "0.62565464", "0.6249185", "0.6246183", "0.6246183", "0.6246183", "0.6246183", "0.62443674", "0.6243725", "0.62376386", "0.6233553", "0.62314737", "0.62307215", "0.62292784", "0.6225677", "0.6205632", "0.6197893" ]
0.7871788
0
Constructor that required fields to create new user by defining Role, Locale, Authentication Method
public CreateNewUserDetails(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod) { // No language assume English user set(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, \"\", true);\r\n\t}", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, \"\", \"\", true);\r\n\t}", "public User(String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod, boolean bActiveFlag)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, bActiveFlag);\r\n\t}", "public User(String userName, String role, String fName, String lName, \r\n\t\t\tString emailAddr, String streetAddr, String city, String state, \r\n\t\t\tint zip, String country)\r\n\t{\r\n\t\t\r\n\t\tthis.userName = userName;\r\n\t\tthis.role = role;\r\n\t\tthis.firstName = fName;\r\n\t\tthis.lastName = lName;\r\n\t\tthis.emailAddress = emailAddr;\r\n\t\tthis.streetAddress = streetAddr;\r\n\t\tthis.city = city;\r\n\t\tthis.state = state;\r\n\t\tthis.zip = zip;\r\n\t\tthis.country = country;\r\n\t\t\r\n\t}", "public User(int id,String firstName, String lastName, int age, String gender, String emailId,String password,long phoneNumber,int roleId) {\n\tsuper(); \n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.gender = gender;\n\tthis.emailId=emailId;\n\tthis.password=password;\n\tthis.phoneNumber = phoneNumber;\n\tthis.roleId=roleId;\n}", "public User(String username, String password, String firstName, String lastName, String mail, Role role) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t}", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public User(String username, String password, String firstName, String lastName, String mail, Role role,\r\n\t\t\tint collegeNum, String department, int organization) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t\tthis.collegeNum = collegeNum;\r\n\t\tthis.department = department;\r\n\t\tthis.organization = organization;\r\n\t}", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "public NewMember(String username, String password, String email) {\n this.username = username;\n this.password = password;\n this.email = email;\n this.has_role = \"User\";\n this.signingDate = new Date(System.currentTimeMillis());\n }", "public User(int id, String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.id = id;\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public UserRole() {\n // all persisted classes must define a no-arg constructor with at least package visibility\n }", "protected User(String username,String password,AccessLevel accessLevel){\n this.username = username;\n this.password = encryptPassword(password);\n this.accessLevel = accessLevel;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n checkRep();\n }", "public User(String name, String surname, String mail, String phone, Role role) {\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.role = role;\n }", "User()\n\t{\n\n\t}", "public User() {\r\n \r\n }", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User() {\n log.debug(\"Create a User object\");\n }", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n }", "public User() {\r\n\r\n\t}", "public LibrarianUser() {\n\t\tsuper();\n\t}", "protected User() {}", "protected User() {}", "public User() {\r\n\t}", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, \"\", \"\", \"\", true);\r\n\t}", "public User(String username, String nPassword)\n {\n userName = username;\n password = nPassword;\n }", "public User() {\r\n }", "public User() {\n\n\t}", "public User(int id, String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\t}", "public User()\n\t{\n\t}", "public SecurityUser() {\n\t\tsuper();\n\t}", "public DbUser() {\r\n\t}", "public User(String username, String password, UserType type) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty() || type == null) {\r\n\t throw new IllegalArgumentException(\"User : username or password or user type passed can not be null.\");\r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = type;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public User() {\r\n this(\"\", \"\");\r\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public User(){\n this(null, null);\n }", "public User(long id, String username, String email, String password) {\n this.id = id;\n this.username = username;\n this.email = email;\n this.password = password;\n}", "public User() { }", "public User(String username, String password) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty()) {\r\n\t throw new IllegalArgumentException(\"User : username or password passed can not be null.\"); \r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = UserType.USER;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public User() {\n /**\n * default Cto'r\n */\n }", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public User() {}", "public User() {}", "public User() {}", "protected User() {\n }", "public Users(String username, String password, String email, String phone)\r\n/* 53: */ {\r\n/* 54:67 */ this.username = username;\r\n/* 55:68 */ this.password = password;\r\n/* 56:69 */ this.email = email;\r\n/* 57:70 */ this.phone = phone;\r\n/* 58: */ }", "public UserAccount() {\n\n\t}", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public CreateUserCommand() {\n userReceiver = new UserReceiver();\n roleReceiver = new RoleReceiver();\n next = new GetRolesCommand();\n result = new CommandResult();\n }", "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 }", "User createUser();", "public User(String username, String password) {\r\n this.username = username;\r\n this.password = password;\r\n }", "private User() {\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "public UserModel(int ID, String firstName, String lastName, String password, String username, int role, int status) {\n this.ID = ID;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password=password;\n this.username = username;\n this.role = role;\n this.status = status;\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "public User(TUser tUser) {\n if (tUser.isSetUsername()) {\n username = tUser.getUsername();\n }\n\n if (tUser.isSetPassword()) {\n password = tUser.getPassword();\n }\n\n if (tUser.isSetEnabled()) {\n enabled = tUser.isEnabled();\n }\n\n if (tUser.isSetRoles()) {\n roles = tUser.getRoles().stream().map(tUserRole ->\n new UserRole(tUserRole, this)).collect(Collectors.toSet());\n }\n\n if (tUser.isSetRobots()) {\n robots = tUser.getRobots().stream().map(tRobot -> new Robot(tRobot, this)).collect(Collectors.toSet());\n }\n }", "public Role() {\n\t}", "private User() {}", "public User() {\n\n }", "private void createUser(final String email, final String password) {\n\n }", "public User(String username, String password) {\n this.username = username;\n this.password = password;\n }", "public Role() {\n }", "public Role() {\n }", "public User(){}", "public User(){}", "public User(){}", "public User(String username, String password, String email, boolean type) {\n //this.id = id;\n this.username = username;\n this.password = password;\n this.email = email;\n this.type = type;\n }", "public User(){\n }", "public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }", "public User(String userType, String userName, String firstName, String lastName, String password, String address, String city, int userRating, LocalDate joinDate) {\n super();\n this.userType = userType;\n this.userName = userName;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password = password;\n this.address = address;\n this.city = city;\n this.userRating = userRating;\n this.joinDate = joinDate;\n }", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public User(){\n\n }", "public User(String username, String password, UserType userType) {\n this.username.set(username);\n this.password.set(password);\n this.userType.set(userType);\n }" ]
[ "0.76306576", "0.7303284", "0.7248043", "0.7224747", "0.71939325", "0.71735686", "0.7135157", "0.71317834", "0.7115367", "0.7099414", "0.7072315", "0.70683557", "0.70267373", "0.69746333", "0.69672483", "0.69427574", "0.6913272", "0.69100314", "0.6875622", "0.6860844", "0.68566525", "0.68451434", "0.6843472", "0.6833056", "0.6823043", "0.680715", "0.680715", "0.680715", "0.679373", "0.67821866", "0.67590284", "0.67582124", "0.67582124", "0.674809", "0.6746899", "0.67297363", "0.67295766", "0.6715357", "0.67148024", "0.67142487", "0.67142487", "0.67104346", "0.67038876", "0.66996723", "0.6696072", "0.66874677", "0.6684646", "0.6680842", "0.66691", "0.66652805", "0.6659658", "0.6647023", "0.663275", "0.662789", "0.6624077", "0.6624077", "0.6624077", "0.66223156", "0.66167605", "0.6600709", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6600402", "0.6595824", "0.65779716", "0.65760374", "0.6575813", "0.65754825", "0.6572689", "0.6564556", "0.65592325", "0.65590054", "0.65548074", "0.65506506", "0.6549008", "0.65427643", "0.6539387", "0.6536201", "0.6536201", "0.6535995", "0.6535995", "0.6535995", "0.65303296", "0.6529387", "0.6529199", "0.65251267", "0.6521226", "0.65160495", "0.6511971", "0.650705" ]
0.78170085
0
Constructor that required fields to create new user by defining Role, Locale, Authentication Method, ActiveFlag
public CreateNewUserDetails(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod, boolean bActiveFlag) { // No language assume English user set(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, bActiveFlag); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, sAuthMethod, true);\r\n\t}", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole, String sLocale)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, sLocale, \"\", true);\r\n\t}", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail, String sRole)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, sRole, \"\", \"\", true);\r\n\t}", "public User(String userName, String role, String fName, String lName, \r\n\t\t\tString emailAddr, String streetAddr, String city, String state, \r\n\t\t\tint zip, String country)\r\n\t{\r\n\t\t\r\n\t\tthis.userName = userName;\r\n\t\tthis.role = role;\r\n\t\tthis.firstName = fName;\r\n\t\tthis.lastName = lName;\r\n\t\tthis.emailAddress = emailAddr;\r\n\t\tthis.streetAddress = streetAddr;\r\n\t\tthis.city = city;\r\n\t\tthis.state = state;\r\n\t\tthis.zip = zip;\r\n\t\tthis.country = country;\r\n\t\t\r\n\t}", "public User(String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "public User(int id,String firstName, String lastName, int age, String gender, String emailId,String password,long phoneNumber,int roleId) {\n\tsuper(); \n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.gender = gender;\n\tthis.emailId=emailId;\n\tthis.password=password;\n\tthis.phoneNumber = phoneNumber;\n\tthis.roleId=roleId;\n}", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public NewMember(String username, String password, String email) {\n this.username = username;\n this.password = password;\n this.email = email;\n this.has_role = \"User\";\n this.signingDate = new Date(System.currentTimeMillis());\n }", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User(String username, String password, String firstName, String lastName, String mail, Role role,\r\n\t\t\tint collegeNum, String department, int organization) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t\tthis.collegeNum = collegeNum;\r\n\t\tthis.department = department;\r\n\t\tthis.organization = organization;\r\n\t}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public UserRole() {\n // all persisted classes must define a no-arg constructor with at least package visibility\n }", "public User(String username, String password, String firstName, String lastName, String mail, Role role) {\r\n\t\tthis.username = username;\r\n\t\tthis.password = password;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.mail = mail;\r\n\t\tthis.role = role;\r\n\t}", "public User(int id, String email, String password, String name, String address, String zipcode, String phone, Role role)\n {\n this.id = id;\n this.email = email;\n this.password = password;\n this.name = name;\n this.address = address;\n this.zipcode = zipcode;\n this.phone = phone;\n this.role = role;\n }", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "User()\n\t{\n\n\t}", "protected User(String username,String password,AccessLevel accessLevel){\n this.username = username;\n this.password = encryptPassword(password);\n this.accessLevel = accessLevel;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n checkRep();\n }", "public User() {\r\n \r\n }", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User(String name, String surname, String mail, String phone, Role role) {\n this.name = name;\n this.surname = surname;\n this.mail = mail;\n this.phone = phone;\n this.role = role;\n }", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public DbUser() {\r\n\t}", "public LibrarianUser() {\n\t\tsuper();\n\t}", "public User() {\n log.debug(\"Create a User object\");\n }", "public User(String username, String password, boolean isTechAgent) {\n // The hashpw method hashes password with a random salt.\n String pw_hash = BCrypt.hashpw(password, BCrypt.gensalt());\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = pw_hash;\n this.isTechAgent = isTechAgent;\n }", "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 CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public User() {\r\n\r\n\t}", "public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public UserModel(int ID, String firstName, String lastName, String password, String username, int role, int status) {\n this.ID = ID;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password=password;\n this.username = username;\n this.role = role;\n this.status = status;\n }", "public User(String username, String password, String email, boolean type) {\n //this.id = id;\n this.username = username;\n this.password = password;\n this.email = email;\n this.type = type;\n }", "public User(String username, String password, UserType type) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty() || type == null) {\r\n\t throw new IllegalArgumentException(\"User : username or password or user type passed can not be null.\");\r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = type;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "public User() {\r\n\t}", "public UserAccount() {\n\n\t}", "public User() {\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "public User()\n\t{\n\t}", "public User(int id, String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime, Set<UserRole> roles) {\n this();\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n this.roles = roles;\n }", "public CreateNewUserDetails(String sLogin, String sFirstName, \r\n\t\t\tString sLastName, String sPassword, String sEmail)\r\n\t{\r\n\t\t// No language assume English user\r\n\t\tset(sLogin, sFirstName, sLastName, sPassword, sEmail, \"\", \"\", \"\", true);\r\n\t}", "public User(String userType, String userName, String firstName, String lastName, String password, String address, String city, int userRating, LocalDate joinDate) {\n super();\n this.userType = userType;\n this.userName = userName;\n this.firstName = firstName;\n this.lastName = lastName;\n this.password = password;\n this.address = address;\n this.city = city;\n this.userRating = userRating;\n this.joinDate = joinDate;\n }", "public Users(String username, String password, String email, String phone)\r\n/* 53: */ {\r\n/* 54:67 */ this.username = username;\r\n/* 55:68 */ this.password = password;\r\n/* 56:69 */ this.email = email;\r\n/* 57:70 */ this.phone = phone;\r\n/* 58: */ }", "public User() {\r\n this(\"\", \"\");\r\n }", "public User() {\r\n }", "public User() {\n\n\t}", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\t}", "public User(long uId, String uPassword, String uFirstName, String uLastName, \n String uEmailAddress, Date uLastAccess, Date uEnrolDate, \n char uType, boolean uEnabled) throws InvalidUserDataException {\n try{\n setId(uId);\n setPassword(uPassword);\n setFirstName(uFirstName);\n setLastName(uLastName);\n setEmailAddress(uEmailAddress);\n setLastAccess(uLastAccess);\n setEnrolDate(uEnrolDate);\n setEnabled(uEnabled);\n setType(uType);\n \n }catch(Exception e)\n {\n throw new InvalidUserDataException(e.getMessage());\n }\n \n }", "public User(TUser tUser) {\n if (tUser.isSetUsername()) {\n username = tUser.getUsername();\n }\n\n if (tUser.isSetPassword()) {\n password = tUser.getPassword();\n }\n\n if (tUser.isSetEnabled()) {\n enabled = tUser.isEnabled();\n }\n\n if (tUser.isSetRoles()) {\n roles = tUser.getRoles().stream().map(tUserRole ->\n new UserRole(tUserRole, this)).collect(Collectors.toSet());\n }\n\n if (tUser.isSetRobots()) {\n robots = tUser.getRobots().stream().map(tRobot -> new Robot(tRobot, this)).collect(Collectors.toSet());\n }\n }", "public SecurityUser() {\n\t\tsuper();\n\t}", "protected User() {}", "protected User() {}", "public User(){\n this(null, null);\n }", "public User(String username, String password) {\r\n\t if (username == null || username.isEmpty() || password == null || password.isEmpty()) {\r\n\t throw new IllegalArgumentException(\"User : username or password passed can not be null.\"); \r\n\t }\r\n this.email = new Email(EmailType.PERSONAL, username);\r\n\t\tthis.username = username;\r\n\t\tthis.password = encrypt(password);\r\n\t\tthis.displayname = username;\r\n this.type = UserType.USER;\r\n\t\tthis.status = InstanceStatus.TRANSCIENT;\r\n\t}", "public User(int user_id, String full_name, String address, String postal_code, int mobile_no,\n String snow_zone, String garbage_day, String password){\n this.user_id = user_id;\n this.full_name = full_name;\n this.address = address;\n this.postal_code = postal_code;\n this.mobile_no = mobile_no;\n this.snow_zone = snow_zone;\n this.garbage_day = garbage_day;\n this.password = password;\n\n }", "public User() {\n /**\n * default Cto'r\n */\n }", "public User(String username, String nPassword)\n {\n userName = username;\n password = nPassword;\n }", "public CreateUserCommand() {\n userReceiver = new UserReceiver();\n roleReceiver = new RoleReceiver();\n next = new GetRolesCommand();\n result = new CommandResult();\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public User(UUID userID, String username, String password, boolean isTechAgent) {\n this.userID = userID;\n this.username = username;\n this.password = password;\n this.isTechAgent = isTechAgent;\n }", "public User(String username, String password, String firstName, String lastName, Short userType) {\r\n this.username = username;\r\n this.password = password;\r\n this.firstName = firstName;\r\n this.lastName = lastName;\r\n this.userType = userType;\r\n }", "public Role() {\n\t}", "public User() {}", "public User() {}", "public User() {}", "public User(String firstName, String lastName, String userName, String email, String password, LocalDateTime creationDateTime, LocalDateTime updateDateTime) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.email = email;\n this.password = password;\n this.creationDateTime = creationDateTime;\n this.updateDateTime = updateDateTime;\n }", "public User() { }", "public UserMember() {\r\n //this.email = \"user@user.com\";\r\n this.email = \"\";\r\n this.firstName = \"\";\r\n this.lastName = \"\";\r\n this.username = \"\";\r\n this.password = \"\";\r\n this.memberId = 0;\r\n }", "public User(long id, String username, String email, String password) {\n this.id = id;\n this.username = username;\n this.email = email;\n this.password = password;\n}", "public TUser() {\n this(\"t_user\", null);\n }", "public JpaUser(String username, String password, JpaOrganization organization, String name, String email,\n String provider, boolean manageable) {\n super();\n this.username = username;\n this.password = password;\n this.organization = organization;\n this.name = name;\n this.email = email;\n this.provider = provider;\n this.manageable = manageable;\n this.roles = new HashSet<JpaRole>();\n }", "public User(String un, String pw, String fn, String c, String g, Date dob, Date acsd){\n this.username = un;\n this.password = pw;\n this.fullName = fn;\n this.country = c;\n this.gender = g;\n this.dob = dob;\n this.accessDate = acsd;\n }", "public UserAccount() {\n }", "public User(String username, String password, String firstName, String lastName, Short userType, Short userRating) {\r\n this.username = username;\r\n this.password = password;\r\n this.firstName = firstName;\r\n this.lastName = lastName;\r\n this.userType = userType;\r\n this.userRating = userRating;\r\n }", "public Role() {\n }", "public Role() {\n }", "public User(String username, String password, UserType userType) {\n this.username.set(username);\n this.password.set(password);\n this.userType.set(userType);\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User(){\n\t username = \"Anonymous\";\n\t}", "User createUser();" ]
[ "0.76793027", "0.7518976", "0.74086106", "0.72801656", "0.72730154", "0.72710025", "0.72121155", "0.7204159", "0.7177841", "0.71460515", "0.71354437", "0.7112884", "0.7062979", "0.70456517", "0.70391786", "0.7032249", "0.7030799", "0.70037293", "0.69509345", "0.6910431", "0.6906904", "0.68937373", "0.6865481", "0.68622184", "0.68618083", "0.68618083", "0.68618083", "0.6831436", "0.6831232", "0.682879", "0.68252033", "0.6823488", "0.68004704", "0.6795884", "0.6792236", "0.6787179", "0.67851967", "0.6770692", "0.67638373", "0.6747826", "0.67422706", "0.67409134", "0.6732161", "0.6722555", "0.67180884", "0.6714375", "0.6709992", "0.67023087", "0.6699195", "0.66981405", "0.6697207", "0.66947037", "0.6689727", "0.6689727", "0.6688467", "0.66857123", "0.66822904", "0.667727", "0.6673431", "0.6673431", "0.66614914", "0.66432834", "0.6642876", "0.66368014", "0.66350245", "0.662934", "0.6629161", "0.66149294", "0.6608117", "0.6608081", "0.66059715", "0.66059715", "0.66059715", "0.6599643", "0.65929186", "0.65813047", "0.6573929", "0.6569294", "0.6568838", "0.6558917", "0.6554627", "0.65484035", "0.6546002", "0.6546002", "0.6537248", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6530132", "0.6526795", "0.652595" ]
0.77476335
0
Sets all the variables.
private void set(String sLogin, String sFirstName, String sLastName, String sPassword, String sEmail, String sRole, String sLocale, String sAuthMethod, boolean bActiveFlag) { this.sLogin = sLogin; this.sFirstName = sFirstName; this.sLastName = sLastName; this.sPassword = sPassword; this.sEmail = sEmail; this.sRole = sRole; this.sLocale = sLocale; this.sAuthMethod = sAuthMethod; this.bActiveFlag = bActiveFlag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "protected void initVars() {}", "private void updateVars()\n {\n\n }", "public void setAll()\r\n\t{\r\n\t\tthis.coderVersion = CaTIESProperties.getValue(\"caties.coder.version\");\r\n\t\tthis.gateHome = CaTIESProperties.getValue(\"caties.gate.home\");\r\n\t\tthis.creoleUrlName = CaTIESProperties.getValue(\"caties.creole.url.name\");\r\n\t\tthis.caseInsensitiveGazetteerUrlName = CaTIESProperties\r\n\t\t\t\t.getValue(\"caties.case.insensitive.gazetteer.url.name\");\r\n\t\tthis.caseSensitiveGazetteerUrlName = CaTIESProperties\r\n\t\t\t\t.getValue(\"caties.case.sensitive.gazetteer.url.name\");\r\n\t\tthis.sectionChunkerUrlName = CaTIESProperties.getValue(\"caties.section.chunker.url.name\");\r\n\t\tthis.conceptFilterUrlName = CaTIESProperties.getValue(\"caties.concept.filter.url.name\");\r\n\t\tthis.negExUrlName = CaTIESProperties.getValue(\"caties.neg.ex.url.name\");\r\n\t\tthis.conceptCategorizerUrlName = CaTIESProperties\r\n\t\t\t\t.getValue(\"caties.concept.categorizer.url.name\");\r\n\t}", "private void inicializaValores(){\n /**\n * Reinicia los valores de las variables.\n */\n ce.setVariables();\n valorA.setText(null);\n valorB.setText(null);\n valorC.setText(null);\n x1.setText(null);\n x2.setText(null);\n \n }", "private void setUp() {\r\n\tvariables = new Vector();\r\n\tstatements = new Vector();\r\n\tconstraints = new Vector();\r\n\tvariableGenerator = new SimpleVariableGenerator(\"v_\");\r\n }", "private void assignment() {\n\n\t\t\t}", "public void resetVariables() {\n this.name = \"\";\n this.equipLevel = 0;\n this.cpuCost = 0;\n this.bankDamageModifier = 1.0f;\n this.redirectDamageModifier = 1.0f;\n this.attackDamageModifier = 1.0f;\n this.ftpDamageModifier = 1.0f;\n this.httpDamageModifier = 1.0f;\n this.attackDamage = 0.0f;\n this.pettyCashReducePct = 1.0f;\n this.pettyCashFailPct = 1.0f;\n this.dailyPayChangeFailPct = 1.0f;\n this.dailyPayChangeReducePct = 1.0f;\n this.stealFileFailPct = 1.0f;\n this.installScriptFailPct = 1.0f;\n }", "private void setInititalValues() {\n drone.setTranslateX(INITIAL_X_POSITION);\n drone.setTranslateY(INITIAL_Y_POSITION);\n drone.setTranslateZ(INITIAL_Z_POSITION);\n\n // set initial orientation to z-axis (into the screen)\n setxOrientation(0);\n setyOrientation(0);\n setzOrientation(1);\n setYawAngle(0);\n setRollAngle(0);\n setPitchAngle(0);\n setSpeed(TelloDefaultValues.DEFAULT_SPEED);\n }", "public void setNewValues(){\n questionT = qMean.getText();\n phoneT = pMean.getText();\n doorT = dMean.getText();\n time = simTime.getText();\n simulation.setTime(time);\n simulation.setD(doorT);\n simulation.setP(phoneT);\n simulation.setQ(questionT);\n }", "public void setGlobalVariables(GlobalVariables globalVariables);", "public void setVars() {\n\t\tif (jEdit.getPlugin(\"console.ConsolePlugin\") != null) {\n\t\t\tconsole.ConsolePlugin.setSystemShellVariableValue(\"LUAJ\", getLuaJ());\n\t\t}\n\t}", "private void setVariables() {\n vb = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);\n linBoardGame = (LinearLayout) ((Activity) context).findViewById(boardID);\n gridContainer = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n shipTV = (TextView) ((Activity) context).findViewById(R.id.shipTV);\n linBoardGame.setOnTouchListener(this);\n sizeOfCell = Math.round(ScreenWidth() / (maxN + (1)));\n occupiedCells = new ArrayList<>();\n playerAttacks = new ArrayList<>();\n hit = false;\n gridID = R.drawable.grid;\n if (!player ) lockGrid = true;\n ships = new ArrayList<>();\n }", "public void limpiarCampos() {\n\t\ttema = new Tema();\n\t\ttemaSeleccionado = new Tema();\n\t\tmultimedia = new Multimedia();\n\t}", "private void setValues() {\n //Calls for new assessment\n Assessment assessment = new Assessment();\n //Updates the local db assessmentDao with courseID and assessment ID\n assessment = db.assessmentDao().getAssessment(courseID, assessmentID);\n //Gets the assessment details name\n String name = assessment.getAssessment_name();\n //Gets the assessment details type\n String type = assessment.getAssessment_type();\n //Gets the assessment details status\n String status = assessment.getAssessment_status();\n //Gets the assessment details date\n String dDate = DateFormat.format(\"MM/dd/yyyy\", assessment.getAssessment_due_date()).toString();\n boolean alert1 = assessment.getAssessment_alert();\n //Gets the assessment details alert bar\n String alert = \"Off\";\n if (alert1) {\n alert = \"On\";\n }\n //Sets assessment details Name\n adName.setText(name);\n //Sets assessment details type\n adType.setText(type);\n //Sets assessment details status\n adStatus.setText(status);\n //Sets assessment details due date\n adDueDate.setText(dDate);\n //Sets assessment details alert\n adAlert.setText(alert);\n }", "private void initializeAll() {\n initialize(rows);\n initialize(columns);\n initialize(boxes);\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 initVars(){\n this.sOut = new StringBuilder();\n this.curPos = this.frameCount = 0;\n this.heldKeys = new int[257];\n this.showCursor = false;\n this.fontId = DAGGER40;\n Arrays.fill(this.heldKeys,-1);\n }", "private void initVariables() {\n ivBack.setVisibility(View.VISIBLE);\n tvTitle.setVisibility(View.VISIBLE);\n tvTitle.setText(getString(R.string.change_language));\n\n gifProgress.setImageResource(R.drawable.shopholic_loader);\n progressBar.setVisibility(View.GONE);\n String currentLang = AppSharedPreference.getInstance().getString(this, AppSharedPreference.PREF_KEY.CURRENT_LANGUAGE);\n setLanguage(currentLang);\n }", "void setParameters() {\n\t\t\n\t}", "public void resetTestVars() {\n\t\tuser1 = new User();\n\t\tuser2 = new User();\n\t\tuser3 = new User();\n\t\tsn = new SocialNetwork();\n\t\tstatus = SocialNetworkStatus.DEFAULT;\n\t\tearly = new Date(25L);\n\t\tmid = new Date(50L);\n\t\tlate = new Date(75L);\n\t}", "public final void setDefautlVals() {\n this.createTime = this.writeTime = GlobalMethods.getTimeStamp(null);\n this.createId = this.writeId = PackagingVars.context.getUser().getId();\n }", "public static void updateVars() {\n IntVar tempo;\n for (Vars vars: getArrayutcc() ){\n tempo = (IntVar) Store.getModelStore().findVariable(vars.varname);\n vars.vinf = tempo.value();\n }\n\n }", "private void setup()\n\t{\n\t\tif(values == null)\n\t\t\tvalues = new HashMap<>();\n\t\telse\n\t\t\tvalues.clear();\n\t}", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t}", "public void initializeScoringVariables(){\n\t\tgame.setMovement(moveDistance);\n\t\tgame.setRight(correctGuess);\n\t\tgame.setWrong(incorrectGuesses);\n\t\tgame.setTime(duration(startTime,endTime));\n\t}", "private void setVars(String orgName, String commName, String serialNum, String reason, String insertedBy) {\n organizationName = orgName;\n commonName = commName;\n serialNumber = serialNum;\n this.reason = reason;\n this.insertedBy = insertedBy;\n }", "public void resetVariables(){\n\t\tthis.queryTriplets.clear();\n\t\tthis.variableList.clear();\n\t\tthis.prefixMap.clear();\n\t}", "private void setVariables(Context context){\n this.context = context != null ? context : getContext();\n mwifiAdmin = new WifiAdmin(this.context);\n }", "private void setAllAttributesFromController() {\n obsoData.setSupplier(supplier);\n \n obsoData.setEndOfOrderDate(endOfOrderDate);\n obsoData.setObsolescenceDate(obsolescenceDate);\n \n obsoData.setEndOfSupportDate(endOfSupportDate);\n obsoData.setEndOfProductionDate(endOfProductionDate);\n \n obsoData.setCurrentAction(avlBean.findAttributeValueListById(\n ActionObso.class, actionId));\n obsoData.setMtbf(mtbf);\n \n obsoData.setStrategyKept(avlBean.findAttributeValueListById(\n Strategy.class,\n strategyId));\n obsoData.setContinuityDate(continuityDate);\n \n obsoData.setManufacturerStatus(avlBean.findAttributeValueListById(\n ManufacturerStatus.class, manufacturerStatusId));\n obsoData.setAirbusStatus(avlBean.findAttributeValueListById(\n AirbusStatus.class, airbusStatusId));\n \n obsoData.setLastObsolescenceUpdate(lastObsolescenceUpdate);\n obsoData.setConsultPeriod(avlBean.findAttributeValueListById(\n ConsultPeriod.class, consultPeriodId));\n \n obsoData.setPersonInCharge(personInCharge);\n obsoData.setCommentOnStrategy(comments);\n }", "private void setupVariables() {\n mCalendarView = findViewById(R.id.calendarView);\n mTextView = findViewById(R.id.eventsView);\n }", "private void setEverything(){\r\n int listLength = propertyList.length -1;\r\n arrayIterator = new ArrayIterator<>(propertyList, listLength+1);\r\n\r\n this.priceTree = new SearchTree<>(new PriceComparator());\r\n this.stockTree = new SearchTree<>(new StockComparator());\r\n this.ratingTree = new SearchTree<>(new RatingComparator());\r\n this.deliveryTree= new SearchTree<>(new DeliveryTimeComparator());\r\n\r\n this.foodArray = new ArrayQueue<>();\r\n this.restaurantArray = new ArrayQueue<>();\r\n\r\n // Fill arrays from property list.\r\n createFoodArray();\r\n arrayIterator.setCurrent(0); //Since the restaurantArray will use the same iterator\r\n createRestaurantArray();\r\n\r\n // Fill Binary Search Trees\r\n createFoodTrees();\r\n createRestaurantTrees();\r\n }", "private void initValues() {\n \n }", "protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }", "private void initVars(){\n this.dice = new Dice();\n this.playing = true;\n this.currentPlayer = 0;\n this.turn = 0;\n this.xPlayers=new ArrayList<>(); \n this.players = new Player[4];\n this.diceRoller=true;\n this.xTokens=new ArrayList<>();\n this.winners=new ArrayList<>();\n this.computerPlayer= new Autoplay();\n this.gameResults = \"\";\n this.debug = false;\n }", "public void setdat()\n {\n }", "@Before\r\n\tpublic void set()\r\n\t{\n\t\tif (!Message.configure(\"wordsweeper.xsd\")) {\r\n\t\t\tfail (\"unable to configure protocol\");\r\n\t\t}\r\n\t\tModel.serverAccess = mockServer;\r\n\t\tModel.gameLayout = gameLayout;\r\n\t\tModel.GAME = game;\r\n\t\tModel.PLAYER = player;\r\n\t\tModel.BOARD = board;\r\n\t\tModel.gameLayout.setLayout();\r\n\t\tModel.gameLayout.addListener();\r\n\t}", "private void initFields() {\n\n tipPercent = 0.0;\n noPersons = 1;\n totalPay = 0.0;\n totalTip = 0.0;\n totalPerPerson = 0.0;\n\n }", "public void setAllValues() {\n//\t\tNewRestaurantDetailsByStoreId newRestaurantDetailsByStoreId = null;\n\t\t\n\t\tif (Constants.allthemes!=null){\n\t\t int length = Constants.allthemes.size();\n\t\t for(int i=0;i<length;i++){\n\t\t \tThemes currentTheme = Constants.allthemes.get(i);\n\t\t \tAddObjectToList(currentTheme.photo_url,\n\t\t \t\t\tcurrentTheme.title, \n\t\t\t\t\t\t\"~\"+currentTheme.content,\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\tcurrentTheme.themeIndex);\n\t\t }\n\t\t \n\t\t \n\t\t runOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tprepareArrayLits();//CREATE LIST VIEW OF THE NEW RESTAURANTS\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\tToast.makeText(SlyThemesActivity.this, \"無資料,請重開App.\",Toast.LENGTH_SHORT).show();\n\t\t}\n\t}", "public static void initialisations() {\n\t\tit = 0;\r\n\t\tbc = 1;\r\n\r\n\t\t// pile des reprises pour compilation des branchements en avant\r\n\t\tpileRep = new TPileRep(); \r\n\t\t// programme objet = code Mapile de l'unite en cours de compilation\r\n\t\tpo = new ProgObjet();\r\n\t\t// COMPILATION SEPAREE: desripteur de l'unite en cours de compilation\r\n\t\tdesc = new Descripteur();\r\n\r\n\t\t// initialisation necessaire aux attributs lexicaux\r\n\t\tUtilLex.initialisation();\r\n\r\n\t\t// initialisation du type de l'expression courante\r\n\t\ttCour = NEUTRE;\r\n\r\n\t\t//Initialisation de la variable qui compte le nombre de param�tres de chaque proc�dure \r\n\t\tnbParamProc = 0;\r\n\r\n\t\t//Initialisation de la variable qui compte le nombre de variables d�clar�es\r\n\t\tnbVar++;\r\n\r\n\t\t//Initialisation vTmp\r\n\t\tvTmp = 0;\r\n\t\t\r\n\t\tdesc.setUnite(\"programme\");\r\n\t\t\r\n\t}", "@SuppressWarnings(\"deprecation\")\n\tprivate void setControllerVariables() {\n\t\tcontrollerVars.setAudioManager((AudioManager) act.getSystemService(Context.AUDIO_SERVICE));\n\t\tcontrollerVars.setActVolume((float) controllerVars.getAudioManager().getStreamVolume(AudioManager.STREAM_MUSIC));\n\t\tcontrollerVars.setMaxVolume((float) controllerVars.getAudioManager().getStreamMaxVolume(AudioManager.STREAM_MUSIC));\n\t\tcontrollerVars.setVolume(controllerVars.getActVolume() / controllerVars.getMaxVolume());\n\n\t\t//Hardware buttons setting to adjust the media sound\n\t\tact.setVolumeControlStream(AudioManager.STREAM_MUSIC);\n\n\t\t// the counter will help us recognize the stream id of the sound played now\n\t\tcontrollerVars.setCounter(0);\n\n\t\t// Load the sounds\n\t\tcontrollerVars.setSoundPool(new SoundPool(20, AudioManager.STREAM_MUSIC, 0));\n\t\tcontrollerVars.getSoundPool().setOnLoadCompleteListener(new OnLoadCompleteListener() {\n\t\t @Override\n\t\t public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {\n\t\t \tcontrollerVars.setLoaded(true);\n\t\t }\n\t\t});\t\t\n\t}", "private void initVariables(){\n int counter = 1;\n for (int vCount = 0; vCount < vertexCount; vCount++){\n for (int pCount = 0; pCount < positionCount; pCount++){\n variables[vCount][pCount] = counter++;\n }\n }\n }", "public Variables() {\n this.numCliente = 0;\n this.tiempoSalida = 999;\n }", "public void resetVariables() {\n\t\tArrays.fill(variables, 0.0);\n\t}", "protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\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}", "private void setAttributes() {\n mAuth = ServerData.getInstance().getMAuth();\n user = ServerData.getInstance().getUser();\n sharedpreferences = getSharedPreferences(GOOGLE_CALENDAR_SHARED_PREFERENCES, Context.MODE_PRIVATE);\n walkingSharedPreferences = getSharedPreferences(ACTUAL_WALK, Context.MODE_PRIVATE);\n\n notificationId = 0;\n requestCode = 0;\n fragmentManager = getSupportFragmentManager();\n\n context = this;\n }", "void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }", "private void setValues() {\n textViewPrice = findViewById(R.id.textViewPrice);\n textViewStoreName = findViewById(R.id.textViewStoreName);\n textViewLocation = findViewById(R.id.textViewLocation);\n buttonAcceptOrder = findViewById(R.id.buttonAcceptOrder);\n\n order = Parcels.unwrap(getIntent().getParcelableExtra(Order.class.getSimpleName()));\n\n textViewPrice.setText(\"$\" + decimalFormat.format(order.getPrice()));\n textViewStoreName.setText(\"Store: \"+ order.getStore().getName());\n textViewLocation.setText(\"Address: \" + order.getStore().getAddress());\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}", "private void setupVariables() {\n activeCourseList = new ArrayList<>();\n activeScheduleList = new ArrayList<>();\n\n scanner = new Scanner(System.in);\n reader = new JsonReader(\"./data/ScheduleList.json\",\n \"./data/CourseList.json\");\n\n loadLists();\n }", "protected void setNumVars(int numVars)\n {\n \tthis.numVars = numVars;\n }", "public void setTotalVariables( int totalVars ) ;", "private void limpiarValores(){\n\t\tpcodcia = \"\";\n\t\tcedula = \"\";\n\t\tcoduser = \"\";\n\t\tcluser = \"\";\n\t\tmail = \"\";\n\t\taudit = \"\";\n\t\tnbr = \"\";\n\t\trol = \"\";\n\t}", "private void initializeVariables(Date timeSlotDate)\n\t\t{\n\t\t\tthis.timeSlot = timeSlotDate;\n\t\t}", "public void setValues(){\r\n int k=0;\r\n String[] var;\r\n String evar;\r\n \r\n //Set Values \r\n for (int i=0; i<linkVector.size(); i++){\r\n var= (String[]) linkVector.elementAt(i);\r\n evar=var[1];\r\n try { \r\n varContextField= varContextFields[linkIndex[k]]; \r\n switch (linkType[k++]){\r\n case DOUBLE: setValue(evar,varContextField.getDouble(varContextObject)); break;\r\n case ARRAYDOUBLE: setValue(evar,(double[])varContextField.get(varContextObject)); break;\r\n case ARRAYDOUBLE2D: setValue(evar,(double[][])varContextField.get(varContextObject)); break;\r\n case STRING: setValue(evar,(String)varContextField.get(varContextObject)); break; \r\n }\r\n \r\n } catch (java.lang.IllegalAccessException e) {\r\n System.out.println(\"Error Step: setting a value \" + e);\r\n } \r\n } \r\n }", "public final void setVariables(final Map<?, ?> variables)\n\t{\n\t\tthis.variables = variables;\n\t}", "public void setAll(boolean all) {\n uppercase = all;\n lowercase = all;\n numbers = all;\n symbols = all;\n }", "private void setUIFields(){\n setImage();\n setTitle();\n setLocation();\n setRatingBar();\n setDate();\n setISBN();\n setDescription();\n setPageCount();\n setNumRatings();\n }", "public void updateVariables(){\n Map<String, Integer> specialParameter = myLogic.getSpecialParameterToDisplay();\n liveScore.setText(Double.toString(myLogic.getScore()));\n for (String parameter: specialParameter.keySet()) {\n numLives.setText(parameter + specialParameter.get(parameter));\n }\n myMoney.setText(Double.toString(myLogic.getCash()));\n }", "private void initiliaze() {\r\n\t\tthis.inputFile = cd.getInputFile();\r\n\t\tthis.flowcell = cd.getFlowcell();\r\n\t\tthis.totalNumberOfTicks = cd.getOptions().getTotalNumberOfTicks();\r\n\t\tthis.outputFile = cd.getOutputFile();\r\n\t\tthis.statistics = cd.getStatistic();\r\n\t}", "private void initializeGlobalVariables()\n\t{\n\t\t_continue = (Button) findViewById(R.id.es_continue);\n\t\t\n\t\t_points = (CheckBox) findViewById(R.id.es_points);\n\t\t_score = (CheckBox) findViewById(R.id.es_score);\n\t}", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t\tCursurIndex = 1;\n\t\t\n\t}", "private void setFields() {\n\t\tfirstname.setText(guest.getFirstName());\n\t\tlastname.setText(guest.getLastName());\n\t\tpassport.setText(guest.getPassportNumber());\n\t\ttelephone.setText(guest.getTelephoneNumber());\n\t\tarrival.setText(arrivalDate.toString());\n\t\tdeparture.setText(departureDate.toString());\n\n\t\tif (hotelChoice.getName() != null && hotelChoice.getName() != \"\"\n\t\t\t\t&& !(hotelChoice.getName() == Controller.DEFAULT_HOTEL_CHOICE)) {\n\t\t\thotel.setText(hotelChoice.getName());\n\t\t} else {\n\t\t\thotelChoice = new Hotel();\n\t\t\thotelChoice.setName(\"\");\n\t\t\thotel.clear();\n\t\t}\n\t\tif (roomQualityChoice.getQuality() != null && roomQualityChoice.getQuality() != \"\"\n\t\t\t\t&& !(roomQualityChoice.getQuality() == Controller.DEFAULT_QUALITY_CHOICE)) {\n\t\t\tquality.setText(roomQualityChoice.getQuality());\n\t\t} else {\n\t\t\troomQualityChoice = new RoomQuality();\n\t\t\troomQualityChoice.setQuality(\"\");\n\t\t\tquality.clear();\n\t\t}\n\t\tif (discountChoice > 0) {\n\t\t\tdiscount.setText(\"(-\" + discountChoice + \"%)\");\n\t\t}\n\n\t\tloadAvailableRooms();\n\n\t}", "private void initializeVariables() {\n\n //Acquisizione credeziali per il login\n editTextUsername = findViewById(R.id.username);\n editTextPassword = findViewById(R.id.password);\n\n //bottone per il login\n mLoginButton = findViewById(R.id.button_login);\n\n //Checkbox per ricordare le credenziali\n rememberMe = findViewById(R.id.remember);\n\n //Variabile per reimpostare la password\n forgotTextLink = findViewById(R.id.lost_password);\n\n //ProgressBar\n progressBar = findViewById(R.id.progress_view);\n }", "void setupVariables(IVariableFactory factory);", "private void init() {\n\t\t\n\t\ttry{\t\t\t\n\t\t\tinfos = new HashMap<String, VariableInfo>();\n\t\t\t\n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\t\n\t\t\t\tif(this.problem.getNbrNeighbors(var) != 0){ // an isolated variable doesn't need a CryptoScheme and therefore no VariableInfo either\n\t\t\t\t\t\n\t\t\t\t\tVariableInfo info = new VariableInfo(var);\n\t\t\t\t\tinfos.put(var, info);\n\t\t\t\t\t\n\t\t\t\t\tinfo.cs = cryptoConstr.newInstance(this.cryptoParameter);\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//initialize request counter for my own variables\n\t\t\trequestCount = new HashMap<String,Integer>(); \n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\trequestCount.put(var, 0);\n\t\t\t}\n\t\t\t\n\t\t\tthis.started = true;\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "private void init()\n\t{\n\t\tsetModel(new Model(Id.model, this, null));\n\t\tsetEnviroment(new Enviroment(Id.enviroment, this, model()));\n\t\tsetVaccinationCenter(new VaccinationCenter(Id.vaccinationCenter, this, model()));\n\t\tsetCanteen(new Canteen(Id.canteen, this, vaccinationCenter()));\n\t\tsetRegistration(new Registration(Id.registration, this, vaccinationCenter()));\n\t\tsetExamination(new Examination(Id.examination, this, vaccinationCenter()));\n\t\tsetVaccination(new Vaccination(Id.vaccination, this, vaccinationCenter()));\n\t\tsetWaitingRoom(new WaitingRoom(Id.waitingRoom, this, vaccinationCenter()));\n\t\tsetSyringes(new Syringes(Id.syringes, this, vaccination()));\n\t}", "public void setAllGeneratorVariables(int voters, byte ratings, int parties, ElectionType type, int districts){\n this.voters = voters;\n this.ratings = ratings;\n this.parties = parties;\n this.type = type;\n this.districts = districts;\n recalculateVotes(new ActionEvent());\n }", "private void init() {\n cloudAmount = null;\n cloudGenus = null;\n cloudAltitude = null;\n cloudDescription = null;\n }", "public void setGlobalVariables(GlobalVariables globalVariables) {\n this.globalVariables = globalVariables;\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}", "@Override\r\n\tprotected void initVariableSet() {\n\t\tthis.lineImpetanz = this.initVariable(\"lineImpetance\", new NumericValue(0.1,0.2), EnumUnit.ohm, true, true);\r\n\t\tthis.lineCharge = this.initVariable(\"lineCharge\", new NumericValue(0), EnumUnit.ohm, true, true);\r\n\t\t\t\t\r\n\t}", "public void SetAllVariables(double NewValue) {\n DstQueue.SetAllVariables(NewValue);\n }", "private void initValues()\n {\n this.viewToolBar.setSelected(\n ConfigurationUtils.isChatToolbarVisible());\n\n this.viewSmileys.setSelected(\n ConfigurationUtils.isShowSmileys());\n\n this.chatSimpleTheme.setSelected(\n ConfigurationUtils.isChatSimpleThemeEnabled());\n }", "private void setAllParameters(int len) {\n\t\t\tshowUPLMN = new String[len] ;\n\t\t\toriginalUPLMN = new String[len] ;\n\t\t\tstrUorG = new String[len] ;\n\t\t\tpart = new byte[len][];\n\t\t\torder = new int[len];\n\t\t\tfor(int i=0;i<len;i++){\n\t\t\t\t part[i] = new byte[6];\n\t\t\t}\n\t\t}", "private void setViews() {\n\n TextView currentApixu = findViewById(R.id.currentApixu);\n TextView currentOwm = findViewById(R.id.currentOwm);\n TextView currentWu = findViewById(R.id.currentWu);\n\n currentApixu.setText(feedValues[0]);\n currentOwm.setText(feedValues[1]);\n currentWu.setText(feedValues[2]);\n }", "public static void setGlobalsToDefaults(){\r\n\t\tGlobals.globalvars.put(\"gamestage\", \"none\");\r\n\t\tGlobals.globalvars.put(\"cleft\", 0);\r\n\t\t\r\n\t\tInteger[] prematch = {64, 20};\r\n \tGlobals.cdpresets.put(\"pregame\", prematch);\r\n \tInteger[] getready = {5, 1200};\r\n \tGlobals.cdpresets.put(\"prepare\", getready);\r\n \tInteger[] battle = {10, 1200};\r\n \tGlobals.cdpresets.put(\"fight\", battle);\r\n \t\r\n \tGlobals.countdowns.clear();\r\n \tGlobals.lobby.clear();\r\n\t}", "public void setToStructure() {\n workbookStudy.setStudy(studyView);\n workbookStudy.setConditions(conditions);\n workbookStudy.setStudyConditions(studyConditions);\n workbookStudy.setFactors(factorsView);\n workbookStudy.setConstants(constants);\n workbookStudy.setVariates(variates);\n workbookStudy.setGermplasmData(germplasmData);\n }", "public void baiscSetting(){\n generations_ = 0;\n maxGenerations_ = ((Integer) this.getInputParameter(\"maxGenerations\")).intValue();\n populationSize_ = ((Integer) this.getInputParameter(\"populationSize\")).intValue();\n mutation_ = operators_.get(\"mutation\");\n crossover_ = operators_.get(\"crossover\");\n selection_ = operators_.get(\"selection\");\n learning_ = operators_.get(\"learning\");\n\n }", "private void initializeVariable() {\n\n\t\tlearn = (Button) findViewById(R.id.learnButton);\n\t\tlearn.setOnClickListener(this);\n\t\tplay = (Button) findViewById(R.id.playButton);\n\t\tplay.setOnClickListener(this);\n\t\tmode = (Button) findViewById(R.id.b_mode);\n\t\tmode.setOnClickListener(this);\n\t\tmode.setText(Global.currentMode + \" MODE\");\n\t\tclassID_SD = \"com.example.northamericanwildlifesounds.SOUNDDISPLAY\";\n\t\tsetUpAnimalData();\n\t}", "protected void initialize() {\r\n x = 0;\r\n y = 0;\r\n driveTrain.reInit();\r\n }", "protected void initialize() {\n\t\tright = left = throttle = turn = forward = 0;\n\t}", "public final void resetSystemVars() {\n if (CMLib.lang() != null)\n CMLib.lang().setLocale(getStr(\"LANGUAGE\"), getStr(\"COUNTRY\"));\n\n TIME_TICK = getLong(\"TICKTIME\");\n if (TIME_TICK < 500)\n TIME_TICK = 4000;\n TIME_TICK_DOUBLE = TIME_TICK;\n TICKS_PER_RLMIN = (int) Math.round(60000.0 / TIME_TICK_DOUBLE);\n TICKS_PER_RLHOUR = TICKS_PER_RLMIN * 60;\n TICKS_PER_RLDAY = TICKS_PER_RLHOUR * 24;\n MILLIS_PER_MUDHOUR = getLong(\"MILLISPERMUDHOUR\");\n if (MILLIS_PER_MUDHOUR < TIME_TICK)\n MILLIS_PER_MUDHOUR = 600000;\n\n final List<String> privateList = CMParms.parseCommas(getStr(\"PRIVATERESOURCES\").toUpperCase(), true);\n privateSet.clear();\n for (final String s : privateList)\n privateSet.put(s.trim(), Thread.currentThread().getThreadGroup());\n\n setVar(Str.BADNAMES, getStr(\"BADNAMES\"));\n setVar(Str.MULTICLASS, getStr(\"CLASSSYSTEM\"));\n setVar(Str.PKILL, getStr(\"PLAYERKILL\"));\n setVar(Str.PLAYERDEATH, getStr(\"PLAYERDEATH\"));\n setVar(Str.ITEMLOOTPOLICY, getStr(\"ITEMLOOTPOLICY\"));\n setVar(Str.MOBDEATH, getStr(\"MOBDEATH\"));\n setVar(Str.PLAYERFLEE, getStr(\"FLEE\"));\n setVar(Str.SHOWDAMAGE, getStr(\"SHOWDAMAGE\"));\n setVar(Str.EMAILREQ, getStr(\"EMAILREQ\"));\n setVar(Str.ESC0, getStr(\"ESCAPE0\"));\n setVar(Str.ESC1, getStr(\"ESCAPE1\"));\n setVar(Str.ESC2, getStr(\"ESCAPE2\"));\n setVar(Str.ESC3, getStr(\"ESCAPE3\"));\n setVar(Str.ESC4, getStr(\"ESCAPE4\"));\n setVar(Str.ESC5, getStr(\"ESCAPE5\"));\n setVar(Str.ESC6, getStr(\"ESCAPE6\"));\n setVar(Str.ESC7, getStr(\"ESCAPE7\"));\n setVar(Str.ESC8, getStr(\"ESCAPE8\"));\n setVar(Str.ESC9, getStr(\"ESCAPE9\"));\n setVar(Str.MSPPATH, getStr(\"SOUNDPATH\"), false);\n setVar(Str.AUTOPURGE, getStr(\"AUTOPURGE\"));\n setIntVar(Int.ACCOUNTPURGEDAYS, getStr(\"ACCOUNTPURGE\"), 14);\n setVar(Str.IDLETIMERS, getStr(\"IDLETIMERS\"));\n setVar(Str.CORPSEGUARD, getStr(\"CORPSEGUARD\"));\n setUpLowVar(Str.MUDDOMAIN, getStr(\"DOMAIN\"));\n String adminEmail = getStr(\"ADMINEMAIL\");\n if ((adminEmail == null) || (adminEmail.trim().length() == 0))\n adminEmail = getStr(\"I3EMAIL\");\n setVar(Str.ADMINEMAIL, adminEmail);\n setUpLowVar(Str.I3ROUTERS, getStr(\"I3ROUTERS\"));\n setVar(Str.AUTOREACTION, getStr(\"AUTOREACTION\"));\n setVar(Str.WIZLISTMASK, getStr(\"WIZLISTMASK\"));\n setUpLowVar(Str.DEFAULTPARENTAREA, getStr(\"DEFAULTPARENTAREA\"));\n setUpLowVar(Str.CLANWEBSITES, getStr(\"CLANWEBSITES\"));\n setVar(Str.CHANNELBACKLOG, getStr(\"CHANNELBACKLOG\"));\n setUpLowVar(Str.CLANFORUMDATA, getStr(\"CLANFORUMDATA\"));\n setUpLowVar(Str.STARTINGITEMS, getStr(\"STARTINGITEMS\", \"1 Waterskin, 1 Ration, 1 Torch\"));\n setVar(Str.PREJUDICE, getStr(\"PREJUDICE\"));\n setUpLowVar(Str.PRICEFACTORS, getStr(\"PRICEFACTORS\"));\n setVar(Str.IGNOREMASK, getStr(\"IGNOREMASK\"));\n setVar(Str.BUDGET, getStr(\"BUDGET\"));\n setVar(Str.DEVALUERATE, getStr(\"DEVALUERATE\"));\n setVar(Str.INVRESETRATE, getStr(\"INVRESETRATE\"));\n setVar(Str.AUCTIONRATES, getStr(\"AUCTIONRATES\", \"0,10,0.1%,10%,5%,1,168\"));\n setUpLowVar(Str.DEFAULTPROMPT, getStr(\"DEFAULTPROMPT\"));\n String promptBehavior = getStr(\"PROMPTBEHAVIOR\", \"NORMAL\");\n promptSuffix = new byte[0];\n if (!promptBehavior.equalsIgnoreCase(\"NORMAL\") && promptBehavior.length() > 0) {\n for (int i = 0; i < promptBehavior.length() - 1; i += 2) {\n final String cStr = promptBehavior.substring(i, i + 2);\n if (cStr.equalsIgnoreCase(\"CR\")) {\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + 1);\n promptSuffix[promptSuffix.length - 1] = (byte) '\\n';\n } else if (cStr.equalsIgnoreCase(\"LF\")) {\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + 1);\n promptSuffix[promptSuffix.length - 1] = (byte) '\\r';\n } else if (cStr.equalsIgnoreCase(\"GA\")) {\n final int pos = promptSuffix.length;\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + Session.TELNETGABYTES.length);\n System.arraycopy(Session.TELNETGABYTES, 0, promptSuffix, pos, Session.TELNETGABYTES.length);\n } else {\n final int pos = promptSuffix.length;\n byte[] bytes;\n try {\n bytes = cStr.trim().getBytes(getVar(Str.CHARSETINPUT));\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + bytes.length);\n System.arraycopy(bytes, 0, promptSuffix, pos, bytes.length);\n } catch (UnsupportedEncodingException e) {\n }\n }\n }\n }\n for (final ListFile lfVar : ListFile.values()) {\n sysLstFileLists[lfVar.ordinal()] = null;\n sysLstFileSet[lfVar.ordinal()] = null;\n }\n setVar(Str.EMOTEFILTER, getStr(\"EMOTEFILTER\"));\n p().emoteFilter.clear();\n p().emoteFilter.addAll(CMParms.parse((getStr(\"EMOTEFILTER\")).toUpperCase()));\n setVar(Str.POSEFILTER, getStr(\"POSEFILTER\"));\n setVar(Str.STATCOSTS, getStr(\"STATCOSTS\", \"<18 1, <22 2, <25 3, <99 5\"));\n setVar(Str.REMORTMASK, getStr(\"REMORTMASK\", \"-LEVEL +>60\"));\n setVar(Str.REMORTRETAIN, getStr(\"REMORTRETAIN\", \"SKILLSAT100\"));\n\n p().poseFilter.clear();\n p().poseFilter.addAll(CMParms.parse((getStr(\"POSEFILTER\")).toUpperCase()));\n setVar(Str.SAYFILTER, getStr(\"SAYFILTER\"));\n p().sayFilter.clear();\n p().sayFilter.addAll(CMParms.parse((getStr(\"SAYFILTER\")).toUpperCase()));\n setVar(Str.CHANNELFILTER, getStr(\"CHANNELFILTER\"));\n p().channelFilter.clear();\n p().channelFilter.addAll(CMParms.parse((getStr(\"CHANNELFILTER\")).toUpperCase()));\n setVar(Str.CLANTROPAREA, getStr(\"CLANTROPAREA\"));\n setVar(Str.CLANTROPCP, getStr(\"CLANTROPCP\"));\n setVar(Str.CLANTROPEXP, getStr(\"CLANTROPEXP\"));\n setVar(Str.CLANTROPPK, getStr(\"CLANTROPPK\"));\n setVar(Str.CLANTROPMB, getStr(\"CLANTROPMB\"));\n setVar(Str.CLANTROPLVL, getStr(\"CLANTROPLVL\"));\n setVar(Str.COLORSCHEME, getStr(\"COLORSCHEME\"));\n setUpLowVar(Str.SMTPSERVERNAME, getStr(\"SMTPSERVERNAME\"));\n setVar(Str.EXPCONTACTLINE, getStr(\"EXPCONTACTLINE\"));\n setVar(Str.AUTOWEATHERPARMS, getStr(\"AUTOWEATHERPARMS\"));\n setVar(Str.DEFAULTPLAYERFLAGS, getStr(\"DEFAULTPLAYERFLAGS\"));\n setUpLowVar(Str.AUTOAREAPROPS, getStr(\"AUTOAREAPROPS\"));\n setUpLowVar(Str.MXPIMAGEPATH, getStr(\"MXPIMAGEPATH\"));\n setBoolVar(Bool.ACCOUNTEXPIRATION, getStr(\"ACCOUNTEXPIRATION\").equalsIgnoreCase(\"YES\") ? true : false);\n setBoolVar(Bool.INTRODUCTIONSYSTEM, getStr(\"INTRODUCTIONSYSTEM\").equalsIgnoreCase(\"YES\") ? true : false);\n setBoolVar(Bool.HASHPASSWORDS, getStr(\"HASHPASSWORDS\").equalsIgnoreCase(\"YES\") ? true : false);\n setUpLowVar(Str.PREFACTIONS, getStr(\"FACTIONS\"));\n setUpLowVar(Str.CHARCREATIONSCRIPTS, getStr(\"CHARCREATIONSCRIPTS\"));\n setUpLowVar(Str.CHARSETINPUT, getStr(\"CHARSETINPUT\", \"iso-8859-1\"));\n setUpLowVar(Str.CHARSETOUTPUT, getStr(\"CHARSETOUTPUT\", \"iso-8859-1\"));\n setUpCosts(\"COMMONCOST\", commonCost, CMParms.parseCommas(getStr(\"COMMONCOST\", \"1 TRAIN\"), true));\n setUpCosts(\"SKILLCOST\", skillsCost, CMParms.parseCommas(getStr(\"SKILLCOST\", \"1 TRAIN\"), true));\n setUpCosts(\"LANGCOST\", languageCost, CMParms.parseCommas(getStr(\"LANGCOST\", \"3 PRACTICE\"), true));\n setVar(Str.RACEMIXING, getStr(\"RACEMIXING\"));\n String[] hungerCodes = CMParms.parseCommas(getStr(\"HUNGER\", \"500,100,100\"), true).toArray(new String[3]);\n setIntVar(Int.HUNGER_FULL, hungerCodes.length > 0 ? CMath.s_int(hungerCodes[0]) : 500);\n setIntVar(Int.HUNGER_GAIN_PCT, hungerCodes.length > 1 ? CMath.s_int(CMStrings.deleteAllofChar(hungerCodes[1], '%')) : 100);\n setIntVar(Int.HUNGER_LOSS_PCT, hungerCodes.length > 2 ? CMath.s_int(CMStrings.deleteAllofChar(hungerCodes[2], '%')) : 100);\n String[] thirstCodes = CMParms.parseCommas(getStr(\"THIRST\", \"1000,100,100\"), true).toArray(new String[3]);\n setIntVar(Int.THIRST_FULL, thirstCodes.length > 0 ? CMath.s_int(thirstCodes[0]) : 500);\n setIntVar(Int.THIRST_GAIN_PCT, thirstCodes.length > 1 ? CMath.s_int(CMStrings.deleteAllofChar(thirstCodes[1], '%')) : 100);\n setIntVar(Int.THIRST_LOSS_PCT, thirstCodes.length > 2 ? CMath.s_int(CMStrings.deleteAllofChar(thirstCodes[2], '%')) : 100);\n setIntVar(Int.MOB_HP_BASE, CMath.s_int(getStr(\"MOB_HP_BASE\", \"11\")));\n\n setUpLowVar(Str.BLACKLISTFILE, getStr(\"BLACKLISTFILE\", \"/resources/ipblock.ini\"));\n setWhitelist(CMProps.WhiteList.CONNS, getStr(\"WHITELISTIPSCONN\"));\n setWhitelist(CMProps.WhiteList.LOGINS, getStr(\"WHITELISTLOGINS\"));\n setWhitelist(CMProps.WhiteList.NEWPLAYERS, getStr(\"WHITELISTIPSNEWPLAYERS\"));\n\n if (p().sysBools[Bool.MUDSHUTTINGDOWN.ordinal()] == null)\n p().sysBools[Bool.MUDSHUTTINGDOWN.ordinal()] = Boolean.FALSE;\n\n for (final StrList strListVar : StrList.values()) {\n final String list = getStr(strListVar.toString().toUpperCase().trim());\n if ((list != null) && (list.trim().length() > 0))\n setListVar(strListVar, CMParms.parseCommas(list, false).toArray(new String[0]));\n }\n\n if (CMLib.color() != null)\n CMLib.color().clearLookups();\n if (getStr(\"MANACONSUMEAMT\").trim().equalsIgnoreCase(\"LEVEL\"))\n setIntVar(Int.MANACONSUMEAMT, -100);\n else if (getStr(\"MANACONSUMEAMT\").trim().equalsIgnoreCase(\"SPELLLEVEL\"))\n setIntVar(Int.MANACONSUMEAMT, -200);\n else\n setIntVar(Int.MANACONSUMEAMT, CMath.s_int(getStr(\"MANACONSUMEAMT\").trim()));\n String s = getStr(\"COMBATSYSTEM\");\n if (\"queue\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.QUEUE.ordinal());\n else if (\"manual\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.MANUAL.ordinal());\n else if (\"turnbased\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.TURNBASED.ordinal());\n else\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.DEFAULT.ordinal());\n s = getStr(\"EQVIEW\");\n if (\"paragraph\".equalsIgnoreCase(s))\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_PARAGRAPH);\n else if (\"mixed\".equalsIgnoreCase(s))\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_MIXED);\n else\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_DEFAULT);\n s = getStr(\"EXVIEW\");\n if (\"brief\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_BRIEF);\n else if (\"paragraph\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_PARAGRAPH);\n else if (\"mixed\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_MIXED);\n else\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_DEFAULT);\n\n s = getStr(\"EXPIRATIONS\");\n List<String> V = CMParms.parseCommas(s, false);\n for (int i = 0; i < 5; i++) {\n final int ordNum = Int.EXPIRE_MONSTER_EQ.ordinal() + i;\n final Int expEnum = Int.values()[ordNum];\n if (V.size() > 0) {\n setIntVar(expEnum, V.get(0));\n V.remove(0);\n } else\n switch (expEnum) {\n case EXPIRE_MONSTER_EQ:\n setIntVar(Int.EXPIRE_MONSTER_EQ, \"30\");\n break;\n case EXPIRE_PLAYER_DROP:\n setIntVar(Int.EXPIRE_PLAYER_DROP, \"1200\");\n break;\n case EXPIRE_RESOURCE:\n setIntVar(Int.EXPIRE_RESOURCE, \"60\");\n break;\n case EXPIRE_MONSTER_BODY:\n setIntVar(Int.EXPIRE_MONSTER_BODY, \"30\");\n break;\n case EXPIRE_PLAYER_BODY:\n setIntVar(Int.EXPIRE_PLAYER_BODY, \"1330\");\n break;\n default:\n break;\n }\n }\n\n setIntVar(Int.MANACONSUMETIME, getStr(\"MANACONSUMETIME\"));\n setIntVar(Int.PAGEBREAK, getStr(\"PAGEBREAK\"));\n setIntVar(Int.CLANENCHCOST, getStr(\"CLANENCHCOST\"));\n setIntVar(Int.FOLLOWLEVELDIFF, getStr(\"FOLLOWLEVELDIFF\"));\n setIntVar(Int.EXPRATE, getStr(\"EXPRATE\"));\n setIntVar(Int.SKYSIZE, getStr(\"SKYSIZE\"));\n setIntVar(Int.MAXSTAT, getStr(\"MAXSTATS\"));\n setIntVar(Int.BASEMAXSTAT, getStr(\"BASEMAXSTAT\", \"18\"));\n setIntVar(Int.BASEMINSTAT, getStr(\"BASEMINSTAT\", \"3\"));\n setIntVar(Int.STARTSTAT, getStr(\"STARTSTAT\"));\n setIntVar(Int.DEFCMDTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCMDTIME\"), p().cmdActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMCMDTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMCMDTIME\"), p().cmdComActionCostExceptions) * 100.0));\n setIntVar(Int.DEFABLETIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFABLETIME\"), p().skillActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMABLETIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMABLETIME\"), p().skillComActionCostExceptions) * 100.0));\n setIntVar(Int.DEFSOCTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFSOCTIME\"), p().socActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMSOCTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMSOCTIME\"), p().socComActionCostExceptions) * 100.0));\n setIntVar(Int.MANACOST, (int) CMProps.setExceptionCosts(getStr(\"MANACOST\"), p().skillMaxManaExceptions));\n setIntVar(Int.MANAMINCOST, (int) CMProps.setExceptionCosts(getStr(\"MANAMINCOST\"), p().skillMinManaExceptions));\n setIntVar(Int.EDITORTYPE, (getStr(\"EDITORTYPE\").equalsIgnoreCase(\"WIZARD\")) ? 1 : 0);\n setIntVar(Int.MINCLANMEMBERS, getStr(\"MINCLANMEMBERS\"));\n setIntVar(Int.MAXCLANMEMBERS, getStr(\"MAXCLANMEMBERS\"));\n setIntVar(Int.CLANCOST, getStr(\"CLANCOST\"));\n setIntVar(Int.DAYSCLANDEATH, getStr(\"DAYSCLANDEATH\"));\n setIntVar(Int.DAYSCLANOVERTHROW, getStr(\"DAYSCLANOVERTHROW\", \"952\"));\n setIntVar(Int.MINCLANLEVEL, getStr(\"MINCLANLEVEL\"));\n setIntVar(Int.LASTPLAYERLEVEL, getStr(\"LASTPLAYERLEVEL\"));\n setIntVar(Int.JOURNALLIMIT, getStr(\"JOURNALLIMIT\"));\n setIntVar(Int.MUDTHEME, getStr(\"MUDTHEME\"));\n setIntVar(Int.TRIALDAYS, getStr(\"TRIALDAYS\"));\n setIntVar(Int.MAXCONNSPERIP, getStr(\"MAXCONNSPERIP\"));\n setIntVar(Int.MAXCONNSPERACCOUNT, getStr(\"MAXCONNSPERACCOUNT\"));\n setIntVar(Int.MAXNEWPERIP, getStr(\"MAXNEWPERIP\"));\n setIntVar(Int.JSCRIPTS, getStr(\"JSCRIPTS\"));\n setIntVar(Int.RECOVERRATE, getStr(\"RECOVERRATE\"), 1);\n setIntVar(Int.COMMONACCOUNTSYSTEM, getStr(\"COMMONACCOUNTSYSTEM\"), 1);\n setIntVar(Int.OBJSPERTHREAD, getStr(\"OBJSPERTHREAD\"));\n setIntVar(Int.MAXCOMMONSKILLS, getStr(\"MAXCOMMONSKILLS\"), 0);\n setIntVar(Int.MAXCRAFTINGSKILLS, getStr(\"MAXCRAFTINGSKILLS\"), 2);\n setIntVar(Int.MAXNONCRAFTINGSKILLS, getStr(\"MAXNONCRAFTINGSKILLS\"), 5);\n setIntVar(Int.MAXLANGUAGES, getStr(\"MAXLANGUAGES\"), 3);\n setIntVar(Int.RACEEXPIRATIONDAYS, getStr(\"RACEEXPIRATIONDAYS\"), 365);\n setIntVar(Int.WALKCOST, getStr(\"WALKCOST\"), 1);\n setIntVar(Int.RUNCOST, getStr(\"RUNCOST\"), 2);\n setIntVar(Int.AWARERANGE, getStr(\"AWARERANGE\"), 0);\n setIntVar(Int.MINWORKERTHREADS, getStr(\"MINWORKERTHREADS\"), 1);\n setIntVar(Int.MAXWORKERTHREADS, getStr(\"MAXWORKERTHREADS\"), 100);\n setIntVar(Int.DUELTICKDOWN, getStr(\"DUELTICKDOWN\"), 5);\n V = CMParms.parseCommas(getStr(\"MAXCLANCATS\"), true);\n p().maxClanCatsMap.clear();\n for (final String cat : V) {\n if (CMath.isInteger(cat.trim()))\n p().maxClanCatsMap.put(\"\", Integer.valueOf(CMath.s_int(cat.trim())));\n else {\n final int x = cat.lastIndexOf(' ');\n if ((x > 0) && CMath.isInteger(cat.substring(x + 1).trim()))\n p().maxClanCatsMap.put(cat.substring(0, x).trim().toUpperCase(), Integer.valueOf(CMath.s_int(cat.substring(x + 1).trim())));\n }\n }\n if (!p().maxClanCatsMap.containsKey(\"\"))\n p().maxClanCatsMap.put(\"\", Integer.valueOf(1));\n\n p().publicClanCats.clear();\n V = CMParms.parseCommas(getStr(\"PUBLICCLANCATS\"), true);\n for (final String cat : V)\n p().publicClanCats.add(cat.trim().toUpperCase());\n p().publicClanCats.add(\"\");\n\n V = CMParms.parseCommas(getStr(\"INJURYSYSTEM\"), true);\n setIntVar(Int.INJPCTCHANCE, (V.size() > 0) ? CMath.s_int(V.get(0)) : 100);\n setIntVar(Int.INJPCTHP, (V.size() > 1) ? CMath.s_int(V.get(1)) : 40);\n setIntVar(Int.INJPCTHPAMP, (V.size() > 2) ? CMath.s_int(V.get(2)) : 10);\n setIntVar(Int.INJPCTCHANCEAMP, (V.size() > 3) ? CMath.s_int(V.get(3)) : 100);\n setIntVar(Int.INJMULTIPLIER, (V.size() > 4) ? CMath.s_int(V.get(4)) : 4);\n setIntVar(Int.INJMINLEVEL, (V.size() > 5) ? CMath.s_int(V.get(5)) : 10);\n setIntVar(Int.INJBLEEDMINLEVEL, (V.size() > 6) ? CMath.s_int(V.get(6)) : 15);\n setIntVar(Int.INJBLEEDPCTHP, (V.size() > 7) ? CMath.s_int(V.get(7)) : 20);\n setIntVar(Int.INJBLEEDPCTCHANCE, (V.size() > 8) ? CMath.s_int(V.get(8)) : 100);\n\n List<String> prowesses = CMParms.parseCommas(getStr(\"PROWESSOPTIONS\"), true);\n int prowValue = Int.Prowesses.ARMOR_ABSOLUTE.value |\n Int.Prowesses.ARMOR_NUMBER.value |\n Int.Prowesses.COMBAT_ABSOLUTE.value |\n Int.Prowesses.COMBAT_NUMBER.value;\n if (prowesses.size() > 0) {\n prowValue = 0;\n for (String prow : prowesses) {\n final Int.Prowesses P = (Int.Prowesses) CMath.s_valueOf(Int.Prowesses.class, prow.toUpperCase().replace('-', '_').trim());\n if (P == null)\n Log.errOut(\"CMProps\", \"Invalid PROWESSOPTIONS value: \" + prow);\n else if (P.value == 0)\n prowValue = 0;\n else\n prowValue |= P.value;\n }\n }\n setIntVar(Int.COMBATPROWESS, prowValue);\n\n String stateVar = getStr(\"STARTHP\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTHP, CMath.s_int(stateVar));\n stateVar = getStr(\"STARTMANA\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTMANA, CMath.s_int(stateVar));\n stateVar = getStr(\"STARTMOVE\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTMOVE, CMath.s_int(stateVar));\n\n setIntVar(Int.MAXITEMSHOWN, getStr(\"MAXITEMSHOWN\"));\n setIntVar(Int.MUDSTATE, getStr(\"MUDSTATE\"));\n\n setUpLowVar(Str.FORMULA_ATTACKADJUSTMENT, getStr(\"FORMULA_ATTACKADJUSTMENT\", \"(50+@x1+(((@x2-9)/5)*((@x3-9)/5)*((@x3-9)/5))+@x4)-(0.15*@xx*@x5)-(0.15*@xx*@x6)-(0.3*@xx*@x7)\"));\n setUpLowVar(Str.FORMULA_ARMORADJUSTMENT, getStr(\"FORMULA_ARMORADJUSTMENT\", \"(@x1-( (((@x2-9)/5)*((@x3-9)/5)*((@x3-9)/5*@x8)) +(@x4*@x8)-(0.15*@xx>0*@x5)-(0.15*@xx>0*@x6)-(0.3*@xx>0*@x7)*@x9))-100\"));\n setUpLowVar(Str.FORMULA_ATTACKFUDGEBONUS, getStr(\"FORMULA_ATTACKFUDGEBONUS\", \"@x3 * (@x1 - @x2)* (@x1 - @x2)\"));\n setUpLowVar(Str.FORMULA_PVPATTACKFUDGEBONUS, getStr(\"FORMULA_PVPATTACKFUDGEBONUS\", getVar(Str.FORMULA_ATTACKFUDGEBONUS)));\n setUpLowVar(Str.FORMULA_CHANCESPELLCRIT, getStr(\"FORMULA_CHANCESPELLCRIT\", \"(( ((@x2-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5) ))\"));\n setUpLowVar(Str.FORMULA_PVPCHANCESPELLCRIT, getStr(\"FORMULA_PVPCHANCESPELLCRIT\", getVar(Str.FORMULA_CHANCESPELLCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGESPELLCRIT, getStr(\"FORMULA_DAMAGESPELLCRIT\", \"(@x1*( ((@x2-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5) )/100.0)+(@x4/2)\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGESPELLCRIT, getStr(\"FORMULA_PVPDAMAGESPELLCRIT\", getVar(Str.FORMULA_DAMAGESPELLCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGESPELLFUDGE, getStr(\"FORMULA_DAMAGESPELLFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGESPELLFUDGE, getStr(\"FORMULA_PVPDAMAGESPELLFUDGE\", getVar(Str.FORMULA_DAMAGESPELLFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGEMELEEFUDGE, getStr(\"FORMULA_DAMAGEMELEEFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEMELEEFUDGE, getStr(\"FORMULA_PVPDAMAGEMELEEFUDGE\", getVar(Str.FORMULA_DAMAGEMELEEFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDFUDGE, getStr(\"FORMULA_DAMAGERANGEDFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGERANGEDFUDGE, getStr(\"FORMULA_PVPDAMAGERANGEDFUDGE\", getVar(Str.FORMULA_DAMAGERANGEDFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDTARGETED, getStr(\"FORMULA_DAMAGERANGEDTARGETED\", \"((1?@x1)+((@x3-@x4)/2.5)-(0.5*@xx*@x8)+(0.5*@xx*@x9)+(0.2*@xx*@x10)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGERANGEDTARGETED, getStr(\"FORMULA_PVPDAMAGERANGEDTARGETED\", getVar(Str.FORMULA_DAMAGERANGEDTARGETED)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDSTATIC, getStr(\"FORMULA_DAMAGERANGEDSTATIC\", \"((1?@x1)+((@x3-@x4)/2.5)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_DAMAGEMELEETARGETED, getStr(\"FORMULA_DAMAGEMELEETARGETED\", \"((1?@x1)+((@x2-10+@x3-@x4)/5)-(0.5*@xx*@x8)+(0.5*@xx*@x9)+(0.2*@xx*@x10)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEMELEETARGETED, getStr(\"FORMULA_PVPDAMAGEMELEETARGETED\", getVar(Str.FORMULA_DAMAGEMELEETARGETED)));\n setUpLowVar(Str.FORMULA_DAMAGEMELEESTATIC, getStr(\"FORMULA_DAMAGEMELEESTATIC\", \"((1?@x1)+((@x2-10+@x3-@x4)/5)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_CHANCEWEAPONCRIT, getStr(\"FORMULA_CHANCEWEAPONCRIT\", \"((((@x2-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)))\"));\n setUpLowVar(Str.FORMULA_PVPCHANCEWEAPONCRIT, getStr(\"FORMULA_PVPCHANCEWEAPONCRIT\", getVar(Str.FORMULA_CHANCEWEAPONCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGEWEAPONCRIT, getStr(\"FORMULA_DAMAGEWEAPONCRIT\", \"(@x1 * (((@x2-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5))/50.0)+(@x4/2)\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEWEAPONCRIT, getStr(\"FORMULA_PVPDAMAGEWEAPONCRIT\", getVar(Str.FORMULA_DAMAGEWEAPONCRIT)));\n setUpLowVar(Str.FORMULA_NPCHITPOINTS, getStr(\"FORMULA_NPCHITPOINTS\", \"3 + @x1 + (@x1 * @x2)\"));\n setUpLowVar(Str.FORMULA_HITPOINTRECOVER, getStr(\"FORMULA_HITPOINTRECOVER\", \"5+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0))*@x2/9.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_MANARECOVER, getStr(\"FORMULA_MANARECOVER\", \"25+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0) - (@xx*@x5/2.0))*@x2/50.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_MOVESRECOVER, getStr(\"FORMULA_MOVESRECOVER\", \"25+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0) - (@xx*@x5/2.0))*@x2/10.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) + (@xx/4.0*@x8) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_TOTALCOMBATXP, getStr(\"FORMULA_TOTALCOMBATXP\", \"100 + ((25*@x1) - (@x1*((25*@x1)^.5)))\"));\n setUpLowVar(Str.FORMULA_INDCOMBATXP, getStr(\"FORMULA_INDCOMBATXP\", \"(@x1 * (@x2 / @x3)) < 100\"));\n\n final LanguageLibrary lang = CMLib.lang();\n Directions.instance().reInitialize(getInt(\"DIRECTIONS\"), new Directions.DirectionWordTranslator() {\n @Override\n public String translate(String string) {\n return lang.L(string);\n }\n });\n\n resetSecurityVars();\n statCodeExtensions = getStrsStarting(\"EXTVAR_\");\n\n // initialized elsewhere\n if (getVar(Str.MAILBOX) == null) {\n setVar(Str.MAILBOX, \"\");\n setIntVar(Int.MAXMAILBOX, 0);\n setBoolVar(Bool.EMAILFORWARDING, false);\n }\n\n CMLib.propertiesLoaded();\n this.lastReset = System.currentTimeMillis();\n }", "protected void initialize() {\n \tsetSetpoint(0.0);\n }", "private void setData() {\n populateInterfaceElements();\n }", "private void set(){\n resetBuffer();\n }", "private void init() {\n setMinutes(new int[] {});\n setHours(new int[] {});\n setDaysOfMonth(new int[] {});\n setMonths(new int[] {});\n setDaysOfWeek(new int[] {});\n }", "private void setAllSliders() {\n setSliderValue(speedSlider, speedTF, 24);\n }", "private void initVar() {\n\n sTextLD = sTextMLD;\n\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 init_settings() {\n\t\tSettings.setDifficulty(Difficulty.NORMAL);\n\t\tSettings.setGravity(BowmanConstants.DEFAULT_GRAVITY);\n\t}", "private void SetUp() {\n numbers.add(0);\n numbers.add(1);\n numbers.add(2);\n numbers.add(3);\n numbers.add(4);\n numbers.add(5);\n numbers.add(6);\n numbers.add(7);\n numbers.add(8);\n numbers.add(9);\n\n PuzzleSolve(10, empty, numbers);\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 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}", "private void initializeVariables() {\n rnd = new Random();\n\n pieceKind = rnd.nextInt() % 7;\n if(pieceKind < 0) pieceKind *= -1;\n pieceKind2 = rnd.nextInt() % 7;\n if(pieceKind2 < 0) pieceKind2 *= -1;\n\n piece = new Piece(pieceKind,this);\n newPiece();\n startedGame = true;\n\n for(i=0; i<276; i++) {\n modulo = i%12;\n if(modulo == 0 || modulo == 11 || i>251) {\n matrix[i] = 0; colMatrix[i] = true;\n } else {\n matrix[i] = -1; colMatrix[i] = false;\n }\n }\n\n for(i=0; i<5; i++) completeLines[i] = -1;\n for(i=0; i<4; i++) keybl.setMovTable(i, false);\n }", "protected void initialize() {\n\t\tthis.position = Point3D.ZERO;\n\t\t// reset subclasses properties if any\n\t\treset();\n\t}", "private void setup() {\n\t\tpopulateEntitiesLists();\n\t\t// rayHandler.setCombinedMatrix(batch.getProjectionMatrix());\n\t\tambientColor = Color.CLEAR;\n\t\tsetAmbientAlpha(.3f);\n\t\tfpsLogger = new FPSLogger();\n\t\tdynamicEntities = new ArrayList<DynamicEntity>();\n\t\tfont.getData().setScale(DEBUG_FONT_SCALE);\n\t}", "private void ResetVarC() {\n anchura = true;\n iterator = 0;\n Yencoding = new ArrayList<Integer>();\n Cbencoding = new ArrayList<Integer>();\n Crencoding = new ArrayList<Integer>();\n FY = new StringBuilder();\n FCB = new StringBuilder();\n FCR = new StringBuilder();\n }", "private void setDefaults() {\n\t\tequipActions = new String[] { \"Remove\", null, \"Operate\", null, null };\n\t\tmodelId = 0;\n\t\tname = null;\n\t\tdescription = null;\n\t\tmodifiedModelColors = null;\n\t\toriginalModelColors = null;\n\t\tmodifiedTextureColors = null;\n\t\toriginalTextureColors = null;\n\t\tmodelZoom = 2000;\n\t\tmodelRotation1 = 0;\n\t\tmodelRotation2 = 0;\n\t\tmodelRotationY = 0;\n\t\tmodelOffset1 = 0;\n\t\tmodelOffset2 = 0;\n\t\tstackable = false;\n\t\tvalue = 1;\n\t\tmembersObject = false;\n\t\tgroundOptions = new String[5];\n\t\tinventoryOptions = new String[5];\n\t\tmaleModel = -1;\n\t\tanInt188 = -1;\n\t\tmaleOffset = 0;\n\t\tfemaleModel = -1;\n\t\tanInt164 = -1;\n\t\tfemaleOffset = 0;\n\t\tanInt185 = -1;\n\t\tanInt162 = -1;\n\t\tanInt175 = -1;\n\t\tanInt166 = -1;\n\t\tanInt197 = -1;\n\t\tanInt173 = -1;\n\t\tstackIDs = null;\n\t\tstackAmounts = null;\n\t\tcertID = -1;\n\t\tcertTemplateID = -1;\n\t\tanInt167 = 128;\n\t\tanInt192 = 128;\n\t\tanInt191 = 128;\n\t\tanInt196 = 0;\n\t\tanInt184 = 0;\n\t\tteam = 0;\n\n\t\topcode140 = -1;\n\t\topcode139 = -1;\n\t\topcode148 = -1;\n\t\topcode149 = -1;\n\n\t\tsearchableItem = false;\n\t}", "void executionOver() {\n this.reporter = null;\n this.options = null;\n this.executorEngine = null;\n this.progressSuppressingEventHandler = null;\n this.outputService = null;\n this.buildActionMap = null;\n this.completedAndResetActions = null;\n this.lostDiscoveredInputsMap = null;\n this.actionCacheChecker = null;\n this.outputDirectoryHelper = null;\n }" ]
[ "0.721194", "0.71785975", "0.7007566", "0.6817126", "0.6787553", "0.67048275", "0.6651565", "0.6593213", "0.652849", "0.64866227", "0.6424035", "0.63744444", "0.6354946", "0.6306602", "0.63037974", "0.6262467", "0.62401193", "0.6212956", "0.61910295", "0.61717343", "0.6160302", "0.61419225", "0.61377704", "0.61340505", "0.612512", "0.6117188", "0.6108796", "0.6101951", "0.609254", "0.6090011", "0.6088802", "0.6070605", "0.6068092", "0.6064444", "0.6062684", "0.60626286", "0.60396177", "0.6038976", "0.6035808", "0.6021657", "0.6016148", "0.5988836", "0.5985512", "0.5984278", "0.5977878", "0.5972266", "0.5968025", "0.5956328", "0.59202754", "0.59187275", "0.5914926", "0.59148484", "0.5912675", "0.5910089", "0.5883014", "0.585628", "0.5848274", "0.5846034", "0.5840347", "0.5835772", "0.5832", "0.5826412", "0.582094", "0.58172905", "0.5816517", "0.58105075", "0.5809195", "0.5807437", "0.58037037", "0.5799792", "0.57715005", "0.576912", "0.57630336", "0.5761377", "0.5755959", "0.5754494", "0.57543945", "0.57414037", "0.5740217", "0.5738777", "0.5734183", "0.5730401", "0.5721712", "0.57211375", "0.571233", "0.5709729", "0.57042605", "0.570248", "0.56986", "0.5695219", "0.5690409", "0.56863207", "0.56863105", "0.56821793", "0.56724465", "0.5671653", "0.56715995", "0.56669116", "0.5652771", "0.5646882", "0.5645165" ]
0.0
-1
/"Hello"/ /'Hello'/ "Hello" I love "Java" and "Programming" 'I love "Java" and "Programming"'
public static void main(String[] args) { System.out.println("/\"Hello\"/"); System.out.println("/'Hello'/"); System.out.println("\"Hello\""); System.out.println("'I love \"Java\" and \"Programming\"'"); System.out.println(getXpath("Sandeep")); ////input[@id='Sandeep'] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void phraseConcatTest() {\n\t\tString query1 = \"\\\" hello my \\\"\";\n\t\tString query2 = \"\\\" I am the king \\\"\";\n\t\tString query3 = \"\\\" yes you are \\\" \";\n\t\t\n\t\tString query1Result = \"hello+my\";\n\t\tString query2Result = \"I+am+the+king\";\n\t\tString query3Result = \"yes+you+are\";\n\t\t\n\t\tassertEquals(query1Result, queryTest.fixPhrases(query1));\n\t\tassertEquals(query2Result, queryTest.fixPhrases(query2));\n\t\tassertEquals(query3Result, queryTest.fixPhrases(query3));\n\t}", "@Test\n\tpublic void queryTest() {\n\t\tString query1 = \"(\\\"hello my name is\\\" & my | (!no & yes))\";\n\t\tString query2 = \"(hello & (\\\"yes sir\\\") | !no)\";\n\t\tString query3 = \"\\\"bob dylan\\\" ( big boy | toy ) & \\\"named troy\\\"\";\n\t\tString query4 = \"test \\\"quan what does\\\"\";\n\t\t\n\t\tString query1Result = \"hello+my+name+is my & !no yes & |\";\n\t\tString query2Result = \"hello yes+sir & !no |\";\n\t\tString query3Result = \"bob+dylan big boy & toy | & named+troy &\";\n\t\tString query4Result = \"test quan+what+does &\";\n\t\t\n\t\tassertEquals(query1Result, String.join(\" \", queryTest.getPostFix(query1)));\n\t\tassertEquals(query2Result, String.join(\" \", queryTest.getPostFix(query2)));\n\t\tassertEquals(query3Result, String.join(\" \", queryTest.getPostFix(query3)));\n\t\tassertEquals(query4Result, String.join(\" \", queryTest.getPostFix(query4)));\n\t}", "private static String getSingleText(CommonToken token, String name1, String name2) {\n String input = token.getText();\n\n if (StringUtils.containsWhitespace(input)) return input;\n if (\",\".equals(input)) return \" AND \";\n return name1 + \".\" + input + \"=\" + name2 + \".\" + input;\n }", "public static void main(String arg[]) {\n String frase1 = \"Había vez circo alegraba el\";\n String frase2 = \"una un que siempre carazón sin temer jamás\";\n String frase3 = \"\";\n\n int inicio1 = 0;\n int fin1 = frase1.indexOf(\" \");\n int inicio2 = 0;\n int fin2 = frase2.indexOf(\" \");\n\n while ((fin1 != -1) || (fin2 != -1)) {\n if (fin1 != -1) {\n frase3 = frase3.concat(frase1.substring(inicio1, fin1 + 1));\n inicio1 = fin1 + 1;\n fin1 = frase1.indexOf(\" \", inicio1);\n }\n if (fin2 != -1) {\n frase3 = frase3.concat(frase2.substring(inicio2, fin2 + 1));\n inicio2 = fin2 + 1;\n fin2 = frase2.indexOf(\" \", inicio2);\n }\n }\n System.out.println(frase3);\n }", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "Rule DoubleQuotedLiteral() {\n return Sequence(\n \"\\\"\",\n ZeroOrMore(NoneOf(\"\\\"\")),\n \"\\\"\");\n }", "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "final public IASTLiteralTextNode LanguageVariantsQuotedStringArgument() throws ParseException {\r\n IASTLiteralTextNode node = null;\r\n Token token = null;\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case AMPERSAND:\r\n jj_consume_token(AMPERSAND);\r\n break;\r\n default:\r\n jj_la1[19] = jj_gen;\r\n ;\r\n }\r\n token = jj_consume_token(STRING);\r\n node = getRawLiteralTextNodeSpanning(token, token);\r\n {if (true) return node;}\r\n throw new Error(\"Missing return statement in function\");\r\n }", "@Test\n public void noSpacesBetweenKeywordsTest() {\n tester.yields(\"LaLaLaLaLaaaLi\", lala.EXPRESSION);\n }", "public String catchPhrase() {\n @SuppressWarnings(\"unchecked\") List<List<String>> catchPhraseLists = (List<List<String>>) faker.fakeValuesService().fetchObject(\"company.buzzwords\");\n return joinSampleOfEachList(catchPhraseLists, \" \");\n }", "public static void main(String[] args) {\n\t\tStringJoiner joiner=new StringJoiner(\" and \",\"{\",\"}\");\n\t\tjoiner.add(\"python\");\n\t\tjoiner.add(\"java\");\n\t\tjoiner.add(\"c\");\n\t\tjoiner.add(\"c++\").add(\"html\").add(\"css\").add(\"js\");\n\t\tString s=joiner.toString();\n\t\tSystem.out.println(s);\n\t\tString s1=\"asd ad ad vxczvz\";\n\t\tSystem.out.println(s1.lastIndexOf(\" \"));\n\t\tSystem.out.println(s1.substring(s1.lastIndexOf(\" \")));\n\t\t\n\t\tStringJoiner joiner1=new StringJoiner(\" and \",\"[\",\"]\");\n\t\tjoiner1.add(\"asdsa\").add(\"rgrg\").add(\"grger\");\n\t\tSystem.out.println(joiner1);\n\t\tjoiner.merge(joiner1);\n\t\tSystem.out.println(joiner);\n\t}", "private String doubleQuote( String raw ) { return '\"' + raw + '\"'; }", "public String quotate(String content){\n\n return \"'\"+content+\"'\";\n }", "public void firstSem2a6(){\n chapter = \"firstSem2a6\";\n String firstSem2a6 = \"\\\"Well? Are we friends, like that guy said?\\\"\";\n getTextIn(firstSem2a6);\n }", "private String containingWord(String attribute, String word) {\r\n return \"contains(concat(' ',normalize-space(@\" + attribute + \"),' '),' \"\r\n + word + \" ')\";\r\n }", "String processing();", "public void testStrings()\n {\n final ReportStringWriter rptr = new ReportStringWriter();\n\n final StringBuffer sb = new StringBuffer()\n .append(\"Cat food\").append('\\n');\n final Reader netRdr = new StringReader(sb.toString());\n final NamedEntityTree net = new NamedEntityTree();\n net.load(netRdr);\n\n StringReader txtRdr = new StringReader(\"Dog food. Eat more Cat food now.\");\n final Lexer lex = new Lexer();\n lex.load(txtRdr);\n lex.analyze();\n\n final Parser parser = new Parser();\n parser.parse(lex);\n\n net.recognize(rptr, net, 1, lex.getSymbolTable(), parser);\n\n assertEquals( \"ROOT:Cat:food\\n\",\n rptr.toString());\n }", "Rule SingleQuotedLiteral() {\n return Sequence(\n \"'\",\n ZeroOrMore(NoneOf(\"'\")),\n \"'\");\n }", "public void firstSem2a5(){\n chapter = \"firstSem2a5\";\n String firstSem2a5 = \"What about your friend here?\\\" he asks, nodding to \"+student.getRmName()+\". \\\"Oh, I'm good,\\\"\" +\n student.getRmName()+\"says quickly. I already have a job, through the underground Communist...uh, through\" +\n \" the school paper.\\\" You chat with the man a little longer before he excuses himself to go back to the \" +\n \"kitchen.\\tYou and \"+student.getRmName()+\" finish up your dinner and head back. About halfway there, your roommate \" +\n \"stops and peers at you intensely. \\\"Well?\\\" they say.\";\n getTextIn(firstSem2a5);\n }", "@Test\n public void testSpinTwoWords() {\n final String actualResult = kata4.spinWord(\"Hey fellow warriors\");\n final String expectedResult = \"Hey wollef sroirraw\";\n assertEquals(expectedResult, actualResult);\n }", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "@Override\n\tprotected void testForOpenDoubleQuotes() {\n\t}", "public static void main(String[] args) {\n\n String st = \"Java is a programming Language. Java is also an Island of Indonesia. Java is widely used language\";\n\n }", "public static void main(String[] args) {\nString s1 = \"java gg\";\nchar[] ch ={'g','r','d'};\nString s2 = new String(ch);\n//length\nSystem.out.println(s1.length());\nSystem.out.println(s2.length());\n//charAt\nchar c = s1.charAt(2);\nSystem.out.println(c);\n//String format\nString cd = String.format(\"value %32.11f\",32.5654);\nSystem.out.println(cd);\n//Substring.........start index starts with 0 and end index starts with 1\nSystem.out.println(s1.substring(1));\nSystem.out.println(s1.substring(1, 3));\n//Contains\nSystem.out.println(\"contains example\" +s1.contains(\"gg\"));\n//Join\nString joint = String.join(\"-\", \"Welcome\",\"to\",\"india\");\nSystem.out.println(joint);\n//Equals\nSystem.out.println(s1.equals(s2));\n//is empty\nSystem.out.println(s1.isEmpty());\n//Concat\ns1.concat(\"hello\");\nSystem.out.println(s1);\ns1 = s1.concat(\" home\");\nSystem.out.println(s1);\n//char replace\nString sf=\"javatpoint is a very good website\"; \nString replaceString=sf.replace('a','e');//replaces all occurrences of 'a' to 'e' \nSystem.out.println(replaceString);\n//charSequence replace\nString sg=\"my name is khan my name is java\"; \nString replaceString1=sg.replace(\"is\",\"was\");//replaces all occurrences of \"is\" to \"was\" \nSystem.out.println(replaceString1); \n// trim: string with omitted leading and trailing spaces\nString df = \" Hello java \";\nSystem.out.println(df+\"javapoint\");\nSystem.out.println(df.trim()+\"javapoint\");\n//Split\nString g1 = \"Strike with bang\";\nString[] words = g1.split(\"\\\\s\");//regular expression\nfor (String m:words){\n\tSystem.out.println(m);\n}\n\tfor(String m1:g1.split(\"\\\\s\", 2)){\n\t\tSystem.out.println(m1);\n\t}\n\t\n//indexof\n\tString sw1=\"this is index of example\"; \n\t//passing substring \n\tint index1=sw1.indexOf(\"dex o\");//returns the index of is substring \n\tint index2=sw1.indexOf(\"index\");//returns the index of index substring \n\tSystem.out.println(index1+\" \"+index2);//2 8 \n\t \n\t//passing substring with from index \n\tint index3=sw1.indexOf(\"is\",4);//returns the index of is substring after 4th index \n\tSystem.out.println(index3);//5 i.e. the index of another is \n\t \n\t//passing char value \n\tint index4=sw1.indexOf('x');//returns the index of s char value \n\tSystem.out.println(index4);//3 \n//To lower case\n\tString sf1=\"JAVATPOINT HELLO stRIng\"; \n\tString s1lower=sf1.toLowerCase(); \n\tSystem.out.println(s1lower); \n//To upper case\n\tString sf2 =\"john cenA\";\n\tSystem.out.println(sf2.toUpperCase());\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\t\n\t\t //1.Write a regex to split String by new line?\n\t\t String regex=\" \";\n\t\t String regex1=\"\\\\n+\"; //Split by new line\n\t\t \n\t\t String regex2=\"\\\\r?\"; //Split by new line also called carraiage return\n\t\t String regex3=\"\\\\r?\\\\n\";//Answer\n\t\t String s =\"subhash is \\n good \\n\\n boy\";\n\t\t String s1 =\"subhash is \\r good boy\";\n\t\t System.out.println(s1);\n\t\t String[] string = s.split(\"\\\\n\");\n\t\t String[] string1 = s.split(\"\\\\n?\");\n\t\t String[] string2 = s.split(\"\\\\n*\");\n\t\t String[] string3 = s.split(\"\\\\n+\");\n\t\t \n\t\t String[] string4 = s.split(\"\\\\n??\");\n\t\t String[] string5 = s.split(\"\\\\n*?\");\n\t\t String[] string6 = s.split(\"\\\\n+?\");\n\t\t \n\t\t String[] string7 = s.split(\"\\\\n?+\");\n\t\t String[] string8 = s.split(\"\\\\n*+\");\n\t\t String[] string9 = s.split(\"\\\\n++\");\n\t\t \n\t\t \n\t\t for(String ss: string)\n\t\t\t System.out.print(ss);\n\t\t \n\t\t //2.What is use of Dot(.) symbol in Java Regex? . represents any number of any characters\n\t\t \n\t\t //3. How to extract a substring using regex ? Example - String test = \"This is a test String and 'This is data we want'\"\n\t\t \n\t\t String input =\"This is a test String and 'This is data we want'\";\n\t\t Pattern pattern = Pattern.compile(\"(')(.*?)(')\");//reluctant quantifier\n\t\t Matcher matcher = pattern.matcher(input);\n\t\t \n\t\t while(matcher.find())\n\t\t {\n\t\t\t System.out.println(matcher.group(1)+matcher.group(2)+matcher.group(3));\n\t\t\t //'This is data we want'\n\t\t }\n\t\t \n\t\t /*\n\t\t \t\n\t\t \t*\t\t\tZero or more occurrences\t\t\t\t\t. * - Any sequence\n\t\t\t?\t\t\tZero or one occurrences(Optional)\t\t\t[0-9]? - Any optional digit\n\t\t\t+\t\t\tOne or more occurrences\t\t\t\t\t\t[0-9]+ - One or more digit\n\t\t\t{x}\t\t\tx instance of occurrences\t\t\t\t\tm{5} - Five instances of the letter m\n\t\t\t{x,y}\t\tbetween x and y instances of occurrences\t[0-9]{13,19} - Between 13 and 19 occurrences\n\t\t\t{x,}\t\tat least x instances of occurrences\t\t\t.{8,} - At least 8 characters\n\t\t \n\t\t \n\t\t */\n\t\t \n\t\t //4. What is difference between matches() and find() in Java Regex?\n\t\t //matches() returns true only if the whole string matches the specified pattern while find() returns trues even if a substring matches the pattern.\n\t\t \n\t\t \n\t\t //5.How to replace all non-alphanumeric characters with empty strings?\n\t\t \n\t\t \n\t\t System.out.println(\"a1A*()\".replaceAll(\"(?i)[a-z0-9]\",\"\"));//*()\n\t\t System.out.println(\"a1A*()\".replaceAll(\"[a-z0-9A-Z]\",\"\"));//*()\n\t\t \n\t\t \n\t\t \n\t\t //How to replace 2 or more spaces with single space in string and delete leading and trailing spaces?\n\t\t System.out.println(\"a b c \".replaceAll(\"\\\\s{1,}\",\" \").trim());\n\t\t \n\t\t //Create a regular expression that accepts alphanumeric characters only. Its length must be five characters long only\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"java1\"));//true- Matches check for the whole of input with the regex\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"subhad\"));//false\n\t\t \n\t\t //Create a regular expression that accepts 10 digit numeric characters starting with 1, 2 or 3 only.\n\t\t System.out.println(Pattern.matches(\"[123][0-9]{9}\", \"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[0-9]{9}\",\"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[\\\\d]{9}\",\"\"));\n\t\t \n\t\t \n\t\t //How to extract nos from a string\n\t\t List<Integer> list = new ArrayList<>();\n\t\t Pattern pattern1 = Pattern.compile(\"\\\\d+\");\n\t\t Matcher matcher1 = pattern1.matcher(\"1234dfdf4573dfdf5555d2fdf5555df55dfdfd513\");\n\t\t while(matcher1.find())\n\t\t {\n\t\t\t list.add(Integer.parseInt(matcher1.group()));\n\t\t }\n\t\t System.out.println();\n\t\t list.forEach(e->System.out.print(e+\":\"));// 1234:4573:5555:2:5555:55:513: one or more occurrence are grouped together \n\t\t System.out.println();\n\t\t \n\t\t //Pattern pattern1 = Pattern.compile(\"\\\\d\"); will print 1:2:3:4:4:5:7:3:5:5:5:5:2:5:5:5:5:5:5:5:1:3:\n\t\t \n\t\t \n\t\t System.out.println(\"***********\");\n\t\t //\tHow to split Java String by newlines?\n\t\t //\t\\r and \\n CR and LF used in windows\n\t\t \n\t\t \n\t\t String lines[]= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r?\\\\n]\");\n\t\t // lk::dfdf:sd:fsdf:zsff: this will check for each match of \\r or \\n and insert empty lines if there are consecutive line separators\n\t\t \n\t\t lines= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r\\\\n]+\");\n\t\t //lk:dfdf:sd:fsdf:zsff: - if you do not want empty lines\n\t\t \n\t\t //Importance of Pattern.compile()\n\t\t /*\n\t\t A regular expression, specified as a string, must first be compiled into an instance of Pattern class. \n\t\t Pattern.compile() method is the only way to create a instance of object. A typical invocation sequence is thus\n\t\t */\n\n\t\t \n\t\t \n\t\t System.out.println(Pattern.matches(\".s\", \"as\"));//true (2nd char is s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mk\"));//false (2nd char is not s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mst\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\".s\", \"amms\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\"..s\", \"mas\"));//true (3rd char is s) \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "public static void main (String args []) {\n\r\n String str = \"\\\"क\\\", \\\"का\\\", \\\"कि\\\", \\\"की\\\", \\\"कु\\\", \\\"कू\\\", \\\"के\\\", \\\"कै\\\", \\\"को\\\", \\\"कौ\\\", \\\"कं\\\", \\\"क:\\\"\" ;\r\n String strEng = \"\\\"ka\\\", \\\"kā\\\", \\\"ki\\\", \\\"kī\\\", \\\"ku\\\", \\\"kū\\\", \\\"kē\\\", \\\"kai\\\", \\\"ko\\\", \\\"kau\\\", \\\"kṁ\\\", \\\"ka:\\\"\" ;\r\n\r\n String additionalConsonants = \"\\\"क़\\\", \\\"क़ा\\\", \\\"क़ि\\\", \\\"क़ी\\\", \\\"क़ु\\\", \\\"क़ू\\\", \\\"क़े\\\", \\\"क़ै\\\", \\\"क़ो\\\", \\\"क़ौ\\\", \\\"क़ं\\\", \\\"क़:\\\"\"; \r\n String additionalConsonantsEng = \"\\\"qa\\\", \\\"qā\\\", \\\"qi\\\", \\\"qī\\\", \\\"qu\\\", \\\"qū\\\", \\\"qē\\\", \\\"qai\\\", \\\"qo\\\", \\\"qau\\\", \\\"qṁ\\\", \\\"qa:\\\"\" ;\r\n\r\n //String str = \"क, का, कि, की, कु, कू, के, कै, को, कौ, कं, क:\" ;\r\n \r\n \r\n \r\n //generateNP(str);\r\n //generateEN(strEng);\r\n //System.out.println();\r\n generateNPAdditionalConsonants(additionalConsonants);\r\n generateENAdditionalConsonants(additionalConsonantsEng);\r\n\r\n\r\n\r\n }", "public void testImapQuote() {\n \n // Simple strings should come through with simple quotes\n assertEquals(\"\\\"abcd\\\"\", Utility.imapQuoted(\"abcd\"));\n \n // Quoting internal double quotes with \\\n assertEquals(\"\\\"ab\\\\\\\"cd\\\"\", Utility.imapQuoted(\"ab\\\"cd\"));\n \n // Quoting internal \\ with \\\\\n assertEquals(\"\\\"ab\\\\\\\\cd\\\"\", Utility.imapQuoted(\"ab\\\\cd\"));\n }", "final public IASTListNode<IASTLiteralTextNode> LanguageVariantsQuotedStringArguments() throws ParseException {\r\n IASTListNode<IASTLiteralTextNode> args = null;\r\n args = LanguageVariantsQuotedStringArgumentList();\r\n if (args == null) {\r\n args = ASTFactory.createListNode(\",\");\r\n }\r\n ParserUtils.setSourceRangeForListNode(null, args, null);\r\n {if (true) return args;}\r\n throw new Error(\"Missing return statement in function\");\r\n }", "@Test\n\tpublic void test3()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: (spacex|spx)\\n\" +\n\t\t\t\"$webpage: {<a=$1> b=reddit}\",\n\t\t\texplodeRulesAndCreateString(\"webpage: a=(spacex|spx) b=reddit\")\n\t\t);\n\t}", "@Test\n\tpublic void test6()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\",\n\t\t\texplodeRulesAndCreateString(\"webpage: spacex (webpage|(web page))\")\n\t\t);\n\t}", "String applyQuote(String name);", "@Test\n public void spacesInKeywordTest() {\n tester.correct(\"Laaa Laaa Laaaa Li\" );\n }", "@Test\n void multiConstruct() {\n var multicons = \"(define conCar_a (cons 1 2))(define conCar_b (cons 3 conCar_a))(define conCar_c (cons conCar_b 4))(define conCar_d (cons conCar_b conCar_c))\";\n Main.parseInputString(multicons);\n assertEquals(\"(3 1 . 2)\", Main.parseInputString(\"(display (car conCar_d)) \"));\n }", "@Test\n public void testStringLiteralEscapedTick2() throws Exception {\n String sql = \"SELECT '''abc''' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"'abc'\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }", "private String literal(String str) {\n StringBuffer buffer = new StringBuffer();\n \n buffer.append(\"'\");\n for (int i = 0; i < str.length(); i++) {\n switch (str.charAt(i)) {\n case '\\'':\n buffer.append(\"''\");\n break;\n default:\n buffer.append(str.charAt(i));\n break;\n }\n }\n buffer.append(\"'\");\n return buffer.toString();\n }", "@Test\n public void stringsWork()\n {\n assertEquals( \"<%= bwah %>lol\", StringStatement1.render() );\n assertEquals( \"<%@ directive syntax %><% statement syntax %>\", StringStatement2.render() );\n assertEquals( \"<%-- comment syntax --%>\", StringStatement3.render() );\n }", "void mo1342w(String str, String str2);", "@Test\n public void testStringLiteralEscapedTick4() throws Exception {\n String sql = \"SELECT \\\" \\\"\\\" \\\" FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \" \\\" \");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }", "public String getSpeechResult(String hypothesis){\n\n\n String[] arrayOfStrings = hypothesis.split(\"text\\\" :\");\n String textPredicted = arrayOfStrings[1];\n\n arrayOfStrings = textPredicted.split(\"\\\"\");\n textPredicted = arrayOfStrings[1];\n\n return textPredicted;\n }", "@Nonnull\n public static String getXPathString(@Nonnull String str) {\n // if the value contains only single or double quotes, construct\n // an XPath literal\n if (!str.contains(\"'\")) {\n return \"'\" + str + \"'\";\n }\n if (!str.contains(\"\\\"\")) {\n return \"\\\"\" + str + \"\\\"\";\n }\n\n // if the value contains both single and double quotes, construct an\n // expression that concatenates all non-double-quote substrings with\n // the quotes, e.g.:\n //\n // concat(\"foo\", '\"', \"bar\")\n\n int singleCount = StringUtils.countMatches(str, \"'\");\n int doubleCount = StringUtils.countMatches(str, \"\\\"\");\n\n // the quote that gets split on\n String quote;\n // an inverse-quoted quote to represent the quote that was a split point\n String quotedQuote;\n // a pattern that splits on the designated split quote\n Pattern splitPattern;\n\n // use either single or double quote depending on which one is used less\n if (singleCount > doubleCount) {\n quote = \"\\\"\";\n quotedQuote = \"'\\\"'\";\n splitPattern = XPATH_DOUBLE_QUOTE_SPLIT_PATTERN;\n } else {\n quote = \"'\";\n quotedQuote = \"\\\"'\\\"\";\n splitPattern = XPATH_SINGLE_QUOTE_SPLIT_PATTERN;\n }\n\n List<String> xpathConcatList = new ArrayList<String>();\n\n // regex perhaps isn't the most efficient but its split behavior (with -1) is correct\n String[] substrings = splitPattern.split(str, -1);\n\n for (int i = 0; i < substrings.length; i++) {\n String chunk = substrings[i];\n\n // if this isn't just the space between subsequent quotes, include the chunk\n if (!chunk.equals(\"\")) {\n xpathConcatList.add(quote + chunk + quote);\n }\n\n // if this isn't the last item, include a literal to represent the quote that was split on\n if (i < substrings.length - 1) {\n xpathConcatList.add(quotedQuote);\n }\n }\n\n return \"concat(\" + StringUtils.join(xpathConcatList, \", \") + \")\";\n }", "public static void main(String[] args)\t{\r\n\t\t\r\n\t\tSystem.out.println(\"A \\\"quoted\\\" String is\");\r\n\t\tSystem.out.println(\"'much' better if you learn\");\r\n\t\tSystem.out.println(\"the rules of \\\"escape sequences.\\\"\");\r\n\t\tSystem.out.println(\"Also, \\\"\\\" represents an empty String.\");\r\n\t\tSystem.out.println(\"Don't forget: use \\\\\\\" instead of \\\" !\");\r\n\t\tSystem.out.println(\"'' is not the same as \\\"\");\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString lyrics = \"Let it go!Let it go!Cannot hold it back anymore\";\r\n\t\t\r\n\t\tSystem.out.println(lyrics);\r\n\t\t\r\n\t\tString changeher = lyrics.replace(\"it\", \"\\\"her\\\"\");\r\n\t\t\r\n\t\tSystem.out.println(changeher);\r\n\t\t\r\n\t\tString changecannot = changeher.replace(\"Cannot\", \"can't\");\r\n\t\t\r\n\t\tSystem.out.println(changecannot);\r\n\t}", "public boolean closeString(String word1, String word2) {\n\n \n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"He said \\\"How are you ? \\\"\");//Print \"\" special character\n\t\tSystem.out.println(\"/n\");//print /n\n\t\tSystem.out.println(\"()\");// print ()\n\t\tSystem.out.println(\"\\'name\\'\");//print ''\n\t\t\n\n\t}", "@Test\n public void testRedundant2version() {\n String ver2 = Textile.straighten_weft2(\"aad.bbd+d*ac\");\n assertEquals(\"d.bbac\",ver2);\n }", "public static void main(String[] args) {\n\t\r\n\t\t {\r\n\t\t String str1 = \"Hello Java and Welcome to Java\";\r\n\t\t String str2 = \"Java\";\r\n\t\t System.out.println(\"Original String: \" + str1);\r\n\t\t System.out.println(\"Specified sequence of char values: \" + str2);\r\n\t\t System.out.println(str1.contains(str2));\r\n\t\t }\r\n\t\t}", "public static void main(String[] args) {\n\t\tString text = \"\\\"undifferentiated's thyroid carcinomas were carried out with antisera against calcitonin, calcitonin-gene related peptide (CGRP), somatostatin, and also thyroglobulin, using the PAP method. \";\n\t\ttext = text.replace('\\\"', ' ');\n\t\t\n\t\tStringUtil su = new StringUtil();\n\t\t\n\t\t// Extracting...\n\t\tString text2 = new String(text);\n\t\tEnvironmentVariable.setMoaraHome(\"./\");\n\t\tGeneRecognition gr = new GeneRecognition();\n\t\tArrayList<GeneMention> gms = gr.extract(MentionConstant.MODEL_BC2,text);\n\t\t// Listing mentions...\n\t\tSystem.out.println(\"Start\\tEnd\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.Text());\n\t\t\t//System.out.println(text2.substring(gm.Start(), gm.End()));\n\t\t\tSystem.out.println(su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t}\n\t\tif (true){\n\t\t\treturn;\n\t\t}\n\t\t// Normalizing mentions...\n\t\tOrganism yeast = new Organism(Constant.ORGANISM_YEAST);\n\t\tOrganism human = new Organism(Constant.ORGANISM_HUMAN);\n\t\tExactMatchingNormalization gn = new ExactMatchingNormalization(human);\n\t\tgms = gn.normalize(text,gms);\n\t\t// Listing normalized identifiers...\n\t\t\n\t\tSystem.out.println(\"\\nStart\\tEnd\\t#Pred\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tif (gm.GeneIds().size()>0) {\n\t\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.GeneIds().size() + \n\t\t\t\t\t\"\\t\" + su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t\t\tfor (int j=0; j<gm.GeneIds().size(); j++) {\n\t\t\t\t\tGenePrediction gp = gm.GeneIds().get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\" + gp.GeneId() + \" \" + gp.OriginalSynonym() + \" \" + gp.ScoreDisambig());\n\t\t\t\t\tSystem.out.println((gm.GeneId().GeneId().equals(gp.GeneId())?\" (*)\":\"\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String args[]) {\n\t String str1 = \"Welcome\";\n\t String str2 = \" to \";\n\t String str3 = \" HOME \";\n\t str1 = str1.concat(str2).concat(str3);\n\t System.out.println(str1);\n\t \n\t \n\t \n\t }", "public void firstSem10a(){\n chapter = \"firstSem10a\";\n String firstSem10a = \"There's a commotion outside your room - your door looks like it's been smashed down, and your RA is standing outside, looking \" +\n \"distressed. You can hear a shout from inside - your roommate - and sounds of a struggle. \\\"Get in there and help!\\\" you shout to the RA, \" +\n \"but he just shakes his head. \\\"Sorry, I can't. I'm anti-violence. You can't fight hate with hate, you know.\\\"\\tPushing past him, you \" +\n \"run into your room to see your roommate grappling with a large beast. THE beast. It is real. What do you want to do?\";\n getTextIn(firstSem10a);\n }", "public void caseAStringBasic(AStringBasic node)\n {\n String str = node.getString().getText();\n str = str.substring(1, str.length() - 1);\n\n // split the string on double quotes and individually\n // quote each piece to avoid quoting issues\n for (String chk : str.split(\"\\\"\"))\n buffer.append('\"').append(chk).append('\"');\n }", "@Test\n public void testStringLiteralEscapedTick3() throws Exception {\n String sql = \"SELECT 'a''b''c' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"a'b'c\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }", "public static void main(String[] args) {\n\n String[] split = \"hjhk***jklj,j\\nkl\".split(quote(\"***\") + \"|,\");\n for (String every : split)\n System.out.println(\"test slpit: \" + every);\n// Pattern p = Pattern.compile(\"\\\\[([^\\\\]]+)\\\\]\");\n// Matcher m = p.matcher(\"[***]\");\n// while(m.find()) {\n// System.out.println(m.group(0));\n// }\n }", "public static void wellFormed(){\n System.out.println(\"A well-formed Java program has\");\n System.out.println(\"a main method with { and }\");\n System.out.println(\"braces.\");\n System.out.println(\"\");\n System.out.println(\"A System.out.println statement\");\n System.out.println(\"has ( and ) and usually a\");\n System.out.println(\"String that starts and ends\");\n System.out.println(\"with a \\\" character.\");\n System.out.println(\"(But we type \\\\\\\" instead!)\");\n }", "@And(\"^Cards displayed are \\\"([^\\\"]*)\\\"$\")\r\n public void cards_displayed_are_something(String strArg1) throws Throwable {\n \tSystem.out.println(strArg1);\r\n \r\n }", "public static void main(String[] args) {\n String str =\"any text goes here\";\n System.out.println(str);\n String str2 = \"1\";\n System.out.println(str2);\n String hello =\"Hello world\";\n System.out.println(\"hello\");\n\n String myName =\"Cybertek\"+\"School\";\n System.out.println(\"myName\");\n //Example\n String name = \"Parizat\";\n System.out.println(\"My name is \"+name);\n\n String newStr = \"100\"+10;//10010\n System.out.println(newStr);\n\n System.out.println(1+2+3);//6\n System.out.println(\"1\"+2+3);//123 \"12\"+3==>123\n //System.out.println(\"1\"+1-3); \"11\"-3\n\n System.out.println(\"Batch 12\"+ 1+2);//\"Batch 121\"+2====>Batch1212\n\n System.out.println(2-1+1+\"4\");//24\n System.out.println(1+\"123\"+4+5);//112345\n\n System.out.println(\"123\"+(4+5));\n System.out.println(1+(\"1\"+2));//112\n// 1+ \"12\"==>112\n\n System.out.println(1+\"123\"+(4+5));\n// \"1123\"+ 9====>11239\n\n System.out.println(4+3-(9+3));\n// 7-12===>-5\n System.out.println((1+2)+\"3\");//33\n\n //System.out.println(_(1+2)- \"3\" );\n// 3 text\n\n\n String BookName=\"I like the booke call\\'Game of throne \\'\";\n System.out.println(BookName);\n\n String MyInfo = \"my name is \\n\\tCybertek\";\n System.out.println(MyInfo);\n\n System.out.println('3'+3);\n // 51+3====>54\n System.out.println(\"3\"+3);\n\n\n System.out.println(\"3\"+'3');//if we concat char to string,char is concat as a character\n // \"3\"+3\n System.out.println(12+'3');//if we concat char to number ,representive number char will comncat\n// 12+51=63\n\n System.out.println(2+3);//5\n System.out.println(\"2\"+3);//23\n\n System.out.println('7'+3);//58\n // 55+3=58\n\n System.out.println('7'+\"3\");//73\n System.out.println('7'+9);\n // 53+9\n\n\n\n\n\n }", "private static String quote(String text) {\r\n String result;\r\n if (null == text) {\r\n result = text;\r\n } else {\r\n result = \"\\\"\" + text + \"\\\"\";\r\n }\r\n return result;\r\n }", "public void cars_of_my_father(){\n System.out.println(\"Royal Rayce, Maruti Suzuki, Mazda\");\n }", "@Test\n\tpublic void explicitANDTest() {\n\t\tString query = \"hello goodbye\";\n\t\tString query2 = \"hello goodbye hello\";\n\t\tString query3 = \"( hello ( goodbye | hello bye ) )\";\n\t\t\n\t\tString queryResults = \"hello & goodbye\";\n\t\tString query2Results = \"hello & goodbye & hello\";\n\t\tString query3Results = \"( hello & ( goodbye | hello & bye ) )\";\n\n\t\tassertEquals(queryResults, String.join(\" \", queryTest.addExplicitAND(query.split(\" \"))));\n\t\tassertEquals(query2Results, String.join(\" \", queryTest.addExplicitAND(query2.split(\" \"))));\n\t\tassertEquals(query3Results, String.join(\" \", queryTest.addExplicitAND(query3.split(\" \"))));\n\t}", "@Test\r\n public final void rawInputNamesShouldNotHaveSpaces() {\r\n \tString actual = proc.preprocessRawInputName(\" AndThis String\");\r\n \tassertEquals(\"AndThisString\", actual);\r\n }", "private String buildWordMatch(Matcher matcher, String word){\n return \"(\" + matcher.replaceAll(\"% \"+word+\" %\")\n + \" or \" + matcher.replaceAll(word+\" %\")\n + \" or \" + matcher.replaceAll(word)\n + \" or \" + matcher.replaceAll(\"% \"+word) + \")\" ;\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "public GrandChildOfStringMatch() {}", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "@Test\n\tpublic void test4()\n\t{\n\t\tassertEquals(\n\t\t\t\"$webpage: {<spacex>}\",\n\t\t\texplodeRulesAndCreateString(\"webpage: spacex\")\n\t\t);\n\t}", "@Test\n public void testExtractTextFromDocument_String_String()\n {\n String splitCharacter = \"\\n\";\n\n PDFExtractor instance = new PDFExtractor();\n \n String expResult = page1 + splitCharacter + page2;\n String result = instance.extractTextFromDocument(pathToFile, splitCharacter);\n \n assertEquals(expResult, result);\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "public void testRestartabilityWithAntiquotations() {\n checkCorrectRestart(\n \"''\\n\" +\n \" ${\\n\" +\n \" [\\n\" +\n \" \\\"pure string\\\",\\n\" +\n \" \\\"string with ${antiquotation}\\\",\\n\" +\n \" ''ind string with ${multiple} ${antiquotations}''\\n\" +\n \" ]\\n\" +\n \" }\\n\" +\n \"''\\n\");\n }", "@Test\n public void testStringLiteralEscapedTick() throws Exception {\n String sql = \"SELECT 'O''Leary' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"O'Leary\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString str= \"Hello Dear Dan, how are you Dan, How you been?\";\n\t\tString str1= \"Honesty, I dont care bro\";\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(str.replace('e', 'z')); // we used .replace and replaced all 'e', to 'z' \n\t\t\n\t\tSystem.out.println(str.replace(\"Dear\", \"Love\")); // we used .replace target, replacement to replace specific words. Here I replaced \"Dear with Love\"\n\t\tSystem.out.println(str.replaceFirst(\"Dan\", \"Sir\")); //This replaces the FIRST Dan, and leaves the rest \n\n\t\tString str2=\"12-22-1990\"; // 12/22/1990\n\t\t\n\t\tSystem.out.println(str2.replace('-', '/'));\n\t\t\n\t\t\n\t\t \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public interface StringBasic01 {\n\n\t/**\n\t * Palindrome is a String which give the same result by reading from left to right and from right to left.\n\t * Example: \"aabaa\" is a palindrome.\n\t * \"mom\" is a palindrome\n\t * \"radar\" is a palindrome\n\t * etc.\n\t * Using charAt(int position) function of Java String to check if a input String is palindrome\n\t *\n\t */\n\tstatic boolean isPalindrome(String s) {\n\t\tint i = 0, j = s.length() - 1;\n\t\twhile (i < j) {\n\t\t\tif (s.charAt(i) != s.charAt(j))\n\t\t\t\treturn false;\n\t\t\t++i;\n\t\t\t--j;\n\t\t}\n\t\treturn true;\n\t}\n\n\t\t/**\n\t\t * Given a paragraph of text, calculate how many sentences included in the paragraph.\n\t\t ** Example: paragraph = \"I have 2 pets, a cat and a dog. The cat's name is Milo. The dog's name is Ricky\";\n\t\t ** return should be 3.\n\t\t *\n\t\t * @param paragraph of text\n\t\t * @return the number of sentences\n\t\t * (Suggest: Using split function of String).\n\t\t */\n\n\t\tstatic int sentenceCount(String paragraph) {\n\t\t\tif (paragraph != null && !paragraph.isEmpty()) {\n\t\t\t\treturn paragraph.split(\"\\\\.\").length;\n\t\t\t}\n\t\t\telse return 0;\n\t\t}\n\n\t\t/**\n\t\t * Given a paragraph of text, which unfortunately contains bad writing style:\n\t\t * error1: each sentence doesn't begin with a capital letter\n\t\t * error2: there is space between commas and previous letter, like \"2 pets , a cat \"\n\t\t * error3: there is no space between commas and the next letter, like \"2 pets,a cat \"\n\t\t * error4: there is space between period and previous letter, like \"a dog .\"\n\t\t * error5: there is more than one space between words, like \"a dog\"\n\t\t * Write code to correct the paragraph.\n\t\t ** Example: paragraph = \"i have 2 pets , a cat and a dog. the cat's name is Milo . the dog's name is Ricky\"\n\t\t ** output = \"I have 2 pets, a cat and a dog. The cat's name is Milo. The dog's name is Ricky\"\n\t\t *\n\t\t * @param paragraph of wrong text\n\t\t * @return corrected paragraph\n\t\t * Suggest: using some of followings: split, replace, toUpperCase.\n\t\t */\n\t\tstatic String correctParagraph(String paragraph) {\n\n\t\t\tString newText = paragraph.replaceAll(\"\\\\s{2,}+\", \" \");\n\n\t\t\tnewText = newText.replaceAll(\"\\\\s+,\", \",\");\n\t\t\tnewText = newText.replaceAll(\"\\\\s+\\\\.\", \".\");\n\n\n\t\t\tString firstLetter = newText.substring(0, 1).toUpperCase();\n\t\t\tnewText = firstLetter + newText.substring(1);\n\n\t\t\tString[] sentences = newText.split(\"\\\\.\");\n\t\t\tfor(int i = 0; i < sentences.length; i++){\n\t\t\t\tString temp = sentences[i].trim();\n\t\t\t\tfirstLetter = temp.substring(0, 1).toUpperCase();\n\t\t\t\tsentences[i] = firstLetter + temp.substring(1);\n\t\t\t}\n\t\t\tStringBuilder newParagraph = new StringBuilder(sentences[0]);\n\t\t\tfor(int i = 1; i < sentences.length; i++){\n\t\t\t\tnewParagraph.append(\". \").append(sentences[i]);\n\t\t\t}\n\t\t\tnewText = newParagraph.append(\".\").toString();\n\n\t\t\treturn newText;\n\t\t}\n\n /**\n * Given an article and a keyword. Find how many times the key words appear in the articles\n * Example:\n * article = \"Business Insider teamed up with Zillow's rental site, HotPads, to find the\n * median rent for a one-bedroom apartment in each of the 49 US metro areas with the largest\n * populations (as determined by Zillow). We also used Data USA to find the median household\n * income in each of these areas.\n *\n * The data was compiled using HotPad's Repeat Rent Index. Each of the one-bedroom apartments\n * analyzed in the study has been listed for rent on HotPads for longer than a month.\"\n * keyword = \"one-bedroom\".\n * Because the word \"one-bedroom\" appears twice in the paragraph, therefore:\n * countAppearances should return 2.\n * @param article: String. like a newspaper article\n * @param keyword: keyword to find in the articles\n * @return the number of appearances\n * Suggest: use method indexOf\n */\n\n\n\tstatic int countAppearances(String article, String keyword) {\n\t\tif(keyword.isEmpty()){\n\t\t\treturn 0;\n\t\t}\n\t\tString newArticle = article.replace(keyword, \"\");\n\t\treturn (article.length() - newArticle.length())/keyword.length();\n\t}\n\n\n}", "public String ayadi_sandhi(String s1, String s2)\n {\n Log.info(\"Welcome to ayadi Sandhi\");\n\n if (!VowelUtil.isEjanta(s1)) Log.info(\"NOT ELIGIBLE FOR ayadi sandhi\");\n\n if (!VowelUtil.isAjadi(s2)) Log.info(\"NOT ELIGIBLE FOR ayadi sandhi\");\n // if 2nd string is not a Vowel, then cannot proceed.\n String return_me = s1 + s2;\n\n String stripped1;\n stripped1 = VarnaUtil.stripAntyaVarna(s1); // s1.substring(0, str_len1\n // - reduce_by1);\n\n String modified_anta = s1 + s2;\n\n if (s1.endsWith(\"e\") || s1.endsWith(\"e3\"))\n {\n modified_anta = stripped1 + \"ay\";\n }\n\n else if (s1.endsWith(\"E\") || s1.endsWith(\"E3\"))\n {\n modified_anta = stripped1 + \"Ay\";\n }\n\n else if (s1.endsWith(\"o\") || s1.endsWith(\"o3\"))\n {\n modified_anta = stripped1 + \"av\";\n }\n\n else if (s1.endsWith(\"O\") || s1.endsWith(\"O3\"))\n {\n modified_anta = stripped1 + \"Av\";\n }\n\n return_me = modified_anta + s2;\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.78\");\n comments.setSutraPath(\"eco.ayavAyAvaH\");\n comments.setSutraProc(\"ayAdi-Adesha\");\n comments.setSource(Comments.sutra);\n String cond1 = \"When a word terminating in an <ec> pratyahara \" + \"is followed by any vowel the <ec>as are replaced by ayadi.\" + \"\\n<ec>(e/ai/o/au) + any vowel = ay/Ay/av/Av respectively.\";\n comments.setConditions(cond1);\n\n // The words are furthur modified by the principle of yakkar-vakaar lopa\n return_me += \", \" + (new MixedSandhi()).shaakalya_ya_va_lopa(modified_anta, s2, comments);\n\n return return_me;\n }", "public static void main(String[] args) {\n\t\t// LENGTH();\n//\t\tString str=\"Syntax\";-----------------------\n//\t\t int lengthOfString=str.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name=\"Timmy\";---------------------\n//\t\t int lengthOfString=name.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name1=\" Syntex Technolody \";------------------\n//\t\t int lengthOfString1=name1.length();\n//\t\t System.out.println(name1.length());\n//\t\t String str2=\"Welcome, students!\";-----------------------\n//\t\t System.out.println(str2.length());\n\t\t// UPPER LOWER cases;\n//\t\t String str3=\"Hello\";\n//\t\t String newString=str3.toUpperCase();\n//\t\t System.out.println(newString);\n//\t\t String lowerCaseString=newString.toLowerCase();\n//\t\t System.out.println(lowerCaseString);\n//\t\t String love=\"Peionies will bring me Love\";\n//\t\t String caseString=love.toUpperCase();\n//\t\t System.out.println(love.toUpperCase());\n//\t\t String job=\"GOOD JOB IS SECCSESS IN LIFE\";\n//\t\t String newString1=job.toLowerCase();\n//\t\t System.out.println(newString1);\n//\t\t //equality;\n//\t\t String p1=\"The Hight is 5 inches\";\n//\t\t String p2=\"The hight is 5 inches\"; //QUASTION---DOES NOT IGNORES CASE!\n//\t\t boolean equality=p1.equalsIgnoreCase(p2);\n//\t\t System.out.println(equality);\n\n\t\tString word1 = \"syntaxsolutions\";\n\t\tString word2 = \"SYNTAXSOLUTIONS\";\n\n\t\tString case1 =word1.toUpperCase();\n\t\tSystem.out.println(case1);\n\n\t\tString case2 = word2.toLowerCase();\n\t\tSystem.out.println(case2);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString myString = \"Python 3.0\";\n\t\tString[] mySplitStrings = myString.split(\" \");\n\t\t\n\t\tSystem.out.println(String.join(\" Tutorial \", mySplitStrings));\n\t}", "String escapeReservedWords(String query);", "public static void main (String ... args) {\n\n String titulo = \"simple\";\n String pattern = \"abc\";\n String source = \"avsfvasdfabcwefewafabc\";\n find(titulo, pattern, source);\n\n ////////////////////////\n titulo = \"Digitos...\";\n pattern = \"\\\\d\";\n source = \"9a8d70sd98f723708\";\n find(titulo, pattern, source);\n\n titulo = \"NO Digitos...\";\n pattern = \"\\\\D\";\n source = \"9a8d70sd98f723708\";\n find(titulo, pattern, source);\n\n titulo = \"\";\n pattern = \"a?\";\n source = \"aba\";\n find(titulo, pattern, source);\n\n titulo = \"dot methacharacter\";\n pattern = \"a.c\";\n source = \"ac abc a c\";\n find(titulo, pattern, source);\n\n titulo =\"Operator ^ carat\";\n pattern = \"proj1([^,])*\";\n source = \"proj3.txt,proj1sched.pdf,proj1,prof2,proj1.java\";\n find(titulo, pattern, source);\n\n }", "@Test\n\tpublic void test7()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\\n\" +\n\t\t\t\"$webpage: {<slashdot>}\",\n\t\t\texplodeRulesAndCreateString(\"webpage:\\n\\tspacex (webpage|(web page))\\n\\tslashdot\")\n\t\t);\n\t}", "public static void main(String[] args) {\n\n String firstString = \"this is what I'm searching in\";\n String secondString = \"I\";\n\n System.out.println(subStringIn(firstString, secondString));\n }", "public static void main(String[] args) {\n String pattern = \"orl\";\n String text = \"Hello World in Java\";\n\n searchPatternInText(pattern, text);\n\n //pattern = \"xyz\";\n //searchPatternInText(pattern, text);\n }", "@Test\n public void wordPatternTest() {\n String pattern = \"aaa\", str = \"aa aa aa aa\";\n boolean ans = instance.wordPattern(pattern, str);\n System.out.println(ans);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString[] testSentence = new String[]{\r\n\t\t\t\t\"西三旗硅谷先锋小区半地下室出租,便宜可合租硅谷工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t\t\"这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。\",\r\n\t\t\t \"我不喜欢日本和服。\",\r\n\t\t\t \"雷猴回归人间。\",\r\n\t\t\t \"工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t \"我需要廉租房\",\r\n\t\t\t \"永和服装饰品有限公司\",\r\n\t\t\t \"我爱北京天安门\",\r\n\t\t\t \"abc\",\r\n\t\t\t \"隐马尔可夫\",\r\n\t\t\t \"雷猴是个好网站\",\r\n\t\t\t \"“Microsoft”一词由“MICROcomputer(微型计算机)”和“SOFTware(软件)”两部分组成\",\r\n\t\t\t \"草泥马和欺实马是今年的流行词汇\",\r\n\t\t\t \"伊藤洋华堂总府店\",\r\n\t\t\t \"中国科学院计算技术研究所\",\r\n\t\t\t \"罗密欧与朱丽叶\",\r\n\t\t\t \"我购买了道具和服装\",\r\n\t\t\t \"PS: 我觉得开源有一个好处,就是能够敦促自己不断改进,避免敞帚自珍\",\r\n\t\t\t \"湖北省石首市\",\r\n\t\t\t \"湖北省十堰市\",\r\n\t\t\t \"总经理完成了这件事情\",\r\n\t\t\t \"电脑修好了\",\r\n\t\t\t \"做好了这件事情就一了百了了\",\r\n\t\t\t \"人们审美的观点是不同的\",\r\n\t\t\t \"我们买了一个美的空调\",\r\n\t\t\t \"线程初始化时我们要注意\",\r\n\t\t\t \"一个分子是由好多原子组织成的\",\r\n\t\t\t \"祝你马到功成\",\r\n\t\t\t \"他掉进了无底洞里\",\r\n\t\t\t \"中国的首都是北京\",\r\n\t\t\t \"孙君意\",\r\n\t\t\t \"外交部发言人马朝旭\",\r\n\t\t\t \"领导人会议和第四届东亚峰会\",\r\n\t\t\t \"在过去的这五年\",\r\n\t\t\t \"还需要很长的路要走\",\r\n\t\t\t \"60周年首都阅兵\",\r\n\t\t\t \"你好人们审美的观点是不同的\",\r\n\t\t\t \"买水果然后去世博园\",\r\n\t\t\t \"但是后来我才知道你是对的\",\r\n\t\t\t \"存在即合理\",\r\n\t\t\t \"的的的的的在的的的的就以和和和\",\r\n\t\t\t \"I love你,不以为耻,反以为rong\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"很好但主要是基于网页形式\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"为什么我不能拥有想要的生活\",\r\n\t\t\t \"后来我才\",\r\n\t\t\t \"此次来中国是为了\",\r\n\t\t\t \"使用了它就可以解决一些问题\",\r\n\t\t\t \",使用了它就可以解决一些问题\",\r\n\t\t\t \"其实使用了它就可以解决一些问题\",\r\n\t\t\t \"好人使用了它就可以解决一些问题\",\r\n\t\t\t \"是因为和国家\",\r\n\t\t\t \"老年搜索还支持\",\r\n\t\t\t \"干脆就把那部蒙人的闲法给废了拉倒!RT @laoshipukong : 27日,全国人大常委会第三次审议侵权责任法草案,删除了有关医疗损害责任“举证倒置”的规定。在医患纠纷中本已处于弱势地位的消费者由此将陷入万劫不复的境地。 \",\r\n\t\t\t \"他说的确实在理\",\r\n\t\t\t \"长春市长春节讲话\",\r\n\t\t\t \"结婚的和尚未结婚的\",\r\n\t\t\t \"结合成分子时\",\r\n\t\t\t \"旅游和服务是最好的\",\r\n\t\t\t \"这件事情的确是我的错\",\r\n\t\t\t \"供大家参考指正\",\r\n\t\t\t \"哈尔滨政府公布塌桥原因\",\r\n\t\t\t \"我在机场入口处\",\r\n\t\t\t \"邢永臣摄影报道\",\r\n\t\t\t \"BP神经网络如何训练才能在分类时增加区分度?\",\r\n\t\t\t \"南京市长江大桥\",\r\n\t\t\t \"应一些使用者的建议,也为了便于利用NiuTrans用于SMT研究\",\r\n\t\t\t \"长春市长春药店\",\r\n\t\t\t \"邓颖超生前最喜欢的衣服\",\r\n\t\t\t \"胡锦涛是热爱世界和平的政治局常委\",\r\n\t\t\t \"程序员祝海林和朱会震是在孙健的左面和右面, 范凯在最右面.再往左是李松洪\",\r\n\t\t\t \"一次性交多少钱\",\r\n\t\t\t \"两块五一套,三块八一斤,四块七一本,五块六一条\",\r\n\t\t\t \"小和尚留了一个像大和尚一样的和尚头\",\r\n\t\t\t \"我是中华人民共和国公民;我爸爸是共和党党员; 地铁和平门站\",\r\n\t\t\t \"张晓梅去人民医院做了个B超然后去买了件T恤\",\r\n\t\t\t \"AT&T是一件不错的公司,给你发offer了吗?\",\r\n\t\t\t \"C++和c#是什么关系?11+122=133,是吗?PI=3.14159\",\r\n\t\t\t \"你认识那个和主席握手的的哥吗?他开一辆黑色的士。\",\r\n\t\t\t \"枪杆子中出政权\",\r\n\t\t\t \"张三风同学走上了不归路\",\r\n\t\t\t \"阿Q腰间挂着BB机手里拿着大哥大,说:我一般吃饭不AA制的。\",\r\n\t\t\t \"在1号店能买到小S和大S八卦的书,还有3D电视。\"\r\n\r\n\t\t};\r\n\t\t\r\n\t\tSegment app = new Segment();\r\n\t\t\r\n\t\tfor(String sentence : testSentence)\r\n\t\t\tSystem.out.println(app.cut(sentence));\r\n\t}", "private static String escape(String arg) {\n int max;\n StringBuilder result;\n char c;\n\n max = arg.length();\n result = new StringBuilder(max);\n for (int i = 0; i < max; i++) {\n c = arg.charAt(i);\n switch (c) {\n case '\\'':\n case '\"':\n case ' ':\n case '\\t':\n case '&':\n case '|':\n case '(':\n case ')':\n case '\\n':\n result.append('\\\\');\n result.append(c);\n break;\n default:\n result.append(c);\n break;\n }\n }\n return result.toString();\n }", "private String escapeString(String value, String queryLanguage) {\n String escaped = null;\n if (value != null) {\n if (queryLanguage.equals(Query.XPATH) || queryLanguage.equals(Query.SQL)) {\n // See JSR-170 spec v1.0, Sec. 6.6.4.9 and 6.6.5.2\n escaped = value.replaceAll(\"\\\\\\\\(?![-\\\"])\", \"\\\\\\\\\\\\\\\\\").replaceAll(\"'\", \"\\\\\\\\'\")\n .replaceAll(\"'\", \"''\");\n }\n }\n return escaped;\n }", "private String escape(String token) {\n return token.replace(\",\" , \"\");\n }", "public static void main(String[] args) {\n\t\tString lyrics = \"Let \\\"her\\\" go! Let \\\"her\\\" go! Can\\'t hold \\\"her\\\" back anymore\";\n\t\tSystem.out.print(lyrics);\n\t}", "String mo3176a(String str, String str2);", "String fragment();", "StringLiteralExp createStringLiteralExp();", "@Test\n void doubleConstructInConstruct() {\n assertEquals(\"(1 . 2)\", Main.parseInputString(\"(display (car (cons (cons 1 2) (cons 3 4))))\"));\n }", "public void test_extractKeyphrase_A$String() throws Exception {\n\t\tYahooAuctionService target = new YahooAuctionService();\r\n\t\tString text = \"せどり初心者は中古と新品ではどちらが向いているか?\";\r\n\t\tList<String> actual = target.extractKeyphrase(text);\r\n\t\tList<String> expected = null;\r\n\t\tassertEquals(expected, actual);\r\n\t}", "public static ArthurString divide(ArthurString one, ArthurString two) {\n String twoReverse = new StringBuilder(two.str).reverse().toString();\n return multiply(one, new ArthurString(twoReverse));\n }", "public static void main3(String[] args) {\n String str = \"192*168*1*1\";\n\n //String [] strings = str.split(\"\\\\.\");\n String [] strings = str.split(\"\\\\*\");\n //为什么需要两个斜杠 在本来的情况下 \\ +要转义的字符就可以了\n //但是此时在在\"\"里面不知道\\是干什么的 需要两个斜杠\n for(String s : strings) {\n System.out.println(s);\n }\n }", "public static void main(String[] args) {\n\t\tString str = \"32+5*2-40/3\";\r\n\t\t/*\r\n\t\tPattern p = Pattern.compile(\"(([0-9]+)(\\\\+\\\\-\\\\*\\\\/)?)+\");\r\n\t\tMatcher m = p.matcher(str);\r\n\t\tSystem.out.println(m.find());\r\n\t\tSystem.out.println(m.groupCount());\r\n\t\tSystem.out.println(m.group(1));\r\n\t\tSystem.out.println(m.group(2));\r\n\t\tSystem.out.println(m.group(3));\r\n\t\t*/\r\n\t\tString[] sub = str.split(\"\\\\+|\\\\-|\\\\*|\\\\/\");\r\n\t\tfor(String s : sub) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<String> determineSearchedWords(String userCommand) {\n\t\tif (userCommand == null || userCommand.equals(\"\")) {\n\t\t\tlogger.log(Level.WARNING, Global.MESSAGE_ILLEGAL_ARGUMENTS);\n\t\t\treturn null;\n\t\t}\n\n\t\tString userCommandWithoutCommandType = removeCommandType(userCommand);\n\n\t\tArrayList<String> searchedWords = new ArrayList<String>();\n\t\tPattern pattern = Pattern.compile(\"[^\\\\s\\\"']+|\\\"([^\\\"]*)\\\"\");\n\t\tMatcher matcher = pattern.matcher(userCommandWithoutCommandType);\n\n\t\twhile (matcher.find()) {\n\t\t\tif (matcher.group(1) != null) {\n\t\t\t\tsearchedWords.add(matcher.group(1)); // Phrase in double quotes\n\t\t\t} else {\n\t\t\t\tsearchedWords.add(matcher.group()); // Single word\n\t\t\t}\n\t\t}\n\t\treturn searchedWords;\n\t}", "@When(\"^User login into application with \\\"([^\\\"]*)\\\" and \\\"([^\\\"]*)\\\"$\")\r\n public void user_login_into_application_with_something_and_something(String strArg1, String strArg2) throws Throwable {\n \tSystem.out.println(strArg1);\r\n \tSystem.out.println(strArg2);\t\r\n \r\n }", "public static void main(String[] args) {\n\t\tString s1 = \"My name is manish\";\n\t\t//By new keyword\n\t\tString s2 = new String(\"My name is manish\");\n\t\t//System.out.println(s1.equals(s2)); //compare values\n\t\t//System.out.println(s1==(s2));// compare references not value\n\t\t\n\t\t//Java String toUpperCase() and toLowerCase() method\n\t\tString s = \"SacHin\";\n\t\t//System.out.println(s.toUpperCase());\n\t\t//System.out.println(s.toLowerCase());\n\t\t\n\t\t//string trim() method eliminates white spaces before and after string\n\t\tString s3= \" String \";\n\t\t//System.out.println(s3.trim());\n\t\t\n\t\t//string charAt() method returns a character at specified index\n\t\tString s4 = \"Manish\";\n\t\t//System.out.println(s4.charAt(4));\n\t\t\n\t\t//string length() method returns length of the string\n\t\tString a = \"manish\";\n\t\tString a1 = \"My name is manish\";\n\t\t//System.out.println(a.length());\n\t\t//System.out.println(a1.length());\n\t\t\n\t\t//string valueOf() method coverts given type such as int, long, float, double, boolean, char and char array into string.\n\t\tint i = 23;\n\t\tchar [] ch = {'a','b','c','d'};\n\t\tString s5 = String.valueOf(i);\n\t\tString c = String.valueOf(ch);\n\t\t//System.out.println(s5+10);\n\t\t//System.out.println(s5.length());\n\t\t//System.out.println(c+10);\n\t\t//System.out.println(c.length());\n\t\t\n\t\t//string replace() method replaces all occurrence of first sequence of character with second sequence of character.\n\t\tString s6 = \"java is programming Language, java is oops language, java is easy language\";\n\t\t//String replaceString = s6.replace(\"java\",\"kava\");\n\t\t//System.out.println(replaceString);\n\t\t\n\t\t//string concat() method combines specified string at the end of this string\n\t\tString s7 = \"ram goes to home, \";\n\t\tString s8 = \"he also goes to school\";\n\t\t//System.out.println(s7.concat(s8));\n\t\t//System.out.println(s7+s8);\n\t\t\n\t\t/*\n\t\t * //string split() method splits this string against given regular expression\n\t\t * and returns a char array String s9 =\n\t\t * \"java string split method by javatpoint\"; String [] spParts = s9.split(\" \");\n\t\t * //String [] s10Parts = s9.split(\" \",4); for(int i=) {\n\t\t * System.out.print(str+\",\"); }\n\t\t */\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\tString str=\"Four score and seven years ago\";\n\t\t\tSystem.out.println(\"The letter r appears at the following locations: \");\n\t\t\tint position = str.indexOf('r');\n\t\t\twhile (position!= -1) {\n\t\t\t\tSystem.out.print(position + \" \");\n\t\t\t\tposition = str.indexOf('r',position+1);\n\t\t\t}\n\t\t\t\n\t\t\tString str2 = \"and a one and two and a three\";\n\t\t\tSystem.out.println(\"The word \\\" and\\\" appears at the following location: \");\n\t\t\tint positionAnd = str2.indexOf(\"and\");\n\t\t\twhile(positionAnd != -1) {\n\t\t\t\tSystem.out.print(positionAnd + \" \");;\n\t\t\t\tpositionAnd = str2.indexOf(\"and\", positionAnd+1);\n\t\t\t}\n}", "public static void main(String[] args) {\n\t\n\tString str=\"Hello Deannochka, How are you? How have you been?\";\n\tSystem.out.println(str.replace(\" y\", \" th\"));\n\tSystem.out.println(str.replace(\"Hello\", \"Hey\"));\n//\tSystem.out.println(str.replaceAll(regex, replacement));\n\t\n}", "private static boolean QuotStringLiteral_1_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"QuotStringLiteral_1_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, PREDEFINEDENTITYREF);\n if (!r) r = consumeToken(b, CHARREF);\n if (!r) r = EscapeQuot(b, l + 1);\n if (!r) r = consumeToken(b, STRINGCHAR);\n exit_section_(b, m, null, r);\n return r;\n }", "void mo1340v(String str, String str2);", "protected String getStringValueText(String value) {\n // TODO(igorkarp): do not quote expressions once they could be detected.\n return getQuote() + value + getQuote();\n }" ]
[ "0.6150818", "0.55403984", "0.5512303", "0.5445335", "0.5421144", "0.54094213", "0.53804004", "0.5295366", "0.52870786", "0.52691656", "0.526071", "0.5212775", "0.51818866", "0.5179951", "0.515292", "0.5134997", "0.5126533", "0.5116053", "0.51093674", "0.5098797", "0.5092911", "0.50874573", "0.50629294", "0.5038985", "0.5035457", "0.50338936", "0.50211066", "0.50011736", "0.5000563", "0.49888366", "0.4987534", "0.49835545", "0.49725303", "0.49644193", "0.4963238", "0.4958309", "0.49569148", "0.4951695", "0.49484655", "0.4930621", "0.49258614", "0.49243927", "0.4918989", "0.49179775", "0.49037656", "0.49027604", "0.488289", "0.48750207", "0.48726067", "0.48692974", "0.48669147", "0.48622787", "0.4860386", "0.4852495", "0.48513487", "0.48504663", "0.48476678", "0.48466685", "0.4844973", "0.4843467", "0.4842182", "0.4841957", "0.4840771", "0.4837267", "0.48371217", "0.48354587", "0.48304954", "0.48216823", "0.4807938", "0.48059642", "0.4800502", "0.4800174", "0.4792991", "0.47901958", "0.47898468", "0.47876868", "0.47875586", "0.47863188", "0.47857702", "0.47807586", "0.47750032", "0.47680718", "0.4767171", "0.47655252", "0.47557193", "0.47480342", "0.47425294", "0.4735712", "0.47313836", "0.47296244", "0.4729185", "0.4728179", "0.4716634", "0.47117552", "0.47012332", "0.46955997", "0.46935743", "0.4683231", "0.46827957", "0.46827367" ]
0.53997695
6
Set the baseurl for assets.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the baseurl for assets.") @JsonProperty(JSON_PROPERTY_BASEURL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBaseurl() { return baseurl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBaseURL(String val) {\n\n\t\tbaseURL = val;\n\n\t}", "public void setBaseURL(final String url) {\r\n String location = url;\r\n //-- remove filename if necessary:\r\n if (location != null) { \r\n int idx = location.lastIndexOf('/');\r\n if (idx < 0) idx = location.lastIndexOf('\\\\');\r\n if (idx >= 0) {\r\n int extIdx = location.indexOf('.', idx);\r\n if (extIdx > 0) {\r\n location = location.substring(0, idx);\r\n }\r\n }\r\n }\r\n \r\n try {\r\n _resolver.setBaseURL(new URL(location));\r\n } catch (MalformedURLException except) {\r\n // try to parse the url as an absolute path\r\n try {\r\n LOG.info(Messages.format(\"mapping.wrongURL\", location));\r\n _resolver.setBaseURL(new URL(\"file\", null, location));\r\n } catch (MalformedURLException except2) { }\r\n }\r\n }", "void setBaseUri(String baseUri);", "IParser setServerBaseUrl(String theUrl);", "public static void setBaseURL() {\n\n\t\tRestAssured.baseURI = DataReader.dataReader(\"baseURL\");\n\t}", "public void setBaseUrl(final String baseUrl) {\n this.baseUrl = baseUrl;\n }", "public void setBaseUrl(String baseUrl) {\n this.baseUrl = baseUrl;\n }", "private URL getAssetsUrl() {\n\t\treturn url(ASSETS_URL);\n\t}", "public String getBaseUrl() {\r\n return baseUrl;\r\n }", "@Override\n\tprotected String getHttpBaseUrl() {\n\t\treturn this.properties.getHttpUrlBase();\n\t}", "public void setBaseUrl(java.lang.String mBaseUrl) {\n bugQuery.setBaseUrl(mBaseUrl);\n }", "public String getBaseUrl()\r\n {\r\n return this.url;\r\n }", "public String getBaseUrl() {\n return baseUrl;\n }", "public String getBaseUrl() {\n return baseUrl;\n }", "public String getBaseUrl()\n {\n return baseUrl;\n }", "public RestAPI setBaseURL(String url) throws APIException {\n\t\tthis.url = url;\n\t\tcheckBaseURL();\n\n\t\treturn this;\n\t}", "public String getBaseUrl() {\n return (String) get(\"base_url\");\n }", "public String getBaseURL() {\n return baseURL;\n }", "public String getBaseURL() {\n return baseURL;\n }", "public String getBaseUrl()\n\t{\n\t\treturn baseUrl;\n\t}", "public static String getBaseUrl() {\n return baseUrl;\n }", "public void setBasePath(final String value)\n {\n basePath = value;\n }", "public String getBaseUrl() {\n return builder.getBaseUrl();\n }", "@Override\r\n\tpublic void setAPIBaseUrl(String apiBaseUrl) {\n\t\tthis.apiBaseUrl = apiBaseUrl;\r\n\t}", "public abstract String getBaseURL();", "protected String getBaseUrl() {\n return requestBaseUrl;\n }", "public void setBaseAddress(String base_address) {\n try {\n this.base_address = new URILocator(base_address);\n } catch (MalformedURLException e) {\n throw new OntopiaRuntimeException(e);\n }\n }", "public String baseUrl() {\n return baseUrl;\n }", "public void setProxyBaseUrl(String baseURL) {\n this.proxyBaseUrl = baseURL;\n }", "public URL makeBase(URL startingURL);", "public void setCodebase(URL _codebase) {\r\n\t\tcodebase = _codebase;\r\n\t}", "public String getBaseURL() {\n\n\t\treturn baseURL;\n\n\t}", "public void setShBaseURL(String val) {\n\n\t\tshBaseURL = val;\n\n\t}", "public String getBaseUrl() {\n return preferences.getString(PREFERENCES_BACKEND_BASE_URL, \"http://naamataulu-backend.herokuapp.com/api/v1/\");\n }", "public static String getBaseUrl() {\r\n if (baseUrl == null) {\r\n baseUrl = Constants.HTTP_PROTOCOL + \"://\" + getBaseHost() + \":\" + getBasePort();\r\n }\r\n return baseUrl;\r\n }", "public static String getdevBaseUrl(){\n\n return DEV_BASE_URL;\n }", "public void setBaseRepositoryUrl(String baseRepositoryUrl) {\n\t\tthis.baseRepositoryUrl = baseRepositoryUrl;\n\t}", "public void setCveJsonUrlBase(URL url) {\n this.cveJsonUrlBase = url;\n }", "public String getBaseStaticUrl() {\n return (String) get(\"base_static_url\");\n }", "public void setSchemaBaseURL(String schemaBaseURL) {\n this.schemaBaseURL = schemaBaseURL;\n }", "private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }", "public DefaultHref(String baseUrl)\r\n {\r\n this.parameters = new HashMap();\r\n setFullUrl(baseUrl);\r\n }", "private String baseUrl() {\n return \"http://\" + xosServerAddress + \":\" +\n Integer.toString(xosServerPort) + XOSLIB + baseUri;\n }", "public void setUrl(String url) {\n if(url != null && !url.endsWith(\"/\")){\n url += \"/\";\n }\n this.url = url;\n }", "public Saml2AuthHelper(String baseOAuthUrl)\n {\n if (baseOAuthUrl != null && !baseOAuthUrl.isEmpty())\n {\n this.baseUrl = Uri.parse(baseOAuthUrl);\n }\n }", "@Override\n public void setUrl(String url) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Directory manager \" + directoryManager);\n }\n try {\n super.setUrl(directoryManager.replacePath(url));\n } catch (Exception e) {\n LOGGER.error(\"Exception thrown when setting URL \", e);\n throw new IllegalStateException(e);\n }\n }", "String getRootServerBaseUrl();", "String getServerBaseURL();", "public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }", "@Override\n\tpublic URL getBaseURL() {\n\t\tURL url = null;\n\t\tString buri = getBaseURI();\n\t\tif (buri != null) {\n\t\t\ttry {\n\t\t\t\turl = new URL(buri);\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\ttry {\n\t\t\t\t\tString docuri = document.getDocumentURI();\n\t\t\t\t\tif (docuri != null) {\n\t\t\t\t\t\tURL context = new URL(docuri);\n\t\t\t\t\t\turl = new URL(context, buri);\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e1) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}", "public UrlBuilder compileBaseUrl(HttpServletRequest request, String repositoryId) {\n String baseUrl = (String) request.getAttribute(Dispatcher.BASE_URL_ATTRIBUTE);\n if (baseUrl != null) {\n int repIdPos = baseUrl.indexOf(REPOSITORY_PLACEHOLDER);\n if (repIdPos < 0) {\n return new UrlBuilder(baseUrl);\n } else {\n return new UrlBuilder(baseUrl.substring(0, repIdPos) + repositoryId\n + baseUrl.substring(repIdPos + REPOSITORY_PLACEHOLDER.length()));\n }\n }\n\n UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(), null);\n\n url.addPath(request.getContextPath());\n url.addPath(request.getServletPath());\n\n if (repositoryId != null) {\n url.addPathSegment(repositoryId);\n }\n\n return url;\n }", "public String appBaseUrl() {\n int amtToTrim = request.getServletPath().length() + request.getPathInfo().length();\n String appBase = requestURL.substring(0, requestURL.length()-amtToTrim);\n return appBase;\n }", "private void setAssetPath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n assetPath_ = value;\n }", "void setAvatarUrl(String avatarUrl);", "String fallbackBaseUrl() {\n return settings.get(FALLBACK_BASE_URL);\n }", "public URL getBaseHref() {\n return baseHref;\n }", "public void setSynBaseUrl(String synBaseUrl) {\r\n \tthis.synBaseUrl = synBaseUrl;\r\n }", "public void init() {\n // the config string contains just the asset store directory path\n //set baseDir?\n this.initialized = true;\n }", "private URL getAssetsUrl(String marker) {\n\t\tif (marker.length() == 0) {\n\t\t\treturn getAssetsUrl();\n\t\t} else {\n\t\t\treturn url(ASSETS_URL + \"?\" + form().add(\"marker\", marker).toString());\n\t\t}\n\t}", "public static String getPrefBaseUrl(Context context){\n String key = context.getString(R.string.pref_base_url_key);\n return PreferenceManager.getDefaultSharedPreferences(context).getString(key,null);\n }", "public void setCodebase(final String codebase) {\n this.codebase = codebase;\n if(this.codebase!=null) {\n if(!this.codebase.endsWith(\"/\"))\n this.codebase = this.codebase+\"/\";\n }\n }", "public void setUrl(String url);", "public void setUrl(String url);", "public void setURL(String url);", "public String getApiBaseUrl() {\n return this.apiBaseUrl;\n }", "public String getBaseLinkUrl() {\n return (String) get(\"base_link_url\");\n }", "public void setBasedir(String baseD) throws BuildException {\n setBaseDir(new File(baseD));\n }", "public String getURL() {\n\t\treturn RequestConstants.BASE_IMAGE_URL+_url;\n\t}", "public void setUrl(String url) {\n\t\tthis.url = url;\n\t\tthis.handleConfig(\"url\", url);\n\t}", "public void setApiBaseUrl(final String apiBaseUrl) {\n this.apiBaseUrl = Objects.requireNonNull(apiBaseUrl);\n this.getNetspeakCache().clear();\n }", "public void setBasedir( File basedir )\n {\n this.basedir = basedir;\n }", "public void determineBaseUrl() {\n if (Environment.isLatest()) {\n baseUrl = \"api-latest.wdpro.starwave.com\";\n } else if (Environment.isStage()) {\n baseUrl = \"api-stage.wdpro.starwave.com\";\n } else if (Environment.isENV4()) {\n baseUrl = \"api-latest.wdpro.starwave.com\";\n } else if (Environment.isENV2()) {\n // baseUrl = \"api-qa.wdpro.disney.go.com:8088\";\n baseUrl = \"api-env2.wdpro.starwave.com\";\n } else if (Environment.isSoftLaunch()) {\n baseUrl = \"api.wdpro.disney.go.com\";\n } else if (Environment.isShadow()) {\n baseUrl = \"api-shadow.wdpro.starwave.com\";\n } else if (Environment.isProduction()) {\n baseUrl = \"api.wdpro.disney.go.com\";\n } else {\n baseUrl = \"api.wdpro.disney.go.com\";\n }\n }", "public TestState baseUrl(String baseUrl) {\n this.baseUrl = baseUrl;\n return this;\n }", "public String getBaseUri() {\n\t\treturn baseUri;\n\t}", "public void setHyperlinkBase(String hyperlinkBase)\r\n {\r\n m_hyperlinkBase = hyperlinkBase;\r\n }", "public Assets() {\n\t\tinit();\n\t}", "public static void SetBaseAddress(String baseAddress) {\n\t\t// Load Projects Settings XML file\n\t\tDocument doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + \"\\\\ProjectSettings.xml\");\n\t\t// Get the <root> element of the Document\n\t\torg.w3c.dom.Element root = doc.getDocumentElement();\n\t\t// Remove previous entry\n\t\tNode previousBaseAddress = null;\n\t\ttry {\n\t\t\tpreviousBaseAddress = root.getElementsByTagName(\"baseAddress\").item(0);\n\t\t}\n\t\tcatch (Exception ex) { /* do nothing */ }\n\t\tif (previousBaseAddress != null) {\n\t\t\troot.removeChild(previousBaseAddress);\n\t\t}\n\t\t// Create a child node for <baseAddress value=\"{baseAddress}\">\n\t\torg.w3c.dom.Element baseAddressNode = doc.createElement(\"baseAddress\");\n\t\tbaseAddressNode.setAttribute(\"value\", baseAddress);\n\t root.appendChild(baseAddressNode);\n\t // Save document to disk\n\t Utilities.writeDocumentToFile(doc, new File(IDE.projectFolderPath + \"\\\\ProjectSettings.xml\"));\n\t}", "public void setHeadImgurl(String headImgurl) {\n this.headImgurl = headImgurl;\n }", "public void setHTTP_URL(String url) {\r\n\t\ttry {\r\n\t\t\tURL u = new URL(url);\r\n\t\t\tu.toURI();\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t} catch (URISyntaxException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tthis.settings.setProperty(\"HTTP_URL\", url);\r\n\t\tthis.saveChanges();\r\n\t}", "void setUrl(String url) {\n this.url = Uri.parse(url);\n }", "public static String UrlToHit(){\n\t\treturn BaseURL;\n\t}", "public java.lang.String getBaseUrl() {\n return bugQuery.getBaseUrl();\n }", "private String getBaseURL(Document dom) {\n String baseURLValue = null;\n \n //get the root element\n Element element = dom.getDocumentElement();\n \n //get a nodelist of elements\n \n NodeList nl = element.getElementsByTagName(\"baseURL\");\n if(nl != null && nl.getLength() > 0) {\n for(int i = 0 ; i < nl.getLength();i++) {\n //get the list element\n Element baseURL = (Element)nl.item(i);\n baseURLValue = baseURL.getTextContent();\n }\n }\n \n return baseURLValue;\n }", "public String getBaseMediaUrl() {\n return (String) get(\"base_media_url\");\n }", "public void setUrl(URL url)\n {\n this.url = url;\n }", "public static void init(URL banksapiBaseUrl) {\n if (BANKSapi.banksapiBaseUrl == null) {\n BANKSapi.banksapiBaseUrl = banksapiBaseUrl;\n } else {\n throw new IllegalStateException(\"init(URL) called but base URL is already initialized\");\n }\n }", "public void setURL(String _url) { url = _url; }", "public void setBase(LocatorIF base_address) {\n this.base_address = base_address;\n }", "public void setDefaultUrl(String url) {\n\t\tthis.defaultUrl = url;\n\t}", "public String getBaseURI(){\r\n\t\t \r\n\t\t String uri = properties.getProperty(\"baseuri\");\r\n\t\t if(uri != null) return uri;\r\n\t\t else throw new RuntimeException(\"baseuri not specified in the configuration.properties file.\");\r\n\t }", "@Override\n public String getBaseUrl() {\n return MobileiaTrivia.getBaseUrl();\n }", "public static String getModuleBaseUrl(HttpServletRequest request) {\n\t String requestedUri = request.getRequestURI();\n\t int contextEnd = request.getContextPath().length();\n\t int folderEnd = requestedUri.lastIndexOf('/') + 1;\n\t return requestedUri.substring(contextEnd, folderEnd);\n\t }", "public void setFileUrl(String fileUrl);", "@Override\n public String getBaseUri() {\n return null;\n }", "public void base() {\n APIlib.getInstance().addJSLine(jsBase + \".base();\");\n }", "public void setBasedir( String basedir )\n {\n setBasedir( new File( basedir.replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar ) ) );\n }", "private Assets (){}", "public void setSource(URL url) throws IOException {\n\t\tFile f = new File(url.getFile());\n\t\tif (f.isAbsolute()) {\n\t\t\tsourceFile = url;\n\t\t\timg = ImageIO.read(f);\n\t\t\tthis.isRelativePath = false;\n\t\t} else {\n\t\t\tsourceFile = new URL(SymbologyFactory.SymbolLibraryPath\n\t\t\t\t\t+ File.separator + f.getPath());\n\t\t\timg = ImageIO.read(f);\n\t\t\tthis.isRelativePath = true;\n\t\t}\n\t}", "public void setUploadUrl( String url_ ) {\n\t\tif (url_ != null) {\n\t\t\tphotoUrl = url_;\n\t\t} else {\n\t\t\tphotoUrl = \"http://199.58.116.35:8081/fotaflo-test/pictures/upload\";\n\t\t}\n\t\tlog( \"photoUrl \" + photoUrl, Log.Level.Information );\n\t}", "CreateS3VolumeRequestBuilder setRootUrl(String rootUrl);" ]
[ "0.7060854", "0.6997099", "0.69368446", "0.6917592", "0.6784903", "0.67630684", "0.6735419", "0.65674716", "0.6355061", "0.63327396", "0.63293624", "0.6313462", "0.62785", "0.62785", "0.6235193", "0.6209587", "0.6197831", "0.61932427", "0.61932427", "0.61883396", "0.6184741", "0.61679834", "0.6163228", "0.61200213", "0.60625064", "0.5938128", "0.5922488", "0.5905358", "0.5896748", "0.5885693", "0.5878729", "0.5864701", "0.5828774", "0.5762025", "0.5748341", "0.5736416", "0.5734454", "0.56631213", "0.5655792", "0.5651665", "0.56384975", "0.561267", "0.56099117", "0.5594155", "0.5547229", "0.5535785", "0.5489728", "0.5479402", "0.5468058", "0.5458475", "0.5457953", "0.5456204", "0.5429456", "0.54266495", "0.5421557", "0.54197973", "0.5416493", "0.54124117", "0.5407579", "0.54046214", "0.5365482", "0.5364339", "0.5364339", "0.53641653", "0.53449714", "0.53424084", "0.5338736", "0.5335212", "0.53305733", "0.5320533", "0.53152776", "0.52872443", "0.527722", "0.5276325", "0.52539045", "0.5238962", "0.5237087", "0.5222622", "0.52143", "0.52109456", "0.51987326", "0.51831436", "0.5159352", "0.51550734", "0.5148252", "0.514737", "0.5135308", "0.51296157", "0.51191103", "0.5110982", "0.5107115", "0.5101291", "0.5095468", "0.50948215", "0.5070128", "0.50669146", "0.5063602", "0.5063436", "0.50633097", "0.5054125" ]
0.7184821
0
Disables parallel fetching of assets during PDF creation. Useful if your asset host has strict rate limiting.
@javax.annotation.Nullable @ApiModelProperty(value = "Disables parallel fetching of assets during PDF creation. Useful if your asset host has strict rate limiting.") @JsonProperty(JSON_PROPERTY_NO_PARALLEL_DOWNLOADS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getNoParallelDownloads() { return noParallelDownloads; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void disableConcurrency() {\n concurrent = false;\n }", "public static void disable() {\n if (lock.compareAndSet(false, true)) {\n\n RxJavaPlugins.setOnCompletableAssembly(null);\n RxJavaPlugins.setOnSingleAssembly(null);\n RxJavaPlugins.setOnMaybeAssembly(null);\n\n RxJavaPlugins.setOnObservableAssembly(null);\n RxJavaPlugins.setOnFlowableAssembly(null);\n RxJavaPlugins.setOnConnectableObservableAssembly(null);\n RxJavaPlugins.setOnConnectableFlowableAssembly(null);\n\n RxJavaPlugins.setOnParallelAssembly(null);\n\n lock.set(false);\n }\n }", "@Override\n public boolean isParallelPaintingSupported() {\n return false;\n }", "public static void performanceCountDisable() { }", "void unsetRequiredResources();", "static public void falsifyProcessingJobs()\n {\n processingJobs = false;\n }", "void disable()\n{\n synchronized (this) {\n is_enabled = false;\n request_queue.clear();\n for (DymonPatchRequest ar : active_requests) removeActive(ar);\n if (request_timer != null) request_timer.cancel();\n request_timer = null;\n }\n}", "@MainThread\n @Override\n protected void onStopLoading() {\n super.onStopLoading();\n cancelLoadHelper();\n }", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // not necessary for proj1\n }", "public void disabledInit() {\n\t\tvision.disableCameraSaving();\n\t}", "public static void cancelAll() {\n\n ImageDownloadTask[] taskArray = new ImageDownloadTask[sInstance.downloadWorkQueue.size()];\n\n // Populates the array with the task objects in the queue\n sInstance.downloadWorkQueue.toArray(taskArray);\n\n /*\n * Locks on the singleton to ensure that other processes aren't mutating Threads, then\n * iterates over the array of tasks and interrupts the task's current Thread.\n */\n synchronized (sInstance) {\n for (ImageDownloadTask imageDownloadTask : taskArray) {\n Thread thread = imageDownloadTask.getCurrentThread();\n if (null != thread) {\n thread.interrupt();\n }\n }\n }\n }", "private void cancelInit() {\n if (initPageDataTask != null) {\r\n initPageDataTask.cancel(true);\r\n }\r\n }", "@MainThread\n @Override\n protected void onForceLoad() {\n super.onForceLoad();\n cancelLoadHelper();\n\n makeRequest();\n }", "public boolean acquireNoWait(boolean forMerge) {\r\n return true;\r\n }", "@Override\n public void setParallel(boolean parallel) {\n super.setParallel(true);\n }", "private void downloadImagesIfMissing()\t{\n\n\t\tarrayOfImageIDsToDownload = getArrayOfMissingImages(getImageIDs(shopName));\t\t\n\n\t\tif(networkIsAvailable() && !(arrayOfImageIDsToDownload.length == 1 && arrayOfImageIDsToDownload[0].equals(\"\")) && arrayOfImageIDsToDownload.length != 0 )\t{\n\n\t\t\tpDialog = new ProgressDialog (DisplayActivity.this);\n\t\t\tpDialog.setMessage(\"Downloading \"+arrayOfImageIDsToDownload.length+\" Image(s)...\");\n\t\t\tpDialog.show();\t\n\n\t\t\timageCounter=0;\n\t\t\t\n\t\t\tString url = \"http://www.loyal3.co.za/downloadImage?image=\"+arrayOfImageIDsToDownload[imageCounter].trim()+\"&res=\"+screenSize();\n\n\t\t\tnew DownloadAdvertImages().execute(url);\n\n\t\t} else {\n\n\t\t\tsetLogo(getLogoID(shopName), logoButton);\n\t\t\t\t\t\n\t\t\tsetAdvertFlipper();\t//Mag dalk die 2 moet omruil.\n\t\t\tsetAdvertImages();\n\t\t}\n\t}", "boolean isDoNotRegenerateJspFiles();", "public void cancelAllImages() {\n int size = currentImageRequests.size();\n for (int i = 0; i < size; i++) {\n currentImageRequests.valueAt(i).cancel();\n }\n }", "public void releaseCachedPages() {\n cache.removeAll();\n }", "private void optimizeForWebPerformance() {\n if (usesDeploymentConfig()) {\n getFrameworkSettings().setSerializer(new DeflatedJavaSerializer(getApplicationKey()));\n } else {\n getResourceSettings().setCachingStrategy(new NoOpResourceCachingStrategy());\n }\n\n getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);\n }", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "@MainThread\n @Override\n protected void onReset() {\n super.onReset();\n\n onStopLoading();\n\n releaseResources(mResult);\n mResult = null;\n\n doProgressSafe(false);\n }", "public void stop(){\n log.info(\"PageDownloaderPool stopped.\");\n downloaders.forEach(PageDownloader::doStop);\n }", "public void abortAllSingleDownloadControllers() {\r\n\r\n while (true) {\r\n java.util.List<SingleDownloadController> list = new ArrayList<SingleDownloadController>();\r\n synchronized (downloadControllers) {\r\n list.addAll(downloadControllers);\r\n }\r\n for (SingleDownloadController con : list) {\r\n if (con.isAlive() && !con.isAborted()) {\r\n con.abortDownload();\r\n }\r\n }\r\n boolean alive = false;\r\n for (SingleDownloadController con : list) {\r\n if (con.isAlive()) {\r\n alive = true;\r\n break;\r\n }\r\n }\r\n if (alive == false) break;\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException e) {\r\n logger.log(e);\r\n return;\r\n }\r\n }\r\n }", "public void acquire(boolean forMerge) {\r\n return;\r\n }", "private void downloadInBackground(){\n\t\tdownloadResourceInBackground(imageUrl1, R.id.dl_image_1, R.id.dl_progressbar_1);\n\t\tdownloadResourceInBackground(imageUrl2, R.id.dl_image_2, R.id.dl_progressbar_2);\n\t\tdownloadResourceInBackground(imageUrl3, R.id.dl_image_3, R.id.dl_progressbar_3);\n\t\tdownloadResourceInBackground(imageUrl4, R.id.dl_image_4, R.id.dl_progressbar_4);\n\t\tdownloadResourceInBackground(imageUrl5, R.id.dl_image_5, R.id.dl_progressbar_5);\n\t}", "public boolean loadProgress() {\n return false;\n }", "public void prepareForDeferredProcessing() {\n\n }", "@RequestMapping(value = \"/downloadBulkPdf\", method = RequestMethod.GET)\r\n\tpublic @ResponseBody\r\n\tString downloadBulkPdf(@ModelAttribute(\"groupDownload\") BulkDownloadTO bulkDownloadTO, HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n\t\tlogger.log(IAppLogger.INFO, \"Enter: downloadBulkPdf()\");\r\n\t\tString currentUser = (String) request.getSession().getAttribute(IApplicationConstants.CURRUSER);\r\n\t\tString currentUserId = (String) request.getSession().getAttribute(IApplicationConstants.CURRUSERID);\r\n\t\tString currentOrg = (String) request.getSession().getAttribute(IApplicationConstants.CURRORG);\r\n\t\tString customer = (String) request.getSession().getAttribute(IApplicationConstants.CUSTOMER);\r\n\t\tlong currCustomer = (customer == null) ? 0 : Long.parseLong(customer);\r\n\t\tString status = \"Error\";\r\n\t\ttry {\r\n\t\t\t// remove retain bulk value\r\n\t\t\trequest.getSession().removeAttribute(\"retainBulkDownloadTO\");\r\n\t\t\tString fileType = request.getParameter(\"fileType\");\r\n\t\t\tString nodeid = (String) request.getParameter(\"tenantId\");\r\n\t\t\tString adminYear = (String) request.getParameter(\"AdminYear\");\r\n\t\t\tString reportUrl = (String) request.getParameter(\"reportUrl\");\r\n\t\t\tString docName = CustomStringUtil.appendString(currentUser, \" \", Utils.getDateTime(), \"_Querysheet.pdf\");\r\n\r\n\t\t\tString school = null, corp = null, orgClass = null, testProgram = null, grade = null;\r\n\t\t\tif (!\"CR\".equals(fileType)) {\r\n\t\t\t\tMap<String, Object> parameters = null;\r\n\t\t\t\tparameters = (Map<String, Object>) request.getSession().getAttribute(IApplicationConstants.REPORT_TYPE_CUSTOM + \"parameters\" + reportUrl);\r\n\t\t\t\twhile (parameters == null) {\r\n\t\t\t\t\tlogger.log(IAppLogger.WARN, \"Waiting for custom report parameter .... \");\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tparameters = (Map<String, Object>) request.getSession().getAttribute(IApplicationConstants.REPORT_TYPE_CUSTOM + \"parameters\" + reportUrl);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tadminYear = (String) parameters.get(\"p_adminYear\");\r\n\t\t\t\tschool = (String) parameters.get(\"p_school\");\r\n\t\t\t\tcorp = (String) parameters.get(\"p_corp\");\r\n\t\t\t\torgClass = (String) parameters.get(\"p_class\");\r\n\t\t\t\tgrade = (String) parameters.get(\"p_gradeid\");\r\n\t\t\t\ttestProgram = (String) parameters.get(\"p_testProgram\");\r\n\t\t\t}\r\n\t\t\tbulkDownloadTO.setQuerysheetFile(docName);\r\n\t\t\tbulkDownloadTO.setUdatedBy((currentUserId == null) ? 0 : Long.parseLong(currentUserId));\r\n\t\t\tbulkDownloadTO.setUsername(currentUser);\r\n\t\t\tbulkDownloadTO.setTestAdministration(adminYear);\r\n\t\t\tbulkDownloadTO.setSchool(school);\r\n\t\t\tbulkDownloadTO.setCorp(corp);\r\n\t\t\tbulkDownloadTO.setOrgClass(orgClass);\r\n\t\t\tbulkDownloadTO.setTestProgram(testProgram);\r\n\t\t\tbulkDownloadTO.setGrade(grade);\r\n\t\t\tbulkDownloadTO.setCustomerId(customer);\r\n\t\t\tbulkDownloadTO.setReportUrl(reportUrl);\r\n\t\t\tbulkDownloadTO.setRequestType(fileType);\r\n\t\t\tbulkDownloadTO.setDownloadMode(request.getParameter(\"mode\"));\r\n\r\n\t\t\tbulkDownloadTO = inorsService.createJob(bulkDownloadTO);\r\n\r\n\t\t\tString querysheetFile = PdfGenerator.generateQuerysheet(bulkDownloadTO, propertyLookup);\r\n\r\n\t\t\tlogger.log(IAppLogger.INFO, \"sending messsage --------------- \");\r\n\t\t\tmessageProducer.sendJobForProcessing(String.valueOf(bulkDownloadTO.getJobId()), Utils.getContractName());\r\n\r\n\t\t\tif (bulkDownloadTO.getJobId() != 0)\r\n\t\t\t\tstatus = \"Success\";\r\n\r\n\t\t\tresponse.setContentType(\"application/json\");\r\n\t\t\tresponse.getWriter().write(\"\");\r\n\t\t\tresponse.getWriter().write(\"{\\\"status\\\":\\\"\" + status + \"\\\"}\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.log(IAppLogger.ERROR, e.getMessage(), e);\r\n\t\t\te.printStackTrace();\r\n\t\t\tresponse.getWriter().write(\"{\\\"status\\\":\\\"\" + status + \"\\\"}\");\r\n\t\t}\r\n\t\tlogger.log(IAppLogger.INFO, \"Exit: downloadBulkPdf()\");\r\n\t\treturn null;\r\n\t}", "public void disable();", "public void cancelAllRegisteredAsyncs(){\n\n if(asyncTaskArrayList.size() == 0){\n return;\n }\n\n for(AsyncTask asyncTask : asyncTaskArrayList){\n if(asyncTask.isCancelled()){\n asyncTask.cancel(true);\n }\n }\n\n theMovieDBObjectArrayList.clear();\n inActive = true;\n }", "public void disable() {\r\n m_enabled = false;\r\n useOutput(0, 0);\r\n }", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "@Override\n\t\t\t\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (webViewSize == 0)\n\t\t\t\t\t\t\t\t\t\t\twebViewSize = 1000;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPDFImage.sShowImages = true; // show images\n\t\t\t\t\t\t\t\t\t PDFPaint.s_doAntiAlias = true; // make text smooth\n\t\t\t\t\t\t\t\t\t HardReference.sKeepCaches = true; // save images in cache\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\tfinal String html = PDFUtil.convertToHtml(webViewSize, fileImg);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tgetActivity().runOnUiThread(new Runnable(){\n\n\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\t\t\twebView.loadDataWithBaseURL(\"\", html, \"text/html\",\"UTF-8\", \"\");\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.gc();\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\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\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\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\treturn null;\n\t\t\t\t\t\t\t\t}", "@Override\n public boolean isConcurrentFontManagementSupported() {\n return false;\n }", "protected Throwable doInBackground(final Void... p0) {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 1: astore_2 \n // 2: aload_0 \n // 3: getfield android/support/v4/print/PrintHelperKitkat$2.val$cancellationSignal:Landroid/os/CancellationSignal;\n // 6: invokevirtual android/os/CancellationSignal.isCanceled:()Z\n // 9: ifeq 16\n // 12: aload_2 \n // 13: astore_1 \n // 14: aload_1 \n // 15: areturn \n // 16: new Landroid/print/pdf/PrintedPdfDocument;\n // 19: astore_3 \n // 20: aload_3 \n // 21: aload_0 \n // 22: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 25: getfield android/support/v4/print/PrintHelperKitkat.mContext:Landroid/content/Context;\n // 28: aload_0 \n // 29: getfield android/support/v4/print/PrintHelperKitkat$2.val$pdfAttributes:Landroid/print/PrintAttributes;\n // 32: invokespecial android/print/pdf/PrintedPdfDocument.<init>:(Landroid/content/Context;Landroid/print/PrintAttributes;)V\n // 35: aload_0 \n // 36: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 39: aload_0 \n // 40: getfield android/support/v4/print/PrintHelperKitkat$2.val$bitmap:Landroid/graphics/Bitmap;\n // 43: aload_0 \n // 44: getfield android/support/v4/print/PrintHelperKitkat$2.val$pdfAttributes:Landroid/print/PrintAttributes;\n // 47: invokevirtual android/print/PrintAttributes.getColorMode:()I\n // 50: invokestatic android/support/v4/print/PrintHelperKitkat.access$100:(Landroid/support/v4/print/PrintHelperKitkat;Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;\n // 53: astore 4\n // 55: aload_0 \n // 56: getfield android/support/v4/print/PrintHelperKitkat$2.val$cancellationSignal:Landroid/os/CancellationSignal;\n // 59: invokevirtual android/os/CancellationSignal.isCanceled:()Z\n // 62: istore 5\n // 64: aload_2 \n // 65: astore_1 \n // 66: iload 5\n // 68: ifne 14\n // 71: aload_3 \n // 72: iconst_1 \n // 73: invokevirtual android/print/pdf/PrintedPdfDocument.startPage:(I)Landroid/graphics/pdf/PdfDocument$Page;\n // 76: astore 6\n // 78: aload_0 \n // 79: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 82: getfield android/support/v4/print/PrintHelperKitkat.mIsMinMarginsHandlingCorrect:Z\n // 85: ifeq 216\n // 88: new Landroid/graphics/RectF;\n // 91: astore_1 \n // 92: aload_1 \n // 93: aload 6\n // 95: invokevirtual android/graphics/pdf/PdfDocument$Page.getInfo:()Landroid/graphics/pdf/PdfDocument$PageInfo;\n // 98: invokevirtual android/graphics/pdf/PdfDocument$PageInfo.getContentRect:()Landroid/graphics/Rect;\n // 101: invokespecial android/graphics/RectF.<init>:(Landroid/graphics/Rect;)V\n // 104: aload_0 \n // 105: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 108: aload 4\n // 110: invokevirtual android/graphics/Bitmap.getWidth:()I\n // 113: aload 4\n // 115: invokevirtual android/graphics/Bitmap.getHeight:()I\n // 118: aload_1 \n // 119: aload_0 \n // 120: getfield android/support/v4/print/PrintHelperKitkat$2.val$fittingMode:I\n // 123: invokestatic android/support/v4/print/PrintHelperKitkat.access$200:(Landroid/support/v4/print/PrintHelperKitkat;IILandroid/graphics/RectF;I)Landroid/graphics/Matrix;\n // 126: astore 7\n // 128: aload_0 \n // 129: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 132: getfield android/support/v4/print/PrintHelperKitkat.mIsMinMarginsHandlingCorrect:Z\n // 135: ifeq 313\n // 138: aload 6\n // 140: invokevirtual android/graphics/pdf/PdfDocument$Page.getCanvas:()Landroid/graphics/Canvas;\n // 143: aload 4\n // 145: aload 7\n // 147: aconst_null \n // 148: invokevirtual android/graphics/Canvas.drawBitmap:(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V\n // 151: aload_3 \n // 152: aload 6\n // 154: invokevirtual android/print/pdf/PrintedPdfDocument.finishPage:(Landroid/graphics/pdf/PdfDocument$Page;)V\n // 157: aload_0 \n // 158: getfield android/support/v4/print/PrintHelperKitkat$2.val$cancellationSignal:Landroid/os/CancellationSignal;\n // 161: invokevirtual android/os/CancellationSignal.isCanceled:()Z\n // 164: istore 5\n // 166: iload 5\n // 168: ifeq 340\n // 171: aload_3 \n // 172: invokevirtual android/print/pdf/PrintedPdfDocument.close:()V\n // 175: aload_0 \n // 176: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 179: astore_1 \n // 180: aload_1 \n // 181: ifnull 191\n // 184: aload_0 \n // 185: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 188: invokevirtual android/os/ParcelFileDescriptor.close:()V\n // 191: aload_2 \n // 192: astore_1 \n // 193: aload 4\n // 195: aload_0 \n // 196: getfield android/support/v4/print/PrintHelperKitkat$2.val$bitmap:Landroid/graphics/Bitmap;\n // 199: if_acmpeq 14\n // 202: aload 4\n // 204: invokevirtual android/graphics/Bitmap.recycle:()V\n // 207: aload_2 \n // 208: astore_1 \n // 209: goto 14\n // 212: astore_1 \n // 213: goto 14\n // 216: new Landroid/print/pdf/PrintedPdfDocument;\n // 219: astore 7\n // 221: aload 7\n // 223: aload_0 \n // 224: getfield android/support/v4/print/PrintHelperKitkat$2.this$0:Landroid/support/v4/print/PrintHelperKitkat;\n // 227: getfield android/support/v4/print/PrintHelperKitkat.mContext:Landroid/content/Context;\n // 230: aload_0 \n // 231: getfield android/support/v4/print/PrintHelperKitkat$2.val$attributes:Landroid/print/PrintAttributes;\n // 234: invokespecial android/print/pdf/PrintedPdfDocument.<init>:(Landroid/content/Context;Landroid/print/PrintAttributes;)V\n // 237: aload 7\n // 239: iconst_1 \n // 240: invokevirtual android/print/pdf/PrintedPdfDocument.startPage:(I)Landroid/graphics/pdf/PdfDocument$Page;\n // 243: astore 8\n // 245: new Landroid/graphics/RectF;\n // 248: astore_1 \n // 249: aload_1 \n // 250: aload 8\n // 252: invokevirtual android/graphics/pdf/PdfDocument$Page.getInfo:()Landroid/graphics/pdf/PdfDocument$PageInfo;\n // 255: invokevirtual android/graphics/pdf/PdfDocument$PageInfo.getContentRect:()Landroid/graphics/Rect;\n // 258: invokespecial android/graphics/RectF.<init>:(Landroid/graphics/Rect;)V\n // 261: aload 7\n // 263: aload 8\n // 265: invokevirtual android/print/pdf/PrintedPdfDocument.finishPage:(Landroid/graphics/pdf/PdfDocument$Page;)V\n // 268: aload 7\n // 270: invokevirtual android/print/pdf/PrintedPdfDocument.close:()V\n // 273: goto 104\n // 276: astore_1 \n // 277: aload_3 \n // 278: invokevirtual android/print/pdf/PrintedPdfDocument.close:()V\n // 281: aload_0 \n // 282: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 285: astore_2 \n // 286: aload_2 \n // 287: ifnull 297\n // 290: aload_0 \n // 291: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 294: invokevirtual android/os/ParcelFileDescriptor.close:()V\n // 297: aload 4\n // 299: aload_0 \n // 300: getfield android/support/v4/print/PrintHelperKitkat$2.val$bitmap:Landroid/graphics/Bitmap;\n // 303: if_acmpeq 311\n // 306: aload 4\n // 308: invokevirtual android/graphics/Bitmap.recycle:()V\n // 311: aload_1 \n // 312: athrow \n // 313: aload 7\n // 315: aload_1 \n // 316: getfield android/graphics/RectF.left:F\n // 319: aload_1 \n // 320: getfield android/graphics/RectF.top:F\n // 323: invokevirtual android/graphics/Matrix.postTranslate:(FF)Z\n // 326: pop \n // 327: aload 6\n // 329: invokevirtual android/graphics/pdf/PdfDocument$Page.getCanvas:()Landroid/graphics/Canvas;\n // 332: aload_1 \n // 333: invokevirtual android/graphics/Canvas.clipRect:(Landroid/graphics/RectF;)Z\n // 336: pop \n // 337: goto 138\n // 340: new Ljava/io/FileOutputStream;\n // 343: astore_1 \n // 344: aload_1 \n // 345: aload_0 \n // 346: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 349: invokevirtual android/os/ParcelFileDescriptor.getFileDescriptor:()Ljava/io/FileDescriptor;\n // 352: invokespecial java/io/FileOutputStream.<init>:(Ljava/io/FileDescriptor;)V\n // 355: aload_3 \n // 356: aload_1 \n // 357: invokevirtual android/print/pdf/PrintedPdfDocument.writeTo:(Ljava/io/OutputStream;)V\n // 360: aload_3 \n // 361: invokevirtual android/print/pdf/PrintedPdfDocument.close:()V\n // 364: aload_0 \n // 365: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 368: astore_1 \n // 369: aload_1 \n // 370: ifnull 380\n // 373: aload_0 \n // 374: getfield android/support/v4/print/PrintHelperKitkat$2.val$fileDescriptor:Landroid/os/ParcelFileDescriptor;\n // 377: invokevirtual android/os/ParcelFileDescriptor.close:()V\n // 380: aload_2 \n // 381: astore_1 \n // 382: aload 4\n // 384: aload_0 \n // 385: getfield android/support/v4/print/PrintHelperKitkat$2.val$bitmap:Landroid/graphics/Bitmap;\n // 388: if_acmpeq 14\n // 391: aload 4\n // 393: invokevirtual android/graphics/Bitmap.recycle:()V\n // 396: aload_2 \n // 397: astore_1 \n // 398: goto 14\n // 401: astore_2 \n // 402: goto 297\n // 405: astore_1 \n // 406: goto 380\n // 409: astore_1 \n // 410: goto 191\n // Exceptions:\n // Try Handler\n // Start End Start End Type \n // ----- ----- ----- ----- ---------------------\n // 2 12 212 216 Ljava/lang/Throwable;\n // 16 64 212 216 Ljava/lang/Throwable;\n // 71 104 276 313 Any\n // 104 138 276 313 Any\n // 138 166 276 313 Any\n // 171 180 212 216 Ljava/lang/Throwable;\n // 184 191 409 413 Ljava/io/IOException;\n // 184 191 212 216 Ljava/lang/Throwable;\n // 193 207 212 216 Ljava/lang/Throwable;\n // 216 273 276 313 Any\n // 277 286 212 216 Ljava/lang/Throwable;\n // 290 297 401 405 Ljava/io/IOException;\n // 290 297 212 216 Ljava/lang/Throwable;\n // 297 311 212 216 Ljava/lang/Throwable;\n // 311 313 212 216 Ljava/lang/Throwable;\n // 313 337 276 313 Any\n // 340 360 276 313 Any\n // 360 369 212 216 Ljava/lang/Throwable;\n // 373 380 405 409 Ljava/io/IOException;\n // 373 380 212 216 Ljava/lang/Throwable;\n // 382 396 212 216 Ljava/lang/Throwable;\n // \n // The error that occurred was:\n // \n // java.lang.IndexOutOfBoundsException: Index 199 out-of-bounds for length 199\n // at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)\n // at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)\n // at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)\n // at java.base/java.util.Objects.checkIndex(Objects.java:372)\n // at java.base/java.util.ArrayList.get(ArrayList.java:439)\n // at com.strobel.decompiler.ast.AstBuilder.convertToAst(AstBuilder.java:3321)\n // at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:113)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:211)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1164)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:330)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:251)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:126)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "void unsetPoolRaces();", "void hideQueuingBuildProgress();", "public void setProgress( boolean onOff );", "public void init() {\n // TODO start asynchronous download of heavy resources\n }", "private void cancelBitmapFetcher() {\n if (null != mBitmapFetcher) {\n mBitmapFetcher.cancel();\n mBitmapFetcher = null;\n }\n }", "@Override\n\t\t\tprotected Bitmap doInBackground(String... params) {\n\t\t\t\tString file = null;\n\t\t\t\tfor (int i = 0; i < getCount(); i++) {\n\t\t\t\t\tif (FunctionConfig.isPage_effect_no_radom_style() && i != 0) {\n\t\t\t\t\t\tfile = path + (i + 1) + \".png\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfile = path + i + \".png\";\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tBitmap bmp = Tools.getPurgeableBitmap(mContext\n\t\t\t\t\t\t\t\t.getAssets().open(file), -1, -1);// BitmapFactory.decodeStream(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// mContext.getAssets().open(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// file ) );\n\t\t\t\t\t\t// fileList.add( i , bmp );\n\t\t\t\t\t\tmMemoryCache.put(i, bmp);\n\t\t\t\t\t} catch (IOException 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} catch (OutOfMemoryError error) {\n\t\t\t\t\t\terror.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}", "public void disable() {\n\t\tm_enabled = false;\n\t\tuseOutput(0);\n\t}", "public void clearOffScreenResources() {\n int firstPosition = 0;\n int lastPosition = getItemCount();\n int offScreenKeepInCacheCount = mSpanCount;\n RecyclerView recyclerView = getRecyclerView();\n if (recyclerView != null && recyclerView.getLayoutManager() instanceof LinearLayoutManager) {\n LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();\n firstPosition = layoutManager.findFirstVisibleItemPosition();\n lastPosition = layoutManager.findLastVisibleItemPosition();\n }\n if (firstPosition == RecyclerView.NO_POSITION || lastPosition == RecyclerView.NO_POSITION) {\n return;\n }\n\n if (sDebug)\n Log.d(TAG, \"clearOffScreenResources:first:\" + firstPosition + \";last:\" + lastPosition);\n\n Iterator<Integer> it = mCachedPageList.iterator();\n while (it.hasNext()) {\n int page = it.next();\n int position = page - 1;\n\n if (position < (firstPosition - offScreenKeepInCacheCount) || position > (lastPosition + offScreenKeepInCacheCount)) {\n // not in range: clear BitmapDrawable cache, recycle Bitmap\n try {\n Map<String, Object> source = getItem(position);\n if (source != null) {\n // clear the cache\n mDataLock.lock();\n source.put(THUMB_IMAGE, null);\n mDataLock.unlock();\n if (sDebug)\n Log.d(TAG, \"remove image cache for page: \" + page + \"; position: \" + position);\n // this page is no longer cached\n it.remove();\n }\n } catch (Exception ignored) {\n }\n } // else in range: do nothing\n }\n // cancel all off screen tasks as well\n for (int i = 0; i < mTaskList.size(); i++) {\n int page = mTaskList.keyAt(i);\n int position = page - 1;\n if (position < (firstPosition - offScreenKeepInCacheCount) || position > (lastPosition + offScreenKeepInCacheCount)) {\n LoadThumbnailTask task = mTaskList.valueAt(i);\n if (null != task) {\n task.cancel(true);\n }\n } // else in range: do nothing\n }\n }", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // only necessary for lab5\n bufferPool.remove(pid);\n }", "void disable();", "void disable();", "public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }", "public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "void disable() {\n }", "public final void releaseNoCopy() {\n explicitlyLocked = false;\n byteBase.unlockNoCopy();\n }", "boolean ignoreExternal();", "public static void disablePermissionCache() {\n sPermissionCache.disableLocal();\n }", "void hideMainLoadingWheel();", "@Override\r\n\t\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n public void onDisable() {\n super.onDisable();\n running = false;\n }", "@Override\n protected void onStopLoading() {\n cancelLoad();\n }", "public void startInlineDownloading() {\n inDownloadingProgress.add(photoId);\n if (fullPhotosCaching.containsKey(photoId)) {\n final PhotoCache photoCache = fullPhotosCaching.get(photoId);\n saveImageFile(photoCache, DEFAULT_PATH, MAX_QUALITY, this);\n }\n else {\n getPhotoCache(photoId, DEFAULT_PATH, context, this);\n }\n }", "@Override\n protected void onStopLoading() {\n cancelLoad();\n }", "public void setPrefetch (boolean flag) throws ModelException;", "@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }", "@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }", "@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }", "private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}", "@Override\n public void preAllocateIds(int requestSize) {\n // do nothing by default\n }", "public static void naive(int numResources){\n while(terminatedCount < taskList.size()){\n\n releaseArr = new int [numResources];\n boolean wait = addressWaiting();\n boolean notWait = addressNonWaiting();\n\n while((wait == false && notWait == false) && !checkResources() && terminatedCount < taskList.size() ){\n for(Task t : taskList){\n if(t.terminateTime == -1 && (!t.isAborted)){ // not terminated yet\n releaseAll(t);\n\n t.isAborted = true;\n terminatedCount ++;\n removeWaiting(t.taskNumber);\n\n break; // break out of forloop\n }\n }\n updateResources();\n }\n\n updateResources();\n time += 1;\n\n for(Instruction i : removeSet){\n waitingList.remove(i);\n }\n Collections.sort(waitingList);\n }\n }", "public void bufferBillingProjects() {\n int creationAttempts = this.workbenchConfigProvider.get().billing.bufferRefillProjectsPerTask;\n for (int i = 0; i < creationAttempts; i++) {\n bufferBillingProject();\n }\n }", "public void disableBuildHotel(){\r\n\t\tbuildHotel = false;\r\n\t}", "public void cancelLoadUrl() {\n\t\t\n\t}", "public void _cancelAllRequests() throws Open4GLException\n {\n m_QuarixProgressOOConnectorImpl._cancelAllRequests();\n }", "public void setMultipleCriticalPaths(boolean multipleCriticalPaths)\r\n {\r\n m_multipleCriticalPaths = multipleCriticalPaths;\r\n }", "@Override\n\tpublic boolean allowMultithreading()\n\t{\n\t\treturn true;\n\t}", "private void refreshToDownloadTemplates ()\n\t{\n\t\tthis.toDownloadTemplates = new Vector<TemplateCycle>();\n\t\tfor (TemplateCycle fits : lockedTemplates) {\n\t\t\tif (fits.getStatus()==TemplateCycle.STATUS_LOCKED)\n\t\t\t{\n\t\t\t\tthis.toDownloadTemplates.add(fits);\n\t\t\t}\n\t\t}\n\t}", "@Override // com.android.settings.dashboard.DashboardFragment\n public boolean isParalleledControllers() {\n return true;\n }", "protected abstract void disable();", "@Override\nprotected void onStopLoading() {\n cancelLoad();\n }", "public void setCalculateMultipleCriticalPaths(boolean flag)\r\n {\r\n m_calculateMultipleCriticalPaths = flag;\r\n }", "public void prefetch() {\n\t}", "public void notDestroyable()\n\t{\n\t\tdestroyable = false;\n\t}", "@DISPID(1611006052) //= 0x60060064. The runtime will prefer the VTID if present\n @VTID(128)\n void linkedExternalReferencesOnlyOnPublication(\n boolean oOnlyForPublishedElements);", "public void release(){\n tex_particles.release();\n }", "private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }", "@Override\n\tpublic String disableBulk() throws Throwable {\n\t\treturn null;\n\t}", "public void disable()\r\n\t{\r\n\t\tenabled = false;\r\n\t}", "public void cancelPendingPrintJobs()\n {\n printerSimulator.cancelPendingPrintJobs();\n }", "AgentPolicyBuilder disableCache();", "@Override\n public boolean isConcurrentWritableImageManagementSupported() {\n return false;\n }", "public void abortOptimizedBurstShot() {\n this.mCameraDevice.abortBurstShot();\n if (1 != this.mAppController.getSupportedHardwarelevel(this.mCameraId)) {\n lightlyRestartPreview();\n }\n }", "public final WuicFacadeBuilder disableMultipleConfigInTagSupport() {\n this.multipleConfigInTagSupport = Boolean.FALSE;\n return this;\n }", "@Override \n\t protected void onStopLoading() {\n\t // Attempt to cancel the current load task if possible.\n\t cancelLoad();\n\t }", "@Override \n\t protected void onStopLoading() {\n\t // Attempt to cancel the current load task if possible.\n\t cancelLoad();\n\t }", "public void unsetForceInline() {\n // For concurrent scenarios we should allow the flag to be already unset\n assert inlining == InlinePreference.Default || inlining == InlinePreference.ForceInline;\n inlining = InlinePreference.Default;\n }" ]
[ "0.5942475", "0.55865294", "0.50676", "0.5034377", "0.49322015", "0.4923102", "0.49218148", "0.48955762", "0.487562", "0.4827086", "0.47968176", "0.47792226", "0.47594333", "0.47252816", "0.46789512", "0.46759918", "0.46667063", "0.46511322", "0.46363372", "0.46330473", "0.46252552", "0.4615557", "0.4609335", "0.46016404", "0.46015024", "0.4595336", "0.45885158", "0.45866567", "0.45766076", "0.45643234", "0.45524734", "0.45457724", "0.45381546", "0.4533294", "0.45294675", "0.45223427", "0.45209813", "0.45081753", "0.45055458", "0.4502706", "0.44953793", "0.44929275", "0.44923127", "0.44914702", "0.4489631", "0.44893008", "0.44893008", "0.44835988", "0.44835988", "0.4481222", "0.4481222", "0.4481222", "0.4481222", "0.4481222", "0.4481222", "0.4481222", "0.44751513", "0.44664103", "0.44556886", "0.4449293", "0.44385436", "0.44348425", "0.44348425", "0.4427525", "0.44248867", "0.4410083", "0.4409576", "0.44022977", "0.44014907", "0.44014907", "0.44014907", "0.4386724", "0.43782187", "0.43738186", "0.43733618", "0.4372163", "0.4370657", "0.43665472", "0.43593976", "0.43578902", "0.4357294", "0.4357068", "0.43472224", "0.43389663", "0.43361363", "0.43355015", "0.43264067", "0.43251514", "0.43010414", "0.42978147", "0.42970896", "0.42942262", "0.42910987", "0.42876655", "0.42838362", "0.42729276", "0.42723826", "0.4259381", "0.4259381", "0.4251479" ]
0.67826855
0
Set the user for HTTP authentication.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the user for HTTP authentication.") @JsonProperty(JSON_PROPERTY_HTTP_USER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getHttpUser() { return httpUser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setAuthenticatedUser(HttpServletRequest req, HttpSession httpSess, String userName) {\n\t\t// Set the authentication\n\t\tauthComponent.setCurrentUser(userName);\n\n\t\t// Set up the user information\n\t\tUserTransaction tx = transactionService.getUserTransaction();\n\t\tNodeRef homeSpaceRef = null;\n\t\tUser user;\n\t\ttry {\n\t\t\ttx.begin();\n\t\t\tuser = new User(userName, authService.getCurrentTicket(), personService.getPerson(userName));\n\t\t\thomeSpaceRef = (NodeRef) nodeService.getProperty(personService.getPerson(userName), ContentModel.PROP_HOMEFOLDER);\n\t\t\tif(homeSpaceRef == null) {\n\t\t\t\tlogger.warn(\"Home Folder is null for user '\"+userName+\"', using company_home.\");\n\t\t\t\thomeSpaceRef = (NodeRef) nodeService.getRootNode(Repository.getStoreRef());\n\t\t\t}\n\t\t\tuser.setHomeSpaceId(homeSpaceRef.getId());\n\t\t\ttx.commit();\n\t\t} catch (Throwable ex) {\n\t\t\tlogger.error(ex);\n\n\t\t\ttry {\n\t\t\t\ttx.rollback();\n\t\t\t} catch (Exception ex2) {\n\t\t\t\tlogger.error(\"Failed to rollback transaction\", ex2);\n\t\t\t}\n\n\t\t\tif (ex instanceof RuntimeException) {\n\t\t\t\tthrow (RuntimeException) ex;\n\t\t\t} else {\n\t\t\t\tthrow new RuntimeException(\"Failed to set authenticated user\", ex);\n\t\t\t}\n\t\t}\n\n\t\t// Store the user\n\t\thttpSess.setAttribute(AuthenticationHelper.AUTHENTICATION_USER, user);\n\t\thttpSess.setAttribute(LoginBean.LOGIN_EXTERNAL_AUTH, Boolean.TRUE);\n\n\t\t// Set the current locale from the Accept-Lanaguage header if available\n\t\tLocale userLocale = parseAcceptLanguageHeader(req, m_languages);\n\n\t\tif (userLocale != null) {\n\t\t\thttpSess.setAttribute(LOCALE, userLocale);\n\t\t\thttpSess.removeAttribute(MESSAGE_BUNDLE);\n\t\t}\n\n\t\t// Set the locale using the session\n\t\tI18NUtil.setLocale(Application.getLanguage(httpSess));\n\n\t}", "public void setUser(String user)\n {\n _user = user;\n }", "void setUser(OSecurityUser user);", "void setAuthenticated(boolean b);", "public void setUser(String user) \r\n\t{\n\t\tthis.user = user;\r\n\t}", "public void setUser(String user) {\r\n this.user = user;\r\n }", "private void setUser(HttpServletRequest req, Request sensorReq) {\n\t\tObject userObject = req.getAttribute(\"__user\");\n\t\tif ( null == userObject) \n\t\t{\n\t\t\tsensorReq.setUser(UserProfile.getAnonymous());\n\t\t} \n\t\telse \n\t\t{\n\t\t\tsensorReq.setUser((UserProfile) userObject);\n\t\t}\n\t}", "public void setUser(final String user)\n {\n checkImmutable();\n if (this.logger.isTraceEnabled()) {\n this.logger.trace(\"setting user: \" + user);\n }\n this.user = user;\n }", "public void setUser(final String user)\n {\n checkImmutable();\n if (this.logger.isTraceEnabled()) {\n this.logger.trace(\"setting user: \" + user);\n }\n this.user = user;\n }", "public void setUser(String user) {\n this.user = user;\n }", "public void setUser(String user) {\n this.user = user;\n }", "public void setUser(String user) {\n this.user = user;\n }", "public void setUser(String user) {\n this.user = user;\n }", "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 }", "protected void setUsername(final String user) {\n this.user = user;\n }", "public void assignAuthorisedUser(final boolean val) {\n authorisedUser = val;\n }", "public void setUser(User user) { this.user = user; }", "public void setUser(User theUser) {\n\t\tmyUser = theUser;\n\t}", "public void setUser(java.lang.String user) {\n this.user = user;\n }", "public TedHttpSession userObject(Object userObject) {\n this.req.userObject(userObject);\n return this;\n }", "public void setDatabaseUser(String sDatabaseUser) throws IOException;", "void setUser(final ApplicationUser user);", "public void setUser(User user) {\r\n this.user = user;\r\n }", "public void setUser(String user) {\n\t\t\tthis.user = user;\n\t\t}", "void setUsername(String username);", "public static void setUser(String user) {\n Account.user = user;\n }", "public final GetHTTP setUsername(final String username) {\n properties.put(USERNAME_PROPERTY, username);\n return this;\n }", "public void setUser(User user) {\n\tthis.user = user;\n }", "void setUserUsername(String username);", "protected void switchToUser( ApplicationContext ctx, String username ) {\n\n UserDetails user = userManager.loadUserByUsername( username );\n\n List<GrantedAuthority> authrs = new ArrayList<GrantedAuthority>( user.getAuthorities() );\n\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n TestingAuthenticationToken token = new TestingAuthenticationToken( username, \"testing\", authrs );\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "@Override\n public Completable setAccessToken(DomainUserModel user) {\n return userService.setAccessToken(user);\n }", "public static void setConnectedUser( HttpServletRequest request, User user )\r\n\t{\r\n\t\trequest.getSession().setAttribute( \"connectedUser\", user );\r\n\t}", "public void setUser(final SimpleUser user) {\n this.user = user;\n }", "public void setSecurityContext() {\n ctx = SecurityContextHolder.getContext();\n SecurityContextHolder.getContext();\n final Authentication authentication = ctx.getAuthentication();\n setName(authentication.getName()); //NOPMD\n }", "public void setUser(User user) {\r\n\t\tthis.user = user;\r\n\t}", "public void setUser(User user) {\r\n\t\tthis.user = user;\r\n\t}", "final void setAuthentication(boolean required)\r\n {\r\n requires_AUT = required;\r\n }", "@Override\n\tpublic void setUserName(String userName);", "@Override\n\tpublic void setUserName(String userName);", "public void setUser(User user) {\n this.user = user;\n }", "public void setUser(User user) {\n this.user = user;\n }", "public void setUser(User user) {\n this.user = user;\n }", "@Override\n\tpublic User auth()\n\t{\n\t\treturn this.user;\n\t}", "public void setUser(final String user)\n {\n checkImmutable();\n this.user = user;\n }", "public void setUser(String paramUser) {\n\tstrUser = paramUser;\n }", "void setPassedUser(User passedUser);", "@Override\n\tpublic void setAuthProvider(AuthProvider arg0) {\n\t}", "public final void setUsername(final String value) {\n username = value;\n }", "public void setUsername(String username) {this.username = username;}", "public void initUser(ActiveSession user) {\n this.user = user;\n }", "private UserSession handleBasicAuthentication(String credentials, HttpServletRequest request) {\n\t\tString userPass = Base64Decoder.decode(credentials);\n\n\t\t// The decoded string is in the form\n\t\t// \"userID:password\".\n\t\tint p = userPass.indexOf(\":\");\n\t\tif (p != -1) {\n\t\t\tString userID = userPass.substring(0, p);\n\t\t\tString password = userPass.substring(p + 1);\n\t\t\t\n\t\t\t// Validate user ID and password\n\t\t\t// and set valid true if valid.\n\t\t\t// In this example, we simply check\n\t\t\t// that neither field is blank\n\t\t\tIdentity identity = WebDAVAuthManager.authenticate(userID, password);\n\t\t\tif (identity != null) {\n\t\t\t\tUserSession usess = UserSession.getUserSession(request);\n\t\t\t\tsynchronized(usess) {\n\t\t\t\t\t//double check to prevent severals concurrent login\n\t\t\t\t\tif(usess.isAuthenticated()) {\n\t\t\t\t\t\treturn usess;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tusess.signOffAndClear();\n\t\t\t\t\tusess.setIdentity(identity);\n\t\t\t\t\tUserDeletionManager.getInstance().setIdentityAsActiv(identity);\n\t\t\t\t\t// set the roles (admin, author, guest)\n\t\t\t\t\tRoles roles = BaseSecurityManager.getInstance().getRoles(identity);\n\t\t\t\t\tusess.setRoles(roles);\n\t\t\t\t\t// set authprovider\n\t\t\t\t\t//usess.getIdentityEnvironment().setAuthProvider(OLATAuthenticationController.PROVIDER_OLAT);\n\t\t\t\t\n\t\t\t\t\t// set session info\n\t\t\t\t\tSessionInfo sinfo = new SessionInfo(identity.getName(), request.getSession());\n\t\t\t\t\tUser usr = identity.getUser();\n\t\t\t\t\tsinfo.setFirstname(usr.getProperty(UserConstants.FIRSTNAME, null));\n\t\t\t\t\tsinfo.setLastname(usr.getProperty(UserConstants.LASTNAME, null));\n\t\t\t\t\tsinfo.setFromIP(request.getRemoteAddr());\n\t\t\t\t\tsinfo.setFromFQN(request.getRemoteAddr());\n\t\t\t\t\ttry {\n\t\t\t\t\t\tInetAddress[] iaddr = InetAddress.getAllByName(request.getRemoteAddr());\n\t\t\t\t\t\tif (iaddr.length > 0) sinfo.setFromFQN(iaddr[0].getHostName());\n\t\t\t\t\t} catch (UnknownHostException e) {\n\t\t\t\t\t\t // ok, already set IP as FQDN\n\t\t\t\t\t}\n\t\t\t\t\tsinfo.setAuthProvider(BaseSecurityModule.getDefaultAuthProviderIdentifier());\n\t\t\t\t\tsinfo.setUserAgent(request.getHeader(\"User-Agent\"));\n\t\t\t\t\tsinfo.setSecure(request.isSecure());\n\t\t\t\t\tsinfo.setWebDAV(true);\n\t\t\t\t\tsinfo.setWebModeFromUreq(null);\n\t\t\t\t\t// set session info for this session\n\t\t\t\t\tusess.setSessionInfo(sinfo);\n\t\t\t\t\t//\n\t\t\t\t\tusess.signOn();\n\t\t\t\t\treturn usess;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUser(User user) {\n\t\tthis.user = user;\n\t}", "public void setUsername(String u)\n\t{\n\t\tusername = u;\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 setCurrentUser(String username) {\n currentUser = username;\n }", "public void setUsername(String aUsername) {\n username = aUsername;\n }", "public void setUsername(String username)\r\n/* 16: */ {\r\n/* 17:34 */ this.username = username;\r\n/* 18: */ }", "public void setupUser() {\n }", "public static void setUsername(String username)\n {\n username_ = username;\n }", "public void setUserName( String value )\n {\n m_UserName = value;\n }", "protected static void setUsername(String username) {\n Program.username = username;\n }", "public void setUsername(String user) {\n\t\tthis.username = user;\n\t}", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "public boolean setPrincipal(Principal user);", "public void reAuthenticateUser(User regUser){\n System.out.println(\"Authenticating Google User from DB\");\n UserWithRoles authUser = new UserWithRoles(regUser);\n Authentication authentication = new UsernamePasswordAuthenticationToken(\n authUser, authUser.getPassword(), authUser.getAuthorities()\n );\n SecurityContextHolder.getContext().setAuthentication(authentication);\n }", "public void setLoggedUser(CustomEmployee user) {\n loggedUser = user;\n }", "public void setUser(final User user) {\n this.user = user;\n }", "public void login(HttpServletRequest req, HttpServletResponse res) throws IOException {\n\n // Client credentials\n Properties p = GlobalSettings.getNode(\"oauth.password-credentials\");\n String clientId = p.getProperty(\"client\");\n String secret = p.getProperty(\"secret\");\n ClientCredentials clientCredentials = new ClientCredentials(clientId, secret);\n\n // User credentials\n String username = req.getParameter(\"username\");\n String password = req.getParameter(\"password\");\n UsernamePassword userCredentials = new UsernamePassword(username, password);\n\n // Create request\n TokenResponse oauth = TokenRequest.newPassword(userCredentials, clientCredentials).post();\n if (oauth.isSuccessful()) {\n PSToken token = oauth.getAccessToken();\n\n // If open id was defined, we can get the member directly\n PSMember member = oauth.getMember();\n if (member == null) {\n member = OAuthUtils.retrieve(token);\n }\n\n if (member != null) {\n OAuthUser user = new OAuthUser(member, token);\n HttpSession session = req.getSession(false);\n String goToURL = this.defaultTarget;\n if (session != null) {\n ProtectedRequest target = (ProtectedRequest)session.getAttribute(AuthSessions.REQUEST_ATTRIBUTE);\n if (target != null) {\n goToURL = target.url();\n session.invalidate();\n }\n }\n session = req.getSession(true);\n session.setAttribute(AuthSessions.USER_ATTRIBUTE, user);\n res.sendRedirect(goToURL);\n } else {\n LOGGER.error(\"Unable to identify user!\");\n res.sendError(HttpServletResponse.SC_FORBIDDEN);\n }\n\n } else {\n LOGGER.error(\"OAuth failed '{}': {}\", oauth.getError(), oauth.getErrorDescription());\n if (oauth.isAvailable()) {\n res.sendError(HttpServletResponse.SC_FORBIDDEN);\n } else {\n res.sendError(HttpServletResponse.SC_BAD_GATEWAY);\n }\n }\n\n }", "public void setUsername(String un)\r\n\t{\r\n\t\tusername = un;\r\n\t}", "public void setAuth(int pAuth){\n this.auth = pAuth;\n }", "public void setAuthUserId(String newId) {\n session.setAttribute(\"userId\", newId);\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 }", "public void setUser(UserData data) {\n user = data;\n }", "@Override\n\tpublic void setUserName(String userName) {\n\n\t}", "public void setCredentials( String username_, String password_ ) {\n\t\tif (username_ != null) {\n\t\t\tusername = username_;\n\t\t} else {\n\t\t\tusername = \"Encinitas\";\n\t\t}\n\t\tif (password_ != null) {\n\t\t\tpassword = password_;\n\t\t} else {\n\t\t\tpassword = \"Carlsbad\";\n\t\t}\n\t\tlog( \"username \" + username, Log.Level.Information );\n\t\tlog( \"password \" + password, Log.Level.Information );\n\t}", "public void propagateCredentials( User user, String password );", "public void setUserName(String userName){\r\n this.userName = userName;\r\n }", "public static void setUser(String user) {\n\t\tif (adHocAccount == null)\n\t\t\tadHocAccount = new Account();\n\t\tadHocAccount.userName = user;\n\t}", "protected void setBasicAuthorization(String hostName, int hostPort, String realm, String userid, String pswd)\r\n {\r\n\r\n AuthorizationInfo.addBasicAuthorization(hostName, hostPort, realm, userid, pswd);\r\n // Inform the HTTPConnection that our Proxy Host,\r\n // Port is a proxyServer.\r\n HTTPConnection.setProxyServer(hostName, hostPort);\r\n }", "public void setUserContext(UserContext userContext);", "public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }", "public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }", "public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }", "public void setNewUser(String username, String password)\r\n {\r\n configureClient(username, password);\r\n }", "private void initUser() {\n\t}", "public static void setUserForCurrentThread(String user) {\r\n userPerThread.set(user);\r\n }", "public void setUserName(String userName){\n this.userName = userName;\n }", "public void setMongoUser(String user) {\n mongoUser = user;\n }", "private void allowForRefreshToken(ApplicationUser user, HttpServletRequest request) {\n UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(\n null, null, null);\n SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);\n request.setAttribute(\"user\", user);\n }", "private void setSessionAttribs(HttpServletRequest req, BlogUser user) {\n\t\treq.getSession().setAttribute(\"current.user.id\", user.getId());\n\t\treq.getSession().setAttribute(\"current.user.fn\", user.getFirstName());\n\t\treq.getSession().setAttribute(\"current.user.ln\", user.getLastName());\n\t\treq.getSession().setAttribute(\"current.user.nick\", user.getNick());\n\t}", "@Override\r\n\tpublic void authUser(IAuthServiceDelegate delegate, LoginUser user) {\r\n\t\t(new AuthService()).authUser(delegate, user);\r\n\t}" ]
[ "0.7251182", "0.6369855", "0.63630915", "0.63062567", "0.63049686", "0.6303991", "0.62911195", "0.6204299", "0.6204299", "0.6201707", "0.6201707", "0.6201707", "0.6201707", "0.61899936", "0.6163928", "0.6124857", "0.6118747", "0.6114816", "0.6081844", "0.60487795", "0.6027006", "0.6024235", "0.6022614", "0.60135525", "0.6004981", "0.5986448", "0.59830743", "0.59808534", "0.59620506", "0.5959026", "0.5941911", "0.5921988", "0.5917522", "0.59102803", "0.5903395", "0.5903395", "0.58921003", "0.5883362", "0.5883362", "0.587459", "0.587459", "0.587459", "0.58669716", "0.58634514", "0.5813114", "0.58081543", "0.58018816", "0.5782345", "0.57799685", "0.5767755", "0.5756478", "0.5756404", "0.5756404", "0.5756404", "0.5756404", "0.5756404", "0.5756404", "0.5747001", "0.5711128", "0.5696533", "0.56822705", "0.56783247", "0.56749064", "0.5656467", "0.5655379", "0.56516737", "0.56501365", "0.56429636", "0.56429636", "0.56429636", "0.5637769", "0.5630533", "0.5629971", "0.5627854", "0.5602648", "0.55918825", "0.5586379", "0.5585504", "0.55817974", "0.55817974", "0.55817974", "0.5569859", "0.55621934", "0.555657", "0.55499613", "0.55495673", "0.5548521", "0.55439067", "0.5540239", "0.553123", "0.553123", "0.553123", "0.5514108", "0.55080295", "0.5508021", "0.55066496", "0.550166", "0.5496874", "0.5489566", "0.5485782" ]
0.6781012
1
Set the password for HTTP authentication.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the password for HTTP authentication.") @JsonProperty(JSON_PROPERTY_HTTP_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getHttpPassword() { return httpPassword; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final GetHTTP setPassword(final String password) {\n properties.put(PASSWORD_PROPERTY, password);\n return this;\n }", "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "public void setPassword(String pw)\n {\n this.password = pw;\n }", "public void setPassword(String pass);", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(java.lang.String newPassword);", "public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }", "public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }", "void setPassword(String ps) {\n this.password = ps;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "@Override\n\tpublic void setPassword(String password) {\n\n\t}", "public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}", "public void setPassword(String p) {\n\t\tpassword = p;\n\t}", "public void setPassword(String password){\r\n this.password = password;\r\n }", "public void set_pass(String password)\n {\n pass=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) {\n this.password = password;\r\n }", "public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }", "public void setPassword( String password )\r\n {\r\n this.password = password;\r\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 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 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(final String password){\n mPassword = password;\n }", "public void setPassword(String password) {\n\tthis.password = password;\n}", "public void setPassword(String password)\n {\n this.password = password;\n }", "public void setPassword(String password)\n \t{\n \t\tthis.password = password;\n \t}", "public void set_password(String password)\r\n\t{\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(String password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password.set(password);\n }", "public void setPassword(int password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }", "public void setPassword(final String password) {\n this.password = password.toCharArray();\n }", "public void setPassword( final String password )\n\t{\n\t\tthis.password = password;\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 }", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n saveProperties();\n }", "public void setPassword (java.lang.String password) {\r\n\t\tthis.password = password;\r\n\t}", "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 setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}", "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 void setPass(String pass)\r\n\t{\r\n\t\tpassword = pass;\r\n\t}", "public void setPassword(String password) {\n setObject(\"password\", (password != null) ? password : \"\");\n }", "public void setPassword(String password) {\n this.passwordHash = passwordHash;\n }", "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 }", "@Override\n public String getPassword() {\n return password;\n }", "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 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}", "public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }", "@Override\n public String getPassword() {\n return password;\n }" ]
[ "0.77349144", "0.7675632", "0.7675632", "0.7675632", "0.765082", "0.7650515", "0.74505085", "0.7430639", "0.73477143", "0.73136353", "0.7302588", "0.7299133", "0.7265974", "0.72298026", "0.7195439", "0.71912736", "0.71726525", "0.71334195", "0.71334195", "0.71142966", "0.71044815", "0.70980805", "0.70864624", "0.70864624", "0.70848924", "0.70848924", "0.70627975", "0.70627975", "0.70627975", "0.70627975", "0.70627975", "0.70627975", "0.70514685", "0.70430017", "0.70293856", "0.7021188", "0.6976608", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.695284", "0.69425964", "0.69425964", "0.6938337", "0.69353515", "0.6934362", "0.6916718", "0.6901914", "0.68546706", "0.68462825", "0.68462825", "0.6845406", "0.6845406", "0.684082", "0.6827468", "0.6827468", "0.6821491", "0.68201214", "0.68084776", "0.68084776", "0.68038166", "0.68038166", "0.67968875", "0.67968875", "0.67818666", "0.6779733", "0.6759652", "0.67549026", "0.67242587", "0.6690175", "0.66804254", "0.665324", "0.66285276" ]
0.6960755
37
Set the HTTP proxy server.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the HTTP proxy server.") @JsonProperty(JSON_PROPERTY_HTTP_PROXY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getHttpProxy() { return httpProxy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setProxyServer(String proxyServer) {\n this.proxyServer = proxyServer;\n }", "public void setHttpProxyHost(String host);", "public void setHttpProxyPort(int port);", "@Override\n public void setServerProxy(IServerProxy theProxy) {\n assert theProxy != null;\n m_theProxy = theProxy;\n }", "public String getProxyServer() {\n return proxyServer;\n }", "public void setProxyHost(String hostname) {\n proxyHost = hostname;\n }", "public void setProxyHost(java.lang.String newProxyHost)\r\n {\r\n System.out.println(\"Host: \" + newProxyHost);\r\n proxyHost = newProxyHost;\r\n }", "protected static void setProxyLocation(URI proxyLocation) {\n Program.proxyLocation = proxyLocation;\n Program.proxyLocationSet = true;\n }", "public final GetHTTP setProxyHost(final String proxyHost) {\n properties.put(PROXY_HOST_PROPERTY, proxyHost);\n return this;\n }", "public final GetHTTP setProxyPort(final String proxyPort) {\n properties.put(PROXY_PORT_PROPERTY, proxyPort);\n return this;\n }", "public void setHttpServer(String httpServer) {\n this.httpServer = httpServer;\n }", "public Proxy(){\n\t\tthis.useProxy = false;\n\t\tthis.host = null;\n\t\tthis.port = -1;\n\t}", "public void setProxyPort(int port) {\n proxyPort = port;\n }", "public void setProxyHost(String proxyHost) {\n this.proxyHost = proxyHost;\n }", "public void setProxyPort(int proxyPort) {\n this.proxyPort = proxyPort;\n }", "public void setProxyPort(int proxyPort) {\n this.proxyPort = proxyPort;\n }", "public void setProxyPort(String newProxyPort)\r\n {\r\n proxyPort = newProxyPort;\r\n }", "public void initProxy() {\n\n System.setProperty(\"http.proxyHost\", \"199.101.97.159\"); // set proxy server\n System.setProperty(\"http.proxyPort\", \"60099\"); // set proxy port\n //System.setProperty(\"http.proxyUser\", authUser);\n //System.setProperty(\"http.proxyPassword\", authPassword);\n Authenticator.setDefault(\n new Authenticator() {\n @Override\n public PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(\n authUser, authPassword.toCharArray());\n }\n }\n );\n }", "public void setProxy(Proxy proxy) {\n\t\tthis.proxy = proxy;\n\t}", "public void setProxyPort(String proxyPort) {\n this.proxyPort = proxyPort;\n }", "public void setProxyHost(String proxyHost) {\n\t proxyHandler.setProxyHost(proxyHost);\n \n if ((proxyHost != null) && (proxyHost.length() > 1)) {\n isProxyActivated.set(true);\n } \n resetChain();\n\t}", "public static void setProxyServer(final String serverURI, final String proxyURI) {\n if (StringUtils.isEmpty(serverURI)) {\n return;\n }\n final String propertyName = getProxyPropertyName(serverURI);\n if (StringUtils.isEmpty(proxyURI)) {\n PluginServiceProvider.getInstance().getPropertyService().removeProperty(propertyName);\n } else {\n PluginServiceProvider.getInstance().getPropertyService().setProperty(propertyName, proxyURI);\n }\n }", "public void setSocksProxyHost(String host) {\n this.socksProxyHost = host;\n }", "public void setProxyPort(int newProxyPort)\r\n {\r\n System.out.println(\"Port: \" + newProxyPort);\r\n proxyPort = \"\" + newProxyPort;\r\n }", "public String getProxyHost() {\n return proxyHost;\n }", "public ServerProxy(String host, int port) {\n\t\tthis.setHost(host);\n\t\tthis.setPort(port);\n\t\tthis.cookieManager = new java.net.CookieManager();\n\t}", "@Nonnull\n public String getProxyHost() {\n return proxyHost;\n }", "public String getHttpProxyHost();", "public void setProxyAddress(String proxyAddress) {\n this.proxyAddress = proxyAddress;\n }", "public java.lang.String getProxyHost()\r\n {\r\n return proxyHost;\r\n }", "public void setServer(Server server) {\n this.server = server;\n }", "private void setHttpclientProxy(DefaultHttpClient httpClient) {\r\n Proxy proxy = ProxyProvider.getProxy();\r\n String proxyUser = ProxyProvider.getProxyUserName();\r\n String proxyPwd = ProxyProvider.getProxyUserPassword();\r\n // set by other components like tSetProxy\r\n if (proxy != null) {\r\n\r\n final HttpHost httpHost = new HttpHost(((InetSocketAddress) proxy.address()).getHostName(),\r\n ((InetSocketAddress) proxy.address()).getPort());\r\n // Sets usage of HTTP proxy\r\n httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpHost);\r\n\r\n // Sets proxy authentication, if credentials were provided\r\n // TODO Because the proxy of get accesToken can't support authentication. remove this ?\r\n if (proxyUser != null && proxyPwd != null) {\r\n httpClient.getCredentialsProvider().setCredentials(new AuthScope(httpHost),\r\n new UsernamePasswordCredentials(proxyUser, proxyPwd));\r\n }\r\n\r\n }\r\n\r\n }", "public int getHttpProxyPort();", "public void setServer(Server server) {\n\t\t\r\n\t}", "public void applyWebProxySettings() {\n boolean settingsChanged = false;\n boolean enablingProxy = false;\n Properties sysprops = System.getProperties();\n if (proxyHost != null) {\n settingsChanged = true;\n if (proxyHost.length() != 0) {\n traceSettingInfo();\n enablingProxy = true;\n sysprops.put(\"http.proxyHost\", proxyHost);\n String portString = Integer.toString(proxyPort);\n sysprops.put(\"http.proxyPort\", portString);\n sysprops.put(\"https.proxyHost\", proxyHost);\n sysprops.put(\"https.proxyPort\", portString);\n sysprops.put(\"ftp.proxyHost\", proxyHost);\n sysprops.put(\"ftp.proxyPort\", portString);\n if (nonProxyHosts != null) {\n sysprops.put(\"http.nonProxyHosts\", nonProxyHosts);\n sysprops.put(\"https.nonProxyHosts\", nonProxyHosts);\n sysprops.put(\"ftp.nonProxyHosts\", nonProxyHosts);\n }\n if(proxyUser!=null) {\n sysprops.put(\"http.proxyUser\", proxyUser);\n sysprops.put(\"http.proxyPassword\", proxyPassword);\n }\n } else {\n log(\"resetting http proxy\", Project.MSG_VERBOSE);\n sysprops.remove(\"http.proxyHost\");\n sysprops.remove(\"http.proxyPort\");\n sysprops.remove(\"http.proxyUser\");\n sysprops.remove(\"http.proxyPassword\");\n sysprops.remove(\"https.proxyHost\");\n sysprops.remove(\"https.proxyPort\");\n sysprops.remove(\"ftp.proxyHost\");\n sysprops.remove(\"ftp.proxyPort\");\n }\n }\n\n //socks\n if (socksProxyHost != null) {\n settingsChanged = true;\n if (socksProxyHost.length() != 0) {\n enablingProxy = true;\n sysprops.put(\"socksProxyHost\", socksProxyHost);\n sysprops.put(\"socksProxyPort\", Integer.toString(socksProxyPort));\n if (proxyUser != null) {\n //this may be a java1.4 thingy only\n sysprops.put(\"java.net.socks.username\", proxyUser);\n sysprops.put(\"java.net.socks.password\", proxyPassword);\n }\n\n } else {\n log(\"resetting socks proxy\", Project.MSG_VERBOSE);\n sysprops.remove(\"socksProxyHost\");\n sysprops.remove(\"socksProxyPort\");\n sysprops.remove(\"java.net.socks.username\");\n sysprops.remove(\"java.net.socks.password\");\n }\n }\n\n\n //for Java1.1 we need to tell the system that the settings are new\n if (settingsChanged &&\n JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {\n legacyResetProxySettingsCall(enablingProxy);\n }\n }", "String getHttpProxyHost();", "public MyProxyLogon() {\n super();\n host = System.getenv(\"MYPROXY_SERVER\");\n if (host == null) {\n host = \"myproxy.teragrid.org\";\n }\n String portString = System.getenv(\"MYPROXY_SERVER_PORT\");\n if (portString != null) {\n port = Integer.parseInt(portString);\n }\n username = System.getProperty(\"user.name\");\n }", "public void setProxyBaseUrl(String baseURL) {\n this.proxyBaseUrl = baseURL;\n }", "int getHttpProxyPort();", "public void setServer (\r\n String strServer) throws java.io.IOException, com.linar.jintegra.AutomationException;", "private HttpProxyCacheServer getProxy() {\n\n return proxy == null ? (proxy = newProxy()) : proxy;\n }", "public void setDefaultProxyConfig(ProxyConfig config);", "private void setInternalProxy(SimpleClientHttpRequestFactory requestFactory) {\n\t\tif (PAYASIA_MIND_PROXY_ENABLED_FOR_DEV) {\n\t\t\tProxy proxy = new Proxy(Type.HTTP, new InetSocketAddress(\n\t\t\t\t\tPAYASIA_MIND_PROXY_HOSTNAME, PAYASIA_MIND_PROXY_PORT));\n\t\t\trequestFactory.setProxy(proxy);\n\t\t}\n\t}", "public void setProxyPassword(String proxyPassword) {\n this.proxyPassword = proxyPassword;\n }", "public void setProxyPassword(String proxyPassword) {\n this.proxyPassword = proxyPassword;\n }", "public void setServer(URL url) {\n\n\t}", "public void setProxyPassword(String proxyPassword) {\n\t proxyHandler.setProxyPassword(proxyPassword);\n\t}", "public void setProxyUser(String proxyUser) {\n this.proxyUser = proxyUser;\n }", "public HttpProxy(int port)\n {\n thisPort = port;\n }", "public String getProxyPort()\r\n {\r\n return proxyPort;\r\n }", "public Proxy(String host, int port){\n\t\tthis.useProxy = true;\n\t\tthis.host = host;\n\t\tthis.port = port;\n\t}", "public void setServer(Server server) {\n\t\tthis.server = server;\n\t}", "public int getProxyPort() {\n return proxyPort;\n }", "public int getProxyPort() {\n return proxyPort;\n }", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "public void setServer(int server) {\n this.server = server;\n }", "private void httpProxyConnect(String host, int port) throws IOException {\n // connect to the proxy\n // _proxyPort validated in superconstrutor, no need to set default here\n if (_fetchHeaderTimeout > 0) {\n _proxy = new Socket();\n _proxy.setSoTimeout(_fetchHeaderTimeout);\n _proxy.connect(new InetSocketAddress(_proxyHost, _proxyPort), _fetchHeaderTimeout);\n } else {\n _proxy = new Socket(_proxyHost, _proxyPort);\n }\n httpProxyConnect(_proxy, host, port);\n }", "public void setSmtpSOCKSProxyPort(int value) {\n this.smtpSOCKSProxyPort = value;\n }", "public final ListS3 setProxyHost(final String proxyHost) {\n properties.put(PROXY_HOST_PROPERTY, proxyHost);\n return this;\n }", "protected void setProxiedClient(URL paramURL, String paramString, int paramInt) throws IOException {\n/* 127 */ this.delegate.setProxiedClient(paramURL, paramString, paramInt);\n/* */ }", "public ProxySettings(Proxy proxy)\n {\n this(proxy, null, null);\n }", "public String getProxyPort() {\n return proxyPort;\n }", "public String getProxyHost() {\n return cfg.getProxyHost();\n }", "void setProxyConnectionState(ProxyConnectionState proxyConnectionState) {\n this.proxyConnectionState = proxyConnectionState;\n }", "public void setProxyUser(String proxyUser) {\n\t proxyHandler.setProxyUser(proxyUser);\n\t}", "public void setHttpListener(Builder serverBuilder) {\n if (options.httpPort == -1) {\n log.info(\"HTTP listener is disabled.\");\n return;\n }\n if (options.httpPort < -1 || options.httpPort > MAX_PORT) {\n log.warn(\"Unallowed httpPort value. HTTP listener is disabled!\");\n return;\n }\n\n if (options.httpListenAddress != null)\n serverBuilder.addHttpListener(options.httpPort, options.httpListenAddress);\n else {\n // Listen on all interfaces\n serverBuilder.addHttpListener(options.httpPort, hostAllInterfacesString);\n }\n\n log.info(\"HTTP listener created\");\n }", "public void setServer(IServer server) {\n\t\tthis.server = server;\n\t\tlogger.debug(\"Server is set\");\n\t}", "protected void setProxiedClient(URL paramURL, String paramString, int paramInt, boolean paramBoolean) throws IOException {\n/* 143 */ this.delegate.setProxiedClient(paramURL, paramString, paramInt, paramBoolean);\n/* */ }", "public void setSiteHttpServerName(String pSiteHttpServerName) {\n mSiteHttpServerName = pSiteHttpServerName;\n }", "public void setSocksProxyPort(int port) {\n this.socksProxyPort = port;\n }", "public final String getProxyHost() {\n return properties.get(PROXY_HOST_PROPERTY);\n }", "public final String getProxyHost() {\n return properties.get(PROXY_HOST_PROPERTY);\n }", "public void setSiteHttpServerPort(int pSiteHttpServerPort) {\n mSiteHttpServerPort = pSiteHttpServerPort;\n }", "public void setSERVER(String SERVER) {\n \t\tthis.SERVER = SERVER;\n \t}", "private ServerModelFacade(IServerProxy theProxy) {\n setServerProxy(theProxy);\n }", "public interface IProxySettings\n{\n /**\n * @return The proxy type to be used. May not be <code>null</code>.\n */\n @Nonnull\n Proxy.Type getProxyType ();\n\n /**\n * @return The proxy host name of IP address. May be <code>null</code> if\n * proxy type is DIRECT.\n */\n @Nullable\n String getProxyHost ();\n\n /**\n * @return The proxy port for this HTTP proxy type. Should be &gt; 0. May be\n * &le; 0 if the proxy type is DIRECT.\n */\n int getProxyPort ();\n\n /**\n * @return The proxy user name. May be <code>null</code>.\n */\n @Nullable\n String getProxyUserName ();\n\n default boolean hasProxyUserName ()\n {\n return StringHelper.hasText (getProxyUserName ());\n }\n\n /**\n * @return The proxy password for the provided user. May be <code>null</code>.\n * Note: an empty password may be valid. Only <code>null</code>\n * indicates \"no password\".\n */\n @Nullable\n String getProxyPassword ();\n\n default boolean hasProxyPassword ()\n {\n return getProxyPassword () != null;\n }\n\n /**\n * Check if hostname and port match the ones from the provided\n * {@link InetSocketAddress}.\n *\n * @param aAddr\n * The address to compare with. May be <code>null</code>.\n * @return <code>true</code> if the unresolved hostname and the port match.\n */\n default boolean hasInetSocketAddress (@Nullable final InetSocketAddress aAddr)\n {\n return aAddr != null && EqualsHelper.equals (aAddr.getHostString (), getProxyHost ()) && getProxyPort () == aAddr.getPort ();\n }\n\n /**\n * Check if these settings have the provided socket address.\n *\n * @param aAddr\n * The socket address to compare to. May be <code>null</code>.\n * @return <code>true</code> if the proxy type is DIRECT and the address is\n * <code>null</code>, or if the object is of type\n * {@link InetSocketAddress} and the values match.\n * @see #hasInetSocketAddress(InetSocketAddress)\n */\n boolean hasSocketAddress (@Nullable SocketAddress aAddr);\n\n /**\n * @return A non-<code>null</code> {@link Proxy} instance. Only uses proxy\n * host and port.\n * @see #getProxyHost()\n * @see #getProxyPort()\n */\n @Nonnull\n default Proxy getAsProxy ()\n {\n return getAsProxy (true);\n }\n\n /**\n * @param bResolveHostname\n * <code>true</code> to resolve host names (needed in production) or\n * <code>false</code> to not resolve them (mainly for testing\n * purposes). This flag has no impact if the proxy type is DIRECT.\n * @return A non-<code>null</code> {@link Proxy} instance. Only uses proxy\n * host and port.\n * @see #getProxyHost()\n * @see #getProxyPort()\n */\n @Nonnull\n Proxy getAsProxy (boolean bResolveHostname);\n\n /**\n * @return The {@link PasswordAuthentication} instances matching the\n * credentials contained in this object or <code>null</code> if no\n * username is present.\n */\n @Nullable\n default PasswordAuthentication getAsPasswordAuthentication ()\n {\n // If no user name is set, no Authenticator needs to be created\n if (!hasProxyUserName ())\n return null;\n\n final String sProxyPassword = getProxyPassword ();\n // Constructor does not take null password!\n return new PasswordAuthentication (getProxyUserName (),\n sProxyPassword == null ? ArrayHelper.EMPTY_CHAR_ARRAY : sProxyPassword.toCharArray ());\n }\n}", "public void setServerUrl(String serverUrl) \n {\n \tthis.serverUrl = serverUrl;\n }", "public void setHttpServerName(String httpServerName) {\n this.httpServerName = httpServerName;\n }", "public ProxyConfiguration(@NotNull String proxyName, int port) {\n this.host = new HttpHost(proxyName, port);\n }", "public void setServerURL(String serverURL) {\n this.serverURL = serverURL;\n saveProperties();\n }", "protected final void setServerUrl(final String serverUrl) {\n this.serverUrl = serverUrl;\n }", "public int getProxyPort() {\n return cfg.getProxyPort();\n }", "public String getHttpServer() {\n return httpServer;\n }", "public ClientBuilder proxy(@Nullable Proxy proxy) {\n this.proxy = proxy;\n return this;\n }", "protected static void setProxyUsername(String username) {\n Program.proxyUsername = username;\n proxyUsernameSet = true;\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public void setHost(String host);", "protected boolean legacyResetProxySettingsCall(boolean setProxy) {\n System.getProperties().put(\"http.proxySet\", new Boolean(setProxy).toString());\n try {\n Class c = Class.forName(\"sun.net.www.http.HttpClient\");\n Method reset = c.getMethod(\"resetProperties\", null);\n reset.invoke(null, null);\n return true;\n }\n catch (ClassNotFoundException cnfe) {\n return false;\n }\n catch (NoSuchMethodException e) {\n return false;\n }\n catch (IllegalAccessException e) {\n return false;\n }\n catch (InvocationTargetException e) {\n return false;\n }\n }", "private void setResolverAsGoProxy(ArtifactoryManager artifactoryClient) throws Exception {\n String rtUrl = PackageManagerUtils.createArtifactoryUrlWithCredentials(artifactoryClient.getUrl(), resolverUsername, resolverPassword, ARTIFACTORY_GO_API + resolutionRepository);\n String proxyValue = rtUrl + \",\" + GOPROXY_VCS_FALLBACK;\n env.put(GOPROXY_ENV_VAR, proxyValue);\n }", "public void setProxyPswd(java.lang.String newProxyPswd)\r\n {\r\n proxyPswd = newProxyPswd;\r\n }", "private void internalHttpProxyConnect(String host, int port) throws IOException {\n // connect to the proxy\n _proxy = InternalSocket.getSocket(_proxyHost, _proxyPort);\n httpProxyConnect(_proxy, host, port);\n }", "IParser setServerBaseUrl(String theUrl);", "boolean isOmniProxyServer();", "public void setProxyRealm(java.lang.String newProxyRealm)\r\n {\r\n System.out.println(\"Realm: \" + newProxyRealm);\r\n proxyRealm = newProxyRealm;\r\n }", "public void setStunServer(String server);", "public void setProxyScheme(java.lang.String newProxyScheme)\r\n {\r\n System.out.println(\"Scheme: \" + newProxyScheme);\r\n proxyScheme = newProxyScheme;\r\n }", "public final GetHTTP removeProxyHost() {\n properties.remove(PROXY_HOST_PROPERTY);\n return this;\n }", "public void setPort(final String remoteHost) {\n host = remoteHost;\n }", "HttpProxy(final Integer port,\n final Integer securePort,\n final Integer socksPort,\n final Integer directLocalPort,\n final Integer directLocalSecurePort,\n final String directRemoteHost,\n final Integer directRemotePort) {\n\n this.port = port;\n this.securePort = securePort;\n this.socksPort = socksPort;\n this.directLocalPort = directLocalPort;\n this.directLocalSecurePort = directLocalSecurePort;\n this.directRemoteHost = directRemoteHost;\n this.directRemotePort = directRemotePort;\n\n hasStarted = SettableFuture.create();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n ChannelFuture httpChannel = createHTTPChannel(port, securePort);\n ChannelFuture httpsChannel = createHTTPSChannel(securePort);\n ChannelFuture socksChannel = createSOCKSChannel(socksPort, port);\n ChannelFuture directChannel = createDirectChannel(directLocalPort, directRemoteHost, directRemotePort);\n ChannelFuture directSecureChannel = createDirectSecureChannel(directLocalSecurePort, directRemoteHost, directRemotePort);\n\n if (httpChannel != null) {\n // create system wide proxy settings for HTTP CONNECT\n proxyStarted(port, false);\n }\n if (socksChannel != null) {\n // create system wide proxy settings for SOCKS\n proxyStarted(socksPort, true);\n }\n hasStarted.set(\"STARTED\");\n\n waitForClose(httpChannel);\n waitForClose(httpsChannel);\n waitForClose(socksChannel);\n waitForClose(directChannel);\n waitForClose(directSecureChannel);\n } catch (Exception ie) {\n logger.error(\"Exception while running proxy channels\", ie);\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }\n }).start();\n\n try {\n // wait for proxy to start all channels\n hasStarted.get();\n } catch (Exception e) {\n logger.debug(\"Exception while waiting for proxy to complete starting up\", e);\n }\n }", "public String getSocksProxy()\n {\n return socksProxy;\n }" ]
[ "0.77590364", "0.74820006", "0.7401255", "0.73738486", "0.68495744", "0.67900944", "0.6785113", "0.6760788", "0.67476654", "0.673862", "0.6711899", "0.6668797", "0.6651978", "0.6616593", "0.66033393", "0.66033393", "0.6590945", "0.6550182", "0.6548995", "0.6530845", "0.651803", "0.6382786", "0.6334825", "0.6329651", "0.61178696", "0.61044264", "0.6091388", "0.6073234", "0.6071354", "0.604665", "0.6045131", "0.6035201", "0.6003303", "0.60022056", "0.59987205", "0.5997279", "0.59695137", "0.5958907", "0.5953876", "0.5949195", "0.59411615", "0.5932262", "0.59287155", "0.5927688", "0.5927688", "0.5922237", "0.5908154", "0.59057015", "0.5897199", "0.58785427", "0.5864751", "0.5848914", "0.5842715", "0.5842715", "0.5829791", "0.5824373", "0.57963306", "0.57830274", "0.57816684", "0.57779384", "0.5765723", "0.574972", "0.57453126", "0.57443327", "0.5737506", "0.5733947", "0.57333255", "0.5732183", "0.57228994", "0.57227767", "0.5711016", "0.5711016", "0.5706843", "0.5702858", "0.5655802", "0.56425893", "0.56350106", "0.56139326", "0.55983806", "0.5576213", "0.5576041", "0.55637366", "0.55624396", "0.55621135", "0.55606145", "0.5555454", "0.55414593", "0.5537948", "0.55354923", "0.5525162", "0.551173", "0.5467288", "0.5445269", "0.5415158", "0.54088014", "0.54003525", "0.5398034", "0.5384877", "0.5376564", "0.5373848" ]
0.67087495
11
Set the HTTP request timeout.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the HTTP request timeout.") @JsonProperty(JSON_PROPERTY_HTTP_TIMEOUT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getHttpTimeout() { return httpTimeout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setHttpClientRequestTimeout(int timeout) {\n this.requestTimeout = timeout;\n this.customized = true;\n }", "public final synchronized void setConnectionTimeout(final int timeout) {\n HttpConnectionParams.setConnectionTimeout(params, timeout);\n }", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "public void setResponseTimeOut(int timeOut)\n {\n fResponseTimeOut = timeOut;\n }", "public void setHttpClientTimeout(int timeout) {\n this.connectTimeout = timeout;\n this.customized = true;\n }", "public static void setRequestTimeout(long requestTimeoutMs) {\n DebeziumResource.requestTimeoutMs = Duration.ofMillis(requestTimeoutMs);\n }", "public HttpClient setConnectionTimeout(Env env, NumberValue timeout) {\n client.setConnectTimeout(timeout.toInt());\n return this;\n }", "void setOperationTimeout(int timeout) throws RemoteException;", "public void setQueryTimeout(int queryTimeout) {\n\t\tthis.queryTimeout = queryTimeout;\n\t}", "public void setRemoteRequestTimeout(String value) {\n\t\tnew LabeledText(OpenShiftLabel.TextLabels.REMOTE_REQUEST_TIMEOUT).setText(value);\n\t}", "public final synchronized void setSocketTimeout(final int timeout) {\n HttpConnectionParams.setSoTimeout(params, timeout);\n }", "public void setTimeout(int timeout) {\r\n\t\tconnTimeout = timeout;\r\n\t}", "public void setTimeout(int newTimeout) {\n this.timeout = newTimeout;\n }", "T setStartTimeout(Integer timeout);", "public final GetHTTP setConnectionTimeout(final String connectionTimeout) {\n properties.put(CONNECTION_TIMEOUT_PROPERTY, connectionTimeout);\n return this;\n }", "public void setTimeout(int _timeout) {\n if (timeout < 0)\n return;\n timeout = _timeout;\n }", "public void setQueryTimeout(long timeout) {\n queryTimeout = timeout;\n }", "private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}", "@Override\n\tpublic void setOpTimeout(long arg0) {\n\n\t}", "public void setConnectionTimeout(int connectionTimeout) {\r\n this.connectionTimeout = connectionTimeout;\r\n }", "public void setTimeout(int timeout) {\r\n this.timeout = timeout;\r\n }", "public void setTimeout(double timeout){\n this.timeout = timeout;\n }", "public void setTimeout( int timeout ) {\n this.timeout = timeout;\n }", "public void setConnectionTimeout(Duration connectionTimeout) {\n this.connectionTimeout = connectionTimeout;\n }", "public void setTimeout(int timeout) {\n this.timeout = timeout;\n }", "public void setTimeout(int timeout) {\r\n\t\tthis.TIMEOUT = timeout;\r\n\t}", "public void setTimeOut(long timeOut) {\n _timeOut = timeOut;\n }", "public void setConnectionTimeout(int connectionTimeout)\r\n\t{\r\n\t\tthis.connectionTimeout = connectionTimeout;\r\n\t}", "public void setTimeout(Integer timeout) {\n\t\tthis.timeout = timeout;\n\t}", "public void setConnectionTimeOut(int connectionTimeOut) {\n this.connectionTimeOut = connectionTimeOut;\n }", "void setStartTimeout(int startTimeout);", "public void setTimeout(long timeout) {\n this.timeout = timeout;\n }", "public void setTimeout(long timeout) {\n this.timeout = timeout;\n }", "public final GetHTTP setDataTimeout(final String dataTimeout) {\n properties.put(DATA_TIMEOUT_PROPERTY, dataTimeout);\n return this;\n }", "@Override\n public void setQueryTimeout( int x ) throws SQLException {\n timeout = x;\n }", "public Params setConnectionTimeout(Duration connectionTimeout) {\n this.connectionTimeout = Optional.of(connectionTimeout);\n return this;\n }", "public void setSipTransportTimeout(int timeoutMs);", "public void setTimeout(final String timeout);", "public void setTimeout(long t) {\n StepTimeout = t;\n }", "public void setTimeout(int timeout);", "public void setTimeout(final int timeout) {\n this.timeout = timeout;\n }", "public void setTimeout(long timeout)\r\n\t{\r\n\t\tthis.timeout = timeout;\r\n\t}", "public void setSocketTimeout(int socketTimeout)\n {\n this._socketTimeout = socketTimeout;\n }", "public void setTimeout(org.apache.axis.types.UnsignedInt timeout) {\n this.timeout = timeout;\n }", "@Override public ServerConfig timeout(final int value, final TimeUnit units) {\n this.timeout = units.toMillis(value);\n return this;\n }", "@Override\n\tpublic void setConnectTimeout(long arg0) {\n\n\t}", "public SetIdleTimeoutCommand(int timeout) {\n this.timeout = timeout;\n }", "public void setConnectionTimeout(double connectionTimeout) {\n this.connectionTimeout = connectionTimeout;\n saveProperties();\n }", "public void setRequestTimeoutMillis(long requestTimeoutMillis)\n {\n this.requestTimeoutMillis = requestTimeoutMillis;\n }", "public void setConnTimeout(int connTimeout)\n {\n this._connTimeout = connTimeout;\n }", "@Override\n protected void onRequestTimeout(Tuple request) {\n }", "void setTimeout(@Nullable Duration timeout);", "public void setTimeout(long timeout) {\n\t\tthis.timeout = timeout;\n\t}", "public void setTimeout(Long value) {\r\n timeout = value;\r\n incompatibleWithSpawn |= timeout != null;\r\n }", "public long getRequestTimeoutMillis()\n {\n return requestTimeoutMillis;\n }", "public void resetTimeout(){\n this.timeout = this.timeoutMax;\n }", "public void setNortpTimeout(int seconds);", "public void setSocketTimeout(int socketTimeout) {\r\n this.socketTimeout = socketTimeout;\r\n }", "public void setConnectionTimeout(final int connTimeout) {\n this.newConnTimeout = connTimeout;\n }", "public long timeout(long timeout);", "public void setSoTimeout(int soTimeout)\r\n\t{\r\n\t\tthis.soTimeout = soTimeout;\r\n\t}", "public void setTimeout(final long timeout);", "protected void setTimeout() {\r\n\t\tTimeout timeout = new Timeout();\r\n\t\tt.schedule(timeout, TIMEOUT);\r\n\t}", "@Test\r\n public void testSetTimeout() {\r\n // Not required\r\n }", "@Test\n public void testSocketTimeout(){\n CloseableHttpClient client = HttpClients.createDefault();\n HttpGet httpGet = new HttpGet(URL + \"/http/testSocketTimeout\");\n RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(3500).build();\n httpGet.setConfig(requestConfig);\n try {\n CloseableHttpResponse response = client.execute(httpGet);\n System.out.println(EntityUtils.toString(response.getEntity()));\n } catch (Exception e){\n e.printStackTrace();\n }\n }", "protected void setTimeout(Integer connectionTimeoutInMillis, Integer receiveTimeoutInMillis) {\n ((BindingProvider) movilizerCloud).getRequestContext().put(CONNECTION_TIMEOUT_KEY,\n String.valueOf(connectionTimeoutInMillis));\n\n //Set timeout until the response is received\n ((BindingProvider) movilizerCloud).getRequestContext().put(RECEIVE_TIMEOUT_KEY,\n String.valueOf(receiveTimeoutInMillis));\n\n }", "public void setLoginTimeout(int paramLoginTimeout) {\n\tiLoginTimeout = paramLoginTimeout ;\n }", "public void setInCallTimeout(int seconds);", "public long getTimeout() { return timeout; }", "public long GetTimeout() { return timeout; }", "public void setTimeout (int timeout) {\n\tif (timeout >= 0)\n\t call.setTimeout (new Integer (timeout));\n }", "public void typeRemoteRequestTimeout(String value) {\n\t\tnew LabeledText(OpenShiftLabel.TextLabels.REMOTE_REQUEST_TIMEOUT).typeText(value);\n\t}", "@Override\n public ConfigurationImpl setNetworkCheckTimeout(int timeout) {\n this.networkCheckTimeout = timeout;\n return this;\n }", "public void setSendTimeout(int sendTimeout){\n return; //TODO codavaj!!\n }", "public void setSocketTimeout(final int socketTimeout) {\n this.newSoTimeout = socketTimeout;\n }", "@Override\r\n\t\tpublic void setNetworkTimeout(Executor executor, int milliseconds)\r\n\t\t\t\tthrows SQLException {\n\t\t\t\r\n\t\t}", "public native void setKeepAliveTimeout (int timeout);", "public void setConnectTimeout(int connectTimeout){\n return; //TODO codavaj!!\n }", "public void requestTimeout(Pdu packet);", "public void setRequestTimeoutMillis(long requestTimeoutMillis) {\n\t\t\n\t\tif (requestTimeoutMillis < MIN_REQUEST_TIMEOUT_MILLIS) {\n\t\t\tLOG.warning(\"[\" + getId() + \"] try to set request timeout with \" + requestTimeoutMillis + \" millis. This value will be ignored because it is smaller that \" + MIN_REQUEST_TIMEOUT_MILLIS + \" millis\");\n\t\t}\n\n\t\tif (requestTimeoutMillis <= 0) {\n\t\t\trequestHandlerAdapter.onRequestTimeout(this);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsetLastTimeDataReceivedMillis(System.currentTimeMillis());\n\t\t\n\t\tif ((this.requestTimeoutMillis == null) || (this.requestTimeoutMillis != requestTimeoutMillis)) {\n\t\t\tthis.requestTimeoutMillis = requestTimeoutMillis;\n\t\t\t\n\t\t\tif (requestTimeoutMillis == Long.MAX_VALUE) {\n\t\t\t\tterminateWatchDogTask();\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tlong watchdogPeriod = 100; \n\t\t\t\t\n\t\t\t\tif (requestTimeoutMillis > 1000) {\n\t\t\t\t\twatchdogPeriod = requestTimeoutMillis / 10;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (watchdogPeriod > MIN_WATCHDOG_PERIOD_MILLIS) {\n\t\t\t\t\twatchdogPeriod = MIN_WATCHDOG_PERIOD_MILLIS;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tupdateWatchDog(watchdogPeriod);\n\t\t\t}\n\t\t}\n\t}", "@Deprecated\r\n\tpublic void setTimeout(int timeout) {\r\n\t\tsetClientSoTimeout(timeout);\r\n\t\tsetServerSoTimeout(timeout);\r\n\t}", "@Config(\"dc.http-request-readTimeout\")\n @ConfigDescription(\"http request read timeout, default value is 30s\")\n public DataCenterConfig setHttpRequestReadTimeout(Duration httpRequestReadTimeout)\n {\n this.httpRequestReadTimeout = httpRequestReadTimeout;\n return this;\n }", "public Duration getHttpRequestConnectTimeout()\n {\n return httpRequestConnectTimeout;\n }", "public void clearRemoteRequestTimeout() {\n\t\tsetRemoteRequestTimeout(\"0\");\n\t}", "public int getTimeout() {\r\n return timeout;\r\n }", "public int getTimeout() {\n return timeout;\n }", "@Config(\"dc.http-request-connectTimeout\")\n @ConfigDescription(\"http request connect timeout, default value is 30s\")\n public DataCenterConfig setHttpRequestConnectTimeout(Duration httpRequestConnectTimeout)\n {\n this.httpRequestConnectTimeout = httpRequestConnectTimeout;\n return this;\n }", "public void setDefaultTimeout(int defaultTimeout) {\n this.defaultTimeout = defaultTimeout;\n }", "public Duration getHttpRequestReadTimeout()\n {\n return httpRequestReadTimeout;\n }", "protected int minTimeout() { return 500; }", "public int getTimeout() {\n return params.getTimeout() * 1000;\n }", "long getTimeout();", "public void setTimeoutLength(int timeout) {\n\t\tmyTimeoutLength = timeout;\n\t\tif (myPort == null) {\n\t\t\treturn;\n\t\t}\n\t\tmyPort.setTimeoutLength(timeout);\n\t}", "public void setDelayedTimeout(int seconds);", "@Test\n public void testLongTimeout() throws Exception {\n final int expectedTimeoutInSeconds = ((30 * 24) * 60) * 60;// 30 days.\n\n final long expectedLongValue = expectedTimeoutInSeconds * 1000L;\n Capture<Integer> capturedInt = new Capture<Integer>();\n // use a capture to make sure the setter is doing the right thing.\n mockSession.setMaxInactiveInterval(captureInt(capturedInt));\n expect(mockSession.getMaxInactiveInterval()).andReturn(expectedTimeoutInSeconds);\n replay(mockSession);\n HttpServletSession servletSession = new HttpServletSession(mockSession, null);\n servletSession.setTimeout(expectedLongValue);\n long timeoutInMilliseconds = servletSession.getTimeout();\n Assert.assertEquals(expectedLongValue, timeoutInMilliseconds);\n Assert.assertEquals(expectedTimeoutInSeconds, capturedInt.getValue().intValue());\n }", "void setStopTimeout(int stopTimeout);", "void setTimeout(long timeout) {\n if(timeout < 0) {\n throw new RuntimeException(buildMessage(\"Timeout value must be positive, not \" + timeout));\n }\n this.timeout = timeout;\n }", "public void setReadTimeout(int readTimeout){\n return; //TODO codavaj!!\n }", "protected int maxTimeout() { return 15*1000*1000; }", "@Override\r\n\tpublic void setLoginTimeout(int arg0) throws SQLException {\n\r\n\t}" ]
[ "0.75122243", "0.71462184", "0.70629376", "0.70396584", "0.7014513", "0.7013846", "0.69078356", "0.6827941", "0.6779471", "0.6765258", "0.6755589", "0.6745641", "0.67352617", "0.6730377", "0.67185825", "0.66831803", "0.6662947", "0.66567266", "0.66434264", "0.6639992", "0.66323644", "0.6630722", "0.6622656", "0.6618117", "0.66092795", "0.6572392", "0.65606606", "0.6557339", "0.65387386", "0.6501828", "0.64989305", "0.64759564", "0.64759564", "0.6447772", "0.6434843", "0.6430582", "0.6424171", "0.63992536", "0.6386317", "0.6375639", "0.63217133", "0.6320024", "0.63129735", "0.62984186", "0.62982893", "0.62981766", "0.62941265", "0.62890035", "0.628698", "0.6281591", "0.628031", "0.6274917", "0.62647676", "0.62646055", "0.6251238", "0.62407094", "0.6240578", "0.61963135", "0.61911154", "0.61767465", "0.61634827", "0.6148156", "0.6107393", "0.6086761", "0.6060817", "0.6059029", "0.6055871", "0.6053924", "0.6052401", "0.6014638", "0.60124177", "0.60084516", "0.59997815", "0.5998402", "0.59952587", "0.5971256", "0.5948844", "0.5947432", "0.5904692", "0.5903819", "0.5899667", "0.58973736", "0.58925265", "0.58773553", "0.58772826", "0.58605355", "0.5849073", "0.5838455", "0.58271074", "0.5807606", "0.580627", "0.58057135", "0.5791339", "0.5787419", "0.5782886", "0.5772748", "0.5763964", "0.57620096", "0.5755622", "0.5742585" ]
0.65283024
29
Specify the CSS media type. Defaults to \"print\" but you may want to use \"screen\" for web styles.
@javax.annotation.Nullable @ApiModelProperty(value = "Specify the CSS media type. Defaults to \"print\" but you may want to use \"screen\" for web styles.") @JsonProperty(JSON_PROPERTY_MEDIA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getMedia() { return media; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public reportScreen(String reportType) {\n this.reportType = reportType;\n\n }", "@Value.Default\n public String getMediaType() {\n\treturn \"\";\n }", "public void setMediaType(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), MEDIATYPE, value);\r\n\t}", "public void setMediaType(java.lang.String mediaType)\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(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MEDIATYPE$18);\n }\n target.setStringValue(mediaType);\n }\n }", "public String getMediaType() {\r\n return mediaType;\r\n }", "public String getMediaType() {\n\t\treturn mediaType;\n\t}", "public void setMedia(java.lang.String media) {\n this.media = media;\n }", "public static String getMediaType(Request request) {\n\t\tList<Preference<MediaType>> acceptedMediaTypes = request.getClientInfo().getAcceptedMediaTypes();\n\t\tfor (Preference<MediaType> preference : acceptedMediaTypes) {\n\t\t\tMediaType mediaType = preference.getMetadata();\n\t\t\tString mediaTypeName = mediaType.getName().trim();\n\t\t\tmediaTypeName=mediaTypeName.replaceAll(\"\\\\s\", \"\");\n\t\t\tif(mediaTypeName.equalsIgnoreCase(MediaType.APPLICATION_JSONVERBOSE.getName())){\n\t\t\t\treturn \".json\";\n\t\t\t}\n\t\t\tif(mediaTypeName.equalsIgnoreCase(MediaType.APPLICATION_ATOM.getName())){\n\t\t\t\treturn \".xml\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "MediaType getMediaType();", "public String getMediaType() throws SdpParseException {\n\t\treturn getMedia();\n\t}", "public void setCss(String css) {\n this.css = css;\n }", "public String getMediaType() {\n\t\t\treturn mediaType;\n\t\t}", "public static void setMediaType(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, MEDIATYPE, value);\r\n\t}", "@DISPID(1093) //= 0x445. The runtime will prefer the VTID if present\n @VTID(14)\n java.lang.String media();", "public java.lang.String getMediaType()\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(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(MEDIATYPE$18);\n }\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@DISPID(1093) //= 0x445. The runtime will prefer the VTID if present\n @VTID(13)\n void media(\n java.lang.String p);", "public void setType(String type)\n\t\t{\n\t\t\tElement typeElement = XMLUtils.findChild(mediaElement, TYPE_ELEMENT_NAME);\n\t\t\tif (type == null || type.equals(\"\")) {\n\t\t\t\tif (typeElement != null)\n\t\t\t\t\tmediaElement.removeChild(typeElement);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (typeElement == null) {\n\t\t\t\t\ttypeElement = document.createElement(TYPE_ELEMENT_NAME);\n\t\t\t\t\tmediaElement.appendChild(typeElement);\n\t\t\t\t}\n\t\t\t\ttypeElement.setTextContent(type);\n\t\t\t}\n\t\t}", "MediaType createMediaType();", "public void printScreen() {\n\t\tBrowser.printScreen(this.getClass().getSimpleName());\n\t}", "public void setMedia(String m) {\n\t\tmedia = m;\n\t}", "public void setPageStyle(String style)\n {\n // ignore\n }", "public void printToScreen() {\n String type = \"\";\n switch (this.type) {\n case 1:\n type = \"Fashion\";\n break;\n case 2:\n type = \"Electronic\";\n break;\n case 3:\n type = \"Consumable\";\n break;\n case 4:\n type = \"Household appliance\";\n break;\n }\n// System.out.println(\"Type : \" + type);\n System.out.printf(\"%6d%15s%6f%20s\\n\", id, name, price, type);\n }", "void setStyle(String style);", "String getPreferredMediaType( Document testRunArgs ) {\r\n String mediaTypeFromTestRunArg = parseMediaTypeFromTestRunArgs( testRunArgs );\r\n if ( mediaTypeFromTestRunArg != null && SUPPORTED_MEDIA_TYPES.contains( mediaTypeFromTestRunArg ) )\r\n return mediaTypeFromTestRunArg;\r\n return \"application/xml\";\r\n }", "VrsMediaType(String name) {\n\t\tthis.type= MediaType.valueOf(name);\n\t}", "public String toCSS(){\n return new StringBuilder()\n .append(\"display:\")\n .append(this.toString().replace(\"_\", \"-\"))\n .append(\";\").toString();\n }", "public void setMediaFormat(MediaFormat mediaFormat) {\n this.mediaFormat = mediaFormat;\n }", "public void xsetMediaType(org.apache.xmlbeans.XmlString mediaType)\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(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(MEDIATYPE$18);\n }\n target.set(mediaType);\n }\n }", "public void addMediaType(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), MEDIATYPE, value);\r\n\t}", "public String getPaperType() {\n return paperType;\n }", "public void setStyle(String style) {\n this.style = style;\n }", "public void setCtype(String ctype) {\n this.ctype = ctype;\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "MoviePlayer(String name, String manufacturer, Screen screen, MonitorType monitorType) {\n super(name, ItemType.Visual,manufacturer);\n\n this.screen = screen;\n this.monitorType = monitorType;\n }", "void setRendererType(String rendererType);", "public PrintGraphicalPage() {\n\tprintJob = PrinterJob.getPrinterJob(); \n\tformat = printJob.getPageFormat(null);\n\tpaper = format.getPaper();\n\tpaper.setImageableArea(0.0, 0.0, format.getPaper().getWidth(), format.getPaper().getHeight());\n\tformat.setPaper(paper);\n\t\n\t\n\t//aset = new HashPrintRequestAttributeSet();\n\t//MediaSizeName newMediaSizeName = new MediaSizeName(300);\n\t//myMediaSize=new MediaSize(80,230,Size2DSyntax.MM, MediaSizeName.PERSONAL_ENVELOPE);\n\t//aset.add(myMediaSize);\n //aset.add(MediaSizeName.ISO_A4);\n\t//resolution = new PrinterResolution(100, 100, PrinterResolution.DPI);\n //aset.add(resolution);\n //aset.add(OrientationRequested.PORTRAIT);\n }", "public String getExportMimeType(){\n return \"text/plain\";\n }", "public Report type(String type) {\n this.type = type;\n return this;\n }", "public static void addMediaType(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.add(model, instanceResource, MEDIATYPE, value);\r\n\t}", "@RequestMapping(value = \"/media\", produces = \"text/html;charset=utf-8\")\n\tpublic String tomedia(Model model, HttpServletRequest request, HttpServletResponse response,\n\t\t\t@CookieValue(value = \"city\", defaultValue = \"-1\") int city) {\n\t\t\n\t\treturn \"index_menu/media_production\";\n\t}", "public void setMediaType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), MEDIATYPE, value);\r\n\t}", "public void setMimeType(String mimeType) {\n response.setContentType(mimeType);\n }", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "public void setPaperType(String paperType) {\n this.paperType = paperType == null ? null : paperType.trim();\n }", "public org.apache.xmlbeans.XmlString xgetMediaType()\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(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_default_attribute_value(MEDIATYPE$18);\n }\n return target;\n }\n }", "public void setContentType(String contentType);", "public java.lang.String getMedia() {\n return media;\n }", "public String getType()\n\t\t{\n\t\t\tElement typeElement = XMLUtils.findChild(mediaElement, TYPE_ELEMENT_NAME);\n\t\t\treturn typeElement == null ? null : typeElement.getTextContent();\n\t\t}", "public MediaFormat getMediaFormat() {\n return mediaFormat;\n }", "public final synchronized void setStyle(int style){\n this.style = style;\n\n if (isLoggedIn()){\n sendCommand(\"$set style \"+style);\n filterLine(\"Style \"+style+\" set.\");\n }\n }", "private void writeTrackStyle() {\n printWriter.println(\"<Style id=\\\"\" + TRACK_STYLE + \"\\\">\");\n printWriter.println(\"<LineStyle><color>7f0000ff</color><width>4</width></LineStyle>\");\n printWriter.println(\"<IconStyle>\");\n printWriter.println(\"<scale>1.3</scale>\");\n printWriter.println(\"<Icon><href>\" + TRACK_ICON + \"</href></Icon>\");\n printWriter.println(\"</IconStyle>\");\n printWriter.println(\"</Style>\");\n }", "public interface TypePrinter {\n\n /**\n * Print a plain char to this printer.\n *\n * @param c the char\n * @return this TypePrinter\n */\n TypePrinter print(char c);\n\n /**\n * Print a plain String. If the string is null, the four characters {@code \"null\"} are printed.\n *\n * @param s the String\n * @return this TypePrinter\n */\n TypePrinter print(String s);\n\n /**\n * Print a Class. If the class is null, the four characters {@code \"null\"} are printed. The behavior\n * of this method is implementation specific. For example, some implementations print the fully qualified\n * class name where others may print just the {@link Class#getSimpleName simple name}.\n *\n * @param clazz the Class to print\n * @return this TypePrinter\n */\n TypePrinter print(Class<?> clazz);\n\n /**\n * Return everything printed to this TypePrinter as a String.\n */\n @Override String toString();\n}", "public void setReplyType(String rt) {\n/* 318 */ getCOSObject().setName(\"RT\", rt);\n/* */ }", "private String findMappedPrinter(String type) {\n logger.trace(\"findMappedPrinter::\" + type);\n return settingService.getSetting().getPrinters().get(type);\n }", "public void setMime_type(String value)\r\n {\r\n getSemanticObject().setProperty(data_mime_type, value);\r\n }", "void setDisplayMode(DisplayMode mode);", "public void setStyle(String st){\n style = st;\n }", "public static void setMediaType( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, MEDIATYPE, value);\r\n\t}", "public void setDeviceType(String argDeviceType){\n\t argDeviceType=argDeviceType.toUpperCase();\n\t if(argDeviceType.equals(\"CISCO\"))\n\t deviceType=RouterType.CISCO;\n\t else\n\t\t deviceType=RouterType.JUNIPER;\n }", "@Override\n public String getSprintMPasString() {\n if (hasArmedMASC()) {\n return getRunMPwithoutMASC() + \"(\" + getSprintMP() + \")\";\n }\n return Integer.toString(getSprintMP());\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public XMLDocument addStylesheet (String href, String type)\r\n\t{\r\n\t\tPI pi = new PI ();\r\n\t\tpi.setTarget (\"xml-stylesheet\").addInstruction (\"href\", href)\r\n\t\t\t.addInstruction (\"type\", type);\r\n\t\tprolog.addElement (pi);\r\n\t\treturn (this);\r\n\t}", "@Override\r\n\tpublic void setPrinter(IPrinter printer) {\n\r\n\t}", "TypePrinter print(char c);", "public MediaType getType() {\n return type;\n }", "public void setType(int type) {\n \t\tbrowserType = type;\n \t\tif (type == FILE_BROWSER) {\n \t\t\tdialogLabel = Messages.RemoteResourceBrowser_fileLabel;\n \t\t\tsetTitle(Messages.RemoteResourceBrowser_fileTitle);\n \t\t} else if (type == DIRECTORY_BROWSER) {\n \t\t\tdialogLabel = Messages.RemoteResourceBrowser_directoryLabel;\n \t\t\tsetTitle(Messages.RemoteResourceBrowser_directoryTitle);\n \t\t} else {\n \t\t\tdialogLabel = Messages.RemoteResourceBrowser_resourceLabel;\n \t\t\tsetTitle(Messages.RemoteResourceBrowser_resourceTitle);\n \t\t}\n \t}", "public Set<MediaType> getSupportedMediaTypes();", "public void setMaterial_type(Integer material_type) {\n this.material_type = material_type;\n }", "public void setContentType(String ctString) {\n/* */ BasicHeader basicHeader;\n/* 126 */ Header h = null;\n/* 127 */ if (ctString != null) {\n/* 128 */ basicHeader = new BasicHeader(\"Content-Type\", ctString);\n/* */ }\n/* 130 */ setContentType((Header)basicHeader);\n/* */ }", "public String getDisplayType();", "void setType(java.lang.String type);", "@Override\n\tpublic void setPaperType(java.lang.String paperType) {\n\t\t_scienceAppPaper.setPaperType(paperType);\n\t}", "public void setDisplay(String display);", "private void actionPrint() {\n // get PrinterJob\n PrinterJob job = PrinterJob.getPrinterJob();\n MyPrintable printable = new MyPrintable(job.defaultPage(), layoutPanel);\n\n // setup Printable, Pageable\n job.setPrintable(printable);\n job.setPageable(printable);\n\n // display print dialog and print\n if (job.printDialog()) {\n try {\n job.print();\n } catch (PrinterException e) {\n e.printStackTrace();\n }\n }\n }", "MimeType mediaType();", "private void setContentType(HttpServletResponse response, Format format) {\r\n switch (format) {\r\n case html:\r\n case htmlfragment:\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n break;\r\n case kml:\r\n response.setContentType(\"application/vnd.google-earth.kml+xml;charset=UTF-8\");\r\n response.setHeader(\"Content-Disposition\",\"attachment; filename=\\\"document.kml\\\"\");\r\n break;\r\n case json:\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n response.setHeader(\"Content-disposition\", \"attachment; filename=\\\"document.json\\\"\");\r\n break;\r\n case pjson:\r\n\t response.setContentType(\"text/plain;charset=UTF-8\");\r\n\t break; \r\n default:\r\n case xml:\r\n response.setContentType(\"text/xml;charset=UTF-8\");\r\n break;\r\n }\r\n}", "public void setContentType(MediaType mediaType)\r\n/* 186: */ {\r\n/* 187:278 */ Assert.isTrue(!mediaType.isWildcardType(), \"'Content-Type' cannot contain wildcard type '*'\");\r\n/* 188:279 */ Assert.isTrue(!mediaType.isWildcardSubtype(), \"'Content-Type' cannot contain wildcard subtype '*'\");\r\n/* 189:280 */ set(\"Content-Type\", mediaType.toString());\r\n/* 190: */ }", "void PrintOnScreen(String toPrnt);", "public String getMediumType() { return Constants.medium_MODEM; }", "public String setPrintOrientation(String orientation)\r\n\t{\n\t\tif (orientation.equalsIgnoreCase(\"portrait\") || orientation.equalsIgnoreCase(\"landscape\"))\r\n\t\t{\r\n\t\t\tprintOrientation = orientation;\r\n\t\t\tVL2.logger.logDebug(\"printOrientation set to \" + orientation);\r\n\t\t\treturn orientation;\r\n\t\t}\r\n\t\tVL2.logger.log(\"setPrintOrientation to '\" + orientation + \"' failed.\");\r\n\t\treturn null;\r\n\t}", "final public void setType(String type)\n {\n setProperty(TYPE_KEY, (type));\n }", "public void setContentType(String type) {\n this.response.setContentType(type);\n }", "public final void media() throws RecognitionException {\n try {\n // css21.g:54:5: ( MEDIA_SYM medium ( COMMA medium )* LBRACE ruleSet RBRACE )\n // css21.g:54:7: MEDIA_SYM medium ( COMMA medium )* LBRACE ruleSet RBRACE\n {\n match(input,MEDIA_SYM,FOLLOW_MEDIA_SYM_in_media169); if (state.failed) return ;\n\n pushFollow(FOLLOW_medium_in_media171);\n medium();\n\n state._fsp--;\n if (state.failed) return ;\n\n // css21.g:54:24: ( COMMA medium )*\n loop5:\n do {\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==COMMA) ) {\n alt5=1;\n }\n\n\n switch (alt5) {\n \tcase 1 :\n \t // css21.g:54:25: COMMA medium\n \t {\n \t match(input,COMMA,FOLLOW_COMMA_in_media174); if (state.failed) return ;\n\n \t pushFollow(FOLLOW_medium_in_media176);\n \t medium();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop5;\n }\n } while (true);\n\n\n match(input,LBRACE,FOLLOW_LBRACE_in_media188); if (state.failed) return ;\n\n pushFollow(FOLLOW_ruleSet_in_media202);\n ruleSet();\n\n state._fsp--;\n if (state.failed) return ;\n\n match(input,RBRACE,FOLLOW_RBRACE_in_media212); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }", "public void setContentType(ContentType type)\n\t{\n\t\tsetHeader(CONTENT_TYPE, type.toString());\n\t}", "@Override\n public Class<HrCmsMediaRecord> getRecordType() {\n return HrCmsMediaRecord.class;\n }", "public void setTerminalType(java.lang.String terminalType) {\n this.terminalType = terminalType;\n }", "public void display()\n\t{\n\t\tmediaType = \"Picture\";\n\t\t\n\t\tSystem.out.println(mediaType + \": \" + name + \", \" + resolution + \" dpi, is rated \" + rating + \" stars.\" );\n\t}", "public void setMedia(List<JRMediaObject> media) {\n mMedia = media;\n }", "@Override public String toString() {\n return this.ToMediaType().toString();\n }", "@Accessor(qualifier = \"mediasExportMediaCode\", type = Accessor.Type.SETTER)\n\tpublic void setMediasExportMediaCode(final String value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(MEDIASEXPORTMEDIACODE, value);\n\t}", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:290 */ return value != null ? MediaType.parseMediaType(value) : null;\r\n/* 196: */ }", "public static void ChangeScreen(ScreenType t) {\n\t\tlayout.show(contentPanel, t.toString());\n\t}", "public static void setType(String type) {\n Globals.type = type;\n setProperty(\"type\", type);\n }", "@Override\n\tpublic void play(String audioType, String fileName) {\n\t\tif(audioType.equalsIgnoreCase(\"mp3\")) {\n\t\t\tSystem.out.println(\"Playing mp3 file name : \"+ fileName);\n\t\t}\n\t\telse if ((audioType.equalsIgnoreCase(\"vlc\")) ||(audioType.equalsIgnoreCase(\"mp4\"))) {\n\t\t\tmediaAdapter = new MediaAdapter(audioType);\n\t\t\tmediaAdapter.play(audioType, fileName);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Invalid media type : \" + audioType + \" not supported.\");\n\t\t}\n\t}", "public void setContentType(final String type) {\n setHeader(\"Content-Type\", type);\n }", "@Override\n\tpublic final void setContentType(final String mimeType)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.setContentType(mimeType);\n\t\t}\n\t}", "public static StringBuilder getCss(boolean asTable) {\r\n\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tif (asTable) {\r\n\t\t\tsb.append(\"<style type=\\\"text/css\\\">\\n\");\r\n\r\n\t\t\tsb.append(\"body {\\n\");\r\n\t\t\tsb\r\n\t\t\t\t\t.append(\"font-family: Nokia Standard Multiscript, Tahoma, Verdana, Arial;\\n\");\r\n\t\t\tsb.append(\"font-size: 0.8em;\\n\");\r\n\t\t\tsb.append(\"color: #0055B7;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"h1 {\\n\");\r\n\t\t\tsb.append(\"padding: 30px 0 0 0;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"text-align: center;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"#date {\\n\");\r\n\t\t\tsb.append(\"text-align: center;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"hr {\\n\");\r\n\t\t\tsb.append(\"height: 1px;\\n\");\r\n\t\t\tsb.append(\"background-color: cccccc;\\n\");\r\n\t\t\tsb.append(\"color: #cccccc;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"h2 h3 {\\n\");\r\n\t\t\tsb.append(\"padding: 10px 0 10px 0;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.report {\\n\");\r\n\t\t\t// sb.append(\"table-layout: fixed\\n\");\r\n\t\t\tsb.append(\"width: 100%;\\n\");\r\n\t\t\tsb.append(\"border: 1px solid #e0dfe3;\\n\");\r\n\t\t\tsb.append(\"border-collapse: collapse;\\n\");\r\n\t\t\tsb.append(\"color: #333333;\\n\");\r\n\t\t\tsb.append(\"table-layout: fixed\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.report th {\\n\");\r\n\t\t\tsb.append(\"text-align: left;\\n\");\r\n\t\t\tsb.append(\"padding: 5px;\\n\");\r\n\t\t\tsb.append(\"background-color: #f9fafd;\\n\");\r\n\t\t\tsb.append(\"color: #595a5f;\\n\");\r\n\t\t\tsb.append(\"border-bottom: 1px #999999 solid;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.report th.featureName {\\n\");\r\n\t\t\tsb.append(\"background-color: #f2f2f3;\\n\");\r\n\t\t\tsb.append(\"font: #595a5f Tahoma, Verdana, Arial bold;\\n\");\r\n\t\t\tsb.append(\"font-size: 1.1em;\\n\");\r\n\t\t\tsb.append(\"border-top: 3px #9d9da1;\\n\");\r\n\t\t\tsb.append(\"border-top-style: double;\\n\");\r\n\t\t\tsb.append(\"border-bottom: 3px #9d9da1;\\n\");\r\n\t\t\tsb.append(\"border-bottom-style: double;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.report td {\\n\");\r\n\t\t\tsb.append(\"word-wrap: normal;\\n\");\r\n\t\t\tsb.append(\"border: 1px #EBEBEB;\\n\");\r\n\t\t\tsb.append(\"padding: 5px;\\n\");\r\n\t\t\tsb.append(\"border-style: solid; \\n\");\r\n\t\t\tsb.append(\"vertical-align: top;\\n\");\r\n\t\t\tsb.append(\"font: Tahoma, Verdana, Arial;\\n\");\r\n\t\t\tsb.append(\"_font-size: 0.8em;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.summary {\\n\");\r\n\t\t\tsb.append(\"border: 1px solid #e0dfe3;\\n\");\r\n\t\t\tsb.append(\"border-collapse: collapse;\\n\");\r\n\t\t\tsb.append(\"color: #333333;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.summary th {\\n\");\r\n\t\t\tsb.append(\"text-align: left;\\n\");\r\n\t\t\tsb.append(\"padding: 5px;\\n\");\r\n\t\t\tsb.append(\"background-color: #f9fafd;\\n\");\r\n\t\t\tsb.append(\"color: #595a5f;\\n\");\r\n\t\t\tsb.append(\"border-bottom: 1px #999999 solid;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.summary th.featureName {\\n\");\r\n\t\t\tsb.append(\"background-color: #f2f2f3;\\n\");\r\n\t\t\tsb.append(\"font: #595a5f Tahoma, Verdana, Arial bold;\\n\");\r\n\t\t\tsb.append(\"font-size: 1.1em;\\n\");\r\n\t\t\tsb.append(\"border-top: 3px #9d9da1;\\n\");\r\n\t\t\tsb.append(\"border-top-style: double;\\n\");\r\n\t\t\tsb.append(\"border-bottom: 3px #9d9da1;\\n\");\r\n\t\t\tsb.append(\"border-bottom-style: double;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"table.summary td {\\n\");\r\n\t\t\tsb.append(\"word-wrap: break-word;\\n\");\r\n\t\t\tsb.append(\"border: 1px #EBEBEB;\\n\");\r\n\t\t\tsb.append(\"padding: 5px;\\n\");\r\n\t\t\tsb.append(\"border-style: solid; \\n\");\r\n\t\t\tsb.append(\"vertical-align: top;\\n\");\r\n\t\t\tsb.append(\"font: Tahoma, Verdana, Arial;\\n\");\r\n\t\t\tsb.append(\"_font-size: 0.8em;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".currentValue {\\n\");\r\n\t\t\tsb.append(\"background-color: #a3e5a9;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"</style>\\n\");\r\n\r\n\t\t} else {\r\n\t\t\tsb.append(\"<style type=\\\"text/css\\\">\\n\");\r\n\t\t\tsb.append(\"body {\\n\");\r\n\t\t\tsb.append(\"word-wrap: break-word;\\n\");\r\n\t\t\tsb\r\n\t\t\t\t\t.append(\"font-family: Nokia Standard Multiscript, Tahoma, Verdana, Arial;\\n\");\r\n\t\t\tsb.append(\"color: #0055B7;\\n\");\r\n\t\t\tsb.append(\"padding: 0 0 0 10px;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"h1#reportName {\\n\");\r\n\t\t\tsb.append(\"text-align: center;\\n\");\r\n\t\t\tsb.append(\"padding: 30px 0 0 0;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"#date {\\n\");\r\n\t\t\tsb.append(\"text-align: center;\\n\");\r\n\t\t\tsb.append(\"page-break-after: always;\\n\");\r\n\t\t\tsb.append(\"padding: 0;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"h2#tocHeader {\\n\");\r\n\t\t\tsb.append(\"padding: 20px 0 0 0px;\\n\");\r\n\t\t\tsb.append(\"margin: inherit;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"ul.toc, ul.toc ul {\\n\");\r\n\t\t\tsb.append(\"font-size: 12px;\\n\");\r\n\t\t\tsb.append(\"margin: inherit;\\n\");\r\n\t\t\tsb.append(\"list-style-type: none;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"hr {\\n\");\r\n\t\t\tsb.append(\"page-break-after: always;\\n\");\r\n\t\t\tsb.append(\"height: 1px;\\n\");\r\n\t\t\tsb.append(\"background-color: cccccc;\\n\");\r\n\t\t\tsb.append(\"color: #cccccc;\\n\");\r\n\t\t\tsb.append(\"width: 100%;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".group, .subgroup, .feature, .setting {\\n\");\r\n\t\t\tsb.append(\"padding: 10px 0 0 0px;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".subsetting {\\n\");\r\n\t\t\tsb.append(\"padding: 10px 0 0 20px;\\n\");\r\n\t\t\tsb.append(\"margin: 0;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"h2, h3, h4, h5, h6 {\\n\");\r\n\t\t\tsb.append(\"padding: 0px;\\n\");\r\n\t\t\tsb.append(\"margin: 0px;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".description {\\n\");\r\n\t\t\tsb.append(\"font-size: 12px;\\n\");\r\n\t\t\tsb.append(\"margin: 0 0 0 0px;\\n\");\r\n\t\t\tsb.append(\"padding: 0px;\\n\");\r\n\t\t\tsb.append(\"color: #333333;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".settingValues {\\n\");\r\n\t\t\tsb.append(\"padding: 0px;\\n\");\r\n\t\t\tsb.append(\"margin: 5px 0 0 0px;\\n\");\r\n\t\t\tsb.append(\"color: #333333;\\n\");\r\n\t\t\tsb.append(\"font-size: 12px;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".Property {\\n\");\r\n\t\t\tsb.append(\"float: left;\\n\");\r\n\t\t\tsb.append(\"width: 200px;\\n\");\r\n\t\t\tsb.append(\"clear: both;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".Value {\\n\");\r\n\t\t\tsb.append(\"position: relative;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\".PropertySum {\\n\");\r\n\t\t\tsb.append(\"float: left;\\n\");\r\n\t\t\tsb.append(\"margin-left: 50px;\\n\");\r\n\t\t\tsb.append(\"width: 200px;\\n\");\r\n\t\t\tsb.append(\"clear: both;\\n\");\r\n\t\t\tsb.append(\"}\\n\");\r\n\r\n\t\t\tsb.append(\"</style>\\n\");\r\n\t\t}\r\n\t\treturn sb;\r\n\t}" ]
[ "0.5372982", "0.5182367", "0.50932014", "0.5005198", "0.4902695", "0.48769894", "0.48676664", "0.48446408", "0.48377535", "0.48118693", "0.47939053", "0.47680008", "0.4752068", "0.47229198", "0.47113693", "0.46884423", "0.46734565", "0.4627257", "0.45424005", "0.45175403", "0.45074832", "0.45068973", "0.44907326", "0.44852746", "0.44602978", "0.44536602", "0.4448667", "0.44400617", "0.44277292", "0.440865", "0.43853524", "0.4380471", "0.43770677", "0.43770677", "0.43762654", "0.43757543", "0.43668348", "0.43602034", "0.43440765", "0.43384245", "0.4320022", "0.43153882", "0.430908", "0.43090016", "0.43007064", "0.42998528", "0.42965472", "0.42895582", "0.4286436", "0.42829564", "0.4277763", "0.42746776", "0.42622468", "0.4252077", "0.42478603", "0.42387378", "0.4234673", "0.42314827", "0.422933", "0.42282498", "0.42252216", "0.42155328", "0.42155328", "0.42155328", "0.42152762", "0.42074093", "0.42008972", "0.4187251", "0.4183477", "0.41786194", "0.41714984", "0.41695663", "0.4167279", "0.41617462", "0.41608387", "0.41581026", "0.41514504", "0.4149981", "0.4149229", "0.41394737", "0.41308612", "0.413016", "0.41256788", "0.4123375", "0.41207722", "0.4095664", "0.40912217", "0.40904012", "0.40886155", "0.4084076", "0.40755418", "0.4075515", "0.40738866", "0.40684924", "0.40684053", "0.40656412", "0.40554217", "0.40507135", "0.40450847", "0.4042984" ]
0.67469805
0
Disable font embedding in PDFs.
@javax.annotation.Nullable @ApiModelProperty(value = "Disable font embedding in PDFs.") @JsonProperty(JSON_PROPERTY_NO_EMBED_FONTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getNoEmbedFonts() { return noEmbedFonts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isFontSet() { return false; }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font subsetting in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_SUBSET_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoSubsetFonts() {\n return noSubsetFonts;\n }", "protected void doStandardFonts() {\r\n\t\trenderer.txt.setUseStandardFonts(ui.viewStandardFonts.isSelected());\r\n\t}", "public void allowUnsupportedFont() {\n if (mBuilderPtr == 0) {\n throw new IllegalStateException(\"Unable to allow unsupported font.\");\n }\n nAllowUnsupportedFont(mBuilderPtr);\n }", "@Override\n public boolean isConcurrentFontManagementSupported() {\n return false;\n }", "private void setFont() {\n\t}", "public PdfFontProgram() {\n super();\n }", "private void setFont() {\n Typeface font = Typeface.createFromAsset(getContext().getAssets(), mFontPath);\n setTypeface(font, Typeface.NORMAL);\n }", "public void GetFont (){\n fontBol = false;\n fontBolS = true;\n fontBolA = true;\n fontBolW = true;\n }", "public Obj getEmbeddedFont() throws PDFNetException {\n/* 809 */ return Obj.__Create(GetEmbeddedFont(this.a), this.b);\n/* */ }", "public static void setUseNativeFonts ( final boolean useNativeFonts )\n {\n NativeFonts.useNativeFonts = useNativeFonts;\n }", "public FontFile getEmbeddedFont() {\n return font;\n }", "public String getEmbeddedFontName() throws PDFNetException {\n/* 795 */ return GetEmbeddedFontName(this.a);\n/* */ }", "private void setFont() {\n try {\n setFont(Font.loadFont(new FileInputStream(FONT_PATH), 23));\n } catch (FileNotFoundException e) {\n setFont(Font.font(\"Verdana\", 23));\n }\n }", "private boolean browserCantRenderFontsConsistently() {\n\r\n return getPage().getWebBrowser().getBrowserApplication()\r\n .contains(\"PhantomJS\")\r\n || (getPage().getWebBrowser().isIE() && getPage()\r\n .getWebBrowser().getBrowserMajorVersion() <= 9);\r\n }", "public void setFont(Font f) {\n super.setFont(f);\n columnWidth = 0;\n }", "private void loadFont() {\n\t\ttry {\n\t\t\tfont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(\"assets/fonts/forced_square.ttf\"));\n\t\t} catch (Exception e) {\n\t\t\tfont = new Font(\"Helvetica\", Font.PLAIN, 22);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n void testAcroFormDefaultFonts() throws IOException\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try (PDDocument doc = new PDDocument())\n {\n PDPage page = new PDPage(PDRectangle.A4);\n doc.addPage(page);\n PDAcroForm acroForm2 = new PDAcroForm(doc);\n doc.getDocumentCatalog().setAcroForm(acroForm2);\n PDResources defaultResources = acroForm2.getDefaultResources();\n assertNull(defaultResources);\n defaultResources = new PDResources();\n acroForm2.setDefaultResources(defaultResources);\n assertNull(defaultResources.getFont(COSName.HELV));\n assertNull(defaultResources.getFont(COSName.ZA_DB));\n\n // getting AcroForm sets the two fonts\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n assertNotNull(defaultResources.getFont(COSName.HELV));\n assertNotNull(defaultResources.getFont(COSName.ZA_DB));\n\n // repeat with a new AcroForm (to delete AcroForm cache) and thus missing /DR\n doc.getDocumentCatalog().setAcroForm(new PDAcroForm(doc));\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n \n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n doc.save(baos);\n }\n try (PDDocument doc = Loader.loadPDF(baos.toByteArray()))\n {\n PDAcroForm acroForm2 = doc.getDocumentCatalog().getAcroForm();\n PDResources defaultResources = acroForm2.getDefaultResources();\n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n // make sure that font wasn't overwritten\n assertTrue(helv instanceof PDType1Font);\n assertTrue(zadb instanceof PDType1Font);\n PDType1Font helvType1 = (PDType1Font) helv;\n PDType1Font zadbType1 = (PDType1Font) zadb;\n assertEquals(FontName.HELVETICA.getName(), helv.getName());\n assertEquals(FontName.ZAPF_DINGBATS.getName(), zadb.getName());\n assertNull(helvType1.getType1Font());\n assertNull(zadbType1.getType1Font());\n }\n }", "public void initFont() {\r\n\t\tFont dosFont = null;\r\n try {\r\n \t//setup font\r\n\t\t\t\tURL fontUrl = getURL(\"fonts/DOSFont.ttf\");\r\n\t\t \tdosFont = Font.createFont(Font.TRUETYPE_FONT, fontUrl.openStream());\r\n\t \tdosFont = dosFont.deriveFont(Font.PLAIN, 15);\r\n\t \tGraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n\t \tge.registerFont(dosFont);\r\n\t } catch(Exception e) {\r\n\t e.printStackTrace();\r\n\t System.exit(-1);\r\n\t }\r\n screen.setFont(dosFont);//set font on JTextArea\r\n\t}", "public void revertFont()\r\n\t{\r\n\t\tif (savedFont != null)\r\n\t\t{\r\n\t\t\tg.setFont(savedFont);\r\n\t\t}\r\n\t}", "public void setTrueFont(Font font)\n\t{\n\t\tString bodyRule = \"body { font-family: \" + font.getFamily() + \"; \" +\n\t\t\t\t\"font-size: \" + font.getSize() + \"pt; }\";\n\t\t((HTMLDocument)getDocument()).getStyleSheet().addRule(bodyRule);\n\t\t//Sets the font for when the JEditorPane is switched to plain text.\n\t\tsetFont(font);\n\t}", "private void setupFonts()\r\n\t{\r\n\t\tSystem.out.println(\"In setupFonts()\");\r\n\t\t\r\n\t\t// set up the text fonts\r\n\t\ttry\r\n\t\t{\r\n\t\t\ttextFont = Font.createFont(Font.TRUETYPE_FONT, AppletResourceLoader.getFileFromJar(GameConstants.PATH_FONTS + \"FOXLEY8_.ttf\"));\r\n\t\t\ttextFont = textFont.deriveFont(16.0f);\r\n\t\t\ttextFontBold = textFont.deriveFont(Font.BOLD, 16.0f);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ERROR IN setupFonts(): \" + e.getClass().getName() + \" - \" + e.getMessage());\r\n\t\t}\r\n\t}", "private void loadSystemFont(String font){\n mFont = new Font(font, mFontStyle, (int)mFontSize);\n }", "boolean isAlwaysvectorfont();", "public void GetFontS (){\n fontBolS = false;\n fontBol = true;\n fontBolA = true;\n fontBolW = true;\n }", "public void GetFontA (){\n fontBolA = false;\n fontBolS = true;\n fontBol = true;\n fontBolW = true;\n }", "public Font createFont() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "public void GetFontW (){\n fontBolW = false;\n fontBolS = true;\n fontBolA = true;\n fontBol = true;\n }", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "public void fontLoader(){\n try {\n //create the font to use. Specify the size!\n customFont = Font.createFont(Font.TRUETYPE_FONT, new File(\".\\\\resources\\\\DS-DIGI.ttf\")).deriveFont(40f);\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n ge.registerFont(customFont);\n } catch (IOException e) {\n e.printStackTrace();\n } catch(FontFormatException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void dispose() {\n\t\tfont.dispose();\r\n\t}", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "public native void setFont(Font value) /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\tjso.font = value.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n }-*/;", "public void init() {\n\n /**\n * FontFile1 = A stream containing a Type 1 font program\n * FontFile2 = A stream containing a TrueType font program\n * FontFile3 = A stream containing a font program other than Type 1 or\n * TrueType. The format of the font program is specified by the Subtype entry\n * in the stream dictionary\n */\n try {\n\n // get an instance of our font factory\n FontFactory fontFactory = FontFactory.getInstance();\n\n if (entries.containsKey(FONT_FILE)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n }\n\n if (entries.containsKey(FONT_FILE_2)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_2);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TRUE_TYPE);\n }\n }\n\n if (entries.containsKey(FONT_FILE_3)) {\n\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_3);\n String subType = fontStream.getObject(\"Subtype\").toString();\n if (subType != null &&\n (subType.equals(FONT_FILE_3_TYPE_1C) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0C))\n ) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n if (subType != null && subType.equals(FONT_FILE_3_OPEN_TYPE)) {\n// font = new NFontOpenType(fontStreamBytes);\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_OPEN_TYPE);\n }\n }\n }\n // catch everything, we can fall back to font substitution if a failure\n // occurs. \n catch (Throwable e) {\n logger.log(Level.FINE, \"Error Reading Embedded Font \", e);\n }\n\n }", "public void setFont(Font font)\n {\n this.font = font;\n }", "public void setFont(Font value) {\r\n this.font = value;\r\n }", "public static void setDefaultFont(Font f) {\r\n defaultFont = f;\r\n }", "@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Arial\", Font.PLAIN, 11)); \r\n }", "public void setFont(int fontId){\n this.fontId = fontId;\n }", "public void setFont(Font font) {\n\tthis.font = font;\n }", "private String getFallbackFontName(PDFontDescriptor fontDescriptor) {\n/* */ String fontName;\n/* 235 */ if (fontDescriptor != null) {\n/* */ \n/* */ \n/* 238 */ boolean isBold = false;\n/* 239 */ String name = fontDescriptor.getFontName();\n/* 240 */ if (name != null) {\n/* */ \n/* 242 */ String lower = fontDescriptor.getFontName().toLowerCase();\n/* */ \n/* */ \n/* 245 */ isBold = (lower.contains(\"bold\") || lower.contains(\"black\") || lower.contains(\"heavy\"));\n/* */ } \n/* */ \n/* */ \n/* 249 */ if (fontDescriptor.isFixedPitch()) {\n/* */ \n/* 251 */ fontName = \"Courier\";\n/* 252 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 254 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 256 */ else if (isBold)\n/* */ {\n/* 258 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 260 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 262 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* 265 */ } else if (fontDescriptor.isSerif()) {\n/* */ \n/* 267 */ fontName = \"Times\";\n/* 268 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 270 */ fontName = fontName + \"-BoldItalic\";\n/* */ }\n/* 272 */ else if (isBold)\n/* */ {\n/* 274 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 276 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 278 */ fontName = fontName + \"-Italic\";\n/* */ }\n/* */ else\n/* */ {\n/* 282 */ fontName = fontName + \"-Roman\";\n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 287 */ fontName = \"Helvetica\";\n/* 288 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 290 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 292 */ else if (isBold)\n/* */ {\n/* 294 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 296 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 298 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 305 */ fontName = \"Times-Roman\";\n/* */ } \n/* 307 */ return fontName;\n/* */ }", "public FontConfig() {\n\t\tthis.name = \"Monospaced\";\n\t\tthis.style = FontStyle.PLAIN;\n\t\tthis.size = DEFAULT_SIZE;\n\t}", "@Override\n\tpublic void dispose() {\n\t\n\t\tFont.dispose();\n\t\n\t}", "public void setFont( Font font ) {\r\n this.font = font;\r\n }", "public void setFontProgram(PdfFile fontProgram) {\n this.add(fontProgram);\n }", "@Action(selectedProperty = \"bigFontSet\", enabledProperty = \"windowsOS\")\n public void toggleFontSet() {\n }", "public final void setIsFreeText(java.lang.Boolean isfreetext)\r\n\t{\r\n\t\tsetIsFreeText(getContext(), isfreetext);\r\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow printing of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_PRINT)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowPrint() {\n return disallowPrint;\n }", "public void setFont(Font f) {\n font = f;\n compute();\n }", "protected void applyFont() {\n\t\tif (fields != null) {\n\t\t\tIterator<FieldEditor> e = fields.iterator();\n\t\t\twhile (e.hasNext()) {\n\t\t\t\tFieldEditor pe = e.next();\n\t\t\t\t// pe.applyFont();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void dispose() {\n\t\tisActive = false;\n\t\tfont.dispose();\n\t}", "Font createFont();", "public void setFontName(String name) {\n\t\tthis.fontName = name;\n\t}", "public void setTextFont(Font font);", "public void init( )\n {\n metFont = new HersheyFont( getDocumentBase(), getParameter(\"font\"));\n }", "private void setupFont() {\n CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()\n .setDefaultFontPath(\"fonts/Montserrat-Regular.otf\")\n .setFontAttrId(R.attr.fontPath)\n .build()\n );\n }", "FontMapperImpl() {\n/* 55 */ this.substitutes.put(\"Courier\", \n/* 56 */ Arrays.asList(new String[] { \"CourierNew\", \"CourierNewPSMT\", \"LiberationMono\", \"NimbusMonL-Regu\" }));\n/* 57 */ this.substitutes.put(\"Courier-Bold\", \n/* 58 */ Arrays.asList(new String[] { \"CourierNewPS-BoldMT\", \"CourierNew-Bold\", \"LiberationMono-Bold\", \"NimbusMonL-Bold\" }));\n/* */ \n/* 60 */ this.substitutes.put(\"Courier-Oblique\", \n/* 61 */ Arrays.asList(new String[] { \"CourierNewPS-ItalicMT\", \"CourierNew-Italic\", \"LiberationMono-Italic\", \"NimbusMonL-ReguObli\" }));\n/* */ \n/* 63 */ this.substitutes.put(\"Courier-BoldOblique\", \n/* 64 */ Arrays.asList(new String[] { \"CourierNewPS-BoldItalicMT\", \"CourierNew-BoldItalic\", \"LiberationMono-BoldItalic\", \"NimbusMonL-BoldObli\" }));\n/* */ \n/* 66 */ this.substitutes.put(\"Helvetica\", \n/* 67 */ Arrays.asList(new String[] { \"ArialMT\", \"Arial\", \"LiberationSans\", \"NimbusSanL-Regu\" }));\n/* 68 */ this.substitutes.put(\"Helvetica-Bold\", \n/* 69 */ Arrays.asList(new String[] { \"Arial-BoldMT\", \"Arial-Bold\", \"LiberationSans-Bold\", \"NimbusSanL-Bold\" }));\n/* */ \n/* 71 */ this.substitutes.put(\"Helvetica-Oblique\", \n/* 72 */ Arrays.asList(new String[] { \"Arial-ItalicMT\", \"Arial-Italic\", \"Helvetica-Italic\", \"LiberationSans-Italic\", \"NimbusSanL-ReguItal\" }));\n/* */ \n/* 74 */ this.substitutes.put(\"Helvetica-BoldOblique\", \n/* 75 */ Arrays.asList(new String[] { \"Arial-BoldItalicMT\", \"Helvetica-BoldItalic\", \"LiberationSans-BoldItalic\", \"NimbusSanL-BoldItal\" }));\n/* */ \n/* 77 */ this.substitutes.put(\"Times-Roman\", \n/* 78 */ Arrays.asList(new String[] { \"TimesNewRomanPSMT\", \"TimesNewRoman\", \"TimesNewRomanPS\", \"LiberationSerif\", \"NimbusRomNo9L-Regu\" }));\n/* */ \n/* 80 */ this.substitutes.put(\"Times-Bold\", \n/* 81 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldMT\", \"TimesNewRomanPS-Bold\", \"TimesNewRoman-Bold\", \"LiberationSerif-Bold\", \"NimbusRomNo9L-Medi\" }));\n/* */ \n/* */ \n/* 84 */ this.substitutes.put(\"Times-Italic\", \n/* 85 */ Arrays.asList(new String[] { \"TimesNewRomanPS-ItalicMT\", \"TimesNewRomanPS-Italic\", \"TimesNewRoman-Italic\", \"LiberationSerif-Italic\", \"NimbusRomNo9L-ReguItal\" }));\n/* */ \n/* */ \n/* 88 */ this.substitutes.put(\"Times-BoldItalic\", \n/* 89 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldItalicMT\", \"TimesNewRomanPS-BoldItalic\", \"TimesNewRoman-BoldItalic\", \"LiberationSerif-BoldItalic\", \"NimbusRomNo9L-MediItal\" }));\n/* */ \n/* */ \n/* 92 */ this.substitutes.put(\"Symbol\", Arrays.asList(new String[] { \"Symbol\", \"SymbolMT\", \"StandardSymL\" }));\n/* 93 */ this.substitutes.put(\"ZapfDingbats\", Arrays.asList(new String[] { \"ZapfDingbatsITC\", \"Dingbats\", \"MS-Gothic\" }));\n/* */ \n/* */ \n/* */ \n/* 97 */ for (String baseName : Standard14Fonts.getNames()) {\n/* */ \n/* 99 */ if (!this.substitutes.containsKey(baseName)) {\n/* */ \n/* 101 */ String mappedName = Standard14Fonts.getMappedFontName(baseName);\n/* 102 */ this.substitutes.put(baseName, copySubstitutes(mappedName));\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ try {\n/* 110 */ String ttfName = \"/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf\";\n/* 111 */ InputStream ttfStream = FontMapper.class.getResourceAsStream(ttfName);\n/* 112 */ if (ttfStream == null)\n/* */ {\n/* 114 */ throw new IOException(\"Error loading resource: \" + ttfName);\n/* */ }\n/* 116 */ TTFParser ttfParser = new TTFParser();\n/* 117 */ this.lastResortFont = ttfParser.parse(ttfStream);\n/* */ }\n/* 119 */ catch (IOException e) {\n/* */ \n/* 121 */ throw new RuntimeException(e);\n/* */ } \n/* */ }", "@Test\n void testDontAddMissingInformationOnDocumentLoad()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n \n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n // do a low level access to the AcroForm to avoid the generation of missing entries\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n COSDictionary catalogDictionary = documentCatalog.getCOSObject();\n COSDictionary acroFormDictionary = (COSDictionary) catalogDictionary.getDictionaryObject(COSName.ACRO_FORM);\n\n // ensure that the missing information has not been generated\n assertNull(acroFormDictionary.getDictionaryObject(COSName.DA));\n assertNull(acroFormDictionary.getDictionaryObject(COSName.RESOURCES));\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "public void remove(String name) {\n FreeTypeFontGenerator generator = generators.remove(name);\n if (generator != null) {\n generator.dispose();\n }\n Map<Integer, BitmapFont> fonts = bitmapFonts.remove(name);\n if (fonts != null) {\n for (BitmapFont font : fonts.values()) {\n font.dispose();\n }\n }\n }", "public void setTextFont(Font font)\n {\n setFont(font);\n }", "private void settypeface() {\n }", "private FontBoxFont findFont(FontFormat format, String postScriptName) {\n/* 403 */ if (postScriptName == null)\n/* */ {\n/* 405 */ return null;\n/* */ }\n/* */ \n/* */ \n/* 409 */ if (this.fontProvider == null)\n/* */ {\n/* 411 */ getProvider();\n/* */ }\n/* */ \n/* */ \n/* 415 */ FontInfo info = getFont(format, postScriptName);\n/* 416 */ if (info != null)\n/* */ {\n/* 418 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 422 */ info = getFont(format, postScriptName.replaceAll(\"-\", \"\"));\n/* 423 */ if (info != null)\n/* */ {\n/* 425 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 429 */ for (String substituteName : getSubstitutes(postScriptName)) {\n/* */ \n/* 431 */ info = getFont(format, substituteName);\n/* 432 */ if (info != null)\n/* */ {\n/* 434 */ return info.getFont();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 439 */ info = getFont(format, postScriptName.replaceAll(\",\", \"-\"));\n/* 440 */ if (info != null)\n/* */ {\n/* 442 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 446 */ info = getFont(format, postScriptName + \"-Regular\");\n/* 447 */ if (info != null)\n/* */ {\n/* 449 */ return info.getFont();\n/* */ }\n/* */ \n/* 452 */ return null;\n/* */ }", "public void unsetItalic()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(ITALIC$6, 0);\n }\n }", "public void setIdxSearchNoHtml(boolean idxSearchNoHtml) {\n Preferences prefs = getPreferences();\n prefs.putBoolean(PROP_SEARCH_NO_HTML, idxSearchNoHtml);\n }", "public void setFontName(String name)\n {\n font.setFontName(name);\n }", "public String getFontName();", "public String getFontName();", "public String getFontName();", "public void setFont(Font newFont) {\n\tfont = newFont;\n }", "public void setFont(String font) {\r\n\t\tProps p = getPage().getPageProperties();\r\n\t\t_fontTagStart = p.getProperty(font + Props.TAG_START);\r\n\t\t_fontTagEnd = p.getProperty(font + Props.TAG_END);\r\n\t}", "static PDFont loadFont(PDDocument document) {\n Path fontPath = Paths.get(badgeResourcePath, \"/Bitstream - BankGothic Md BT Medium.ttf\");\n\n try (InputStream stream = new FileInputStream(fontPath.toFile())) {\n return PDType0Font.load(document, stream);\n } catch (IOException ex) {\n log.warn(\"Error, couldn't load font '{}'\", fontPath.toAbsolutePath());\n return PDType1Font.HELVETICA_BOLD;\n }\n }", "public void changeFonts(){\n Typeface typeFace = Typeface.createFromAsset (this.getAssets (), \"fonts/courier.ttf\");\n sloganTV.setTypeface (typeFace);\n }", "@Override\n public void setFont(String font) {\n graphicsEnvironmentImpl.setFont(canvas, font);\n }", "private java.awt.Font getFont(Feature feature, Font[] fonts) {\n if (fontFamilies == null) {\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n fontFamilies = new HashSet();\n \n List f = Arrays.asList(ge.getAvailableFontFamilyNames());\n fontFamilies.addAll(f);\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"there are \" + fontFamilies.size() + \" fonts available\");\n }\n }\n \n java.awt.Font javaFont = null;\n \n int styleCode = 0;\n int size = 6;\n String requestedFont = \"\";\n \n for (int k = 0; k < fonts.length; k++) {\n requestedFont = fonts[k].getFontFamily().getValue(feature).toString();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"trying to load \" + requestedFont);\n }\n \n if (loadedFonts.containsKey(requestedFont)) {\n javaFont = (java.awt.Font) loadedFonts.get(requestedFont);\n \n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n return javaFont.deriveFont(styleCode, size);\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not already loaded\");\n }\n \n if (fontFamilies.contains(requestedFont)) {\n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"requesting \" + requestedFont + \" \" + styleCode + \" \" + size);\n }\n \n javaFont = new java.awt.Font(requestedFont, styleCode, size);\n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a system font\");\n }\n \n // may be its a file or url\n InputStream is = null;\n \n if (requestedFont.startsWith(\"http\") || requestedFont.startsWith(\"file:\")) {\n try {\n URL url = new URL(requestedFont);\n is = url.openStream();\n } catch (MalformedURLException mue) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad url in java2drenderer\" + requestedFont + \"\\n\" + mue);\n }\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n }\n } else {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a URL\");\n }\n \n File file = new File(requestedFont);\n \n //if(file.canRead()){\n try {\n is = new FileInputStream(file);\n } catch (FileNotFoundException fne) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad file name in java2drenderer\" + requestedFont + \"\\n\" + fne);\n }\n }\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"about to load\");\n }\n \n if (is == null) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"null input stream\");\n }\n \n continue;\n }\n \n try {\n javaFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, is);\n } catch (FontFormatException ffe) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Font format error in java2drender \" + requestedFont + \"\\n\" + ffe);\n }\n \n continue;\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n \n continue;\n }\n \n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n return null;\n }", "public void unsetForceInline() {\n // For concurrent scenarios we should allow the flag to be already unset\n assert inlining == InlinePreference.Default || inlining == InlinePreference.ForceInline;\n inlining = InlinePreference.Default;\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "private void updateFontSet() {\n if (!isBigFontSet()) {\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), null);\n } else {\n// <snip> Install sscaled font\n FontPolicy windowsPolicy = FontPolicies.getDefaultWindowsPolicy();\n FontSet fontSet = windowsPolicy.getFontSet(null, UIManager\n .getLookAndFeelDefaults());\n WrapperFontSet scaled = new WrapperFontSet(fontSet, 5);\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), scaled);\n// </snip>\n }\n updateLookAndFeel();\n }", "public void setFont(Font newFont) {\r\n\t\tfont = newFont;\r\n\t}", "public static void setFont(Font font){\n\t\tGComponent.fGlobalFont = font;\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow annotation of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_ANNOTATE)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowAnnotate() {\n return disallowAnnotate;\n }", "public void setIgnoreAttachedBody(boolean flag);", "public void setIgnoreTextEvent(boolean bIgnoreTextEvent) {\n m_bIgnoreTextEvent = bIgnoreTextEvent;\n }", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "public boolean isFacebeautyEnabled() {\n return false;\n }", "public void setSuppressAlpha(boolean suppressAlpha) {\n/* 106 */ this.suppressAlpha = suppressAlpha;\n/* */ }", "@Test\n public void Test_Output_Font() throws Exception {\n String actual_value = \"\";\n String expected_value = \"1 0 obj \\n<< \\n/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] \\n\";\n expected_value += \"/Font \\n<< \\n/F2 \\n<< \\n/Type /Font \\n/BaseFont /Helvetica \\n/SubType /Type1 \\n\";\n expected_value += \">> \\n>> \\n>> \\n\";\n\n PdfResource resrc = new PdfResource();\n resrc.addFont(new PdfFont(PdfFont.HELVETICA, false, false));\n actual_value = new String(resrc.dumpInfo());\n \n assertThat(actual_value, equalTo(expected_value));\n }", "public void setIsFontItalic(boolean value) {\n this.isFontItalic = value;\n }", "public void unsetBoldItalic()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BOLDITALIC$8, 0);\n }\n }", "public static void setInvisible() {\r\n\t\tfrmMfhEmailer.setVisible(false);\r\n\t}", "protected boolean isFreeStyle(){\r\n\t\treturn false;\r\n\t}", "private static Font[] loadFonts() throws Exception {\r\n Font font = Font.createFont(Font.TRUETYPE_FONT, Class.class.getClass()\r\n .getResource(\"/language/fonts/code2000.ttf\").openStream());\r\n // since 1.6 we could register the font and use it by name\r\n // but using the font directly makes us 1.5 compatible\r\n // GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font);\r\n return new Font[]{font};\r\n }", "public static void main(String[] args) throws Exception\n {\n String dataDir = Utils.getDataDir(AsposeSpecifyDefaultFontswhileRendering.class);\n\n Document doc = new Document(dataDir + \"document.doc\");\n\n // If the default font defined here cannot be found during rendering then the closest font on the machine is used instead.\n FontSettings.setDefaultFontName(\"Arial Unicode MS\");\n\n // Now the set default font is used in place of any missing fonts during any rendering calls.\n doc.save(dataDir + \"Rendering.SetDefaultFont_Out.pdf\");\n doc.save(dataDir + \"Rendering.SetDefaultFont_Out.xps\");\n\n System.out.println(\"Process Completed Successfully\");\n }", "public void writeFont(PdfWriter pdfWriter, PdfIndirectReference pdfIndirectReference, Object[] objArr) throws DocumentException, IOException {\n int i;\n int i2 = 0;\n int intValue = objArr[0].intValue();\n int intValue2 = objArr[1].intValue();\n byte[] bArr = objArr[2];\n if (!(objArr[3].booleanValue() && this.subset)) {\n i = bArr.length - 1;\n for (int i3 = 0; i3 < bArr.length; i3++) {\n bArr[i3] = 1;\n }\n } else {\n i2 = intValue;\n i = intValue2;\n }\n PdfIndirectReference pdfIndirectReference2 = null;\n PdfStream fullFontStream = getFullFontStream();\n if (fullFontStream != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fullFontStream).getIndirectReference();\n }\n PdfDictionary fontDescriptor = getFontDescriptor(pdfIndirectReference2);\n if (fontDescriptor != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fontDescriptor).getIndirectReference();\n }\n pdfWriter.addToBody((PdfObject) getFontBaseType(pdfIndirectReference2, i2, i, bArr), pdfIndirectReference);\n }", "public void setFont(Font font)\r\n\t{\r\n\t\t_g2.setFont(font);\r\n\t}", "public static Font create(Doc paramDoc, int paramInt, boolean paramBoolean) throws PDFNetException {\n/* 143 */ return __Create(Create(paramDoc.__GetHandle(), paramInt, paramBoolean), paramDoc);\n/* */ }", "public static Font createTrueTypeFont(Doc paramDoc, String paramString, boolean paramBoolean) throws PDFNetException {\n/* 220 */ return __Create(CreateTrueTypeFont(paramDoc.__GetHandle(), paramString, paramBoolean, true), paramDoc);\n/* */ }", "private void setFont() {\n\t\tsessionTitle.setFont(FONT_TITLE);\n\t\tdetailedDescription.setFont(FONT_DESCRIPTION);\n\t\texitButton.setFont(FONT_BUTTON);\n\t}", "public abstract Font getFont();", "public native void setDisableFormats(boolean disable) /*-{\r\n\t\tvar template = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();\r\n\t\ttemplate.disableFormats = disable;\r\n\t}-*/;" ]
[ "0.6724703", "0.6345934", "0.6323267", "0.62484944", "0.6096145", "0.56763583", "0.55962634", "0.55852085", "0.5561331", "0.55299574", "0.54653037", "0.5449378", "0.53983927", "0.53787124", "0.5370304", "0.5345845", "0.5333133", "0.5301735", "0.5268918", "0.5257946", "0.52432233", "0.52340275", "0.520531", "0.518979", "0.51775783", "0.5169844", "0.5167388", "0.515817", "0.51566374", "0.5140238", "0.5120117", "0.5100633", "0.5093771", "0.50877565", "0.5076993", "0.50737625", "0.5064761", "0.50491875", "0.50184095", "0.50131756", "0.49830613", "0.49707383", "0.49637902", "0.4946725", "0.48951855", "0.48850867", "0.4872281", "0.48498076", "0.48460665", "0.48392865", "0.4826576", "0.481642", "0.48121405", "0.48019302", "0.47829962", "0.47789356", "0.4758735", "0.47564307", "0.47533625", "0.475163", "0.47452036", "0.47354624", "0.47340825", "0.47333723", "0.4729614", "0.47282764", "0.4719415", "0.4719415", "0.4719415", "0.4703644", "0.47035688", "0.4703304", "0.4696123", "0.46941093", "0.46794567", "0.46693894", "0.46623895", "0.46599358", "0.46598786", "0.465451", "0.46442252", "0.46424383", "0.46393695", "0.46380922", "0.46214467", "0.46139467", "0.46130735", "0.4606501", "0.46009874", "0.4589026", "0.4576969", "0.4569593", "0.45674556", "0.45540577", "0.45459485", "0.45440283", "0.45423415", "0.45337766", "0.45319977", "0.45310166" ]
0.7290597
0
Disable font subsetting in PDFs.
@javax.annotation.Nullable @ApiModelProperty(value = "Disable font subsetting in PDFs.") @JsonProperty(JSON_PROPERTY_NO_SUBSET_FONTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getNoSubsetFonts() { return noSubsetFonts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isFontSet() { return false; }", "protected void doStandardFonts() {\r\n\t\trenderer.txt.setUseStandardFonts(ui.viewStandardFonts.isSelected());\r\n\t}", "private void setFont() {\n\t}", "public void GetFont (){\n fontBol = false;\n fontBolS = true;\n fontBolA = true;\n fontBolW = true;\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font embedding in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_EMBED_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoEmbedFonts() {\n return noEmbedFonts;\n }", "@Override\n public boolean isConcurrentFontManagementSupported() {\n return false;\n }", "public void revertFont()\r\n\t{\r\n\t\tif (savedFont != null)\r\n\t\t{\r\n\t\t\tg.setFont(savedFont);\r\n\t\t}\r\n\t}", "public void GetFontS (){\n fontBolS = false;\n fontBol = true;\n fontBolA = true;\n fontBolW = true;\n }", "public void allowUnsupportedFont() {\n if (mBuilderPtr == 0) {\n throw new IllegalStateException(\"Unable to allow unsupported font.\");\n }\n nAllowUnsupportedFont(mBuilderPtr);\n }", "@Test\n void testAcroFormDefaultFonts() throws IOException\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try (PDDocument doc = new PDDocument())\n {\n PDPage page = new PDPage(PDRectangle.A4);\n doc.addPage(page);\n PDAcroForm acroForm2 = new PDAcroForm(doc);\n doc.getDocumentCatalog().setAcroForm(acroForm2);\n PDResources defaultResources = acroForm2.getDefaultResources();\n assertNull(defaultResources);\n defaultResources = new PDResources();\n acroForm2.setDefaultResources(defaultResources);\n assertNull(defaultResources.getFont(COSName.HELV));\n assertNull(defaultResources.getFont(COSName.ZA_DB));\n\n // getting AcroForm sets the two fonts\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n assertNotNull(defaultResources.getFont(COSName.HELV));\n assertNotNull(defaultResources.getFont(COSName.ZA_DB));\n\n // repeat with a new AcroForm (to delete AcroForm cache) and thus missing /DR\n doc.getDocumentCatalog().setAcroForm(new PDAcroForm(doc));\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n \n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n doc.save(baos);\n }\n try (PDDocument doc = Loader.loadPDF(baos.toByteArray()))\n {\n PDAcroForm acroForm2 = doc.getDocumentCatalog().getAcroForm();\n PDResources defaultResources = acroForm2.getDefaultResources();\n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n // make sure that font wasn't overwritten\n assertTrue(helv instanceof PDType1Font);\n assertTrue(zadb instanceof PDType1Font);\n PDType1Font helvType1 = (PDType1Font) helv;\n PDType1Font zadbType1 = (PDType1Font) zadb;\n assertEquals(FontName.HELVETICA.getName(), helv.getName());\n assertEquals(FontName.ZAPF_DINGBATS.getName(), zadb.getName());\n assertNull(helvType1.getType1Font());\n assertNull(zadbType1.getType1Font());\n }\n }", "public void GetFontA (){\n fontBolA = false;\n fontBolS = true;\n fontBol = true;\n fontBolW = true;\n }", "public PdfFontProgram() {\n super();\n }", "public void setFont(Font f) {\n super.setFont(f);\n columnWidth = 0;\n }", "private void setFont() {\n Typeface font = Typeface.createFromAsset(getContext().getAssets(), mFontPath);\n setTypeface(font, Typeface.NORMAL);\n }", "void setFontFamily(ReaderFontSelection f);", "FontMapperImpl() {\n/* 55 */ this.substitutes.put(\"Courier\", \n/* 56 */ Arrays.asList(new String[] { \"CourierNew\", \"CourierNewPSMT\", \"LiberationMono\", \"NimbusMonL-Regu\" }));\n/* 57 */ this.substitutes.put(\"Courier-Bold\", \n/* 58 */ Arrays.asList(new String[] { \"CourierNewPS-BoldMT\", \"CourierNew-Bold\", \"LiberationMono-Bold\", \"NimbusMonL-Bold\" }));\n/* */ \n/* 60 */ this.substitutes.put(\"Courier-Oblique\", \n/* 61 */ Arrays.asList(new String[] { \"CourierNewPS-ItalicMT\", \"CourierNew-Italic\", \"LiberationMono-Italic\", \"NimbusMonL-ReguObli\" }));\n/* */ \n/* 63 */ this.substitutes.put(\"Courier-BoldOblique\", \n/* 64 */ Arrays.asList(new String[] { \"CourierNewPS-BoldItalicMT\", \"CourierNew-BoldItalic\", \"LiberationMono-BoldItalic\", \"NimbusMonL-BoldObli\" }));\n/* */ \n/* 66 */ this.substitutes.put(\"Helvetica\", \n/* 67 */ Arrays.asList(new String[] { \"ArialMT\", \"Arial\", \"LiberationSans\", \"NimbusSanL-Regu\" }));\n/* 68 */ this.substitutes.put(\"Helvetica-Bold\", \n/* 69 */ Arrays.asList(new String[] { \"Arial-BoldMT\", \"Arial-Bold\", \"LiberationSans-Bold\", \"NimbusSanL-Bold\" }));\n/* */ \n/* 71 */ this.substitutes.put(\"Helvetica-Oblique\", \n/* 72 */ Arrays.asList(new String[] { \"Arial-ItalicMT\", \"Arial-Italic\", \"Helvetica-Italic\", \"LiberationSans-Italic\", \"NimbusSanL-ReguItal\" }));\n/* */ \n/* 74 */ this.substitutes.put(\"Helvetica-BoldOblique\", \n/* 75 */ Arrays.asList(new String[] { \"Arial-BoldItalicMT\", \"Helvetica-BoldItalic\", \"LiberationSans-BoldItalic\", \"NimbusSanL-BoldItal\" }));\n/* */ \n/* 77 */ this.substitutes.put(\"Times-Roman\", \n/* 78 */ Arrays.asList(new String[] { \"TimesNewRomanPSMT\", \"TimesNewRoman\", \"TimesNewRomanPS\", \"LiberationSerif\", \"NimbusRomNo9L-Regu\" }));\n/* */ \n/* 80 */ this.substitutes.put(\"Times-Bold\", \n/* 81 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldMT\", \"TimesNewRomanPS-Bold\", \"TimesNewRoman-Bold\", \"LiberationSerif-Bold\", \"NimbusRomNo9L-Medi\" }));\n/* */ \n/* */ \n/* 84 */ this.substitutes.put(\"Times-Italic\", \n/* 85 */ Arrays.asList(new String[] { \"TimesNewRomanPS-ItalicMT\", \"TimesNewRomanPS-Italic\", \"TimesNewRoman-Italic\", \"LiberationSerif-Italic\", \"NimbusRomNo9L-ReguItal\" }));\n/* */ \n/* */ \n/* 88 */ this.substitutes.put(\"Times-BoldItalic\", \n/* 89 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldItalicMT\", \"TimesNewRomanPS-BoldItalic\", \"TimesNewRoman-BoldItalic\", \"LiberationSerif-BoldItalic\", \"NimbusRomNo9L-MediItal\" }));\n/* */ \n/* */ \n/* 92 */ this.substitutes.put(\"Symbol\", Arrays.asList(new String[] { \"Symbol\", \"SymbolMT\", \"StandardSymL\" }));\n/* 93 */ this.substitutes.put(\"ZapfDingbats\", Arrays.asList(new String[] { \"ZapfDingbatsITC\", \"Dingbats\", \"MS-Gothic\" }));\n/* */ \n/* */ \n/* */ \n/* 97 */ for (String baseName : Standard14Fonts.getNames()) {\n/* */ \n/* 99 */ if (!this.substitutes.containsKey(baseName)) {\n/* */ \n/* 101 */ String mappedName = Standard14Fonts.getMappedFontName(baseName);\n/* 102 */ this.substitutes.put(baseName, copySubstitutes(mappedName));\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ try {\n/* 110 */ String ttfName = \"/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf\";\n/* 111 */ InputStream ttfStream = FontMapper.class.getResourceAsStream(ttfName);\n/* 112 */ if (ttfStream == null)\n/* */ {\n/* 114 */ throw new IOException(\"Error loading resource: \" + ttfName);\n/* */ }\n/* 116 */ TTFParser ttfParser = new TTFParser();\n/* 117 */ this.lastResortFont = ttfParser.parse(ttfStream);\n/* */ }\n/* 119 */ catch (IOException e) {\n/* */ \n/* 121 */ throw new RuntimeException(e);\n/* */ } \n/* */ }", "@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Arial\", Font.PLAIN, 11)); \r\n }", "@Action(selectedProperty = \"bigFontSet\", enabledProperty = \"windowsOS\")\n public void toggleFontSet() {\n }", "private void updateFontSet() {\n if (!isBigFontSet()) {\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), null);\n } else {\n// <snip> Install sscaled font\n FontPolicy windowsPolicy = FontPolicies.getDefaultWindowsPolicy();\n FontSet fontSet = windowsPolicy.getFontSet(null, UIManager\n .getLookAndFeelDefaults());\n WrapperFontSet scaled = new WrapperFontSet(fontSet, 5);\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), scaled);\n// </snip>\n }\n updateLookAndFeel();\n }", "public void clearSelectedFontName()\r\n\t{\r\n\t\t// deselect the currently selected item in the Font Names list if there is one\r\n\t\tfontNamesList.clearSelection();\r\n\t}", "public void GetFontW (){\n fontBolW = false;\n fontBolS = true;\n fontBolA = true;\n fontBol = true;\n }", "private void setFont() {\n try {\n setFont(Font.loadFont(new FileInputStream(FONT_PATH), 23));\n } catch (FileNotFoundException e) {\n setFont(Font.font(\"Verdana\", 23));\n }\n }", "boolean isAlwaysvectorfont();", "protected void applyFont() {\n\t\tif (fields != null) {\n\t\t\tIterator<FieldEditor> e = fields.iterator();\n\t\t\twhile (e.hasNext()) {\n\t\t\t\tFieldEditor pe = e.next();\n\t\t\t\t// pe.applyFont();\n\t\t\t}\n\t\t}\n\t}", "protected final void setSubscript() {\n setFontSize((int) (getFontSize() * 0.5d));\n// yOffset += getFontSize();\n }", "public void clearSelectedFontSize()\r\n\t{\r\n\t\t// deselect the currently selected item in the Font Size list if there is one\r\n\t\tfontSizeList.clearSelection();\r\n\t}", "@Override\r\n\tpublic int getFontSize() {\n\t\treturn 0;\r\n\t}", "public void setFontLevel(int level) {\n super.setFontLevel(level);\n Object[] objectsToSize = new Object[]\n {unmarkedLabel, fixedCoordinatesItem};\n FontSizer.setFonts(objectsToSize, level);\n }", "public void initFont() {\r\n\t\tFont dosFont = null;\r\n try {\r\n \t//setup font\r\n\t\t\t\tURL fontUrl = getURL(\"fonts/DOSFont.ttf\");\r\n\t\t \tdosFont = Font.createFont(Font.TRUETYPE_FONT, fontUrl.openStream());\r\n\t \tdosFont = dosFont.deriveFont(Font.PLAIN, 15);\r\n\t \tGraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n\t \tge.registerFont(dosFont);\r\n\t } catch(Exception e) {\r\n\t e.printStackTrace();\r\n\t System.exit(-1);\r\n\t }\r\n screen.setFont(dosFont);//set font on JTextArea\r\n\t}", "public void setFont(Font value) {\r\n this.font = value;\r\n }", "public void setTrueFont(Font font)\n\t{\n\t\tString bodyRule = \"body { font-family: \" + font.getFamily() + \"; \" +\n\t\t\t\t\"font-size: \" + font.getSize() + \"pt; }\";\n\t\t((HTMLDocument)getDocument()).getStyleSheet().addRule(bodyRule);\n\t\t//Sets the font for when the JEditorPane is switched to plain text.\n\t\tsetFont(font);\n\t}", "public FontConfig() {\n\t\tthis.name = \"Monospaced\";\n\t\tthis.style = FontStyle.PLAIN;\n\t\tthis.size = DEFAULT_SIZE;\n\t}", "public void setFont(Font font)\n {\n this.font = font;\n }", "public native void setFont(Font value) /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\tjso.font = value.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n }-*/;", "public void setFont(Font f) {\n font = f;\n compute();\n }", "public void unsetItalic()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(ITALIC$6, 0);\n }\n }", "public void setFont(int fontId){\n this.fontId = fontId;\n }", "@Test\n public void Test_Output_Font() throws Exception {\n String actual_value = \"\";\n String expected_value = \"1 0 obj \\n<< \\n/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] \\n\";\n expected_value += \"/Font \\n<< \\n/F2 \\n<< \\n/Type /Font \\n/BaseFont /Helvetica \\n/SubType /Type1 \\n\";\n expected_value += \">> \\n>> \\n>> \\n\";\n\n PdfResource resrc = new PdfResource();\n resrc.addFont(new PdfFont(PdfFont.HELVETICA, false, false));\n actual_value = new String(resrc.dumpInfo());\n \n assertThat(actual_value, equalTo(expected_value));\n }", "public Obj getEmbeddedFont() throws PDFNetException {\n/* 809 */ return Obj.__Create(GetEmbeddedFont(this.a), this.b);\n/* */ }", "public Font createFont() {\n\t\treturn null;\n\t}", "private void loadSystemFont(String font){\n mFont = new Font(font, mFontStyle, (int)mFontSize);\n }", "public void setResultsFont()\r\n {\r\n Font UserTextFont = MetalLookAndFeel.getUserTextFont();\r\n if (ResultsTextPane != null)\r\n\t ResultsTextPane.setFont(new Font(\"Monospaced\", Font.PLAIN, UserTextFont.getSize() ));\r\n }", "private boolean browserCantRenderFontsConsistently() {\n\r\n return getPage().getWebBrowser().getBrowserApplication()\r\n .contains(\"PhantomJS\")\r\n || (getPage().getWebBrowser().isIE() && getPage()\r\n .getWebBrowser().getBrowserMajorVersion() <= 9);\r\n }", "public void setFont(Font font) {\n\tthis.font = font;\n }", "public void setFont(RMFont aFont) { }", "public void setFont(Font newFont) {\n\tfont = newFont;\n }", "public void init() {\n\n /**\n * FontFile1 = A stream containing a Type 1 font program\n * FontFile2 = A stream containing a TrueType font program\n * FontFile3 = A stream containing a font program other than Type 1 or\n * TrueType. The format of the font program is specified by the Subtype entry\n * in the stream dictionary\n */\n try {\n\n // get an instance of our font factory\n FontFactory fontFactory = FontFactory.getInstance();\n\n if (entries.containsKey(FONT_FILE)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n }\n\n if (entries.containsKey(FONT_FILE_2)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_2);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TRUE_TYPE);\n }\n }\n\n if (entries.containsKey(FONT_FILE_3)) {\n\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_3);\n String subType = fontStream.getObject(\"Subtype\").toString();\n if (subType != null &&\n (subType.equals(FONT_FILE_3_TYPE_1C) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0C))\n ) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n if (subType != null && subType.equals(FONT_FILE_3_OPEN_TYPE)) {\n// font = new NFontOpenType(fontStreamBytes);\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_OPEN_TYPE);\n }\n }\n }\n // catch everything, we can fall back to font substitution if a failure\n // occurs. \n catch (Throwable e) {\n logger.log(Level.FINE, \"Error Reading Embedded Font \", e);\n }\n\n }", "public void writeFont(PdfWriter pdfWriter, PdfIndirectReference pdfIndirectReference, Object[] objArr) throws DocumentException, IOException {\n int i;\n int i2 = 0;\n int intValue = objArr[0].intValue();\n int intValue2 = objArr[1].intValue();\n byte[] bArr = objArr[2];\n if (!(objArr[3].booleanValue() && this.subset)) {\n i = bArr.length - 1;\n for (int i3 = 0; i3 < bArr.length; i3++) {\n bArr[i3] = 1;\n }\n } else {\n i2 = intValue;\n i = intValue2;\n }\n PdfIndirectReference pdfIndirectReference2 = null;\n PdfStream fullFontStream = getFullFontStream();\n if (fullFontStream != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fullFontStream).getIndirectReference();\n }\n PdfDictionary fontDescriptor = getFontDescriptor(pdfIndirectReference2);\n if (fontDescriptor != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fontDescriptor).getIndirectReference();\n }\n pdfWriter.addToBody((PdfObject) getFontBaseType(pdfIndirectReference2, i2, i, bArr), pdfIndirectReference);\n }", "private void loadFont() {\n\t\ttry {\n\t\t\tfont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(\"assets/fonts/forced_square.ttf\"));\n\t\t} catch (Exception e) {\n\t\t\tfont = new Font(\"Helvetica\", Font.PLAIN, 22);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getFontName();", "public String getFontName();", "public String getFontName();", "public void setFont(Font newFont) {\r\n\t\tfont = newFont;\r\n\t}", "public static void setDefaultFont(Font f) {\r\n defaultFont = f;\r\n }", "public abstract Font getFont();", "private String getFallbackFontName(PDFontDescriptor fontDescriptor) {\n/* */ String fontName;\n/* 235 */ if (fontDescriptor != null) {\n/* */ \n/* */ \n/* 238 */ boolean isBold = false;\n/* 239 */ String name = fontDescriptor.getFontName();\n/* 240 */ if (name != null) {\n/* */ \n/* 242 */ String lower = fontDescriptor.getFontName().toLowerCase();\n/* */ \n/* */ \n/* 245 */ isBold = (lower.contains(\"bold\") || lower.contains(\"black\") || lower.contains(\"heavy\"));\n/* */ } \n/* */ \n/* */ \n/* 249 */ if (fontDescriptor.isFixedPitch()) {\n/* */ \n/* 251 */ fontName = \"Courier\";\n/* 252 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 254 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 256 */ else if (isBold)\n/* */ {\n/* 258 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 260 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 262 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* 265 */ } else if (fontDescriptor.isSerif()) {\n/* */ \n/* 267 */ fontName = \"Times\";\n/* 268 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 270 */ fontName = fontName + \"-BoldItalic\";\n/* */ }\n/* 272 */ else if (isBold)\n/* */ {\n/* 274 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 276 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 278 */ fontName = fontName + \"-Italic\";\n/* */ }\n/* */ else\n/* */ {\n/* 282 */ fontName = fontName + \"-Roman\";\n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 287 */ fontName = \"Helvetica\";\n/* 288 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 290 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 292 */ else if (isBold)\n/* */ {\n/* 294 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 296 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 298 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 305 */ fontName = \"Times-Roman\";\n/* */ } \n/* 307 */ return fontName;\n/* */ }", "@Override\n public void setFont(String font) {\n graphicsEnvironmentImpl.setFont(canvas, font);\n }", "public String getEmbeddedFontName() throws PDFNetException {\n/* 795 */ return GetEmbeddedFontName(this.a);\n/* */ }", "public void setFont( Font font ) {\r\n this.font = font;\r\n }", "@Override\r\n\tpublic void dispose() {\n\t\tfont.dispose();\r\n\t}", "@Override\n public void clearText() {\n textMap.clear();\n render();\n }", "public int getStandardType1FontType() throws PDFNetException {\n/* 909 */ return GetStandardType1FontType(this.a);\n/* */ }", "private void unfocusedAll() {\n this.nameTextField.setFocusTraversable(false);\n this.surnameTextField.setFocusTraversable(false);\n this.addressTextField.setFocusTraversable(false);\n this.postalCodeTextField.setFocusTraversable(false);\n }", "public void unsetBoldItalic()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BOLDITALIC$8, 0);\n }\n }", "public void setFontName(String name) {\n\t\tthis.fontName = name;\n\t}", "public void preProcessPDF(Object document) {\n Document pdf = (Document) document;\n pdf.setPageSize(PageSize.LETTER.rotate());\n pdf.open();\n }", "public void setFontName(String name)\n {\n font.setFontName(name);\n }", "private void setupFonts()\r\n\t{\r\n\t\tSystem.out.println(\"In setupFonts()\");\r\n\t\t\r\n\t\t// set up the text fonts\r\n\t\ttry\r\n\t\t{\r\n\t\t\ttextFont = Font.createFont(Font.TRUETYPE_FONT, AppletResourceLoader.getFileFromJar(GameConstants.PATH_FONTS + \"FOXLEY8_.ttf\"));\r\n\t\t\ttextFont = textFont.deriveFont(16.0f);\r\n\t\t\ttextFontBold = textFont.deriveFont(Font.BOLD, 16.0f);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ERROR IN setupFonts(): \" + e.getClass().getName() + \" - \" + e.getMessage());\r\n\t\t}\r\n\t}", "private FontBoxFont findFont(FontFormat format, String postScriptName) {\n/* 403 */ if (postScriptName == null)\n/* */ {\n/* 405 */ return null;\n/* */ }\n/* */ \n/* */ \n/* 409 */ if (this.fontProvider == null)\n/* */ {\n/* 411 */ getProvider();\n/* */ }\n/* */ \n/* */ \n/* 415 */ FontInfo info = getFont(format, postScriptName);\n/* 416 */ if (info != null)\n/* */ {\n/* 418 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 422 */ info = getFont(format, postScriptName.replaceAll(\"-\", \"\"));\n/* 423 */ if (info != null)\n/* */ {\n/* 425 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 429 */ for (String substituteName : getSubstitutes(postScriptName)) {\n/* */ \n/* 431 */ info = getFont(format, substituteName);\n/* 432 */ if (info != null)\n/* */ {\n/* 434 */ return info.getFont();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 439 */ info = getFont(format, postScriptName.replaceAll(\",\", \"-\"));\n/* 440 */ if (info != null)\n/* */ {\n/* 442 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 446 */ info = getFont(format, postScriptName + \"-Regular\");\n/* 447 */ if (info != null)\n/* */ {\n/* 449 */ return info.getFont();\n/* */ }\n/* */ \n/* 452 */ return null;\n/* */ }", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "@Override\n public Color getFontColor(){\n return Color.BLACK;\n }", "public static void setFont(Font font){\n\t\tGComponent.fGlobalFont = font;\n\t}", "private java.awt.Font getFont(Feature feature, Font[] fonts) {\n if (fontFamilies == null) {\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n fontFamilies = new HashSet();\n \n List f = Arrays.asList(ge.getAvailableFontFamilyNames());\n fontFamilies.addAll(f);\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"there are \" + fontFamilies.size() + \" fonts available\");\n }\n }\n \n java.awt.Font javaFont = null;\n \n int styleCode = 0;\n int size = 6;\n String requestedFont = \"\";\n \n for (int k = 0; k < fonts.length; k++) {\n requestedFont = fonts[k].getFontFamily().getValue(feature).toString();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"trying to load \" + requestedFont);\n }\n \n if (loadedFonts.containsKey(requestedFont)) {\n javaFont = (java.awt.Font) loadedFonts.get(requestedFont);\n \n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n return javaFont.deriveFont(styleCode, size);\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not already loaded\");\n }\n \n if (fontFamilies.contains(requestedFont)) {\n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"requesting \" + requestedFont + \" \" + styleCode + \" \" + size);\n }\n \n javaFont = new java.awt.Font(requestedFont, styleCode, size);\n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a system font\");\n }\n \n // may be its a file or url\n InputStream is = null;\n \n if (requestedFont.startsWith(\"http\") || requestedFont.startsWith(\"file:\")) {\n try {\n URL url = new URL(requestedFont);\n is = url.openStream();\n } catch (MalformedURLException mue) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad url in java2drenderer\" + requestedFont + \"\\n\" + mue);\n }\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n }\n } else {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a URL\");\n }\n \n File file = new File(requestedFont);\n \n //if(file.canRead()){\n try {\n is = new FileInputStream(file);\n } catch (FileNotFoundException fne) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad file name in java2drenderer\" + requestedFont + \"\\n\" + fne);\n }\n }\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"about to load\");\n }\n \n if (is == null) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"null input stream\");\n }\n \n continue;\n }\n \n try {\n javaFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, is);\n } catch (FontFormatException ffe) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Font format error in java2drender \" + requestedFont + \"\\n\" + ffe);\n }\n \n continue;\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n \n continue;\n }\n \n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n return null;\n }", "public void setMatchFontName(String matchFontName);", "public static void setUseNativeFonts ( final boolean useNativeFonts )\n {\n NativeFonts.useNativeFonts = useNativeFonts;\n }", "public void set_fonts(Graphics2D g2, float scale) {\n if ( XHSIPreferences.get_instance().get_bold_fonts() ) {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.BOLD, 10);\n this.font_small = new Font( \"Verdana\", Font.BOLD, 12);\n this.font_medium = new Font( \"Verdana\", Font.BOLD, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.BOLD, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.BOLD, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.BOLD, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.BOLD, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.BOLD, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.BOLD, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n } else {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.PLAIN, 10);\n this.font_small = new Font( \"Verdana\", Font.PLAIN, 12);\n this.font_medium = new Font( \"Verdana\", Font.PLAIN, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.PLAIN, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.PLAIN, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.PLAIN, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.PLAIN, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.PLAIN, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.PLAIN, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n }\n\n // calculate font metrics\n // W is probably the largest characher...\n FontMetrics fm;\n\n fm = g2.getFontMetrics(this.font_large);\n this.line_height_large = fm.getAscent();\n this.max_char_advance_large = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_large = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_medium);\n this.line_height_medium = fm.getAscent();\n this.max_char_advance_medium = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_medium = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_small);\n this.line_height_small = fm.getAscent();\n this.max_char_advance_small = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_small = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_tiny);\n this.line_height_tiny = fm.getAscent();\n this.max_char_advance_tiny = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_tiny = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_zl);\n this.line_height_zl = fm.getAscent();\n this.max_char_advance_zl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_zl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_yl);\n this.line_height_yl = fm.getAscent();\n this.max_char_advance_yl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_yl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxl);\n this.line_height_xxl = fm.getAscent();\n this.max_char_advance_xxl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xl);\n this.line_height_xl = fm.getAscent();\n this.max_char_advance_xl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_l);\n this.line_height_l = fm.getAscent();\n this.max_char_advance_l = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_l = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_m);\n this.line_height_m = fm.getAscent();\n this.max_char_advance_m = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_m = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_s);\n this.line_height_s = fm.getAscent();\n this.max_char_advance_s = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_s = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xs);\n this.line_height_xs = fm.getAscent();\n this.max_char_advance_xs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxs);\n this.line_height_xxs = fm.getAscent();\n this.max_char_advance_xxs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_normal);\n this.line_height_normal = fm.getAscent();\n this.max_char_advance_normal = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_normal = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n }", "public void assertCustomFonts()\n {\n Style root = getStyle(\"base\");\n assertFonts(root);\n }", "@Override\n public String getFont() {\n return graphicsEnvironmentImpl.getFont(canvas);\n }", "abstract Font getFont();", "public boolean isBigFontSet() {\n return hasBig;\n }", "public void removeAllEncodingSettings() {\r\n\t\tBase.removeAll(this.model, this.getResource(), ENCODINGSETTINGS);\r\n\t}", "public void setFont(Font font)\r\n\t{\r\n\t\t_g2.setFont(font);\r\n\t}", "private void settypeface() {\n }", "public void selectProductFormatPdf(String pdfProductFormat)\n \t{\n \t Select country=new Select(productRequirementsPageLocators.selectProductFormat);\n country.selectByVisibleText(pdfProductFormat);\n \t\t\n \t}", "public void setFontProgram(PdfFile fontProgram) {\n this.add(fontProgram);\n }", "@Override\n\tpublic void dispose() {\n\t\tisActive = false;\n\t\tfont.dispose();\n\t}", "private void disablePainting(boolean redraw) {\n \t\tif (fIsPainting) {\n \t\t\tfIsPainting= false;\n \t\t\tfTextWidget.removePaintListener(this);\n \t\t\tif (redraw && hasDecorations())\n \t\t\t\thandleDrawRequest(null);\n \t\t}\n \t}", "public CanvasFont getFont() {\n return this.textFont;\n }", "public void setTextFont(Font font);", "public void disableNormalizationPlugin();", "@Override\n public void disableDraw() {\n drawingTools.disableDraw();\n }", "public void setSuppressAlpha(boolean suppressAlpha) {\n/* 106 */ this.suppressAlpha = suppressAlpha;\n/* */ }", "void setFontScale(\n float s);", "@Override\n\tpublic void dispose() {\n\t\n\t\tFont.dispose();\n\t\n\t}", "public void setFont(String font) {\r\n\t\tProps p = getPage().getPageProperties();\r\n\t\t_fontTagStart = p.getProperty(font + Props.TAG_START);\r\n\t\t_fontTagEnd = p.getProperty(font + Props.TAG_END);\r\n\t}", "@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\r\n }", "public void revertColorAndFont()\r\n\t{\r\n\t\trevertColor();\r\n\t\trevertFont();\r\n\t}", "public PatchTextStyleProperties font(String font) {\n this.font = font;\n return this;\n }", "Font createFont();", "public void setBigFontSet(boolean bigFontSet) {\n boolean old = isBigFontSet();\n if (old == bigFontSet) return;\n this.hasBig = bigFontSet;\n updateFontSet();\n firePropertyChange(\"bigFontSet\", old, isBigFontSet());\n }" ]
[ "0.67881423", "0.65536183", "0.59809834", "0.5971903", "0.5957841", "0.5851455", "0.57692766", "0.5740887", "0.5709407", "0.5656677", "0.5655581", "0.56446785", "0.5573646", "0.54842365", "0.5408361", "0.5383611", "0.5378869", "0.5377998", "0.5369025", "0.53488994", "0.53342974", "0.5327968", "0.51891905", "0.5170899", "0.51550895", "0.51547736", "0.5136937", "0.51363397", "0.513385", "0.51251304", "0.51145065", "0.51133424", "0.5101973", "0.50877166", "0.50865376", "0.50798935", "0.5053637", "0.50514024", "0.50399387", "0.50345474", "0.5013873", "0.5006188", "0.5006077", "0.49857193", "0.49814025", "0.49664292", "0.49562937", "0.49423417", "0.4928497", "0.49276343", "0.49276343", "0.49276343", "0.49239624", "0.49216688", "0.4914599", "0.49143523", "0.49092138", "0.49040782", "0.4899795", "0.48992735", "0.48723942", "0.48655102", "0.4856199", "0.48490626", "0.4838111", "0.48202327", "0.48191777", "0.4813233", "0.48122376", "0.481161", "0.48101556", "0.4806108", "0.48016697", "0.47860703", "0.4784419", "0.4780315", "0.47771183", "0.4773727", "0.4768043", "0.47671407", "0.47593486", "0.47450173", "0.47365907", "0.4723676", "0.47226983", "0.47208446", "0.47120148", "0.4705677", "0.4705527", "0.47020122", "0.46992838", "0.46973714", "0.46816993", "0.46810392", "0.4678714", "0.46706852", "0.46615928", "0.4649407", "0.46448147", "0.4638671" ]
0.7323632
0
Set encryption key size.
@javax.annotation.Nullable @ApiModelProperty(value = "Set encryption key size.") @JsonProperty(JSON_PROPERTY_KEY_BITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getKeyBits() { return keyBits; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setKeySize(int keySize) {\n this.keySize = keySize;\n }", "void setKeySize(int size);", "public SigningMethodBuilder maxKeySize(Integer keySize) {\n this.object().setMaxKeySize(keySize);\n return this;\n }", "public SigningMethodBuilder minKeySize(Integer keySize) {\n this.object().setMinKeySize(keySize);\n return this;\n }", "public void setKeyLength(int keyLength) {\n\t\tthis.keyLength = keyLength;\n\t}", "@BeforeClass\n public void setKeyLength() {\n Aes.keyLength = 16;\n }", "@Override\n public int keySize() {\n return ciper.keySize() + 8;\n }", "private void set_size(int size)\r\n\t{\r\n\t\tthis.size = size;\r\n\t}", "@AfterClass(alwaysRun = true)\n public void restoreKeyLength() {\n Aes.keyLength = Aes.DEFAULT_KEY_LENGTH;\n }", "public void setLength(int length)\n {\n encryptionDictionary.setInt(\"Length\", length);\n }", "@Override\n public void setAEBufferSize(int size) {\n if (size < 1000 || size > 1000000) {\n log.warning(\"ignoring unreasonable aeBufferSize of \" + size + \", choose a more reasonable size between 1000 and 1000000\");\n return;\n }\n this.aeBufferSize = size;\n prefs.putInt(\"CypressFX2.aeBufferSize\", aeBufferSize);\n }", "public void setSize(long size) {\r\n\t\tthis.size = size;\r\n\t}", "public void set_size(int s);", "public void setSize(TSizeInBytes size) {\n\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\r\n _size = size;\r\n }", "public void setSize(int _size)\r\n {\r\n size = _size;\r\n }", "public void setSize(int size){\n this.size = size;\n }", "public void setSize(int size) {\r\n this.size = size;\r\n }", "public void setSize(int size) {\n this.size = size;\n }", "public void setSize(int size) {\n this.size = size;\n }", "public void setSize(Integer size) {\n this.size = size;\n }", "public void setSize(int size) {\n\t\t _size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(String size) {\n this.size = size;\n }", "public void setSize(String size) {\r\n //System.out.print(\"Setting Size...\");\r\n this.Size = size;\r\n }", "public void setSize(long value) {\n this.size = value;\n }", "public void setBlockSize(long value) {\n this.blockSize = value;\n }", "public void setSize(int size) {\n this.size = size;\n }", "public void setLocalSize(int size);", "public Integer keySize() {\n return this.keySize;\n }", "public void setSize(int value) {\n\t\tthis.size = value;\n\t}", "public void setSizeInBits(final int size) {\n\t\tthis.sizeinbits = size;\n\t}", "private void setSize(int s){\n\t\tsize = s;\n\t}", "public void setEngineSize(int _engineSize)\r\n {\r\n engineSize = _engineSize;\r\n }", "public void setSize(int size) {\n\tthis.sizeNumber = sizeNumber;\r\n}", "@Element \n public void setSize(String size) {\n this.size = size;\n }", "public void setSize(String size) {\n\t\tthrow new UnsupportedOperationException(\"readonly\");\n\t}", "public abstract void setMaxExponentSize(byte maxExponentSize);", "public static void setDiskCacheSize(long size) {\n sDiskCacheSize = size;\n }", "public void setSizeE(long s){\n\t\tthis.sizeE = s;\n\t}", "public void setSize(double size) \n {\n this.size = size;\n }", "public void setKey(String s){\n this.key = s;\n this.blockLen = s.length();\n }", "public void setKeyAmount(int value) {\n this.keyAmount = value;\n }", "public void setSIZE(java.lang.String SIZE) {\n this.SIZE = SIZE;\n }", "public void setEncryptionKey(String encryptionKey) throws Exception\n {\n try\n {\n SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(\"PBEWithMD5AndDES\");\n key = keyFactory.generateSecret(new PBEKeySpec(encryptionKey.toCharArray()));\n }\n catch (Exception e)\n {\n throw new Exception(\"Problem unlocking the codec : \" + e.getMessage());\n }\n }", "public void setSize(int size) {\n\t members = size;\n\t}", "public void setGroupingSize(int newValue) {\n groupingSize = (byte) newValue;\n }", "void setPaperSize(short size);", "public void setSize(int size);", "private void growSize() {\n size++;\n\n if (size > maxSize) {\n if (keys.length == Integer.MAX_VALUE) {\n throw new IllegalStateException(\"Max capacity reached at size=\" + size);\n }\n\n // Double the capacity.\n rehash(keys.length << 1);\n }\n }", "protected void setMaxSize(int size) {\n maxSize = size;\n }", "public void setVolumeSize(Integer volumeSize) {\n this.volumeSize = volumeSize;\n }", "void setKeyNumber(int number)\r\n {\r\n number_of_key = number;\r\n }", "public void setHashLength(int keyLength) {\n\t\tthis.hashLength = keyLength;\n\t}", "public void setGameSize(int size) throws ConfigurationException {\n\t\tif (size < MINIMAL_SIZE || size > MAXIMAL_SIZE) {\n\t\t\tthrow ConfigurationException.wrongSizeBounds(MINIMAL_SIZE, MAXIMAL_SIZE, size);\n\t\t}\n\t\tgameSize = size;\n\t}", "public void setIndentSize(short indentSize);", "public void setSize(@Nullable String size) {\n this.size = size;\n }", "public void setPackageSize(int size){\r\n }", "public void setKey(int key);", "public void setKey(int key);", "protected void setArraySize(int arraySize){\r\n\t \tthis.arraySize = arraySize;\r\n\t }", "public void setSizeId(Integer sizeId) {\n this.sizeId = sizeId;\n }", "public void setSizeV(long s){\n\t\tthis.sizeV = s;\n\t}", "@Override\r\n\tpublic void setSequenceSize(int x) {\n\t\tsizeNum = x;\r\n\t\tupdate();\r\n\t}", "public abstract void adjustSize(long size);", "int getKeySize();", "public void setKmsSecretKey(String key) {this.databaseConfig.setProperty(\"kmsSecretKey\", key);}", "@Override\n\tpublic void setBufferSize(int size) {\n\t}", "public TarArchiveEntry setEntrySize(long size) {\n if (size < 0) {\n throw new IllegalArgumentException(\"size is out of range: \" + size);\n }\n this.size = size;\n return this;\n }", "public void setObjectSize(short size) { this.objectSize=size; }", "public void setSizeId(String value) {\n setAttributeInternal(SIZEID, value);\n }", "public void setElementSize(int elementsize) {\n\t\tthis.elementsize = elementsize;\n\t}", "public void setPartitionSize(int partitionSize) throws IllegalArgumentException {\n\t\tif(partitionSize < 1 || partitionSize > numOfAttributes)\n\t\t\tthrow new IllegalArgumentException(\"The partition size must be between 1 and number of attributes\");\n\t\tthis.partitionSize = partitionSize;\n\t}", "@Override\r\n\tpublic void setSequenceSize(int size) {\n\t\tthis.sequence = \"Sequence length: \"+size;\r\n\t\tupdate();\r\n\t}", "public void setSizeQty(Number value) {\n setAttributeInternal(SIZEQTY, value);\n }", "public TransactionBuilder setCacheSize(long size);", "public static void setRecorderVideoSize(Size size){\n\t}", "public void setSize(String size) {\r\n this.size = size == null ? null : size.trim();\r\n }", "public com.autodesk.ws.avro.Call.Builder setObjectSize(java.lang.Long value) {\n validate(fields()[6], value);\n this.object_size = value;\n fieldSetFlags()[6] = true;\n return this; \n }", "public static synchronized void setKeyClickLength(int len) {\r\n\t\tButton.keys.setKeyClickLength(len);\r\n\t}", "public ReissueCertificateOrderRequestInner withKeySize(Integer keySize) {\n this.keySize = keySize;\n return this;\n }", "public void setiPhoneStorageSize(int iPhoneStorageSize) {\r\n this.iPhoneStorageSize = iPhoneStorageSize;\r\n }", "public void setSize(int newSize);", "public void setSize(int newSize);", "void setMaxCharSize(int value);", "public void setKey(int nKey){\n\t\tkey = clamp(nKey, MINKEY, MAXKEY);\n\t}", "public void set_fieldsize(AST fieldsize);", "public void setSize(double s)\n\t{\n\t\tsize = s;\n\t}", "public Builder setServerPayloadSizeBytes(int value) {\n \n serverPayloadSizeBytes_ = value;\n onChanged();\n return this;\n }", "public void setKeyBytes(byte[] key){\n\t\t\n\t\tsetKey(new String(key));\n\t}", "void setLength( long length );", "public IconBuilder fontSize(int size) {\n\t\tthis.fixedFontSize = size;\n\t\treturn this;\n\t}", "public void setSize(int size){\n\t\tthis.shipSize = size;\n\t}", "public void setSize(Vector2ic size){\n glfwSetWindowSize(handle, size.x(), size.y());\n this.size.set(size);\n sizeMultiplexer.handle(new WindowSizeEvent(handle, size.x(), size.y()));\n }", "@Override\n public void setKey(byte[] key) {\n }", "public void setEncryptionKey(LVValue encryptKey) throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tmyData.encryptKey=encryptKey;\n\t}", "@Override\n\tpublic void setSize(String sizeOfTheBeverage) {\n\t\tthis.sizeOfTheBeverage = sizeOfTheBeverage;\n\t}" ]
[ "0.81408596", "0.76820546", "0.6810291", "0.6580051", "0.65250635", "0.65093005", "0.62769014", "0.62310404", "0.6218622", "0.62019336", "0.619862", "0.61214477", "0.610594", "0.60507256", "0.6038771", "0.5993283", "0.59809977", "0.5978003", "0.595137", "0.595137", "0.594724", "0.59363335", "0.58999395", "0.58999395", "0.58999395", "0.58999395", "0.58928674", "0.5889379", "0.58511466", "0.58474", "0.58324754", "0.58163905", "0.57717365", "0.572815", "0.57135856", "0.56957036", "0.56703943", "0.5641716", "0.5639364", "0.5596426", "0.5592021", "0.55900186", "0.5548352", "0.5519648", "0.5518915", "0.5505386", "0.55038875", "0.5478691", "0.5461805", "0.54416555", "0.5439501", "0.54310054", "0.54274243", "0.5413335", "0.53994185", "0.53889877", "0.53848094", "0.53796643", "0.53787106", "0.5377186", "0.5374813", "0.53740996", "0.53740996", "0.53710467", "0.53656745", "0.5360435", "0.53521276", "0.5345254", "0.5341889", "0.5340302", "0.5327141", "0.5321977", "0.53195333", "0.5300347", "0.5288898", "0.5277723", "0.527541", "0.5271222", "0.5270552", "0.52665544", "0.52603626", "0.5239215", "0.5236227", "0.52335286", "0.52256775", "0.522469", "0.522469", "0.5222304", "0.52191794", "0.51974726", "0.51971763", "0.5193478", "0.51927644", "0.5180604", "0.517927", "0.5179045", "0.5175803", "0.5174494", "0.5171322", "0.5169122" ]
0.6105878
13
Set the PDF user password.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the PDF user password.") @JsonProperty(JSON_PROPERTY_USER_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getUserPassword() { return userPassword; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPassword(String pw)\n {\n this.password = pw;\n }", "public void setPassword(String pass);", "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "public void setPassword(java.lang.String newPassword);", "public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }", "void setPassword(String ps) {\n this.password = ps;\n }", "public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "public void set_pass(String password)\n {\n pass=password;\n }", "public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }", "public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(String p) {\n\t\tpassword = p;\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\n\t}", "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)\n \t{\n \t\tthis.password = password;\n \t}", "public void setPassword(String password) {\n this.password = password;\r\n }", "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)\n {\n this.password = password;\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 password )\r\n {\r\n this.password = password;\r\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 }", "public void setPassword(String password) {\n this.password = password;\n saveProperties();\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 set_password(String password)\r\n\t{\r\n\t\tthis.password = password;\r\n\t}", "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 setErrorPassword();", "public void setUserPassword(String newPassword) {\n profile.setPassword(currentUser, newPassword);\n }", "public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }", "@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}", "public void setPasswordField(final JPasswordField pwPasswordParam) {\n this.pwPassword = pwPasswordParam;\n }", "public void setPassword (java.lang.String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPasspwd(String passpwd) {\n this.passpwd = passpwd;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setDevicePassword(String argPassword) {\n\tdevicePassword = argPassword;\n }", "public void setPassword(String user, String password) throws Exception {\n\t\tProperties database = getDataBase();\n\t\tdatabase.setProperty(user, PasswordHash.createHash(password));\n\t\tsave(database);\n\t}", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPass(String pass)\r\n\t{\r\n\t\tpassword = pass;\r\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "public void setPasswordPlainText(String password) {\n this.password = password;\n }", "public void setPassword(final String password){\n mPassword = password;\n }", "public void setPassword(String password) {\n this.password.set(password);\n }", "public void setUserPass(final UTF8String userPass) {\n this.userPass = userPass;\n }", "public void setPassword( final String password )\n\t{\n\t\tthis.password = password;\n\t}", "public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }", "public void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(String password) {\n setObject(\"password\", (password != null) ? password : \"\");\n }", "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(int password) {\n this.password = password;\n }", "public void setPassword(String new_password) throws DataFault {\n\t\t\t\t setPassword(Hash.getDefault(getContext()), new_password);\n\t\t\t }", "public void setPw(char[] password) {\n\t\t\r\n\t}", "public void setPassword(String text) {\n txtPassword().setText(text);\n }" ]
[ "0.7207541", "0.7177974", "0.7175418", "0.7175418", "0.7175418", "0.71048653", "0.7017702", "0.70082325", "0.7007234", "0.69075924", "0.68910086", "0.6853506", "0.6833509", "0.6764262", "0.6747854", "0.67242163", "0.66550314", "0.66375303", "0.66016614", "0.66016614", "0.657999", "0.6575617", "0.65697694", "0.6555932", "0.6555932", "0.6553014", "0.6553014", "0.65513873", "0.65289074", "0.65207934", "0.65207934", "0.65207934", "0.65207934", "0.65207934", "0.65207934", "0.65080976", "0.6494495", "0.6494495", "0.647731", "0.64767706", "0.6469828", "0.6456013", "0.64489394", "0.64437026", "0.6432482", "0.6432228", "0.6411372", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.64046454", "0.6397087", "0.638112", "0.63799113", "0.63739866", "0.63739866", "0.63654876", "0.63623726", "0.63623726", "0.6360453", "0.6355486", "0.6320663", "0.6312638", "0.6306454", "0.6304218", "0.62905365", "0.62905365", "0.6289033", "0.628176", "0.6269366", "0.6245142", "0.6244581", "0.624385" ]
0.694029
9
Set the PDF owner password.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the PDF owner password.") @JsonProperty(JSON_PROPERTY_OWNER_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getOwnerPassword() { return ownerPassword; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPassword(String pw)\n {\n this.password = pw;\n }", "public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }", "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }", "void setPassword(String ps) {\n this.password = ps;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }", "public void setPassword(java.lang.String newPassword);", "public void setPassword(String pass);", "public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}", "public void setPassword(String p) {\n\t\tpassword = p;\n\t}", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "public void setPassword(String password)\n {\n _password = password;\n }", "@Override\n\tpublic void setPassword(String password) {\n\n\t}", "@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}", "public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }", "public void setPasswordField(final JPasswordField pwPasswordParam) {\n this.pwPassword = pwPasswordParam;\n }", "public void setPassword(String password) {\n this.password = password;\n saveProperties();\n }", "public void setPassword(String password){\r\n this.password = password;\r\n }", "public void setDevicePassword(String argPassword) {\n\tdevicePassword = argPassword;\n }", "public void setPassword(java.lang.String param) {\r\n localPasswordTracker = param != null;\r\n\r\n this.localPassword = param;\r\n }", "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 }", "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)\n {\n this.password = password;\n }", "public void setPassword(String password)\n \t{\n \t\tthis.password = password;\n \t}", "public void set_pass(String password)\n {\n pass=password;\n }", "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) {\n this.password = password;\r\n }", "public void setPassword(String password) {\n\tthis.password = password;\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 password )\r\n {\r\n this.password = password;\r\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 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 }", "public void setPassword(String password) {\n setObject(\"password\", (password != null) ? password : \"\");\n }", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Set the PDF user password.\")\n @JsonProperty(JSON_PROPERTY_USER_PASSWORD)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public String getUserPassword() {\n return userPassword;\n }", "@Override\n\tpublic void setPassword(String password) {\n\t\tgetInnerObject().setPassword(password);\n\t\t\n\t}", "public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }", "public void setPw(char[] password) {\n\t\t\r\n\t}", "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 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 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 }", "public void setOwner(User owner) {\n this.owner = owner;\n }", "public void set_password(String password)\r\n\t{\r\n\t\tthis.password = password;\r\n\t}", "void setErrorPassword();", "public void setPassword(String password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\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 password) {\n this.password = password;\n }", "public void setPassword (java.lang.String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setAppPassword(String appPassword) {\n this.appPassword = appPassword;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(final String password){\n mPassword = password;\n }", "public void setPassword(String text) {\n txtPassword().setText(text);\n }", "public void setPassword( final String password )\n\t{\n\t\tthis.password = password;\n\t}", "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}", "public void setOwner( String owner ){\r\n \ttry{\r\n \t\t_lockObject.lock();\r\n \t_owner = owner;\r\n \t_itDepartment.setDirector(_owner);\r\n \t}finally{\r\n \t\t_lockObject.unlock();\r\n \t}\r\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }" ]
[ "0.6468958", "0.6370642", "0.6263558", "0.6263558", "0.6263558", "0.61579275", "0.61411625", "0.60749155", "0.6049012", "0.60318923", "0.60155916", "0.60038847", "0.5947983", "0.5916725", "0.5914191", "0.58804756", "0.585162", "0.5814637", "0.58109224", "0.5790198", "0.5773115", "0.5772079", "0.5770901", "0.57543993", "0.57543993", "0.57490146", "0.57490146", "0.5740914", "0.5735325", "0.5730869", "0.5729489", "0.5729489", "0.5726479", "0.57102317", "0.5707462", "0.5707462", "0.57012796", "0.56894433", "0.56695133", "0.56695133", "0.56695133", "0.56695133", "0.56695133", "0.56695133", "0.566463", "0.56587213", "0.56587213", "0.5655582", "0.5633171", "0.5615903", "0.5606315", "0.5597344", "0.5597344", "0.5597127", "0.5597127", "0.5588594", "0.55747116", "0.5572101", "0.5571095", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55648124", "0.55544734", "0.55480516", "0.5547367", "0.5544255", "0.5531119", "0.55030096", "0.5502211", "0.5499865", "0.5484885", "0.5484885" ]
0.69141
0
Disallow printing of this PDF.
@javax.annotation.Nullable @ApiModelProperty(value = "Disallow printing of this PDF.") @JsonProperty(JSON_PROPERTY_DISALLOW_PRINT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDisallowPrint() { return disallowPrint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean getPrint() {\n\t\treturn false;\n\t}", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "private Boolean isPDF(PrintDocument printDocument) {\n String url = printDocument.getUrl();\n String filename = url.substring(url.lastIndexOf(\"/\") + 1);\n\n return filename.matches(\"^.*\\\\.(pdf)$\");\n }", "public boolean isEnabledPrint() {\n return enabledPrint;\n }", "private void printPDF(PrintDocument printDocument) throws PrinterException, IOException {\n logger.debug(\"printPDF::\" + printDocument);\n\n String filename = DocumentService.getFileFromUrl(printDocument.getUrl()).getPath();\n\n long timeStart = System.currentTimeMillis();\n\n DocPrintJob docPrintJob = getDocPrintJob(printDocument.getType());\n\n PrinterJob job = PrinterJob.getPrinterJob();\n job.setPrintService(docPrintJob.getPrintService());\n\n PageFormat pageFormat = getPageFormat(job);\n\n PDDocument document = null;\n try {\n document = PDDocument.load(new File(filename));\n\n Book book = new Book();\n for (int i = 0; i < document.getNumberOfPages(); i += 1) {\n // Rotate Page Automatically\n\n PageFormat eachPageFormat = (PageFormat) pageFormat.clone();\n\n if (settingService.getSetting().getAutoRotation()) {\n if (document.getPage(i).getCropBox().getWidth() > document.getPage(i).getCropBox().getHeight()) {\n logger.debug(\"Auto rotation result: LANDSCAPE\");\n eachPageFormat.setOrientation(PageFormat.LANDSCAPE);\n } else {\n logger.debug(\"Auto rotation result: PORTRAIT\");\n eachPageFormat.setOrientation(PageFormat.PORTRAIT);\n }\n }\n\n AnnotatedPrintable printable = new AnnotatedPrintable(new PDFPrintable(document, Scaling.SHRINK_TO_FIT, false, settingService.getSetting().getPrinterDPI()));\n\n for (AnnotatedPrintable.AnnotatedPrintableAnnotation printDocumentExtra : printDocument.getExtras()) {\n printable.addAnnotation(printDocumentExtra);\n }\n book.append(printable, eachPageFormat);\n }\n\n job.setPageable(book);\n job.setJobName(\"WebApp Hardware Bridge PDF\");\n job.setCopies(printDocument.getQty());\n job.print();\n\n long timeFinish = System.currentTimeMillis();\n logger.info(\"Document \" + filename + \" printed in \" + (timeFinish - timeStart) + \"ms\");\n } finally {\n if (document != null) {\n try {\n document.close();\n } catch (Exception e) {\n }\n }\n }\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow copying of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_COPY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowCopy() {\n return disallowCopy;\n }", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "public void skipPrint()\n {\n skipPrint(0);\n }", "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow annotation of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_ANNOTATE)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowAnnotate() {\n return disallowAnnotate;\n }", "public boolean canBuildPrinter() {\r\n return isPrinter(getFormatter());\r\n }", "public boolean getToPrint() {\r\n return this.toPrint;\r\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow modification of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_MODIFY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowModify() {\n return disallowModify;\n }", "public void setToPrint(Boolean toPrint) {\r\n this.toPrint = toPrint;\r\n }", "public void print() { /* FILL IN */ }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disables parallel fetching of assets during PDF creation. Useful if your asset host has strict rate limiting.\")\n @JsonProperty(JSON_PROPERTY_NO_PARALLEL_DOWNLOADS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoParallelDownloads() {\n return noParallelDownloads;\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font embedding in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_EMBED_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoEmbedFonts() {\n return noEmbedFonts;\n }", "@SneakyThrows\n private void pdfReport() {\n NotificationUtil.warningAlert(\"Warning\", \"Nothing to export\", NotificationUtil.SHORT);\n ServiceFactory.getPdfService().projectReport(table.getItems());\n }", "public boolean isProhibited() {\n return getFlow().isProhibited();\n }", "public void supressDraw() {\n this.m_canDraw = false;\n }", "private void actionPrint() {\n // get PrinterJob\n PrinterJob job = PrinterJob.getPrinterJob();\n MyPrintable printable = new MyPrintable(job.defaultPage(), layoutPanel);\n\n // setup Printable, Pageable\n job.setPrintable(printable);\n job.setPageable(printable);\n\n // display print dialog and print\n if (job.printDialog()) {\n try {\n job.print();\n } catch (PrinterException e) {\n e.printStackTrace();\n }\n }\n }", "public void doPrint() {\n printBehavior.printReceipt();\n\n }", "public void handlePrintFile (File printFile) {\n // not supported\n }", "public void allowDraw() {\n this.m_canDraw = true;\n }", "public void cancelPendingPrintJobs()\n {\n printerSimulator.cancelPendingPrintJobs();\n }", "private boolean enablePrint(boolean found)\n {\n if(found)\n {\n printJMenuItem.setEnabled(true);\n }\n else\n {\n printJMenuItem.setEnabled(false);\n }\n \n return found;\n }", "void isPrintable(boolean b) {\n\t\tm.isPrintable=b;\n\t}", "@Test\n void testDontAddMissingInformationOnDocumentLoad()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n \n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n // do a low level access to the AcroForm to avoid the generation of missing entries\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n COSDictionary catalogDictionary = documentCatalog.getCOSObject();\n COSDictionary acroFormDictionary = (COSDictionary) catalogDictionary.getDictionaryObject(COSName.ACRO_FORM);\n\n // ensure that the missing information has not been generated\n assertNull(acroFormDictionary.getDictionaryObject(COSName.DA));\n assertNull(acroFormDictionary.getDictionaryObject(COSName.RESOURCES));\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "public static boolean canDisplayPdf(Context context) {\n\t\tPackageManager packageManager = context.getPackageManager();\n\t\tIntent testIntent = new Intent(Intent.ACTION_VIEW);\n\t\ttestIntent.setType(MIME_TYPE_PDF);\n\t\tif (packageManager.queryIntentActivities(testIntent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY).size() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic void suppress() {\n\n\t}", "public void setPrintHiddenFields(boolean printHiddenFields)\n\t{\n\t\tthis.printHiddenFields = printHiddenFields;\n\t}", "@Override\r\n protected boolean suppressValidation(HttpServletRequest httpServletRequest) {\r\n int curPage = getCurrentPage(httpServletRequest);\r\n int targetPage = getTargetPage(httpServletRequest, curPage);\r\n if (targetPage < curPage) return true;\r\n return super.suppressValidation(httpServletRequest);\r\n }", "public void printPdf(View view) {\n PrintManager printManager = (PrintManager) getSystemService(PRINT_SERVICE);\n printManager.print(\"print_job_name\", new ViewPrintAdapter(this, pageViews), null);\n Context context = App.getContext();\n LogManager.reportStatus(context, \"INSPECTOR\", \"printPdf\");\n }", "public void validarExportPDF() throws IOException {\n exportPDF_NF();\n }", "public boolean isPrintHiddenFields()\n\t{\n\t\treturn printHiddenFields;\n\t}", "public void actionPerformed(ActionEvent e){\n if (e.getSource() instanceof JButton) {\r\n PrinterJob printJob = PrinterJob.getPrinterJob();\r\n PageFormat pf = new PageFormat();\r\n pf.setOrientation(PageFormat.LANDSCAPE);\r\n printJob.setPrintable(_instance, pf);\r\n //if (printJob.printDialog()) {\r\n try {\r\n printJob.print();\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n //}\r\n }\r\n }", "public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}", "public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}", "@attribute(value = \"\", required = false)\t\r\n\tpublic void setPrintFieldValue(Boolean printFieldValue) {\r\n\t\tthis.printFieldValue = printFieldValue;\r\n\t}", "public void changePrintingAll()\n {\n printingAll = !printingAll;\n }", "@Override\n public void disableDraw() {\n drawingTools.disableDraw();\n }", "private Boolean isRaw(PrintDocument printDocument) {\n return printDocument.getRawContent() != null && !printDocument.getRawContent().isEmpty();\n }", "@Override\n\tpublic void print() {\n\t\tdecoratedPrinter.print();\n\t}", "public void setInvoiceDeliveryPrefsPrint(java.lang.Boolean invoiceDeliveryPrefsPrint) {\n this.invoiceDeliveryPrefsPrint = invoiceDeliveryPrefsPrint;\n }", "@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "public static boolean usePrinting() {\n\t\treturn (isWindows() || isSolaris() || isMac());\n\t}", "public void disable() {\n\t\tm_enabled = false;\n\t\tuseOutput(0);\n\t}", "public void disable();", "private void doPrint() {\n PrintManager printManager = (PrintManager) this\n .getSystemService(Context.PRINT_SERVICE);\n\n // Set job name, which will be displayed in the print queue\n String jobName = this.getString(R.string.app_name) + \" Document\";\n\n // Start a print job, passing in a PrintDocumentAdapter implementation\n // to handle the generation of a print document\n printManager.print(jobName, new MyPrintDocumentAdapter(this),\n null); //\n }", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "private void generarDocP(){\n generarPdf(this.getNombre());\n }", "public void preProcessPDF(Object document) {\n Document pdf = (Document) document;\n pdf.setPageSize(PageSize.LETTER.rotate());\n pdf.open();\n }", "public void suppress() {\n\t\tstop = true;\n\t}", "public void actionPerformed(ActionEvent e) {\n \t\tPrinterJob job = PrinterJob.getPrinterJob();\n \t\tjob.setPrintable(this);\n \t\tboolean ok = job.printDialog();\n \t\tif (ok) {\n \t\t\ttry {\n \t\t\t\tjob.print();\n \t\t\t} catch (PrinterException ex) {\n \t\t\t\t/* The job did not successfully complete */\n \t\t\t}\n \t\t}\n \n \t}", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // not necessary for proj1\n }", "protected void disableRotation()\n\t{\n\t\tthis.rotationAllowed = false;\n\t}", "public void disable() {\r\n m_enabled = false;\r\n useOutput(0, 0);\r\n }", "private void printRaw(PrintDocument printDocument) throws PrinterException, PrintException {\n logger.debug(\"printRaw::\" + printDocument);\n long timeStart = System.currentTimeMillis();\n\n byte[] bytes = Base64.decodeBase64(printDocument.getRawContent());\n\n DocPrintJob docPrintJob = getDocPrintJob(printDocument.getType());\n Doc doc = new SimpleDoc(bytes, DocFlavor.BYTE_ARRAY.AUTOSENSE, null);\n docPrintJob.print(doc, null);\n\n long timeFinish = System.currentTimeMillis();\n logger.info(\"Document raw printed in \" + (timeFinish - timeStart) + \"ms\");\n }", "public void removePrintArea(int arg0) {\n\n\t}", "final public boolean isNeverAccessible()\r\n {\r\n return never_accessible;\r\n }", "public Boolean getBypassDocumentValidation() {\n return bypassDocumentValidation;\n }", "final void setNeverAccessible(boolean never)\r\n {\r\n never_accessible = never;\r\n }", "public boolean isSprinting(){\n return this.sprint;\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "@Override\r\n\tpublic boolean isDisabled() throws NotesApiException {\n\t\treturn false;\r\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font subsetting in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_SUBSET_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoSubsetFonts() {\n return noSubsetFonts;\n }", "void disable();", "void disable();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-06 12:50:58.284 -0400\", hash_original_method = \"7522AD53308CD10F1544E38D1EB762CF\", hash_generated_method = \"CE79928AEF3A763B2BF787801BBC2702\")\n \npublic void cancel() {\n final int state = getInfo().getState();\n if (state == PrintJobInfo.STATE_QUEUED\n || state == PrintJobInfo.STATE_STARTED\n || state == PrintJobInfo.STATE_BLOCKED\n || state == PrintJobInfo.STATE_FAILED) {\n mPrintManager.cancelPrintJob(mCachedInfo.getId());\n }\n }", "public void disableEndOfProductionButton(){\n this.endOfproductionButton.setEnabled(false);\n }", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // only necessary for lab5\n bufferPool.remove(pid);\n }", "public boolean isAccessible() {\n return false;\n }", "public static List<Page> processPDF(byte[] theFile, PageProcessor pp,\n int startPage, int endPage, String encoding, String password,\n List<AdjacencyGraph<GenericSegment>> adjGraphList, boolean GUI)\n throws DocumentProcessingException\n {\n\n\n boolean toConsole = false;\n if (password == null)\n password = \"\";\n if (encoding == null || encoding == \"\")\n encoding = DEFAULT_ENCODING;\n\n if (startPage == 0)\n startPage = 1;\n if (endPage == 0)\n endPage = Integer.MAX_VALUE;\n\n ByteArrayInputStream inStream = new ByteArrayInputStream(theFile);\n PDDocument document = null;\n\n try {\n\n PDFObjectExtractor extractor = new PDFObjectExtractor();\n// PDDocument document = null;\n document = PDDocument.load( inStream );\n // document.print();\n if( document.isEncrypted() )\n {\n try\n {\n document.decrypt( password );\n }\n catch( InvalidPasswordException e )\n {\n if(!(password == null || password == \"\"))//they supplied the wrong password\n {\n throw new DocumentProcessingException\n (\"Error: The supplied password is incorrect.\");\n }\n else\n {\n //they didn't suppply a password and the default of \"\" was wrong.\n throw new DocumentProcessingException\n ( \"Error: The document is encrypted.\" );\n }\n } catch (CryptographyException e) {\n throw new DocumentProcessingException(e);\n }\n }\n\n extractor.setStartPage( startPage );\n extractor.setEndPage( endPage );\n // stripper.writeText( document, output );\n\n List<PDFPage> thePages = extractor.findObjects(document);\n List<Page> theResult = new ArrayList<Page>();\n\n startPage = extractor.getStartPage();\n endPage = extractor.getEndPage();\n\n // now the DU part\n\n Iterator<PDFPage> pageIter = thePages.iterator();\n int currentPage = -1;\n while(pageIter.hasNext())\n {\n currentPage ++;\n PDFPage thePage = pageIter.next();\n\n Page resultPage = pp.processPage(thePage);\n theResult.add(resultPage);\n if (adjGraphList != null)\n adjGraphList.add(pp.getAdjGraph());\n\n }\n\n // 17.11.10 document-wide processing for headers, footers, etc.\n if (!GUI)\n theResult = pp.processDocPages(theResult, null);\n\n // move to finally block somewhere?\n if( document != null )\n {\n document.close();\n }\n return theResult;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n throw new DocumentProcessingException(e);\n }\n\n }", "public void startPrinting()\n {\n printerSimulator.startPrintingProcess();\n }", "public static void noSavingsPrinter() {\n System.out.println(line);\n System.out.println(NO_ACHIEVED_SAVINGS_MSG);\n System.out.println(line);\n }", "@VisibleForTesting\n void print();", "public String markDivorceExtractAsPrinted() {\n MarriageRegister marriageRegister = marriageRegistrationService.getMarriageRegisterByIdUKey(idUKey, user,\n Permission.PRINT_MARRIAGE_EXTRACT);\n\n if (marriageRegister != null && marriageRegister.getState() == MarriageRegister.State.DIVORCE_CERT_PRINTED) {\n addActionMessage(getText(\"message.divorcerextract.alreadymarkedasprinted\"));\n return SUCCESS;\n } else {\n try {\n //TODO : refactor rename licensePrintedLocationId and licenseIssuedUserId in order to user this attribute for both notice and Extract print\n marriageRegistrationService.markDivorceExtractAsPrinted(idUKey, locationDAO.\n getLocation(licensePrintedLocationId), userDAO.getUserByPK(licenseIssuedUserId), user);\n } catch (CRSRuntimeException e) {\n switch (e.getErrorCode()) {\n case ErrorCodes.MARRIAGE_REGISTER_NOT_FOUND:\n addActionError(getText(\"error.marriageregister.notfound\"));\n break;\n case ErrorCodes.INVALID_STATE_OF_MARRIAGE_REGISTER:\n addActionError(getText(\"error.marriageregister.invalidstate\"));\n break;\n case ErrorCodes.PERMISSION_DENIED:\n addActionError(getText(\"message.permissiondenied\"));\n break;\n case ErrorCodes.INVALID_LOCATION_ON_ISSUING_MARRIAGE_EXTRACT:\n addActionError(getText(\"message.marriagerextract.markasprintedfailed\"));\n break;\n case ErrorCodes.INVALID_USER_ON_CERTIFYING_MARRIAGE_EXTRACT:\n addActionError(getText(\"message.marriagerextract.markasprintedfailed\"));\n break;\n default:\n addActionError(getText(\"message.marriagerextract.markasprintedfailed\"));\n break;\n }\n return ERROR;\n }\n }\n addActionMessage(getText(\"message.divorceextract.markasprinted\"));\n return SUCCESS;\n }", "public javax.swing.JRadioButton getNoPrintRadio() {\r\n return noPrintRadio;\r\n }", "public boolean isPrivate() {\n return false;\n }", "public static void setInvisible() {\r\n\t\tfrmMfhEmailer.setVisible(false);\r\n\t}", "@Override\n\tpublic void print() {\n\t\t\n\t}", "@Override\r\n\tpublic boolean isPaid() {\n\t\treturn false;\r\n\t}", "public void printJobRequiresAttention(PrintJobEvent pje) ;", "@Override\n\tpublic void hideGuaranteedDeliverySection() {\n\n\t}", "private PrintUtilities()\n {\n // Do nothing.\n }", "public boolean isPrivate() {\n return (this.mDisplay.getFlags() & 4) != 0;\n }", "public void genPDF(String qfname)\r\n\t{\n\t\tboolean res = loadQg(qfname);\r\n\t\tif(!res)\r\n\t\t{\r\n\t\t\tmsg = \"(PDFW:GenPDF) Can not load questions from: \"+qfname;\r\n\t\t\tJOptionPane.showMessageDialog(null, msg);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n\n if (PrinterInstance.mPrinter == null) {\n Toast.makeText(mContext, getString(R.string.not_support), Toast.LENGTH_LONG).show();\n } else {\n mPrinter.printImage(monoChromeBitmap, PAlign.NONE, 0, false);\n }\n }", "void disable() {\n }", "public void doPrint()\n {\n PrinterJob printJob = PrinterJob.getPrinterJob();\n \n printJob.setPrintable((Printable) mapComponent);\n if (printJob.printDialog()) {\n try {\n printJob.print();\n } catch (Exception e) {\n ErrorHandler.displayError(\"An error occured during printing:\\n\" + e, ErrorHandler.ERR_PRINT_FAIL);\n }\n }\n }", "@Override\n\tpublic boolean isWiderReport() {\n\t\treturn true;\n\t}", "@Override\r\n\tpublic void print() {\n\t}", "public void print() {\n DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;\n \n //Aca obtenemos el servicio de impresion por default\n //Si no quieres ver el dialogo de seleccionar impresora usa esto\n //PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();\n \n \n //Con esto mostramos el dialogo para seleccionar impresora\n //Si quieres ver el dialogo de seleccionar impresora usalo\n //Solo mostrara las impresoras que soporte arreglo de bits\n PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();\n PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);\n PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();\n PrintService service = ServiceUI.printDialog(null, 700, 200, printService, defaultService, flavor, pras);\n \n //Creamos un arreglo de tipo byte\n byte[] bytes;\n\n //Aca convertimos el string(cuerpo del ticket) a bytes tal como\n //lo maneja la impresora(mas bien ticketera :p)\n bytes = this.contenidoFactura.getBytes();\n //Creamos un documento a imprimir, a el se le appendeara\n //el arreglo de bytes\n Doc doc = new SimpleDoc(bytes,flavor,null);\n \n //Creamos un trabajo de impresión\n DocPrintJob job = service.createPrintJob();\n\n //Imprimimos dentro de un try de a huevo\n try {\n //El metodo print imprime\n job.print(doc, null);\n \n } catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n DocPrintJob cutjob = service.createPrintJob();\n DocPrintJob spacejob = service.createPrintJob();\n //dejando espacios al final\n byte[] espacio = (\"\\n \\n \\n \\n\").getBytes();\n try{\n spacejob.print(new SimpleDoc(espacio,flavor,null),null);\n }\n catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n //cortando el papel\n try{\n byte[] cutP = new byte[] { 0x1d, 'V', 1 };\n cutjob.print(new SimpleDoc(cutP,flavor,null),null); \n }catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n \n }", "public void disableAnglePid() {\n\t\tgyroPid.disable();\n\t}", "@Override\n public void onPrinterAvailable(int flag) {\n Logger.i(TAG, \"working till here printer available!\");\n\n if (flag == 2) {\n// btn_PrintBill.setEnabled(false);\n// btn_Reprint.setEnabled(false);\n SetPrinterAvailable(false);\n } else if (flag == 5) {\n// btn_PrintBill.setEnabled(true);\n// btn_Reprint.setEnabled(true);\n// feedPrinter();\n SetPrinterAvailable(true);\n } else if (flag == 0) {\n// btn_PrintBill.setEnabled(true);\n// btn_Reprint.setEnabled(true);\n SetPrinterAvailable(false);\n }\n }" ]
[ "0.6108227", "0.6055076", "0.60021496", "0.59827715", "0.590817", "0.5905386", "0.5874822", "0.56803036", "0.566661", "0.5517088", "0.5510123", "0.5437684", "0.53708375", "0.5351502", "0.53192264", "0.5270155", "0.5261402", "0.5237396", "0.5215519", "0.51997584", "0.5196749", "0.51922625", "0.51895016", "0.51805884", "0.51704866", "0.51643115", "0.5144247", "0.5114788", "0.5111152", "0.50997645", "0.5095152", "0.508094", "0.5080411", "0.5075034", "0.50397336", "0.50377226", "0.5029736", "0.50272375", "0.502654", "0.502654", "0.4990494", "0.49878302", "0.49770933", "0.4976779", "0.49675307", "0.49631283", "0.4953875", "0.4953325", "0.49375495", "0.4937082", "0.49287564", "0.4925462", "0.49192116", "0.49192116", "0.49192116", "0.49138963", "0.4902821", "0.48945734", "0.4892597", "0.4882227", "0.48746487", "0.48729342", "0.48658708", "0.48536786", "0.4840655", "0.48397556", "0.48115084", "0.48091757", "0.48021868", "0.47894353", "0.47847074", "0.47674787", "0.47674787", "0.47637913", "0.47620937", "0.47616583", "0.4759301", "0.47515938", "0.4736517", "0.47348893", "0.47336748", "0.4733417", "0.47267538", "0.47254226", "0.4724651", "0.47241828", "0.47233185", "0.47214597", "0.47162518", "0.4712447", "0.47112358", "0.47089258", "0.47018513", "0.46970877", "0.4677861", "0.46647078", "0.46634743", "0.46630207", "0.46501043", "0.46489555" ]
0.7449243
0
Disallow copying of this PDF.
@javax.annotation.Nullable @ApiModelProperty(value = "Disallow copying of this PDF.") @JsonProperty(JSON_PROPERTY_DISALLOW_COPY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDisallowCopy() { return disallowCopy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void setNotAutoCopy(){isAutoCopying=false;}", "static void setNotCopying(){isCopying=false;}", "public boolean isCopyEnabled() {\n \t\tif (text == null || text.isDisposed())\n \t\t\treturn false;\n \t\treturn text.getSelectionCount() > 0;\n \t}", "static void setCopying(){isCopying=true;}", "public boolean shouldRevertToOriginalAuthorizationOnCopy() {\n return false;\n }", "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "@Override\n public boolean canPaste(Clipboard clipboard) {\n return false;\n }", "public void cutCopyEnabled(boolean enabled);", "public static void testConvertIntoCopy_copyDisallowed(MaintenanceDocument document, DataDictionaryService dataDictionaryService) throws Exception {\n DataDictionary d = dataDictionaryService.getDataDictionary();\r\n Class documentClass = document.getClass();\r\n boolean originalValue = d.getDocumentEntry(documentClass.getName()).getAllowsCopy();\r\n try {\r\n d.getDocumentEntry(documentClass.getName()).setAllowsCopy(false);\r\n\r\n boolean failedAsExpected = false;\r\n try {\r\n ((Copyable) document).toCopy();\r\n }\r\n catch (IllegalStateException e) {\r\n failedAsExpected = true;\r\n }\r\n\r\n assertTrue(failedAsExpected);\r\n }\r\n finally {\r\n d.getDocumentEntry(documentClass.getName()).setAllowsCopy(originalValue);\r\n }\r\n }", "public void lostOwnership( Clipboard aClipboard, Transferable aContents) {\n //do nothing\n }", "@Override\n\tpublic boolean isShareable() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isShareable() {\n\t\treturn false;\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow modification of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_MODIFY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowModify() {\n return disallowModify;\n }", "public boolean isCopyState() {\n\t\treturn true;\n\t}", "@Override\n public void copy() {\n clipboard.setContents(getSelectionAsList(false));\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow printing of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_PRINT)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowPrint() {\n return disallowPrint;\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "public void lostOwnership (Clipboard clipboard, Transferable contents)\n {\n _paste.setEnabled(false);\n _clipclass = null;\n }", "@Override\r\n public boolean canCancel(Document document) {\n return false;\r\n }", "public static void main(String[] args) {\n\n File sourceFile = new File(\"/Users/oyo/Documents/book/Java8实战.pdf\");\n File destFile = new File(\"/Users/oyo/Documents/book1/Java8实战.pdf\");\n\n\n\n long beforeTime = System.currentTimeMillis();\n\n copyFile(sourceFile, destFile);\n System.out.println(System.currentTimeMillis()-beforeTime);\n\n\n }", "@Override\r\n\tpublic boolean isIgnoreDestDeletes() throws NotesApiException {\n\t\treturn false;\r\n\t}", "public void copy() {\n\n\t}", "public void performCopy() {\n \t\ttext.copy();\n \t}", "public void copy() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"copyButton\").click();\n\t}", "public boolean isCopier(String id);", "public void copy() {\n\t\tcmd = new CopyCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "Prototype makeCopy();", "public boolean cp() {\n return false;\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void lostOwnership(Clipboard clipboard, Transferable contents) {\n\t\t\t\t\t\t\t\t}", "private boolean checkiforiginal(int copynum) {\n boolean isAvailable = false;\n if (copynum == 0) {\n isAvailable = true;\n }\n return isAvailable;\n }", "public Contenido copiar() {\n\t\tthrow new NotImplementedException();\r\n\t}", "public boolean isPrivateCloneOf(Text thePublicService) {\n return false;\n }", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "public final void releaseNoCopy() {\n explicitlyLocked = false;\n byteBase.unlockNoCopy();\n }", "@Override\r\n public void encryptPdf(String src, String dest) throws IOException, DocumentException {\n\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tFileCopy fc = new FileCopy();\n\t\tString inputFile = \"C:\\\\UmaTest\\\\ResumeNotesSatya.docx\";\n\t\tString outputFile = \"C:\\\\UmaTest\\\\MyTestOut.docx\";\n\t\t\n\t\tboolean isCopied = fc.copyFile(inputFile, outputFile);\n\t\t\n\t\tSystem.out.println(\"isCOpied=\"+isCopied);\n\t\t\n\t\t\n\t\t\n\n\t}", "@FXML\n private void copyDelete() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(DELETE_MESSAGE);\n clipboard.setContent(url);\n }", "public CurrentDocumentCopyCommand() {\n\tsuper(\"Save current document as new copy.\");\n }", "public void takeUndoSnapshotForSafety() {\n/* 1222 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* 1226 */ boolean shouldUnlock = false;\n/* */ try {\n/* 1228 */ this.mPdfViewCtrl.docLock(false);\n/* 1229 */ shouldUnlock = true;\n/* 1230 */ if (this.mPdfViewCtrl.getDoc().hasChangesSinceSnapshot()) {\n/* 1231 */ JSONObject jsonObj = new JSONObject();\n/* 1232 */ jsonObj.put(\"Action\", \"safety\");\n/* 1233 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 1234 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 1237 */ this.mPdfViewCtrl.takeUndoSnapshot(jsonObj.toString());\n/* 1238 */ if (sDebug)\n/* 1239 */ Log.d(TAG, \"snapshot for safety\"); \n/* */ } \n/* 1241 */ } catch (PDFNetException|JSONException e) {\n/* 1242 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } finally {\n/* 1244 */ if (shouldUnlock) {\n/* 1245 */ this.mPdfViewCtrl.docUnlock();\n/* */ }\n/* */ } \n/* */ }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow annotation of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_ANNOTATE)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowAnnotate() {\n return disallowAnnotate;\n }", "@LargeTest\n public void testCopy() {\n TestAction ta = new TestAction(TestName.COPY);\n runTest(ta, TestName.COPY.name());\n }", "@Override\r\n\tpublic void setIgnoreDestDeletes(boolean arg0) throws NotesApiException {\n\r\n\t}", "public void copySelection() {\r\n \t\t// Bertoli Marco\r\n \t\tclipboard.copy();\r\n \t}", "public void clickOnHardCopyButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnHardCopyButton.click();\n\n \t}", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "public void requestCopyPose()\r\n {\r\n \tAnimatedSpriteEditorGUI gui = AnimatedSpriteEditor.getEditor().getGUI(); \r\n \r\n boolean continueToCopy = true;\r\n if (!saved)\r\n {\r\n // THE USER CAN OPT OUT HERE\r\n continueToCopy = promptToSave();\r\n }\r\n \r\n // IF THE USER REALLY WANTS TO EXIT THE APP\r\n if (continueToCopy)\r\n {\r\n \tcontinueToCopy = poseIO.copyPose(currentPoseName, poseID);\r\n }\t \r\n \r\n \tif (continueToCopy)\r\n \t{\r\n \t\tJOptionPane.showMessageDialog(\r\n\t gui,\r\n\t POSE_COPIED_TEXT,\r\n\t POSE_COPIED_TITLE_TEXT,\r\n\t JOptionPane.INFORMATION_MESSAGE);\r\n \t\tAnimatedSpriteEditor.getEditor().getFileManager().reloadSpriteType();\r\n EditorStateManager stateManager = AnimatedSpriteEditor.getEditor().getStateManager();\r\n stateManager.setState(EditorState.SELECT_POSE_STATE);\r\n stateManager.getPoseurStateManager().setState(PoseurState.SELECT_SHAPE_STATE);\r\n \t}\r\n \telse\r\n \t{\r\n \t\tJOptionPane.showMessageDialog(\r\n\t gui,\r\n\t POSE_COPIED_ERROR_TEXT,\r\n\t POSE_COPIED_ERROR_TITLE_TEXT,\r\n\t JOptionPane.ERROR_MESSAGE);\r\n \t}\r\n \t\r\n }", "public void onTextCopy()\n\t{\n\t}", "@Override\r\npublic void setNumcopy(int numcopy) {\n\tsuper.setNumcopy(numcopy);\r\n}", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "protected void copyLinkToClipboard() {\r\n\t\tapp.copyTextToSystemClipboard(getURL());\r\n\t\tlink.selectAll();\r\n\t}", "public void lostOwnership(Clipboard clipboard, Transferable contents) {\n // Firefox doesn't clear its selection when someone else claims the\n // X11 selection and I imagine it could be quite annoying in Evergreen.\n // So deliberately do nothing.\n \n // If we already have the read lock and ask for the write lock in\n // setSelectionWithoutScrolling, that would cause deadlock if\n // another thread has the read lock and is waiting for this thread.\n }", "public void pasteEnabled(boolean enabled);", "@Source(\"gr/grnet/pithos/resources/editcopy.png\")\n ImageResource copy();", "public boolean canShare();", "@Override\r\npublic int getNumcopy() {\n\treturn super.getNumcopy();\r\n}", "protected abstract boolean copyCheckedFiles();", "@Override\r\n\tpublic boolean isSaveAsAllowed() {\r\n\t\treturn false;\r\n\t}", "Permanent copyPermanent(Permanent copyFromPermanent, UUID copyToPermanentId, Ability source, CopyApplier applier);", "@Override\n public boolean isDownloadable() {\n return true;\n }", "private Boolean isPDF(PrintDocument printDocument) {\n String url = printDocument.getUrl();\n String filename = url.substring(url.lastIndexOf(\"/\") + 1);\n\n return filename.matches(\"^.*\\\\.(pdf)$\");\n }", "boolean isIgnorable() { return false; }", "public boolean isProhibited() {\n return getFlow().isProhibited();\n }", "public boolean validateRequirement_IfCopyTextIsReadOnly(Requirement requirement, DiagnosticChain diagnostics, Map<Object, Object> context) {\n\t\treturn requirement.IfCopyTextIsReadOnly(diagnostics, context);\n\t}", "public void setDuplicateSuppression(boolean duplicate_suppression) {\n this.duplicate_suppression = duplicate_suppression;\n }", "@Override\r\n\tpublic Buffer copy() {\n\t\t\r\n\t\treturn null;\r\n\t}", "public boolean isDirect();", "public static boolean isSigned_dest() {\n return false;\n }", "@Override\n\tpublic boolean isSaveAsAllowed() {\n\t\treturn false;\n\t}", "@Override\n \tpublic boolean canDelete() {\n \t\treturn false;\n \t}", "public void setOptimizeCopy(boolean optimizeCopy)\n {\n this.optimizeCopy = optimizeCopy;\n }", "public void onPagesCropped() {\n/* 560 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 565 */ JSONObject jsonObj = new JSONObject();\n/* 566 */ if (this.mContext != null) {\n/* 567 */ String strCropPages = this.mContext.getResources().getString(R.string.pref_viewmode_user_crop);\n/* 568 */ jsonObj.put(\"Action\", strCropPages);\n/* */ } \n/* 570 */ jsonObj.put(\"Action event\", \"crop_pages\");\n/* */ \n/* 572 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 573 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 576 */ takeUndoSnapshot(jsonObj.toString());\n/* 577 */ if (sDebug)\n/* 578 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 579 */ } catch (Exception e) {\n/* 580 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disables parallel fetching of assets during PDF creation. Useful if your asset host has strict rate limiting.\")\n @JsonProperty(JSON_PROPERTY_NO_PARALLEL_DOWNLOADS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoParallelDownloads() {\n return noParallelDownloads;\n }", "void addCopy() {\r\n numCopies++;\r\n }", "@Test\n void testDontAddMissingInformationOnDocumentLoad()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n \n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n // do a low level access to the AcroForm to avoid the generation of missing entries\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n COSDictionary catalogDictionary = documentCatalog.getCOSObject();\n COSDictionary acroFormDictionary = (COSDictionary) catalogDictionary.getDictionaryObject(COSName.ACRO_FORM);\n\n // ensure that the missing information has not been generated\n assertNull(acroFormDictionary.getDictionaryObject(COSName.DA));\n assertNull(acroFormDictionary.getDictionaryObject(COSName.RESOURCES));\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "public boolean getOptimizeCopy()\n {\n return optimizeCopy;\n }", "protected void validateFile() {\r\n\t\tFile f = new File(FileUltil.joinPath(dOutputFolder, dFileName));\r\n\t\tif (f.exists() && !f.isDirectory()) {\r\n\t\t\tdFileName = \"Copy of \" + dFileName;\r\n\t\t\tvalidateFile();\r\n\t\t}\r\n\t}", "private void reEnableCopyButtons() {\n // re-enable the buttons the relevant buttons\n copyToASpaceButton.setEnabled(true);\n repositoryCheckButton.setEnabled(true);\n copyProgressBar.setValue(0);\n\n if (copyStopped) {\n if (ascopy != null) ascopy.saveURIMaps();\n copyStopped = false;\n copyProgressBar.setString(\"Cancelled Copy Process ...\");\n } else {\n copyProgressBar.setString(\"Done\");\n }\n }", "@FXML\n private void copyUrl() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(HELP_URL);\n clipboard.setContent(url);\n }", "private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}", "public boolean ignore()\n {\n return nameValues.getValue( FormTags.LINK_TYPE )[0].equals( \"Ignore\" );\n }", "boolean checkIfCopyAvailable(int materialId);", "@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}", "public CopyPage() {\n initComponents();\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 }", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "Field getCopy();", "@Test\n void testIllegalFieldsDefinition() throws IOException, URISyntaxException\n {\n String sourceUrl = \"https://issues.apache.org/jira/secure/attachment/12866226/D1790B.PDF\";\n\n try (PDDocument testPdf = Loader.loadPDF(\n RandomAccessReadBuffer.createBufferFromStream(new URI(sourceUrl).toURL().openStream())))\n {\n PDDocumentCatalog catalog = testPdf.getDocumentCatalog();\n\n assertDoesNotThrow(() -> catalog.getAcroForm(), \"Getting the AcroForm shall not throw an exception\");\n }\n }", "public void setPassportCopyUpload(String passportCopyUpload) {\n\t\tthis.passportCopyUpload = passportCopyUpload;\n\t}", "boolean readOnly();", "boolean readOnly();", "public void makeReadOnly();", "public boolean isPasteEnabled() {\n \t\tif (text == null || text.isDisposed())\n \t\t\treturn false;\n \t\treturn true;\n \t}", "@Override\n public void toCopy() throws WorkflowException {\n super.toCopy();\n travelAdvancesForTrip = null;\n setTravelDocumentIdentifier(null);\n if (!(this instanceof TravelAuthorizationCloseDocument)) { // TAC's don't have advances\n initiateAdvancePaymentAndLines();\n }\n }", "@Override\n public boolean isPrivate() {\n return true;\n }", "public boolean getDuplicateSuppression() {\n return duplicate_suppression;\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n String description = request.getParameter(\"description\"); // Retrieves <input type=\"text\" name=\"description\">\n Part filePart = request.getPart(\"file\"); // Retrieves <input type=\"file\" name=\"file\">\n // String fileName = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); // MSIE fix.\n InputStream fileContent = filePart.getInputStream();\n \n int rand =(int)( Math.random()*1000000000);\n String sourcePath = \"C:\\\\tmp\\\\tmp_\"+rand+\".pdf\";\n\n final Path destination = Paths.get(sourcePath);\n\n File file = destination.toFile();\n if(file.exists()){\n file.delete();\n }\n Files.copy(fileContent, destination);\n\n \n String path= PDFMinerController.pdf2text(sourcePath);\n \n \n File source = new File(path);\n System.out.println(\"XML file is readable \"+source.exists());\n List<Reference> refList= ReferenceExctractor.getReferences(source);\n Parser p = new Parser();\n StyleParser hp = new StyleParser();\n ArrayList<OneChar> text = p.parse(source);\n String headline= hp.parseHeadline(text);\n //response.setContentType(\"text/xml\");\n StringBuilder sb =new StringBuilder();\n sb.append(headline).append(\"\\n\");\n System.out.println(\"Reference list size \"+refList.size());\n for(Reference ref:refList ){\n System.out.println(\"Reference \"+ref.toString());\n sb.append(ref.toString()).append(\"\\n\");\n \n \n }\n response.getWriter().println(sb.toString());\n\t\n \n if(file.exists()){\n file.delete();\n System.out.println(\"PDF file deleted\");\n }\n System.out.println(\"Source exist \"+source.exists());\n if(source.exists()){\n source.delete();\n System.out.println(\"Source File deleted\");\n }\n \n }", "protected boolean isReadOnly()\n {\n return true;\n }", "@Override\n\tpublic boolean isReadOnly() {\n\t\treturn false;\n\t}" ]
[ "0.6496685", "0.6471618", "0.6321213", "0.6219833", "0.6178014", "0.6131958", "0.59492564", "0.59409904", "0.5912586", "0.56040376", "0.5590083", "0.5590083", "0.5564912", "0.5475471", "0.5436896", "0.5394452", "0.53743404", "0.5368163", "0.53674924", "0.53573895", "0.5354873", "0.53438866", "0.5303394", "0.52869636", "0.5227874", "0.5191736", "0.51901424", "0.51878846", "0.5168748", "0.51636314", "0.51379246", "0.5135203", "0.5108185", "0.5100345", "0.5095499", "0.5093164", "0.5044854", "0.503422", "0.50318503", "0.50067914", "0.49985301", "0.49960375", "0.49941567", "0.4979926", "0.49734196", "0.49734196", "0.4965158", "0.49565166", "0.49390933", "0.49341732", "0.4918834", "0.49152166", "0.4911057", "0.49078768", "0.48954257", "0.48919374", "0.4859293", "0.48442963", "0.48368716", "0.4836545", "0.4832275", "0.48244733", "0.48196706", "0.48047298", "0.47926313", "0.47864425", "0.47820336", "0.47799492", "0.47757635", "0.4771505", "0.47702315", "0.4768068", "0.47585514", "0.47542548", "0.47519514", "0.47505128", "0.4744934", "0.47394913", "0.47383258", "0.47348562", "0.4734501", "0.47199944", "0.47149295", "0.4714773", "0.46968824", "0.4696799", "0.46913454", "0.4690814", "0.4685473", "0.46832222", "0.46771607", "0.46771607", "0.46767348", "0.4675181", "0.46726662", "0.46637994", "0.46636754", "0.4663123", "0.46621436", "0.46603456" ]
0.7337884
0
Disallow annotation of this PDF.
@javax.annotation.Nullable @ApiModelProperty(value = "Disallow annotation of this PDF.") @JsonProperty(JSON_PROPERTY_DISALLOW_ANNOTATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDisallowAnnotate() { return disallowAnnotate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onAnnotationsPreRemove(Map<Annot, Integer> annots) {\n/* 370 */ if (annots == null || annots.size() == 0 || !this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ }", "protected boolean skip(Annotation annotation) {\n \t\treturn false;\n \t}", "@Override\r\n\tpublic Annotation annotate() {\n\t\treturn null;\r\n\t}", "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow printing of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_PRINT)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowPrint() {\n return disallowPrint;\n }", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "public void onAnnotationsRemovedOnPage(int pageNum) {\n/* 408 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 413 */ JSONObject jsonObj = new JSONObject();\n/* 414 */ if (this.mContext != null) {\n/* 415 */ String strRemoveAnnotations = this.mContext.getResources().getString(R.string.undo_redo_annots_remove_from_page, new Object[] { Integer.valueOf(pageNum) });\n/* 416 */ jsonObj.put(\"Action\", strRemoveAnnotations);\n/* */ } \n/* 418 */ jsonObj.put(\"Action event\", \"remove_annots_from_page\");\n/* */ \n/* 420 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 421 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 424 */ takeUndoSnapshot(jsonObj.toString());\n/* 425 */ if (this.mToolManager.getAnnotManager() != null) {\n/* 426 */ this.mToolManager.getAnnotManager().onLocalChange(\"delete\");\n/* */ }\n/* 428 */ if (sDebug)\n/* 429 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 430 */ } catch (Exception e) {\n/* 431 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "@Override\n public boolean canFix(Annotation annotation) {\n return false;\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow copying of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_COPY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowCopy() {\n return disallowCopy;\n }", "protected void createIgnoreAnnotations() {\n\t\tString source = \"http://www.polarsys.org/capella/2007/ImpactAnalysis/Ignore\";\t\n\t\taddAnnotation\n\t\t (architectureAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceImplementationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceUseEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (providedInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (requiredInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (actorCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow modification of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_MODIFY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowModify() {\n return disallowModify;\n }", "public void onAnnotationsPreModify(Map<Annot, Integer> annots) {\n/* 297 */ if (annots == null || annots.size() == 0 || !this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* 301 */ this.mPreModifyPageNum = 0;\n/* 302 */ this.mPreModifyAnnotRect = null;\n/* */ \n/* 304 */ for (Map.Entry<Annot, Integer> pair : annots.entrySet()) {\n/* 305 */ Annot annot = pair.getKey();\n/* 306 */ Integer pageNum = pair.getValue();\n/* 307 */ if (this.mPreModifyPageNum != 0 && this.mPreModifyPageNum != pageNum.intValue()) {\n/* 308 */ this.mPreModifyPageNum = 0;\n/* 309 */ this.mPreModifyAnnotRect = null;\n/* */ return;\n/* */ } \n/* 312 */ this.mPreModifyPageNum = pageNum.intValue();\n/* */ try {\n/* 314 */ if (annot != null && annot.isValid()) {\n/* */ Rect annotRect;\n/* 316 */ if (annot.getType() == 19) {\n/* */ \n/* 318 */ Widget widget = new Widget(annot);\n/* 319 */ Field field = widget.getField();\n/* 320 */ annotRect = field.getUpdateRect();\n/* */ } else {\n/* 322 */ annotRect = this.mPdfViewCtrl.getPageRectForAnnot(annot, pageNum.intValue());\n/* */ } \n/* 324 */ annotRect.normalize();\n/* 325 */ if (this.mPreModifyAnnotRect != null) {\n/* 326 */ this.mPreModifyAnnotRect.setX1(Math.min(this.mPreModifyAnnotRect.getX1(), annotRect.getX1()));\n/* 327 */ this.mPreModifyAnnotRect.setY1(Math.min(this.mPreModifyAnnotRect.getY1(), annotRect.getY1()));\n/* 328 */ this.mPreModifyAnnotRect.setX2(Math.max(this.mPreModifyAnnotRect.getX2(), annotRect.getX2()));\n/* 329 */ this.mPreModifyAnnotRect.setY2(Math.max(this.mPreModifyAnnotRect.getY2(), annotRect.getY2())); continue;\n/* */ } \n/* 331 */ this.mPreModifyAnnotRect = annotRect;\n/* */ }\n/* */ \n/* 334 */ } catch (Exception e) {\n/* 335 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ } \n/* */ }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font embedding in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_EMBED_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoEmbedFonts() {\n return noEmbedFonts;\n }", "boolean hasExplicitAnnotation();", "boolean hasExplicitAnnotation();", "@Override\n public boolean isDisableMetadataField() {\n return false;\n }", "public void removeAnnotations() {\n int size = this.annotationsArray.size();\n long[] jArr = new long[size];\n this.selectedMarkers.clear();\n for (int i = 0; i < size; i++) {\n jArr[i] = this.annotationsArray.keyAt(i);\n Annotation annotation = this.annotationsArray.get(jArr[i]);\n if (annotation instanceof Marker) {\n Marker marker = (Marker) annotation;\n marker.hideInfoWindow();\n this.iconManager.iconCleanup(marker.getIcon());\n }\n }\n this.annotations.removeAll();\n }", "@Override\n\tpublic Annotation[] getAnnotations() {\n\t\treturn null;\n\t}", "public boolean isAnnotation() {\n return cut.isAnnotation();\n }", "public void setExempt(boolean exempt);", "public void allowDraw() {\n this.m_canDraw = true;\n }", "public void requestDisallowIntercepts(){\n one.getParent().requestDisallowInterceptTouchEvent(true);\n two.getParent().requestDisallowInterceptTouchEvent(true);\n three.getParent().requestDisallowInterceptTouchEvent(true);\n four.getParent().requestDisallowInterceptTouchEvent(true);\n\n one.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n return false;\n }\n });\n }", "public void onAllAnnotationsRemoved() {\n/* 441 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 446 */ JSONObject jsonObj = new JSONObject();\n/* 447 */ if (this.mContext != null) {\n/* 448 */ String strRemoveAnnotations = this.mContext.getResources().getString(R.string.undo_redo_annots_remove);\n/* 449 */ jsonObj.put(\"Action\", strRemoveAnnotations);\n/* */ } \n/* 451 */ jsonObj.put(\"Action event\", \"remove_all_annotations\");\n/* */ \n/* 453 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 454 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 457 */ takeUndoSnapshot(jsonObj.toString());\n/* 458 */ if (this.mToolManager.getAnnotManager() != null) {\n/* 459 */ this.mToolManager.getAnnotManager().onLocalChange(\"delete\");\n/* */ }\n/* 461 */ if (sDebug)\n/* 462 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 463 */ } catch (Exception e) {\n/* 464 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }", "public void supressDraw() {\n this.m_canDraw = false;\n }", "public void setNotVisibleIfNotBlockedAndReplaced() {\n\t\tif (!isBlocked && getReplacementAttribute() == null) {\n\t\t\tthis.isVisible = false;\n\t\t}\n\t}", "public void indicateNot() {\r\n notIndicated = true;\r\n }", "public boolean isPaintingAnnotations() {\n \t\treturn !fConfiguredAnnotationTypes.isEmpty() || !fConfiguredHighlightAnnotationTypes.isEmpty();\n \t}", "public void annotationsCouldNotBeAdded(String errorMessage) {}", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "@Test\n void testDontAddMissingInformationOnDocumentLoad()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n \n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n // do a low level access to the AcroForm to avoid the generation of missing entries\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n COSDictionary catalogDictionary = documentCatalog.getCOSObject();\n COSDictionary acroFormDictionary = (COSDictionary) catalogDictionary.getDictionaryObject(COSName.ACRO_FORM);\n\n // ensure that the missing information has not been generated\n assertNull(acroFormDictionary.getDictionaryObject(COSName.DA));\n assertNull(acroFormDictionary.getDictionaryObject(COSName.RESOURCES));\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "public void changeNoParClassAnnotation(String className, String annotationName, boolean set) {\n projectData.changeClassNoParAnnotation(className, annotationName, set);\n }", "public void setAnnotation(String annotation) {\n this.annotation = annotation;\n }", "private void disableIfDissatisfied() {\n \t\tif ( !this.satisfiesPolygon() ) {\n \t\t\tthis.area.setEnabled( false );\n \t\t}\n \t}", "public void setAnnotation (String annotation) {\n this.annotation = annotation;\n }", "IParser setOmitResourceId(boolean theOmitResourceId);", "public void setIgnoreAttachedBody(boolean flag);", "@Override\n\tpublic void onInvisible() {\n\n\t}", "TypeConstraintMappingContext<C> ignoreAllAnnotations();", "void setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles);", "public void showDisarmed();", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "Annotations(int location_x, int location_y, String annotation) {\r\n super(ANNOTATIONS_WIDTH, ANNOTATIONS_LENGTH, location_x, location_y, annotation);\r\n this.isVisible = false;\r\n this.getComponent().setBackground(Color.GREEN);\r\n this.getComponent().setOpaque(true);\r\n this.getComponent().setVisible(false);\r\n }", "@Override\n\tpublic void suppress() {\n\n\t}", "public void negateUnxepectedTagPenalty() {\n\t\tnegateUnxepectedTagPenalty = true;\n\t}", "public abstract boolean mo30680a(Annotation annotation);", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disable font subsetting in PDFs.\")\n @JsonProperty(JSON_PROPERTY_NO_SUBSET_FONTS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoSubsetFonts() {\n return noSubsetFonts;\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "public static RuntimeAnnotationsAttr\n getRuntimeInvisibleAnnotations (AttrContainer container) {\n return getAnnotationsAttr(container, \"RuntimeInvisibleAnnotations\");\n }", "private void checkAnnotation()\n{\n if (getContext() == null) {\n BoardLog.logD(\"BICEX\",\"No context for annotations\");\n return;\n }\n long when = getExecution().getCurrentTime();\n Integer ilno = getContext().getLineAtTime(when);\n BoardLog.logD(\"BICEX\",\"LINE annotation at \" + ilno + \" \" + getContext().getFileName());\n\n if (ilno == null || ilno == 0) {\n removeAnnotation();\n }\n else if (ilno == current_line) ;\n else {\n removeAnnotation();\n EvalAnnot ea = new EvalAnnot(ilno,when);\n synchronized (this) {\n\t current_line = ilno;\n\t current_annotation = ea;\n\t BaleFactory.getFactory().addAnnotation(current_annotation);\n }\n }\n}", "public void setAnnotations(Annotations annotations) {\n\t\tthis.annotations = annotations;\n\t}", "public void disableAnglePid() {\n\t\tgyroPid.disable();\n\t}", "public void setInvisible(boolean b)\n\t{\n\t\t_invisible = b;\n\t}", "public void markNeverInline() {\n // For concurrent scenarios we should allow the flag to be already set\n assert inlining == InlinePreference.Default || inlining == InlinePreference.NeverInline;\n inlining = InlinePreference.NeverInline;\n }", "public void unsetNamedAnnotTrack()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(NAMEDANNOTTRACK$38, 0);\r\n }\r\n }", "boolean isOmitResourceId();", "final void setNeverAccessible(boolean never)\r\n {\r\n never_accessible = never;\r\n }", "public static void main( String[] args ) throws Exception\n {\n if( args.length != 2 )\n {\n System.out.println(\"Usage: <input pdf> <output file>\");\n }\n else\n {\n \tFile file = new File(\"./\"+args[0]);\n \tPDDocument document = PDDocument.load(file);\n\n \t List<PDPage> documentPages = document.getDocumentCatalog().getAllPages();\n\n \t\n try\n {\n \tPDPage page = documentPages.get(0);\n //document.addPage(page);\n List annotations = page.getAnnotations();\n\n // Setup some basic reusable objects/constants\n // Annotations themselves can only be used once!\n\n float inch = 72;\n PDGamma colourGreen = new PDGamma();\n colourGreen.setG(1);\n PDGamma colourBlue = new PDGamma();\n colourBlue.setB(1);\n\n PDBorderStyleDictionary borderThick = new PDBorderStyleDictionary();\n borderThick.setWidth(inch/12); // 12th inch\n PDBorderStyleDictionary borderThin = new PDBorderStyleDictionary();\n borderThin.setWidth(inch/72); // 1 point\n PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary();\n borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE);\n borderULine.setWidth(inch/72); // 1 point\n\n float pw = page.getMediaBox().getUpperRightX();\n float ph = page.getMediaBox().getUpperRightY();\n\n // Add the markup annotation, a highlight to PDFBox text\n PDFont font = PDType1Font.HELVETICA_BOLD;\n PDAnnotationTextMarkup txtMark = new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT);\n txtMark.setColour(colourBlue);\n txtMark.setConstantOpacity((float)0.1); // Make the highlight 20% transparent\n\n // Set the rectangle containing the markup\n\n float textWidth = (font.getStringWidth( \"PDFBox\" )/1000) * 18;\n PDRectangle position = new PDRectangle();\n position.setLowerLeftX(inch);\n position.setLowerLeftY( ph-inch-18 );\n position.setUpperRightX(72 + textWidth);\n position.setUpperRightY(ph-inch);\n txtMark.setRectangle(position);\n\n // work out the points forming the four corners of the annotations\n // set out in anti clockwise form (Completely wraps the text)\n // OK, the below doesn't match that description.\n // It's what acrobat 7 does and displays properly!\n float[] quads = new float[8];\n\n quads[0] = position.getLowerLeftX(); // x1\n quads[1] = position.getUpperRightY()-2; // y1\n quads[2] = position.getUpperRightX(); // x2\n quads[3] = quads[1]; // y2\n quads[4] = quads[0]; // x3\n quads[5] = position.getLowerLeftY()-2; // y3\n quads[6] = quads[2]; // x4\n quads[7] = quads[5]; // y5\n\n txtMark.setQuadPoints(quads);\n txtMark.setContents(\"Highlighted since it's important\");\n\n annotations.add(txtMark);\n\n\n \n\n // Now a square annotation\n\n PDAnnotationSquareCircle aSquare =\n new PDAnnotationSquareCircle( PDAnnotationSquareCircle.SUB_TYPE_SQUARE);\n aSquare.setContents(\"Square Annotation\");\n aSquare.setColour(colourGreen); // Outline in red, not setting a fill\n aSquare.setBorderStyle(borderThick);\n aSquare.setConstantOpacity((float)0.1);\n\n // Place the annotation on the page, we'll make this 1\" (72points) square\n // 3.5\" down, 1\" in from the right on the page\n\n position = new PDRectangle(); // Reuse the variable, but note it's a new object!\n position.setLowerLeftX(pw-(2*inch)); // 1\" in from right, 1\" wide\n position.setLowerLeftY(ph-(float)(3.5*inch) - inch); // 1\" height, 3.5\" down\n position.setUpperRightX(pw-inch); // 1\" in from right\n position.setUpperRightY(ph-(float)(3.5*inch)); // 3.5\" down\n aSquare.setRectangle(position);\n\n // add to the annotations on the page\n annotations.add(aSquare);\n\n\n\n document.save(args[1]);\n }\n finally\n {\n document.close();\n }\n }\n }", "public FXMLPropertiesDisabler() {\n this(OS.get());\n }", "@Override\r\n public boolean canCancel(Document document) {\n return false;\r\n }", "@Override\n public boolean isDisableIdentifierField() {\n return false;\n }", "protected void disableRotation()\n\t{\n\t\tthis.rotationAllowed = false;\n\t}", "public void pasteEnabled(boolean enabled);", "public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}", "public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}", "public CustomAnnotationParanamer() {\n super(new AdaptiveParanamer());\n }", "public void warningPermit();", "public void doCancel() {\n\t\tannotationManager.removeAllProviders();\n\t}", "@PropertySetter(role = ANNOTATION)\n\tboolean removeAnnotation(CtAnnotation<? extends Annotation> annotation);", "@Override\n\t\tpublic void annotate(JCas arg0) throws AnalysisEngineProcessException {\n\t\t\t\n\t\t}", "public void disable();", "public void onAnnotationAction() {\n/* 474 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 479 */ JSONObject jsonObj = new JSONObject();\n/* 480 */ if (this.mContext != null) {\n/* 481 */ String strAnnotAction = this.mContext.getResources().getString(R.string.undo_redo_annot_action);\n/* 482 */ jsonObj.put(\"Action\", strAnnotAction);\n/* */ } \n/* 484 */ jsonObj.put(\"Action event\", \"action\");\n/* */ \n/* 486 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 487 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 490 */ takeUndoSnapshot(jsonObj.toString());\n/* 491 */ if (sDebug)\n/* 492 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 493 */ } catch (Exception e) {\n/* 494 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }", "public boolean deleteAnnotation (AWBAnnotation annot, JawbDocument doc) {\n return doc.deleteAnnotation (annot);\n }", "protected void setRestrict(boolean restrict) {\n this.restrict = restrict;\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disables parallel fetching of assets during PDF creation. Useful if your asset host has strict rate limiting.\")\n @JsonProperty(JSON_PROPERTY_NO_PARALLEL_DOWNLOADS)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getNoParallelDownloads() {\n return noParallelDownloads;\n }", "public void makeInvisible() {\n\t\t\n\t\theadShape.setVisible(false);\n\t\tspine.setVisible(false);\n\t\tleftArmLine.setVisible(false);\n\t\trightArmLine.setVisible(false);\n\t\tleftLegLine.setVisible(false);\n\t\trightLegLine.setVisible(false);\n\t\tplayAgain.setVisible(false);\n\t\trevealLabel.setVisible(false);\n\t\t\n\t\t\n\t}", "IParser setSuppressNarratives(boolean theSuppressNarratives);", "@Override\n\tpublic boolean canExtract() {\n\t\treturn false;\n\t}", "public boolean isFacebeautyEnabled() {\n return false;\n }", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}", "@Test\n\tpublic void experimentShouldNotShowPublicationAnnotations() throws Exception {\n Interaction interaction = getMockBuilder().createInteractionRandomBinary();\n\n Experiment experiment = interaction.getExperiments().iterator().next();\n Publication publication = experiment.getPublication();\n\n addAnnotation(experiment, publication, \"Cancer dataset\", createTopic(CvTopic.DATASET_MI_REF, CvTopic.DATASET));\n\n getCorePersister().saveOrUpdate(interaction);\n\n // When: I go to the interaction details page\n goToInteractionDetailsPage(interaction.getAc());\n\n // Then: I don't expect to see those annotations in the experiment\n assertThat(driver.findElements(By.linkText(CvTopic.DATASET)).size(), is(equalTo(1)));\n assertThat(driver.findElement(By.id(\"mainPanels:j_id_18r:publicationAnnotTable:publicationAnnotTable:0:annotText\")).getText(), is(equalTo(\"Cancer dataset\")));\n\t}", "private void disablePhotoEditing() {\r\n isEditingPhotos = false;\r\n }", "@Override\n public String getAnnotation() {\n return annotation;\n }", "public interface SourceAnnotation {\n\n void annotate(AnnotationHolder holder, Document document, int sourceOffset);\n\n}", "protected boolean checkAAField()\n {\n if (this.pdWidget.getActions() != null)\n {\n ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_AA));\n return false;\n }\n return true;\n }", "public void removeAllAnnotationTypes() {\n \t\tfConfiguredAnnotationTypes.clear();\n \t\tfAllowedAnnotationTypes.clear();\n \t\tfConfiguredHighlightAnnotationTypes.clear();\n \t\tfAllowedHighlightAnnotationTypes.clear();\n \t\tif (fTextInputListener != null) {\n \t\t\tfSourceViewer.removeTextInputListener(fTextInputListener);\n \t\t\tfTextInputListener= null;\n \t\t}\n \t}", "public boolean isProhibited() {\n return getFlow().isProhibited();\n }", "public void setExclusiveMethodAnnot (\n Class<? extends java.lang.annotation.Annotation> exclusiveMethodAnnot)\n {\n synchronized (monitor)\n {\n this.exclusiveMethodAnnot = exclusiveMethodAnnot;\n }\n }", "void removeAnnotations() {\n if (currentIndicators.isEmpty()) {\n return;\n }\n // remove annotations from the model\n synchronized (annotationModelLockObject) {\n if (annotationModel instanceof IAnnotationModelExtension) {\n ((IAnnotationModelExtension) annotationModel).replaceAnnotations(\n currentIndicators.toArray(new Annotation[currentIndicators.size()]),\n null);\n } else {\n for (Annotation annotation : currentIndicators) {\n annotationModel.removeAnnotation(annotation);\n }\n }\n currentIndicators = Lists.newArrayList();\n }\n }", "public AnnotationPanel getAnnotationPanel() {\n\t\treturn null;\n\t}", "@Override\r\n\t\t\tpublic boolean onIntercept() {\n\t\t\t\treturn false;\r\n\t\t\t}", "public void setUnlabeled(){\n\t\tthis._isLabeled = false;\n\t}", "public void disableCasProcessor(String aCasProcessorName) {\n for (int i = 0; i < annotatorList.size(); i++) {\n ProcessingContainer pc = ((ProcessingContainer) annotatorList.get(i));\n if (pc.getName().equals(aCasProcessorName)) {\n pc.setStatus(Constants.CAS_PROCESSOR_DISABLED);\n if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_diabled_cp__FINEST\",\n new Object[] { Thread.currentThread().getName(), pc.getName() });\n }\n }\n }\n }", "@Override\npublic boolean isEnabled() {\n\treturn false;\n}", "public void setAnnotation(DrawingComponent annotation)\n\t{\n\t\tthis.annotation = annotation;\n\t}", "@Override\n public void visit(Tree.AnnotationList al) {\n }", "public PDAnnotation getInReplyTo() throws IOException {\n/* 260 */ COSBase base = getCOSObject().getDictionaryObject(\"IRT\");\n/* 261 */ if (base instanceof COSDictionary)\n/* */ {\n/* 263 */ return PDAnnotation.createAnnotation(base);\n/* */ }\n/* 265 */ return null;\n/* */ }" ]
[ "0.6133904", "0.5912921", "0.58649254", "0.5815194", "0.57060474", "0.570114", "0.5640075", "0.56266105", "0.5567587", "0.55551887", "0.5482785", "0.5456691", "0.5384988", "0.5341957", "0.5336651", "0.5336651", "0.53230137", "0.52710754", "0.5231168", "0.52194697", "0.5201653", "0.51991606", "0.51892537", "0.518914", "0.5164343", "0.51533014", "0.51385486", "0.51124185", "0.51119417", "0.51075524", "0.5104458", "0.5078986", "0.5069944", "0.5064636", "0.5064073", "0.50575", "0.5050836", "0.50480694", "0.50477785", "0.5036903", "0.4981528", "0.49795726", "0.49795726", "0.49658567", "0.49484423", "0.49459916", "0.493126", "0.4930803", "0.49280423", "0.49280143", "0.4926625", "0.4917575", "0.49021095", "0.4899668", "0.48973083", "0.48933873", "0.48929268", "0.4877883", "0.48750815", "0.4866313", "0.48576862", "0.48522425", "0.48470885", "0.4835136", "0.48265508", "0.48265508", "0.48254088", "0.48199135", "0.48162487", "0.48158807", "0.4812097", "0.4802969", "0.48001558", "0.4797996", "0.47920913", "0.4787561", "0.47822052", "0.47793362", "0.4777178", "0.47762597", "0.4770021", "0.4770021", "0.4770021", "0.4764585", "0.47601599", "0.47542098", "0.4754154", "0.47533765", "0.4750127", "0.47455817", "0.47394916", "0.4739144", "0.47301677", "0.4725827", "0.47248343", "0.47195336", "0.47142196", "0.47135517", "0.47081146", "0.47035518" ]
0.74314517
0
Disallow modification of this PDF.
@javax.annotation.Nullable @ApiModelProperty(value = "Disallow modification of this PDF.") @JsonProperty(JSON_PROPERTY_DISALLOW_MODIFY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDisallowModify() { return disallowModify; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow copying of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_COPY)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowCopy() {\n return disallowCopy;\n }", "public void onDisable() {\n \n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is disabled!\" );\n }", "public void onDisable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" disabled!\");\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow annotation of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_ANNOTATE)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowAnnotate() {\n return disallowAnnotate;\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Disallow printing of this PDF.\")\n @JsonProperty(JSON_PROPERTY_DISALLOW_PRINT)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDisallowPrint() {\n return disallowPrint;\n }", "static void setNotEdit(){isEditing=false;}", "public boolean getAllowModifications() {\n return true;\n }", "void disableEdit() {\n\t\tnameField.setEditable(false);\n\t\tssnField.setEditable(false);\n\t\ttakenDateField.setEditable(false);\n\t\ttotalScoreField.setEditable(false);\n\t\tadvisorField.setEditable(false);\n\t\t\n\t}", "public void setHiddenOrReadOnly() {\n if(getField_type().toLowerCase().matches(\"view|vfunction\")) {\n if(!getType().toLowerCase().matches(\"hidden\")){\n setSaveRequired(\"read\");\n }\n }\n }", "public void setExempt(boolean exempt);", "private void disablePhotoEditing() {\r\n isEditingPhotos = false;\r\n }", "public default boolean isEditable(){ return false; }", "@Override\r\n public boolean canCancel(Document document) {\n return false;\r\n }", "public void disable();", "public boolean shouldRevertToOriginalAuthorizationOnCopy() {\n return false;\n }", "private void setReadOnlyMode() {\n// mFileTitleEditText.setEnabled(false);\n// mDocContentEditText.setEnabled(false);\n mOpenFileId = null;\n }", "public void makeReadOnly();", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "final void setNeverAccessible(boolean never)\r\n {\r\n never_accessible = never;\r\n }", "private void performDirectEdit() {\n\t}", "public void setProtected()\n {\n ensureLoaded();\n m_flags.setProtected();\n setModified(true);\n }", "public void setPrivate()\n {\n ensureLoaded();\n m_flags.setPrivate();\n setModified(true);\n }", "public void makeReadOnly()\n {\n m_readOnly = true;\n }", "public void makeReadOnly()\n {\n m_readOnly = true;\n }", "public void setNotVisibleIfNotBlockedAndReplaced() {\n\t\tif (!isBlocked && getReplacementAttribute() == null) {\n\t\t\tthis.isVisible = false;\n\t\t}\n\t}", "void disable();", "void disable();", "void disableMod();", "public void setProtection(boolean value);", "protected abstract void disable();", "boolean shouldModify();", "@Override\n\tpublic void updateFalse(MetodoPagamento object) {\n\t\t\n\t}", "private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}", "public void nonEditable() {\r\n\t\tzoneAffichage.setEditable(false);\r\n\t\tzoneAffichage.setBackground(Color.WHITE);\r\n\t\tzoneAffichage.setFocusable(false);\r\n\t\tzoneAffichage.setCursor(null);\r\n\t}", "@Override\n\tpublic boolean isReadOnly() {\n\t\treturn false;\n\t}", "public void askModification() {\n\t\t\n\t\n\t}", "public void disableUpdate() {\n\t\tupdate = false;\n\t}", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "private void setMemberInformationPanelEditableFalse() {\n \n fNameTF.setEditable(false);\n lNameTF.setEditable(false);\n cprTF.setEditable(false);\n cityTF.setEditable(false);\n adressTF.setEditable(false);\n emailTF.setEditable(false);\n memberIdTF.setEditable(false);\n fNameTF.setEditable(false);\n phoneTF.setEditable(false);\n postalCodeTF.setEditable(false);\n adressNrTF.setEditable(false);\n changePictureBTN.setEnabled(false);\n }", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "public boolean doModify() {\n return true;\n }", "public final void CanNotBeChanged () {\n\t\tSystem.out.println(\"Can not be Changed\");\n\t}", "@Override\r\n\tpublic void setDisabled(boolean arg0) throws NotesApiException {\n\r\n\t}", "@Override\r\n\tpublic void setDontSendLocalSecurityUpdates(boolean arg0)\r\n\t\t\tthrows NotesApiException {\n\r\n\t}", "public void markFileAsNotSaved()\r\n {\r\n saved = false;\r\n }", "@Override\r\n\tpublic boolean isDisabled() throws NotesApiException {\n\t\treturn false;\r\n\t}", "void setProtection(boolean value);", "public Boolean getBypassDocumentValidation() {\n return bypassDocumentValidation;\n }", "void disable() {\n }", "boolean readOnly();", "boolean readOnly();", "@Override\n public void setReadOnly(boolean readonly) {\n // do nothing\n }", "boolean isIgnorable() { return false; }", "public boolean unSetDangerous() {\r\n\t\tif(isDangerous && isCovered) {\r\n\t\t\tisDangerous=false;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void allowDraw() {\n this.m_canDraw = true;\n }", "@Override\n\tprotected boolean canBeRidden(Entity entityIn)\n\t{\n\t\treturn false;\n\t}", "protected void setRestrict(boolean restrict) {\n this.restrict = restrict;\n }", "public void setModification(boolean b)\n {\n this.isModification = b;\n }", "protected void setIsFileNotSupport(boolean isFileNotSupport) {\n\t\tmIsTextFileNotSupport = isFileNotSupport;\n\t}", "public boolean isProhibited() {\n return getFlow().isProhibited();\n }", "public void setNegativePermissions();", "public void setReadOnly(boolean isReadOnly);", "static void setNotAutoCopy(){isAutoCopying=false;}", "public boolean isAccessible() {\n return false;\n }", "protected void disableRotation()\n\t{\n\t\tthis.rotationAllowed = false;\n\t}", "public boolean mayHaveRewrite() { return false; }", "public boolean isReadOnly();", "public boolean isReadOnly();", "public boolean isReadOnly();", "public void supprimerInaccessibles(){\n grammaireCleaner.nettoyNonAccGramm();\n setChanged();\n notifyObservers(\"3\");\n }", "public boolean isReadOnly() {\n\t\treturn false;\n\t}", "protected boolean isReadOnly()\n {\n return true;\n }", "public void disable() {\n \t\t\tsetEnabled(false);\n \t\t}", "public void disableAccessRules() {\n\t\tm_parser.disableAccessRules();\n\t}", "public void setNotHasPermission(Boolean notHasPermission)\r\n {\r\n this.notHasPermission = notHasPermission;\r\n }", "static void setNotCopying(){isCopying=false;}", "@Override\n public boolean canUpdate() { return false; }", "public void supressDraw() {\n this.m_canDraw = false;\n }", "public void disable(){\r\n\t\tthis.activ = false;\r\n\t}", "public void indicateNot() {\r\n notIndicated = true;\r\n }", "private boolean canChangeDocuments() {\n\n // If the text is modified, give the user a chance to\n // save it. Otherwise return true.\n\n if (fDocument.isModified()) {\n byte save = askSave(this, getTitle());\n if (save == YES) {\n return doSave();\n }\n else {\n return save == NO;\n }\n }\n else {\n return true;\n }\n }", "public void disable ( ) {\r\n\t\tenabled = false;\r\n\t}", "public void warningPermit();", "protected void allowRotation()\n\t{\n\t\tthis.rotationAllowed = true;\n\t}", "public default boolean canBePermanent(){ return false; }", "public boolean canEdit() {\r\n\t\treturn !dslView.isContainsErrors();\r\n\t}", "final public boolean isNeverAccessible()\r\n {\r\n return never_accessible;\r\n }", "public void disable() {\r\n m_enabled = false;\r\n useOutput(0, 0);\r\n }", "public void clearModifiedFlag();", "void clearModifiedFlag();", "public void vanish() {\n\t\t\r\n\t\tlpanel.addMouseMotionListener(new MouseAdapter() {\r\n\t\t\tpublic void mouseMoved(MouseEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tchecker.setEnabled(false);\r\n\t\t\t\tchecker.setVisible(false);\r\n\t\t\t\trequestL.setEnabled(false);\r\n\t\t\t\trequestL.setVisible(false);\r\n\t\t\t\tpatientL.setEnabled(false);\r\n\t\t\t\tpatientL.setVisible(false);\r\n\t\t\t\treport.setEnabled(false);\r\n\t\t\t\treport.setVisible(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\t}", "public boolean getShouldChangePatchAfterWrite()\n {\n return false; \n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "public boolean setDangerous() {\r\n\t\tif(!isDangerous && isCovered) {\r\n\t\t\tisDangerous=true;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // not necessary for proj1\n }", "private void unlockButton() {\n\t\tconversionPdf_Txt.setEnabled(true);\n\t\tavisJury.setEnabled(true);\n\t\tstatistique.setEnabled(true);\n bData.setEnabled(true);\n\t}", "boolean getDeletionProtection();", "public void disableAddAffliation() {\n System.out.println(\"disable add affliation\");\n members_addAffliation.setDisable(true);\n members_removeAffliation.setDisable(false);\n }" ]
[ "0.6860117", "0.6610989", "0.6311091", "0.6261468", "0.60133564", "0.58814794", "0.58750725", "0.5831512", "0.58122194", "0.5725628", "0.5721246", "0.570684", "0.5684939", "0.56218046", "0.5619073", "0.55745226", "0.5562601", "0.5538279", "0.5519373", "0.55112875", "0.54953", "0.5494805", "0.547014", "0.54605556", "0.54605556", "0.54555804", "0.54375434", "0.54375434", "0.54347825", "0.5425105", "0.5391904", "0.5386307", "0.5375656", "0.5368964", "0.5366186", "0.53568286", "0.5349955", "0.53379494", "0.5334369", "0.5334369", "0.5323724", "0.5307155", "0.5299447", "0.5294519", "0.52945", "0.5290833", "0.5290217", "0.5284634", "0.5273859", "0.5272402", "0.5259434", "0.5250406", "0.5250406", "0.5249439", "0.5235998", "0.5234006", "0.52207625", "0.5215524", "0.51969874", "0.51922774", "0.5181627", "0.5172035", "0.51691616", "0.51489514", "0.5144396", "0.5138289", "0.5136812", "0.5134962", "0.51281136", "0.51281136", "0.51281136", "0.5126175", "0.511581", "0.5112643", "0.51061356", "0.5104159", "0.5102547", "0.51019734", "0.50728667", "0.5054417", "0.5050682", "0.50451934", "0.5042507", "0.5035243", "0.5035161", "0.5028998", "0.50252116", "0.5022041", "0.50211245", "0.50204045", "0.5019848", "0.50165504", "0.5015866", "0.50137985", "0.50116867", "0.501123", "0.50087476", "0.50083256", "0.50060767", "0.50051713" ]
0.73595375
0
Enable Prince debug mode.
@javax.annotation.Nullable @ApiModelProperty(value = "Enable Prince debug mode.") @JsonProperty(JSON_PROPERTY_DEBUG) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDebug() { return debug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void enableDebug() {\n this.debug = true;\n }", "public static void enableDebugging(){\n DEBUG = true;\n }", "void setDebugEnabled(boolean value) {\r\n debug_enabled = value;\r\n }", "@Override\n\tpublic void setDebugMode(boolean debug) {\n\n\t}", "public void setDebugging(boolean on)\n\t{\n\t\t_options.setDebugging(on);\n\t}", "public void toggleDebugMode() {\r\n DEBUG = !DEBUG;\r\n }", "@Override\n protected boolean isDebugEnable() {\n return false;\n }", "public void setDebugMode(boolean debugMode)\r\n {\r\n this.debugMode = debugMode;\r\n }", "public void setDebugMode(boolean debugMode) {\n this.debugMode = debugMode;\n }", "public void toggleDebug() {\n\t\tdebug = debug ? false : true;\n\t}", "@Override\n\tpublic void setDebug(boolean isDebug) {\n\t\t\n\t}", "void setDebug(boolean mode) {\n\t\tdebug = mode;\n\t}", "public static void disableDebugging(){\n DEBUG = false;\n }", "@Override\n\tpublic void setDebugMode(int debugMode) {\n\n\t}", "public void setDebugMode(final boolean dMode) { debugMode = dMode; }", "public static void setDebugMode(boolean debugMode) {\n mDebug = debugMode;\n }", "public void setDebugEnabled(boolean debugEnabled) {\n this.debugEnabled = debugEnabled;\n }", "public void setDebug(boolean debug) {\n this.debug=debug;\n }", "public void setDebug(boolean isDebug)\n {\n this.isDebug = isDebug;\n this.repaint();\n }", "static void debug() {\n ProcessRunnerImpl.setGlobalDebug(true);\n }", "public static void normalDebug(){\n enableVerbos = false;\n }", "public void setDebug(boolean value) {\n\t\tdebug = value;\n\t}", "protected boolean isDebugEnable() {\n return BlurDialogEngine.DEFAULT_DEBUG_POLICY;\n }", "public void setDebug(boolean b) { debug = b; }", "public boolean isDebugEnabled();", "public void setDebug(boolean debug) {\n this.debug = debug;\n }", "public void setDebug(boolean debug) {\n this.debug = debug;\n }", "public void disableDebug() {\n this.debug = false;\n }", "boolean isDebugEnabled();", "public void setDebugMode(boolean status)\n {\n debugMode = status;\n }", "public static void setDebug(boolean d) {\n\t\tdebug = d;\n\t}", "public void setDebug(boolean debug) {\n\t\tthis._debug = debug;\n\t}", "public void setDebug(final boolean debug)\n {\n this.debug = debug;\n }", "public void setDebuggable(boolean debug) {\n this.debug = debug;\n }", "public static boolean debugOn()\r\n {\r\n on = true;\r\n System.out.println(\"Debug Mode On\");\r\n return on;\r\n }", "public void setDebug( boolean debugF ) {\n\t\tthis.debug = debugF;\n\t\t}", "void debug() {\n this.renderer.debug = !this.renderer.debug;\n reload();\n }", "public boolean getDebugMode() { return debugMode; }", "public void setDebug(boolean f) {\n debug = f;\n }", "public static boolean debugOff()\r\n {\r\n on = false;\r\n System.out.println(\"Debug Mode Off\");\r\n return on;\r\n }", "@Override\n\tpublic boolean isDebugEnabled() {\n\t\treturn debugEnabled;\n\t}", "public static void setDebug(boolean flag)\n\t{\n\t\tm_debugFlag = flag;\n\t}", "public Render setDebugPrint() {\r\n\t\t_print = true;\r\n\t\treturn this;\r\n\t}", "public void setDebugOn(boolean flag)\n {\n this.setProperty(GUILoggerSeverityProperty.DEBUG, flag);\n }", "public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }", "public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }", "public void setDisplayDebug(boolean displayDebug) {\n this.displayDebug = displayDebug;\n }", "public static void setDebug(boolean debug) {\n IsDebug = debug;\n if (debug)\n setLevel(VERBOSE);\n else\n setLevel(INFO);\n }", "public static void setDebugFlag(boolean flag) {\n\t\tPMA.setDebugFlag(flag);\n\t\tif (flag) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Debug flag enabled. You will receive extra feedback and messages from the Java SDK (like this one)\");\n\t\t\tif (PMA.logger != null) {\n\t\t\t\tPMA.logger.severe(\n\t\t\t\t\t\t\"Debug flag enabled. You will receive extra feedback and messages from the Java SDK (like this one)\");\n\t\t\t}\n\t\t}\n\t}", "public static void setDebug(boolean db) {\n\n\t\tdebug = db;\n\n\t}", "public final void setDebug() {\r\n setLevel(org.apache.log4j.Level.DEBUG);\r\n }", "public boolean isDebug();", "protected void setContinueDebug(boolean continueDebug) {\n\t\tthis.continueDebug = continueDebug;\n\t}", "public boolean getSpecifyDebugCcl() {\n return specifyDebugCcl;\n }", "public void debug() {\n\n\t\t// Establecemos el estado\n\t\tsetEstado(Estado.DEBUG);\n\n\t\t// Obtenemos la proxima tarea\n\t\ttarea = planificador.obtenerProximaTarea();\n\t}", "public LagartoDOMBuilder enableDebug() {\n\t\tconfig.collectErrors = true;\n\t\tconfig.parserConfig.setCalculatePosition(true);\n\t\treturn this;\n\t}", "void k2h_set_debug_level_silent();", "protected static void setDebugLevel(int debugLevel) {\n Program.debugLevel = debugLevel;\n }", "static void debug(boolean b) {\n ProcessRunnerImpl.setGlobalDebug(b);\n }", "public void continueDebugStep() {\n \tthis.continueDebug = true;\n }", "public CompilationBuilder setDebug(boolean debug) {\n\t\tcompilerConfiguration.setDebug(debug);\n\t\treturn this;\n\t}", "public boolean getDebugMode()\n {\n return debugMode;\n }", "public boolean isDebugEnabled() {\n return debugEnabled;\n }", "public TerminalPropertiesBuilder setSpecifyDebugCcl(final boolean specifyDebugCcl) {\n this.specifyDebugCcl = specifyDebugCcl;\n return this;\n }", "public void setDebugSuspend(final boolean debugSuspend)\n {\n this.debugSuspend = debugSuspend;\n }", "public boolean isDebugMode() {\n return debugMode;\n }", "boolean isDebug();", "boolean isDebug();", "protected void setDebugging(boolean debugging) {\n\t\tthis.debugging = debugging;\n\t}", "@Override\r\n public boolean isDebug() {\n return BuildConfig.DEBUG;\r\n }", "public void setDebug(boolean debug, PrintStream out)\n {\n session.setDebug(debug);\n if (debug)\n session.setDebugOut(out);\n }", "@Override\n\tpublic boolean isDebugEnabled(Marker marker) {\n\t\treturn false;\n\t}", "public static void debug(boolean d) {\n D = d;\n }", "@FXML\n\tpublic void enableDebugLevel() {\n\t\tcheckFieldEditOrNot = true;\n\t\tif (enableDebugLevel.isSelected()) {\n\t\t\tdebugValue.setDisable(false);\n\t\t\tdebugValue.setValue(\"0\");\n\t\t\tSX3Manager.getInstance().addLog(\"Debug Level : Enable.<br>\");\n\t\t} else {\n\t\t\tdebugValue.setDisable(true);\n\t\t\tdebugValue.setValue(\"\");\n\t\t\tSX3Manager.getInstance().addLog(\"Debug Level : Disable.<br>\");\n\t\t}\n\t}", "public boolean isDebugEnabled()\n/* */ {\n/* 250 */ return getLogger().isDebugEnabled();\n/* */ }", "void setDebugPort(Integer debugPort);", "public boolean isDebug( ) {\n\t\treturn debug;\n\t}", "public void setDebugSend( boolean debug_on_off )\n {\n debug_send = debug_on_off;\n }", "public boolean isDebugEnabled() {\n return getFormat().getConverterService().isDebugEnabled();\n }", "@Override\n public boolean isDebug() {\n return BuildConfig.DEBUG;\n }", "protected boolean isContinueDebug() {\n\t\treturn continueDebug;\n\t}", "@Input\n public boolean isDebuggable() {\n return debug;\n }", "public Debug() {\n target = getProject().getObjects()\n .property(JavaForkOptions.class);\n port = getProject().getObjects()\n .property(Integer.class).convention(5005);\n server = getProject().getObjects()\n .property(Boolean.class).convention(true);\n suspend = getProject().getObjects()\n .property(Boolean.class).convention(true);\n finalizedBy(target);\n }", "public static void setDebug(int b) {\n debug = b;\n }", "public void setProfiling (boolean enable) {\n\tprofiling = enable;\n }", "public static final boolean isDebugInfo() { return true; }", "public void debug() {\n\n }", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public boolean isDisplayDebug() {\n return displayDebug;\n }", "public boolean getDebug() {\n return debug;\n }", "public boolean getDebug() {\n return debug;\n }", "public void setDebugServer(final boolean debugServer)\n {\n this.debugServer = debugServer;\n }", "public static void setDebug(boolean debug) {\n ButterKnife.debug = debug;\n }", "private final boolean isDebugMode() {\r\n\tString debug = m_ctx.getInitParameter(\"gateway.debug\");\r\n\tif (debug == null)\r\n\t return false;\r\n\tif (debug.equalsIgnoreCase(\"true\"))\r\n\t return true;\r\n\telse\r\n\t return false;\r\n }", "public void switchToDebug() {\r\n\t\tdebugPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"debugPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "public X debugGraphicsOptions(int debugOptions) {\n component.setDebugGraphicsOptions(debugOptions);\n return (X) this;\n }", "public synchronized void setDebugTraceEnabled(TrcDbgTrace tracer, boolean enabled)\n {\n debugTracer = enabled ? tracer : null;\n }", "public boolean isDebug()\n\t{\n\t\treturn this.debug;\n\t}", "public boolean isDebug() {\n\t\treturn _debug;\n\t}" ]
[ "0.74139506", "0.7340733", "0.6939362", "0.68647283", "0.68550843", "0.6817441", "0.680174", "0.6777513", "0.67176694", "0.6709521", "0.67052287", "0.6679041", "0.66711414", "0.66634524", "0.66540384", "0.6608522", "0.6583626", "0.65808195", "0.6546291", "0.65437573", "0.65413666", "0.6538439", "0.65375775", "0.65220094", "0.6505578", "0.6476647", "0.6476647", "0.64097446", "0.6395502", "0.63818616", "0.63010406", "0.62866336", "0.6281679", "0.6273032", "0.6226568", "0.6205744", "0.6190773", "0.618585", "0.61599606", "0.6154062", "0.6134767", "0.61035883", "0.61021477", "0.6071301", "0.6045687", "0.6045687", "0.6039331", "0.6035855", "0.6020061", "0.6017369", "0.60159296", "0.5997158", "0.599048", "0.59873396", "0.59774685", "0.5976674", "0.59701717", "0.5939728", "0.5938774", "0.59071916", "0.5899017", "0.5887538", "0.58680826", "0.5861201", "0.58603567", "0.58184564", "0.5801172", "0.5801172", "0.5784606", "0.57710904", "0.576421", "0.5727212", "0.5718341", "0.57126963", "0.5699537", "0.5678515", "0.56762195", "0.56706333", "0.56565046", "0.56546396", "0.56374425", "0.56324095", "0.5565426", "0.5564839", "0.55608517", "0.55438876", "0.55350995", "0.54999447", "0.54999447", "0.54770184", "0.5455159", "0.5455159", "0.5421321", "0.54174423", "0.54158473", "0.5414225", "0.5412772", "0.5410723", "0.53999114", "0.5392476" ]
0.6539257
21
Specify the input format.
@javax.annotation.Nullable @ApiModelProperty(value = "Specify the input format.") @JsonProperty(JSON_PROPERTY_INPUT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public InputEnum getInput() { return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Format[] getSupportedInputFormats()\n {\n return supportedInputFormats;\n }", "public Format setInputFormat(Format input) {\n inputFormat = input;\n return input;\n }", "public void setInputFormat(String inputFormat) {\n this.inputFormat = inputFormat;\n }", "public void setFormat(String fmt)\n {\n format = fmt;\n }", "public void setOutputFormat(OutputFormat format);", "public void setFormat(String format) {\r\n _format = format;\r\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "Object getFormat();", "public void setFormat(String value) {\n/* 198 */ setValue(\"format\", value);\n/* */ }", "@Override\n public Format getInputFormat()\n {\n return super.getInputFormat();\n }", "void setOutputFormat(String outputFormat);", "private Format()\n {\n super();\n }", "public void setFormat(Format format) {\n this.format = format.getIndex();\n }", "public DefaultFormat() {\n }", "public ClientLoader inputFormat(final String theInputFormat) {\r\n this.inputFormat = checkNotNull(theInputFormat, \"inputFormat is null\");\r\n return this;\r\n }", "@Override\n public String getFormatName() throws IOException {\n return input == null? myDefaultFormat.getName() : getInfo().getFormat().getName();\n }", "String getFormat();", "String getFormat();", "String getFormat();", "public void setFormat(Connector connector, Format format);", "FileFormat getFormat();", "@Override\n public Format setInputFormat(Format format)\n {\n Format inputFormat\n = ((format instanceof VideoFormat)\n && (((VideoFormat) format).getSize() == null))\n ? null // size is required\n : super.setInputFormat(format);\n \n if (logger.isDebugEnabled() && (inputFormat != null))\n logger.debug(\"SwScaler set to input in \" + inputFormat);\n return inputFormat;\n }", "public void addFormat(Format format);", "@Override\n public void setFormat(Format format) {\n if (format != Format.XML)\n throw new IllegalArgumentException(\"JAXBHandle supports the XML format only\");\n }", "public int getFormat()\n {\n return format;\n }", "@ApiModelProperty(required = true, value = \"The file type of the file.\")\n public String getFormat() {\n return format;\n }", "public void InvalidFormat();", "public int getFormat ()\n {\n return this.format;\n }", "public void setSupportFormat(String supportFormat) {\r\n\t\tthis.supportFormat = supportFormat;\r\n\t}", "public Format getInputFormat() {\n return inputFormat;\n }", "protected Format doSetFormat(Format format)\n {\n return null;\n }", "public void setFormats(Vector<String> formats) {\n\t\tthis.formats = formats;\n\t}", "public String getInputFormat() {\n return this.inputFormat;\n }", "@Field(0) \n\tpublic AVBufferSrcParameters format(int format) {\n\t\tthis.io.setIntField(this, 0, format);\n\t\treturn this;\n\t}", "public String getFormat() {\n/* 206 */ return getValue(\"format\");\n/* */ }", "public interface Format {\n public static final String PATTERN_DATE = \"yyyy-MM-dd\";\n public static final String PATTERN_DATE_YEAR = \"yyyy\";\n}", "public String getFormat() {\n\t\treturn format;\n\t}", "public String getFormat() {\n return format;\n }", "public String getFormat() {\n return format;\n }", "public String getFormat() {\n return format;\n }", "public String getFormat()\n {\n return format;\n }", "public void setMarshalDateFormat (String format) {\n\t\tthis.outFormat = format;\n }", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "public void setDataFormat(String dataFormat) {\n this.dataFormat = dataFormat;\n }", "@Override\n\tpublic String[] getFormats() {\n\t\treturn new String[] {\"yyyy-MM-dd'T'HH:mm:ss\",\"yyyy-MM-dd HH:mm:ss\",\"yyyy-MM-dd HH:mm\",\"yyyy-MM-dd'T'HH:mm\",\"yyyy-MM-dd HH\", \"yyyy-MM-dd\" };\n\t}", "public String getFormat() {\r\n return _format;\r\n }", "public void setDataFormatPattern(String dataFormatPattern) {\r\n this.dataFormatPattern = dataFormatPattern;\r\n }", "Format internalSetFormat(Format format)\n {\n return doSetFormat(format);\n }", "public void setFormat(String value) \r\n\t{\r\n\t\tformatString = value;\r\n\t}", "String getFormatter();", "private ARXInteger(String format){\r\n if (format == null || format.equals(\"Default\")){\r\n this.format = null;\r\n this.string = null; \r\n this.locale = null;\r\n } else {\r\n this.format = new DecimalFormat(format);\r\n this.string = format;\r\n this.locale = null;\r\n }\r\n }", "void format();", "private Formats() {\n }", "public final void setFormat(AdFormat format) {\n\t\timpl.setFormat(format);\n }", "protected abstract String format();", "public interface InputFormat {\n /**\n * Return a FileFilter that can be used to identify files which can be restored\n * with this Storage Format. Typically, each input format has its own \n * recognizable file naming convention.\n *\n * @return FileFilter to be used with a javax.swing.JFileChooser\n */\n public javax.swing.filechooser.FileFilter getFileFilter();\n \n /**\n * Return a JFileChooser accessory that can be used to customize the input\n * format.\n *\n * @return A JFileChooser accessory to be used with a javax.swing.JFileChooser\n * Returns null, if no accessory is provided for this format.\n */\n public JComponent getInputFormatAccessory();\n \n /**\n * Reads figures from a file and replaces the children of the drawing\n * with them.\n * <p>\n * This is a convenience method for calling read(File,Drawing,true).\n *\n * @param file The file.\n * @param drawing The drawing.\n */\n public void read(File file, Drawing drawing) throws IOException;\n \n /**\n * Reads figures from a file and adds them to the specified drawing.\n *\n * @param file The file.\n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the file replaces the\n * contents of the drawing (for example, when loading a drawing from a file).\n * Set this to false, to add the contents of the file to the drawing (for\n * example, when the file has been dropped into the drawing view).\n */\n public void read(File file, Drawing drawing, boolean replace) throws IOException;\n\n /**\n * Reads figures from a file and adds them to the specified drawing.\n *\n * @param in The input stream.\n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the stream replaces the\n * contents of the drawing (for example, when loading a drawing from a stream).\n * Set this to false, to add the contents of the file to the drawing (for\n * example, when the stream has been dropped into the drawing view).\n */\n public void read(InputStream in, Drawing drawing, boolean replace) throws IOException;\n\n /**\n * Returns true, if this InputFormat can readFigures TransferData using the \n * specified DataFlavor.\n * \n * @param flavor A DataFlavor.\n */\n public boolean isDataFlavorSupported(DataFlavor flavor);\n \n /**\n * Reads figures from the specified Transferable and adds them to the\n * specified drawing.\n * \n * @param t The Transferable. \n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the transferable\n * replaces the contents of the drawing (for example, when loading a drawing\n * from a transferable). Set this to false, to add the contents of the \n * transferable to the drawing (for example, when the transferable has been\n * dropped or pasted into the drawing view).\n */\n public void read(Transferable t, Drawing drawing, boolean replace) throws UnsupportedFlavorException, IOException;\n}", "public String getFormat() {\n return this.format;\n }", "@Override\n public Format setOutputFormat(Format format)\n {\n Format outputFormat = super.setOutputFormat(format);\n \n if (logger.isDebugEnabled() && (outputFormat != null))\n logger.debug(\"SwScaler set to output in \" + outputFormat);\n return outputFormat;\n }", "@UML(identifier=\"fileFormat\", obligation=MANDATORY, specification=ISO_19139)\n Format getFileFormat();", "public Dataset withFormat(InputFormat format) {\n this.format = format.toString();\n return this;\n }", "public void setFormat(RMFormat aFormat)\n{\n // Add format to first binding\n if((aFormat==null || aFormat instanceof java.text.Format) && getBindingCount()>0)\n getBinding(0).setFormat((java.text.Format)aFormat);\n \n // Pass down to children\n for(int i=0, iMax=getChildCount(); i<iMax; i++)\n getChild(i).setFormat(aFormat);\n}", "public void setInputFormatOptions(InputFormatOptions inputFormatOptions) {\n this.inputFormatOptions = inputFormatOptions;\n }", "public interface FormatConverter {\n\n /**\n * Returns the tool's executable full path.\n * \n * @return\n */\n public String getExecutable();\n\n /**\n * Sets the tool's executable full path.\n * \n * @param executable\n */\n public void setExecutable(String executable);\n\n /**\n * Returns the environment variables that are set prior to invoking the tool's executable.\n * \n * @return\n */\n public Map<String, String> getEnvironment();\n\n /**\n * Provides the environment variables that are set prior to invoking the tool's executable.\n * \n * @return\n */\n public void setEnvironment(Map<String, String> environment);\n\n /**\n * Adds an output format among the supported ones.\n * \n * @param format\n */\n public void addFormat(Format format);\n\n /**\n * Get a list of supported output formats.\n *\n * @return\n */\n public List<Format> getFormats();\n\n /**\n * Programmatically removes all formats.\n */\n public void clearFormats();\n\n /**\n * Replaces currently supported formats with the provided list.\n * \n * @param formats\n */\n public void replaceFormats(List<Format> formats);\n\n}", "public RuleBasedNumberFormat(int format)\n/* */ {\n/* 822 */ this(ULocale.getDefault(ULocale.Category.FORMAT), format);\n/* */ }", "@Override\r\n\tpublic String getFormat() {\r\n\t\treturn \"java\";\r\n\t}", "public void setFormatOptions(FormatOptions formatOptions) {\n this.formatOptions = formatOptions;\n }", "public abstract void setImageFormat(String format);", "private static String determineOutputFormat(CommandLine optionLine)\n {\n String format = optionLine.getOptionValue(Environment.FORMAT);\n if (StringUtils.isEmpty(format)) {\n format = \"TTL\"; //$NON-NLS-1$ - by default\n }\n return format;\n }", "public APIFormat(AS400 system, String name) {\r\n\r\n this.system = system;\r\n this.name = name;\r\n this.length = -1;\r\n this.fields = null;\r\n\r\n this.int4Conv = null;\r\n this.charConv = null;\r\n this.dateTimeConv = null;\r\n\r\n this.offset = 0;\r\n }", "@Override\r\n\tpublic void setAudioFormat(AudioFormat format) {\r\n\r\n\t}", "public abstract String getOutputFormat();", "String getOutputFormat();", "String documentFormat();", "private String inFormat() {\n File f = cfg.getReadFromFile();\n if (f != null) {\n return \" in format file \" + f.getPath();\n }\n return \" in format \" + StringUtils.defaultString(cfg.getName(), \"(unnamed)\");\n }", "public void mo1606a(Format format) {\n }", "String getValueFormat();", "public static void setTheirDefaultFormat(Format fmt)\n {\n theirDefaultFormat = (Format) fmt.clone();\n }", "private FormatUtilities() {}", "public void setFormat(final NumberFormat f) {\r\n format = f;\r\n }", "public FormatException() {\n\t\tsuper(\"This value is not within the standard.\");\n\t}", "public void setFormat(String format) {\n\t\tString contents = getText().trim();\n\t\tdouble value = 0;\n\t\tif (contents.length() != 0) {\n\t\t\ttry {\n\t\t\t\tvalue = parser.parse(contents).doubleValue();\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tthrow new ErrorException(ex);\n\t\t\t}\n\t\t}\n\t\tformatString = format;\n\t\tif (format == null) {\n\t\t\tformatter = null;\n\t\t\tparser = NumberFormat.getNumberInstance(Locale.US);\n\t\t} else {\n\t\t\tformatter = (format.length() == 0) ? new DecimalFormat() : new DecimalFormat(format);\n\t\t\tparser = formatter;\n\t\t}\n\t\tif (contents.length() != 0) {\n\t\t\tsetValue(value);\n\t\t}\n\t}", "protected String getDataFormat() {\n return this.dataFormat;\n }", "public BioFormatsFormat() {\n\t\tcacheReaderClasses();\n\t}", "public Format setOutputFormat(Format output) {\n outputFormat = output;\n return output;\n }", "public String getFormat() {\n\t\treturn formatString;\n\t}", "@VTID(8)\r\n java.lang.String format();", "public abstract void format(Job job, Order order, Object formatConfig) throws Exception;", "void setFormat(ImageFormat format);", "@Override\n\tpublic String getFormat() {\n\t\treturn \"xml\";\n\t}", "public final void mT__215() throws RecognitionException {\n try {\n int _type = T__215;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:213:8: ( 'format' )\n // InternalMyDsl.g:213:10: 'format'\n {\n match(\"format\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\n protected void accept(ParameterVisitor visitor, Object value) {\n if (FormatType.INTEGRAL.canFormat(value)) {\n visitor.visit(value, FormatChar.DECIMAL, WITH_GROUPING);\n } else if (FormatType.FLOAT.canFormat(value)) {\n // Technically floating point formatting via {0} differs from \"%,f\", but as \"%,f\" results in\n // more precision it seems better to mimic \"%,f\" rather than discard both precision and type\n // information by calling visitPreformatted().\n visitor.visit(value, FormatChar.FLOAT, WITH_GROUPING);\n } else if (value instanceof Date) {\n // MessageFormat is not thread safe, so we always clone().\n String formatted = ((MessageFormat) prototypeMessageFormatter.clone())\n .format(new Object[] {value}, new StringBuffer(), null /* field position */)\n .toString();\n visitor.visitPreformatted(value, formatted);\n } else if (value instanceof Calendar) {\n visitor.visitDateTime(value, DateTimeFormat.DATETIME_FULL, getFormatOptions());\n } else {\n visitor.visit(value, FormatChar.STRING, getFormatOptions());\n }\n }", "public NotesFormatException(String msg) {\n\t\tsuper(msg);\n\t}", "FormatSpecifier(final String[] sa) {\n this.sa = sa;\n }", "@Test\n\tpublic void testFormats() throws IOException {\n\t\tassertArrayEquals(Formats.FORMATS, ffmpeg.formats().toArray());\n\t\tassertArrayEquals(Formats.FORMATS, ffmpeg.formats().toArray());\n\n\t\tverify(runFunc, times(1)).run(argThatHasItem(\"-formats\"));\n\t}", "public void m7902a(int format) {\n this.f6691d = format;\n }", "private void readInputFormat(ConfigLinkedDocument ld, Entry<String, JsonNode> e) {\n String formatIdentifier = str(e);\n Format format = DocumentFormats.getFormat(formatIdentifier);\n if (format == null)\n throw new InvalidInputFormatConfig(\n \"Unknown input format \" + str(e) + \" in linked document \" + ld.getName());\n\n ld.setInputFormatIdentifier(formatIdentifier);\n }", "public boolean isFormat() {\n\t\treturn isFormat;\n\t}", "public void set_standard_format () {\n\t\tf_friendly_format = false;\n\n\t\tmainshock_time = 0L;\n\t\tmainshock_mag = 0.0;\n\t\tmainshock_lat = 0.0;\n\t\tmainshock_lon = 0.0;\n\t\tmainshock_depth = 0.0;\n\n\t\treturn;\n\t}" ]
[ "0.7195159", "0.71007264", "0.69381726", "0.6763659", "0.6761371", "0.6755823", "0.6672973", "0.6672973", "0.6672973", "0.6447498", "0.6439505", "0.64268", "0.6379911", "0.6332558", "0.6304386", "0.6296369", "0.62461793", "0.6225704", "0.6188643", "0.6188643", "0.6188643", "0.61530125", "0.6124798", "0.6113378", "0.61117196", "0.60669273", "0.6021993", "0.60218716", "0.59875077", "0.59636486", "0.5955578", "0.5938138", "0.5877359", "0.58333206", "0.58305025", "0.5826655", "0.5809693", "0.58009624", "0.5790291", "0.5785882", "0.5785882", "0.5785882", "0.5779728", "0.5773829", "0.57567555", "0.57384473", "0.5731004", "0.5729956", "0.56894404", "0.56879413", "0.56780887", "0.56736374", "0.5645478", "0.5644962", "0.56371224", "0.5636462", "0.56296206", "0.5625752", "0.5619462", "0.5617467", "0.5615698", "0.560627", "0.55957514", "0.55882597", "0.5577915", "0.55643606", "0.5540566", "0.55378705", "0.5527279", "0.5522093", "0.552121", "0.5518416", "0.55172133", "0.55118376", "0.55118036", "0.5505569", "0.54887235", "0.5478684", "0.5471188", "0.5462787", "0.54580265", "0.5457971", "0.5453738", "0.5427278", "0.54245824", "0.5422481", "0.541809", "0.5416648", "0.5404269", "0.5403981", "0.5403399", "0.5395783", "0.53957415", "0.5388078", "0.5376628", "0.53577036", "0.5356316", "0.53485113", "0.53457594", "0.5341793" ]
0.53508586
97
Deprecated, use the appropriate &x60;pipeline&x60; version. Specify a specific verison of PrinceXML to use.
@javax.annotation.Nullable @ApiModelProperty(value = "Deprecated, use the appropriate `pipeline` version. Specify a specific verison of PrinceXML to use.") @JsonProperty(JSON_PROPERTY_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getVersion() { return version; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String getXalanVersion(Class procVersion) {\n try {\n Field f = procVersion.getField(\"S_VERSION\");\n return f.get(null).toString();\n } catch (Exception e){\n return \"?\";\n }\n }", "@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property String getXmlVersion();", "public void setJiveXmlVersion(String value) {\r\n ImportJive.addMessage(\"Jive XML version = \\\"\" + value + \"\\\"\");\r\n }", "public SxpLegacy(Version sxpVersion) {\n this.sxpVersion = sxpVersion;\n }", "public void setXpeContractVersion(String value) {\n setAttributeInternal(XPECONTRACTVERSION, value);\n }", "void xsetApplicationVersion(com.microsoft.schemas.office.x2006.digsig.STVersion applicationVersion);", "@Override\n public int getVersion() {\n return 4;\n }", "@Override\n public String getXmlVersion() {\n return mXml11 ? XmlConsts.XML_V_11_STR : XmlConsts.XML_V_10_STR;\n }", "private void ensureStreamVersion() throws UnsupportedOperationException {\n if (streamVersion != 1 && streamVersion != 3) {\n throw new UnsupportedOperationException(\"Unsupported stream version \" + streamVersion);\n }\n }", "public void setVersion(String version)\n {\n this.ver = version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "@Override\n public int getMajorVersion() {\n return 2;\n }", "public XMLDocument (double version, boolean standalone)\r\n\t{\r\n\t\tprolog = new Vector<Object> (2);\r\n\t\tStringBuffer versionStr = new StringBuffer ();\r\n\t\tversionStr.append (\"<?xml version=\\\"\");\r\n\t\tversionStr.append (version);\r\n\t\tversionStr.append (\"\\\" standalone=\\\"\");\r\n\t\tif (standalone)\r\n\t\t\tversionStr.append (\"yes\\\"?>\");\r\n\t\telse\r\n\t\t\tversionStr.append (\"no\\\"?>\\n\");\r\n\t\tthis.versionDecl = versionStr.toString ();\r\n\t\t/**\r\n * FIXME: ECS currently does not do any ordering of attributes. Although\r\n * about 99% of the time, this has no problems, in the initial XML\r\n * declaration, it can be a problem in certain frameworks (e.g.\r\n * Cocoon/Xerces/Xalan). So instead of adding an element here, we have\r\n * to store this first command in a String and add it to the output at\r\n * output time.\r\n */\r\n\t\t/**\r\n * PI versionDecl = new PI().setTarget(\"xml\"); if (standalone)\r\n * versionDecl.addInstruction(\"standalone\", \"yes\"); else\r\n * versionDecl.addInstruction(\"standalone\", \"no\");\r\n * versionDecl.setVersion(version); prolog.addElement(versionDecl);\r\n */\r\n\t}", "public void setVersion(String version);", "public void setVersion(String version){\r\n this.version = version;\r\n }", "public void setVersion(String componentVersion1) {\n this.version = componentVersion1;\n }", "public XMLDocument (double version)\r\n\t{\r\n\t\tthis (version, true);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "private static String removeJavaVersion(String javaVersion, String xml) {\n String versionPrefix = \"<!--Version \";\n int javaLocation = xml.indexOf(versionPrefix + javaVersion);\n if (javaLocation == -1) {\n fail(\"could not find Java version string in xml '\" + xml + \"'\");\n }\n return xml.replace(versionPrefix + javaVersion, versionPrefix + \"X.Y.Z\");\n }", "public void setReleaseVersion(String version) {\r\n\t\tthis.version = version;\r\n\t}", "@Override\r\n\tpublic void setVersion(int version) {\n\r\n\t}", "public void setVer(Integer ver) {\n this.ver = ver;\n }", "public Document getLatestVersion(boolean major) {\n throw new UnsupportedOperationException();\n }", "public void setIsProVersion(Boolean IsProVersion) {\n this.IsProVersion = IsProVersion;\n }", "@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property void setXmlStandalone(boolean xmlStandalone);", "@Override\n public int getVersion() {\n return 3;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "int getGvlSpecificationVersion();", "protected static Protocol getPrimerDesignProtocol(final ReadableVersion version) {\n\n Protocol protocol = null;\n if (ConstructBeanWriter.PrimerDesignProtocolHook != null) {\n protocol = version.get(ConstructBeanWriter.PrimerDesignProtocolHook);\n }\n\n if (protocol != null) {\n if (protocol.getName().equalsIgnoreCase(ExperimentUtility.SPOTCONSTRUCT_DESIGN_PROTOCOL)\n || protocol.getName().equalsIgnoreCase(ExperimentUtility.OPPFCONSTRUCT_DESIGN_PROTOCOL)) {\n return protocol;\n }\n }\n\n final Map<String, Object> m = new HashMap<String, Object>();\n m.put(\"name\", ExperimentUtility.SPOTCONSTRUCT_DESIGN_PROTOCOL);\n protocol = version.findFirst(Protocol.class, m);\n if (null == protocol) {\n m.put(\"name\", ExperimentUtility.SPOTCONSTRUCT_DESIGN_OLD);\n protocol = version.findFirst(Protocol.class, m);\n }\n\n assert null != protocol : \"Could not find SPOT Construct Primer Design protocol\";\n ConstructBeanWriter.PrimerDesignProtocolHook = protocol.get_Hook();\n return protocol;\n }", "void xsetOfficeVersion(com.microsoft.schemas.office.x2006.digsig.STVersion officeVersion);", "@Override\n public int getEffectiveMajorVersion() {\n return 0;\n }", "@Override\n public void onNoNewVersionDetected() {\n\n }", "public void xsetVersion(org.apache.xmlbeans.XmlInteger version)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlInteger target = null;\r\n target = (org.apache.xmlbeans.XmlInteger)get_store().find_element_user(VERSION$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlInteger)get_store().add_element_user(VERSION$6);\r\n }\r\n target.set(version);\r\n }\r\n }", "public void setVersion(String version) {\r\n\t\tthis.version = version;\r\n\t}", "public void setVer(Integer ver) {\n\t\tthis.ver = ver;\n\t}", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "@CompositeValue(ignore=true)\n @XmlAttribute(name=\"version\")\n public void setVersion(Version version)\n {\n versionRange = new VersionRange(version, true, version, true);\n }", "@Override\n\tpublic int getMajorVersion() {\n\t\treturn 0;\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n\t\tthis.version = version;\n\t}", "@Override\r\n\tpublic String getVersion() {\r\n\t\treturn \"1.0.5\";\r\n\t}", "@Override\n public SourceVersion getSupportedSourceVersion() {\n\tSourceVersion cversion = super.getSupportedSourceVersion();\n\tSourceVersion version = SourceVersion.latest();\n\treturn (cversion.ordinal() > version.ordinal())? cversion: version;\n }", "@Test\n\tpublic void testReasonerVersionOld() throws Exception {\n\t\tIPRProof proof1 = prRoot.createChild(IPRProof.ELEMENT_TYPE, null, null);\n\n\t\tfinal IProofTree proofTree = makeVersionProof(OLD_VERSION, IConfidence.DISCHARGED_MAX);\n\t\tfinal IProofTree expectedDeserialized = makeVersionProof(OLD_VERSION, IConfidence.UNCERTAIN_MAX);\n\t\tcheckProofTreeSerialization(proof1, proofTree, expectedDeserialized, true);\n\t\t// check stability for deserialized proof tree\n\t\tcheckProofTreeSerialization(proof1, expectedDeserialized, true);\n\t}", "void setVersion(String version);", "void setVersion(String version);", "public String getRequiredVersion() {\n/* 152 */ return this.jspversion;\n/* */ }", "public XWikiPatch setFullVersion(String versionXml) throws XWikiException\n {\n setContent(versionXml);\n setDiff(false);\n return this;\n }", "public void setVersion(java.lang.String version) {\r\n this.version = version;\r\n }", "public void setXpeDccContractVersion(XpeDccContractVersionImpl value) {\n setAttributeInternal(XPEDCCCONTRACTVERSION, value);\n }", "public void setVersion(java.math.BigInteger version)\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_element_user(VERSION$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(VERSION$6);\r\n }\r\n target.setBigIntegerValue(version);\r\n }\r\n }", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public boolean hasOldVersionNumber() {\n return (getVersionNumber() < CURRENT_VERSION_NO);\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "@Override\n public int getVersion() {\n return 0;\n }", "String ramlVersion();", "@Override\n\tpublic void setCheckOlderVersion(boolean paramBoolean)\n\t{\n\n\t}", "public void setVersion(int version)\n\t{\n\t\tconferenceInfo.setAttribute(VERSION_ATTR_NAME, Integer.toString(version));\n\t}", "@Deprecated\n\tprivate void oldCode()\n\t{\n\t}", "@Override\n\tpublic void setVersion(java.lang.String version) {\n\t\t_scienceApp.setVersion(version);\n\t}", "@Override\n public void checkVersion() {\n }", "public void setVersionsSupported(String versionsSupported);", "public String getVersion() {\r\n return (\"2004.09\");\r\n }", "public void setVersion(Integer version) {\r\n this.version = version;\r\n }", "public Boolean getIsProVersion() {\n return this.IsProVersion;\n }", "public void setVersion( Integer version ) {\n this.version = version;\n }", "public void setVerCode(Integer verCode) {\n this.verCode = verCode;\n }", "public String getProductVersion();", "public int getVersion() { return 1; }", "private boolean isBadVersion(int version) {\n return false;\n }", "private void setVersionNumber(int version) {\n versionNumber = version;\n }", "@Override\n\tprotected ExchangeVersion getMinimumRequiredServerVersion() {\n\t\treturn ExchangeVersion.Exchange2007_SP1;\n\t}", "@Override\n\tprotected ExchangeVersion getMinimumRequiredServerVersion() {\n\t\treturn ExchangeVersion.Exchange2007_SP1;\n\t}", "void setVersion(long version);", "@Override\n public int getMinorVersion() {\n return 0;\n }", "@Override\n\tpublic OperatorVersion[] getIncompatibleVersionChanges() {\n\t\treturn ExpressionParserUtils.addIncompatibleExpressionParserChange(super.getIncompatibleVersionChanges());\n\t}", "public static SemVer from(int major) {\n return from(major, 0, 0);\n }", "public String getXpeContractVersion() {\n return (String) getAttributeInternal(XPECONTRACTVERSION);\n }", "public String getXpeContractVersion() {\n return (String) getAttributeInternal(XPECONTRACTVERSION);\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "@Override()\n public String getToolVersion()\n {\n return Version.NUMERIC_VERSION_STRING;\n }", "boolean isBadVersion(int version) {\n return true;\n }", "public void reportVersion(final Lexer lexer) {\n \tif (lexer.givenDoctype != null) {\n \t\tsimpleMessage(DOCTYPE_GIVEN_SUMMARY.code(), lexer, Level.INFO, \"doctype_given\",\n lexer.givenDoctype);\n \t}\n \tif (!lexer.configuration.isXmlTags()) {\n \t\tfinal int apparentVers = lexer.apparentVersion();\n \t\tfinal String vers = Lexer.getNameFromVers(apparentVers);\n \t\t\n simpleMessage(REPORT_VERSION_SUMMARY.code(), lexer, Level.INFO, \"report_version\", \n \t\t\t (vers != null ? vers : \"HTML Proprietary\"));\n if (lexer.warnMissingSIInEmittedDocType()) {\n \tsimpleMessage(-1, lexer, Level.INFO, \"no_si\");\n }\n \t}\n }", "public void setVersion(Integer version) {\n\t\tthis.version = version;\n\t}", "@Override\n\tpublic void createRelease(Version version) {\n\n\t}", "void setOfficeVersion(java.lang.String officeVersion);", "public final void setVersion(String version) {\n this.version = version;\n }", "@Override\r\n public void setPreNexPlayerVideoRendererListener(NexPlayer.IVideoRendererListener preNexPlayerVideoRendererListener) {\r\n this.preNexPlayerVideoRendererListener = preNexPlayerVideoRendererListener;\r\n }", "private void testProXml(){\n\t}", "public static boolean has14() {\n return getVersion() >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;\n }" ]
[ "0.5898972", "0.52585316", "0.4979957", "0.49605083", "0.48908937", "0.48610064", "0.47646415", "0.47617352", "0.47565785", "0.473555", "0.4719599", "0.4711667", "0.4644956", "0.46237692", "0.46077323", "0.4578172", "0.45560145", "0.45532066", "0.45462832", "0.45445487", "0.4538193", "0.45359123", "0.45331305", "0.45325184", "0.45259258", "0.4509019", "0.4504795", "0.4504795", "0.4499973", "0.44894746", "0.44861913", "0.44727215", "0.44634104", "0.4460026", "0.44594273", "0.44489077", "0.44397533", "0.44372332", "0.44372332", "0.4436574", "0.44239885", "0.4404351", "0.4404351", "0.4404351", "0.4400309", "0.4389437", "0.43808922", "0.43597883", "0.43556902", "0.43556902", "0.4351986", "0.43473", "0.4330395", "0.43297222", "0.43280992", "0.4326406", "0.43210512", "0.4320716", "0.43043923", "0.42991143", "0.42894205", "0.42886734", "0.4279664", "0.42754942", "0.42625704", "0.42547008", "0.4250803", "0.4249457", "0.42459694", "0.4245515", "0.42410225", "0.4240516", "0.42379236", "0.42308077", "0.42266247", "0.42237565", "0.4219949", "0.4219949", "0.42197844", "0.42167613", "0.42147645", "0.42109194", "0.42054662", "0.42054662", "0.42010778", "0.42010778", "0.42010778", "0.42010778", "0.42010778", "0.42010778", "0.42004886", "0.42000192", "0.41872612", "0.41852516", "0.41852188", "0.41807616", "0.41778657", "0.41638932", "0.41602618", "0.41567346" ]
0.646872
0
Enable PrinceXML JavaScript. DocRaptor JavaScript parsing is also available elsewhere.
@javax.annotation.Nullable @ApiModelProperty(value = "Enable PrinceXML JavaScript. DocRaptor JavaScript parsing is also available elsewhere.") @JsonProperty(JSON_PROPERTY_JAVASCRIPT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getJavascript() { return javascript; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void Javascript() {\n\n\t}", "public LagartoDOMBuilder enableXmlMode() {\n\t\tconfig.ignoreWhitespacesBetweenTags = true; // ignore whitespaces that are non content\n\t\tconfig.parserConfig.setCaseSensitive(true); // XML is case sensitive\n\t\tconfig.parserConfig.setEnableRawTextModes(false); // all tags are parsed in the same way\n\t\tconfig.enabledVoidTags = false; // there are no void tags\n\t\tconfig.selfCloseVoidTags = false; // don't self close empty tags (can be changed!)\n\t\tconfig.impliedEndTags = false; // no implied tag ends\n\t\tconfig.parserConfig.setEnableConditionalComments(false); // disable IE conditional comments\n\t\tconfig.parserConfig.setParseXmlTags(true); // enable XML mode in parsing\n\t\treturn this;\n\t}", "public void setRetireJsAnalyzerEnabled(boolean retireJsAnalyzerEnabled) {\n this.retireJsAnalyzerEnabled = retireJsAnalyzerEnabled;\n }", "@Override\n protected boolean isRenderScriptEnable() {\n return true;\n }", "@DOMSupport(DomLevel.ONE)\r\n@JsMetatype\r\npublic interface Document extends Node {\r\n\t\r\n\r\n\t/**\r\n\t * This is a convenience attribute that allows direct access to the child \r\n\t * node that is the document element of the document.\r\n\t */\r\n\t@Property Element getDocumentElement();\r\n\t\r\n\t/**\r\n\t * An attribute specifying the encoding used for this document at the time of the parsing. \r\n\t * This is null when it is not known, such as when the Document was created in memory.\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@Property String getInputEncoding();\r\n\r\n\t/**\r\n\t * An attribute specifying, as part of the XML declaration, \r\n\t * the encoding of this document. This is null when unspecified or when it is not known, \r\n\t * such as when the Document was created in memory.\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property String getXmlEncoding();\r\n\r\n\t/**\r\n\t * An attribute specifying, as part of the XML declaration, whether this document is standalone. \r\n\t * This is false when unspecified.\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property boolean getXmlStandalone();\r\n\t\r\n\t/**\r\n\t * An attribute specifying, as part of the XML declaration, whether this document is standalone.\r\n\t * @param xmlStandalone\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property void setXmlStandalone(boolean xmlStandalone);\r\n\r\n\t/**\r\n\t * An attribute specifying, as part of the XML declaration, the version number of this document. \r\n\t * If there is no declaration and if this document supports the \"XML\" feature, the value is \"1.0\". \r\n\t * If this document does not support the \"XML\" feature, the value is always null. \r\n\t * Changing this attribute will affect methods that check for invalid characters in XML names. \r\n\t * Application should invoke Document.normalizeDocument() in order to check for invalid characters \r\n\t * in the Nodes that are already part of this Document. \r\n\t * DOM applications may use the DOMImplementation.hasFeature(feature, version) method with \r\n\t * parameter values \"XMLVersion\" and \"1.0\" (respectively) to determine if an implementation \r\n\t * supports [XML 1.0]. DOM applications may use the same method with parameter values \"XMLVersion\" \r\n\t * and \"1.1\" (respectively) to determine if an implementation supports [XML 1.1]. \r\n\t * In both cases, in order to support XML, an implementation must also support the \"XML\" feature \r\n\t * defined in this specification. Document objects supporting a version of the \"XMLVersion\" feature \r\n\t * must not raise a NOT_SUPPORTED_ERR exception for the same version number when using \r\n\t * Document.xmlVersion. \r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property String getXmlVersion();\r\n\t\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property void setXmlVersion(String xmlVersion);\r\n\r\n\t/**\r\n\t * An attribute specifying whether error checking is enforced or not. \r\n\t * When set to false, the implementation is free to not test every possible error case normally \r\n\t * defined on DOM operations, and not raise any DOMException on DOM operations or report errors \r\n\t * while using Document.normalizeDocument(). In case of error, the behavior is undefined. \r\n\t * This attribute is true by default.\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property boolean getStrictErrorChecking();\r\n\t\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property void setStrictErrorChecking(boolean strictErrorChecking);\r\n\r\n\t/**\r\n\t * The location of the document or null if undefined or if the Document was created using \r\n\t * DOMImplementation.createDocument. No lexical checking is performed when setting this attribute; \r\n\t * this could result in a null value returned when using Node.baseURI. \r\n\t * Beware that when the Document supports the feature \"HTML\" [DOM Level 2 HTML], \r\n\t * the href attribute of the HTML BASE element takes precedence over this attribute \r\n\t * when computing Node.baseURI. \r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@Property String getDocumentURI();\r\n\t@DOMSupport( DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n\t@Property void setDocumentURI(String documentURI);\r\n \r\n\t/**\r\n\t * The configuration used when Document.normalizeDocument() is invoked. \r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport(BrowserType.UNDEFINED)\r\n\t@Property DOMConfiguration getDomConfig();\r\n\t\r\n\t /**\r\n * The Document Type Declaration (see DocumentType) associated with this document. \r\n * For XML documents without a document type declaration this returns null. For HTML documents, \r\n * a DocumentType object may be returned, independently of the presence or absence of document type \r\n * declaration in the HTML document. This provides direct access to the DocumentType node, \r\n * child node of this Document. This node can be set at document creation time and later changed \r\n * through the use of child nodes manipulation methods, such as Node.insertBefore, \r\n * or Node.replaceChild. Note, however, that while some implementations may instantiate \r\n * different types of Document objects supporting additional features than the \"Core\", \r\n * such as \"HTML\" [DOM Level 2 HTML], based on the DocumentType specified at creation time, \r\n * changing it afterwards is very unlikely to result in a change of the features supported.\r\n * @return\r\n * @since DOM Level 3\r\n */\r\n @DOMSupport(DomLevel.THREE)\r\n @Property DocumentType getDoctype();\r\n \r\n\t/**\r\n\t * The DOMImplementation object that handles this document. \r\n\t * A DOM application may use objects from multiple implementations.\r\n\t */\r\n @Property DOMImplementation getImplementation();\r\n\r\n\t/**\r\n\t * Creates an element of the type specified. Note that the instance \r\n\t * returned implements the <code>Element</code> interface, so attributes \r\n\t * can be specified directly on the returned object.\r\n\t * <br>In addition, if there are known attributes with default values, \r\n\t * <code>Attr</code> nodes representing them are automatically created \r\n\t * and attached to the element.\r\n\t * <br>To create an element with a qualified name and namespace URI, use \r\n\t * the <code>createElementNS</code> method.\r\n\t * @param tagName The name of the element type to instantiate. For XML, \r\n\t * this is case-sensitive, otherwise it depends on the \r\n\t * case-sensitivity of the markup language in use. In that case, the \r\n\t * name is mapped to the canonical form of that markup by the DOM \r\n\t * implementation.\r\n\t * @return A new <code>Element</code> object with the \r\n\t * <code>nodeName</code> attribute set to <code>tagName</code>, and \r\n\t * <code>localName</code>, <code>prefix</code>, and \r\n\t * <code>namespaceURI</code> set to <code>null</code>.\r\n\t * @exception DOMException\r\n\t * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML \r\n\t * name according to the XML version in use specified in the \r\n\t * <code>Document.xmlVersion</code> attribute.\r\n\t */\r\n @FactoryFunc\r\n\t@Function Element createElement(String tagName);\r\n\r\n\t/**\r\n\t * Creates a <code>Text</code> node given the specified string.\r\n\t * @param data The data for the node.\r\n\t * @return The new <code>Text</code> object.\r\n\t */\r\n\t@Function Text createTextNode(String data);\r\n\r\n\t/**\r\n\t * Returns a <code>NodeList</code> of all the <code>Elements</code> in \r\n\t * document order with a given tag name and are contained in the \r\n\t * document.\r\n\t * @param tagname The name of the tag to match on. The special value \"*\" \r\n\t * matches all tags. For XML, the <code>tagname</code> parameter is \r\n\t * case-sensitive, otherwise it depends on the case-sensitivity of the \r\n\t * markup language in use. \r\n\t * @return A new <code>NodeList</code> object containing all the matched \r\n\t * <code>Elements</code>.\r\n\t */\r\n\t@FactoryFunc\r\n @JsArray(Node.class)\r\n\t@Function NodeList getElementsByTagName(String tagname);\r\n\t\r\n @BrowserSupport({BrowserType.NONE})\r\n @ARename(name = \"getElementsByTagName\")\r\n @JstExclude\r\n @Function NodeList byTag(String tagName);\r\n\r\n\t/**\r\n\t * Imports a node from another document to this document, without altering \r\n\t * or removing the source node from the original document; this method \r\n\t * creates a new copy of the source node. The returned node has no \r\n\t * parent; (<code>parentNode</code> is <code>null</code>).\r\n\t */\r\n @DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_1P, BrowserType.OPERA_7P})\r\n @Function Node importNode(Node importedNode, boolean deep);\r\n\r\n\t/**\r\n\t * Returns the <code>Element</code> that has an ID attribute with the \r\n\t * given value. If no such element exists, this returns <code>null</code>\r\n\t * . If more than one element has an ID attribute with that value, what \r\n\t * is returned is undefined. \r\n\t * <br> The DOM implementation is expected to use the attribute \r\n\t * <code>Attr.isId</code> to determine if an attribute is of type ID. \r\n\t * <p ><b>Note:</b> Attributes with the name \"ID\" or \"id\" are not of type \r\n\t * ID unless so defined.\r\n\t * @param elementId The unique <code>id</code> value for an element.\r\n\t * @return The matching element or <code>null</code> if there is none.\r\n\t * @since DOM Level 2\r\n\t */\r\n @DOMSupport(DomLevel.TWO)\r\n @Function Element getElementById(String elementId);\r\n \r\n @BrowserSupport({BrowserType.NONE})\r\n @ARename(name = \"getElementById\")\r\n @JstExclude\r\n @Function Element byId(String elementId);\r\n\r\n \r\n\t/**\r\n\t * Creates an Attr of the given name. Note that the Attr instance can then be set on an Element \r\n\t * using the setAttributeNode method. To create an attribute with a qualified name and namespace URI, \r\n\t * use the createAttributeNS method.\r\n\t * @param name\r\n\t * @return\r\n\t */\r\n @Function Attr createAttribute(String name);\r\n \r\n\t/**\r\n\t * Creates an element of the given qualified name and namespace URI. Per [XML Namespaces], \r\n\t * applications must use the value null as the namespaceURI parameter for methods \r\n\t * if they wish to have no namespace.\r\n\t * @param namespaceURI\r\n\t * @param qualifiedName\r\n\t * @return\r\n\t * @since DOM Level 2\r\n\t */\r\n @DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n @Function Element createElementNS(String namespaceURI, String qualifiedName);\r\n \r\n\t/**\r\n\t * Creates an attribute of the given qualified name and namespace URI. Per [XML Namespaces], \r\n\t * applications must use the value null as the namespaceURI parameter for methods \r\n\t * if they wish to have no namespace.\r\n\t * @param namespaceURI\r\n\t * @param qualifiedName\r\n\t * @return\r\n\t * @since DOM Level 2\r\n\t */\r\n @DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n\t@Function Attr createAttributeNS(String namespaceURI, String qualifiedName);\r\n\r\n\t/**\r\n\t * Returns a NodeList of all the Elements with a given local name and namespace URI in document order.\r\n\t * @param namespaceURI\r\n\t * @param localName\r\n\t * @return\r\n\t * @since DOM Level 2\r\n\t */\r\n\t@DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P, BrowserType.IE_9P})\r\n @JsArray(Node.class)\r\n @FactoryFunc\r\n\t@Function NodeList getElementsByTagNameNS(String namespaceURI, String localName);\r\n \r\n @BrowserSupport({BrowserType.NONE})\r\n @ARename(name = \"getElementsByTagNameNS\")\r\n @JstExclude\r\n @Function NodeList byTagNS(String namespaceURI, String localName);\r\n \r\n\t/**\r\n\t * Creates an EntityReference object. In addition, if the referenced entity is known, \r\n\t * the child list of the EntityReference node is made the same as that of the corresponding Entity node.\r\n\t * @param name\r\n\t * @return\r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Function EntityReference createEntityReference(String name);\r\n \r\n\t/**\r\n\t * Creates a Comment node given the specified string.\r\n\t * @param data\r\n\t * @return\r\n\t */\r\n\t@Function Comment createComment(String data);\r\n\r\n\t/**\r\n\t * Creates a CDATASection node whose value is the specified string.\r\n\t * @param data\r\n\t * @return\r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n\t@Function CDATASection createCDATASection(String data);\r\n\r\n\t/**\r\n\t * Creates a ProcessingInstruction node given the specified name and data strings.\r\n\t * @param target\r\n\t * @param data\r\n\t * @return\r\n\t */\r\n\r\n\t@DOMSupport(DomLevel.ONE)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n\t@Function ProcessingInstruction createProcessingInstruction(String target, String data);\r\n \r\n\t/**\r\n\t * Creates an empty DocumentFragment object. \r\n\t * @return\r\n\t */\r\n\t@Function DocumentFragment createDocumentFragment();\r\n\r\n\t/**\r\n\t * Attempts to adopt a node from another document to this document. \r\n\t * If supported, it changes the ownerDocument of the source node, its children, \r\n\t * as well as the attached attribute nodes if there are any. \r\n\t * If the source node has a parent it is first removed from the child list of its parent. \r\n\t * This effectively allows moving a subtree from one document to another (unlike importNode() \r\n\t * which create a copy of the source node instead of moving it). \r\n\t * When it fails, applications should use Document.importNode() instead. \r\n\t * Note that if the adopted node is already part of this document (i.e. the source and \r\n\t * target document are the same), this method still has the effect of removing the source node \r\n\t * from the child list of its parent, if any. \r\n\t * The following list describes the specifics for each type of node. \r\n\t * @param source\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n\t@Function Node adoptNode(Node source);\r\n\r\n\t/**\r\n\t * This method acts as if the document was going through a save and load cycle, \r\n\t * putting the document in a \"normal\" form. As a consequence, this method updates the \r\n\t * replacement tree of EntityReference nodes and normalizes Text nodes, as defined in \r\n\t * the method Node.normalize(). Otherwise, the actual result depends on the features being set \r\n\t * on the Document.domConfig object and governing what operations actually take place. \r\n\t * Noticeably this method could also make the document namespace well-formed according to \r\n\t * the algorithm described in Namespace Normalization, check the character normalization, \r\n\t * remove the CDATASection nodes, etc. See DOMConfiguration for details. \r\n\t * @since DOM Level 3\r\n\t *\r\n\t */\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@Function void normalizeDocument();\r\n\r\n\t/**\r\n\t * Rename an existing node of type ELEMENT_NODE or ATTRIBUTE_NODE. When possible this simply changes \r\n\t * the name of the given node, otherwise this creates a new node with the specified name \r\n\t * and replaces the existing node with the new node as described below. If simply changing the name of\r\n\t * the given node is not possible, the following operations are performed: a new node is created, \r\n\t * any registered event listener is registered on the new node, any user data attached to the old node \r\n\t * is removed from that node, the old node is removed from its parent if it has one, the children \r\n\t * are moved to the new node, if the renamed node is an Element its attributes are moved to the \r\n\t * new node, the new node is inserted at the position the old node used to have in its parent's \r\n\t * child nodes list if it has one, the user data that was attached to the old node is attached to \r\n\t * the new node.\r\n\t * When the node being renamed is an Element only the specified attributes are moved, \r\n\t * default attributes originated from the DTD are updated according to the new element name. \r\n\t * In addition, the implementation may update default attributes from other schemas. \r\n\t * Applications should use Document.normalizeDocument() to guarantee these attributes are up-to-date. \r\n\t * When the node being renamed is an Attr that is attached to an Element, the node is first removed \r\n\t * from the Element attributes map. Then, once renamed, either by modifying the existing node or \r\n\t * creating a new one as described above, it is put back. In addition,\r\n\t * <ul>\r\n\t * <li>a user data event NODE_RENAMED is fired,</li>\r\n\t * <li>when the implementation supports the feature \"MutationNameEvents\", \r\n\t * each mutation operation involved in this method fires the appropriate event, \r\n\t * and in the end the event {http://www.w3.org/2001/xml-events, DOMElementNameChanged} or \r\n\t * {http://www.w3.org/2001/xml-events, DOMAttributeNameChanged} is fired.</li>\r\n\t * </ul>\r\n\t * @param n\r\n\t * @param namespaceURI\r\n\t * @param qualifiedName\r\n\t * @return\r\n\t * @since DOM Level 3\r\n\t */\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Function Node renameNode(Node n, \r\n String namespaceURI, \r\n String qualifiedName);\r\n\r\n\t/**\r\n\t * The get the last modified date & time of the document. \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getLastModified();\r\n\r\n\t/**\r\n\t * The get the document background color \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getBgColor();\r\n\r\n\t/**\r\n\t * The get the active link color \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getAlinkColor();\r\n\r\n\t/**\r\n\t * The get the visited link color \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getVlinkColor();\r\n\r\n\t/**\r\n\t * The get the link color \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getLinkColor();\r\n\r\n\t/**\r\n\t * The get the protocol \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getProtocol();\r\n\r\n\t/**\r\n\t * The get the cookie \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getCookie();\r\n\r\n\t/**\r\n\t * The get the document fg color \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getFgColor();\r\n\r\n\t/**\r\n\t * The get the state of the document \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getReadyState();\r\n\r\n\t/**\r\n\t * The get the security of the document \r\n\t * \r\n\t */\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property String getSecurity();\r\n\t\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property void setBgColor(String value);\r\n\t\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property void setFgColor(String value);\r\n\t\r\n\t@DOMSupport(DomLevel.ONE)\r\n @Property void setLinkColor(String value);\r\n}", "Sketch apex();", "boolean shouldUseOldSyntax() {\n return isJsLibrary;\n }", "@DOMSupport(DomLevel.THREE)\r\n\t@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Property void setXmlStandalone(boolean xmlStandalone);", "public LagartoDOMBuilder enableHtmlMode() {\n\t\tconfig.ignoreWhitespacesBetweenTags = false; // collect all whitespaces\n\t\tconfig.parserConfig.setCaseSensitive(false); // HTML is case insensitive\n\t\tconfig.parserConfig.setEnableRawTextModes(true); // script and style tags are parsed as CDATA\n\t\tconfig.enabledVoidTags = true; // list of void tags\n\t\tconfig.selfCloseVoidTags = false; // don't self close void tags\n\t\tconfig.impliedEndTags = true; // some tags end is implied\n\t\tconfig.parserConfig.setEnableConditionalComments(false); // don't enable IE conditional comments\n\t\tconfig.parserConfig.setParseXmlTags(false); // enable XML mode in parsing\n\t\treturn this;\n\t}", "public AdmClientePreferencialHTML() {\n/* 191 */ this(StandardDocumentLoader.getInstance());\n/* */ \n/* 193 */ buildDocument();\n/* */ }", "public PoaMaestroMultivaloresHTML() {\n/* 253 */ this(StandardDocumentLoader.getInstance());\n/* */ \n/* 255 */ buildDocument();\n/* */ }", "public JAXPParser(Map<String, Boolean> parserFeatures) {\n this();\n loadDocumentBuilderFactory();\n try {\n if(null != parserFeatures) {\n for(Entry<String, Boolean> entry : parserFeatures.entrySet()) {\n documentBuilderFactory.setFeature(entry.getKey(), entry.getValue());\n }\n }\n } catch(Exception e) {\n throw XMLPlatformException.xmlPlatformParseException(e);\n }\n }", "public PoaMaestroMultivaloresHTML(boolean buildDOM) { this(StandardDocumentLoader.getInstance(), buildDOM); }", "ScriptEvaluator createScriptEvaluator();", "public void buildDocument() {\n/* 310 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 312 */ syncAccessMethods();\n/* */ }", "public XWPFDocument startConversion() {\n\n convertParagraphs(docx);\n convertFooter(docx);\n convertHeader(docx);\n convertTables(docx);\n updateStylesToNewFont();\n\n\n return docx;\n }", "protected RCPOMDocument() {\n\t}", "public final void setXmllang(java.lang.String value) throws JavaScriptException {\n ((SVGFilterElement)ot).setXmllang(value);\n }", "boolean hasJs();", "public AdmClientePreferencialHTML(boolean buildDOM) { this(StandardDocumentLoader.getInstance(), buildDOM); }", "public void start() {\n if (editor == null) {\n return;\n }\n \n DocumentManager.register(doc, styledText, documentManager);\n \n preCode = doc.get();\n \n super.start();\n }", "@Test (dataProvider = \"ignoreNoscriptElementsDataProvider\")\r\n public void ignoreNoscriptElements(boolean ignoreNoscriptElements) throws Exception\r\n {\n final String HTML = \"\\n <html>\\n <head>\\n <title>NOSCRIPT</title>\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\">\\n <script type=\\\"text/javascript\\\">\\n alert(\\\"Hello, world!\\\");\\n </script>\\n </head>\\n <body>\\n <noscript><p>Your browser does not support JavaScript!</p></noscript>\\n </body>\\n </html>\";\r\n\r\n HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();\r\n htmlLoadOptions.setIgnoreNoscriptElements(ignoreNoscriptElements);\r\n\r\n Document doc = new Document(new MemoryStream(Encoding.getUTF8().getBytes(HTML)), htmlLoadOptions);\r\n doc.save(getArtifactsDir() + \"HtmlLoadOptions.IgnoreNoscriptElements.pdf\");\r\n //ExEnd\r\n\r\n Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(getArtifactsDir() + \"HtmlLoadOptions.IgnoreNoscriptElements.pdf\");\r\n TextAbsorber textAbsorber = new TextAbsorber();\r\n textAbsorber.Visit(pdfDoc);\r\n\r\n Assert.AreEqual(ignoreNoscriptElements ? \"\" : \"Your browser does not support JavaScript!\", textAbsorber.Text);\r\n }", "public void buildDocument() {\n/* 220 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 222 */ syncAccessMethods();\n/* */ }", "public boolean isRetireJsAnalyzerEnabled() {\n return retireJsAnalyzerEnabled;\n }", "protected static org.w3c.dom.Document setUpXML(String nodeName)\n throws ParserConfigurationException\n {\n //try\n //{\n DocumentBuilderFactory myFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder myDocBuilder = myFactory.newDocumentBuilder();\n DOMImplementation myDOMImpl = myDocBuilder.getDOMImplementation();\n // resultDocument = myDOMImpl.createDocument(\"at.ac.tuwien.dbai.pdfwrap\", \"PDFResult\", null);\n org.w3c.dom.Document resultDocument =\n myDOMImpl.createDocument(\"at.ac.tuwien.dbai.pdfwrap\", nodeName, null);\n return resultDocument;\n //}\n //catch (ParserConfigurationException e)\n //{\n // e.printStackTrace();\n // return null;\n //}\n\n }", "public void buildDocument() {\n/* 248 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 250 */ syncAccessMethods();\n/* */ }", "private void prepDocument() {\n if (body == null) {\n body = document.appendElement(\"body\");\n }\n\n body.attr(\"id\", \"readabilityBody\");\n\n Elements frames = document.getElementsByTag(\"frame\");\n if (frames.size() > 0) {\n LOG.error(\"Frames. Can't deal. Write code later to look at URLs and fetch\");\n impossible = true;\n return;\n }\n\n Elements stylesheets = document.getElementsByTag(\"style\");\n stylesheets.remove();\n stylesheets = document.select(\"link[rel='stylesheet']\");\n stylesheets.remove();\n\n /* Turn all double br's into p's */\n /*\n * Note, this is pretty costly as far as processing goes. Maybe optimize later.\n */\n handlePP();\n handleDoubleBr();\n fontsToSpans();\n }", "public GroovyScriptEvaluator() {\n\t}", "@Override\n\tpublic void startDocument() {\n\t\t\n\t}", "@Override\r\n \tprotected boolean supportInterpreter() {\n \t\treturn false;\r\n \t}", "public static native void setUseDom(boolean value)/*-{\r\n\t\t$wnd.Ext.DomHelper.useDom = value;\r\n\t}-*/;", "public void enableRawInlineHtml()\n {\n rawInlineHtmlEnabled = true;\n }", "private void handlePP() {\n String inner = document.body().html();\n inner.replaceAll(\"<p></p>\", \"<p>\");\n document.body().html(inner);\n }", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "public static void designTextEditor() {\n\t\t\n\t}", "public void showLoadXML(Properties p);", "private void enableServicesXMLBrowse(){\n\t\txmlBrowseButton.setEnabled(true);\n\t\tservicesXMLPath.setEnabled(true);\n\t}", "@Override\n public void setValidationMode(int validationMode) {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n switch (validationMode) {\n case XMLParser.NONVALIDATING: {\n documentBuilderFactory.setValidating(false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.DTD_VALIDATION: {\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalDTDAccess(documentBuilderFactory, \"all\", false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.SCHEMA_VALIDATION: {\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalAccess(documentBuilderFactory, \"all\", false);\n } catch (IllegalArgumentException e) {\n // This parser does not support XML Schema validation so leave it as\n // a non-validating parser.\n }\n return;\n }\n }\n }", "@Override\n protected void afterActivityLaunched() {\n onWebView().forceJavascriptEnabled();\n }", "public void setEnabledJText(boolean ativa) {\n jTPorta.setEnabled(ativa);\n jTNomeBanco.setEnabled(ativa);\n jTUsuario.setEnabled(ativa);\n jPSenha.setEnabled(ativa);\n }", "public IndicadoresEficaciaHTML() {\n/* 163 */ this(StandardDocumentLoader.getInstance());\n/* */ \n/* 165 */ buildDocument();\n/* */ }", "public void setProvenanceEnabled(boolean enabled) {\n provEnabled = enabled;\n }", "@Override\n public void XML_startDocument(Atz_XML_SAX_DataHandler sourceHandler) {\n flagDelegateParsing = false;\n }", "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n\n // Setup permissions\n Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin(\"Permissions\");\n\n if (permissionsPlugin == null) {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system not detected, defaulting to all users\");\n usePermissions = false;\n } else {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system detected\");\n usePermissions = true;\n this.permissionHandler = ((Permissions) permissionsPlugin).getHandler();\n }\n\n // Register commands\n getCommand(\"tradewolf\").setExecutor(new TradeWolfCommand(this));\n\n // Output to console that plugin is enabled\n log.info(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" enabled!\");\n }", "public void setPlainJsMarshaller(DwrpPlainJsMarshaller marshaller)\n {\n this.plainJsMarshaller = marshaller;\n }", "@Override\n public void setNamespaceAware(boolean isNamespaceAware) {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n documentBuilderFactory.setNamespaceAware(isNamespaceAware);\n }", "public boolean isJsMode() {\n return jsMode;\n }", "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\n }", "boolean supportsScripts();", "@Override\n\tpublic boolean isScriptable() {\n\t\treturn false;\n\t}", "public void setValidateScriptExpressions(boolean validateScriptExpressions) {\n\t\tthis.validateScriptExpressions = validateScriptExpressions;\n\t}", "public JCYDocument() {}", "public void onEnable() {\n\r\n \tloadSettings();\r\n \tinitDbPool();\r\n \t\r\n // EXAMPLE: Custom code, here we just output some info so we can check all is well\r\n PluginDescriptionFile pdfFile = this.getDescription();\r\n\t\tlogger.info( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\r\n }", "public void jsContructor() {\n }", "private static void initFX(final JFXPanel fxPanel) {\n Group group = new Group();\n Scene scene = new Scene(group);\n fxPanel.setScene(scene);\n\n webView = new WebView();\n\n group.getChildren().add(webView);\n webView.setMinSize(300, 300);\n webView.setPrefSize(850, 600);\n webView.setMaxSize(850, 600);\n\n webView.getEngine().setJavaScriptEnabled(true); //allows us to run JS code\n\n //START\n webView.getEngine().setOnAlert(new EventHandler<WebEvent<String>>() {\n @Override\n public void handle(WebEvent<String> event) {\n JOptionPane.showMessageDialog(\n fxPanel,\n event.getData(),\n \"Alert Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n });\n\n webView.getEngine().getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) ->\n {\n JSObject window = (JSObject) webView.getEngine().executeScript(\"window\");\n window.setMember(\"java\", bridge2);\n webView.getEngine().executeScript(\"console.log = function(message)\\n\" +\n \"{\\n\" +\n \" java.log(message);\\n\" +\n \"};\");\n });\n //END\n\n // Obtain the webEngine to navigate\n WebEngine webEngine = webView.getEngine();\n //solves Captcha problem\n //webEngine.setUserAgent(\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36\");\n webEngine.load(\"https://yandex.ru\"); //sets the start page for the application\n }", "private String filterScriptMarkup(HttpServletRequest request, HttpServletResponse response, CMAbstractCode code) {\n //construct xmlFilters to strip RichText from <div> and <p> tags\n Markup unfilteredCode = code.getCode();\n List<XMLFilter> filters = new ArrayList<>();\n filters.addAll(xmlFilterFactory.createFilters(request, response, unfilteredCode, \"script\"));\n filters.add(new ScriptFilter());\n\n //strip <div> and <p> from markup\n StringWriter writer = new StringWriter();\n ScriptSerializer handler = new ScriptSerializer(writer);\n unfilteredCode.writeOn(filters, handler);\n return writer.getBuffer().toString();\n }", "public static void init() {\n chsrInit();\n configJS();\n }", "@Override\r\n\tpublic DTextArea setHtmlOnCanPlayThrough(final String script) {\r\n\t\tsuper.setHtmlOnCanPlayThrough(script) ;\r\n\t\treturn this ;\r\n\t}", "void setJs(final String js) {\n this.js = js;\n }", "private void testProXml(){\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Enable Prince debug mode.\")\n @JsonProperty(JSON_PROPERTY_DEBUG)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getDebug() {\n return debug;\n }", "private final synchronized void m46509N() {\n this.f40737s = C14793ay.m42898d().mo39091b();\n if (this.f40737s == null) {\n try {\n evaluateJavascript(\"(function(){})()\", null);\n m46522a(Boolean.valueOf(true));\n } catch (IllegalStateException unused) {\n m46522a(Boolean.valueOf(false));\n }\n }\n }", "@SuppressLint(\"SetJavaScriptEnabled\")\n private void configureWebViewSettings() {\n WebSettings settings = getSettings();\n settings.setJavaScriptEnabled(true);\n settings.setAppCacheEnabled(true);\n settings.setDomStorageEnabled(true);\n settings.setBuiltInZoomControls(true);\n settings.setLoadWithOverviewMode(true);\n settings.setUseWideViewPort(true);\n settings.setSupportMultipleWindows(false); // to enable opening links which require opening a new tab\n settings.setLoadsImagesAutomatically(true);\n settings.setBuiltInZoomControls(true);\n }", "private void setPageSettings() {\n\n List<Element> paragraphs = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"para\", omniPageXMLDocument.getDocumentElement());\n\n int lineCounter = 0;\n int fontSizeSum = 0;\n if (paragraphs != null && !paragraphs.isEmpty()) {\n\n int biggestTop = 0;\n int biggestLeft = 0;\n for (Element paragraphElement : paragraphs) {\n\n List<Element> linesOfParagraph = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"ln\", paragraphElement);\n\n if (linesOfParagraph != null && !linesOfParagraph.isEmpty()) {\n for (Element lineElement : linesOfParagraph) {\n String fontFace = lineElement.getAttribute(\"fontFace\");\n\n if (fontFace == null || fontFace.isEmpty()) { //if yes, start run merge process\n augmentLineElement(lineElement);\n }\n\n if (lineElement.getAttribute(\"t\") != null && !lineElement.getAttribute(\"t\").isEmpty() &&\n lineElement.getAttribute(\"l\") != null && !lineElement.getAttribute(\"l\").isEmpty()) {\n int top = Integer.parseInt(lineElement.getAttribute(\"t\").replaceAll(\",\", \"\\\\.\"));\n\n if (top > biggestTop) {\n biggestTop = top;\n }\n\n int left = Integer.parseInt(lineElement.getAttribute(\"l\").replaceAll(\",\", \"\\\\.\"));\n\n if (left > biggestLeft) {\n biggestLeft = left;\n }\n }\n\n double fontSize = 0;\n if (lineElement.getAttribute(\"fontSize\") != null && !lineElement.getAttribute(\"fontSize\").isEmpty()) {\n fontSize = Double.valueOf(lineElement.getAttribute(\"fontSize\").replaceAll(\",\", \"\\\\.\"));\n }\n\n\n fontSizeSum += fontSize;\n lineCounter++;\n }\n }\n }\n\n averagePageFontSize = (double) fontSizeSum / lineCounter;\n\n topBucketSize = (biggestTop / 8) + 1;\n leftBucketSize = (biggestLeft / 8) + 1;\n } else {\n averagePageFontSize = null;\n }\n\n\n }", "JavaEvaluator createJavaEvaluator();", "private EscidocConfiguration() throws SystemException {\r\n System.setProperty(\"java.awt.headless\", \"true\");\r\n this.properties = loadProperties();\r\n }", "@Override\n\tpublic void startDocument() throws SAXException {\n\t\tSystem.out.println(\"---解析文档开始----\");\n\t}", "public PropertiesDocument() {\n\t\tthis.documentBuilderFactory = DocumentBuilderFactory.newInstance();\n try {\n\t\t\tthis.documentBuilder = documentBuilderFactory.newDocumentBuilder();\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// Exception with default configuration\n\t\t\te.printStackTrace();\n\t\t}\n this.properties = new Properties();\n\t}", "public void setIMPLEMENTFX(java.lang.CharSequence value) {\n this.IMPLEMENT_FX = value;\n }", "public void mode() {\n APIlib.getInstance().addJSLine(jsBase + \".mode();\");\n }", "public void setJavaScriptEscape(boolean javaScriptEscape) throws JspException {\n\t\tthis.javaScriptEscape = javaScriptEscape;\n\t}", "public boolean getEnableProductionEncodingHack() {\r\n \t\treturn Boolean.valueOf(properties.getProperty(KEY_ENABLE_PROD_ENCODING_HACK));\r\n \t}", "@Override\n public boolean onCheckIsTextEditor() {\n return false;\n }", "public Boolean getBypassDocumentValidation() {\n return bypassDocumentValidation;\n }", "public ScriptEditorConfiguration(EditorMode mode) {\n\t\tassistant = new ContentAssistant();\n\t\treconciler = new PresentationReconciler();\n\t\tscriptScanner = new ScriptScanner(mode);\n\t\trepairer = new DefaultDamagerRepairer(scriptScanner);\n\t}", "void xsetParlay(org.apache.xmlbeans.XmlBoolean parlay);", "@Override\n public void configureForXmlConformance() {\n mConfig.configureForXmlConformance();\n }", "public static void run() {\r\n LoadOptions loadOptions = new LoadOptions();\r\n loadOptions.setPassword(\"P@$$w0rd\");\r\n // Constants.InProtectedDocumentDocx is an absolute or relative path to your document. Ex: @\"C:\\\\Docs\\\\protected-document.docx\"\r\n String filePath = Constants.InProtectedDocumentDocx;\r\n Watermarker watermarker = new Watermarker(filePath, loadOptions);\r\n\r\n // use watermarker methods to manage watermarks in the document\r\n TextWatermark watermark = new TextWatermark(\"Test watermark\", new Font(\"Arial\", 12));\r\n\r\n watermarker.add(watermark);\r\n\r\n watermarker.save(Constants.OutProtectedDocumentDocx);\r\n\r\n watermarker.close();\r\n }", "@Override public JavaNativeTextField setAutocorrection (boolean enable) {\n return this;\n }", "public void showYourself(Subscription parentBinding) {\n myPopupStage.setOnCloseRequest(e -> parentBinding.unsubscribe());\n exportResultArea.setSyntaxHighlighter(new XmlSyntaxHighlighter());\n myPopupStage.show();\n }", "public PythXMLEncoder (String script) {\n delegate = encoderFromScript(script);\n }", "public IndicadoresEficaciaHTML(boolean buildDOM) { this(StandardDocumentLoader.getInstance(), buildDOM); }", "public SPARQLBooleanXMLParser() {\n\t\tsuper();\n\t}", "public static void configJS() { // Default Joystick else as gamepad\n // jsConfig = chsr.getSelected() == null ? 0 : chsr.getSelected();\n // SmartDashboard.putNumber(\"JS/JS_Config\", jsConfig);\n\n switch (jsConfig) {\n case 0: // Normal 3 joystick config\n norm3JS();\n break;\n\n case 1: // Normal 2 joystick config No CoDrvr\n norm2JS();\n break;\n\n case 2: // Gamepad only\n a_GP();\n break;\n\n default: // Bad assignment\n System.out.println(\"Bad JS choice - \" + jsConfig);\n caseDefault();\n break;\n }\n }", "IParser setPrettyPrint(boolean thePrettyPrint);", "boolean isAutoEnableElementsTranslation();", "protected static synchronized void setStrictParsing(final boolean enable)\n {\n EASMessage.s_strictParsing = new Boolean(enable);\n }", "public _AstroLexer(java.io.Reader in, boolean highlightMode, boolean jsDocTypesMode) {\n isHighlightModeOn = highlightMode;\n isJsDocTypesModeOn = jsDocTypesMode;\n this.zzReader = in;\n }", "protected void engineStarted() throws XDocletException { }", "void xsetAuto(org.apache.xmlbeans.XmlBoolean auto);", "public\n EvinceEditor()\n {\n super(\"Evince\", new VersionID(\"2.0.9\"), \"Temerity\", \n\t \"A multiple format document viewer.\",\n\t \"evince\");\n }", "@Override\n\tprotected void initScript(Element e, Script parent) throws ScriptException {\n\n\t}", "private boolean temNoScript() {\r\n\t\tif (!procurouNoScript) {\r\n\t\t\ttemnoscript = regras.verificaNoscript(codHTML);\r\n\t\t\tprocurouNoScript = true;\r\n\t\t}\r\n\t\treturn temnoscript;\r\n\t}", "@Override\n\tpublic void startDocument() throws SAXException {\n\t\tSystem.out.println(\"开始解析文档\");\n\t}", "protected abstract boolean evalEscapeXml() throws JspException;", "boolean generateEmbeddableWebComponents();", "public JavaScript(String javaScript) {\n this.javaScript = javaScript;\n }", "public void loadJavaScript(String javascript) {\n if (TextUtils.isEmpty(javascript)) {\n return;\n }\n\n if (Build.VERSION.SDK_INT >= 19) { //Build.VERSION_CODES.KITKAT\n String newJS = clipJacaScriptUrlString(javascript);\n if (!newJS.startsWith(\"javascript:\")) {\n try{\n super.evaluateJavascript(newJS, null);\n }catch (Exception | Error e){\n super.loadUrl(javascript);\n e.printStackTrace();\n }\n } else {\n super.loadUrl(javascript);\n }\n } else {\n super.loadUrl(javascript);\n }\n }", "private void setJavier(Javier javier) {\r\n\t\tthis.javier = javier;\r\n\t}", "public void processDocumentProlog(org.w3c.dom.Document document)\r\n\tthrows Exception\r\n\t{\r\n\tgetWriter().write(\"Document prolog\\n\");\r\n\treturn;\r\n\t}" ]
[ "0.52511173", "0.49473137", "0.47718638", "0.46866396", "0.45927885", "0.45521712", "0.45418012", "0.453293", "0.45268503", "0.45191044", "0.44705924", "0.4457752", "0.44532934", "0.44443625", "0.44112015", "0.44029504", "0.44014332", "0.44007808", "0.4400719", "0.43871415", "0.43728802", "0.43668857", "0.43546966", "0.43391702", "0.43240604", "0.43115896", "0.42745042", "0.42742825", "0.42669782", "0.42364544", "0.4228022", "0.42263034", "0.42244065", "0.42234367", "0.42183605", "0.42067504", "0.42063308", "0.41911873", "0.41894442", "0.4186086", "0.41620457", "0.4161783", "0.41406703", "0.41344324", "0.4128151", "0.4118583", "0.4116507", "0.41052598", "0.4097693", "0.40940464", "0.4091633", "0.40850657", "0.40847906", "0.40845066", "0.4075387", "0.40753815", "0.40715352", "0.40596968", "0.40424427", "0.4029655", "0.40150768", "0.4011174", "0.40057415", "0.400212", "0.39953774", "0.3994005", "0.39865085", "0.39792612", "0.39708853", "0.39687705", "0.39687353", "0.39678282", "0.39617148", "0.39538997", "0.3952945", "0.39528632", "0.39503843", "0.3949199", "0.39481196", "0.39481175", "0.3945933", "0.39440903", "0.39415732", "0.39411882", "0.39373967", "0.39363575", "0.3935099", "0.39321068", "0.3929709", "0.3926165", "0.3923227", "0.39175716", "0.39144087", "0.3911623", "0.39100334", "0.39094943", "0.3908212", "0.3904212", "0.39012468", "0.3900525" ]
0.6732401
0
Set the DPI when rendering CSS. Defaults to 96 but can be set with Prince 9.0 and up.
@javax.annotation.Nullable @ApiModelProperty(value = "Set the DPI when rendering CSS. Defaults to 96 but can be set with Prince 9.0 and up.") @JsonProperty(JSON_PROPERTY_CSS_DPI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getCssDpi() { return cssDpi; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract float getXdpi();", "public abstract float getYdpi();", "public void setDPISBN(String value){\n\t\tthis.m_bIsDirty = (this.m_bIsDirty || (!value.equals(this.m_sDPISBN)));\n\t\tthis.m_sDPISBN=value;\n\t}", "void setPaperSize(short size);", "public native void setUnits(int resolutionType) throws MagickException;", "public static double getDisplayDpi() {\n\t\treturn javafx.stage.Screen.getPrimary().getDpi();\n\t}", "private IIOMetadata setDPI(IIOMetadata metadata) throws IIOInvalidTreeException {\n\n IIOMetadataNode lat = new IIOMetadataNode(\"GPS Latitude\");\n lat.setAttribute(\"value\",Double.toString(26.6200042939));\n IIOMetadataNode log = new IIOMetadataNode(\"GPS Longitude\");\n log.setAttribute(\"value\",Double.toString(106.6757104939));\n\n\n IIOMetadataNode dim = new IIOMetadataNode(\"Dimension\");\n dim.appendChild(lat);\n dim.appendChild(log);\n\n IIOMetadataNode root = new IIOMetadataNode(\"javax_imageio_1.0\");\n root.appendChild(dim);\n\n metadata.mergeTree(\"javax_imageio_1.0\", root);\n\n return metadata;\n }", "public static void setImagesSizeWithDpi(int deviceDPI){\n switch (deviceDPI){\n case DisplayMetrics.DENSITY_XHIGH:\n POSTER_SIZE = \"w342\";\n BACKDROP_SIZE = \"w780\";\n break;\n case DisplayMetrics.DENSITY_XXHIGH:\n POSTER_SIZE = \"w500\";\n BACKDROP_SIZE = \"w1000\";\n break;\n case DisplayMetrics.DENSITY_XXXHIGH:\n POSTER_SIZE = \"w780\";\n BACKDROP_SIZE = \"w1920\";\n break;\n default:\n POSTER_SIZE = \"w185\";\n BACKDROP_SIZE = \"w500\";\n break;\n }\n }", "public String getDPISBN(){\n\t\treturn this.m_sDPISBN;\n\t}", "public void setDPISSN(String value){\n\t\tthis.m_bIsDirty = (this.m_bIsDirty || (!value.equals(this.m_sDPISSN)));\n\t\tthis.m_sDPISSN=value;\n\t}", "public void SetResolution() {\r\n DisplayMetrics displayMetrics = new DisplayMetrics();\r\n WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);\r\n wm.getDefaultDisplay().getMetrics(displayMetrics);\r\n this.ScreenWidth = displayMetrics.widthPixels;\r\n this.ScreenHeight = displayMetrics.heightPixels;\r\n }", "public void setResolution(int value) {\n this.resolution = value;\n }", "void setHorizontalResolution(int horizontalResolution);", "public native void setXResolution(double xRes) throws MagickException;", "public String getDPISSN(){\n\t\treturn this.m_sDPISSN;\n\t}", "public void settings() {\n size(640, 384);\n }", "public native void setYResolution(double yRes) throws MagickException;", "private static void initUsableDisplaySizes() {\n\t\t// Optimized display dimensions for display resolutions\n\t\tdisplaySizes.add(new Dimension(640, 480)); // Smaller 4:3 (1024x768 and smaller)\n\t\tdisplaySizes.add(new Dimension(800, 600)); // Larger 4:3 (1280x1024)\n\t\tdisplaySizes.add(new Dimension(864, 486)); // Larger 16:9 (1366x768 and larger)\n\t}", "public void setPenSize(int pixelSize){\n myPen.setPenSize(pixelSize);\n }", "void setVerticalResolution(int verticalResolution);", "protected byte desiredWinScale() { return 9; }", "private void calc_screen_size(){\r\n \tscn_grid.setFont(scn_font);\r\n \tscn_context = scn_grid.getFontRenderContext();\r\n \t scn_layout = new TextLayout(\"X\",scn_font,scn_context);\r\n scn_char_rect = scn_layout.getBlackBoxBounds(0,1).getBounds();\r\n scn_char_height = (int) (scn_char_rect.getHeight()); // RPI 630 was Width in err, 6 to *1.5\r\n \tscn_char_base = scn_char_height/2+1;\r\n \tscn_char_height = scn_char_height + scn_char_base+2;\r\n scn_char_width = (int) (scn_char_rect.getWidth()); // RPI 630 was Height in err\r\n \tscn_height = scn_rows * scn_char_height; // RPI 408 + 5 \r\n \tscn_width = scn_cols * scn_char_width + 3; // RPI 408 + 5 \r\n \tscn_size = new Dimension(scn_width,scn_height);\r\n \tscn_image = new BufferedImage(scn_width,scn_height,BufferedImage.TYPE_INT_ARGB);\r\n \tscn_grid = scn_image.createGraphics();\r\n \tscn_grid.setFont(scn_font); \r\n scn_grid.setColor(scn_text_color);\r\n \t scn_context = scn_grid.getFontRenderContext();\r\n scn_grid.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n }", "public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }", "public void configureDigitalMeter()\n {\n\t\tsetFrameType(RectangularFrameType.RoundedSideThinRim);\n\t\tsetBackground(Color.black);\n\t\tsetCharacterType(DigitalCharacterType.Segment7Trapezoid);\n setCharacterCount(10);\n\t\tsetForeground(Color.WHITE);\n\t\tsetDimmedBrush(Color.black);\n\t\tsetCharacterOverflowAlignment(DigitalCharacterOverflowAlignment.Right);\n setCharacterPadding(1);\n setCharacterSpacing(1);\n\t\tsetItalic(false);\n }", "public void settings() { size(1200, 800); }", "void setFontScale(\n float s);", "private void setFacteurSize() {\n if(dimensionsCuisine.getX()>dimensionsCuisine.getY()){\n facteurSize = 640/dimensionsCuisine.getX();\n } else {\n facteurSize = 460/dimensionsCuisine.getY();\n }\n }", "private void m13085a() {\n DisplayMetrics displayMetrics = getResources().getDisplayMetrics();\n this.f12281d = new Paint();\n this.f12281d.setColor(this.f12278a);\n this.f12281d.setAntiAlias(true);\n this.f12281d.setTextSize(displayMetrics.scaledDensity * ((float) this.f12279b));\n }", "public void settings() {\r\n size(750, 550);\r\n }", "public void setResolution(Size resolution, long scale) {\n\t\tAssert.assertNotNull(resolution);\n\n\t\tJWLC.nativeHandler().wlc_output_set_resolution(this.to(),\n\t\t\t\tresolution.to(), Utils.getAsUnsignedInt(scale));\n\t}", "public void settings() {\r\n size(WIDTH, HEIGHT); // Set size of screen\r\n }", "@Override\n\tpublic void setResolution(Dimension size) {\n\n\t}", "void setVResolution(short resolution);", "public double getAsDpi() {\n\t\tif (units != 1 || pixelsxUnitX != pixelsxUnitY)\n\t\t\treturn -1;\n\t\treturn ((double) pixelsxUnitX) * 0.0254;\n\t}", "public void setResolution(int resolution)\r\n\t{\r\n\t\tduration *= resolution;\r\n\t\tduration /= this.resolution;\r\n\t\tthis.resolution = resolution;\r\n\t}", "void setHResolution(short resolution);", "public void setZoom(int ps) {\n P_SCALE = ps;\n //EMBOSS = P_SCALE*8;\n }", "short getPaperSize();", "@Override\n\tpublic String paperSize() {\n\t\treturn \"B5ֽ\";\n\t}", "public static double cmsToPixel(double cms, double dpi)\n {\n return cmToInches(cms) * dpi;\n }", "public void setScreenResolution(int width, int height) {\n String res = Integer.toString(width) + \"x\" + Integer.toString(height);\n this.standardPairs.put(Parameters.RESOLUTION, res);\n }", "public void setCssr(BigDecimal cssr) {\n this.cssr = cssr;\n }", "@DISPID(100) //= 0x64. The runtime will prefer the VTID if present\r\n @VTID(11)\r\n void width(\r\n float prop);", "public void setScaleFactor(float scale){\n scaleFactor = scale;\n }", "private static int convertDpToPx(int dp) {\r\n return (int) (dp * Resources.getSystem().getDisplayMetrics().density);\r\n }", "public void setWidthInch(float inches){\n\t\tthis.setWidth(inches);\n\t}", "public void setResolution(Resolution resolution) {\n this.resolution = resolution;\n }", "public void setScale() {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n scaleAffine();\n Scalebar.putZoomLevelDistances();\n\n //Set up the JFrame using the monitors resolution.\n setSize(screenSize); //screenSize\n setPreferredSize(new Dimension(800, 600)); //screenSize\n setExtendedState(Frame.NORMAL); //Frame.MAXIMIZED_BOTH\n }", "public static float convertDpToPixel(float dp){\n return dp * ((float) Resources.getSystem().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n }", "@Override\n public void settings() {\n size(800, 800, P3D);\n }", "void setBitsPerPixel(int bitsPerPixel);", "public static void setResolution(int width, int height) {\n WIDTH = width;\n HEIGHT = height;\n SCALAR = 1920 / WIDTH + ((1920 % WIDTH == 0) ? 0 : 1);\n }", "public void setNUM_PIS(int NUM_PIS) \r\n {\r\n if(NUM_PIS > 0)\r\n this.NUM_PIS = NUM_PIS;\r\n }", "public void setTargetResolution(int w, int h) {\n captureW = w;\n captureH = h;\n }", "public void setWidth(double w)\n { this.widthDefault = w; }", "protected void setScaleDenominator(double scaleDenominator) {\n this.scaleDenominator = scaleDenominator;\n }", "public native double getYResolution() throws MagickException;", "public void setTextViewSize(float px) {\r\n\t\tfloat scaledDensity = getResources().getDisplayMetrics().scaledDensity;\r\n\t\tint sp = (int) (px / scaledDensity);\r\n\t\tsetTextSize(sp);\r\n\t}", "public void setFontSize(float fs) {\n\t\tif (fs != fontSize) {\n\t\t\tfontSize = fs;\n\t\t\treload();\n\t\t}\n\t}", "public void setWidthCM(float centimeters){\n\t\tthis.setWidth(centimeters*0.3937f);\n\t}", "public void setWidth(double value) {\n this.width = value;\n }", "@Override\n\tprotected float getDrawRatioX(){\n\t\treturn getWidth() / (float)getDefaultTODA() * getRatioOnScreen();\n\t}", "public void setCombatDensityRate(int value) {\n this.combatDensityRate = value;\n }", "private void initLrcFontSize() {\n int screeHeight=getResources().getDisplayMetrics().heightPixels;\n int marginLeft=(int)(1.0*screeHeight/9);\n LrcView.defaultTextSize=DensityUtil.px2sp(this, (marginLeft));//设置默认的歌词大小\n LrcView.defaultDividerHeight=marginLeft/2;\n }", "public native double getXResolution() throws MagickException;", "public void setDensity(float density) {\n this.density = density;\n }", "public void setDisplayFont(int size){\n\t\tscreen.setFont(new Font(\"Serif\",Font.BOLD,size));\r\n\t}", "public void configureDisplayPolicy() {\n int longSize;\n int shortSize;\n if (this.mBaseDisplayDensity == 0) {\n Slog.e(TAG, \"density is 0\");\n return;\n }\n int width = this.mBaseDisplayWidth;\n int height = this.mBaseDisplayHeight;\n if (width > height) {\n shortSize = height;\n longSize = width;\n } else {\n shortSize = width;\n longSize = height;\n }\n int i = this.mBaseDisplayDensity;\n this.mDisplayPolicy.updateConfigurationAndScreenSizeDependentBehaviors();\n this.mDisplayRotation.configure(width, height, (shortSize * 160) / i, (longSize * 160) / i);\n DisplayFrames displayFrames = this.mDisplayFrames;\n DisplayInfo displayInfo = this.mDisplayInfo;\n displayFrames.onDisplayInfoUpdated(displayInfo, calculateDisplayCutoutForRotation(displayInfo.rotation));\n this.mIgnoreRotationForApps = isNonDecorDisplayCloseToSquare(0, width, height);\n }", "public Platform()\n\t{\n\t\t//Add code to scale image here\n\t\tgetImage().scale(100, 16);\n\t}", "public static float convertDpToPx(float dp,int dpi){\n\t\treturn dp * (dpi / 160f);\n\t}", "public int getResolution() {\n return resolution;\n }", "public static float m21412o(Context context) {\n return context.getResources().getDisplayMetrics().density;\n }", "public FontConfig() {\n\t\tthis.name = \"Monospaced\";\n\t\tthis.style = FontStyle.PLAIN;\n\t\tthis.size = DEFAULT_SIZE;\n\t}", "public final float mo9235c(DisplayMetrics displayMetrics) {\n return 100.0f / ((float) displayMetrics.densityDpi);\n }", "private void setFontSize(float newFontSize) {\n\t\tfontSize = newFontSize;\n\t\tproperties.setProperty(\"fontSize\", Float.toString(newFontSize));\n\n\t\t// update all text-based components\n\t\tfor (Component c : components)\n\t\t\tc.setFont(c.getFont().deriveFont(newFontSize));\n\t\t\n\t\t// update machine graphics\n\t\tupdate(); \n\t}", "void setDimension(double width, double height);", "public static void main(String[] args) {\n\t\t final double CM_PER_INCH = 2.54; \n\t\t double paperWidth = 8.5; \n\t\t double paperHeight = 11; \n\t\t System.out.println(\"Paper size in centimeters: \" + \n\t\t paperWidth * CM_PER_INCH + \" by \" + paperHeight * \n\t\t CM_PER_INCH); \n\t}", "public static float converPxToDp(int px, int dpi){\n\t\treturn px / (dpi / 160f);\n\t}", "@Override\n public void settings() {\n setSize(WIDTH, HEIGHT);\n }", "public int getFontSize()\n \t{\n \t\treturn 13;\n \t}", "public String getScreenDensity() {\n return (mScreenDensity);\n }", "public void setNPI(int value) {\r\n this.npi = value;\r\n }", "public void setPhysicalProtectScaling(double physicalProtectScaling)\r\n {\r\n this.mPhysicalProtectScaling = physicalProtectScaling;\r\n }", "static public int toPX(int dp)\n\t{ \n\t\tDisplayMetrics displayMetrics = OsoNegroApp.getAndroidActivity().getResources().getDisplayMetrics();\n\t\treturn (int)((dp * displayMetrics.density) + 0.5);\n\t}", "public void setQuality(int value)\n\t{\n\t\tconfigManager.setQuality(value);\n\t\tupdatePreviewSize();\n\t}", "private float convertDpToPixel(float dp){\n Resources resources = getContext().getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return px;\n }", "public void setDiameter(int diameter) {\n circleDiameter = diameter;\n\n }", "public final void setSrcDensityOverride(int density) {\r\n this.mSrcDensityOverride = density;\r\n }", "public void setWheelDiameterText() {\n ThunderBoardPreferences preferences = prefsManager.getPreferences();\n\n float wheelRadius = (preferences.wheelRadius == 0)\n ? ThunderBoardPreferences.DEFAULT_WHEEL_RADIUS : preferences.wheelRadius;\n\n String outString = \"\";\n if (preferences.measureUnitType == ThunderBoardPreferences.UNIT_METRIC) {\n outString = String.format(getString(R.string.motion_diameter_metric), wheelRadius * 200.0f);\n } else {\n outString = String.format(getString(R.string.motion_diameter_us), wheelRadius * 2.0f * 39.37f);\n }\n wheelDiameterText.setText(outString);\n }", "public void setImageIDESize(byte s) {\n this.ideSize = s;\n }", "@Override\n\tpublic void settings() {\n\t\tSystem.out.println(\"settings\");\n\t\tsize(800, 800);\n\t}", "private void setWidth(long value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n }", "public void setScaleFactor(float scaleFactor) {\n\t\ttrueCoreRadius *= scaleFactor;\n\t\ttruePetalRadius *= scaleFactor;\n\t\tcoreRadius = (int) trueCoreRadius;\n\t\tpetalRadius = (int) truePetalRadius;\n\t\tthis.scaleFactor *= scaleFactor;\n\t}", "public void setupRatio(int width) {\n\t\t//reset SpriteCurrentEdge to fix value every level\n\t\tSpriteCurrentEdge = ResourceManager.FixSizeSpriteEdge;\n\t\t\n\t\tSpriteScaleFactor = ResourceManager.getInstance().cameraWidth / (width * SpriteCurrentEdge);\n\t\t\n\t\t//update resize currentEdge\n\t\tSpriteCurrentEdge = (int)Math.ceil(SpriteCurrentEdge * SpriteScaleFactor);\n\t\t\n\t\t/*\n\t\tLog.i(TAG, String.format(\"width:%1$d edge:%2$d scale:%3$f\", width, \n\t\t\t\tGameManager.getInstance().SpriteCurrentEdge,\n\t\t\t\tGameManager.getInstance().SpriteScaleFactor));\n\t\t*/\n\t}", "@Override\r\n\tprotected void update_display_size(double radius_of_system) {\r\n\t\tdouble tempRadius = radius/radius_of_system *2_500_000;\r\n\t\tthis.setSize((int)tempRadius, (int)tempRadius);\r\n\t}", "void setWidth(int width);", "void setWidth(int width);", "public T setResolution(double resolution) {\n this.resolution = resolution;\n return self();\n }", "public void setForcedDensity(int density, int userId) {\n boolean updateCurrent = true;\n if (density == this.mInitialDisplayDensity) {\n }\n if (userId != -2) {\n updateCurrent = false;\n }\n if (this.mWmService.mCurrentUserId == userId || updateCurrent) {\n if (density == 0) {\n Slog.e(TAG, \"density is 0\", new Exception());\n }\n this.mBaseDisplayDensity = density;\n this.mWmService.reconfigureDisplayLocked(this);\n }\n if (!updateCurrent) {\n if (density == this.mInitialDisplayDensity) {\n density = 0;\n }\n this.mWmService.mDisplayWindowSettings.setForcedDensity(this, density, userId);\n }\n }", "public void updateBaseDisplayMetrics(int baseWidth, int baseHeight, int baseDensity) {\n int i;\n if (baseDensity == 0) {\n Slog.e(TAG, \"density is 0\", new Exception());\n }\n if (HwActivityTaskManager.isCastDisplay(getDisplay().getUniqueId(), \"padCast\")) {\n DisplayContent defaultDisplayContent = this.mWmService.getDefaultDisplayContentLocked();\n int defaultDisplayWidth = 0;\n int defaultDisplayHeight = 0;\n if (defaultDisplayContent != null) {\n defaultDisplayWidth = defaultDisplayContent.mBaseDisplayWidth;\n defaultDisplayHeight = defaultDisplayContent.mBaseDisplayHeight;\n }\n float defaultRatio2 = 0.0f;\n float baseRatio = baseWidth != 0 ? ((float) baseHeight) / ((float) baseWidth) : 0.0f;\n float defaultRatio1 = defaultDisplayWidth != 0 ? ((float) defaultDisplayHeight) / ((float) defaultDisplayWidth) : 0.0f;\n if (defaultDisplayHeight != 0) {\n defaultRatio2 = ((float) defaultDisplayWidth) / ((float) defaultDisplayHeight);\n }\n if (Math.abs(baseRatio - defaultRatio1) <= 0.001f || Math.abs(baseRatio - defaultRatio2) <= 0.001f) {\n this.mRotation = 0;\n } else {\n baseWidth = baseHeight;\n baseHeight = baseWidth;\n this.mRotation = 1;\n }\n }\n this.mBaseDisplayWidth = baseWidth;\n this.mBaseDisplayHeight = baseHeight;\n this.mBaseDisplayDensity = baseDensity;\n int i2 = this.mMaxUiWidth;\n if (i2 > 0 && (i = this.mBaseDisplayWidth) > i2) {\n this.mBaseDisplayHeight = (this.mBaseDisplayHeight * i2) / i;\n this.mBaseDisplayDensity = (this.mBaseDisplayDensity * i2) / i;\n this.mBaseDisplayWidth = i2;\n if (WindowManagerDebugConfig.DEBUG_DISPLAY) {\n Slog.v(TAG, \"Applying config restraints:\" + this.mBaseDisplayWidth + \"x\" + this.mBaseDisplayHeight + \" at density:\" + this.mBaseDisplayDensity + \" on display:\" + getDisplayId());\n }\n }\n this.mBaseDisplayRect.set(0, 0, this.mBaseDisplayWidth, this.mBaseDisplayHeight);\n updateBounds();\n this.mDisplayCutoutCache.clearCacheTable();\n }" ]
[ "0.5864924", "0.5721938", "0.5712373", "0.5707574", "0.5701109", "0.56995004", "0.5641481", "0.55722016", "0.55655825", "0.5479813", "0.54341686", "0.53900576", "0.53656197", "0.535949", "0.5358693", "0.5241503", "0.5239868", "0.5092789", "0.5070167", "0.50640625", "0.50558054", "0.504501", "0.5034258", "0.50288534", "0.5018822", "0.50129145", "0.5010068", "0.499181", "0.495951", "0.4940919", "0.49102512", "0.49099404", "0.4892665", "0.48893362", "0.48811027", "0.48717064", "0.48709074", "0.48634183", "0.48534057", "0.4836478", "0.4825239", "0.48240182", "0.47998238", "0.47948328", "0.47872698", "0.47850016", "0.47798684", "0.477341", "0.4767931", "0.47664282", "0.47453338", "0.4743056", "0.4736414", "0.47051466", "0.4689882", "0.466554", "0.4662589", "0.46594185", "0.46385908", "0.4636992", "0.46306998", "0.46142966", "0.46094674", "0.4592195", "0.4586429", "0.45862684", "0.4585348", "0.4578769", "0.45765993", "0.4572532", "0.4571968", "0.45714474", "0.4553664", "0.45524344", "0.45512858", "0.4546151", "0.4545541", "0.45439836", "0.45431694", "0.4538786", "0.45288765", "0.45223087", "0.45207563", "0.4517308", "0.45124403", "0.45094633", "0.45076346", "0.45050615", "0.45022503", "0.44934523", "0.4485879", "0.44824934", "0.44819665", "0.4476981", "0.4475377", "0.44747478", "0.44747478", "0.44704744", "0.44667765", "0.44648916" ]
0.72461885
0
In Prince 9.0 and up you can set the PDF profile.
@javax.annotation.Nullable @ApiModelProperty(value = "In Prince 9.0 and up you can set the PDF profile.") @JsonProperty(JSON_PROPERTY_PROFILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getProfile() { return profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native void setIptcProfile(ProfileInfo profile)\n\t\t\tthrows MagickException;", "public static void main(String[] args) throws IOException {\n\t PDDocument document = new PDDocument();\n\n\t //Creating a blank page\n\t PDPage blankPage = new PDPage();\n\t \n\t //Adding the blank page to the document\n\t document.addPage( blankPage );\n\n\t //Creating the PDDocumentInformation object \n\t PDDocumentInformation pdd = document.getDocumentInformation();\n\n\t //Setting the author of the document\n\t pdd.setAuthor(\"Tutorialspoint\");\n\t \n\t // Setting the title of the document\n\t pdd.setTitle(\"Sample document\"); \n\t \n\t //Setting the creator of the document \n\t pdd.setCreator(\"PDF Examples\"); \n\t \n\t //Setting the subject of the document \n\t pdd.setSubject(\"Example document\"); \n\t \n\t //Setting the created date of the document \n\t Calendar date = new GregorianCalendar();\n\t date.set(2015, 11, 5); \n\t pdd.setCreationDate(date);\n\t //Setting the modified date of the document \n\t date.set(2016, 6, 5); \n\t pdd.setModificationDate(date); \n\t \n\t //Setting keywords for the document \n\t pdd.setKeywords(\"sample, first example, my pdf\"); \n\t \n\t \n\t PDPageContentStream contentStream = new PDPageContentStream(document, blankPage);\n\t \n\t //Begin the Content stream \n\t contentStream.beginText(); \n\t \n\t //Setting the font to the Content stream \n\t contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n\n\t //Setting the position for the line \n\t contentStream.newLineAtOffset(25, 500);\n\n\t String text = \"This is the sample document and we are adding content to it.\";\n\n\t //Adding text in the form of string \n\t contentStream.showText(text); \n\n\t //Ending the content stream\n\t contentStream.endText();\n\n\t System.out.println(\"Content added\");\n\n\t //Closing the content stream\n\t contentStream.close();\n\t \n\t //Saving the document \n\t document.save(\"doc_attributes.pdf\");\n\n\t System.out.println(\"Properties added successfully \");\n\t \n\t //Closing the document\n\t document.close();\n\t}", "public void setProfile(Boolean profile)\n {\n this.profile = profile;\n }", "public void setProfile(Profile profile) {\n _profile = profile;\n }", "public void setProfile( ProjectProfileBO pProfile )\r\n {\r\n mProfile = pProfile;\r\n }", "public void selectProductFormatPdf(String pdfProductFormat)\n \t{\n \t Select country=new Select(productRequirementsPageLocators.selectProductFormat);\n country.selectByVisibleText(pdfProductFormat);\n \t\t\n \t}", "public static void main(String[] args) {\n PdfDocument pdf = new PdfDocument();\r\n\r\n PdfPageBase page = pdf.getPages().add();\r\n\r\n Rectangle2D rectangle2D = new Rectangle.Float();\r\n rectangle2D.setFrame(new Point2D.Double(10,10),new Dimension(100,100));\r\n\r\n PdfPopupAnnotation annotation = new PdfPopupAnnotation(rectangle2D, \"test\");\r\n annotation.setIcon(PdfPopupIcon.Help);\r\n annotation.setOpen(true);\r\n annotation.setAuthor(\"e-iceblue\");\r\n annotation.setSubject(\"subject_popup\");\r\n annotation.setColor(new PdfRGBColor(255,0,150));\r\n\r\n page.getAnnotationsWidget().add(annotation);\r\n String result = \"output/setAuthorAndSubjectForPdfPopupAnnotation.pdf\";\r\n\r\n //Save the document\r\n pdf.saveToFile(result);\r\n\t}", "public void setProfile(Profile profile) {\n\t\tthis.profile = profile;\n\t}", "private void generarDocP(){\n generarPdf(this.getNombre());\n }", "public void preProcessPDF(Object document) {\n Document pdf = (Document) document;\n pdf.setPageSize(PageSize.LETTER.rotate());\n pdf.open();\n }", "public static void main( String[] args ) throws Exception\n {\n if( args.length != 2 )\n {\n System.out.println(\"Usage: <input pdf> <output file>\");\n }\n else\n {\n \tFile file = new File(\"./\"+args[0]);\n \tPDDocument document = PDDocument.load(file);\n\n \t List<PDPage> documentPages = document.getDocumentCatalog().getAllPages();\n\n \t\n try\n {\n \tPDPage page = documentPages.get(0);\n //document.addPage(page);\n List annotations = page.getAnnotations();\n\n // Setup some basic reusable objects/constants\n // Annotations themselves can only be used once!\n\n float inch = 72;\n PDGamma colourGreen = new PDGamma();\n colourGreen.setG(1);\n PDGamma colourBlue = new PDGamma();\n colourBlue.setB(1);\n\n PDBorderStyleDictionary borderThick = new PDBorderStyleDictionary();\n borderThick.setWidth(inch/12); // 12th inch\n PDBorderStyleDictionary borderThin = new PDBorderStyleDictionary();\n borderThin.setWidth(inch/72); // 1 point\n PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary();\n borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE);\n borderULine.setWidth(inch/72); // 1 point\n\n float pw = page.getMediaBox().getUpperRightX();\n float ph = page.getMediaBox().getUpperRightY();\n\n // Add the markup annotation, a highlight to PDFBox text\n PDFont font = PDType1Font.HELVETICA_BOLD;\n PDAnnotationTextMarkup txtMark = new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT);\n txtMark.setColour(colourBlue);\n txtMark.setConstantOpacity((float)0.1); // Make the highlight 20% transparent\n\n // Set the rectangle containing the markup\n\n float textWidth = (font.getStringWidth( \"PDFBox\" )/1000) * 18;\n PDRectangle position = new PDRectangle();\n position.setLowerLeftX(inch);\n position.setLowerLeftY( ph-inch-18 );\n position.setUpperRightX(72 + textWidth);\n position.setUpperRightY(ph-inch);\n txtMark.setRectangle(position);\n\n // work out the points forming the four corners of the annotations\n // set out in anti clockwise form (Completely wraps the text)\n // OK, the below doesn't match that description.\n // It's what acrobat 7 does and displays properly!\n float[] quads = new float[8];\n\n quads[0] = position.getLowerLeftX(); // x1\n quads[1] = position.getUpperRightY()-2; // y1\n quads[2] = position.getUpperRightX(); // x2\n quads[3] = quads[1]; // y2\n quads[4] = quads[0]; // x3\n quads[5] = position.getLowerLeftY()-2; // y3\n quads[6] = quads[2]; // x4\n quads[7] = quads[5]; // y5\n\n txtMark.setQuadPoints(quads);\n txtMark.setContents(\"Highlighted since it's important\");\n\n annotations.add(txtMark);\n\n\n \n\n // Now a square annotation\n\n PDAnnotationSquareCircle aSquare =\n new PDAnnotationSquareCircle( PDAnnotationSquareCircle.SUB_TYPE_SQUARE);\n aSquare.setContents(\"Square Annotation\");\n aSquare.setColour(colourGreen); // Outline in red, not setting a fill\n aSquare.setBorderStyle(borderThick);\n aSquare.setConstantOpacity((float)0.1);\n\n // Place the annotation on the page, we'll make this 1\" (72points) square\n // 3.5\" down, 1\" in from the right on the page\n\n position = new PDRectangle(); // Reuse the variable, but note it's a new object!\n position.setLowerLeftX(pw-(2*inch)); // 1\" in from right, 1\" wide\n position.setLowerLeftY(ph-(float)(3.5*inch) - inch); // 1\" height, 3.5\" down\n position.setUpperRightX(pw-inch); // 1\" in from right\n position.setUpperRightY(ph-(float)(3.5*inch)); // 3.5\" down\n aSquare.setRectangle(position);\n\n // add to the annotations on the page\n annotations.add(aSquare);\n\n\n\n document.save(args[1]);\n }\n finally\n {\n document.close();\n }\n }\n }", "public void setProfile(MetadataProfile profile) {\n\t\tthis.profile = profile;\n\t}", "public void loadPdfFile() {\n PDFView.Configurator configurator;\n RelativeLayout relativeLayout = (RelativeLayout)this.pdfView.getParent();\n this.errorTextView = (TextView)relativeLayout.findViewById(2131296408);\n this.progressBar = (ProgressBar)relativeLayout.findViewById(2131296534);\n this.sharedPreferences = Factory.getInstance().getMainNavigationActivity().getSharedPreferences(\"AppsgeyserPrefs\", 0);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"pdf_saved_page_\");\n stringBuilder.append(this.initialTabId);\n savedPageKey = stringBuilder.toString();\n if (this.pathFile.startsWith(\"file:///\")) {\n String string2 = this.pathFile.replace((CharSequence)\"file:///android_asset/\", (CharSequence)\"\");\n configurator = this.pdfView.fromAsset(string2);\n } else {\n boolean bl = this.pathFile.startsWith(\"http\");\n configurator = null;\n if (bl) {\n String string3 = this.pathFile;\n new LoaderPdf().execute((Object[])new String[]{string3});\n }\n }\n this.pdfView.useBestQuality(true);\n if (configurator == null) return;\n try {\n this.loadConfigurator(configurator);\n return;\n }\n catch (Exception exception) {\n exception.printStackTrace();\n this.progressBar.setVisibility(8);\n }\n }", "public void setProfileProperties(Map<String, Object> profileProperties) {\n this.profileProperties = profileProperties;\n }", "public void onCreatePdf(View view) {\n\n\t\t// Images used in the PDF should be JPG images, stored as Assets\n\t\tbyte[] stickerBmp = Pdf.getAssetJpgBytes(this, JPG_SRC);\n\n\t\t// Create a new PDF\n\t\tPdf pdf = new Pdf();\n\t\tStream stream = pdf.addPage();\n\n\t\t// Add some text at a specific position\n\t\t// The coordinate system is setup where the origin (0,0) is at the\n\t\t// bottom left corner\n\t\tstream.addText(\"This is a test pdf.\", PDF_HEADER_FONT_SIZE, 100, 50, RED);\n\n\t\t// Add some text with a different color\n\t\tstream.addText(userText.getText().toString(), BLUE, PDF_HEADER_FONT_SIZE);\n\n\t\t// Add a line with a color and a width\n\t\tstream.addHorizontalLine(GREEN, LINE_WIDTH);\n\n\t\t// Add an image at a specific coordinate (top right corner of the page)\n\t\tstream.addBmpImage(Pages.PAGE_WIDTH - (int) Stream.MARGIN_HORIZONTAL - JPG_WIDTH, Pages.PAGE_HEIGHT - (int) Stream.MARGIN_VERTICAL - JPG_HEIGHT,\n\t\t\t\tJPG_WIDTH, JPG_HEIGHT, stickerBmp);\n\n\t\t// Get the raw PDF bytes like this:\n\t\tbyte[] pdfBytes = pdf.getPDF();\n\n\t\t// Optionally, write the bytes out to a file:\n\t\tFile file = Pdf.writePdf(this, pdfBytes, PDF_PDFNAME);\n\n\t\t// Show the PDF in an external viewer\n\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\tUri uri = Uri.fromFile(file);\n\t\tintent.setDataAndType(uri, MIME_TYPE_PDF);\n\t\tstartActivity(intent);\n\n\t}", "public native void setColorProfile(ProfileInfo profile)\n\t\t\tthrows MagickException;", "@Override\n public void setActiveProfile(String profileName) {\n }", "@Test\r\n\tpublic void testCreatePdf(){\n\t}", "public Pdf417lib() {\n\t\tsetDefaultParameters();\n\t}", "public void genPDF(String qfname)\r\n\t{\n\t\tboolean res = loadQg(qfname);\r\n\t\tif(!res)\r\n\t\t{\r\n\t\t\tmsg = \"(PDFW:GenPDF) Can not load questions from: \"+qfname;\r\n\t\t\tJOptionPane.showMessageDialog(null, msg);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void setPdfId(Integer pdfId) {\r\n this.pdfId = pdfId;\r\n }", "private void getPDF(){\r\n\t\t\r\n\t\tif(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_ADMIN)){\r\n\t\t\tgetAdministration(); // pdf uses same data\r\n\t\t} else if(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_TEACHER)){\r\n\t\t\tgetEventRegistration(); // pdf uses same data\r\n\t\t}\r\n\t\t\r\n\t\tPDFGenerator pdfGen = new PDFGenerator();\r\n\t\tpdfGen.createDocument(request, response);\r\n\t\t\r\n\t\tString eventTitle = \"all\";\r\n\t\t\r\n\t}", "public void create() {\n PDDocument document = new PDDocument();\n PDPage page = new PDPage();\n document.addPage(page);\n\n // Create a new font object selecting one of the PDF base fonts\n PDFont font = PDType1Font.HELVETICA_BOLD;\n try (document) {\n // Start a new content stream which will \"hold\" the to be created content\n writeDataToDocument(document, page, font);\n // Save the results and ensure that the document is properly closed:\n document.save(\"Hello World.pdf\");\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n }", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "public void createPDF(Loan loan, boolean isSwedish, String path, int count, String pathname) \n throws FileNotFoundException, DocumentException {\n log.info(\"createPDF : {} -- {}\", path, isSwedish);\n\n this.isSwedish = isSwedish;\n\n switch (pathname) {\n case \"local\":\n externalPath = LOCAL_EXTERNAL_FILES;\n break;\n case \"dina-loans\":\n externalPath = REMOTE_EXTERNAL_FILES_LOANS;\n break;\n default:\n externalPath = REMOTE_EXTERNAL_FILES_AS;\n break;\n }\n\n StringBuilder sb = new StringBuilder();\n sb.append(path);\n sb.append(\"/loanrequest_\");\n sb.append(loan.getId());\n\n File summaryAdminFile = new File(sb.toString() + \"_admin.pdf\"); \n sb.append(\".pdf\");\n File summaryFile = new File(sb.toString().trim()); \n\n document = new Document(PageSize.LETTER);\n adminDocument = new Document(PageSize.LETTER);\n PdfWriter.getInstance(document, new FileOutputStream(summaryFile));\n PdfWriter.getInstance(adminDocument, new FileOutputStream(summaryAdminFile));\n document.open();\n adminDocument.open();\n\n addTitle(loan);\n addContact(loan);\n\n switch (count) {\n case 9:\n addLoanRequestForScientificPurpose(loan);\n addLoanSampleList(loan);\n if (!RequestType.Information.isInformation(loan.getType())) {\n if (RequestType.Physical.isPhysical(loan.getType())) {\n addDestructiveInformation(loan);\n } else {\n addPhotoInformation(loan);\n }\n addCITESInformation(loan);\n } break;\n case 7:\n addEducationRequest(loan);\n break;\n default:\n addCommercialInformation(loan);\n break;\n }\n\n if (!RequestType.Information.isInformation(loan.getType())) {\n addTermsOfLoanAgreement();\n }\n document.close();\n adminDocument.close();\n }", "private void _generateAnAssistantProfessor(int index) {\n String id = _getId(CS_C_ASSTPROF, index);\n writer_.startSection(CS_C_ASSTPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#AssistantProfessor\", true); \t\n }\n _generateAProf_a(CS_C_ASSTPROF, index, id);\n writer_.endSection(CS_C_ASSTPROF);\n _assignFacultyPublications(id, ASSTPROF_PUB_MIN, ASSTPROF_PUB_MAX);\n }", "public void setProfile(String profile) {\n this.profile = profile == null ? null : profile.trim();\n }", "public void createPdf() {\n\t\tDocument document = new Document();\n\t\ttry {\n\t\t\tPdfWriter.getInstance(document, new FileOutputStream(fileName));\n\t\t\tFont header = new Font(Font.FontFamily.HELVETICA, 15, Font.BOLD);\n\t\t\tdocument.open();\n\t\t\t// set the title on the page as \"My Albums\"\n\t\t\tif (state.equals(\"a\")) {\n\t\t\t\tParagraph aHead = new Paragraph();\n\t\t\t\taHead.setFont(header);\n\t\t\t\taHead.add(\"My Albums\\n\\n\");\n\t\t\t\tdocument.add(aHead);\n\t\t\t}\n\t\t\t// or set the title on the page as \"My Publications\"\n\t\t\telse if (state.equals(\"p\")) {\n\t\t\t\tParagraph pHead = new Paragraph();\n\t\t\t\tpHead.setFont(header);\n\t\t\t\tpHead.add(\"My Publications\\n\\n\");\n\t\t\t\tdocument.add(pHead);\n\t\t\t}\n\t\t\t// create the table of albums/publications\n\t\t\tdocument.add(createTable());\n\t\t\tdocument.close();\n\t\t\tFile f = new File(fileName);\n\t\t\ttry {\n\t\t\t\tDesktop.getDesktop().browse(f.toURI());\n\t\t\t}\n\t\t\tcatch(IOException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (DocumentException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void overrideProfileSize() {\n }", "public void createPdf(Context context) {\n PdfDocument document = new PdfDocument();\n\n // crate a page description\n PdfDocument.PageInfo pageInfo =\n new PdfDocument.PageInfo.Builder(500, 500, 2).create();\n\n // start a page\n PdfDocument.Page page = document.startPage(pageInfo);\n\n Canvas canvas = page.getCanvas();\n\n Paint paint = new Paint();\n paint.setColor(Color.CYAN);\n\n //canvas.drawCircle(50, 50, 30, paint);\n\n document.finishPage(page);\n\n\n // Create Page 2\n pageInfo = new PdfDocument.PageInfo.Builder(500, 600, 1).create();\n page = document.startPage(pageInfo);\n canvas = page.getCanvas();\n paint = new Paint();\n paint.setColor(Color.BLUE);\n\n\n //print alldata to pdf\n\n\n Cursor res = myDb.GetSumOfColumns(\"Subscriptions\", \"amount\");\n Cursor result = myDb.GetSumOfColumns(\"Expenses\", \"amount\");\n Cursor cashResult = myDb.GetPayModeTotals(\"Subscriptions\", \"paymode\", \"Cash\");\n Cursor EcocashResult = myDb.GetPayModeTotals(\"Subscriptions\", \"paymode\", \"EcoCash\");\n Cursor BankcashResult = myDb.GetPayModeTotals(\"Subscriptions\", \"paymode\", \"Bank\");\n\n if (res.moveToFirst() && result.moveToFirst() && cashResult.moveToFirst() && EcocashResult.moveToFirst()\n && BankcashResult.moveToFirst()) {\n\n String alldata = res.getString(0);\n String allexpe = result.getString(0);\n String cashres = cashResult.getString(0);\n String ecores = EcocashResult.getString(0);\n String bankres = BankcashResult.getString(0);\n\n int income = 0;\n try {\n\n income = parseInt(alldata) - parseInt(allexpe);\n } catch (Exception e) {\n income = 0;\n }\n\n canvas.drawText(\"Income and Expenditure Statement for the period from ?? to ??\", 100, 160, paint);\n canvas.drawText(\"Income Received : \", 30, 210, paint);\n canvas.drawText(\" Cash : ' \" + cashres + \"' \", 30, 230, paint);\n canvas.drawText(\" Ecocash: ' \" + ecores + \"' \", 30, 250, paint);\n canvas.drawText(\" Bank : ' \" + bankres + \"' \", 30, 270, paint);\n canvas.drawText(\" Total : ' \" + alldata + \" '\", 30, 290, paint);\n canvas.drawText(\"Less Expenses : \", 30, 310, paint);\n canvas.drawText(\" Expense '( \" + allexpe + \")' \", 30, 330, paint);\n canvas.drawText(\"Net Income : \", 30, 350, paint);\n canvas.drawText(\" : Net ' \" + income + \" '\", 30, 370, paint);\n canvas.drawText(\"Compiled By: Secretary _______________ \", 30, 460, paint);\n canvas.drawText(\"Date : \", 30, 490, paint);\n\n }\n\n\n // finish the page\n document.finishPage(page);\n\n // write the document content\n File folder = new File(Environment.getExternalStorageDirectory() +\n File.separator + \"EasySecretary/Income Expenditure/\");\n boolean success = true;\n if (!folder.exists()) {\n success = folder.mkdirs();\n }\n if (success) {\n // Do something on success\n } else {\n // Do something else on failure\n }\n //appending cuurent timestamp to my generated file\n\n Date_Operations dateOp = new Date_Operations();\n String currenttime = dateOp.GetCurrentTimeAndDate();\n\n\n //String targetPdf = \"/sdcard/EasySecretary/Income and Expenditure '\"+currenttime+\"'.pdf\";\n String targetPdf = \"/sdcard/EasySecretary/Income Expenditure/Income and Expenditure \"+currenttime+\".pdf\";\n File filePath = new File(targetPdf);\n try {\n document.writeTo(new FileOutputStream(filePath));\n Toast.makeText(context, \"Pdf stored in \\n \" + targetPdf, Toast.LENGTH_LONG).show();\n } catch (IOException e) {\n e.printStackTrace();\n Toast.makeText(context, \"Something wrong: \" + e.toString(),\n Toast.LENGTH_LONG).show();\n }\n\n // close the document\n document.close();\n\n }", "public void preProcessPDF(final Object document) throws IOException, BadElementException, DocumentException {\n\t\tDocument pdf = (Document) document;\n\t\tpdf.open();\n\t\tpdf.setPageSize(PageSize.A4);\n\t\tServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();\n\t\ttry {\n\t\t\tString logo = servletContext.getRealPath(\"\") + File.separator + \"images\" + File.separator + \"school_logo.png\";\n\t\t\tpdf.add(Image.getInstance(logo));\n\t\t} catch (IOException e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\tpdf.addTitle(this.sessionBean.getCurrentBranch().getName());\n\t\tpdf.addHeader(\"Header\", \"Fee collected\");\n\t}", "public void onStartPage(PdfWriter writer, Document document){}", "public JDPdf(PDFConfiguration config) {\n\t\tsuper();\n\t\tthis.configuration = config;\n\t\tthis.setTitle(ApplicationInternationalization.getString(\"PDFDialog_Title\"));\n\t\t\n\t\tsetDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n\t\tthis.addWindowListener(new WindowAdapter() {\n\t\t\tpublic void windowClosing(WindowEvent evt) {\n closeWin();\n\t\t\t}\n });\n\t\t\n\t\tinitGUI();\n\t}", "public static void main(String[] args) throws IOException {\n\t\tPdf pdf1 = new Pdf();\n\t\t// Assign a security instance to Pdf object\n\t\tpdf1.setSecurity(new Security());\n\t\t// Restrict annotation modification\n\t\tpdf1.getSecurity().isAnnotationsModifyingAllowed(false);\n\t\t// Restrict contents modification\n\t\tpdf1.getSecurity().isContentsModifyingAllowed(false);\n\t\t// Restrict copying the data\n\t\tpdf1.getSecurity().isCopyingAllowed(false);\n\t\t// Allow to print the document\n\t\tpdf1.getSecurity().isCopyingAllowed(true);\n\t\t// Restrict form filling\n\t\tpdf1.getSecurity().isFormFillingAllowed(false);\n\t\t// Add a section in the Pdf\n\t\tSection sec1 = pdf1.getSections().add();\n\t\t// Create a text paragraph\n\t\tText text1 = new Text(sec1, \"this is text content\");\n\t\t// Set the top maring of text paragraph to 30\n\t\ttext1.getMargin().setTop(30);\n\t\t// Add the text paragraph to the section\n\t\tsec1.getParagraphs().add(text1);\n\t\t// Save the Pdf\n\t\tFileOutputStream fileOut = new FileOutputStream(new File(\"Test.pdf\"));\n\t\tpdf1.save(fileOut);\n\t}", "@Override\n\tpublic void createPDF(){\n File xsltFile = new File(RESOURCES_DIR + \"/pdfBook.xsl\");\n \n // the XML file which provides the input\n StreamSource xmlSource = new StreamSource(file);\n \n // create an instance of fop factory\n FopFactory fopFactory = FopFactory.newInstance();\n \n // a user agent is needed for transformation\n FOUserAgent foUserAgent = fopFactory.newFOUserAgent();\n \n // Setup output\n OutputStream out = null;\n try {\n\t\t\tout = new java.io.FileOutputStream(OUTPUT_DIR + \"/output.pdf\");\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n try {\n // Construct fop with desired output format\n Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);\n\n // Setup XSLT\n TransformerFactory factory = TransformerFactory.newInstance();\n Transformer transformer = factory.newTransformer(new StreamSource(xsltFile));\n\n // Resulting SAX events (the generated FO) must be piped through to\n // FOP\n Result res = new SAXResult(fop.getDefaultHandler());\n\n // Start XSLT transformation and FOP processing\n // That's where the XML is first transformed to XSL-FO and then\n // PDF is created\n try {\n\t\t\t\ttransformer.transform(xmlSource, res);\n\t\t\t} catch (TransformerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n } catch (FOPException | TransformerConfigurationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} finally {\n try {\n\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n }", "public boolean setupPreview(String filePath, String appl, int pageNumber) {\n \tif(!Global.loadPdfs) return false;\n\t\t// Fix stupid Windows file separation characters\n \tString whichOS = System.getProperty(\"os.name\");\n\t\tif (whichOS.contains(\"Windows\")) {\n\t\t\tfilePath = filePath.replace(\"\\\\\",\"/\");\n\t\t}\n \tif (appl.equals(\"pdf\")) {\n \t\t\n \t\tPDDocument document = null;\n \t\ttry {\n\t\t\t\tdocument = PDDocument.load( filePath );\n\t\t\t\tif (document.getNumberOfPages() <= pageNumber)\n\t\t\t\t\treturn false;\n\t\t\t\tif (document.getDocumentCatalog().getAllPages().size() <= pageNumber)\n\t\t\t\t\treturn false;\n\t\t\t\tPDPage page = (PDPage)document.getDocumentCatalog().getAllPages().get( pageNumber );\n\t\t\t\tBufferedImage bi = page.convertToImage();\n\t\t\t\t\n\t\t\t\tFile outputfile;\n\t\t\t\toutputfile = new File(filePath +\".png\");\n\t\t\t\tImageIO.write(bi, \"png\", outputfile);\n\t\t\t\treturn true;\n \t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\treturn false;\n\t\t\t}\n \t}\n \treturn false;\n\n }", "public PdfFontProgram() {\n super();\n }", "public PDFProperties (){\n\t\tthis.title = DEFAULT_TITLE;\n\t\tthis.subtitle = DEFAULT_SUBTITLE;\n\t\tthis.spacing = DEFAULT_SPACING;\n\t\tthis.elementsize = DEFAULT_ELEMENTSIZE;\n\t\tthis.pagesize = DEFAULT_PAGESIZE;\n\t\tthis.title_fontsize = DEFAULT_TITLE_FONTSIZE;\n\t\tthis.subtitle_fontsize = DEFAULT_SUBTITLE_FONTSIZE;\n\t\tthis.leftmargin = DEFAULT_LEFTMARGIN;\n\t\tthis.rightmargin = DEFAULT_RIGHTMARGIN;\n\t\tthis.measurespace = DEFAULT_MEASURESPACE;\n\t}", "public static void setEnabledProfile(int profile) {\n if (enabledMenuItem != null) {\n enabledMenuItem.disableProfile();\n }\n\n // Also allow the signer tab to disable the signer\n if (profile == 0) {\n enabledMenuItem.disableProfile();\n enabledMenuItem = null;\n } else {\n\n // I don't want to keep a map of all the profiles. Just iterate through them until we find the right one\n for (MasherySignerMenuItem menuItem : menuItems) {\n if (menuItem.getProfileNumber() == profile) {\n menuItem.enableProfile();\n enabledMenuItem = menuItem;\n }\n }\n }\n }", "@Override\r\n\tpublic void createPDF(HttpServletRequest request, OutputStream os) {\n\t\t\r\n\t}", "public JPDV1(Principal P) {\n this.Princi = P;\n initComponents();\n }", "public void PDF() {\n try {\r\n /* try {\r\n ImageIO.write(Imagen, \"png\", new File(Path + \"1\" + \".png\"));\r\n } catch (IOException ex) {\r\n Logger.getLogger(panelprincipal.getName()).log(Level.SEVERE, null, ex);\r\n }*/\r\n Image imagen = Image.getInstance(jfc.getSelectedFile().getPath() + \"#\" + \".png\");\r\n imagen.scaleAbsolute(500, 400);\r\n imagen.setAlignment(Element.ALIGN_CENTER);\r\n FileOutputStream archivo = new FileOutputStream(jfc.getSelectedFile().getPath() + \".PDF\");\r\n Document d = new Document();\r\n PdfWriter.getInstance(d, archivo);\r\n PDF creacion = new PDF();\r\n d.open();\r\n d.setPageSize(PageSize.LETTER);\r\n d.add(creacion.setTitulo(nombrediagrama));\r\n //doc.add(new Paragraph(\" Carlos Wilfredo Romero Maradiaga \\n\"));\r\n d.add(imagen);\r\n // doc.add(pdf.getCuerpo(\"\\nCódigo Generado:\\n\"));\r\n /* if (codigo.length()<2) {\r\n doc.add(pdf.getCuerpo(\"Para poder visualizar el código, primero debe generarlo desde el Sistema y vuelva a guardar el archivo.\"));\r\n } else {\r\n doc.add(pdf.getCuerpo(codigo));\r\n */\r\n d.close();\r\n JOptionPane.showMessageDialog(null, \"El PDF se genero excelente\", \"Excelente\", JOptionPane.INFORMATION_MESSAGE);\r\n } catch (Exception e) {\r\n }\r\n }", "public void printCard(String name, String number, String age, String grade, \n\t\t\tString country, String bio, String filepath) {\n\t\tPDFCreator p = new PDFCreator(name,number,age,grade,country,bio,filepath);\n\t}", "private void createPdf(String sometext) {\n PdfDocument document = new PdfDocument();\n // crate a page description\n PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(300, 600, 1).create();\n // start a page\n PdfDocument.Page page = document.startPage(pageInfo);\n Canvas canvas = page.getCanvas();\n Paint paint = new Paint();\n paint.setColor(Color.RED);\n canvas.drawCircle(50, 50, 30, paint);\n paint.setColor(Color.BLACK);\n canvas.drawText(sometext, 80, 50, paint);\n //canvas.drawt\n // finish the page\n document.finishPage(page);\n // draw text on the graphics object of the page\n // Create Page 2\n pageInfo = new PdfDocument.PageInfo.Builder(300, 600, 2).create();\n page = document.startPage(pageInfo);\n canvas = page.getCanvas();\n paint = new Paint();\n paint.setColor(Color.BLUE);\n canvas.drawCircle(100, 100, 100, paint);\n document.finishPage(page);\n\n // write the document content\n String directory_path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/mypdf/\";\n File file = new File(directory_path);\n if (!file.exists()) {\n file.mkdirs();\n }\n double random_double = Math.random() * (999999 - 999 + 1) + 999;\n String targetPdf = directory_path + String.valueOf(random_double) + \".pdf\";\n File filePath = new File(targetPdf);\n try {\n document.writeTo(new FileOutputStream(filePath));\n Toast.makeText(this, \"Done\", Toast.LENGTH_LONG).show();\n } catch (IOException e) {\n Log.e(\"main\", \"error \" + e.toString());\n Toast.makeText(this, \"Something wrong: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n // close the document\n document.close();\n }", "public void setProfileManager(ProfileManager profileManager) {\n _profileManager = profileManager;\n }", "public void setProfileName(PosSymbol name) {\n this.profileName = name;\n }", "public void createPdf(String dest) throws IOException, DocumentException, XMPException {\n Document document = new Document(PageSize.A4.rotate());\n //PDF/A-3b\n //Create PdfAWriter with the required conformance level\n PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream(dest), PdfAConformanceLevel.ZUGFeRD);\n writer.setPdfVersion(PdfWriter.VERSION_1_7);\n //Create XMP metadata\n writer.createXmpMetadata();\n writer.getXmpWriter().setProperty(PdfAXmpWriter.zugferdSchemaNS, PdfAXmpWriter.zugferdDocumentFileName, \"invoice.xml\");\n //====================\n document.open();\n //PDF/A-3b\n //Set output intents\n ICC_Profile icc = ICC_Profile.getInstance(new FileInputStream(ICC));\n writer.setOutputIntents(\"Custom\", \"\", \"http://www.color.org\", \"sRGB IEC61966-2.1\", icc);\n //===================\n\n Paragraph p = new Paragraph();\n //PDF/A-3b\n //Embed font\n p.setFont(FontFactory.getFont(FONT, BaseFont.WINANSI, BaseFont.EMBEDDED, 20));\n //=============\n Chunk c = new Chunk(\"The quick brown \");\n p.add(c);\n Image i = Image.getInstance(FOX);\n c = new Chunk(i, 0, -24);\n p.add(c);\n c = new Chunk(\" jumps over the lazy \");\n p.add(c);\n i = Image.getInstance(DOG);\n c = new Chunk(i, 0, -24);\n p.add(c);\n document.add(p);\n\n PdfDictionary parameters = new PdfDictionary();\n parameters.put(PdfName.MODDATE, new PdfDate());\n PdfFileSpecification fileSpec = writer.addFileAttachment(\n \"ZUGFeRD invoice\", null, XML,\n \"invoice.xml\", \"application/xml\",\n AFRelationshipValue.Alternative, parameters);\n PdfArray array = new PdfArray();\n array.add(fileSpec.getReference());\n writer.getExtraCatalog().put(PdfName.AF, array);\n\n document.close();\n }", "public Object getPrinter(PageFormat pf);", "private void createPdf()\n {\n Document document = new Document();\n try {\n String path = Environment.getExternalStorageDirectory().getAbsolutePath()+\"/Meal Counter\";\n File directory = new File(path);\n if(!directory.exists())\n directory.mkdir();\n\n File file = new File(directory,sharedPreferenceData.getmyCurrentSession()+\".pdf\");\n reportPath = file.getAbsolutePath();\n FileOutputStream fileOutputStream = new FileOutputStream(file);\n PdfWriter.getInstance(document,fileOutputStream);\n document.setPageSize(PageSize.A4);\n document.open();\n Paragraph paragraph;\n Font smallFont = new Font(Font.FontFamily.TIMES_ROMAN,22.0f,Font.NORMAL, BaseColor.BLACK);\n Font largeFont = new Font(Font.FontFamily.TIMES_ROMAN,30.0f,Font.BOLD, BaseColor.BLACK);\n paragraph = new Paragraph(\"Session : #\"+sharedPreferenceData.getmyCurrentSession()+\"\\n\\n\"+\n \"Total Taka ------ \"+monthlyTaka+\"\\n\"+\n \"Total Meal ------ \"+monthlyMeal+\"\\n\"+\n \"Total Cost ------ \"+monthlyCost+\"\\n\"+\n \"Remain ------ \"+remain+\"\\n\"+\n \"Meal rate ------ \"+mealRate+\"\\n\\n\\n\",largeFont);\n paragraph.setAlignment(Paragraph.ALIGN_CENTER);\n //document.add(paragraph);\n\n float[] columnWidth = {6f,9f,9f,9f,9f,9f};\n PdfPTable table = new PdfPTable(columnWidth);\n table.setWidthPercentage(90f);\n\n insertDataIntoTable(table,\"Serial\", Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,\"Name\", Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,\"Taka\", Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,\"Meal\", Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,\"Cost\", Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,\"Status\", Element.ALIGN_CENTER,1,smallFont);\n table.setHeaderRows(1);\n\n for(int i=0;i<modelList.size();i++)\n {\n insertDataIntoTable(table,String.valueOf(i+1),Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,modelList.get(i).getId(),Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,modelList.get(i).getTaka(),Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,modelList.get(i).getName(),Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,modelList.get(i).getDate(),Element.ALIGN_CENTER,1,smallFont);\n insertDataIntoTable(table,modelList.get(i).getStatus(),Element.ALIGN_CENTER,1,smallFont);\n }\n\n paragraph.add(table);\n document.add(paragraph);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (DocumentException e) {\n e.printStackTrace();\n }finally {\n document.close();\n\n }\n }", "public static void main(String[] args) {\n\t\tString path = \"Test1.pdf\";\n\t\t\n\n\t}", "private void _generateAnAssociateProfessor(int index) {\n String id = _getId(CS_C_ASSOPROF, index);\n writer_.startSection(CS_C_ASSOPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#AssociateProfessor\", true); \t\n }\n _generateAProf_a(CS_C_ASSOPROF, index, id);\n writer_.endSection(CS_C_ASSOPROF);\n _assignFacultyPublications(id, ASSOPROF_PUB_MIN, ASSOPROF_PUB_MAX);\n \n }", "public void setFile(PDFileSpecification f) {\n/* 409 */ this.stream.setItem(COSName.F, (COSObjectable)f);\n/* */ }", "@SneakyThrows\n private void pdfReport() {\n NotificationUtil.warningAlert(\"Warning\", \"Nothing to export\", NotificationUtil.SHORT);\n ServiceFactory.getPdfService().projectReport(table.getItems());\n }", "public static void main(String[] args) {\n String dataDir = Utils.getDataDir(SavingAPassProtectPresWithReadAccessToDocProps.class);\n\n //ExStart:SavingAPassProtectPresWithReadAccessToDocProps\n // Instantiate a Presentation object that represents a PPT file\n Presentation pres = new Presentation();\n try {\n // ....do some work here.....\n\n // Setting access to document properties in password protected mode\n pres.getProtectionManager().setEncryptDocumentProperties(false);\n\n // Setting Password\n pres.getProtectionManager().encrypt(\"pass\");\n\n // Save your presentation to a file\n pres.save(dataDir + \"demoPassDocument.pptx\", com.aspose.slides.SaveFormat.Pptx);\n } finally {\n if (pres != null) pres.dispose();\n }\n //ExEnd:SavingAPassProtectPresWithReadAccessToDocProps\n }", "void setPaperSize(short size);", "public File createPDF(File file) {\n //\tReportEngine re = ReportEngine.get (getCtx(), ReportEngine.PAYMENT, getC_Payment_ID());\n //\tif (re == null)\n return null;\n //\treturn re.getPDF(file);\n }", "private void getPDF() {\n //for greater than lolipop versions we need the permissions asked on runtime\n //so if the permission is not available user will go to the screen to allow storage permission\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,\n Uri.parse(\"package:\" + getPackageName()));\n startActivity(intent);\n return;\n }\n\n //creating an intent for file chooser\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select PDF File\"), PICK_PDF_CODE);\n }", "public static void main(String[] args) throws Exception {\n PdfDocument doc = new PdfDocument();\r\n //Set margin\r\n PdfUnitConvertor unitCvtr = new PdfUnitConvertor();\r\n PdfMargins margin = new PdfMargins();\r\n margin.setTop(unitCvtr.convertUnits(2.54f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setBottom(margin.getTop());\r\n margin.setLeft(unitCvtr.convertUnits(3.17f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setRight(margin.getLeft());\r\n\r\n drawCover(doc.getSections().add(), margin);\r\n drawContent(doc.getSections().add(), margin);\r\n drawPageNumber(doc.getSections().get(1), margin, 1, doc.getSections().get(1).getCount());\r\n\r\n //Save pdf file.\r\n doc.saveToFile(\"output/pagination.pdf\");\r\n doc.close();\r\n }", "@Override\n\tprotected void setProfile(List<Step> arg0, List<Step> arg1) {\n\t\t\n\t}", "public void visitPOSPrinter( DevCat devCat ) {}", "public void setFile(PDFileSpecification f)\n {\n stream.setItem(COSName.F, f);\n }", "@Override\n public void setContentProportion(int good, int firstpageNum) {\n }", "public void drawPage(PDPage p) throws IOException\n {\n page = p;\n\n\tPDRectangle cropBox = page.findCropBox();\n\tfloat widthPt = cropBox.getWidth();\n\tfloat heightPt = cropBox.getHeight();\n\t// float scaling = resolution / (float)DEFAULT_USER_SPACE_UNIT_DPI;\n\tfloat scaling = (float)1.0;\n\tint widthPx = Math.round(widthPt * scaling);\n\tint heightPx = Math.round(heightPt * scaling);\n\t//TODO The following reduces accuracy. It should really be a Dimension2D.Float.\n\tpageSize = new Dimension( (int)widthPt, (int)heightPt );\n\n\tsetPageAffineTransform(page);\n if ( page.getContents() != null) \n {\n PDResources resources = page.findResources();\n processStream( page, resources, page.getContents().getStream() );\n }\n List<PDAnnotation> annotations = page.getAnnotations();\n for( int i=0; i<annotations.size(); i++ )\n {\n PDAnnotation annot = (PDAnnotation)annotations.get( i );\n PDRectangle rect = annot.getRectangle();\n String appearanceName = annot.getAppearanceStream();\n PDAppearanceDictionary appearDictionary = annot.getAppearance();\n if( appearDictionary != null )\n {\n if( appearanceName == null )\n {\n appearanceName = \"default\";\n }\n Map<String, PDAppearanceStream> appearanceMap = appearDictionary.getNormalAppearance();\n if (appearanceMap != null) \n { \n PDAppearanceStream appearance = \n (PDAppearanceStream)appearanceMap.get( appearanceName ); \n if( appearance != null ) \n { \n Point2D point = new Point2D.Float(rect.getLowerLeftX(), rect.getLowerLeftY());\n Matrix matrix = appearance.getMatrix();\n if (matrix != null) \n {\n // transform the rectangle using the given matrix \n AffineTransform at = matrix.createAffineTransform();\n at.transform(point, point);\n }\n\t\t\t// g.translate( (int)point.getX(), -(int)point.getY() );\n processSubStream( page, appearance.getResources(), appearance.getStream() ); \n\t\t\t// g.translate( -(int)point.getX(), (int)point.getY() ); \n }\n }\n }\n }\n\n }", "public void setNamePro(String namePro) {\n this.namePro = namePro;\n }", "public static void main(String[] args) {\n JFileChooser f = new JFileChooser();\n f.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n f.showSaveDialog(null);\n\n //System.out.println(f.getCurrentDirectory());\n \n \n String destinationFolder = f.getSelectedFile().toString();\n \n //check if OS is Windows, Linux or Mac and change file path\n String operatingSystem = System.getProperty(\"os.name\").toLowerCase();\n char c = operatingSystem.charAt(0);\n String FILE = \"\";\n if (c == 'w') {\n \tFILE = destinationFolder + \"\\\\FirstPdf.pdf\";\n } else {\n \tFILE = destinationFolder + \"/FirstPdf.pdf\";\n }\n \n\n\n try {\n Document document = new Document();\n PdfWriter.getInstance(document, new FileOutputStream(FILE));\n\n //create new font for the unicode symbols\n //font is in fonts folder\n BaseFont baseFont = BaseFont.createFont(\"fonts/arialuni.ttf\", BaseFont.IDENTITY_H, true);\n Font fontRed = new Font(baseFont, 18, Font.BOLD, BaseColor.RED);\n Font fontBlack = new Font(baseFont, 18, Font.BOLD, BaseColor.BLACK);\n document.open();\n\n //create table with 4 columns\n PdfPTable table = new PdfPTable(4);\n\n //create table header row\n PdfPCell c1 = new PdfPCell(new Phrase(\"Hearts\"));\n c1.setBorder(Rectangle.NO_BORDER);\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\n table.addCell(c1);\n\n c1 = new PdfPCell(new Phrase(\"Diamonds\"));\n c1.setBorder(Rectangle.NO_BORDER);\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\n table.addCell(c1);\n\n c1 = new PdfPCell(new Phrase(\"Clubs\"));\n c1.setBorder(Rectangle.NO_BORDER);\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\n table.addCell(c1);\n\n c1 = new PdfPCell(new Phrase(\"Spades\"));\n c1.setBorder(Rectangle.NO_BORDER);\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\n table.addCell(c1);\n table.setHeaderRows(1);\n\n\n //cards symbols and suites\n String[] cards = {\"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"J\", \"Q\", \"K\", \"A\"};\n String[] symbols = {\"\\u2665\", \"\\u2666\", \"\\u2663\", \"\\u2660\"};\n\n for (int i = 0; i < 13; i++) {\n for (int j = 0; j < 4; j++) {\n //fill cards, first two cards - red, other two - black\n if ( j < 2) {\n c1 = new PdfPCell(new Phrase(cards[i] + symbols[j], fontRed));\n } else {\n c1 = new PdfPCell(new Phrase(cards[i] + symbols[j], fontBlack));\n }\n c1.setVerticalAlignment(Element.ALIGN_MIDDLE);\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\n c1.setBackgroundColor(BaseColor.LIGHT_GRAY);\n c1.setBorderColor(BaseColor.WHITE);\n c1.setFixedHeight(150);\n\n c1.setBorderWidth(20);\n table.addCell(c1);\n table.setHorizontalAlignment(Element.ALIGN_CENTER);\n }\n }\n\n document.add(table);\n\n document.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(\"You can find your file at: \" + FILE);\n }", "public void setPcaProperties(java.util.Properties data) {\r\n setParam(KEYNAME_PCAPROPERTIES,data);\r\n }", "public PDFInfo(Blob inBlob, String inPassword) {\n pdfBlob = inBlob;\n password = inPassword;\n }", "public interface PdfProvider {\n /**\n * Create a thumbnail image for a given PDF file.\n *\n * @param inputFile Input file.\n * @param outputStream OutputStream, to which the thumbnail is written. Important: Stream is not closed!\n * @param format Output file format given as a MIME type.\n * @param width Width in pixel.\n * @param height Height in pixel.\n * @param quality Quality factor for output compression.\n * @param speedHint Speed factor for conversion.\n * @throws Exception on any error opening the file, converting the file or writing to the output.\n */\n\n void createThumbNail(File inputFile, OutputStream outputStream,\n String format, int width, int height,\n ConversionCommand.CompressionQuality quality,\n ConversionCommand.SpeedHint speedHint) throws Exception;\n\n PdfDocumentInformation getDocumentInformation(File pdfFile) throws Exception;\n\n int countPages(File pdfFile) throws Exception;\n\n void createPdfFromImages(File[] imageFiles, PdfDocumentInformation documentInformation, File outputPdfFile) throws Exception;\n\n void createPdfFromImages(byte[][] imageFileByteArrays, PdfDocumentInformation documentInformation,\n int width, int height, OutputStream outputStream) throws Exception;\n}", "public void setProfiles(Set<Profile> profiles) {\n\t\tthis.profiles = profiles;\n\t}", "private void addMetaData() {\r\n\t\tdocument.open();\r\n\t\tdocument.addTitle(\"My first PDF\");\r\n\t\tdocument.addSubject(\"Using iText\");\r\n\t\tdocument.addKeywords(\"Java, PDF, iText\");\r\n\t\tdocument.addAuthor(\"Lars Vogel\");\r\n\t\tdocument.addCreator(\"Lars Vogel\");\r\n\t\tdocument.close();\r\n\t}", "public void editTheirProfile() {\n\t\t\n\t}", "public static void setProfile(Profile profile) {\n Login.profile = profile;\n Login.profile.setUserId(getUserId());\n }", "private CIProperties getPdfProperties() {\n CIProperties pdfProps = new CIProperties();\n pdfProps.put(\"RESPONSE\",\"HTTP/1.0 200 OK\");\n pdfProps.put(\"Date\", \"Fri, 06 Apr 2012 18:22:49 GMT\");\n pdfProps.put(\"Server\", \"Apache/2.2.3 (CentOS)\");\n pdfProps.put(\"X-Powered-By\", \"PHP/5.2.17\");\n pdfProps.put(\"Expires\", \"Thu, 19 Nov 1981 08:52:00 GMT\");\n pdfProps.put(\"Cache-Control\", \"no-store, no-cache, must-revalidate, post-check=0, pre-check=0\");\n pdfProps.put(\"Pragma\", \"no-cache\");\n pdfProps.put(\"X-Lockss-content-type\", \"application/pdf; charset=UTF-8\");\n pdfProps.put(\"X-Cache\", \"MISS from lockss.org\");\n pdfProps.put(\"X-Cache-Lookup\", \"MISS from lockss.org:8888\");\n pdfProps.put(\"Via\", \"1.1 lockss.org:8888 (squid/2.7.STABLE7)\");\n pdfProps.put(\"Connection\", \"close\");\n return pdfProps;\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "@Test\n void testAcroFormDefaultFonts() throws IOException\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try (PDDocument doc = new PDDocument())\n {\n PDPage page = new PDPage(PDRectangle.A4);\n doc.addPage(page);\n PDAcroForm acroForm2 = new PDAcroForm(doc);\n doc.getDocumentCatalog().setAcroForm(acroForm2);\n PDResources defaultResources = acroForm2.getDefaultResources();\n assertNull(defaultResources);\n defaultResources = new PDResources();\n acroForm2.setDefaultResources(defaultResources);\n assertNull(defaultResources.getFont(COSName.HELV));\n assertNull(defaultResources.getFont(COSName.ZA_DB));\n\n // getting AcroForm sets the two fonts\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n assertNotNull(defaultResources.getFont(COSName.HELV));\n assertNotNull(defaultResources.getFont(COSName.ZA_DB));\n\n // repeat with a new AcroForm (to delete AcroForm cache) and thus missing /DR\n doc.getDocumentCatalog().setAcroForm(new PDAcroForm(doc));\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n \n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n doc.save(baos);\n }\n try (PDDocument doc = Loader.loadPDF(baos.toByteArray()))\n {\n PDAcroForm acroForm2 = doc.getDocumentCatalog().getAcroForm();\n PDResources defaultResources = acroForm2.getDefaultResources();\n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n // make sure that font wasn't overwritten\n assertTrue(helv instanceof PDType1Font);\n assertTrue(zadb instanceof PDType1Font);\n PDType1Font helvType1 = (PDType1Font) helv;\n PDType1Font zadbType1 = (PDType1Font) zadb;\n assertEquals(FontName.HELVETICA.getName(), helv.getName());\n assertEquals(FontName.ZAPF_DINGBATS.getName(), zadb.getName());\n assertNull(helvType1.getType1Font());\n assertNull(zadbType1.getType1Font());\n }\n }", "public static void writeUserProfile(Profile profile) throws IOException {\n\n try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(USER_PROFILE));\n\n CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL.withHeader(\"firstName\",\"lastName\",\"email\",\"password\",\"phoneNumber\",\"insuranceCompanyName\",\"insuranceCompanyFax\", \"insuranceCompanyEmail\"));\n ) {\n csvPrinter.printRecord(profile.getFirstName().toString(), profile.getLastName(), profile.getEmail(), profile.getPw(), profile.getPhoneNumber(), profile.getInsuranceCompanyName(), profile.getInsuranceCompanyFax(), profile.getInsuranceCompanyEmail());\n csvPrinter.flush();\n }\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "@objid (\"6680b948-597e-4df9-b9a2-de8dc499acb3\")\n void setOwnerProfile(Profile value);", "private void createFile(PonsFileFactory ponsFileFactory, Profile profile){\n moveX(profile);\n ponsFileFactory.setProfile(profile);\n String text = ponsFileFactory.createPonsFile();\n String profileName = profile.getName();\n WriteFile.write(text,pathTextField.getText() + \"/\" + profileName.substring(0,profileName.indexOf(\".\")));\n }", "public void beginProfiling(String name, boolean subProfile){\r\n\t\tif(subProfile){\r\n\t\t\tworld.profiler.startSection(name);\r\n\t\t}else{\r\n\t\t\tworld.profiler.endStartSection(name);\r\n\t\t}\r\n\t}", "public PDStream(COSDocument document) {\n/* 68 */ this.stream = document.createCOSStream();\n/* */ }", "public void setProfiles(HashMap<String, String> profiles) {\n\t\tthis.profiles = profiles;\n\t}", "void setClientProfile(ClientProfile profile)\n throws IOException, SoapException;", "public void setApplicationProfile( String iApplicationProfile )\n {\n mApplicationProfile = iApplicationProfile;\n }", "public void preProcessPDF(Object document) throws IOException, BadElementException, DocumentException {\n Document pdf = (Document) document;\n pdf.open();\n pdf.setPageSize(PageSize.A4);\n\n ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();\n String header = servletContext.getRealPath(\"\") + File.separator + \"resources\" + File.separator + \"img\" + File.separator + \"header.png\";\n\n pdf.add(Image.getInstance(header));\n\n pdf.add(new Paragraph(\"\\n\\n Order placed by: \" + getUserName()));\n pdf.add(new Paragraph(\" Order placed at: \" + getDate().toString()));\n pdf.add(new Paragraph(\"\\n\\n\"));\n\n }", "@Test\n public void testPreSignDocumentIn() throws IOException, GeneralSecurityException\n {\n try ( InputStream resource = getClass().getResourceAsStream(\"document_in.pdf\");\n FileOutputStream os = new FileOutputStream(new File(RESULT_FOLDER, \"document_in-presigned.pdf\")) )\n {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\n Certificate maincertificate = cf.generateCertificate(getClass().getResourceAsStream(\"Samson_aut.cer\"));\n Certificate[] chain = new Certificate[] { maincertificate };\n String hashAlgorithm = \"SHA-256\";\n\n PdfReader reader = new PdfReader(resource);\n PdfSigner signer = new PdfSigner(reader, os, new StampingProperties());\n signer.setFieldName(\"certification\"); // this field already exists\n signer.setCertificationLevel(PdfSigner.CERTIFIED_FORM_FILLING);\n PdfSignatureAppearance sap = signer.getSignatureAppearance();\n sap.setReason(\"Certification of the document\");\n sap.setLocation(\"On server\");\n sap.setCertificate(maincertificate);\n BouncyCastleDigest digest = new BouncyCastleDigest();\n PdfPKCS7 sgn = new PdfPKCS7(null, chain, hashAlgorithm, null, digest,false);\n PreSignatureContainer external = new PreSignatureContainer(PdfName.Adobe_PPKLite,PdfName.Adbe_pkcs7_detached);\n signer.signExternalContainer(external, 8192);\n byte[] hash=external.getHash();\n sgn.getAuthenticatedAttributeBytes(hash, PdfSigner.CryptoStandard.CMS, null, null);\n }\n }", "public void setPages(List<PdfPage> pages) {\n this.pages = pages;\n }", "public AnalysisProfile(){\n\t\tsuper();\n\t\tthis.terms = new HashMap<String, Integer>();\n\t\tthis.sources = new ArrayList<String>();\n\t\tthis.stopWords = new HashSet<String>();\n\t\tthis.yearFrom = -1;\n\t\tthis.yearTo = -1;\n\t\tthis.contextSize = 5;\n\t\tthis.useCompounds = false;\n\t\tthis.useStopwords = true;\n\t\tthis.useOnlyContexts = true;\n\t\tthis.results = new StringBuilder();\n\t\tthis.corpus = new ArrayList<File>();\n\t}", "public void setProfilesLocation(String profilesLocation) {\n this.profilesLocation = profilesLocation;\n }", "public void setProfiling (boolean enable) {\n\tprofiling = enable;\n }", "public abstract Properties getProfileProperties();", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.setContentType(\"application/pdf\");\n\t\tDocument document = new Document();\n\t\t\n try {\n \t//PdfWriter - a class from third party library \n PdfWriter.getInstance(document, response.getOutputStream());\n \n document.open();\n \n document.addTitle(\"MY WEBSITE - Profile Details\");\n \n //create a font object and set size and style\n Font datetime_f = new Font();\n datetime_f.setStyle(Font.ITALIC);\n datetime_f.setSize(8);\n \n //create a paragraph object and set alignment to right\n Paragraph datetime_p = new Paragraph(LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"dd-LLL-uuuu, HH:mm:ss\")), datetime_f);\n datetime_p.setAlignment(Element.ALIGN_RIGHT);\n \n Font sitename_f = new Font();\n sitename_f.setStyle(Font.BOLD);\n sitename_f.setSize(22);\n \n Paragraph sitename_p = new Paragraph(\"MY WEBSITE\", sitename_f);\n sitename_p.setAlignment(Element.ALIGN_CENTER);\n \n //create an empty paragraph, to print empty line\n Paragraph empty_p = new Paragraph(\" \");\n \n Font title_f = new Font();\n title_f.setStyle(Font.BOLD);\n title_f.setSize(18);\n \n Paragraph title_p = new Paragraph(\"Profile Information\", title_f);\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/my_website_db\", \"user1\", \"1111\");\n\t\t\t\n\t\t\t//query user information\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString sql_query = \"SELECT * FROM `usr_accnt` WHERE `usr_unq_name` = '\" + (String)request.getSession().getAttribute(\"UNAME_KEY\") + \"';\";\n\t\t\tResultSet results = stmt.executeQuery(sql_query);\n \n\t\t\t//#if data is found\n\t\t\t//\tcreate paragraph and set the content to PDF\n\t\t\t//#else if no data found\n\t\t\t//\tprint error in PDF\n\t\t\tif(results.next()) {\n\t\t\t\tParagraph firstname_p = new Paragraph(String.format(\"%-20s : %s\", \"First Name\", results.getString(\"usr_firstName\")));\n\t Paragraph lastname_p = new Paragraph(String.format(\"%-20s : %s\", \"Last Name\", results.getString(\"usr_lastName\")));\n\t Paragraph username_p = new Paragraph(String.format(\"%-20s : %s\", \"Username\", results.getString(\"usr_unq_name\")));\n\t Paragraph emailAddress_p = new Paragraph(String.format(\"%-20s : %s\", \"Email Address\", results.getString(\"usr_emailAddress\")));\n\t Paragraph password_p = new Paragraph(String.format(\"%-20s : %s\", \"Password\", results.getString(\"usr_password\")));\n\t Paragraph gender_p = new Paragraph(String.format(\"%-20s : %s\", \"Gender\", results.getString(\"usr_gender\")));\n\t Paragraph country_p = new Paragraph(String.format(\"%-20s : %s\", \"Country\", results.getString(\"usr_country\")));\n\t Paragraph dateOfBirth_p = new Paragraph(String.format(\"%-20s : %s\", \"Date of Birth\", results.getString(\"usr_dateOfBirth\")));\n\t \n\t document.add(datetime_p);\n\t document.add(sitename_p);\n\t document.add(empty_p);\n\t document.add(title_p);\n\t document.add(empty_p);\n\t document.add(firstname_p);\n\t document.add(lastname_p);\n\t document.add(username_p);\n\t document.add(emailAddress_p);\n\t document.add(password_p);\n\t document.add(gender_p);\n\t document.add(country_p);\n\t document.add(dateOfBirth_p);\n\t\t\t} else {\n\t\t\t\tFont err_f = new Font();\n\t\t\t\terr_f.setSize(24);\n\t\t\t\terr_f.setStyle(Font.BOLD);\n\t\t\t\terr_f.setColor(255, 0, 0);\n\t\t\t\t\n\t\t\t\tParagraph err_p = new Paragraph(\"Error occured\", err_f);\n\t\t\t\terr_p.setAlignment(Element.ALIGN_CENTER);\n\t\t\t\t\n\t\t\t\tdocument.add(err_p);\n\t\t\t}\n\t\t\t\n document.close();\n } catch (DocumentException de) {\n throw new IOException(de.getMessage());\n } catch(Exception ex) {\n \tSystem.out.println(\"Exception thrown : \" + ex.toString());\n }\n\t}", "public void setPROFILE_ID(BigDecimal PROFILE_ID) {\r\n this.PROFILE_ID = PROFILE_ID;\r\n }", "private void setSubProfiles(Vector subs)\n {\n subProfiles = subs;\n }", "@Override\n\tpublic void showProfile() {\n\t\t\n\t}", "public void setPropidcard(String propidcard) {\r\n\t\tthis.propidcard = propidcard;\r\n\t}", "public void setProfileText(String profileOwner, String text) {\n\t\tprofiles.put(profileOwner, text);\n\t}", "protected abstract void generateProfileFiles() throws Exception;", "private PDFRenderOption createPDFRenderOption(String servletPath,\n\t\t\tHttpServletRequest request, int pageOverflow, boolean isDesigner,\n\t\t\tboolean isPDF)\n\t{\n\t\tString baseURL = null;\n\t\t// try to get base url from config file\n\t\tif (!isDesigner)\n\t\t\tbaseURL = ParameterAccessor.getBaseURL();\n\n\t\tif (baseURL == null)\n\t\t{\n\t\t\tif (ParameterAccessor.isOpenAsAttachment(request))\n\t\t\t{\n\t\t\t\tbaseURL = request.getScheme() + \"://\" //$NON-NLS-1$\n\t\t\t\t\t\t+ request.getServerName()\n\t\t\t\t\t\t+ \":\" //$NON-NLS-1$\n\t\t\t\t\t\t+ request.getServerPort();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbaseURL = \"\"; //$NON-NLS-1$\t\t\n\t\t\t}\n\t\t}\n\n\t\t// append application context path\n\t\tbaseURL += request.getContextPath();\n\n\t\tPDFRenderOption renderOption = new PDFRenderOption();\n\t\trenderOption.setBaseURL(baseURL);\n\t\tif (servletPath == null || servletPath.length() == 0)\n\t\t{\n\t\t\tservletPath = IBirtConstants.SERVLET_PATH_RUN;\n\t\t}\n\t\trenderOption.setOption(IBirtConstants.SERVLET_PATH, servletPath);\n\t\trenderOption.setSupportedImageFormats(isPDF ? \"PNG;GIF;JPG;BMP;SVG\" : \"PNG;GIF;JPG;BMP\"); //$NON-NLS-1$ //$NON-NLS-2$\n\n\t\t// page overflow setting\n\t\tswitch (pageOverflow)\n\t\t{\n\t\t\tcase IBirtConstants.PAGE_OVERFLOW_AUTO :\n\t\t\t\trenderOption.setOption(PDFRenderOption.PAGE_OVERFLOW,\n\t\t\t\t\t\tInteger.valueOf(PDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES));\n\t\t\t\tbreak;\n\t\t\tcase IBirtConstants.PAGE_OVERFLOW_ACTUAL :\n\t\t\t\trenderOption.setOption(PDFRenderOption.PAGE_OVERFLOW,\n\t\t\t\t\t\tInteger.valueOf(PDFRenderOption.ENLARGE_PAGE_SIZE));\n\t\t\t\tbreak;\n\t\t\tcase IBirtConstants.PAGE_OVERFLOW_FITTOPAGE :\n\t\t\t\trenderOption.setOption(PDFRenderOption.FIT_TO_PAGE,\n\t\t\t\t\t\tBoolean.TRUE);\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\trenderOption.setOption(PDFRenderOption.PAGE_OVERFLOW,\n\t\t\t\t\t\tInteger.valueOf(PDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES));\n\t\t}\n\n\t\t// pagebreak pagination only setting\n\t\t// Bug 238716\n\t\trenderOption.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY,\n\t\t\t\tBoolean.FALSE);\n\n\t\treturn renderOption;\n\t}", "public void testCreate () throws IOException {\n\t PDDocument document = new PDDocument(); \r\n\t \r\n\t //Saving the document\r\n\t document.save(\"./my_doc.pdf\");\r\n\t \r\n\t System.out.println(\"PDF created\"); \r\n\t \r\n\t //Closing the document \r\n\t document.close();\r\n\t}" ]
[ "0.59441936", "0.5735724", "0.5705981", "0.5691618", "0.561974", "0.55401874", "0.5537935", "0.5499265", "0.5482145", "0.53891927", "0.53773", "0.5355078", "0.53353834", "0.52979714", "0.5277453", "0.5269094", "0.5227127", "0.5212124", "0.5192758", "0.51643395", "0.51390254", "0.513099", "0.5128281", "0.5128023", "0.5121567", "0.51157403", "0.5103511", "0.51012295", "0.5084469", "0.50828743", "0.5053778", "0.5026891", "0.5021044", "0.50201946", "0.50195605", "0.50195396", "0.50125176", "0.50064284", "0.4998596", "0.49910203", "0.4969128", "0.4963975", "0.49484202", "0.4947901", "0.4933856", "0.49292433", "0.49232337", "0.4920581", "0.49057448", "0.49056324", "0.49044365", "0.48989546", "0.48780096", "0.48674265", "0.4863903", "0.48600432", "0.4857085", "0.48513037", "0.48503414", "0.48485214", "0.48465493", "0.48422402", "0.48224393", "0.48189098", "0.48179898", "0.48131216", "0.48121995", "0.48002282", "0.4786422", "0.4781904", "0.4779964", "0.47562563", "0.4752748", "0.47513688", "0.47426856", "0.47392136", "0.4738156", "0.47363895", "0.47361517", "0.47260767", "0.47194844", "0.47077307", "0.4706911", "0.47067556", "0.4704399", "0.47009996", "0.46973136", "0.46909034", "0.46908513", "0.46882707", "0.46878195", "0.46864536", "0.46809098", "0.46663615", "0.46655992", "0.46615306", "0.46595323", "0.46454942", "0.4640306", "0.46339163" ]
0.69151914
0
Specify the PDF title, part of the document&39;s metadata.
@javax.annotation.Nullable @ApiModelProperty(value = "Specify the PDF title, part of the document's metadata.") @JsonProperty(JSON_PROPERTY_PDF_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPdfTitle() { return pdfTitle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) { this.title = title; }", "public void setTitle(String title) {\r\n\tthis.title = title;\r\n }", "public void setTitle(String title){\n\t\tthis.title = title;\n\t}", "public void setTitle(String title){\n \tthis.title = title;\n }", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title){\n this.title = title;\n }", "protected void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\r\n _title = title;\r\n }", "public void setTitle(String title) {\n\t\tthis.title = title; \n\t}", "public void setTitle(String title)\n\t{\n\t\tthis.title = title;\n\t}", "public void setTitle(java.lang.String title)\n {\n this.title = title;\n }", "@Override\r\n\tpublic void setTitle(String title) {\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "protected void addTitlePage(Document doc) throws Exception {\n \n \t\tdoc.add(new Paragraph(\"\\n\\n\\n\\n\"));\r\t\t\t\n // data dictionary\n Font font = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 22);\n \t\tParagraph prg = new Paragraph(\"Data Dictionary\", font);\n prg.setAlignment(Element.ALIGN_CENTER);\n doc.add(prg);\n \n doc.add(new Paragraph(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\"));\n \n // full definition\n font = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 14);\n prg = new Paragraph(\"Definition of\", font);\n prg.setAlignment(Element.ALIGN_CENTER);\n doc.add(prg);\n \n // dataset name\n font = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 26);\n prg = new Paragraph(dsName, font);\n \t\tprg.setAlignment(Element.ALIGN_CENTER);\n \t\tdoc.add(prg);\n \t\t\n \t\t// dataset word\n font = FontFactory.getFont(FontFactory.HELVETICA, 14);\n \t\tprg = new Paragraph(\"dataset\", font);\n prg.setAlignment(Element.ALIGN_CENTER);\n doc.add(prg);\n \n \t\tdoc.add(new Paragraph(\"\\n\\n\"));\n \t\t\n \t\t// version\n \t\tprg = new Paragraph();\n \t\tprg.add(new Chunk(\"Version: \", font));\n \t\tprg.add(new Chunk(dsVersion, font));\n \t\tprg.setAlignment(Element.ALIGN_CENTER);\n \t\tdoc.add(prg);\n \t\t\n \t\t// date\n \t\t//prg = new Paragraph(getTitlePageDate());\n \t\t//prg.setAlignment(Element.ALIGN_CENTER);\n \t\t//doc.add(prg);\n \n doc.add(new Paragraph(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\"));\n \n // European Environment Agency\n font = FontFactory.getFont(FontFactory.TIMES_BOLD, 12);\n prg = new Paragraph(\"European Environment Agency\", font);\n prg.setAlignment(Element.ALIGN_CENTER);\n \n if (!Util.voidStr(logo)){\n Image img = Image.getInstance(logo);\n img.setAlignment(Image.LEFT);\n \n prg.add(new Chunk(img, 0, 0));\n }\n \n doc.add(prg);\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n\tthis.title = title;\n}", "public void setTitle(java.lang.Object title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "@Override\n public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\r\n if (title != null) {\r\n this.title = title;\r\n }\r\n else{\r\n System.out.println(\"Not a valid title\");\r\n }\r\n }", "public void setTitle( String title )\n {\n _strTitle = title;\n }", "@Override\n\tpublic void setTitle(java.lang.String title) {\n\t\t_dictData.setTitle(title);\n\t}", "public void setDocumentTitle(String documentTitle) {\n this.documentTitle = documentTitle;\n }", "public void setTitle( String title ) {\n\t\t_title = title;\n\t}", "public void setTitle(final String title)\n {\n this.title = title;\n }", "public void setTitle_(String title_) {\n this.title_ = title_;\n }", "public void setTitle(java.lang.String title);", "public String getDocumentTitle() {\n return this.documentTitle;\n }", "public void setTitle(final String title) {\n this.title = title;\n }", "public void setTitle(Title title) {\r\n this.title = title;\r\n }", "public void setTitle(java.lang.String title)\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(TITLE$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TITLE$2);\n }\n target.setStringValue(title);\n }\n }", "public void setTitle(java.lang.String value) {\n this.title = value;\n }", "private void addMetaData() {\r\n\t\tdocument.open();\r\n\t\tdocument.addTitle(\"My first PDF\");\r\n\t\tdocument.addSubject(\"Using iText\");\r\n\t\tdocument.addKeywords(\"Java, PDF, iText\");\r\n\t\tdocument.addAuthor(\"Lars Vogel\");\r\n\t\tdocument.addCreator(\"Lars Vogel\");\r\n\t\tdocument.close();\r\n\t}", "public void setTitle(final String title) {\n\t\tthis.title = title;\n\t}", "private void setTitle(java.lang.String title) {\n System.out.println(\"setting title \"+title);\n this.title = title;\n }", "@Override\r\n\t\tpublic void setTitle(String title)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "public void prepareTitle()\n {\n DuelTitle title = new DuelTitle();\n addObject(title, 539, 186);\n }", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t\tthis.dirtyAttributes.add(Constants.TITLE);\n\t}", "public void setTitle(String title)\n {\n mTitle = title;\n }", "public void setTitle(String strTitle) { m_strTitle = strTitle; }", "@Element \n public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n mTitle = title;\n }", "private static void addMetaData(Document document) {\n document.addTitle(\"Report\");\n //document.addSubject(\"Using iText\");\n //document.addKeywords(\"Java, PDF, iText\");\n document.addAuthor(\"Illya Barziy\");\n //document.addCreator(\"Lars Vogel\");\n }", "void setTitle(java.lang.String title);", "@Override\r\n\tpublic void getTitle(String title) {\n\t\t\r\n\t}", "public void setTitle(String title) {\n mTitle = title;\n }", "public void setMetaTitle(final LocalizedString metaTitle);", "public void setTitle(String title);", "public void setTitle(String title);", "public void setTitle(String title);", "public void setTitle(String title) {\n this.title = title;\n etvTitle.setText(title);\n }", "@Override\n\tpublic void setTitle(String title) {\n\t\t\n\t}", "private void setTitle(String userTitle){\n title = userTitle;\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }" ]
[ "0.6875879", "0.6875879", "0.68482125", "0.68482125", "0.68482125", "0.68482125", "0.6835868", "0.68356794", "0.6829921", "0.6821631", "0.681519", "0.681519", "0.681519", "0.681519", "0.681519", "0.6810807", "0.6810807", "0.6810807", "0.68034434", "0.68034434", "0.67990047", "0.6797943", "0.67971313", "0.6789249", "0.6788985", "0.6785553", "0.67796665", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.6775794", "0.676338", "0.67631507", "0.67575806", "0.6756063", "0.67553836", "0.67553836", "0.67553836", "0.6751672", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67464405", "0.67312205", "0.67255116", "0.67232114", "0.67162573", "0.66808265", "0.66795284", "0.66738254", "0.664568", "0.66189235", "0.6616482", "0.6610007", "0.6608535", "0.6608161", "0.6598191", "0.6587052", "0.65651083", "0.65648925", "0.65547794", "0.6540818", "0.6539023", "0.653598", "0.6523979", "0.65194315", "0.65189254", "0.65139544", "0.65059334", "0.6502766", "0.64810854", "0.64661217", "0.64661217", "0.64661217", "0.64454365", "0.6437755", "0.6432237", "0.64320785", "0.64320785", "0.64320785", "0.64320785" ]
0.68861717
0
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(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 }" ]
[ "0.7884551", "0.7549554", "0.74972165" ]
0.74614793
93
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
public CreateHashDepositRequest(CreateHashDepositRequest source) { if (source.EvidenceName != null) { this.EvidenceName = new String(source.EvidenceName); } if (source.EvidenceHash != null) { this.EvidenceHash = new String(source.EvidenceHash); } if (source.BusinessId != null) { this.BusinessId = new String(source.BusinessId); } if (source.EvidenceDescription != null) { this.EvidenceDescription = new String(source.EvidenceDescription); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void set(String key, Object value);", "void set(K key, V value);", "public setKeyValue_args(setKeyValue_args other) {\n if (other.isSetKey()) {\n this.key = other.key;\n }\n if (other.isSetValue()) {\n this.value = other.value;\n }\n }", "public abstract void set(String key, T data);", "Object put(Object key, Object value);", "public native Map<K, V> set(K key, V value);", "@Test\n public void testSet() {\n Assert.assertTrue(map.set(\"key-1\", \"value-1\", 10));\n Assert.assertTrue(map.set(\"key-1\", \"value-2\", 10));\n Assert.assertTrue(map.set(\"key-2\", \"value-1\", 10));\n }", "private void setKeySet(OwnSet<K> st){\n this.keySet = st; \n }", "void set(K k, V v) throws OverflowException;", "public Value put(Key key, Value thing) ;", "@Test\n\tpublic void testPutAccessReodersElement() {\n\t\tmap.put(\"key1\", \"value1\");\n\n\t\tSet<String> keySet = map.keySet();\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key1\",\n\t\t\tkeySet.iterator().next());\n\n\t\t// move 2 to the top/front\n\t\tmap.put(\"key2\", \"value2\");\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key2\",\n\t\t\tkeySet.iterator().next());\n\t}", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "final <T> void set(String key, T value) {\n set(key, value, false);\n }", "public void setObject(final String key, final Object value)\r\n {\r\n if (key == null)\r\n {\r\n throw new NullPointerException();\r\n }\r\n if (value == null)\r\n {\r\n helperObjects.remove(key);\r\n }\r\n else\r\n {\r\n helperObjects.put(key, value);\r\n }\r\n }", "@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }", "@Test\n public void keySetTest()\n {\n map.putAll(getAMap());\n assertNotNull(map.keySet());\n }", "@Override\n public V put(K key, V value) {\n if (!containsKey(key)) {\n keys.add(key);\n }\n\n return super.put(key, value);\n }", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "public void setValue(K key, V value);", "public Value set(Value key, Value value) {\n\t\tif (get(key) != null)\n\t\t\tput(key, value);\n\t\telse if (parent != null)\n\t\t\tparent.put(key, value);\n\t\telse\n\t\t\tput(key, value);\n\t\treturn value;\n\t}", "final void set(String key, String value) {\n set(key, value, false);\n }", "void put(String key, Object obj);", "public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }", "private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}", "void put(String key, Object value);", "Object put(Object key, Object value) throws NullPointerException;", "public void testNormalKeySet()\r\n throws Exception\r\n {\r\n try\r\n {\r\n SCOMapTests.checkKeySet(pmf,\r\n HashMap1.class,\r\n ContainerItem.class,\r\n String.class);\r\n }\r\n finally\r\n {\r\n clean(HashMap1.class);\r\n clean(ContainerItem.class);\r\n }\r\n }", "@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }", "@Override\n public V put(K key, V value) {\n reverseMap.put(value, key);\n return super.put(key, value);\n }", "public void testSet(){\n stringRedisTemplate.opsForSet().add(\"set-key\",\"a\",\"b\",\"c\");\n //srem set-key c d\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n //scard set-key\n stringRedisTemplate.opsForSet().size(\"set-key\");\n //smembers set-key\n stringRedisTemplate.opsForSet().members(\"set-key\");\n //smove set-key set-key2 a\n stringRedisTemplate.opsForSet().move(\"set-key\",\"a\",\"set-key2\");\n stringRedisTemplate.opsForSet().move(\"set-key\",\"c\",\"set-key2\");\n\n //sadd skey1 a b c d\n stringRedisTemplate.opsForSet().add(\"skey1\",\"a\",\"b\",\"c\",\"d\");\n //sadd skey2 c d e f\n stringRedisTemplate.opsForSet().add(\"skey2\",\"c\",\"d\",\"e\",\"f\");\n //sdiff skey1 skey2 //存在与skey1中不存在与skey2中, a b\n stringRedisTemplate.opsForSet().difference(\"skey1\",\"skey2\");\n //sinter skey1 skey2 // c d\n stringRedisTemplate.opsForSet().intersect(\"skey1\",\"skey2\");\n //sunion skey1 skey2 // a b c d e f\n stringRedisTemplate.opsForSet().union(\"skey1\",\"skey2\");\n }", "protected abstract void put(K key, V value);", "protected abstract void _set(String key, Object obj, Date expires);", "Set getLocalKeySet();", "void setObjectKey(String objectKey);", "String set(K key, V value, SetOption setOption, long expirationTime, TimeUnit timeUnit);", "public Object putTransient(Object key, Object value);", "public JbootVoModel set(String key, Object value) {\n super.put(key, value);\n return this;\n }", "public abstract void Put(WriteOptions options, Slice key, Slice value) throws IOException, BadFormatException, DecodeFailedException;", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "@Override\r\n\tpublic void putObject(Object key, Object value) {\n\t\t\r\n\t}", "public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}", "public MapVS(SetVS<T> keys, Map<K, V> entries) {\n this.keys = keys;\n this.entries = entries;\n this.concreteHash = computeConcreteHash();\n }", "void put(Object indexedKey, Object key);", "public abstract V put(K key, V value);", "void setKey(K key);", "@Override\n\tpublic void put(S key, T val) {\n\t\t\n\t}", "public void set(String key, Object value)\n {\n if (value == null) remove(key);\n else if (value instanceof Map)\n {\n DataSection section = createSection(key);\n Map map = (Map) value;\n for (Object k : map.keySet())\n {\n section.set(k.toString(), map.get(k));\n }\n }\n else\n {\n data.put(key, value);\n if (!keys.contains(key)) keys.add(key);\n }\n }", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public void attach(Object key, Object value);", "public static interface SetFilter extends KeyValueFilter {\r\n\t\tObject put(String name, Object value);\r\n\t}", "void put(K key, V value);", "void put(K key, V value);", "public void testCache() {\n MethodKey m = new MethodKey(\"aclass\", \"amethod\", new Object[]{1, \"fads\", new Object()});\n String mValue = \"my fancy value\";\n MethodKey m1 = new MethodKey(\"aclass\", \"amethod1\", new Object[]{1, \"fads\", new Object()});\n String mValue1 = \"my fancy value1\";\n MethodKey m2 = new MethodKey(\"aclass\", \"amethod2\", new Object[]{1, \"fads\", new Object()});\n String mValue2 = \"my fancy value2\";\n\n GenericCache.setValue(m, mValue);\n GenericCache.setValue(m1, mValue1);\n GenericCache.setValue(m2, mValue2);\n\n assertEquals(GenericCache.getValue(m), mValue);\n assertEquals(GenericCache.getValue(m1), mValue1);\n assertEquals(GenericCache.getValue(m2), mValue2);\n }", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "public void set(K key, V value)\n {\n // If there are too many entries, expand the table.\n if (this.size > (this.buckets.length * LOAD_FACTOR))\n {\n expand();\n } // if there are too many entries\n // Find out where the key belongs.\n int index = this.find(key);\n // Create a new association list, if necessary.\n if (buckets[index] == null)\n {\n this.buckets[index] = new AssociationList<K, V>();\n } // if (buckets[index] == null)\n // Add the entry.\n AssociationList<K, V> bucket = this.get(index);\n int oldsize = bucket.size;\n bucket.set(key, value);\n // Update the size\n this.size += bucket.size - oldsize;\n }", "public void setKey(K newKey) {\n this.key = newKey;\n }", "@Override\n\tpublic void set(K key, List<V> value) {\n\t\t\n\t}", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "public void setKey (K k) {\n key = k;\n }", "public void setItemCollection(HashMap<String, Item> copy ){\n \titemCollection.putAll(copy);\r\n }", "public void put(Key key, Value val);", "public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }", "ISObject put(String key, ISObject stuff) throws UnexpectedIOException;", "public void put(Comparable key, Stroke stroke) {\n/* 120 */ ParamChecks.nullNotPermitted(key, \"key\");\n/* 121 */ this.store.put(key, stroke);\n/* */ }", "public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }", "public V put(K key, V value) throws InvalidKeyException;", "@SuppressWarnings(\"resource\")\n @Test\n public void testClone() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127625049L), 88,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"18fa817e-9d24-4344-a79a-ab19db23016c\", -15,\n \"7b9ca8ca-2f09-4496-b67e-f3a146e5c741\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127627362L));\n ApiKey apikey2 = apikey1.clone();\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }", "public final void set(final String key, final Object value) {\n try {\n synchronized (jo) {\n if (value == null) {\n jo.remove(key);\n } else {\n jo.put(key, value);\n }\n }\n } catch (JSONException e) {\n }\n }", "@Test\n public void testPutAll_Existing() {\n Map<String, String> toAdd = fillMap(1, 10, \"\", \"Old \");\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10, \"\", \"New \");\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n for (String k : toAdd.keySet()) {\n String old = toAdd.get(k);\n String upd = toUpdate.get(k);\n\n verify(helper).fireReplace(entry(k, old), entry(k, upd));\n }\n verifyNoMoreInteractions(helper);\n }", "V put(K key, V value);", "public T set(T obj);", "public boolean put(String key, String value);", "void put(String key, String value) throws StorageException, ValidationException, KeyValueStoreException;", "public void set(R key, Collection<S> value){\n map.remove(key);\n map.put(key, Collections.synchronizedList(Sugar.listFromCollections(value)));\n }", "@Before\r\n public void test_change(){\r\n HashTable<String,String> table = new HashTable<>(1);\r\n MySet<String> s = (MySet<String>) table.keySet();\r\n table.put(\"AA\",\"BB\");\r\n table.put(\"AA\",\"CC\");\r\n assertTrue(s.contains(\"AA\"));\r\n table.remove(\"AA\");\r\n assertFalse(s.contains(\"AA\"));\r\n }", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public boolean put( KEY key, OBJECT object );", "boolean setValue(String type, String key, String value);", "public Set<V> put(K key, Collection<V> set) {\n // Remove any possibly existing prior association with the key\n Set<V> result = remove(key);\n\n // Note: The second argument is effectless, as we cannot encounter item type errors here\n NavigableSet<V> navSet = createNavigableSet(set, true);\n Iterator<V> it = navSet.iterator();\n\n SetTrieNode currentNode = superRootNode;\n while(it.hasNext()) {\n V v = it.next();\n\n SetTrieNode nextNode = currentNode.nextValueToChild == null ? null : currentNode.nextValueToChild.get(v);\n if(nextNode == null) {\n nextNode = new SetTrieNode(nextId++, currentNode, v);\n if(currentNode.nextValueToChild == null) {\n currentNode.nextValueToChild = new TreeMap<>(comparator);\n }\n currentNode.nextValueToChild.put(v, nextNode);\n }\n currentNode = nextNode;\n }\n\n if(currentNode.keyToSet == null) {\n currentNode.keyToSet = new HashMap<>();\n }\n\n currentNode.keyToSet.put(key, navSet);\n\n keyToNode.put(key, currentNode);\n\n return result;\n }", "public K setKey(K key);", "@SuppressWarnings(\"unchecked\")\n\tpublic Object clone() {\n\t\tLongOpenHashSet c;\n\t\ttry {\n\t\t\tc = (LongOpenHashSet) super.clone();\n\t\t} catch (CloneNotSupportedException cantHappen) {\n\t\t\tthrow new InternalError();\n\t\t}\n\t\tc.key = key.clone();\n\t\tc.state = state.clone();\n\t\treturn c;\n\t}", "Set keySet(final TCServerMap map) throws AbortedOperationException;", "@Test\n public void testBackdoorModificationSameKey()\n {\n testBackdoorModificationSameKey(this);\n }", "public IDataKey clone() {\n return new IDataKey(this);\n }", "boolean canSet(String key);", "public abstract void copyFrom(KeyedString src);", "@Override\n public V put(K key, V value) {\n if ((key == null) || (value == null)) {\n logger.warn(\"NULL key or value key = \" + key + \". value = \" + value);\n System.out.println(StringUtils.join(Thread.currentThread().getStackTrace(), \"\\n\"));\n return null;\n }\n\n // If this map is supposed to be case insensitive, uppercase the key before putting it\n // in the map\n if (caseInsensitive && key instanceof String) {\n return super.put(((K) key.toString().toUpperCase()), value);\n } else {\n return super.put(key, value);\n }\n }", "public void set(String key, String value){\n\t\tif(first == null){\n\t\t\tfirst = new ListMapEntry(key, value);\n\t\t}\n\t\tListMapEntry temp = first;\n\t\tListMapEntry prev = null;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\tprev = temp;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\tprev.setNext(new ListMapEntry(key, value));\n\t\t}\n\t\telse{\n\t\t\ttemp.setValue(value);\n\t\t}\n\t}", "V put(final K key, final V value);", "public void set(String key, Object obj) {\n options.put(key, obj);\n }", "boolean put(K key, V value);", "@Override\n\tpublic void put(Object key, Object val) {\n\t\tif(st[hash(key)].size()>=k)\n\t\t\tst[hash(key)].clear();\n\t\tst[hash(key)].put(key, st[hash(key)].size());\n\t}", "protected abstract boolean _setIfAbsent(String key, Object value, Date expires);", "@Override\n public void putValue(String key, Object value) {\n\n }", "public DelegateAbstractHashMap(AbstractHashSet set) {\n\t\t\tsuper();\n\t\t\tthis.set = set;\n\t\t}", "public void changeKey(String key, Object newValue){\n try {\n myJSON.put(key, newValue);\n writeToFile();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void put(String key, T value);", "@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }", "@Test\n public void testPutAll_ExistingNoChange() {\n Map<String, String> toAdd = fillMap(1, 10);\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10);\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n verifyZeroInteractions(helper);\n }", "String setKey(String newKey);", "public void set(String key, String value) {\n if (key.indexOf('=') != -1 || key.indexOf(';') != -1) {\n Log.e(TAG, \"Key \\\"\" + key + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n if (value.indexOf('=') != -1 || value.indexOf(';') != -1) {\n Log.e(TAG, \"Value \\\"\" + value + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n\n mMap.put(key, value);\n }" ]
[ "0.64388937", "0.6414371", "0.61444044", "0.61156267", "0.6094292", "0.6080913", "0.6040615", "0.5989993", "0.59726274", "0.5955383", "0.58388764", "0.582644", "0.57894206", "0.570459", "0.570268", "0.5688108", "0.56873775", "0.56764096", "0.56074274", "0.5588439", "0.5580588", "0.5570518", "0.5559195", "0.5552479", "0.55491745", "0.5533696", "0.5528432", "0.5511892", "0.5497226", "0.54898083", "0.5483016", "0.54664975", "0.54312867", "0.54259664", "0.54201674", "0.54139125", "0.54094195", "0.5377641", "0.53756416", "0.537434", "0.5374193", "0.53575873", "0.53503066", "0.5340675", "0.532952", "0.53216255", "0.52912223", "0.52853614", "0.5283375", "0.52636886", "0.52581084", "0.52581084", "0.52570707", "0.5256116", "0.52559066", "0.52418405", "0.5236526", "0.5234868", "0.52289414", "0.52265954", "0.52253354", "0.52167624", "0.5216043", "0.52013034", "0.5194698", "0.51887155", "0.5182965", "0.51810867", "0.51773274", "0.51761645", "0.51761436", "0.5174917", "0.5173235", "0.51695335", "0.51352525", "0.513152", "0.5129291", "0.5126512", "0.5123841", "0.5121784", "0.5120405", "0.5120156", "0.5103098", "0.5102452", "0.51023054", "0.50996727", "0.5099243", "0.509026", "0.5075119", "0.5068885", "0.5065515", "0.50634414", "0.5050424", "0.5027415", "0.5023098", "0.5021342", "0.5020198", "0.50191915", "0.50152", "0.50150913", "0.50132865" ]
0.0
-1